Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a65a2a33 authored by Shenwei Wang's avatar Shenwei Wang Committed by Greg Kroah-Hartman
Browse files

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: 03895cf4 ("tty: serial: fsl_lpuart: Add support for RS-485")
Cc: stable <stable@kernel.org>
Signed-off-by: default avatarNicolas Diaz <nicolas.diaz@nxp.com>
Signed-off-by: default avatarShenwei Wang <shenwei.wang@nxp.com>
Link: https://lore.kernel.org/r/20220805144529.604856-1-shenwei.wang@nxp.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ae5e8d0b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1277,9 +1277,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 */