serial: 8250_fintek: Fill in rs485_supported
Add information on supported serial_rs485 features. Differentiate based on which port is in question. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20220606100433.13793-9-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
59c221f8e1
commit
7078046484
|
@ -424,6 +424,17 @@ static int probe_setup_port(struct fintek_8250 *pdata,
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Only the first port supports delays */
|
||||
static const struct serial_rs485 fintek_8250_rs485_supported_port0 = {
|
||||
.flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND | SER_RS485_RTS_AFTER_SEND,
|
||||
.delay_rts_before_send = 1,
|
||||
.delay_rts_after_send = 1,
|
||||
};
|
||||
|
||||
static const struct serial_rs485 fintek_8250_rs485_supported = {
|
||||
.flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND | SER_RS485_RTS_AFTER_SEND,
|
||||
};
|
||||
|
||||
static void fintek_8250_set_rs485_handler(struct uart_8250_port *uart)
|
||||
{
|
||||
struct fintek_8250 *pdata = uart->port.private_data;
|
||||
|
@ -435,6 +446,10 @@ static void fintek_8250_set_rs485_handler(struct uart_8250_port *uart)
|
|||
case CHIP_ID_F81866:
|
||||
case CHIP_ID_F81865:
|
||||
uart->port.rs485_config = fintek_8250_rs485_config;
|
||||
if (!pdata->index)
|
||||
uart->port.rs485_supported = &fintek_8250_rs485_supported_port0;
|
||||
else
|
||||
uart->port.rs485_supported = &fintek_8250_rs485_supported;
|
||||
break;
|
||||
|
||||
default: /* No RS485 Auto direction functional */
|
||||
|
|
Loading…
Reference in New Issue