devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 2/2] dt-bindings: gpio: Add devicetree binding for IDT 79RC3243x GPIO controller
       [not found] <20210421162026.41978-1-tsbogend@alpha.franken.de>
@ 2021-04-21 16:20 ` Thomas Bogendoerfer
  2021-04-21 17:17   ` Rob Herring
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Bogendoerfer @ 2021-04-21 16:20 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Rob Herring, linux-gpio,
	devicetree, linux-kernel

Add YAML devicetree binding for IDT 79RC3243x GPIO controller

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
---
 .../bindings/gpio/gpio-idt3243x.yaml          | 73 +++++++++++++++++++
 1 file changed, 73 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpio/gpio-idt3243x.yaml

diff --git a/Documentation/devicetree/bindings/gpio/gpio-idt3243x.yaml b/Documentation/devicetree/bindings/gpio/gpio-idt3243x.yaml
new file mode 100644
index 000000000000..346a57ef8298
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-idt3243x.yaml
@@ -0,0 +1,73 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/gpio/gpio-idt3243x.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: IDT 79RC32434x GPIO controller
+
+maintainers:
+  - Thomas Bogendoerfer <tsbogend@alpha.franken.de>
+
+properties:
+  compatible:
+    const: idt,3243x-gpio
+
+  reg:
+    maxItems: 2
+
+  reg-names:
+    items:
+      - const: gpio
+      - const: pic
+
+  gpio-controller: true
+
+  "#gpio-cells":
+    const: 2
+
+  ngpios:
+    description:
+      Number of available gpios in a bank.
+    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: interrupt-controller@50000 {
+        compatible = "idt,3243x-gpio";
+        reg = <0x50000 0x14>, <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] 4+ messages in thread

* Re: [PATCH v2 2/2] dt-bindings: gpio: Add devicetree binding for IDT 79RC3243x GPIO controller
  2021-04-21 16:20 ` [PATCH v2 2/2] dt-bindings: gpio: Add devicetree binding for IDT 79RC3243x GPIO controller Thomas Bogendoerfer
@ 2021-04-21 17:17   ` Rob Herring
  2021-04-21 17:39     ` Thomas Bogendoerfer
  0 siblings, 1 reply; 4+ messages in thread
From: Rob Herring @ 2021-04-21 17:17 UTC (permalink / raw)
  To: Thomas Bogendoerfer
  Cc: Linus Walleij, Bartosz Golaszewski, linux-gpio, devicetree,
	linux-kernel

On Wed, Apr 21, 2021 at 06:20:26PM +0200, Thomas Bogendoerfer wrote:
> Add YAML devicetree binding for IDT 79RC3243x GPIO controller
> 
> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> ---
>  .../bindings/gpio/gpio-idt3243x.yaml          | 73 +++++++++++++++++++

Use compatible string for filename.

>  1 file changed, 73 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/gpio/gpio-idt3243x.yaml
> 
> diff --git a/Documentation/devicetree/bindings/gpio/gpio-idt3243x.yaml b/Documentation/devicetree/bindings/gpio/gpio-idt3243x.yaml
> new file mode 100644
> index 000000000000..346a57ef8298
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/gpio/gpio-idt3243x.yaml
> @@ -0,0 +1,73 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/gpio/gpio-idt3243x.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: IDT 79RC32434x GPIO controller
> +
> +maintainers:
> +  - Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> +
> +properties:
> +  compatible:
> +    const: idt,3243x-gpio

What's the 'x'? Generally, we don't do wildcards for compatible strings.

> +
> +  reg:
> +    maxItems: 2
> +
> +  reg-names:
> +    items:
> +      - const: gpio
> +      - const: pic
> +
> +  gpio-controller: true
> +
> +  "#gpio-cells":
> +    const: 2
> +
> +  ngpios:
> +    description:
> +      Number of available gpios in a bank.

That's every 'ngpios'. Drop.

> +    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: interrupt-controller@50000 {

gpio@...

As generally it's primarily a GPIO controller and secondarily an 
interrupt controller.

> +        compatible = "idt,3243x-gpio";
> +        reg = <0x50000 0x14>, <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	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 2/2] dt-bindings: gpio: Add devicetree binding for IDT 79RC3243x GPIO controller
  2021-04-21 17:17   ` Rob Herring
@ 2021-04-21 17:39     ` Thomas Bogendoerfer
  2021-04-22 13:45       ` Rob Herring
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Bogendoerfer @ 2021-04-21 17:39 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Bartosz Golaszewski, linux-gpio, devicetree,
	linux-kernel

On Wed, Apr 21, 2021 at 12:17:27PM -0500, Rob Herring wrote:
> On Wed, Apr 21, 2021 at 06:20:26PM +0200, Thomas Bogendoerfer wrote:
> > Add YAML devicetree binding for IDT 79RC3243x GPIO controller
> > 
> > Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> > ---
> >  .../bindings/gpio/gpio-idt3243x.yaml          | 73 +++++++++++++++++++
> 
> Use compatible string for filename.

ok

> >  1 file changed, 73 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/gpio/gpio-idt3243x.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/gpio/gpio-idt3243x.yaml b/Documentation/devicetree/bindings/gpio/gpio-idt3243x.yaml
> > new file mode 100644
> > index 000000000000..346a57ef8298
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/gpio/gpio-idt3243x.yaml
> > @@ -0,0 +1,73 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/gpio/gpio-idt3243x.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: IDT 79RC32434x GPIO controller
> > +
> > +maintainers:
> > +  - Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> > +
> > +properties:
> > +  compatible:
> > +    const: idt,3243x-gpio
> 
> What's the 'x'? Generally, we don't do wildcards for compatible strings.

there are 3 different SoCs 79rc32434, 79rc32435 and 79rc32438. So should
I add 3 compatible strings and use the first as filename ?

> > +  ngpios:
> > +    description:
> > +      Number of available gpios in a bank.
> 
> That's every 'ngpios'. Drop.

ok.

> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    gpio0: interrupt-controller@50000 {
> 
> gpio@...
> 
> As generally it's primarily a GPIO controller and secondarily an 
> interrupt controller.

ok.

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] 4+ messages in thread

* Re: [PATCH v2 2/2] dt-bindings: gpio: Add devicetree binding for IDT 79RC3243x GPIO controller
  2021-04-21 17:39     ` Thomas Bogendoerfer
@ 2021-04-22 13:45       ` Rob Herring
  0 siblings, 0 replies; 4+ messages in thread
From: Rob Herring @ 2021-04-22 13:45 UTC (permalink / raw)
  To: Thomas Bogendoerfer
  Cc: Linus Walleij, Bartosz Golaszewski, open list:GPIO SUBSYSTEM,
	devicetree, linux-kernel@vger.kernel.org

On Wed, Apr 21, 2021 at 12:40 PM Thomas Bogendoerfer
<tsbogend@alpha.franken.de> wrote:
>
> On Wed, Apr 21, 2021 at 12:17:27PM -0500, Rob Herring wrote:
> > On Wed, Apr 21, 2021 at 06:20:26PM +0200, Thomas Bogendoerfer wrote:
> > > Add YAML devicetree binding for IDT 79RC3243x GPIO controller
> > >
> > > Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> > > ---
> > >  .../bindings/gpio/gpio-idt3243x.yaml          | 73 +++++++++++++++++++
> >
> > Use compatible string for filename.
>
> ok
>
> > >  1 file changed, 73 insertions(+)
> > >  create mode 100644 Documentation/devicetree/bindings/gpio/gpio-idt3243x.yaml
> > >
> > > diff --git a/Documentation/devicetree/bindings/gpio/gpio-idt3243x.yaml b/Documentation/devicetree/bindings/gpio/gpio-idt3243x.yaml
> > > new file mode 100644
> > > index 000000000000..346a57ef8298
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/gpio/gpio-idt3243x.yaml
> > > @@ -0,0 +1,73 @@
> > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > > +%YAML 1.2
> > > +---
> > > +$id: http://devicetree.org/schemas/gpio/gpio-idt3243x.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: IDT 79RC32434x GPIO controller
> > > +
> > > +maintainers:
> > > +  - Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> > > +
> > > +properties:
> > > +  compatible:
> > > +    const: idt,3243x-gpio
> >
> > What's the 'x'? Generally, we don't do wildcards for compatible strings.
>
> there are 3 different SoCs 79rc32434, 79rc32435 and 79rc32438. So should
> I add 3 compatible strings and use the first as filename ?

Kind of depends on the differences. If it is just fuse or packaging
differences between them, then probably okay to use the same
compatible. If the block is maybe the same, but not certain, then then
you can make the oldest a fallback (e.g. compatible =
"idt,32435-gpio", "idt,32434-gpio").

Either the first/oldest or a wildcard is fine for the filename.

Rob

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

end of thread, other threads:[~2021-04-22 13:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20210421162026.41978-1-tsbogend@alpha.franken.de>
2021-04-21 16:20 ` [PATCH v2 2/2] dt-bindings: gpio: Add devicetree binding for IDT 79RC3243x GPIO controller Thomas Bogendoerfer
2021-04-21 17:17   ` Rob Herring
2021-04-21 17:39     ` Thomas Bogendoerfer
2021-04-22 13:45       ` Rob Herring

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