Skip to content

Commit

Permalink
tty/serial: omap: empty the RX FIFO at the end of half-duplex TX
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dimitris Lampridis authored and Greg Kroah-Hartman committed Mar 17, 2014
1 parent cab53dc commit 3a13884
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/tty/serial/omap-serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3a13884

Please sign in to comment.