Skip to contentSkip to conversation

dt-bindings: pinctrl: nvidia,tegra234-pinmux: Restructure common schema

PATCH In review Rob Herring 2 participants 2 messages Feb 2, 2024 – Feb 7, 2024

Subsystems (4)
lore
Share & tools
lore

Rob Herring

author maintainer
#0 lore raw

PATCH 1/1 dt-bindings: pinctrl: nvidia,tegra234-pinmux: Restructure common schema

The structure of the NVIDIA Tegra234 common pinmux schema doesn't work for restricting properties because a child node schema can't be extended with additional properties from another schema defining the same child node. The 2 child node schemas are evaluated independently as the schemas are not recursively combined in any way.

As the common schema is almost all the child node schema anyways, just remove the parent node from the common schema. Then add 'reg' and adjust the $ref's in the users of the common schema.

---
 .../pinctrl/nvidia,tegra234-pinmux-aon.yaml   |  7 +-
 .../nvidia,tegra234-pinmux-common.yaml        | 84 ++++++++-----------
 .../pinctrl/nvidia,tegra234-pinmux.yaml       |  7 +-
 3 files changed, 45 insertions(+), 53 deletions(-)
Documentation/devicetree/bindings/pinctrl/nvidia,tegra234-pinmux-aon.yaml +5 -2
index f3deda9f7127..db8224dfba2c 100644
@@ -10,18 +10,21 @@ maintainers:
   - Thierry Reding <[email protected]>
   - Jon Hunter <[email protected]>
 
-$ref: nvidia,tegra234-pinmux-common.yaml
-
 properties:
   compatible:
     const: nvidia,tegra234-pinmux-aon
 
+  reg:
+    maxItems: 1
+
 patternProperties:
   "^pinmux(-[a-z0-9-]+)?$":
     type: object
 
     # pin groups
     additionalProperties:
+      $ref: nvidia,tegra234-pinmux-common.yaml
+
       properties:
         nvidia,pins:
           items:
Documentation/devicetree/bindings/pinctrl/nvidia,tegra234-pinmux-common.yaml +35 -49

92 lines not on this page · raw message

Documentation/devicetree/bindings/pinctrl/nvidia,tegra234-pinmux.yaml +5 -2
index 17b865ecfcda..f5a3a881dec4 100644
@@ -10,18 +10,21 @@ maintainers:
   - Thierry Reding <[email protected]>
   - Jon Hunter <[email protected]>
 
-$ref: nvidia,tegra234-pinmux-common.yaml
-
 properties:
   compatible:
     const: nvidia,tegra234-pinmux
 
+  reg:
+    maxItems: 1
+
 patternProperties:
   "^pinmux(-[a-z0-9-]+)?$":
     type: object
 
     # pin groups
     additionalProperties:
+      $ref: nvidia,tegra234-pinmux-common.yaml
+
       properties:
         nvidia,pins:
           items:
Signature · 1 line
2.43.0
#1 lore raw
Quoted 11 lines · Rob Herring

The structure of the NVIDIA Tegra234 common pinmux schema doesn't work for restricting properties because a child node schema can't be extended with additional properties from another schema defining the same child node. The 2 child node schemas are evaluated independently as the schemas are not recursively combined in any way.

As the common schema is almost all the child node schema anyways, just remove the parent node from the common schema. Then add 'reg' and adjust the $ref's in the users of the common schema.

Patch applied!

Yours,
Linus Walleij