[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230928221246.13689-4-LinoSanfilippo@gmx.de>
Date: Fri, 29 Sep 2023 00:12:43 +0200
From: Lino Sanfilippo <LinoSanfilippo@....de>
To: gregkh@...uxfoundation.org, jirislaby@...nel.org
Cc: shawnguo@...nel.org, s.hauer@...gutronix.de,
ilpo.jarvinen@...ux.intel.com, mcoquelin.stm32@...il.com,
alexandre.torgue@...s.st.com, linux-kernel@...r.kernel.org,
linux-serial@...r.kernel.org, l.sanfilippo@...bus.com,
LinoSanfilippo@....de, lukas@...ner.de, p.rosenberger@...bus.com,
stable@...r.kernel.org
Subject: [PATCH 3/6] serial: core: set missing supported flag for RX during TX GPIO
From: Lino Sanfilippo <l.sanfilippo@...bus.com>
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: stable@...r.kernel.org
Fixes: 163f080eb717 ("serial: core: Add option to output RS485 RX_DURING_TX state via GPIO")
Signed-off-by: Lino Sanfilippo <l.sanfilippo@...bus.com>
---
drivers/tty/serial/serial_core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index ef0500be3553..697c36dc7ec8 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -3622,6 +3622,8 @@ int uart_get_rs485_mode(struct uart_port *port)
port->rs485_rx_during_tx_gpio = NULL;
return dev_err_probe(dev, ret, "Cannot get rs485-rx-during-tx-gpios\n");
}
+ if (port->rs485_rx_during_tx_gpio)
+ port->rs485_supported.flags |= SER_RS485_RX_DURING_TX;
return 0;
}
--
2.40.1
Powered by blists - more mailing lists