lkml.org 
[lkml]   [2021]   [Jan]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 08/10] USB: serial: xr: fix gpio-mode handling
Date
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: a8f54b7bd132 ("USB: serial: add MaxLinear/Exar USB to Serial driver")
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/usb/serial/xr_serial.c | 9 +++------
1 file 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)) {
--
2.26.2
\
 
 \ /
  Last update: 2021-01-21 14:08    [W:0.274 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site