Skip to content

Commit fc64f7a

Browse files
aford173gregkh
authored andcommitted
serial: 8250_omap: Fix gpio check for auto RTS/CTS
There are two checks to see if the manual gpio is configured, but these the check is seeing if the structure is NULL instead it should check to see if there are CTS and/or RTS pins defined. This patch uses checks for those individual pins instead of checking for the structure itself to restore auto RTS/CTS. Signed-off-by: Adam Ford <[email protected]> Reviewed-by: Yegor Yefremov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 37e3ab0 commit fc64f7a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/tty/serial/8250/8250_omap.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static void omap8250_set_mctrl(struct uart_port *port, unsigned int mctrl)
141141

142142
serial8250_do_set_mctrl(port, mctrl);
143143

144-
if (!up->gpios) {
144+
if (!mctrl_gpio_to_gpiod(up->gpios, UART_GPIO_RTS)) {
145145
/*
146146
* Turn off autoRTS if RTS is lowered and restore autoRTS
147147
* setting if RTS is raised
@@ -456,7 +456,8 @@ static void omap_8250_set_termios(struct uart_port *port,
456456
up->port.status &= ~(UPSTAT_AUTOCTS | UPSTAT_AUTORTS | UPSTAT_AUTOXOFF);
457457

458458
if (termios->c_cflag & CRTSCTS && up->port.flags & UPF_HARD_FLOW &&
459-
!up->gpios) {
459+
!mctrl_gpio_to_gpiod(up->gpios, UART_GPIO_RTS) &&
460+
!mctrl_gpio_to_gpiod(up->gpios, UART_GPIO_CTS)) {
460461
/* Enable AUTOCTS (autoRTS is enabled when RTS is raised) */
461462
up->port.status |= UPSTAT_AUTOCTS | UPSTAT_AUTORTS;
462463
priv->efr |= UART_EFR_CTS;

0 commit comments

Comments
 (0)