aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlpo Järvinen <[email protected]>2022-07-04 12:45:15 +0300
committerGreg Kroah-Hartman <[email protected]>2022-07-08 15:14:09 +0200
commit8bec874f84d826288a6cfa6acc683d15c218d78c (patch)
tree11f4a7cda7d55cf10a7ac0c81380fb82c7295bf3
parent0139da50dc53f0ce2804e83566d290c7e626fd17 (diff)
serial: RS485 termination is supported if DT provides one
When DT provides rs485-term, set termination flag as supported. Reviewed-by: Lino Sanfilippo <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/tty/serial/serial_core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index a9cf1044a9fa..1db44cde76f6 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -3409,6 +3409,8 @@ int uart_get_rs485_mode(struct uart_port *port)
port->rs485_term_gpio = NULL;
return dev_err_probe(dev, ret, "Cannot get rs485-term-gpios\n");
}
+ if (port->rs485_term_gpio)
+ port->rs485_supported.flags |= SER_RS485_TERMINATE_BUS;
return 0;
}