summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLukas Wunner <lukas@wunner.de>2022-11-05 16:46:40 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-11-10 20:14:14 +0300
commit028fcabd8a67196277f907c8ecce8e0bb99b276a (patch)
treee30b21ada0b4297a1cc426983f66dc1fdc373726 /drivers
parente6da7808c955e609b3adf9d18b02f94463616016 (diff)
downloadlinux-028fcabd8a67196277f907c8ecce8e0bb99b276a.tar.xz
serial: ar933x: Deassert Transmit Enable on ->rs485_config()
commit 3a939433ddc1bab98be028903aaa286e5e7461d7 upstream. The ar933x_uart driver neglects to deassert Transmit Enable when ->rs485_config() is invoked. Fix it. Fixes: 9be1064fe524 ("serial: ar933x_uart: add RS485 support") Cc: stable@vger.kernel.org # v5.7+ Cc: Daniel Golle <daniel@makrotopia.org> Reviewed-by: Ilpo JÀrvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Lukas Wunner <lukas@wunner.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/tty/serial/ar933x_uart.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c
index c2be7cf91399..fcbaff894193 100644
--- a/drivers/tty/serial/ar933x_uart.c
+++ b/drivers/tty/serial/ar933x_uart.c
@@ -593,6 +593,11 @@ static int ar933x_config_rs485(struct uart_port *port,
dev_err(port->dev, "RS485 needs rts-gpio\n");
return 1;
}
+
+ if (rs485conf->flags & SER_RS485_ENABLED)
+ gpiod_set_value(up->rts_gpiod,
+ !!(rs485conf->flags & SER_RS485_RTS_AFTER_SEND));
+
port->rs485 = *rs485conf;
return 0;
}