diff mbox series

[2/2] dt-bindings: gpio: Add gpio-latch binding document

Message ID 20220825094132.1268174-3-s.hauer@pengutronix.de
State Superseded
Headers show
Series gpio: Add gpio-latch driver | expand

Commit Message

Sascha Hauer Aug. 25, 2022, 9:41 a.m. UTC
This adds a binding for a GPIO multiplexer driver based on latches
connected to other GPIOs.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 .../devicetree/bindings/gpio/gpio-latch.yaml  | 83 +++++++++++++++++++
 1 file changed, 83 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpio/gpio-latch.yaml

Comments

Linus Walleij Aug. 26, 2022, 1:37 p.m. UTC | #1
On Thu, Aug 25, 2022 at 11:41 AM Sascha Hauer <s.hauer@pengutronix.de> wrote:

> This adds a binding for a GPIO multiplexer driver based on latches
> connected to other GPIOs.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Nice overall!

> +++ b/Documentation/devicetree/bindings/gpio/gpio-latch.yaml
> @@ -0,0 +1,83 @@
> +%YAML 1.2

No license?

> +  data-gpios:
> +    description: Array of GPIOs to be used as data GPIOs

Hm I wanted to just call these "gpios" but that is maybe confusing.
What about "latch-gpios"?

Yours,
Linus Walleij
Sascha Hauer Aug. 29, 2022, 2:40 p.m. UTC | #2
Hi Linus,

On Fri, Aug 26, 2022 at 03:37:40PM +0200, Linus Walleij wrote:
> On Thu, Aug 25, 2022 at 11:41 AM Sascha Hauer <s.hauer@pengutronix.de> wrote:
> 
> > This adds a binding for a GPIO multiplexer driver based on latches
> > connected to other GPIOs.
> >
> > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> 
> Nice overall!
> 
> > +++ b/Documentation/devicetree/bindings/gpio/gpio-latch.yaml
> > @@ -0,0 +1,83 @@
> > +%YAML 1.2
> 
> No license?

Will add in v2.

> 
> > +  data-gpios:
> > +    description: Array of GPIOs to be used as data GPIOs
> 
> Hm I wanted to just call these "gpios" but that is maybe confusing.
> What about "latch-gpios"?

Hm, the clk input is used to latch the current state of the inputs to
the outputs, so "latch-gpios" might even be confused with the GPIO
routed to the clk unput of the latch.  Overall, the whole thing is a
latch, so "latch-gpios" doesn't sound like a good name to distinguish
the different types of inputs of a latch.  I still like data-gpios best
as these lines are described as "Data inputs" in my 74273 data sheet.

Sascha
Linus Walleij Aug. 31, 2022, 12:40 p.m. UTC | #3
On Mon, Aug 29, 2022 at 4:40 PM Sascha Hauer <s.hauer@pengutronix.de> wrote:

> > Hm I wanted to just call these "gpios" but that is maybe confusing.
> > What about "latch-gpios"?
>
> Hm, the clk input is used to latch the current state of the inputs to
> the outputs, so "latch-gpios" might even be confused with the GPIO
> routed to the clk unput of the latch.  Overall, the whole thing is a
> latch, so "latch-gpios" doesn't sound like a good name to distinguish
> the different types of inputs of a latch.  I still like data-gpios best
> as these lines are described as "Data inputs" in my 74273 data sheet.

How about "latched-gpios" (notice the "d")

It makes some semantic sense.

But I will not nitpick, data is fine, just a bit unspecific.

Yours,
Linus Walleij
Sascha Hauer Sept. 1, 2022, 7:53 a.m. UTC | #4
On Wed, Aug 31, 2022 at 02:40:13PM +0200, Linus Walleij wrote:
> On Mon, Aug 29, 2022 at 4:40 PM Sascha Hauer <s.hauer@pengutronix.de> wrote:
> 
> > > Hm I wanted to just call these "gpios" but that is maybe confusing.
> > > What about "latch-gpios"?
> >
> > Hm, the clk input is used to latch the current state of the inputs to
> > the outputs, so "latch-gpios" might even be confused with the GPIO
> > routed to the clk unput of the latch.  Overall, the whole thing is a
> > latch, so "latch-gpios" doesn't sound like a good name to distinguish
> > the different types of inputs of a latch.  I still like data-gpios best
> > as these lines are described as "Data inputs" in my 74273 data sheet.
> 
> How about "latched-gpios" (notice the "d")

Fine with me.

Sascha
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/gpio/gpio-latch.yaml b/Documentation/devicetree/bindings/gpio/gpio-latch.yaml
new file mode 100644
index 0000000000000..0652c9d2130af
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-latch.yaml
@@ -0,0 +1,83 @@ 
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/gpio/gpio-latch.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: GPIO latch controller
+
+maintainers:
+  - Sascha Hauer <s.hauer@pengutronix.de>
+
+description: |
+  This binding describes a GPIO multiplexer based on latches connected to
+  other GPIOs, like this:
+
+  CLK0 ----------------------.        ,--------.
+  CLK1 -------------------.  `--------|>    #0 |
+                          |           |        |
+  OUT0 ----------------+--|-----------|D0    Q0|-----|<
+  OUT1 --------------+-|--|-----------|D1    Q1|-----|<
+  OUT2 ------------+-|-|--|-----------|D2    Q2|-----|<
+  OUT3 ----------+-|-|-|--|-----------|D3    Q3|-----|<
+  OUT4 --------+-|-|-|-|--|-----------|D4    Q4|-----|<
+  OUT5 ------+-|-|-|-|-|--|-----------|D5    Q5|-----|<
+  OUT6 ----+-|-|-|-|-|-|--|-----------|D6    Q6|-----|<
+  OUT7 --+-|-|-|-|-|-|-|--|-----------|D7    Q7|-----|<
+         | | | | | | | |  |           `--------'
+         | | | | | | | |  |
+         | | | | | | | |  |           ,--------.
+         | | | | | | | |  `-----------|>    #1 |
+         | | | | | | | |              |        |
+         | | | | | | | `--------------|D0    Q0|-----|<
+         | | | | | | `----------------|D1    Q1|-----|<
+         | | | | | `------------------|D2    Q2|-----|<
+         | | | | `--------------------|D3    Q3|-----|<
+         | | | `----------------------|D4    Q4|-----|<
+         | | `------------------------|D5    Q5|-----|<
+         | `--------------------------|D6    Q6|-----|<
+         `----------------------------|D7    Q7|-----|<
+                                      `--------'
+
+  The number of clk-gpios and data-gpios is not fixed. The actual number of
+  GPIOs used for clk and data are taken from the corresponding array lengths.
+
+properties:
+  compatible:
+    const: gpio-latch
+  "#gpio-cells":
+    const: 2
+
+  clk-gpios:
+    description: Array of GPIOs to be used to clock a latch
+
+  data-gpios:
+    description: Array of GPIOs to be used as data GPIOs
+
+  gpio-controller: true
+
+  gpio-line-names: true
+
+required:
+  - compatible
+  - "#gpio-cells"
+  - gpio-controller
+  - clk-gpios
+  - data-gpios
+
+additionalProperties: false
+
+examples:
+  - |
+    gpio-latch {
+        #gpio-cells = <2>;
+        pinctrl-names = "default";
+        pinctrl-0 = <&pinctrl_di_do_leds>;
+        compatible = "gpio-latch";
+        gpio-controller;
+
+        clk-gpios = <&gpio3 7 0>, <&gpio3 8 0>;
+        data-gpios = <&gpio3 21 0>, <&gpio3 22 0>,
+                     <&gpio3 23 0>, <&gpio3 24 0>,
+                     <&gpio3 25 0>, <&gpio3 26 0>,
+                     <&gpio3 27 0>, <&gpio3 28 0>;
+    };