Linux Kernels

serial: fsl_lpuart: clear unsupported options in .rs485_config()

This change “serial: fsl_lpuart: clear unsupported options in .rs485_config()” (commit 68c338e) in Linux kernel is authored by Uwe Kleine-König <u.kleine-koenig [at] pengutronix.de> on Tue Jul 18 12:59:40 2017 +0200.

Description of "serial: fsl_lpuart: clear unsupported options in .rs485_config()"

The change “serial: fsl_lpuart: clear unsupported options in .rs485_config()” introduces changes as follows.

serial: fsl_lpuart: clear unsupported options in .rs485_config()

The struct serial_rs485 parameter is both input and output and is
supposed to hold the actually used configuration on return. So clear
unsupported settings.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Linux kernel releases containing commit 68c338e

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "serial: fsl_lpuart: clear unsupported options in .rs485_config()"

There are 5 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/tty/serial/fsl_lpuart.c | 5 +++++
 1 file changed, 5 insertions(+)
 
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 5b4721bd70f0..d24270fe3cbe 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -1076,6 +1076,11 @@ static int lpuart_config_rs485(struct uart_port *port,
 		~(UARTMODEM_TXRTSPOL | UARTMODEM_TXRTSE);
 	writeb(modem, sport->port.membase + UARTMODEM);
 
+	/* clear unsupported configurations */
+	rs485->delay_rts_before_send = 0;
+	rs485->delay_rts_after_send = 0;
+	rs485->flags &= ~SER_RS485_RX_DURING_TX;
+
 	if (rs485->flags & SER_RS485_ENABLED) {
 		/* Enable auto RS-485 RTS mode */
 		modem |= UARTMODEM_TXRTSE;

The commit for this change in Linux stable tree is 68c338e (patch).

Last modified: 2020/01/11 09:46