Thread (10 messages) 10 messages, 4 authors, 2021-05-27

Re: [PATCH] dt-bindings: gpio: gpio-davinci: Convert to json-schema

From: Rob Herring <robh@kernel.org>
Date: 2021-05-21 12:57:06
Also in: linux-devicetree, lkml

On Fri, May 21, 2021 at 3:32 AM Grygorii Strashko
[off-list ref] wrote:
Hi Rob, All

On 18/05/2021 01:15, Rob Herring wrote:
quoted
On Tue, May 11, 2021 at 02:31:20PM +0530, Aswath Govindraju wrote:
quoted
Convert gpio-davinci dt-binding documentation from txt to yaml format.

Signed-off-by: Aswath Govindraju <redacted>
---
  .../devicetree/bindings/gpio/gpio-davinci.txt | 167 ---------------
  .../bindings/gpio/gpio-davinci.yaml           | 193 ++++++++++++++++++
  MAINTAINERS                                   |   2 +-
  3 files changed, 194 insertions(+), 168 deletions(-)
  delete mode 100644 Documentation/devicetree/bindings/gpio/gpio-davinci.txt
  create mode 100644 Documentation/devicetree/bindings/gpio/gpio-davinci.yaml
diff --git a/Documentation/devicetree/bindings/gpio/gpio-davinci.txt b/Documentation/devicetree/bindings/gpio/gpio-davinci.txt
deleted file mode 100644
index 696ea46227d1..000000000000
--- a/Documentation/devicetree/bindings/gpio/gpio-davinci.txt
+++ /dev/null
@@ -1,167 +0,0 @@
-Davinci/Keystone GPIO controller bindings
-
-Required Properties:
-- compatible: should be "ti,dm6441-gpio": for Davinci da850 SoCs
-                    "ti,keystone-gpio": for Keystone 2 66AK2H/K, 66AK2L,
-                                            66AK2E SoCs
-                    "ti,k2g-gpio", "ti,keystone-gpio": for 66AK2G
-                    "ti,am654-gpio", "ti,keystone-gpio": for TI K3 AM654
-                    "ti,j721e-gpio", "ti,keystone-gpio": for J721E SoCs
-                    "ti,am64-gpio", "ti,keystone-gpio": for AM64 SoCs
-
[...]
quoted
quoted
-};
diff --git a/Documentation/devicetree/bindings/gpio/gpio-davinci.yaml b/Documentation/devicetree/bindings/gpio/gpio-davinci.yaml
new file mode 100644
index 000000000000..1e16172669c7
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-davinci.yaml
@@ -0,0 +1,193 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/gpio/gpio-davinci.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: GPIO controller for Davinci and keystone devices
+
+maintainers:
+  - Keerthy <j-keerthy@ti.com>
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - ti,k2g-gpio
+              - ti,am654-gpio
+              - ti,j721e-gpio
+              - ti,am64-gpio
+          - const: ti,keystone-gpio
+
+      - items:
+          - const: ti,dm6441-gpio
+      - items:
+          - const: ti,keystone-gpio
These 2 can be expressed as an 'enum'.
quoted
+
+  reg:
+    maxItems: 1
+    description:
+      Physical base address of the controller and the size of memory mapped registers.
Drop. That's every 'reg' property.
quoted
+
+  gpio-controller: true
+
+  gpio-ranges: true
+
+  gpio-line-names:
+    description: strings describing the names of each gpio line.
Any constraints like min/max number of lines?
quoted
+
+  "#gpio-cells":
+    const: 2
+    description:
+      first cell is the pin number and second cell is used to specify optional parameters (unused).
+
+  interrupts:
+    description:
+      Array of GPIO interrupt number. Only banked or unbanked IRQs are supported at a time.
Needs constraints. How many items and what are they?
quoted
+
+  ti,ngpio:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: The number of GPIO pins supported consecutively.
+    minimum: 1
+
+  ti,davinci-gpio-unbanked:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: The number of GPIOs that have an individual interrupt line to processor.
+    minimum: 0
+
+  clocks:
+    maxItems: 1
+    description:
+      clock-specifier to represent input to the GPIO controller.
Drop description.
quoted
+
+  clock-names:
+    const: gpio
+
+  interrupt-controller: true
+
+  power-domains:
+    maxItems: 1
+    description:
+      Phandle to the power domain provider node.
Drop.
quoted
+
+  "#interrupt-cells":
+    const: 2
+
+patternProperties:
+  "-hog$":
+    type: object
+    properties:
+      gpios: true
+      gpio-hog: true
+      input: true
+      output-high: true
+      output-low: true
+      line-name: true
+
+    required:
+      - gpio-hog
+      - gpios
I see that gpio-hog.yaml dtschema has been added.
Can it be reused here and how?
It's applied to any node containing 'gpio-hog' property, so all you need is:

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