Skip to content

Commit 846651e

Browse files
Shenwei Wanggregkh
authored andcommitted
serial: fsl_lpuart: RS485 RTS polariy is inverse
The setting of RS485 RTS polarity is inverse in the current driver. When the property of 'rs485-rts-active-low' is enabled in the dts node, the RTS signal should be LOW during sending. Otherwise, if there is no such a property, the RTS should be HIGH during sending. Fixes: 03895cf ("tty: serial: fsl_lpuart: Add support for RS-485") Cc: stable <stable@kernel.org> Signed-off-by: Nicolas Diaz <nicolas.diaz@nxp.com> Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com> Link: https://lore.kernel.org/r/20220805144529.604856-1-shenwei.wang@nxp.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 566f9c9 commit 846651e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/tty/serial/fsl_lpuart.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,9 +1394,9 @@ static int lpuart_config_rs485(struct uart_port *port, struct ktermios *termios,
13941394
* Note: UART is assumed to be active high.
13951395
*/
13961396
if (rs485->flags & SER_RS485_RTS_ON_SEND)
1397-
modem &= ~UARTMODEM_TXRTSPOL;
1398-
else if (rs485->flags & SER_RS485_RTS_AFTER_SEND)
13991397
modem |= UARTMODEM_TXRTSPOL;
1398+
else if (rs485->flags & SER_RS485_RTS_AFTER_SEND)
1399+
modem &= ~UARTMODEM_TXRTSPOL;
14001400
}
14011401

14021402
writeb(modem, sport->port.membase + UARTMODEM);

0 commit comments

Comments
 (0)