summaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorDimitris Lampridis <dlampridis@logikonlabs.com>2014-03-13 14:11:47 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-03-18 00:23:08 +0100
commit3a13884abea08a5043b98d9374486ec859d1e03a (patch)
treecbcef87f044116fcc7dbbcf5df42c7761f9f0076 /drivers/tty
parenttty/serial: omap: fix RX interrupt enable/disable in half-duplex TX (diff)
downloadlinux-3a13884abea08a5043b98d9374486ec859d1e03a.tar.xz
linux-3a13884abea08a5043b98d9374486ec859d1e03a.zip
tty/serial: omap: empty the RX FIFO at the end of half-duplex TX
Provided that the SER_RS485_RX_DURING_TX flag is not set, empty the RX FIFO to prevent reading back the transmitted data. Signed-off-by: Dimitris Lampridis <dlampridis@logikonlabs.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/omap-serial.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 65abea2c6e47..dd8b1a5458ff 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -342,6 +342,12 @@ static void serial_omap_stop_tx(struct uart_port *port)
if ((up->rs485.flags & SER_RS485_ENABLED) &&
!(up->rs485.flags & SER_RS485_RX_DURING_TX)) {
+ /*
+ * Empty the RX FIFO, we are not interested in anything
+ * received during the half-duplex transmission.
+ */
+ serial_out(up, UART_FCR, up->fcr | UART_FCR_CLEAR_RCVR);
+ /* Re-enable RX interrupts */
up->ier |= UART_IER_RLSI | UART_IER_RDI;
up->port.read_status_mask |= UART_LSR_DR;
serial_out(up, UART_IER, up->ier);