Thread (11 messages) 11 messages, 3 authors, 2025-01-20

Re: [PATCH v3 1/5] dt-bindings: pinctrl: Add support for Amlogic SoCs

From: Krzysztof Kozlowski <krzk@kernel.org>
Date: 2025-01-17 08:49:02
Also in: linux-amlogic, linux-devicetree, linux-gpio, lkml

On Wed, Jan 15, 2025 at 02:41:59PM +0800, Xianwei Zhao wrote:
+properties:
+  compatible:
+    const: amlogic,pinctrl-a4
+
+  "#address-cells":
+    const: 2
+
+  "#size-cells":
+    const: 2
Why this moved to '2'? 32-bit was not enough?
+
+  ranges: true
+
+required:
+  - compatible
+  - "#address-cells"
+  - "#size-cells"
Keep required after patternProperties
+
+patternProperties:
+  "^gpio@[0-9a-f]+$":
+    type: object
+
+    properties:
+      reg:
+        minItems: 1
+        items:
+          - description: pin config register
+          - description: pin mux setting register (some special pin fixed function)
+          - description: pin drive strength register (optionanl)
typo: optional
+
+      reg-names:
+        minItems: 1
+        items:
+          - const: gpio
+          - const: mux
+          - const: ds
+
+      gpio-controller: true
+
+      "#gpio-cells":
+        const: 2
+
+      gpio-ranges:
+        maxItems: 1
+
+      bank-number:
+        description: |
+          bank-number are provided by the pin controller header file at:
+          <include/dt-bindings/pinctrl/amlogic,pinctrl.h>
+        $ref: /schemas/types.yaml#/definitions/uint32
gpio-ranges tell you that, don't they?

Anyway, you would need here minimum and maximum.
+
+    required:
+      - reg
+      - reg-names
+      - gpio-controller
+      - "#gpio-cells"
+      - gpio-ranges
+      - bank-number
+
+    additionalProperties: false
+
+  "^func-[0-9a-z-]+$":
+    type: object
+    patternProperties:
+      "^group-[0-9a-z-]+$":
+        type: object
+        allOf:
+          - $ref: /schemas/pinctrl/pincfg-node.yaml
+          - $ref: /schemas/pinctrl/pinmux-node.yaml
Missing required pinmux and maybe other properties.
+    additionalProperties: false
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/pinctrl/amlogic,pinctrl.h>
+    apb {
+      #address-cells = <2>;
+      #size-cells = <2>;
+      periphs_pinctrl: pinctrl {
+        compatible = "amlogic,pinctrl-a4";
+        #address-cells = <2>;
+        #size-cells = <2>;
+        ranges;
+
+        gpio@14 {
+          reg = <0 0x14 0 0x10>,
+                <0 0x14 0 0x10>;
One line.
+          reg-names = "gpio", "mux";
+          gpio-controller;
+          #gpio-cells = <2>;
+          bank-number = <AMLOGIC_GPIO_B>;
+          gpio-ranges = <&periphs_pinctrl 0 8 10>;
+        };
Best regards,
Krzysztof

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help