[PATCH V2 1/6] dt-bindings: pinctrl: support specifying pins, groups & functions

Tony Lindgren tony at atomide.com
Thu Nov 25 00:49:04 PST 2021


Hi,

* Rafał Miłecki <zajec5 at gmail.com> [211124 23:05]:
> --- a/Documentation/devicetree/bindings/pinctrl/pinctrl.yaml
> +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl.yaml
> @@ -42,4 +42,44 @@ properties:
>        This property can be set either globally for the pin controller or in
>        child nodes for individual pin group control.
>  
> +  pins:
> +    type: object
> +
> +    patternProperties:
> +      "^.*$":
> +        type: object
> +
> +        properties:
> +          number:
> +            description: Pin number
> +            $ref: /schemas/types.yaml#/definitions/uint32
> +
> +        additionalProperties: false

Please don't introduce Linux kernel internal numbering here. It's
like bringing back the interrupt numbers again. Just make this into
a proper hardware offset from the controller base, so a reg property.
Sure in some cases the reg property is just an index depending on
the controller, we don't really care from the binding point of view.

We already have #pinctrl-cells, so plase do something like the four
ximaginary examples below:

	#pinctrl-cells = <1>;
	...
	pin at foo {
		reg = <0xf00 MUX_MODE0>;
		label = "foo_pin";
	};


	#pinctrl-cells = <2>;
	...
	pin at foo {
		reg = <0xf00 PIN_INPUT_PULLUP MUX_MODE3>;
	};


	#pinctrl-cells = <2>;
	...
	pin at f00 {
		reg = <0xf00 DELAY_PS(0) DELAY_PS(0)>;
	};


	#pinctrl-cells = <3>;
	...
	pin at f00 {
		reg = <0xf00 MUX_MODE3 PULL_UP_STRENGTH(36) PULL_DOWN_STRENGTH(20)>;
	};


Then let's attempt to use just standard numbers and defines for the
values where possible. Then a group of pins is just a list of the pin
phandles in the devicetree.

Regards,

Tony



More information about the linux-arm-kernel mailing list