dt-bindings: pinctrl: Update pinctrl-single to use yaml
Subsystems (3)
PATCH v5 1/1 dt-bindings: pinctrl: Update pinctrl-single to use yaml
Update binding for yaml and remove the old related txt bindings. Note that we are also adding the undocumented pinctrl-single,slew-rate property. And we only use the first example from the old binding.
---
Changes since v4:
- Removed legacy matching for pin group node names, let's fix the dts files instead to use "pins" naming with dashes. This also fixed the new warnings introduced for "not of type 'object'" for anything named pin
Changes since v3:
- Fix issues noted by Rob for v2 version that I had missed
- Categorize patternProperties a bit to make fixing dts files easier
Changes since v2:
- Drop old ti,omap-pinctrl.txt in addition to old pinctrl-single.txt
- Replace reference to pinctrl-single.txt to point to the yaml in ctrl.txt
Changes since v1:
- The v1 version was a WIP patch posted as an example in thread "dt binding check error with hash and comma"
--- .../devicetree/bindings/arm/omap/ctrl.txt | 2 +- .../bindings/pinctrl/pinctrl-single.txt | 262 ------------------ .../bindings/pinctrl/pinctrl-single.yaml | 201 ++++++++++++++ .../bindings/pinctrl/ti,omap-pinctrl.txt | 13 - 4 files changed, 202 insertions(+), 276 deletions(-) delete mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt create mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml delete mode 100644 Documentation/devicetree/bindings/pinctrl/ti,omap-pinctrl.txt
Documentation/devicetree/bindings/arm/omap/ctrl.txt +1 -1
@@ -8,7 +8,7 @@ control module driver itself. See [2] for documentation about clock/clockdomain nodes. -[1] Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt +[1] Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml [2] Documentation/devicetree/bindings/clock/ti/* Required properties:
Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt deleted +0 -262
262 lines not on this page · raw message
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml new file +201 -0
201 lines not on this page · raw message
Documentation/devicetree/bindings/pinctrl/ti,omap-pinctrl.txt deleted +0 -13
@@ -1,13 +0,0 @@ -OMAP Pinctrl definitions - -Required properties: -- compatible : Should be one of: - "ti,omap2420-padconf" - OMAP2420 compatible pinctrl - "ti,omap2430-padconf" - OMAP2430 compatible pinctrl - "ti,omap3-padconf" - OMAP3 compatible pinctrl - "ti,omap4-padconf" - OMAP4 compatible pinctrl - "ti,omap5-padconf" - OMAP5 compatible pinctrl - "ti,dra7-padconf" - DRA7 compatible pinctrl - "ti,am437-padconf" - AM437x compatible pinctrl - -See Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt for further details.
Signature · 1 line
2.40.1
Quoted 8 lines · Tony Lindgren
Update binding for yaml and remove the old related txt bindings. Note that we are also adding the undocumented pinctrl-single,slew-rate property. And we only use the first example from the old binding.
Cc Linus Walleij <[email protected]>Cc Nishanth Menon <[email protected]>Cc Vignesh Raghavendra <[email protected]>Signed-off-by Tony Lindgren <[email protected]>
Thank you for your patch. There is something to discuss/improve.
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml line 7
Quoted 12 lines
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml new file +7
-0@@ -0,0 +1,201 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/pinctrl/pinctrl-single.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: One-register-per-pin type device tree based pinctrl driver
Drop "device tree based pinctrl driver" and describe the hardware.
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml line 14
Quoted 7 lines
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml new file +7
-0+ +maintainers: + - Tony Lindgren <[email protected]> + +description: + This binding describes pinctrl devices that use one hardware register to + configure each pin.
Drop "This binding describes" and just say what is the hardware here.
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml line 19
Quoted 5 lines
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml new file +5
-0+ +properties: + compatible: + oneOf: + - items:
Drop items, you have just an enum.
Quoted 20 lines
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml new file +20
-0+ - enum: + - pinctrl-single + - pinconf-single + - items: + - enum: + - ti,am437-padconf + - ti,dra7-padconf + - ti,omap2420-padconf + - ti,omap2430-padconf + - ti,omap3-padconf + - ti,omap4-padconf + - ti,omap5-padconf + - const: pinctrl-single + + reg: + maxItems: 1 + + interrupt-controller: true + + '#interrupt-cells':
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml line 49
Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml new file +10
-0+ const: 1 + + '#address-cells': + const: 1 + + '#size-cells': + const: 0 + + '#pinctrl-cells': + enum: [ 1, 2 ]
Describe in description what are the arguments. Old binding had it.
Quoted 26 lines
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml new file +26
-0+ + pinctrl-single,bit-per-mux: + description: Optional flag to indicate register controls more than one pin + type: boolean + + pinctrl-single,function-mask: + description: Mask of the allowed register bits + $ref: /schemas/types.yaml#/definitions/uint32 + + pinctrl-single,function-off: + description: Optional function off mode for disabled state + $ref: /schemas/types.yaml#/definitions/uint32 + + pinctrl-single,register-width: + description: Width of pin specific bits in the register + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [ 8, 16, 32 ] + + pinctrl-single,gpio-range: + description: Optional list of pin base, nr pins & gpio function + $ref: /schemas/types.yaml#/definitions/phandle-array + items: + - items: + - description: phandle of a gpio-range node + - description: pin base + - description: number of pins
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml line 85
Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml new file +10
-0+ - description: gpio function + + '#gpio-range-cells': + description: No longer needed, may exist in older files for gpio-ranges + deprecated: true + const: 3 + + gpio-range: + description: Optional node for gpio range cells + type: object
On this level of indentation:
additionalProperties: false
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml line 93
Quoted 8 lines
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml new file +8
-0+ properties: + '#pinctrl-single,gpio-range-cells': + description: Number of gpio range cells + const: 3 + $ref: /schemas/types.yaml#/definitions/uint32 + +patternProperties: + '-pins((.*)?)$|-pin':
Why do you need outer ()?
-pin$
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml line 96
Quoted 3 lines
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml new file +3
-0+ description: Pin group node name using pins or pin naming + type: object + $ref: pinmux-node.yaml#
You don't use anything from this ref. Drop it, unless you plan to deprecate old properties and use generic from pinmux-node.
Quoted 72 lines
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml new file +72
-0+ + additionalProperties: false + + properties: + pinctrl-single,pins: + description: + Array of pins as described in pinmux-node.yaml for pinctrl-pin-array + $ref: /schemas/types.yaml#/definitions/uint32-array + + pinctrl-single,bits: + description: Register bit configuration for pinctrl-single,bit-per-mux + $ref: /schemas/types.yaml#/definitions/uint32-array + items: + - description: register offset + - description: value + - description: pin bitmask in the register + + pinctrl-single,bias-pullup: + description: Optional bias pull up configuration + $ref: /schemas/types.yaml#/definitions/uint32-array + items: + - description: input + - description: enabled pull up bits + - description: disabled pull up bits + - description: bias pull up mask + + pinctrl-single,bias-pulldown: + description: Optional bias pull down configuration + $ref: /schemas/types.yaml#/definitions/uint32-array + items: + - description: input + - description: enabled pull down bits + - description: disabled pull down bits + - description: bias pull down mask + + pinctrl-single,drive-strength: + description: Optional drive strength configuration + $ref: /schemas/types.yaml#/definitions/uint32-array + items: + - description: drive strength current + - description: drive strength mask + + pinctrl-single,input-schmitt: + description: Optional input schmitt configuration + $ref: /schemas/types.yaml#/definitions/uint32-array + items: + - description: input + - description: enable bits + - description: disable bits + - description: input schmitt mask + + pinctrl-single,low-power-mode: + description: Optional low power mode configuration + $ref: /schemas/types.yaml#/definitions/uint32-array + items: + - description: low power mode value + - description: low power mode mask + + pinctrl-single,slew-rate: + description: Optional slew rate configuration + $ref: /schemas/types.yaml#/definitions/uint32-array + items: + - description: slew rate + - description: slew rate mask + +allOf: + - $ref: pinctrl.yaml# + +required: + - compatible + - reg + - pinctrl-single,register-width
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml line 178
Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml new file +10
-0+ +additionalProperties: false + +examples: + - | + soc { + #address-cells = <1>; + #size-cells = <1>; + + pinmux@4a100040 {
Mixed up indentation.
Quoted 5 lines
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml new file +5
-0+ compatible = "pinctrl-single"; + reg = <0x4a100040 0x0196>; + #address-cells = <1>; + #size-cells = <0>; + #pinctrl-cells = <2>;
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml line 193
Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml new file +10
-0+ #interrupt-cells = <1>; + interrupt-controller; + pinctrl-single,register-width = <16>; + pinctrl-single,function-mask = <0xffff>; + pinctrl-single,gpio-range = <&range 0 3 0>; + range: gpio-range { + #pinctrl-single,gpio-range-cells = <3>; + }; + + uart2-pins {
Best regards,
Krzysztof
Quoted 6 lines · Krzysztof Kozlowski
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml line 93
Quoted 2 lines · Tony Lindgren
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml new file +2
-0+patternProperties: + '-pins((.*)?)$|-pin':Why do you need outer ()?
-pin$
OK yeah that works.
Thanks for looking through the binding again, I'll send out v6 with the issues you noticed fixed.
Regards,
Tony