diff options
-rw-r--r-- | drivers/tty/serial/max310x.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c index 0e0c2740ec7e..aed19c688beb 100644 --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c | |||
@@ -955,15 +955,23 @@ static void max310x_set_termios(struct uart_port *port, | |||
955 | /* Configure flow control */ | 955 | /* Configure flow control */ |
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 | if (termios->c_cflag & CRTSCTS) | 958 | |
959 | port->status &= ~(UPSTAT_AUTOCTS | UPSTAT_AUTORTS | UPSTAT_AUTOXOFF); | ||
960 | |||
961 | if (termios->c_cflag & CRTSCTS) { | ||
962 | /* Enable AUTORTS and AUTOCTS */ | ||
963 | port->status |= UPSTAT_AUTOCTS | UPSTAT_AUTORTS; | ||
959 | flow |= MAX310X_FLOWCTRL_AUTOCTS_BIT | | 964 | flow |= MAX310X_FLOWCTRL_AUTOCTS_BIT | |
960 | MAX310X_FLOWCTRL_AUTORTS_BIT; | 965 | MAX310X_FLOWCTRL_AUTORTS_BIT; |
966 | } | ||
961 | if (termios->c_iflag & IXON) | 967 | if (termios->c_iflag & IXON) |
962 | flow |= MAX310X_FLOWCTRL_SWFLOW3_BIT | | 968 | flow |= MAX310X_FLOWCTRL_SWFLOW3_BIT | |
963 | MAX310X_FLOWCTRL_SWFLOWEN_BIT; | 969 | MAX310X_FLOWCTRL_SWFLOWEN_BIT; |
964 | if (termios->c_iflag & IXOFF) | 970 | if (termios->c_iflag & IXOFF) { |
971 | port->status |= UPSTAT_AUTOXOFF; | ||
965 | flow |= MAX310X_FLOWCTRL_SWFLOW1_BIT | | 972 | flow |= MAX310X_FLOWCTRL_SWFLOW1_BIT | |
966 | MAX310X_FLOWCTRL_SWFLOWEN_BIT; | 973 | MAX310X_FLOWCTRL_SWFLOWEN_BIT; |
974 | } | ||
967 | max310x_port_write(port, MAX310X_FLOWCTRL_REG, flow); | 975 | max310x_port_write(port, MAX310X_FLOWCTRL_REG, flow); |
968 | 976 | ||
969 | /* Get baud rate generator configuration */ | 977 | /* Get baud rate generator configuration */ |