Skip to contentSkip to conversation

serial: fsl_lpuart: fix RS485 RTS polariy inverse issue

PATCH New Shenwei Wang 1 participant 1 message Feb 7, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial: fsl_lpuart: fix RS485 RTS polariy inverse issue

The previous 'commit 846651eca073 ("serial: fsl_lpuart: RS485 RTS polariy is inverse")' only fixed the inverse issue on lpuart 8bit platforms.

This is a follow-up patch to fix the RS485 polarity inverse issue on lpuart 32bit platforms.

Fixes 03895cf41d18 ("tty: serial: fsl_lpuart: Add support for RS-485")
---
 drivers/tty/serial/fsl_lpuart.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/tty/serial/fsl_lpuart.c +2 -2
index 5e69fb73f570..de606af200a8 100644
@@ -1387,9 +1387,9 @@ static int lpuart32_config_rs485(struct uart_port *port, struct ktermios *termio
 		 * 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;
 	}
 
 	lpuart32_write(&sport->port, modem, UARTMODIR);
Signature · 1 line
2.34.1