diff options
author | Sergey Organov <sorganov@gmail.com> | 2019-07-26 14:52:39 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-09-04 06:43:46 -0400 |
commit | a25aee902e666e8cc41e33754f13c69a979dd67f (patch) | |
tree | 14c9e0ed6c3b1bd9973d43c5494530987515368b | |
parent | 72d819612ae0b080ba141a6959cea138ddc1e330 (diff) |
serial: imx: set_termios(): do not enable autoRTS if RTS is unset
Don't let receiver hardware automatically control RTS output if it
was requested to be inactive.
To ensure this, set_termios() shouldn't set UCR2_CTSC bit if UCR2_CTS
(=TIOCM_RTS) is cleared. Added corresponding check in imx_uart_rts_auto()
to fix this.
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Sergey Organov <sorganov@gmail.com>
Link: https://lore.kernel.org/r/1564167161-3972-2-git-send-email-sorganov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/imx.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 57d6e6ba556e..32f36d86a960 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c | |||
@@ -405,7 +405,12 @@ static void imx_uart_rts_inactive(struct imx_port *sport, u32 *ucr2) | |||
405 | /* called with port.lock taken and irqs caller dependent */ | 405 | /* called with port.lock taken and irqs caller dependent */ |
406 | static void imx_uart_rts_auto(struct imx_port *sport, u32 *ucr2) | 406 | static void imx_uart_rts_auto(struct imx_port *sport, u32 *ucr2) |
407 | { | 407 | { |
408 | *ucr2 |= UCR2_CTSC; | 408 | /* |
409 | * Only let receiver control RTS output if we were not requested to have | ||
410 | * RTS inactive (which then should take precedence). | ||
411 | */ | ||
412 | if (*ucr2 & UCR2_CTS) | ||
413 | *ucr2 |= UCR2_CTSC; | ||
409 | } | 414 | } |
410 | 415 | ||
411 | /* called with port.lock taken and irqs off */ | 416 | /* called with port.lock taken and irqs off */ |