Re: [PATCH v3 6/7] dt-bindings: pinctrl: rockchip: Add RMIO controller binding
From: Linus Walleij <linusw@kernel.org>
Date: 2025-12-26 18:07:56
Also in:
linux-devicetree, linux-gpio, linux-rockchip, lkml
Hi Ye, thanks for your patch! On Tue, Dec 16, 2025 at 3:50 PM Ye Zhang [off-list ref] wrote:
quoted hunk ↗ jump to hunk
diff --git a/Documentation/devicetree/bindings/pinctrl/rockchip,rmio.yaml b/Documentation/devicetree/bindings/pinctrl/rockchip,rmio.yaml
+ rockchip,rmio-grf: + $ref: /schemas/types.yaml#/definitions/phandle + description: + The phandle of the syscon node (GRF or PMU) containing the RMIO registers. + This property is required if the RMIO registers are located in a different + syscon than the parent pinctrl node. + + rockchip,offset: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + The offset of the RMIO configuration registers within the GRF.
Can't this just be a cell in the phandle?
+ rockchip,pins-num: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + The number of physical pins supported by this RMIO instance. + Used for boundary checking and driver initialization.
Isn't this implicit from the compatible? Why is this different between two device trees using the same compatible pin controller? I don't get it, I think this should be a constant in the code based on the compatible instead.
+patternProperties: + "^[a-z0-9-]+$": + type: object + description: + Function node grouping multiple groups. + + patternProperties: + "^[a-z0-9-]+$": + type: object + description: + Group node containing the pinmux configuration. + + properties: + rockchip,rmio: + $ref: /schemas/types.yaml#/definitions/uint32-matrix + description: + A list of pin-function pairs. The format is <pin_id function_id>. + minItems: 1 + items: + items: + - description: RMIO Pin ID (0 to pins-num - 1) + minimum: 0 + maximum: 31 + - description: Function ID + minimum: 0 + maximum: 98
Please avoid these custom properties and just use the standard "pinmux" property. I don't want any more opaque custom bindings for functions and groups. Reference Documentation/devicetree/bindings/pinctrl/pinmux-node.yaml and use pinmux from there. You can use some shifting and defines to shoehorn your config into a single u32 and parse that in your driver; i.e. instead of rockchip,rmio = <1, 2>; use pinmux = <1 << 8 | 2 << 0>; these shifter numerals can come from defines. In the driver shift & mask out the components you want. e.g.;
+ rmio-uart {
+ rmio_pin27_uart1_tx: rmio-pin27-uart1-tx {
+ rockchip,rmio = <27 RMIO_UART1_TX>;pinmux = <27 << 8 | RMIO_UART1_TX>;
quoted hunk ↗ jump to hunk
+++ b/include/dt-bindings/pinctrl/rockchip,rk3506-rmio.h
These number dumps are not appreciated inside the bindings despite quite a few found their way in there. Use something like arch/*/dts/rockchip/rk3506-rmio-pins.dtsi and include that into your device trees instead. Yours, Linus Walleij