diff options
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/bfin_5xx.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c index d63fad7363b7..59a221f9ee9c 100644 --- a/drivers/serial/bfin_5xx.c +++ b/drivers/serial/bfin_5xx.c | |||
@@ -73,6 +73,8 @@ static void bfin_serial_tx_chars(struct bfin_serial_port *uart); | |||
73 | 73 | ||
74 | static void bfin_serial_mctrl_check(struct bfin_serial_port *uart); | 74 | static void bfin_serial_mctrl_check(struct bfin_serial_port *uart); |
75 | 75 | ||
76 | static void bfin_serial_reset_irda(struct uart_port *port); | ||
77 | |||
76 | /* | 78 | /* |
77 | * interrupts are disabled on entry | 79 | * interrupts are disabled on entry |
78 | */ | 80 | */ |
@@ -105,6 +107,14 @@ static void bfin_serial_stop_tx(struct uart_port *port) | |||
105 | static void bfin_serial_start_tx(struct uart_port *port) | 107 | static void bfin_serial_start_tx(struct uart_port *port) |
106 | { | 108 | { |
107 | struct bfin_serial_port *uart = (struct bfin_serial_port *)port; | 109 | struct bfin_serial_port *uart = (struct bfin_serial_port *)port; |
110 | struct tty_struct *tty = uart->port.info->port.tty; | ||
111 | |||
112 | /* | ||
113 | * To avoid losting RX interrupt, we reset IR function | ||
114 | * before sending data. | ||
115 | */ | ||
116 | if (tty->termios->c_line == N_IRDA) | ||
117 | bfin_serial_reset_irda(port); | ||
108 | 118 | ||
109 | #ifdef CONFIG_SERIAL_BFIN_DMA | 119 | #ifdef CONFIG_SERIAL_BFIN_DMA |
110 | if (uart->tx_done) | 120 | if (uart->tx_done) |
@@ -890,6 +900,20 @@ static int bfin_kgdboc_port_startup(struct uart_port *port) | |||
890 | } | 900 | } |
891 | #endif | 901 | #endif |
892 | 902 | ||
903 | static void bfin_serial_reset_irda(struct uart_port *port) | ||
904 | { | ||
905 | int line = port->line; | ||
906 | unsigned short val; | ||
907 | |||
908 | val = UART_GET_GCTL(&bfin_serial_ports[line]); | ||
909 | val &= ~(IREN | RPOLC); | ||
910 | UART_PUT_GCTL(&bfin_serial_ports[line], val); | ||
911 | SSYNC(); | ||
912 | val |= (IREN | RPOLC); | ||
913 | UART_PUT_GCTL(&bfin_serial_ports[line], val); | ||
914 | SSYNC(); | ||
915 | } | ||
916 | |||
893 | static struct uart_ops bfin_serial_pops = { | 917 | static struct uart_ops bfin_serial_pops = { |
894 | .tx_empty = bfin_serial_tx_empty, | 918 | .tx_empty = bfin_serial_tx_empty, |
895 | .set_mctrl = bfin_serial_set_mctrl, | 919 | .set_mctrl = bfin_serial_set_mctrl, |