Thread (12 messages) 12 messages, 3 authors, 2019-03-29
STALE2653d

[PATCH v2 7/9] serial: atmel_serial: set SER_RS485_DELAY_IN_USEC accordingly

From: Martin Kepplinger <hidden>
Date: 2019-02-21 17:18:51
Also in: linux-devicetree, linux-serial, lkml
Subsystem: microchip at91 serial driver, the rest, tty layer and serial drivers · Maintainers: Richard Genoud, Linus Torvalds, Greg Kroah-Hartman, Jiri Slaby

Unset the SER_RS485_DELAY_IN_USEC flag during rs485 config for
userspace to get the correct setting.

Signed-off-by: Martin Kepplinger <redacted>
---
 drivers/tty/serial/atmel_serial.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 05147fe24343..36ab1c131d36 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -346,6 +346,9 @@ static int atmel_config_rs485(struct uart_port *port,
 
 	port->rs485 = *rs485conf;
 
+	/* delays are in milliseconds */
+	rs485conf->flags &= ~SER_RS485_DELAY_IN_USEC;
+
 	if (rs485conf->flags & SER_RS485_ENABLED) {
 		dev_dbg(port->dev, "Setting UART to RS485\n");
 		atmel_port->tx_done_mask = ATMEL_US_TXEMPTY;
-- 
2.20.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help