Commit 62a4b3d2 authored by Ilpo Järvinen's avatar Ilpo Järvinen Committed by Greg Kroah-Hartman

serial: 8250_dwlib: Fill in rs485_supported

Add information on supported serial_rs485 features. When the driver is
using em485, take advantage of serial8250_em485_supported.
Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20220606100433.13793-7-ilpo.jarvinen@linux.intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 499b1160
...@@ -149,6 +149,11 @@ static bool dw8250_detect_rs485_hw(struct uart_port *p) ...@@ -149,6 +149,11 @@ static bool dw8250_detect_rs485_hw(struct uart_port *p)
return reg; return reg;
} }
static const struct serial_rs485 dw8250_rs485_supported = {
.flags = SER_RS485_ENABLED | SER_RS485_RX_DURING_TX | SER_RS485_RTS_ON_SEND |
SER_RS485_RTS_AFTER_SEND,
};
void dw8250_setup_port(struct uart_port *p) void dw8250_setup_port(struct uart_port *p)
{ {
struct dw8250_port_data *pd = p->private_data; struct dw8250_port_data *pd = p->private_data;
...@@ -159,8 +164,10 @@ void dw8250_setup_port(struct uart_port *p) ...@@ -159,8 +164,10 @@ void dw8250_setup_port(struct uart_port *p)
pd->hw_rs485_support = dw8250_detect_rs485_hw(p); pd->hw_rs485_support = dw8250_detect_rs485_hw(p);
if (pd->hw_rs485_support) { if (pd->hw_rs485_support) {
p->rs485_config = dw8250_rs485_config; p->rs485_config = dw8250_rs485_config;
p->rs485_supported = &dw8250_rs485_supported;
} else { } else {
p->rs485_config = serial8250_em485_config; p->rs485_config = serial8250_em485_config;
p->rs485_supported = &serial8250_em485_supported;
up->rs485_start_tx = serial8250_em485_start_tx; up->rs485_start_tx = serial8250_em485_start_tx;
up->rs485_stop_tx = serial8250_em485_stop_tx; up->rs485_stop_tx = serial8250_em485_stop_tx;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment