Skip to content

Commit 1a33e33

Browse files
linosanfilippo-kunbusgregkh
authored andcommitted
serial: core: set missing supported flag for RX during TX GPIO
If the RS485 feature RX-during-TX is supported by means of a GPIO set the according supported flag. Otherwise setting this feature from userspace may not be possible, since in uart_sanitize_serial_rs485() the passed RS485 configuration is matched against the supported features and unsupported settings are thereby removed and thus take no effect. Cc: <[email protected]> Fixes: 163f080 ("serial: core: Add option to output RS485 RX_DURING_TX state via GPIO") 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 07c30ea commit 1a33e33

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/tty/serial/serial_core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3649,6 +3649,8 @@ int uart_get_rs485_mode(struct uart_port *port)
36493649
if (IS_ERR(desc))
36503650
return dev_err_probe(dev, PTR_ERR(desc), "Cannot get rs485-rx-during-tx-gpios\n");
36513651
port->rs485_rx_during_tx_gpio = desc;
3652+
if (port->rs485_rx_during_tx_gpio)
3653+
port->rs485_supported.flags |= SER_RS485_RX_DURING_TX;
36523654

36533655
return 0;
36543656
}

0 commit comments

Comments
 (0)