Skip to contentSkip to conversation

dt-bindings: pinctrl: Convert Amlogic Meson pinctrl binding

PATCH Superseded Heiner Kallweit 2 participants 2 messages Mar 12, 2023 – Mar 14, 2023

Subsystems (4)

v4 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 dt-bindings: pinctrl: Convert Amlogic Meson pinctrl binding

Convert Amlogic Meson pin controller binding to yaml.

---
v2:
- consider that more than one compatible can be set
- remove bus part from example
v3:
- remove minItem/maxItem properties for compatible
v4:
- split patch to be able to deal with the different reg/reg-names

---
 .../pinctrl/amlogic,meson-pinctrl-a1.yaml     | 60 ++++++++++++
 .../pinctrl/amlogic,meson-pinctrl-common.yaml | 53 +++++++++++
 .../amlogic,meson-pinctrl-g12a-aobus.yaml     | 61 ++++++++++++
 .../amlogic,meson-pinctrl-g12a-periphs.yaml   | 65 +++++++++++++
 .../pinctrl/amlogic,meson8-pinctrl-aobus.yaml | 69 ++++++++++++++
 .../pinctrl/amlogic,meson8-pinctrl-cbus.yaml  | 71 ++++++++++++++
 .../bindings/pinctrl/meson,pinctrl.txt        | 94 -------------------
 7 files changed, 379 insertions(+), 94 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-common.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-g12a-aobus.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-g12a-periphs.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/amlogic,meson8-pinctrl-aobus.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/amlogic,meson8-pinctrl-cbus.yaml
 delete mode 100644 Documentation/devicetree/bindings/pinctrl/meson,pinctrl.txt
Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml new file +60 -0
new file mode 100644
index 000000000..1db9d8453
@@ -0,0 +1,60 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/amlogic,meson-pinctrl-a1.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic Meson A1 pinmux controller
+
+maintainers:
+  - Neil Armstrong <[email protected]>
+
+allOf:
+  - $ref: amlogic,meson-pinctrl-common.yaml#
+
+properties:
+  compatible:
+    enum:
+      - amlogic,meson-a1-periphs-pinctrl
+      - amlogic,meson-s4-periphs-pinctrl
+
+additionalProperties: true
+
+patternProperties:
+  "^bank@[0-9a-z]+$":
+    $ref: amlogic,meson-pinctrl-common.yaml#/$defs/meson-gpio
+
+    properties:
+      reg:
+        maxItems: 2
+
+      reg-names:
+        items:
+          - const: mux
+          - const: gpio
+
+examples:
+  - |
+    periphs_pinctrl: pinctrl {
+      compatible = "amlogic,meson-a1-periphs-pinctrl";
+      #address-cells = <1>;
+      #size-cells = <1>;
+      ranges;
+
+      bank@400 {
+        reg = <0x0400 0x003c>,
+              <0x0480 0x0118>;
+        reg-names = "mux", "gpio";
+        gpio-controller;
+        #gpio-cells = <2>;
+        gpio-ranges = <&periphs_pinctrl 0 0 62>;
+
+        cec_ao_a_h_pins: cec_ao_a_h {
+          mux {
+            groups = "cec_ao_a_h";
+            function = "cec_ao_a_h";
+            bias-disable;
+          };
+        };
+      };
+    };
Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-common.yaml new file +53 -0

53 lines not on this page · raw message

Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-g12a-aobus.yaml new file +61 -0

61 lines not on this page · raw message

Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-g12a-periphs.yaml new file +65 -0

65 lines not on this page · raw message

Documentation/devicetree/bindings/pinctrl/amlogic,meson8-pinctrl-aobus.yaml new file +69 -0

69 lines not on this page · raw message

Documentation/devicetree/bindings/pinctrl/amlogic,meson8-pinctrl-cbus.yaml new file +71 -0

71 lines not on this page · raw message

Documentation/devicetree/bindings/pinctrl/meson,pinctrl.txt deleted +0 -94

94 lines not on this page · raw message

Signature · 1 line
2.39.2
#1 lore raw
Quoted 45 lines · Heiner Kallweit

Convert Amlogic Meson pin controller binding to yaml.

---
v2:
- consider that more than one compatible can be set
- remove bus part from example
v3:
- remove minItem/maxItem properties for compatible
v4:
- split patch to be able to deal with the different reg/reg-names

---
 .../pinctrl/amlogic,meson-pinctrl-a1.yaml     | 60 ++++++++++++
 .../pinctrl/amlogic,meson-pinctrl-common.yaml | 53 +++++++++++
 .../amlogic,meson-pinctrl-g12a-aobus.yaml     | 61 ++++++++++++
 .../amlogic,meson-pinctrl-g12a-periphs.yaml   | 65 +++++++++++++
 .../pinctrl/amlogic,meson8-pinctrl-aobus.yaml | 69 ++++++++++++++
 .../pinctrl/amlogic,meson8-pinctrl-cbus.yaml  | 71 ++++++++++++++
 .../bindings/pinctrl/meson,pinctrl.txt        | 94 -------------------
 7 files changed, 379 insertions(+), 94 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-common.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-g12a-aobus.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-g12a-periphs.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/amlogic,meson8-pinctrl-aobus.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/amlogic,meson8-pinctrl-cbus.yaml
 delete mode 100644 Documentation/devicetree/bindings/pinctrl/meson,pinctrl.txt
Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml new file +11 -0
new file mode 100644
index 000000000..1db9d8453
@@ -0,0 +1,60 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/amlogic,meson-pinctrl-a1.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic Meson A1 pinmux controller
+
+maintainers:
+  - Neil Armstrong <[email protected]>
+

Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml line 21

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml new file +10 -0
+allOf:
+  - $ref: amlogic,meson-pinctrl-common.yaml#
+
+properties:
+  compatible:
+    enum:
+      - amlogic,meson-a1-periphs-pinctrl
+      - amlogic,meson-s4-periphs-pinctrl
+
+additionalProperties: true

No, this cannot be true.

This goes to the same place as in example-schema, so before required.

Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml line 34

Quoted 13 lines
Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml new file +13 -0
+
+patternProperties:
+  "^bank@[0-9a-z]+$":
+    $ref: amlogic,meson-pinctrl-common.yaml#/$defs/meson-gpio
+
+    properties:
+      reg:
+        maxItems: 2
+
+      reg-names:
+        items:
+          - const: mux
+          - const: gpio

Missing required-compatible.

Quoted 38 lines
Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml new file +26 -0
+
+examples:
+  - |
+    periphs_pinctrl: pinctrl {
+      compatible = "amlogic,meson-a1-periphs-pinctrl";
+      #address-cells = <1>;
+      #size-cells = <1>;
+      ranges;
+
+      bank@400 {
+        reg = <0x0400 0x003c>,
+              <0x0480 0x0118>;
+        reg-names = "mux", "gpio";
+        gpio-controller;
+        #gpio-cells = <2>;
+        gpio-ranges = <&periphs_pinctrl 0 0 62>;
+
+        cec_ao_a_h_pins: cec_ao_a_h {
+          mux {
+            groups = "cec_ao_a_h";
+            function = "cec_ao_a_h";
+            bias-disable;
+          };
+        };
+      };
+    };
Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-common.yaml new file +6 -0
new file mode 100644
index 000000000..035219f6e
@@ -0,0 +1,53 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/amlogic,meson-pinctrl-common.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+

Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-common.yaml line 16

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-common.yaml new file +10 -0
+title: Amlogic Meson pinmux controller
+
+maintainers:
+  - Neil Armstrong <[email protected]>
+
+allOf:
+  - $ref: pinctrl.yaml#
+
+properties:
+  compatible: true

Drop.

Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-common.yaml line 26

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-common.yaml new file +10 -0
+  ranges: true
+
+  "#address-cells":
+    enum: [1, 2]
+
+  "#size-cells":
+    enum: [1, 2]
+
+required:
+  - compatible

Drop

Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-common.yaml line 34

Quoted 8 lines
Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-common.yaml new file +8 -0
+  - ranges
+  - "#address-cells"
+  - "#size-cells"
+
+additionalProperties:
+  allOf:
+    - $ref: pincfg-node.yaml#
+    - $ref: pinmux-node.yaml#

I don't think this readable. Properties should rather reference the schema, and now you allow evaluation of anything. Which probably caused your wrong additionalProperties in the first place.

This could be part of node definition below.

Quoted 35 lines
Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-common.yaml new file +19 -0
+
+$defs:
+  meson-gpio:
+    type: object
+    properties:
+      gpio-controller: true
+
+      "#gpio-cells":
+        const: 2
+
+      gpio-ranges:
+        maxItems: 1
+
+    required:
+      - reg
+      - reg-names
+      - gpio-controller
+      - "#gpio-cells"
+      - gpio-ranges
Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-g12a-aobus.yaml new file +10 -0
new file mode 100644
index 000000000..5a84e17f3
@@ -0,0 +1,61 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/amlogic,meson-pinctrl-g12a-aobus.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic Meson G12 AOBUS pinmux controller
+
+maintainers:
+  - Neil Armstrong <[email protected]>

Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-g12a-aobus.yaml line 20

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-g12a-aobus.yaml new file +10 -0
+
+allOf:
+  - $ref: amlogic,meson-pinctrl-common.yaml#
+
+properties:
+  compatible:
+    enum:
+      - amlogic,meson-g12a-aobus-pinctrl
+
+additionalProperties: true

Same problems... and further as well.

Best regards,
Krzysztof