linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] pcf857x: DTS fixes and DT binding to json-schema conversion
@ 2021-05-21  7:54 Geert Uytterhoeven
  2021-05-21  7:54 ` [PATCH 1/3] ARM: dts: dra7x-evm: Align GPIO hog names with dt-schema Geert Uytterhoeven
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2021-05-21  7:54 UTC (permalink / raw)
  To: Rob Herring, Laurent Pinchart, Linus Walleij,
	Bartosz Golaszewski, Benoît Cousson, Tony Lindgren,
	Jan Tuerk, Shawn Guo
  Cc: devicetree, linux-gpio, linux-omap, linux-arm-kernel, Geert Uytterhoeven

	Hi all,

This patch series converts the PCF857x-compatible I/O expanders Device
Tree binding documentation to json-schema, after fixing a few issues in
DTS files.

Thanks for your comments!

Geert Uytterhoeven (3):
  ARM: dts: dra7x-evm: Align GPIO hog names with dt-schema
  ARM: dts: imx: emcon-avari: Fix nxp,pca8574 #gpio-cells
  dt-bindings: gpio: pcf857x: Convert to json-schema

 .../devicetree/bindings/gpio/gpio-pcf857x.txt |  69 ----------
 .../devicetree/bindings/gpio/nxp,pcf8575.yaml | 120 ++++++++++++++++++
 arch/arm/boot/dts/dra7-evm.dts                |   2 +-
 arch/arm/boot/dts/dra71-evm.dts               |   2 +-
 arch/arm/boot/dts/dra72-evm-common.dtsi       |   2 +-
 arch/arm/boot/dts/dra76-evm.dts               |   2 +-
 arch/arm/boot/dts/imx6qdl-emcon-avari.dtsi    |   2 +-
 7 files changed, 125 insertions(+), 74 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/gpio/gpio-pcf857x.txt
 create mode 100644 Documentation/devicetree/bindings/gpio/nxp,pcf8575.yaml

-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 1/3] ARM: dts: dra7x-evm: Align GPIO hog names with dt-schema
  2021-05-21  7:54 [PATCH 0/3] pcf857x: DTS fixes and DT binding to json-schema conversion Geert Uytterhoeven
@ 2021-05-21  7:54 ` Geert Uytterhoeven
  2021-05-23  1:54   ` Laurent Pinchart
  2021-05-27 12:02   ` Tony Lindgren
  2021-05-21  7:54 ` [PATCH 2/3] ARM: dts: imx: emcon-avari: Fix nxp,pca8574 #gpio-cells Geert Uytterhoeven
  2021-05-21  7:54 ` [PATCH 3/3] dt-bindings: gpio: pcf857x: Convert to json-schema Geert Uytterhoeven
  2 siblings, 2 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2021-05-21  7:54 UTC (permalink / raw)
  To: Rob Herring, Laurent Pinchart, Linus Walleij,
	Bartosz Golaszewski, Benoît Cousson, Tony Lindgren,
	Jan Tuerk, Shawn Guo
  Cc: devicetree, linux-gpio, linux-omap, linux-arm-kernel, Geert Uytterhoeven

The dt-schema for nxp,pcf8575 expects GPIO hogs node names to end with a
'hog' suffix.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/boot/dts/dra7-evm.dts          | 2 +-
 arch/arm/boot/dts/dra71-evm.dts         | 2 +-
 arch/arm/boot/dts/dra72-evm-common.dtsi | 2 +-
 arch/arm/boot/dts/dra76-evm.dts         | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/dra7-evm.dts b/arch/arm/boot/dts/dra7-evm.dts
index 38530dbb89a00b7c..3dcb6e1f49bcf1f0 100644
--- a/arch/arm/boot/dts/dra7-evm.dts
+++ b/arch/arm/boot/dts/dra7-evm.dts
@@ -366,7 +366,7 @@ pcf_hdmi: gpio@26 {
 		reg = <0x26>;
 		gpio-controller;
 		#gpio-cells = <2>;
-		p1 {
+		hdmi-audio-hog {
 			/* vin6_sel_s0: high: VIN6, low: audio */
 			gpio-hog;
 			gpios = <1 GPIO_ACTIVE_HIGH>;
diff --git a/arch/arm/boot/dts/dra71-evm.dts b/arch/arm/boot/dts/dra71-evm.dts
index 6d2cca6b44883e59..a64364443031525b 100644
--- a/arch/arm/boot/dts/dra71-evm.dts
+++ b/arch/arm/boot/dts/dra71-evm.dts
@@ -187,7 +187,7 @@ &pcf_gpio_21 {
 };
 
 &pcf_hdmi {
-	p0 {
+	hdmi-i2c-disable-hog {
 		/*
 		 * PM_OEn to High: Disable routing I2C3 to PM_I2C
 		 * With this PM_SEL(p3) should not matter
diff --git a/arch/arm/boot/dts/dra72-evm-common.dtsi b/arch/arm/boot/dts/dra72-evm-common.dtsi
index b65b2dd094d0ff57..f2384277d5dcdc5c 100644
--- a/arch/arm/boot/dts/dra72-evm-common.dtsi
+++ b/arch/arm/boot/dts/dra72-evm-common.dtsi
@@ -268,7 +268,7 @@ pcf_hdmi: pcf8575@26 {
 		 */
 		lines-initial-states = <0x0f2b>;
 
-		p1 {
+		hdmi-audio-hog {
 			/* vin6_sel_s0: high: VIN6, low: audio */
 			gpio-hog;
 			gpios = <1 GPIO_ACTIVE_HIGH>;
diff --git a/arch/arm/boot/dts/dra76-evm.dts b/arch/arm/boot/dts/dra76-evm.dts
index 9bd01ae40b1d1fbb..df47ea59c9c404c2 100644
--- a/arch/arm/boot/dts/dra76-evm.dts
+++ b/arch/arm/boot/dts/dra76-evm.dts
@@ -381,7 +381,7 @@ pcf_hdmi: pcf8575@26 {
 		reg = <0x26>;
 		gpio-controller;
 		#gpio-cells = <2>;
-		p1 {
+		hdmi-audio-hog {
 			/* vin6_sel_s0: high: VIN6, low: audio */
 			gpio-hog;
 			gpios = <1 GPIO_ACTIVE_HIGH>;
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 2/3] ARM: dts: imx: emcon-avari: Fix nxp,pca8574 #gpio-cells
  2021-05-21  7:54 [PATCH 0/3] pcf857x: DTS fixes and DT binding to json-schema conversion Geert Uytterhoeven
  2021-05-21  7:54 ` [PATCH 1/3] ARM: dts: dra7x-evm: Align GPIO hog names with dt-schema Geert Uytterhoeven
@ 2021-05-21  7:54 ` Geert Uytterhoeven
  2021-05-23  1:55   ` Laurent Pinchart
  2021-05-23  5:42   ` Shawn Guo
  2021-05-21  7:54 ` [PATCH 3/3] dt-bindings: gpio: pcf857x: Convert to json-schema Geert Uytterhoeven
  2 siblings, 2 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2021-05-21  7:54 UTC (permalink / raw)
  To: Rob Herring, Laurent Pinchart, Linus Walleij,
	Bartosz Golaszewski, Benoît Cousson, Tony Lindgren,
	Jan Tuerk, Shawn Guo
  Cc: devicetree, linux-gpio, linux-omap, linux-arm-kernel, Geert Uytterhoeven

According to the DT bindings, #gpio-cells must be two.

Fixes: 63e71fedc07c4ece ("ARM: dts: Add support for emtrion emCON-MX6 series")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/boot/dts/imx6qdl-emcon-avari.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/imx6qdl-emcon-avari.dtsi b/arch/arm/boot/dts/imx6qdl-emcon-avari.dtsi
index 828cf3e39784afd6..c4e146f3341bb85d 100644
--- a/arch/arm/boot/dts/imx6qdl-emcon-avari.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-emcon-avari.dtsi
@@ -126,7 +126,7 @@ boardid: gpio@3a {
 		compatible = "nxp,pca8574";
 		reg = <0x3a>;
 		gpio-controller;
-		#gpio-cells = <1>;
+		#gpio-cells = <2>;
 	};
 };
 
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 3/3] dt-bindings: gpio: pcf857x: Convert to json-schema
  2021-05-21  7:54 [PATCH 0/3] pcf857x: DTS fixes and DT binding to json-schema conversion Geert Uytterhoeven
  2021-05-21  7:54 ` [PATCH 1/3] ARM: dts: dra7x-evm: Align GPIO hog names with dt-schema Geert Uytterhoeven
  2021-05-21  7:54 ` [PATCH 2/3] ARM: dts: imx: emcon-avari: Fix nxp,pca8574 #gpio-cells Geert Uytterhoeven
@ 2021-05-21  7:54 ` Geert Uytterhoeven
  2021-05-21 10:04   ` Linus Walleij
  2021-05-23  1:52   ` Laurent Pinchart
  2 siblings, 2 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2021-05-21  7:54 UTC (permalink / raw)
  To: Rob Herring, Laurent Pinchart, Linus Walleij,
	Bartosz Golaszewski, Benoît Cousson, Tony Lindgren,
	Jan Tuerk, Shawn Guo
  Cc: devicetree, linux-gpio, linux-omap, linux-arm-kernel, Geert Uytterhoeven

Convert the PCF857x-compatible I/O expanders Device Tree binding
documentation to json-schema.

Document missing compatible values, properties, and gpio hogs.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Perhaps the "ti,pcf8575" construct should be removed, and the few users
fixed instead?

I have listed Laurent as the maintainer, as he wrote the original
bindings.  Laurent: Please scream if this is inappropriate ;-)
---
 .../devicetree/bindings/gpio/gpio-pcf857x.txt |  69 ----------
 .../devicetree/bindings/gpio/nxp,pcf8575.yaml | 120 ++++++++++++++++++
 2 files changed, 120 insertions(+), 69 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/gpio/gpio-pcf857x.txt
 create mode 100644 Documentation/devicetree/bindings/gpio/nxp,pcf8575.yaml

diff --git a/Documentation/devicetree/bindings/gpio/gpio-pcf857x.txt b/Documentation/devicetree/bindings/gpio/gpio-pcf857x.txt
deleted file mode 100644
index a482455a205b0855..0000000000000000
--- a/Documentation/devicetree/bindings/gpio/gpio-pcf857x.txt
+++ /dev/null
@@ -1,69 +0,0 @@
-* PCF857x-compatible I/O expanders
-
-The PCF857x-compatible chips have "quasi-bidirectional" I/O lines that can be
-driven high by a pull-up current source or driven low to ground. This combines
-the direction and output level into a single bit per line, which can't be read
-back. We can't actually know at initialization time whether a line is configured
-(a) as output and driving the signal low/high, or (b) as input and reporting a
-low/high value, without knowing the last value written since the chip came out
-of reset (if any). The only reliable solution for setting up line direction is
-thus to do it explicitly.
-
-Required Properties:
-
-  - compatible: should be one of the following.
-    - "maxim,max7328": For the Maxim MAX7378
-    - "maxim,max7329": For the Maxim MAX7329
-    - "nxp,pca8574": For the NXP PCA8574
-    - "nxp,pca8575": For the NXP PCA8575
-    - "nxp,pca9670": For the NXP PCA9670
-    - "nxp,pca9671": For the NXP PCA9671
-    - "nxp,pca9672": For the NXP PCA9672
-    - "nxp,pca9673": For the NXP PCA9673
-    - "nxp,pca9674": For the NXP PCA9674
-    - "nxp,pca9675": For the NXP PCA9675
-    - "nxp,pcf8574": For the NXP PCF8574
-    - "nxp,pcf8574a": For the NXP PCF8574A
-    - "nxp,pcf8575": For the NXP PCF8575
-
-  - reg: I2C slave address.
-
-  - gpio-controller: Marks the device node as a gpio controller.
-  - #gpio-cells: Should be 2. The first cell is the GPIO number and the second
-    cell specifies GPIO flags, as defined in <dt-bindings/gpio/gpio.h>. Only the
-    GPIO_ACTIVE_HIGH and GPIO_ACTIVE_LOW flags are supported.
-
-Optional Properties:
-
-  - lines-initial-states: Bitmask that specifies the initial state of each
-  line. When a bit is set to zero, the corresponding line will be initialized to
-  the input (pulled-up) state. When the  bit is set to one, the line will be
-  initialized the low-level output state. If the property is not specified
-  all lines will be initialized to the input state.
-
-  The I/O expander can detect input state changes, and thus optionally act as
-  an interrupt controller. When the expander interrupt line is connected all the
-  following properties must be set. For more information please see the
-  interrupt controller device tree bindings documentation available at
-  Documentation/devicetree/bindings/interrupt-controller/interrupts.txt.
-
-  - interrupt-controller: Identifies the node as an interrupt controller.
-  - #interrupt-cells: Number of cells to encode an interrupt source, shall be 2.
-  - interrupts: Interrupt specifier for the controllers interrupt.
-
-
-Please refer to gpio.txt in this directory for details of the common GPIO
-bindings used by client devices.
-
-Example: PCF8575 I/O expander node
-
-	pcf8575: gpio@20 {
-		compatible = "nxp,pcf8575";
-		reg = <0x20>;
-		interrupt-parent = <&irqpin2>;
-		interrupts = <3 0>;
-		gpio-controller;
-		#gpio-cells = <2>;
-		interrupt-controller;
-		#interrupt-cells = <2>;
-	};
diff --git a/Documentation/devicetree/bindings/gpio/nxp,pcf8575.yaml b/Documentation/devicetree/bindings/gpio/nxp,pcf8575.yaml
new file mode 100644
index 0000000000000000..45034be0f8abc961
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/nxp,pcf8575.yaml
@@ -0,0 +1,120 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/gpio/nxp,pcf8575.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: PCF857x-compatible I/O expanders
+
+maintainers:
+  - Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+
+description:
+  The PCF857x-compatible chips have "quasi-bidirectional" I/O lines that can be
+  driven high by a pull-up current source or driven low to ground. This
+  combines the direction and output level into a single bit per line, which
+  can't be read back. We can't actually know at initialization time whether a
+  line is configured (a) as output and driving the signal low/high, or (b) as
+  input and reporting a low/high value, without knowing the last value written
+  since the chip came out of reset (if any). The only reliable solution for
+  setting up line direction is thus to do it explicitly.
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - ti,pcf8575
+          - const: nxp,pcf8575
+
+      - enum:
+          - maxim,max7328
+          - maxim,max7329
+          - nxp,pca8574
+          - nxp,pca8575
+          - nxp,pca9670
+          - nxp,pca9671
+          - nxp,pca9672
+          - nxp,pca9673
+          - nxp,pca9674
+          - nxp,pca9675
+          - nxp,pcf8574
+          - nxp,pcf8574a
+          - nxp,pcf8575
+
+  reg:
+    maxItems: 1
+
+  gpio-controller: true
+
+  '#gpio-cells':
+    const: 2
+    description:
+      The first cell is the GPIO number and the second cell specifies GPIO
+      flags, as defined in <dt-bindings/gpio/gpio.h>. Only the GPIO_ACTIVE_HIGH
+      and GPIO_ACTIVE_LOW flags are supported.
+
+  lines-initial-states:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Bitmask that specifies the initial state of each line.
+      When a bit is set to zero, the corresponding line will be initialized to
+      the input (pulled-up) state.
+      When the  bit is set to one, the line will be initialized to the
+      low-level output state.
+      If the property is not specified all lines will be initialized to the
+      input state.
+
+  interrupts:
+    maxItems: 1
+
+  interrupt-controller: true
+
+  '#interrupt-cells':
+    const: 2
+
+  wakeup-source: true
+
+patternProperties:
+  "^(hog-[0-9]+|.+-hog(-[0-9]+)?)$":
+    type: object
+
+    properties:
+      gpio-hog: true
+      gpios: true
+      input: true
+      output-high: true
+      output-low: true
+      line-name: true
+
+    required:
+      - gpio-hog
+      - gpios
+
+    additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - gpio-controller
+  - '#gpio-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            pcf8575: gpio@20 {
+                    compatible = "nxp,pcf8575";
+                    reg = <0x20>;
+                    interrupt-parent = <&irqpin2>;
+                    interrupts = <3 0>;
+                    gpio-controller;
+                    #gpio-cells = <2>;
+                    interrupt-controller;
+                    #interrupt-cells = <2>;
+            };
+    };
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 3/3] dt-bindings: gpio: pcf857x: Convert to json-schema
  2021-05-21  7:54 ` [PATCH 3/3] dt-bindings: gpio: pcf857x: Convert to json-schema Geert Uytterhoeven
@ 2021-05-21 10:04   ` Linus Walleij
  2021-05-21 10:23     ` Geert Uytterhoeven
  2021-05-23  1:52   ` Laurent Pinchart
  1 sibling, 1 reply; 14+ messages in thread
From: Linus Walleij @ 2021-05-21 10:04 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rob Herring, Laurent Pinchart, Bartosz Golaszewski,
	Benoît Cousson, Tony Lindgren, Jan Tuerk, Shawn Guo,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list:GPIO SUBSYSTEM, Linux-OMAP, Linux ARM

On Fri, May 21, 2021 at 9:54 AM Geert Uytterhoeven
<geert+renesas@glider.be> wrote:

> Convert the PCF857x-compatible I/O expanders Device Tree binding
> documentation to json-schema.
>
> Document missing compatible values, properties, and gpio hogs.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

(...)
> Perhaps the "ti,pcf8575" construct should be removed, and the few users
> fixed instead?

You would rather list it as deprecated I think?
It is ABI...

> +  gpio-controller: true

So this is implicitly using the generic schema in
/dtschema/schemas/gpio/gpio.yaml

> +  lines-initial-states:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description:
> +      Bitmask that specifies the initial state of each line.
> +      When a bit is set to zero, the corresponding line will be initialized to
> +      the input (pulled-up) state.
> +      When the  bit is set to one, the line will be initialized to the
> +      low-level output state.
> +      If the property is not specified all lines will be initialized to the
> +      input state.

Is this something we standardized or something that should
actually be a custom "nxp," property we just missed it?
(Looks like the latter... oh well, now it is there.)

> +patternProperties:
> +  "^(hog-[0-9]+|.+-hog(-[0-9]+)?)$":
> +    type: object

But this is already in
/dtschema/schemas/gpio/gpio-hog.yaml
for nodename, isn't that where it properly belongs?

I'm however confused here Rob will know what to do.

> required:
>   - gpio-hog
>   - gpios

This is already in
/dtschema/schemas/gpio/gpio-hog.yaml
as well?

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 3/3] dt-bindings: gpio: pcf857x: Convert to json-schema
  2021-05-21 10:04   ` Linus Walleij
@ 2021-05-21 10:23     ` Geert Uytterhoeven
  2021-05-21 18:24       ` Rob Herring
  0 siblings, 1 reply; 14+ messages in thread
From: Geert Uytterhoeven @ 2021-05-21 10:23 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Rob Herring, Laurent Pinchart, Bartosz Golaszewski,
	Benoît Cousson, Tony Lindgren, Jan Tuerk, Shawn Guo,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list:GPIO SUBSYSTEM, Linux-OMAP, Linux ARM

Hi Linus,

On Fri, May 21, 2021 at 12:04 PM Linus Walleij <linus.walleij@linaro.org> wrote:
> On Fri, May 21, 2021 at 9:54 AM Geert Uytterhoeven
> <geert+renesas@glider.be> wrote:
> > Convert the PCF857x-compatible I/O expanders Device Tree binding
> > documentation to json-schema.
> >
> > Document missing compatible values, properties, and gpio hogs.
> >
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> (...)
> > Perhaps the "ti,pcf8575" construct should be removed, and the few users
> > fixed instead?
>
> You would rather list it as deprecated I think?
> It is ABI...

All DTS files use the "nxp,pcf8575" fallback, except for
arch/x86/platform/ce4100/falconfalls.dts.
The latter ain't working with Linux, as the Linux driver doesn't
match against "ti,pcf8575"...

> > +  gpio-controller: true
>
> So this is implicitly using the generic schema in
> /dtschema/schemas/gpio/gpio.yaml

if you leave it out:

    Documentation/devicetree/bindings/gpio/nxp,pcf8575.yaml: ignoring,
error in schema: properties
    warning: no schema found in file:
Documentation/devicetree/bindings/gpio/nxp,pcf8575.yaml
    Documentation/devicetree/bindings/gpio/nxp,pcf8575.yaml:
properties: 'gpio-controller' is a dependency of '#gpio-cells'
    from schema $id: http://devicetree.org/meta-schemas/gpios.yaml#

> > +  lines-initial-states:
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> > +    description:
> > +      Bitmask that specifies the initial state of each line.
> > +      When a bit is set to zero, the corresponding line will be initialized to
> > +      the input (pulled-up) state.
> > +      When the  bit is set to one, the line will be initialized to the
> > +      low-level output state.
> > +      If the property is not specified all lines will be initialized to the
> > +      input state.
>
> Is this something we standardized or something that should
> actually be a custom "nxp," property we just missed it?
> (Looks like the latter... oh well, now it is there.)

Too late for an "nxp," prefix.
See the NOTE in drivers/gpio/gpio-pcf857x.c:

        /* NOTE:  these chips have strange "quasi-bidirectional" I/O pins.
         * We can't actually know whether a pin is configured (a) as output
         * and driving the signal low, or (b) as input and reporting a low
         * value ... without knowing the last value written since the chip
         * came out of reset (if any).  We can't read the latched output.
         *
         * In short, the only reliable solution for setting up pin direction
         * is to do it explicitly.  The setup() method can do that, but it
         * may cause transient glitching since it can't know the last value
         * written (some pins may need to be driven low).
         *
         * Using n_latch avoids that trouble.  When left initialized to zero,
         * our software copy of the "latch" then matches the chip's all-ones
         * reset state.  Otherwise it flags pins to be driven low.
         */

> > +patternProperties:
> > +  "^(hog-[0-9]+|.+-hog(-[0-9]+)?)$":
> > +    type: object
>
> But this is already in
> /dtschema/schemas/gpio/gpio-hog.yaml
> for nodename, isn't that where it properly belongs?
>
> I'm however confused here Rob will know what to do.

If we leave this out, something still has to refer to it?
I see no other binding doing that...

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 3/3] dt-bindings: gpio: pcf857x: Convert to json-schema
  2021-05-21 10:23     ` Geert Uytterhoeven
@ 2021-05-21 18:24       ` Rob Herring
  2021-05-27 15:04         ` Geert Uytterhoeven
  0 siblings, 1 reply; 14+ messages in thread
From: Rob Herring @ 2021-05-21 18:24 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Linus Walleij, Laurent Pinchart, Bartosz Golaszewski,
	Benoît Cousson, Tony Lindgren, Jan Tuerk, Shawn Guo,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list:GPIO SUBSYSTEM, Linux-OMAP, Linux ARM

On Fri, May 21, 2021 at 12:23:47PM +0200, Geert Uytterhoeven wrote:
> Hi Linus,
> 
> On Fri, May 21, 2021 at 12:04 PM Linus Walleij <linus.walleij@linaro.org> wrote:
> > On Fri, May 21, 2021 at 9:54 AM Geert Uytterhoeven
> > <geert+renesas@glider.be> wrote:
> > > Convert the PCF857x-compatible I/O expanders Device Tree binding
> > > documentation to json-schema.
> > >
> > > Document missing compatible values, properties, and gpio hogs.
> > >
> > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> >
> > (...)
> > > Perhaps the "ti,pcf8575" construct should be removed, and the few users
> > > fixed instead?
> >
> > You would rather list it as deprecated I think?
> > It is ABI...
> 
> All DTS files use the "nxp,pcf8575" fallback, except for
> arch/x86/platform/ce4100/falconfalls.dts.
> The latter ain't working with Linux, as the Linux driver doesn't
> match against "ti,pcf8575"...

Perhaps can it just be removed?

> 
> > > +  gpio-controller: true
> >
> > So this is implicitly using the generic schema in
> > /dtschema/schemas/gpio/gpio.yaml
> 
> if you leave it out:
> 
>     Documentation/devicetree/bindings/gpio/nxp,pcf8575.yaml: ignoring,
> error in schema: properties
>     warning: no schema found in file:
> Documentation/devicetree/bindings/gpio/nxp,pcf8575.yaml
>     Documentation/devicetree/bindings/gpio/nxp,pcf8575.yaml:
> properties: 'gpio-controller' is a dependency of '#gpio-cells'
>     from schema $id: http://devicetree.org/meta-schemas/gpios.yaml#
> 
> > > +  lines-initial-states:
> > > +    $ref: /schemas/types.yaml#/definitions/uint32
> > > +    description:
> > > +      Bitmask that specifies the initial state of each line.
> > > +      When a bit is set to zero, the corresponding line will be initialized to
> > > +      the input (pulled-up) state.
> > > +      When the  bit is set to one, the line will be initialized to the
> > > +      low-level output state.
> > > +      If the property is not specified all lines will be initialized to the
> > > +      input state.
> >
> > Is this something we standardized or something that should
> > actually be a custom "nxp," property we just missed it?
> > (Looks like the latter... oh well, now it is there.)
> 
> Too late for an "nxp," prefix.
> See the NOTE in drivers/gpio/gpio-pcf857x.c:
> 
>         /* NOTE:  these chips have strange "quasi-bidirectional" I/O pins.
>          * We can't actually know whether a pin is configured (a) as output
>          * and driving the signal low, or (b) as input and reporting a low
>          * value ... without knowing the last value written since the chip
>          * came out of reset (if any).  We can't read the latched output.
>          *
>          * In short, the only reliable solution for setting up pin direction
>          * is to do it explicitly.  The setup() method can do that, but it
>          * may cause transient glitching since it can't know the last value
>          * written (some pins may need to be driven low).
>          *
>          * Using n_latch avoids that trouble.  When left initialized to zero,
>          * our software copy of the "latch" then matches the chip's all-ones
>          * reset state.  Otherwise it flags pins to be driven low.
>          */
> 
> > > +patternProperties:
> > > +  "^(hog-[0-9]+|.+-hog(-[0-9]+)?)$":
> > > +    type: object
> >
> > But this is already in
> > /dtschema/schemas/gpio/gpio-hog.yaml
> > for nodename, isn't that where it properly belongs?
> >
> > I'm however confused here Rob will know what to do.

This one is a bit odd.

> If we leave this out, something still has to refer to it?
> I see no other binding doing that...

It's selected by 'gpio-hog' being present, but here you need to make 
sure that's the case.

And I would hope you could define the node name to be just 1 of the 2 
cases.

Rob

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 3/3] dt-bindings: gpio: pcf857x: Convert to json-schema
  2021-05-21  7:54 ` [PATCH 3/3] dt-bindings: gpio: pcf857x: Convert to json-schema Geert Uytterhoeven
  2021-05-21 10:04   ` Linus Walleij
@ 2021-05-23  1:52   ` Laurent Pinchart
  2021-05-27 14:43     ` Geert Uytterhoeven
  1 sibling, 1 reply; 14+ messages in thread
From: Laurent Pinchart @ 2021-05-23  1:52 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rob Herring, Linus Walleij, Bartosz Golaszewski,
	Benoît Cousson, Tony Lindgren, Jan Tuerk, Shawn Guo,
	devicetree, linux-gpio, linux-omap, linux-arm-kernel

Hi Geert,

On Fri, May 21, 2021 at 09:54:08AM +0200, Geert Uytterhoeven wrote:
> Convert the PCF857x-compatible I/O expanders Device Tree binding
> documentation to json-schema.
> 
> Document missing compatible values, properties, and gpio hogs.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> Perhaps the "ti,pcf8575" construct should be removed, and the few users
> fixed instead?

Given that the driver doesn't match against it, that could be done, if
you're confident enough that there's no difference between the TI and
NXP versions that would need to be taken into account.

> I have listed Laurent as the maintainer, as he wrote the original
> bindings.  Laurent: Please scream if this is inappropriate ;-)

I'm sure I'll regret it later, but I don't mind :-)

> ---
>  .../devicetree/bindings/gpio/gpio-pcf857x.txt |  69 ----------
>  .../devicetree/bindings/gpio/nxp,pcf8575.yaml | 120 ++++++++++++++++++
>  2 files changed, 120 insertions(+), 69 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/gpio/gpio-pcf857x.txt
>  create mode 100644 Documentation/devicetree/bindings/gpio/nxp,pcf8575.yaml
> 
> diff --git a/Documentation/devicetree/bindings/gpio/gpio-pcf857x.txt b/Documentation/devicetree/bindings/gpio/gpio-pcf857x.txt
> deleted file mode 100644
> index a482455a205b0855..0000000000000000
> --- a/Documentation/devicetree/bindings/gpio/gpio-pcf857x.txt
> +++ /dev/null
> @@ -1,69 +0,0 @@
> -* PCF857x-compatible I/O expanders
> -
> -The PCF857x-compatible chips have "quasi-bidirectional" I/O lines that can be
> -driven high by a pull-up current source or driven low to ground. This combines
> -the direction and output level into a single bit per line, which can't be read
> -back. We can't actually know at initialization time whether a line is configured
> -(a) as output and driving the signal low/high, or (b) as input and reporting a
> -low/high value, without knowing the last value written since the chip came out
> -of reset (if any). The only reliable solution for setting up line direction is
> -thus to do it explicitly.
> -
> -Required Properties:
> -
> -  - compatible: should be one of the following.
> -    - "maxim,max7328": For the Maxim MAX7378
> -    - "maxim,max7329": For the Maxim MAX7329
> -    - "nxp,pca8574": For the NXP PCA8574
> -    - "nxp,pca8575": For the NXP PCA8575
> -    - "nxp,pca9670": For the NXP PCA9670
> -    - "nxp,pca9671": For the NXP PCA9671
> -    - "nxp,pca9672": For the NXP PCA9672
> -    - "nxp,pca9673": For the NXP PCA9673
> -    - "nxp,pca9674": For the NXP PCA9674
> -    - "nxp,pca9675": For the NXP PCA9675
> -    - "nxp,pcf8574": For the NXP PCF8574
> -    - "nxp,pcf8574a": For the NXP PCF8574A
> -    - "nxp,pcf8575": For the NXP PCF8575
> -
> -  - reg: I2C slave address.
> -
> -  - gpio-controller: Marks the device node as a gpio controller.
> -  - #gpio-cells: Should be 2. The first cell is the GPIO number and the second
> -    cell specifies GPIO flags, as defined in <dt-bindings/gpio/gpio.h>. Only the
> -    GPIO_ACTIVE_HIGH and GPIO_ACTIVE_LOW flags are supported.
> -
> -Optional Properties:
> -
> -  - lines-initial-states: Bitmask that specifies the initial state of each
> -  line. When a bit is set to zero, the corresponding line will be initialized to
> -  the input (pulled-up) state. When the  bit is set to one, the line will be
> -  initialized the low-level output state. If the property is not specified
> -  all lines will be initialized to the input state.
> -
> -  The I/O expander can detect input state changes, and thus optionally act as
> -  an interrupt controller. When the expander interrupt line is connected all the
> -  following properties must be set. For more information please see the
> -  interrupt controller device tree bindings documentation available at
> -  Documentation/devicetree/bindings/interrupt-controller/interrupts.txt.
> -
> -  - interrupt-controller: Identifies the node as an interrupt controller.
> -  - #interrupt-cells: Number of cells to encode an interrupt source, shall be 2.
> -  - interrupts: Interrupt specifier for the controllers interrupt.
> -
> -
> -Please refer to gpio.txt in this directory for details of the common GPIO
> -bindings used by client devices.
> -
> -Example: PCF8575 I/O expander node
> -
> -	pcf8575: gpio@20 {
> -		compatible = "nxp,pcf8575";
> -		reg = <0x20>;
> -		interrupt-parent = <&irqpin2>;
> -		interrupts = <3 0>;
> -		gpio-controller;
> -		#gpio-cells = <2>;
> -		interrupt-controller;
> -		#interrupt-cells = <2>;
> -	};
> diff --git a/Documentation/devicetree/bindings/gpio/nxp,pcf8575.yaml b/Documentation/devicetree/bindings/gpio/nxp,pcf8575.yaml
> new file mode 100644
> index 0000000000000000..45034be0f8abc961
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/gpio/nxp,pcf8575.yaml
> @@ -0,0 +1,120 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/gpio/nxp,pcf8575.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: PCF857x-compatible I/O expanders
> +
> +maintainers:
> +  - Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> +
> +description:
> +  The PCF857x-compatible chips have "quasi-bidirectional" I/O lines that can be
> +  driven high by a pull-up current source or driven low to ground. This
> +  combines the direction and output level into a single bit per line, which
> +  can't be read back. We can't actually know at initialization time whether a
> +  line is configured (a) as output and driving the signal low/high, or (b) as
> +  input and reporting a low/high value, without knowing the last value written
> +  since the chip came out of reset (if any). The only reliable solution for
> +  setting up line direction is thus to do it explicitly.
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - items:
> +          - enum:
> +              - ti,pcf8575
> +          - const: nxp,pcf8575
> +
> +      - enum:
> +          - maxim,max7328
> +          - maxim,max7329
> +          - nxp,pca8574
> +          - nxp,pca8575
> +          - nxp,pca9670
> +          - nxp,pca9671
> +          - nxp,pca9672
> +          - nxp,pca9673
> +          - nxp,pca9674
> +          - nxp,pca9675
> +          - nxp,pcf8574
> +          - nxp,pcf8574a
> +          - nxp,pcf8575
> +
> +  reg:
> +    maxItems: 1
> +
> +  gpio-controller: true
> +
> +  '#gpio-cells':
> +    const: 2
> +    description:
> +      The first cell is the GPIO number and the second cell specifies GPIO
> +      flags, as defined in <dt-bindings/gpio/gpio.h>. Only the GPIO_ACTIVE_HIGH
> +      and GPIO_ACTIVE_LOW flags are supported.
> +
> +  lines-initial-states:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description:
> +      Bitmask that specifies the initial state of each line.
> +      When a bit is set to zero, the corresponding line will be initialized to
> +      the input (pulled-up) state.
> +      When the  bit is set to one, the line will be initialized to the
> +      low-level output state.
> +      If the property is not specified all lines will be initialized to the
> +      input state.

The line wrapping is weird.

> +
> +  interrupts:
> +    maxItems: 1
> +
> +  interrupt-controller: true
> +
> +  '#interrupt-cells':
> +    const: 2
> +
> +  wakeup-source: true
> +
> +patternProperties:
> +  "^(hog-[0-9]+|.+-hog(-[0-9]+)?)$":
> +    type: object
> +
> +    properties:
> +      gpio-hog: true
> +      gpios: true
> +      input: true
> +      output-high: true
> +      output-low: true
> +      line-name: true
> +
> +    required:
> +      - gpio-hog
> +      - gpios
> +
> +    additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - gpio-controller
> +  - '#gpio-cells'
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    i2c {
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +
> +            pcf8575: gpio@20 {
> +                    compatible = "nxp,pcf8575";
> +                    reg = <0x20>;
> +                    interrupt-parent = <&irqpin2>;
> +                    interrupts = <3 0>;
> +                    gpio-controller;
> +                    #gpio-cells = <2>;
> +                    interrupt-controller;
> +                    #interrupt-cells = <2>;
> +            };
> +    };

-- 
Regards,

Laurent Pinchart

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/3] ARM: dts: dra7x-evm: Align GPIO hog names with dt-schema
  2021-05-21  7:54 ` [PATCH 1/3] ARM: dts: dra7x-evm: Align GPIO hog names with dt-schema Geert Uytterhoeven
@ 2021-05-23  1:54   ` Laurent Pinchart
  2021-05-27 12:02   ` Tony Lindgren
  1 sibling, 0 replies; 14+ messages in thread
From: Laurent Pinchart @ 2021-05-23  1:54 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rob Herring, Linus Walleij, Bartosz Golaszewski,
	Benoît Cousson, Tony Lindgren, Jan Tuerk, Shawn Guo,
	devicetree, linux-gpio, linux-omap, linux-arm-kernel

Hi Geert,

Thank you for the patch.

On Fri, May 21, 2021 at 09:54:06AM +0200, Geert Uytterhoeven wrote:
> The dt-schema for nxp,pcf8575 expects GPIO hogs node names to end with a
> 'hog' suffix.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  arch/arm/boot/dts/dra7-evm.dts          | 2 +-
>  arch/arm/boot/dts/dra71-evm.dts         | 2 +-
>  arch/arm/boot/dts/dra72-evm-common.dtsi | 2 +-
>  arch/arm/boot/dts/dra76-evm.dts         | 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/dra7-evm.dts b/arch/arm/boot/dts/dra7-evm.dts
> index 38530dbb89a00b7c..3dcb6e1f49bcf1f0 100644
> --- a/arch/arm/boot/dts/dra7-evm.dts
> +++ b/arch/arm/boot/dts/dra7-evm.dts
> @@ -366,7 +366,7 @@ pcf_hdmi: gpio@26 {
>  		reg = <0x26>;
>  		gpio-controller;
>  		#gpio-cells = <2>;
> -		p1 {
> +		hdmi-audio-hog {
>  			/* vin6_sel_s0: high: VIN6, low: audio */
>  			gpio-hog;
>  			gpios = <1 GPIO_ACTIVE_HIGH>;
> diff --git a/arch/arm/boot/dts/dra71-evm.dts b/arch/arm/boot/dts/dra71-evm.dts
> index 6d2cca6b44883e59..a64364443031525b 100644
> --- a/arch/arm/boot/dts/dra71-evm.dts
> +++ b/arch/arm/boot/dts/dra71-evm.dts
> @@ -187,7 +187,7 @@ &pcf_gpio_21 {
>  };
>  
>  &pcf_hdmi {
> -	p0 {
> +	hdmi-i2c-disable-hog {
>  		/*
>  		 * PM_OEn to High: Disable routing I2C3 to PM_I2C
>  		 * With this PM_SEL(p3) should not matter
> diff --git a/arch/arm/boot/dts/dra72-evm-common.dtsi b/arch/arm/boot/dts/dra72-evm-common.dtsi
> index b65b2dd094d0ff57..f2384277d5dcdc5c 100644
> --- a/arch/arm/boot/dts/dra72-evm-common.dtsi
> +++ b/arch/arm/boot/dts/dra72-evm-common.dtsi
> @@ -268,7 +268,7 @@ pcf_hdmi: pcf8575@26 {
>  		 */
>  		lines-initial-states = <0x0f2b>;
>  
> -		p1 {
> +		hdmi-audio-hog {
>  			/* vin6_sel_s0: high: VIN6, low: audio */
>  			gpio-hog;
>  			gpios = <1 GPIO_ACTIVE_HIGH>;
> diff --git a/arch/arm/boot/dts/dra76-evm.dts b/arch/arm/boot/dts/dra76-evm.dts
> index 9bd01ae40b1d1fbb..df47ea59c9c404c2 100644
> --- a/arch/arm/boot/dts/dra76-evm.dts
> +++ b/arch/arm/boot/dts/dra76-evm.dts
> @@ -381,7 +381,7 @@ pcf_hdmi: pcf8575@26 {
>  		reg = <0x26>;
>  		gpio-controller;
>  		#gpio-cells = <2>;
> -		p1 {
> +		hdmi-audio-hog {
>  			/* vin6_sel_s0: high: VIN6, low: audio */
>  			gpio-hog;
>  			gpios = <1 GPIO_ACTIVE_HIGH>;

-- 
Regards,

Laurent Pinchart

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 2/3] ARM: dts: imx: emcon-avari: Fix nxp,pca8574 #gpio-cells
  2021-05-21  7:54 ` [PATCH 2/3] ARM: dts: imx: emcon-avari: Fix nxp,pca8574 #gpio-cells Geert Uytterhoeven
@ 2021-05-23  1:55   ` Laurent Pinchart
  2021-05-23  5:42   ` Shawn Guo
  1 sibling, 0 replies; 14+ messages in thread
From: Laurent Pinchart @ 2021-05-23  1:55 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rob Herring, Linus Walleij, Bartosz Golaszewski,
	Benoît Cousson, Tony Lindgren, Jan Tuerk, Shawn Guo,
	devicetree, linux-gpio, linux-omap, linux-arm-kernel

Hi Geert,

Thank you for the patch.

On Fri, May 21, 2021 at 09:54:07AM +0200, Geert Uytterhoeven wrote:
> According to the DT bindings, #gpio-cells must be two.
> 
> Fixes: 63e71fedc07c4ece ("ARM: dts: Add support for emtrion emCON-MX6 series")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  arch/arm/boot/dts/imx6qdl-emcon-avari.dtsi | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/imx6qdl-emcon-avari.dtsi b/arch/arm/boot/dts/imx6qdl-emcon-avari.dtsi
> index 828cf3e39784afd6..c4e146f3341bb85d 100644
> --- a/arch/arm/boot/dts/imx6qdl-emcon-avari.dtsi
> +++ b/arch/arm/boot/dts/imx6qdl-emcon-avari.dtsi
> @@ -126,7 +126,7 @@ boardid: gpio@3a {
>  		compatible = "nxp,pca8574";
>  		reg = <0x3a>;
>  		gpio-controller;
> -		#gpio-cells = <1>;
> +		#gpio-cells = <2>;
>  	};
>  };
>  

-- 
Regards,

Laurent Pinchart

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 2/3] ARM: dts: imx: emcon-avari: Fix nxp,pca8574 #gpio-cells
  2021-05-21  7:54 ` [PATCH 2/3] ARM: dts: imx: emcon-avari: Fix nxp,pca8574 #gpio-cells Geert Uytterhoeven
  2021-05-23  1:55   ` Laurent Pinchart
@ 2021-05-23  5:42   ` Shawn Guo
  1 sibling, 0 replies; 14+ messages in thread
From: Shawn Guo @ 2021-05-23  5:42 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rob Herring, Laurent Pinchart, Linus Walleij,
	Bartosz Golaszewski, Benoît Cousson, Tony Lindgren,
	Jan Tuerk, devicetree, linux-gpio, linux-omap, linux-arm-kernel

On Fri, May 21, 2021 at 09:54:07AM +0200, Geert Uytterhoeven wrote:
> According to the DT bindings, #gpio-cells must be two.
> 
> Fixes: 63e71fedc07c4ece ("ARM: dts: Add support for emtrion emCON-MX6 series")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Applied, thanks.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/3] ARM: dts: dra7x-evm: Align GPIO hog names with dt-schema
  2021-05-21  7:54 ` [PATCH 1/3] ARM: dts: dra7x-evm: Align GPIO hog names with dt-schema Geert Uytterhoeven
  2021-05-23  1:54   ` Laurent Pinchart
@ 2021-05-27 12:02   ` Tony Lindgren
  1 sibling, 0 replies; 14+ messages in thread
From: Tony Lindgren @ 2021-05-27 12:02 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rob Herring, Laurent Pinchart, Linus Walleij,
	Bartosz Golaszewski, Benoît Cousson, Jan Tuerk, Shawn Guo,
	devicetree, linux-gpio, linux-omap, linux-arm-kernel

* Geert Uytterhoeven <geert+renesas@glider.be> [210521 10:54]:
> The dt-schema for nxp,pcf8575 expects GPIO hogs node names to end with a
> 'hog' suffix.

Picking up this patch into omap-for-v5.14/dt thanks.

Tony

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 3/3] dt-bindings: gpio: pcf857x: Convert to json-schema
  2021-05-23  1:52   ` Laurent Pinchart
@ 2021-05-27 14:43     ` Geert Uytterhoeven
  0 siblings, 0 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2021-05-27 14:43 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Rob Herring, Linus Walleij, Bartosz Golaszewski,
	Benoît Cousson, Tony Lindgren, Jan Tuerk, Shawn Guo,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list:GPIO SUBSYSTEM,
	open list:TI ETHERNET SWITCH DRIVER (CPSW),
	Linux ARM

Hi Laurent,

On Sun, May 23, 2021 at 3:52 AM Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> On Fri, May 21, 2021 at 09:54:08AM +0200, Geert Uytterhoeven wrote:
> > Convert the PCF857x-compatible I/O expanders Device Tree binding
> > documentation to json-schema.
> >
> > Document missing compatible values, properties, and gpio hogs.
> >
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > ---
> > Perhaps the "ti,pcf8575" construct should be removed, and the few users
> > fixed instead?
>
> Given that the driver doesn't match against it, that could be done, if
> you're confident enough that there's no difference between the TI and
> NXP versions that would need to be taken into account.

I've just checked the datasheets, and they're identical modulo
shuffling.  Probably TI is the mandatory second source for the NXP
(née Philips) part.

> > I have listed Laurent as the maintainer, as he wrote the original
> > bindings.  Laurent: Please scream if this is inappropriate ;-)
>
> I'm sure I'll regret it later, but I don't mind :-)

Thanks!

> > +  lines-initial-states:
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> > +    description:
> > +      Bitmask that specifies the initial state of each line.
> > +      When a bit is set to zero, the corresponding line will be initialized to
> > +      the input (pulled-up) state.
> > +      When the  bit is set to one, the line will be initialized to the
> > +      low-level output state.
> > +      If the property is not specified all lines will be initialized to the
> > +      input state.
>
> The line wrapping is weird.

Is it? The different cases just start on a new line.  Which makes no
difference, as there's no "|".

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 3/3] dt-bindings: gpio: pcf857x: Convert to json-schema
  2021-05-21 18:24       ` Rob Herring
@ 2021-05-27 15:04         ` Geert Uytterhoeven
  0 siblings, 0 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2021-05-27 15:04 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Laurent Pinchart, Bartosz Golaszewski,
	Benoît Cousson, Tony Lindgren, Jan Tuerk, Shawn Guo,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list:GPIO SUBSYSTEM, Linux-OMAP, Linux ARM

Hi Rob,

On Fri, May 21, 2021 at 8:24 PM Rob Herring <robh@kernel.org> wrote:
> On Fri, May 21, 2021 at 12:23:47PM +0200, Geert Uytterhoeven wrote:
> > On Fri, May 21, 2021 at 12:04 PM Linus Walleij <linus.walleij@linaro.org> wrote:
> > > On Fri, May 21, 2021 at 9:54 AM Geert Uytterhoeven
> > > <geert+renesas@glider.be> wrote:
> > > > Convert the PCF857x-compatible I/O expanders Device Tree binding
> > > > documentation to json-schema.
> > > >
> > > > Document missing compatible values, properties, and gpio hogs.
> > > >
> > > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > >
> > > (...)
> > > > Perhaps the "ti,pcf8575" construct should be removed, and the few users
> > > > fixed instead?
> > >
> > > You would rather list it as deprecated I think?
> > > It is ABI...
> >
> > All DTS files use the "nxp,pcf8575" fallback, except for
> > arch/x86/platform/ce4100/falconfalls.dts.
> > The latter ain't working with Linux, as the Linux driver doesn't
> > match against "ti,pcf8575"...

Correction: i2c_device_id-based matching ignores the vendor part
of the compatible value.  One day this is gonna bite us...

> Perhaps can it just be removed?

I think so.  All other users of similar I2C GPIO expanders just
use the compatible values of the original NXP parts.

> > > > +patternProperties:
> > > > +  "^(hog-[0-9]+|.+-hog(-[0-9]+)?)$":
> > > > +    type: object
> > >
> > > But this is already in
> > > /dtschema/schemas/gpio/gpio-hog.yaml
> > > for nodename, isn't that where it properly belongs?
> > >
> > > I'm however confused here Rob will know what to do.
>
> This one is a bit odd.
>
> > If we leave this out, something still has to refer to it?
> > I see no other binding doing that...
>
> It's selected by 'gpio-hog' being present, but here you need to make
> sure that's the case.

OK. Fixed.

> And I would hope you could define the node name to be just 1 of the 2
> cases.

Yep, the latter is fine.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-05-27 15:41 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-21  7:54 [PATCH 0/3] pcf857x: DTS fixes and DT binding to json-schema conversion Geert Uytterhoeven
2021-05-21  7:54 ` [PATCH 1/3] ARM: dts: dra7x-evm: Align GPIO hog names with dt-schema Geert Uytterhoeven
2021-05-23  1:54   ` Laurent Pinchart
2021-05-27 12:02   ` Tony Lindgren
2021-05-21  7:54 ` [PATCH 2/3] ARM: dts: imx: emcon-avari: Fix nxp,pca8574 #gpio-cells Geert Uytterhoeven
2021-05-23  1:55   ` Laurent Pinchart
2021-05-23  5:42   ` Shawn Guo
2021-05-21  7:54 ` [PATCH 3/3] dt-bindings: gpio: pcf857x: Convert to json-schema Geert Uytterhoeven
2021-05-21 10:04   ` Linus Walleij
2021-05-21 10:23     ` Geert Uytterhoeven
2021-05-21 18:24       ` Rob Herring
2021-05-27 15:04         ` Geert Uytterhoeven
2021-05-23  1:52   ` Laurent Pinchart
2021-05-27 14:43     ` Geert Uytterhoeven

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