aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/serial
diff options
context:
space:
mode:
authorJohan Hovold2021-01-21 11:29:20 +0100
committerJohan Hovold2021-01-26 16:16:50 +0100
commit465d3b3a0d311680d0e42258fd25454433667e9d (patch)
treead8c06f6138c34898bd41690b0d2270ea0b6bbd7 /drivers/usb/serial
parent736c09316c905622c548582a47eaa2c8c542b520 (diff)
USB: serial: xr: fix gpio-mode handling
Fix the gpio-mode handling so that all the pins are under driver control (i.e. in gpio mode) when hardware flow control is disabled. This is specifically needed to be able to control RTS. Fixes: c2d405aa86b4 ("USB: serial: add MaxLinear/Exar USB to Serial driver") Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/xr_serial.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/usb/serial/xr_serial.c b/drivers/usb/serial/xr_serial.c
index fc727f4283f2..183731cd2ef7 100644
--- a/drivers/usb/serial/xr_serial.c
+++ b/drivers/usb/serial/xr_serial.c
@@ -408,14 +408,11 @@ static void xr_set_flow_mode(struct tty_struct *tty,
if (ret)
return;
+ /* Set GPIO mode for controlling the pins manually by default. */
+ gpio_mode &= ~XR21V141X_UART_MODE_GPIO_MASK;
+
if (C_CRTSCTS(tty)) {
dev_dbg(&port->dev, "Enabling hardware flow ctrl\n");
-
- /*
- * RTS/CTS is the default flow control mode, so set GPIO mode
- * for controlling the pins manually by default.
- */
- gpio_mode &= ~XR21V141X_UART_MODE_GPIO_MASK;
gpio_mode |= XR21V141X_UART_MODE_RTS_CTS;
flow = XR21V141X_UART_FLOW_MODE_HW;
} else if (I_IXON(tty)) {