summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShenwei Wang <shenwei.wang@nxp.com>2022-08-05 09:45:29 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-09-15 12:23:50 +0200
commitf114cfe2176a3a5a5a17de55c2478ea924b6dc12 (patch)
tree3799ca60f1831af001eb4393c6007d7c7c346baa
parent473f394953216614087f4179e55cdf0cf616a13b (diff)
downloadlinux-rt-f114cfe2176a3a5a5a17de55c2478ea924b6dc12.tar.gz
serial: fsl_lpuart: RS485 RTS polariy is inverse
commit 846651eca073e2e02e37490a4a52752415d84781 upstream. 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: 03895cf41d18 ("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>
-rw-r--r--drivers/tty/serial/fsl_lpuart.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 62d1e4607912..cbbdb94592ce 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -1106,9 +1106,9 @@ static int lpuart_config_rs485(struct uart_port *port,
* Note: UART is assumed to be active high.
*/
if (rs485->flags & SER_RS485_RTS_ON_SEND)
- modem &= ~UARTMODEM_TXRTSPOL;
- else if (rs485->flags & SER_RS485_RTS_AFTER_SEND)
modem |= UARTMODEM_TXRTSPOL;
+ else if (rs485->flags & SER_RS485_RTS_AFTER_SEND)
+ modem &= ~UARTMODEM_TXRTSPOL;
}
/* Store the new configuration */