Skip to content

Commit 0c2a5f4

Browse files
linosanfilippo-kunbusgregkh
authored andcommitted
serial: 8250_exar: Set missing rs485_supported flag
The UART supports an auto-RTS mode in which the RTS pin is automatically activated during transmission. So mark this mode as being supported even if RTS is not controlled by the driver but the UART. Also the serial core expects now at least one of both modes rts-on-send or rts-after-send to be supported. This is since during sanitization unsupported flags are deleted from a RS485 configuration set by userspace. However if the configuration ends up with both flags unset, the core prints a warning since it considers such a configuration invalid (see uart_sanitize_serial_rs485()). Cc: <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Lino Sanfilippo <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 51f9377 commit 0c2a5f4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/tty/serial/8250/8250_exar.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ static int sealevel_rs485_config(struct uart_port *port, struct ktermios *termio
480480
}
481481

482482
static const struct serial_rs485 generic_rs485_supported = {
483-
.flags = SER_RS485_ENABLED,
483+
.flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND,
484484
};
485485

486486
static const struct exar8250_platform exar8250_default_platform = {
@@ -524,7 +524,8 @@ static int iot2040_rs485_config(struct uart_port *port, struct ktermios *termios
524524
}
525525

526526
static const struct serial_rs485 iot2040_rs485_supported = {
527-
.flags = SER_RS485_ENABLED | SER_RS485_RX_DURING_TX | SER_RS485_TERMINATE_BUS,
527+
.flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND |
528+
SER_RS485_RX_DURING_TX | SER_RS485_TERMINATE_BUS,
528529
};
529530

530531
static const struct property_entry iot2040_gpio_properties[] = {

0 commit comments

Comments
 (0)