[PATCH 5/7] serial: max310x: Request the line transceiver per port
From: Tapio Reijonen
Date: Wed Nov 11 2026 - 07:30:31 EST
Serial core requests the transceiver GPIO through the port's device
when the port is added, which for this driver is the chip: the
per-port "serial@N" subnodes, where the transceiver of a multi-channel
part is described, are out of its reach. Request it the way the RS485
properties are requested, while the device's firmware node is
temporarily retargeted at the subnode, so each channel gets its own.
Single-channel variants have no subnode; request it from the chip node
there, so the transceiver is known before uart_add_one_port() for
every variant.
Signed-off-by: Tapio Reijonen <tapio.reijonen@xxxxxxxxxxx>
---
drivers/tty/serial/max310x.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c
index bdfdf4a9000bbd18509746bbfd8ed0ade8164598..876bdd1f5496dcf46fdc790a89892342fd85a9e4 100644
--- a/drivers/tty/serial/max310x.c
+++ b/drivers/tty/serial/max310x.c
@@ -2032,20 +2032,24 @@ static int max310x_probe(struct device *dev, const struct max310x_devtype *devty
/*
* Temporarily retarget dev's fwnode to the per-port subnode
- * so uart_get_rs485_mode() picks up the per-port properties.
- * For single-port variants, fall back to the chip's own
- * fwnode so legacy DTs that declare rs485 properties at the
- * top level keep working.
+ * so uart_get_rs485_mode() and uart_get_transceiver() pick up
+ * the per-port properties. For single-port variants, fall
+ * back to the chip's own fwnode so legacy DTs that declare
+ * rs485 properties at the top level keep working.
*/
if (port_np) {
device_set_node(dev, of_fwnode_handle(port_np));
ret = uart_get_rs485_mode(&s->p[i].port);
+ if (!ret)
+ ret = uart_get_transceiver(&s->p[i].port);
device_set_node(dev, saved_fwnode);
of_node_put(port_np);
if (ret)
goto out_clk;
} else if (devtype->nr == 1) {
ret = uart_get_rs485_mode(&s->p[i].port);
+ if (!ret)
+ ret = uart_get_transceiver(&s->p[i].port);
if (ret)
goto out_clk;
}
--
2.47.3