diff mbox series

[v3,4/5] dt-bindings: gpio: convert Atmel GPIO to json-schema

Message ID 20240709092354.191643-5-manikandan.m@microchip.com (mailing list archive)
State New, archived
Headers show
Series Convert Atmel PIO3 Pinctrl and GPIO bindings to yaml | expand

Commit Message

Manikandan Muralidharan July 9, 2024, 9:23 a.m. UTC
Convert the Atmel GPIO controller binding document to DT schema format
using json-schema.
The at91 pinctrl driver uses "atmel,at91rm9200-gpio" compatible string
to find the number of active GPIO banks and identify the pinmux nodes.
"atmel,at91sam9x5-gpio" and "microchip,sam9x60-gpio" have additional
registers to handle drive-strength, slew-rate,  pull-down to drive the
pinmux configs.
The new compatible string "microchip,sam9x7-gpio" is added.

Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
---
changes in v2:

- Fix bot errors with 'make dt_binding_check', missed to add
"atmel,at91rm9200-gpio" as separate compatible for devices that uses it
- Remove label from example
- Add default entry for #gpio-lines property
- Add new compatible string details in commit message
---
 .../bindings/gpio/atmel,at91rm9200-gpio.yaml  | 81 +++++++++++++++++++
 .../devicetree/bindings/gpio/gpio_atmel.txt   | 31 -------
 2 files changed, 81 insertions(+), 31 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/gpio/atmel,at91rm9200-gpio.yaml
 delete mode 100644 Documentation/devicetree/bindings/gpio/gpio_atmel.txt

Comments

Bartosz Golaszewski July 9, 2024, 11:25 a.m. UTC | #1
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>


On Tue, 09 Jul 2024 14:53:53 +0530, Manikandan Muralidharan wrote:
> Convert the Atmel GPIO controller binding document to DT schema format
> using json-schema.
> The at91 pinctrl driver uses "atmel,at91rm9200-gpio" compatible string
> to find the number of active GPIO banks and identify the pinmux nodes.
> "atmel,at91sam9x5-gpio" and "microchip,sam9x60-gpio" have additional
> registers to handle drive-strength, slew-rate,  pull-down to drive the
> pinmux configs.
> The new compatible string "microchip,sam9x7-gpio" is added.
> 
> [...]

Applied, thanks!

[4/5] dt-bindings: gpio: convert Atmel GPIO to json-schema
      commit: 337049890b8cbbb4fb527c58976ea19f4dc747a0

Best regards,
Rob Herring July 9, 2024, 3:54 p.m. UTC | #2
On Tue, Jul 09, 2024 at 01:25:51PM +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> 
> 
> On Tue, 09 Jul 2024 14:53:53 +0530, Manikandan Muralidharan wrote:
> > Convert the Atmel GPIO controller binding document to DT schema format
> > using json-schema.
> > The at91 pinctrl driver uses "atmel,at91rm9200-gpio" compatible string
> > to find the number of active GPIO banks and identify the pinmux nodes.
> > "atmel,at91sam9x5-gpio" and "microchip,sam9x60-gpio" have additional
> > registers to handle drive-strength, slew-rate,  pull-down to drive the
> > pinmux configs.
> > The new compatible string "microchip,sam9x7-gpio" is added.
> > 
> > [...]
> 
> Applied, thanks!
> 
> [4/5] dt-bindings: gpio: convert Atmel GPIO to json-schema
>       commit: 337049890b8cbbb4fb527c58976ea19f4dc747a0

Patch 5 depends on this one.

Rob
Bartosz Golaszewski July 9, 2024, 4:05 p.m. UTC | #3
On Tue, Jul 9, 2024 at 5:54 PM Rob Herring <robh@kernel.org> wrote:
>
> On Tue, Jul 09, 2024 at 01:25:51PM +0200, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> >
> >
> > On Tue, 09 Jul 2024 14:53:53 +0530, Manikandan Muralidharan wrote:
> > > Convert the Atmel GPIO controller binding document to DT schema format
> > > using json-schema.
> > > The at91 pinctrl driver uses "atmel,at91rm9200-gpio" compatible string
> > > to find the number of active GPIO banks and identify the pinmux nodes.
> > > "atmel,at91sam9x5-gpio" and "microchip,sam9x60-gpio" have additional
> > > registers to handle drive-strength, slew-rate,  pull-down to drive the
> > > pinmux configs.
> > > The new compatible string "microchip,sam9x7-gpio" is added.
> > >
> > > [...]
> >
> > Applied, thanks!
> >
> > [4/5] dt-bindings: gpio: convert Atmel GPIO to json-schema
> >       commit: 337049890b8cbbb4fb527c58976ea19f4dc747a0
>
> Patch 5 depends on this one.
>
> Rob

Oops. Linus, I see you already acked it. Do you mind me taking it via
the GPIO tree to avoid rebasing the tree?

Bart
Linus Walleij Aug. 5, 2024, 7:21 a.m. UTC | #4
On Tue, Jul 9, 2024 at 6:05 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:

> > Patch 5 depends on this one.
> >
> > Rob
>
> Oops. Linus, I see you already acked it. Do you mind me taking it via
> the GPIO tree to avoid rebasing the tree?

Too late response from me, go ahead now or I can merge it if
that is better.

Linus Walleij
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/gpio/atmel,at91rm9200-gpio.yaml b/Documentation/devicetree/bindings/gpio/atmel,at91rm9200-gpio.yaml
new file mode 100644
index 000000000000..3dd70933ed8e
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/atmel,at91rm9200-gpio.yaml
@@ -0,0 +1,81 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/gpio/atmel,at91rm9200-gpio.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip GPIO controller (PIO)
+
+maintainers:
+  - Manikandan Muralidharan <manikandan.m@microchip.com>
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - atmel,at91sam9x5-gpio
+              - microchip,sam9x60-gpio
+          - const: atmel,at91rm9200-gpio
+      - items:
+          - enum:
+              - microchip,sam9x7-gpio
+          - const: microchip,sam9x60-gpio
+          - const: atmel,at91rm9200-gpio
+      - items:
+          - const: atmel,at91rm9200-gpio
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  interrupt-controller: true
+
+  "#interrupt-cells":
+    const: 2
+
+  gpio-controller: true
+  gpio-line-names: true
+
+  "#gpio-cells":
+    const: 2
+
+  clocks:
+    maxItems: 1
+
+  "#gpio-lines":
+    description:
+      Number of gpio, 32 by default if absent
+    maxItems: 1
+    default: 32
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - interrupt-controller
+  - "#interrupt-cells"
+  - gpio-controller
+  - "#gpio-cells"
+  - clocks
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/at91.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    gpio@fffff400 {
+            compatible = "atmel,at91rm9200-gpio";
+            reg = <0xfffff400 0x200>;
+            interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>;
+            #gpio-cells = <2>;
+            gpio-controller;
+            interrupt-controller;
+            #interrupt-cells = <2>;
+            clocks = <&pmc PMC_TYPE_PERIPHERAL 2>;
+    };
+...
diff --git a/Documentation/devicetree/bindings/gpio/gpio_atmel.txt b/Documentation/devicetree/bindings/gpio/gpio_atmel.txt
deleted file mode 100644
index 29416f9c3220..000000000000
--- a/Documentation/devicetree/bindings/gpio/gpio_atmel.txt
+++ /dev/null
@@ -1,31 +0,0 @@ 
-* Atmel GPIO controller (PIO)
-
-Required properties:
-- compatible: "atmel,<chip>-gpio", where <chip> is at91rm9200 or at91sam9x5.
-- reg: Should contain GPIO controller registers location and length
-- interrupts: Should be the port interrupt shared by all the pins.
-- #gpio-cells: Should be two.  The first cell is the pin number and
-  the second cell is used to specify optional parameters to declare if the GPIO
-  is active high or low. See gpio.txt.
-- gpio-controller: Marks the device node as a GPIO controller.
-- interrupt-controller: Marks the device node as an interrupt controller.
-- #interrupt-cells: Should be two. The first cell is the pin number and the
-  second cell is used to specify irq type flags, see the two cell description
-  in interrupt-controller/interrupts.txt for details.
-
-optional properties:
-- #gpio-lines: Number of gpio if absent 32.
-
-
-Example:
-	pioA: gpio@fffff200 {
-		compatible = "atmel,at91rm9200-gpio";
-		reg = <0xfffff200 0x100>;
-		interrupts = <2 4>;
-		#gpio-cells = <2>;
-		gpio-controller;
-		#gpio-lines = <19>;
-		interrupt-controller;
-		#interrupt-cells = <2>;
-	};
-