[PATCH 2/3] dt-bindings: serial: maxim,max310x: allow per-port subnodes for rs485

From: Tapio Reijonen

Date: Mon May 25 2026 - 05:44:49 EST


The MAX310x is a multi-port UART (up to four ports). The existing
binding pulls in /schemas/serial/rs485.yaml at the top level, which
only describes a single port - sufficient for max3107 but ambiguous
for max14830 where each port can have its own RS485 wiring.

Add a "port@N" pattern (N = 0..3) carrying rs485 properties on a
per-port basis. When port@N subnodes are present, the chip node also
needs #address-cells = <1> and #size-cells = <0>; allow both. Top-
level rs485 properties remain accepted for compatibility.

Signed-off-by: Tapio Reijonen <tapio.reijonen@xxxxxxxxxxx>
---
.../devicetree/bindings/serial/maxim,max310x.yaml | 60 ++++++++++++++++++++++
1 file changed, 60 insertions(+)

diff --git a/Documentation/devicetree/bindings/serial/maxim,max310x.yaml b/Documentation/devicetree/bindings/serial/maxim,max310x.yaml
index 889eeaca64a027b4d9e8ec87bcf63fcc8fd9d55b..b7095c9abacde81e69c1138e817a1d5bdfaf14d7 100644
--- a/Documentation/devicetree/bindings/serial/maxim,max310x.yaml
+++ b/Documentation/devicetree/bindings/serial/maxim,max310x.yaml
@@ -40,6 +40,34 @@ properties:
minItems: 1
maxItems: 16

+ "#address-cells":
+ const: 1
+
+ "#size-cells":
+ const: 0
+
+patternProperties:
+ "^port@[0-3]$":
+ type: object
+ description:
+ Per-port subnode that carries the RS-485 properties from
+ /schemas/serial/rs485.yaml# for a single UART channel of the
+ chip. Only those rs485-* properties (and the per-port reg) are
+ accepted here; device-wide settings stay on the parent node.
+
+ allOf:
+ - $ref: /schemas/serial/rs485.yaml#
+
+ properties:
+ reg:
+ description: Port number on the chip.
+ maximum: 3
+
+ required:
+ - reg
+
+ unevaluatedProperties: false
+
required:
- compatible
- reg
@@ -72,3 +100,35 @@ examples:
#gpio-cells = <2>;
};
};
+
+ - |
+ #include <dt-bindings/interrupt-controller/irq.h>
+ spi {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ serial@0 {
+ compatible = "maxim,max14830";
+ reg = <0>;
+ spi-max-frequency = <26000000>;
+ clocks = <&xtal4m>;
+ clock-names = "xtal";
+ interrupt-parent = <&gpio3>;
+ interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ rs485-rts-active-low;
+ linux,rs485-enabled-at-boot-time;
+ };
+
+ port@2 {
+ reg = <2>;
+ rs485-rts-active-low;
+ };
+ };
+ };

--
2.47.3