devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 2/2] dt-bindings: gpio: Add devicetree binding for IDT 79RC32434 GPIO controller
       [not found] <20210426095426.118356-1-tsbogend@alpha.franken.de>
@ 2021-04-26  9:54 ` Thomas Bogendoerfer
  2021-04-30 20:19   ` Rob Herring
  2021-05-01 12:13   ` Linus Walleij
  0 siblings, 2 replies; 6+ messages in thread
From: Thomas Bogendoerfer @ 2021-04-26  9:54 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Rob Herring, linux-gpio,
	devicetree, linux-kernel

Add YAML devicetree binding for IDT 79RC32434 GPIO controller

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
---
Changes in v4:
 - renamed to idt,32434-gpio this time for real

Changes in v3:
 - renamed to idt,32434-gpio
 - drop ngpio description
 - use gpio0: gpio@50004 in example

 .../bindings/gpio/idt,32434-gpio.yaml         | 71 +++++++++++++++++++
 1 file changed, 71 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpio/idt,32434-gpio.yaml

diff --git a/Documentation/devicetree/bindings/gpio/idt,32434-gpio.yaml b/Documentation/devicetree/bindings/gpio/idt,32434-gpio.yaml
new file mode 100644
index 000000000000..517d14b6c2e2
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/idt,32434-gpio.yaml
@@ -0,0 +1,71 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/gpio/idt,32434-gpio.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: IDT 79RC32434 GPIO controller
+
+maintainers:
+  - Thomas Bogendoerfer <tsbogend@alpha.franken.de>
+
+properties:
+  compatible:
+    const: idt,32434-gpio
+
+  reg:
+    maxItems: 2
+
+  reg-names:
+    items:
+      - const: gpio
+      - const: pic
+
+  gpio-controller: true
+
+  "#gpio-cells":
+    const: 2
+
+  ngpios:
+    minimum: 1
+    maximum: 32
+
+  interrupt-controller: true
+
+  "#interrupt-cells":
+    const: 2
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - reg-names
+  - gpio-controller
+  - "#gpio-cells"
+  - ngpios
+  - interrupt-controller
+  - "#interrupt-cells"
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    gpio0: gpio@50004 {
+        compatible = "idt,32434-gpio";
+        reg = <0x50004 0x10>, <0x38030 0x0c>;
+        reg-names = "gpio", "pic";
+
+        interrupt-controller;
+        #interrupt-cells = <2>;
+
+        interrupt-parent = <&cpuintc>;
+        interrupts = <6>;
+
+        gpio-controller;
+        #gpio-cells = <2>;
+
+        ngpios = <14>;
+    };
-- 
2.29.2


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

* Re: [PATCH v4 2/2] dt-bindings: gpio: Add devicetree binding for IDT 79RC32434 GPIO controller
  2021-04-26  9:54 ` [PATCH v4 2/2] dt-bindings: gpio: Add devicetree binding for IDT 79RC32434 GPIO controller Thomas Bogendoerfer
@ 2021-04-30 20:19   ` Rob Herring
  2021-05-01 12:13   ` Linus Walleij
  1 sibling, 0 replies; 6+ messages in thread
From: Rob Herring @ 2021-04-30 20:19 UTC (permalink / raw)
  To: Thomas Bogendoerfer
  Cc: Linus Walleij, linux-gpio, linux-kernel, devicetree,
	Bartosz Golaszewski, Rob Herring

On Mon, 26 Apr 2021 11:54:26 +0200, Thomas Bogendoerfer wrote:
> Add YAML devicetree binding for IDT 79RC32434 GPIO controller
> 
> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> ---
> Changes in v4:
>  - renamed to idt,32434-gpio this time for real
> 
> Changes in v3:
>  - renamed to idt,32434-gpio
>  - drop ngpio description
>  - use gpio0: gpio@50004 in example
> 
>  .../bindings/gpio/idt,32434-gpio.yaml         | 71 +++++++++++++++++++
>  1 file changed, 71 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/gpio/idt,32434-gpio.yaml
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH v4 2/2] dt-bindings: gpio: Add devicetree binding for IDT 79RC32434 GPIO controller
  2021-04-26  9:54 ` [PATCH v4 2/2] dt-bindings: gpio: Add devicetree binding for IDT 79RC32434 GPIO controller Thomas Bogendoerfer
  2021-04-30 20:19   ` Rob Herring
@ 2021-05-01 12:13   ` Linus Walleij
  2021-05-04 13:44     ` Rob Herring
  2021-05-11 21:13     ` Thomas Bogendoerfer
  1 sibling, 2 replies; 6+ messages in thread
From: Linus Walleij @ 2021-05-01 12:13 UTC (permalink / raw)
  To: Thomas Bogendoerfer
  Cc: Bartosz Golaszewski, Rob Herring, open list:GPIO SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	linux-kernel

On Mon, Apr 26, 2021 at 11:54 AM Thomas Bogendoerfer
<tsbogend@alpha.franken.de> wrote:

> Add YAML devicetree binding for IDT 79RC32434 GPIO controller
>
> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> ---
> Changes in v4:
>  - renamed to idt,32434-gpio this time for real

Overall looks good to me.

> +required:
(...)
> +  - ngpios

Is there a *technical* reason why this is required?

Can't the driver just default to 32 gpios when not specified?

> +  - interrupt-controller
> +  - "#interrupt-cells"
> +  - interrupts

Why can't interrupt support be made optional?

It is fine if the driver errors out if not provided, but
for the bindings this feels optional.

Or does the thing break unless you handle the IRQs?

Yours,
Linus Walleij

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

* Re: [PATCH v4 2/2] dt-bindings: gpio: Add devicetree binding for IDT 79RC32434 GPIO controller
  2021-05-01 12:13   ` Linus Walleij
@ 2021-05-04 13:44     ` Rob Herring
  2021-05-06 11:11       ` Linus Walleij
  2021-05-11 21:13     ` Thomas Bogendoerfer
  1 sibling, 1 reply; 6+ messages in thread
From: Rob Herring @ 2021-05-04 13:44 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Thomas Bogendoerfer, Bartosz Golaszewski,
	open list:GPIO SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	linux-kernel

On Sat, May 1, 2021 at 7:13 AM Linus Walleij <linus.walleij@linaro.org> wrote:
>
> On Mon, Apr 26, 2021 at 11:54 AM Thomas Bogendoerfer
> <tsbogend@alpha.franken.de> wrote:
>
> > Add YAML devicetree binding for IDT 79RC32434 GPIO controller
> >
> > Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> > ---
> > Changes in v4:
> >  - renamed to idt,32434-gpio this time for real
>
> Overall looks good to me.
>
> > +required:
> (...)
> > +  - ngpios
>
> Is there a *technical* reason why this is required?
>
> Can't the driver just default to 32 gpios when not specified?
>
> > +  - interrupt-controller
> > +  - "#interrupt-cells"
> > +  - interrupts
>
> Why can't interrupt support be made optional?
>
> It is fine if the driver errors out if not provided, but
> for the bindings this feels optional.
>
> Or does the thing break unless you handle the IRQs?

If the hardware has interrupts, then we should describe that. It's the
OS driver that may or may not support interrupts.

Rob

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

* Re: [PATCH v4 2/2] dt-bindings: gpio: Add devicetree binding for IDT 79RC32434 GPIO controller
  2021-05-04 13:44     ` Rob Herring
@ 2021-05-06 11:11       ` Linus Walleij
  0 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2021-05-06 11:11 UTC (permalink / raw)
  To: Rob Herring
  Cc: Thomas Bogendoerfer, Bartosz Golaszewski,
	open list:GPIO SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	linux-kernel

On Tue, May 4, 2021 at 3:44 PM Rob Herring <robh+dt@kernel.org> wrote:
> On Sat, May 1, 2021 at 7:13 AM Linus Walleij <linus.walleij@linaro.org> wrote:

> > Why can't interrupt support be made optional?
(...)
>
> If the hardware has interrupts, then we should describe that. It's the
> OS driver that may or may not support interrupts.

You're right of course. What was I thinking.

Yours,
Linus Walleij

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

* Re: [PATCH v4 2/2] dt-bindings: gpio: Add devicetree binding for IDT 79RC32434 GPIO controller
  2021-05-01 12:13   ` Linus Walleij
  2021-05-04 13:44     ` Rob Herring
@ 2021-05-11 21:13     ` Thomas Bogendoerfer
  1 sibling, 0 replies; 6+ messages in thread
From: Thomas Bogendoerfer @ 2021-05-11 21:13 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Bartosz Golaszewski, Rob Herring, open list:GPIO SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	linux-kernel

On Sat, May 01, 2021 at 02:13:35PM +0200, Linus Walleij wrote:
> On Mon, Apr 26, 2021 at 11:54 AM Thomas Bogendoerfer
> <tsbogend@alpha.franken.de> wrote:
> 
> > Add YAML devicetree binding for IDT 79RC32434 GPIO controller
> >
> > Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> > ---
> > Changes in v4:
> >  - renamed to idt,32434-gpio this time for real
> 
> Overall looks good to me.
> 
> > +required:
> (...)
> > +  - ngpios
> 
> Is there a *technical* reason why this is required?
> 
> Can't the driver just default to 32 gpios when not specified?

sure, I make it optional.

> > +  - interrupt-controller
> > +  - "#interrupt-cells"
> > +  - interrupts
> 
> Why can't interrupt support be made optional?
> 
> It is fine if the driver errors out if not provided, but
> for the bindings this feels optional.

I'll make them optional.

> Or does the thing break unless you handle the IRQs?

no, they could be used just as GPIOs.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

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

end of thread, other threads:[~2021-05-11 21:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20210426095426.118356-1-tsbogend@alpha.franken.de>
2021-04-26  9:54 ` [PATCH v4 2/2] dt-bindings: gpio: Add devicetree binding for IDT 79RC32434 GPIO controller Thomas Bogendoerfer
2021-04-30 20:19   ` Rob Herring
2021-05-01 12:13   ` Linus Walleij
2021-05-04 13:44     ` Rob Herring
2021-05-06 11:11       ` Linus Walleij
2021-05-11 21:13     ` Thomas Bogendoerfer

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).