diff options
author | Christoph Vogtländer <c.vogtlaender@sigma-surface-science.com> | 2019-09-04 08:17:46 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-09-05 03:57:44 -0400 |
commit | 7d4f881ff1fb327e96fc36a58c4f0b6482ea453d (patch) | |
tree | 14b27d97b99b74189f04a140bf9cef98f038884d | |
parent | 5a8c296f5362fffc9da5da10eef01cf0b9b4ac7f (diff) |
serial: max310x: turn off transmitter before activating AutoCTS or auto transmitter flow control
As documented in the data-sheet, the transmitter must be disabled before
activating AutoCTS or auto transmitter flow control. Accordingly, the
transmitter must be enabled after AutoCTS or auto transmitter flow
control gets deactivated.
Signed-off-by: Christoph Vogtländer <c.vogtlaender@sigma-surface-science.com>
Link: https://lore.kernel.org/r/20190904121746.4641-1-c.vogtlaender@sigma-surface-science.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/max310x.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c index aed19c688beb..8434bd5a8ec7 100644 --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c | |||
@@ -956,6 +956,15 @@ static void max310x_set_termios(struct uart_port *port, | |||
956 | max310x_port_write(port, MAX310X_XON1_REG, termios->c_cc[VSTART]); | 956 | max310x_port_write(port, MAX310X_XON1_REG, termios->c_cc[VSTART]); |
957 | max310x_port_write(port, MAX310X_XOFF1_REG, termios->c_cc[VSTOP]); | 957 | max310x_port_write(port, MAX310X_XOFF1_REG, termios->c_cc[VSTOP]); |
958 | 958 | ||
959 | /* Disable transmitter before enabling AutoCTS or auto transmitter | ||
960 | * flow control | ||
961 | */ | ||
962 | if (termios->c_cflag & CRTSCTS || termios->c_iflag & IXOFF) { | ||
963 | max310x_port_update(port, MAX310X_MODE1_REG, | ||
964 | MAX310X_MODE1_TXDIS_BIT, | ||
965 | MAX310X_MODE1_TXDIS_BIT); | ||
966 | } | ||
967 | |||
959 | port->status &= ~(UPSTAT_AUTOCTS | UPSTAT_AUTORTS | UPSTAT_AUTOXOFF); | 968 | port->status &= ~(UPSTAT_AUTOCTS | UPSTAT_AUTORTS | UPSTAT_AUTOXOFF); |
960 | 969 | ||
961 | if (termios->c_cflag & CRTSCTS) { | 970 | if (termios->c_cflag & CRTSCTS) { |
@@ -974,6 +983,15 @@ static void max310x_set_termios(struct uart_port *port, | |||
974 | } | 983 | } |
975 | max310x_port_write(port, MAX310X_FLOWCTRL_REG, flow); | 984 | max310x_port_write(port, MAX310X_FLOWCTRL_REG, flow); |
976 | 985 | ||
986 | /* Enable transmitter after disabling AutoCTS and auto transmitter | ||
987 | * flow control | ||
988 | */ | ||
989 | if (!(termios->c_cflag & CRTSCTS) && !(termios->c_iflag & IXOFF)) { | ||
990 | max310x_port_update(port, MAX310X_MODE1_REG, | ||
991 | MAX310X_MODE1_TXDIS_BIT, | ||
992 | 0); | ||
993 | } | ||
994 | |||
977 | /* Get baud rate generator configuration */ | 995 | /* Get baud rate generator configuration */ |
978 | baud = uart_get_baud_rate(port, termios, old, | 996 | baud = uart_get_baud_rate(port, termios, old, |
979 | port->uartclk / 16 / 0xffff, | 997 | port->uartclk / 16 / 0xffff, |