]> git.baikalelectronics.ru Git - kernel.git/commitdiff
serial: RS485 termination is supported if DT provides one
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 4 Jul 2022 09:45:15 +0000 (12:45 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Jul 2022 13:14:09 +0000 (15:14 +0200)
When DT provides rs485-term, set termination flag as supported.

Reviewed-by: Lino Sanfilippo <l.sanfilippo@kunbus.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20220704094515.6831-3-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial_core.c

index a9cf1044a9faa929d3a3d24bf91240469917cf23..1db44cde76f61eb729651dd4bb651c47e17d23ff 100644 (file)
@@ -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;
 }