Message ID | 20200318142640.982763-5-heiko@sntech.de |
---|---|
State | New |
Headers | show |
Series | serial: 8250: Add rs485 emulation to 8250_dw | expand |
diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c index e682390ce0de..beab1c22b34d 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c @@ -1068,6 +1068,15 @@ int serial8250_register_8250_port(struct uart_8250_port *up) if (up->dl_write) uart->dl_write = up->dl_write; + if (uart->port.rs485_config && + (uart->port.rs485.flags & SER_RS485_ENABLED)) { + dev_dbg(uart->port.dev, "starting in rs485 mode\n"); + ret = uart->port.rs485_config(&uart->port, + &uart->port.rs485); + if (ret < 0) + goto out_unlock; + } + if (uart->port.type != PORT_8250_CIR) { if (serial8250_isa_config != NULL) serial8250_isa_config(0, &uart->port,