Skip to contentSkip to conversation

dt-bindings: pinctrl: aspeed: Allow only defined pin mux node properties

PATCH In review Rob Herring 3 participants 3 messages Aug 19, 2023 – Aug 21, 2023

Subsystems (5)
lore
Share & tools
lore

Rob Herring

author maintainer
#0 lore raw

PATCH 1/1 dt-bindings: pinctrl: aspeed: Allow only defined pin mux node properties

The Aspeed pinctrl bindings are missing an additionalProperties/ unevaluatedProperties schemas on the child pin mux nodes which means any undefined properties are allowed. In addition, using 'additionalProperties' for child nodes with any name works better than a pattern matching everything with an if/then schema to select nodes only.

With 'additionalProperties' added, 'pins' and 'bias-disable' properties need to be added as they were not defined. A $ref to pinmux-node.yaml which defines the common property types was also missing.

---
Really 'pins' should have some constraints, but I don't know what the possible values are. Happy to add if someone can tell me what.

---
 .../pinctrl/aspeed,ast2400-pinctrl.yaml       |  52 ++++----
 .../pinctrl/aspeed,ast2500-pinctrl.yaml       |  56 ++++----
 .../pinctrl/aspeed,ast2600-pinctrl.yaml       | 120 +++++++++---------
 3 files changed, 113 insertions(+), 115 deletions(-)
Documentation/devicetree/bindings/pinctrl/aspeed,ast2400-pinctrl.yaml +26 -26
index bef85c25cdef..37c0a74c7c01 100644
@@ -25,30 +25,32 @@ properties:
   reg:
     maxItems: 2
 
-patternProperties:
-  '^.*$':
-    if:
-      type: object
-    then:
-      patternProperties:
-        "^function|groups$":
-          $ref: /schemas/types.yaml#/definitions/string
-          enum: [ ACPI, ADC0, ADC1, ADC10, ADC11, ADC12, ADC13, ADC14, ADC15,
-                  ADC2, ADC3, ADC4, ADC5, ADC6, ADC7, ADC8, ADC9, BMCINT, DDCCLK, DDCDAT,
-                  EXTRST, FLACK, FLBUSY, FLWP, GPID, GPID0, GPID2, GPID4, GPID6, GPIE0,
-                  GPIE2, GPIE4, GPIE6, I2C10, I2C11, I2C12, I2C13, I2C14, I2C3, I2C4,
-                  I2C5, I2C6, I2C7, I2C8, I2C9, LPCPD, LPCPME, LPCRST, LPCSMI, MAC1LINK,
-                  MAC2LINK, MDIO1, MDIO2, NCTS1, NCTS2, NCTS3, NCTS4, NDCD1, NDCD2,
-                  NDCD3, NDCD4, NDSR1, NDSR2, NDSR3, NDSR4, NDTR1, NDTR2, NDTR3, NDTR4,
-                  NDTS4, NRI1, NRI2, NRI3, NRI4, NRTS1, NRTS2, NRTS3, OSCCLK, PWM0,
-                  PWM1, PWM2, PWM3, PWM4, PWM5, PWM6, PWM7, RGMII1, RGMII2, RMII1,
-                  RMII2, ROM16, ROM8, ROMCS1, ROMCS2, ROMCS3, ROMCS4, RXD1, RXD2, RXD3,
-                  RXD4, SALT1, SALT2, SALT3, SALT4, SD1, SD2, SGPMCK, SGPMI, SGPMLD,
-                  SGPMO, SGPSCK, SGPSI0, SGPSI1, SGPSLD, SIOONCTRL, SIOPBI, SIOPBO,
-                  SIOPWREQ, SIOPWRGD, SIOS3, SIOS5, SIOSCI, SPI1, SPI1DEBUG, SPI1PASSTHRU,
-                  SPICS1, TIMER3, TIMER4, TIMER5, TIMER6, TIMER7, TIMER8, TXD1, TXD2,
-                  TXD3, TXD4, UART6, USB11D1, USB11H2, USB2D1, USB2H1, USBCKI, VGABIOS_ROM,
-                  VGAHS, VGAVS, VPI18, VPI24, VPI30, VPO12, VPO24, WDTRST1, WDTRST2]
+additionalProperties:
+  $ref: pinmux-node.yaml#
+  additionalProperties: false
+
+  properties:
+    pins: true
+    bias-disable: true
+
+  patternProperties:
+    "^function|groups$":
+      enum: [ ACPI, ADC0, ADC1, ADC10, ADC11, ADC12, ADC13, ADC14, ADC15,
+              ADC2, ADC3, ADC4, ADC5, ADC6, ADC7, ADC8, ADC9, BMCINT, DDCCLK, DDCDAT,
+              EXTRST, FLACK, FLBUSY, FLWP, GPID, GPID0, GPID2, GPID4, GPID6, GPIE0,
+              GPIE2, GPIE4, GPIE6, I2C10, I2C11, I2C12, I2C13, I2C14, I2C3, I2C4,
+              I2C5, I2C6, I2C7, I2C8, I2C9, LPCPD, LPCPME, LPCRST, LPCSMI, MAC1LINK,
+              MAC2LINK, MDIO1, MDIO2, NCTS1, NCTS2, NCTS3, NCTS4, NDCD1, NDCD2,
+              NDCD3, NDCD4, NDSR1, NDSR2, NDSR3, NDSR4, NDTR1, NDTR2, NDTR3, NDTR4,
+              NDTS4, NRI1, NRI2, NRI3, NRI4, NRTS1, NRTS2, NRTS3, OSCCLK, PWM0,
+              PWM1, PWM2, PWM3, PWM4, PWM5, PWM6, PWM7, RGMII1, RGMII2, RMII1,
+              RMII2, ROM16, ROM8, ROMCS1, ROMCS2, ROMCS3, ROMCS4, RXD1, RXD2, RXD3,
+              RXD4, SALT1, SALT2, SALT3, SALT4, SD1, SD2, SGPMCK, SGPMI, SGPMLD,
+              SGPMO, SGPSCK, SGPSI0, SGPSI1, SGPSLD, SIOONCTRL, SIOPBI, SIOPBO,
+              SIOPWREQ, SIOPWRGD, SIOS3, SIOS5, SIOSCI, SPI1, SPI1DEBUG, SPI1PASSTHRU,
+              SPICS1, TIMER3, TIMER4, TIMER5, TIMER6, TIMER7, TIMER8, TXD1, TXD2,
+              TXD3, TXD4, UART6, USB11D1, USB11H2, USB2D1, USB2H1, USBCKI, VGABIOS_ROM,
+              VGAHS, VGAVS, VPI18, VPI24, VPI30, VPO12, VPO24, WDTRST1, WDTRST2]
 
 allOf:
   - $ref: pinctrl.yaml#
@@ -56,8 +58,6 @@ allOf:
 required:
   - compatible
 
-additionalProperties: false
-
 examples:
   - |
     syscon: scu at 1e6e2000 {
Documentation/devicetree/bindings/pinctrl/aspeed,ast2500-pinctrl.yaml +28 -28

68 lines not on this page · raw message

Documentation/devicetree/bindings/pinctrl/aspeed,ast2600-pinctrl.yaml +59 -61

132 lines not on this page · raw message

Signature · 1 line
2.40.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Rob Herring

The Aspeed pinctrl bindings are missing an additionalProperties/ unevaluatedProperties schemas on the child pin mux nodes which means any undefined properties are allowed. In addition, using 'additionalProperties' for child nodes with any name works better than a pattern matching everything with an if/then schema to select nodes only.

With 'additionalProperties' added, 'pins' and 'bias-disable' properties need to be added as they were not defined. A $ref to pinmux-node.yaml which defines the common property types was also missing.

Quoted 5 lines

---
Really 'pins' should have some constraints, but I don't know what the possible values are. Happy to add if someone can tell me what.
---

Best regards,
Krzysztof

#2 lore raw
In reply to Rob Herring
Quoted 6 lines · On Sat, Aug 19, 2023 at 3:09?AM Rob Herring <[email protected]> wrote:

The Aspeed pinctrl bindings are missing an additionalProperties/ unevaluatedProperties schemas on the child pin mux nodes which means any undefined properties are allowed. In addition, using 'additionalProperties' for child nodes with any name works better than a pattern matching everything with an if/then schema to select nodes only.

Quoted 6 lines

With 'additionalProperties' added, 'pins' and 'bias-disable' properties need to be added as they were not defined. A $ref to pinmux-node.yaml which defines the common property types was also missing.

Patch applied!

Quoted 2 lines

Really 'pins' should have some constraints, but I don't know what the possible values are. Happy to add if someone can tell me what.

Aspeed folks: put this on your TODO!

Yours,
Linus Walleij