LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] dt-bindings: gpio: Convert Arm PL061 to json-schema
@ 2019-05-14  0:50 Rob Herring
  2019-05-24 11:38 ` Linus Walleij
  0 siblings, 1 reply; 5+ messages in thread
From: Rob Herring @ 2019-05-14  0:50 UTC (permalink / raw)
  To: linus.walleij; +Cc: devicetree, linux-kernel, Bartosz Golaszewski, linux-gpio

Convert the Arm PL061 GPIO controller binding to json-schema format.

As I'm the author for all but the gpio-ranges line, make the schema dual
GPL/BSD license.

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
This warns on a few platforms missing clocks, interrupt-controller 
and/or #interrupt-cells. We could not make those required, but really 
they should be IMO. OTOH, it's platforms like Spear and Calxeda which 
aren't too active, so I don't know that we want to fix them.

 .../devicetree/bindings/gpio/pl061-gpio.txt   | 10 ---
 .../devicetree/bindings/gpio/pl061-gpio.yaml  | 69 +++++++++++++++++++
 2 files changed, 69 insertions(+), 10 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/gpio/pl061-gpio.txt
 create mode 100644 Documentation/devicetree/bindings/gpio/pl061-gpio.yaml

diff --git a/Documentation/devicetree/bindings/gpio/pl061-gpio.txt b/Documentation/devicetree/bindings/gpio/pl061-gpio.txt
deleted file mode 100644
index 89058d375b7c..000000000000
--- a/Documentation/devicetree/bindings/gpio/pl061-gpio.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-ARM PL061 GPIO controller
-
-Required properties:
-- compatible : "arm,pl061", "arm,primecell"
-- #gpio-cells : Should be two. The first cell is the pin number and the
-  second cell is used to specify optional parameters:
-  - bit 0 specifies polarity (0 for normal, 1 for inverted)
-- gpio-controller : Marks the device node as a GPIO controller.
-- interrupts : Interrupt mapping for GPIO IRQ.
-- gpio-ranges : Interaction with the PINCTRL subsystem.
diff --git a/Documentation/devicetree/bindings/gpio/pl061-gpio.yaml b/Documentation/devicetree/bindings/gpio/pl061-gpio.yaml
new file mode 100644
index 000000000000..313b17229247
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/pl061-gpio.yaml
@@ -0,0 +1,69 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/gpio/pl061-gpio.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ARM PL061 GPIO controller
+
+maintainers:
+  - Linus Walleij <linus.walleij@linaro.org>
+  - Rob Herring <robh@kernel.org>
+
+# We need a select here so we don't match all nodes with 'arm,primecell'
+select:
+  properties:
+    compatible:
+      contains:
+        const: arm,pl061
+  required:
+    - compatible
+
+properties:
+  $nodename:
+    pattern: "^gpio@[0-9a-f]+$"
+
+  compatible:
+    items:
+      - const: arm,pl061
+      - const: arm,primecell
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    oneOf:
+      - maxItems: 1
+      - maxItems: 8
+
+  interrupt-controller: true
+
+  "#interrupt-cells":
+    const: 2
+
+  clocks:
+    maxItems: 1
+
+  clock-names: true
+
+  "#gpio-cells":
+    const: 2
+
+  gpio-controller: true
+
+  gpio-ranges:
+    maxItems: 8
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - interrupt-controller
+  - "#interrupt-cells"
+  - clocks
+  - "#gpio-cells"
+  - gpio-controller
+
+additionalProperties: false
+
+...
-- 
2.20.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] dt-bindings: gpio: Convert Arm PL061 to json-schema
  2019-05-14  0:50 [PATCH] dt-bindings: gpio: Convert Arm PL061 to json-schema Rob Herring
@ 2019-05-24 11:38 ` Linus Walleij
  2019-05-27  6:41   ` Viresh Kumar
  0 siblings, 1 reply; 5+ messages in thread
From: Linus Walleij @ 2019-05-24 11:38 UTC (permalink / raw)
  To: Rob Herring, viresh kumar
  Cc: open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	linux-kernel, Bartosz Golaszewski, open list:GPIO SUBSYSTEM

On Tue, May 14, 2019 at 2:50 AM Rob Herring <robh@kernel.org> wrote:

> Convert the Arm PL061 GPIO controller binding to json-schema format.
>
> As I'm the author for all but the gpio-ranges line, make the schema dual
> GPL/BSD license.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> Cc: linux-gpio@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>

Patch applied. As you know I am already a big fan of this scheme.

> This warns on a few platforms missing clocks, interrupt-controller
> and/or #interrupt-cells. We could not make those required, but really
> they should be IMO. OTOH, it's platforms like Spear and Calxeda which
> aren't too active, so I don't know that we want to fix them.

What works for you works for me.

We could add dummy fixed clocks in the DTS files if
we wanted I suppose. The #interrupt-cells and interrupt-controller
things we can just fix, but I wonder what the maintainers of these
platforms are up to? Isn't Calxeda yours, and could Viresh fix
up the SPEAr?

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] dt-bindings: gpio: Convert Arm PL061 to json-schema
  2019-05-24 11:38 ` Linus Walleij
@ 2019-05-27  6:41   ` Viresh Kumar
  2019-06-11 19:54     ` Rob Herring
  0 siblings, 1 reply; 5+ messages in thread
From: Viresh Kumar @ 2019-05-27  6:41 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Rob Herring,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	linux-kernel, Bartosz Golaszewski, open list:GPIO SUBSYSTEM

On 24-05-19, 13:38, Linus Walleij wrote:
> On Tue, May 14, 2019 at 2:50 AM Rob Herring <robh@kernel.org> wrote:
> 
> > Convert the Arm PL061 GPIO controller binding to json-schema format.
> >
> > As I'm the author for all but the gpio-ranges line, make the schema dual
> > GPL/BSD license.
> >
> > Cc: Linus Walleij <linus.walleij@linaro.org>
> > Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > Cc: linux-gpio@vger.kernel.org
> > Signed-off-by: Rob Herring <robh@kernel.org>
> 
> Patch applied. As you know I am already a big fan of this scheme.
> 
> > This warns on a few platforms missing clocks, interrupt-controller
> > and/or #interrupt-cells. We could not make those required, but really
> > they should be IMO. OTOH, it's platforms like Spear and Calxeda which
> > aren't too active, so I don't know that we want to fix them.
> 
> What works for you works for me.
> 
> We could add dummy fixed clocks in the DTS files if
> we wanted I suppose. The #interrupt-cells and interrupt-controller
> things we can just fix, but I wonder what the maintainers of these
> platforms are up to? Isn't Calxeda yours, and could Viresh fix
> up the SPEAr?

I checked SPEAr and it is missing interrupt-controller at few places and clocks
everywhere. Missing clocks should be fine as SPEAr doesn't get clocks from DT.

And interrupt-controller can be just added, I don't think there would be any
platform dependent side-affects ?

-- 
viresh

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] dt-bindings: gpio: Convert Arm PL061 to json-schema
  2019-05-27  6:41   ` Viresh Kumar
@ 2019-06-11 19:54     ` Rob Herring
  2019-06-12  3:19       ` Viresh Kumar
  0 siblings, 1 reply; 5+ messages in thread
From: Rob Herring @ 2019-06-11 19:54 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Linus Walleij,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	linux-kernel, Bartosz Golaszewski, open list:GPIO SUBSYSTEM

On Mon, May 27, 2019 at 12:41 AM Viresh Kumar <viresh.kumar@linaro.org> wrote:
>
> On 24-05-19, 13:38, Linus Walleij wrote:
> > On Tue, May 14, 2019 at 2:50 AM Rob Herring <robh@kernel.org> wrote:
> >
> > > Convert the Arm PL061 GPIO controller binding to json-schema format.
> > >
> > > As I'm the author for all but the gpio-ranges line, make the schema dual
> > > GPL/BSD license.
> > >
> > > Cc: Linus Walleij <linus.walleij@linaro.org>
> > > Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > > Cc: linux-gpio@vger.kernel.org
> > > Signed-off-by: Rob Herring <robh@kernel.org>
> >
> > Patch applied. As you know I am already a big fan of this scheme.
> >
> > > This warns on a few platforms missing clocks, interrupt-controller
> > > and/or #interrupt-cells. We could not make those required, but really
> > > they should be IMO. OTOH, it's platforms like Spear and Calxeda which
> > > aren't too active, so I don't know that we want to fix them.
> >
> > What works for you works for me.
> >
> > We could add dummy fixed clocks in the DTS files if
> > we wanted I suppose. The #interrupt-cells and interrupt-controller
> > things we can just fix, but I wonder what the maintainers of these
> > platforms are up to? Isn't Calxeda yours, and could Viresh fix
> > up the SPEAr?

I was hoping to delete Calxeda rather than fix. I'm pretty sure none
of the distros are using the systems anymore and they were the main
users for a while. Otherwise, I would have converted all the bindings
it uses.

> I checked SPEAr and it is missing interrupt-controller at few places and clocks
> everywhere. Missing clocks should be fine as SPEAr doesn't get clocks from DT.

Clocks not from DT was supposed to be a transitional thing...

>
> And interrupt-controller can be just added, I don't think there would be any
> platform dependent side-affects ?

There shouldn't be.

Rob

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] dt-bindings: gpio: Convert Arm PL061 to json-schema
  2019-06-11 19:54     ` Rob Herring
@ 2019-06-12  3:19       ` Viresh Kumar
  0 siblings, 0 replies; 5+ messages in thread
From: Viresh Kumar @ 2019-06-12  3:19 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	linux-kernel, Bartosz Golaszewski, open list:GPIO SUBSYSTEM

On 11-06-19, 13:54, Rob Herring wrote:
> On Mon, May 27, 2019 at 12:41 AM Viresh Kumar <viresh.kumar@linaro.org> wrote:
> > I checked SPEAr and it is missing interrupt-controller at few places and clocks
> > everywhere. Missing clocks should be fine as SPEAr doesn't get clocks from DT.
> 
> Clocks not from DT was supposed to be a transitional thing...

Right, but by the time I left ST in 2012, mainline clock's DT support
wasn't there and the SPEAr core team got fired soon after that. No one
was left in ST to do the porting, but there are still people using the
SPEAr boards and there are products in market, so we can't delete the
platform as well.

So, no one is going to add clock DT support now.

> > And interrupt-controller can be just added, I don't think there would be any
> > platform dependent side-affects ?
> 
> There shouldn't be.

Okay, will send a patch for that then.

-- 
viresh

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-06-12  3:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-14  0:50 [PATCH] dt-bindings: gpio: Convert Arm PL061 to json-schema Rob Herring
2019-05-24 11:38 ` Linus Walleij
2019-05-27  6:41   ` Viresh Kumar
2019-06-11 19:54     ` Rob Herring
2019-06-12  3:19       ` Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).