diff mbox series

[v3,01/11] dt-bindings: gpio: vf610: fix clock requirements per SoC

Message ID 20261105-gpio-vf610-fixes-v3-1-504e19de5ad5@nxp.com
State New
Headers show
Series gpio: vf610: fix clocks and misc cleanup | expand

Commit Message

Peng Fan (OSS) Nov. 5, 2026, 3:52 a.m. UTC
From: Peng Fan <peng.fan@nxp.com>

The i.MX7ULP GPIO controller needs both the GPIO and PORT clocks,
while the i.MX8ULP and its derivatives (i.MX93/94/95/952) only have
a single "gpio" clock. The VF610 controller has no gateable clocks,
so force clocks and clock-names false.

Fixes: c61d8b5791ab ("dt-bindings: gpio: gpio-vf610: Add imx8ulp compatible string")
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 .../devicetree/bindings/gpio/gpio-vf610.yaml       | 41 ++++++++++++++++++++++
 1 file changed, 41 insertions(+)

Comments

sashiko-bot@kernel.org Nov. 5, 2026, 4:09 a.m. UTC | #1
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] dt-bindings: gpio: vf610: unwieldy per-compatible conditionals in schema
--

commit ea7be1f0505474b900ce5dd27177e80fd2222683
Author: Peng Fan <peng.fan@nxp.com>

dt-bindings: gpio: vf610: fix clock requirements per SoC

This commit updates the gpio-vf610 device tree binding schema to enforce
SoC-specific clock requirements for VF610, i.MX7ULP, and i.MX8ULP (and its
derivatives) via conditional blocks in allOf.

> diff --git a/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml b/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml
> index a31f64b6d40b4..d1d5315ee1648 100644
> --- a/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml
> +++ b/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml
> @@ -57,11 +57,13 @@ properties:
>      maxItems: 32
>  
>    clocks:
> +    minItems: 1
>      items:
>        - description: SoC GPIO clock
>        - description: SoC PORT clock
>  
>    clock-names:
> +    minItems: 1
>      items:
>        - const: gpio
>        - const: port
> @@ -117,6 +119,45 @@ allOf:
>            items:
>              - description: GPIO register base address
>  
> +  - if:
> +      properties:
> +        compatible:
> +          const: fsl,vf610-gpio
> +    then:
> +      properties:
> +        clocks: false
> +        clock-names: false
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: fsl,imx7ulp-gpio
> +    then:
> +      properties:
> +        clocks:
> +          minItems: 2
> +        clock-names:
> +          minItems: 2
> +      required:
> +        - clocks
> +        - clock-names
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: fsl,imx8ulp-gpio
> +    then:
> +      properties:
> +        clocks:
> +          maxItems: 1
> +        clock-names:
> +          maxItems: 1
> +      required:
> +        - clocks
> +        - clock-names

[Severity: Low]
As reported by Sashiko on v2 [1], this isn't a bug, but in
Documentation/devicetree/bindings/gpio/gpio-vf610.yaml, the fsl,imx8ulp-gpio
family (including fsl,imx93-gpio, fsl,imx94-gpio, and fsl,imx95-gpio) does
not share a compatible fallback with fsl,vf610-gpio or fsl,imx7ulp-gpio, and
almost every hardware resource property now differs across the variants:

Documentation/devicetree/bindings/gpio/gpio-vf610.yaml:
  - if:
      properties:
        compatible:
          contains:
            enum:
              - fsl,vf610-gpio
              - fsl,imx7ulp-gpio
    then:
      properties:
        interrupts:
          maxItems: 1
        reg:
          items:
            - description: PORT register base address
            - description: GPIO register base address
    else:
      properties:
        interrupts:
          minItems: 2
        reg:
          items:
            - description: GPIO register base address

Along with reg (2 items on VF610/i.MX7ULP vs 1 item on i.MX8ULP) and
interrupts (1 item on VF610/i.MX7ULP vs 2 items on i.MX8ULP), clocks and
clock-names are disallowed on VF610, require 2 items on i.MX7ULP, and require
1 item on i.MX8ULP.

Rather than relaxing the top-level clocks and clock-names properties to
minItems: 1 and adding three more per-compatible if-then blocks in allOf,
would it be cleaner to split the fsl,imx8ulp-gpio binding into a separate
schema document?

[1] https://lore.kernel.org/r/20261103-gpio-vf610-fixes-v2-1-7c71fb36e184@nxp.com
Peng Fan Nov. 5, 2026, 12:30 p.m. UTC | #2
On Thu, Nov 05, 2026 at 11:52:59AM +0800, Peng Fan (OSS) wrote:
>From: Peng Fan <peng.fan@nxp.com>
>
>The i.MX7ULP GPIO controller needs both the GPIO and PORT clocks,
>while the i.MX8ULP and its derivatives (i.MX93/94/95/952) only have
>a single "gpio" clock. The VF610 controller has no gateable clocks,
>so force clocks and clock-names false.

Sashiko reported:

[Severity: Low]
As reported by Sashiko on v2 [1], this isn't a bug, but in
Documentation/devicetree/bindings/gpio/gpio-vf610.yaml, the fsl,imx8ulp-gpio
family (including fsl,imx93-gpio, fsl,imx94-gpio, and fsl,imx95-gpio) does
not share a compatible fallback with fsl,vf610-gpio or fsl,imx7ulp-gpio, and
almost every hardware resource property now differs across the variants:


I prefer to keep the patch as it is since it has a fixes tag. But anyway
if this is not welcomed, I could separate fsl,imx8ulp-gpio into a new dt-binding
file.

Thanks
Peng

>
>Fixes: c61d8b5791ab ("dt-bindings: gpio: gpio-vf610: Add imx8ulp compatible string")
>Signed-off-by: Peng Fan <peng.fan@nxp.com>
>---
> .../devicetree/bindings/gpio/gpio-vf610.yaml       | 41 ++++++++++++++++++++++
> 1 file changed, 41 insertions(+)
>
>diff --git a/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml b/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml
>index a31f64b6d40b..d1d5315ee164 100644
>--- a/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml
>+++ b/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml
>@@ -57,11 +57,13 @@ properties:
>     maxItems: 32
> 
>   clocks:
>+    minItems: 1
>     items:
>       - description: SoC GPIO clock
>       - description: SoC PORT clock
> 
>   clock-names:
>+    minItems: 1
>     items:
>       - const: gpio
>       - const: port
>@@ -117,6 +119,45 @@ allOf:
>           items:
>             - description: GPIO register base address
> 
>+  - if:
>+      properties:
>+        compatible:
>+          const: fsl,vf610-gpio
>+    then:
>+      properties:
>+        clocks: false
>+        clock-names: false
>+
>+  - if:
>+      properties:
>+        compatible:
>+          contains:
>+            const: fsl,imx7ulp-gpio
>+    then:
>+      properties:
>+        clocks:
>+          minItems: 2
>+        clock-names:
>+          minItems: 2
>+      required:
>+        - clocks
>+        - clock-names
>+
>+  - if:
>+      properties:
>+        compatible:
>+          contains:
>+            const: fsl,imx8ulp-gpio
>+    then:
>+      properties:
>+        clocks:
>+          maxItems: 1
>+        clock-names:
>+          maxItems: 1
>+      required:
>+        - clocks
>+        - clock-names
>+
> additionalProperties: false
> 
> examples:
>
>-- 
>2.51.0
>
Frank Li Nov. 5, 2026, 5:22 p.m. UTC | #3
On Thu, Nov 05, 2026 at 11:52:59AM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
>
> The i.MX7ULP GPIO controller needs both the GPIO and PORT clocks,
> while the i.MX8ULP and its derivatives (i.MX93/94/95/952) only have
> a single "gpio" clock. The VF610 controller has no gateable clocks,
> so force clocks and clock-names false.
>
> Fixes: c61d8b5791ab ("dt-bindings: gpio: gpio-vf610: Add imx8ulp compatible string")
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>  .../devicetree/bindings/gpio/gpio-vf610.yaml       | 41 ++++++++++++++++++++++
>  1 file changed, 41 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml b/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml
> index a31f64b6d40b..d1d5315ee164 100644
> --- a/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml
> +++ b/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml
> @@ -57,11 +57,13 @@ properties:
>      maxItems: 32
>
>    clocks:
> +    minItems: 1
>      items:
>        - description: SoC GPIO clock
>        - description: SoC PORT clock
>
>    clock-names:
> +    minItems: 1
>      items:
>        - const: gpio
>        - const: port
> @@ -117,6 +119,45 @@ allOf:
>            items:
>              - description: GPIO register base address
>
> +  - if:
> +      properties:
> +        compatible:
> +          const: fsl,vf610-gpio
> +    then:
> +      properties:
> +        clocks: false
> +        clock-names: false
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: fsl,imx7ulp-gpio
> +    then:
> +      properties:
> +        clocks:
> +          minItems: 2
> +        clock-names:
> +          minItems: 2
> +      required:
> +        - clocks
> +        - clock-names
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: fsl,imx8ulp-gpio
> +    then:
> +      properties:
> +        clocks:
> +          maxItems: 1
> +        clock-names:
> +          maxItems: 1
> +      required:
> +        - clocks
> +        - clock-names
> +
>  additionalProperties: false
>
>  examples:
>
> --
> 2.51.0
>
>
Krzysztof Kozlowski Nov. 6, 2026, 11:54 a.m. UTC | #4
On Thu, Nov 05, 2026 at 11:52:59AM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> The i.MX7ULP GPIO controller needs both the GPIO and PORT clocks,
> while the i.MX8ULP and its derivatives (i.MX93/94/95/952) only have
> a single "gpio" clock. The VF610 controller has no gateable clocks,
> so force clocks and clock-names false.
> 
> Fixes: c61d8b5791ab ("dt-bindings: gpio: gpio-vf610: Add imx8ulp compatible string")
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  .../devicetree/bindings/gpio/gpio-vf610.yaml       | 41 ++++++++++++++++++++++
>  1 file changed, 41 insertions(+)

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

Best regards,
Krzysztof
Rob Herring Nov. 11, 2026, 2:35 p.m. UTC | #5
On Wed, Nov 4, 2026 at 9:56 PM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
>
> From: Peng Fan <peng.fan@nxp.com>
>
> The i.MX7ULP GPIO controller needs both the GPIO and PORT clocks,
> while the i.MX8ULP and its derivatives (i.MX93/94/95/952) only have
> a single "gpio" clock. The VF610 controller has no gateable clocks,
> so force clocks and clock-names false.
>
> Fixes: c61d8b5791ab ("dt-bindings: gpio: gpio-vf610: Add imx8ulp compatible string")
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  .../devicetree/bindings/gpio/gpio-vf610.yaml       | 41 ++++++++++++++++++++++
>  1 file changed, 41 insertions(+)

Now a bunch of warnings in linux-next. Breaking binding changes like
this need to be applied with the .dts changes.

arch/arm64/boot/dts/freescale:952:50
   Schema warnings:50
     60 gpio@47400000 (fsl,imx93-gpio): clock-names: ["gpio","port"]
has more than 1 item
     60 gpio@43830000 (fsl,imx93-gpio): clock-names: ["gpio","port"]
has more than 1 item
     60 gpio@43820000 (fsl,imx93-gpio): clock-names: ["gpio","port"]
has more than 1 item
     60 gpio@43810000 (fsl,imx93-gpio): clock-names: ["gpio","port"]
has more than 1 item
     41 gpio@47400000 (fsl,imx93-gpio): clocks: [[6,116],[6,116]] has
more than 1 item
     41 gpio@43830000 (fsl,imx93-gpio): clocks: [[6,119],[6,119]] has
more than 1 item
     41 gpio@43820000 (fsl,imx93-gpio): clocks: [[6,118],[6,118]] has
more than 1 item
     41 gpio@43810000 (fsl,imx93-gpio): clocks: [[6,117],[6,117]] has
more than 1 item
     40 gpio@47400000 (fsl,imx95-gpio): clock-names: ["gpio","port"]
has more than 1 item
     40 gpio@43850000 (fsl,imx95-gpio): clock-names: ["gpio","port"]
has more than 1 item
     40 gpio@43840000 (fsl,imx95-gpio): clock-names: ["gpio","port"]
has more than 1 item
     40 gpio@43820000 (fsl,imx95-gpio): clock-names: ["gpio","port"]
has more than 1 item
     40 gpio@43810000 (fsl,imx95-gpio): clock-names: ["gpio","port"]
has more than 1 item
     34 gpio@47400000 (fsl,imx95-gpio): clocks: [[24,54],[24,54]] has
more than 1 item
     34 gpio@43850000 (fsl,imx95-gpio): clocks: [[24,119],[24,119]]
has more than 1 item
     34 gpio@43840000 (fsl,imx95-gpio): clocks: [[24,119],[24,119]]
has more than 1 item
     34 gpio@43820000 (fsl,imx95-gpio): clocks: [[24,119],[24,119]]
has more than 1 item
     34 gpio@43810000 (fsl,imx95-gpio): clocks: [[24,119],[24,119]]
has more than 1 item
     19 gpio@47400000 (fsl,imx93-gpio): clocks: [[3,116],[3,116]] has
more than 1 item
     19 gpio@43830000 (fsl,imx93-gpio): clocks: [[3,119],[3,119]] has
more than 1 item
     19 gpio@43820000 (fsl,imx93-gpio): clocks: [[3,118],[3,118]] has
more than 1 item
     19 gpio@43810000 (fsl,imx93-gpio): clocks: [[3,117],[3,117]] has
more than 1 item
      5 gpio@43870000 (fsl,imx94-gpio): "clocks" is a required property
      5 gpio@43870000 (fsl,imx94-gpio): "clock-names" is a required property
      5 gpio@43860000 (fsl,imx94-gpio): "clocks" is a required property
      5 gpio@43860000 (fsl,imx94-gpio): "clock-names" is a required property
      5 gpio@43850000 (fsl,imx94-gpio): "clocks" is a required property
      5 gpio@43850000 (fsl,imx94-gpio): "clock-names" is a required property
      5 gpio@43840000 (fsl,imx94-gpio): "clocks" is a required property
      5 gpio@43840000 (fsl,imx94-gpio): "clock-names" is a required property
      5 gpio@43820000 (fsl,imx94-gpio): "clocks" is a required property
      5 gpio@43820000 (fsl,imx94-gpio): "clock-names" is a required property
      5 gpio@43810000 (fsl,imx94-gpio): "clocks" is a required property
      5 gpio@43810000 (fsl,imx94-gpio): "clock-names" is a required property
      3 gpio@47400000 (fsl,imx95-gpio): clocks: [[25,54],[25,54]] has
more than 1 item
      3 gpio@47400000 (fsl,imx95-gpio): clocks: [[2,54],[2,54]] has
more than 1 item
      3 gpio@43850000 (fsl,imx95-gpio): clocks: [[25,119],[25,119]]
has more than 1 item
      3 gpio@43850000 (fsl,imx95-gpio): clocks: [[2,119],[2,119]] has
more than 1 item
      3 gpio@43840000 (fsl,imx95-gpio): clocks: [[25,119],[25,119]]
has more than 1 item
      3 gpio@43840000 (fsl,imx95-gpio): clocks: [[2,119],[2,119]] has
more than 1 item
      3 gpio@43820000 (fsl,imx95-gpio): clocks: [[25,119],[25,119]]
has more than 1 item
      3 gpio@43820000 (fsl,imx95-gpio): clocks: [[2,119],[2,119]] has
more than 1 item
      3 gpio@43810000 (fsl,imx95-gpio): clocks: [[25,119],[25,119]]
has more than 1 item
      3 gpio@43810000 (fsl,imx95-gpio): clocks: [[2,119],[2,119]] has
more than 1 item
      2 gpio@2e200000 (fsl,imx8ulp-gpio): clocks: [[41,18],[41,18]]
has more than 1 item
      2 gpio@2e200000 (fsl,imx8ulp-gpio): clock-names: ["gpio","port"]
has more than 1 item
      2 gpio@2d010000 (fsl,imx8ulp-gpio): clocks: [[19,22],[19,10]]
has more than 1 item
      2 gpio@2d010000 (fsl,imx8ulp-gpio): clock-names: ["gpio","port"]
has more than 1 item
      2 gpio@2d000000 (fsl,imx8ulp-gpio): clocks: [[19,21],[19,9]] has
more than 1 item
      2 gpio@2d000000 (fsl,imx8ulp-gpio): clock-names: ["gpio","port"]
has more than 1 item
Frank Li Nov. 11, 2026, 4:27 p.m. UTC | #6
On Wed, Nov 11, 2026 at 08:35:04AM -0600, Rob Herring wrote:
> On Wed, Nov 4, 2026 at 9:56 PM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
> >
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > The i.MX7ULP GPIO controller needs both the GPIO and PORT clocks,
> > while the i.MX8ULP and its derivatives (i.MX93/94/95/952) only have
> > a single "gpio" clock. The VF610 controller has no gateable clocks,
> > so force clocks and clock-names false.
> >
> > Fixes: c61d8b5791ab ("dt-bindings: gpio: gpio-vf610: Add imx8ulp compatible string")
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > ---
> >  .../devicetree/bindings/gpio/gpio-vf610.yaml       | 41 ++++++++++++++++++++++
> >  1 file changed, 41 insertions(+)
>
> Now a bunch of warnings in linux-next. Breaking binding changes like
> this need to be applied with the .dts changes.
>
> arch/arm64/boot/dts/freescale:952:50
>    Schema warnings:50
>      60 gpio@47400000 (fsl,imx93-gpio): clock-names: ["gpio","port"]

I will apply dts change.

Frank
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml b/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml
index a31f64b6d40b..d1d5315ee164 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml
+++ b/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml
@@ -57,11 +57,13 @@  properties:
     maxItems: 32
 
   clocks:
+    minItems: 1
     items:
       - description: SoC GPIO clock
       - description: SoC PORT clock
 
   clock-names:
+    minItems: 1
     items:
       - const: gpio
       - const: port
@@ -117,6 +119,45 @@  allOf:
           items:
             - description: GPIO register base address
 
+  - if:
+      properties:
+        compatible:
+          const: fsl,vf610-gpio
+    then:
+      properties:
+        clocks: false
+        clock-names: false
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: fsl,imx7ulp-gpio
+    then:
+      properties:
+        clocks:
+          minItems: 2
+        clock-names:
+          minItems: 2
+      required:
+        - clocks
+        - clock-names
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: fsl,imx8ulp-gpio
+    then:
+      properties:
+        clocks:
+          maxItems: 1
+        clock-names:
+          maxItems: 1
+      required:
+        - clocks
+        - clock-names
+
 additionalProperties: false
 
 examples: