linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/1] dt-bindings: gpio: mpc8xxx: Convert to yaml format
@ 2024-05-30 16:54 Frank Li
  2024-05-31  6:16 ` Alexander Stein
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Frank Li @ 2024-05-30 16:54 UTC (permalink / raw)
  To: robh
  Cc: Frank.Li, brgl, conor+dt, devicetree, imx, krzk+dt, linus.walleij,
	linux-gpio, linux-kernel

Convert binding doc from txt to yaml.

Remove redundated "gpio1: gpio@2300000" example.
Add gpio-controller at example "gpio@1100".

Signed-off-by: Frank Li <Frank.Li@nxp.com>
---

Notes:
    Change from v1 to v2
     - Add gpio-controller at example "gpio@1100". to fix bot error.
    Strangely, I can't reproduce locally.
    
    Pass dt_binding_check
    make dt_binding_check DT_SCHEMA_FILES=fsl,qoriq-gpio.yaml
      SCHEMA  Documentation/devicetree/bindings/processed-schema.json
      CHKDT   Documentation/devicetree/bindings
      LINT    Documentation/devicetree/bindings
      DTC_CHK Documentation/devicetree/bindings/gpio/fsl,qoriq-gpio.example.dtb

 .../bindings/gpio/fsl,qoriq-gpio.yaml         | 82 +++++++++++++++++++
 .../devicetree/bindings/gpio/gpio-mpc8xxx.txt | 53 ------------
 2 files changed, 82 insertions(+), 53 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/gpio/fsl,qoriq-gpio.yaml
 delete mode 100644 Documentation/devicetree/bindings/gpio/gpio-mpc8xxx.txt

diff --git a/Documentation/devicetree/bindings/gpio/fsl,qoriq-gpio.yaml b/Documentation/devicetree/bindings/gpio/fsl,qoriq-gpio.yaml
new file mode 100644
index 0000000000000..adc955679d066
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/fsl,qoriq-gpio.yaml
@@ -0,0 +1,82 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/gpio/fsl,qoriq-gpio.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale MPC512x/MPC8xxx/QorIQ/Layerscape GPIO controller
+
+maintainers:
+  - Frank Li <Frank.Li@nxp.com>
+
+properties:
+  compatible:
+    oneOf:
+      - enum:
+          - fsl,mpc5121-gpio
+          - fsl,mpc5125-gpio
+          - fsl,mpc8349-gpio
+          - fsl,mpc8572-gpio
+          - fsl,mpc8610-gpio
+          - fsl,pq3-gpio
+      - items:
+          - enum:
+              - fsl,ls1021a-gpio
+              - fsl,ls1028a-gpio
+              - fsl,ls1043a-gpio
+              - fsl,ls1088a-gpio
+              - fsl,ls2080a-gpio
+          - const: fsl,qoriq-gpio
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  "#gpio-cells":
+    const: 2
+
+  gpio-controller: true
+
+  interrupt-controller: true
+
+  "#interrupt-cells":
+    const: 2
+
+  little-endian:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      GPIO registers are used as little endian. If not
+      present registers are used as big endian by default.
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - "#gpio-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    gpio@1100 {
+        compatible = "fsl,mpc5125-gpio";
+        reg = <0x1100 0x080>;
+        interrupts = <78 0x8>;
+        gpio-controller;
+        #gpio-cells = <2>;
+    };
+
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    gpio@2300000 {
+        compatible = "fsl,ls2080a-gpio", "fsl,qoriq-gpio";
+        reg = <0x2300000 0x10000>;
+        interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
+        gpio-controller;
+        little-endian;
+        #gpio-cells = <2>;
+        interrupt-controller;
+        #interrupt-cells = <2>;
+    };
diff --git a/Documentation/devicetree/bindings/gpio/gpio-mpc8xxx.txt b/Documentation/devicetree/bindings/gpio/gpio-mpc8xxx.txt
deleted file mode 100644
index cd28e932bf50e..0000000000000
--- a/Documentation/devicetree/bindings/gpio/gpio-mpc8xxx.txt
+++ /dev/null
@@ -1,53 +0,0 @@
-* Freescale MPC512x/MPC8xxx/QorIQ/Layerscape GPIO controller
-
-Required properties:
-- compatible : Should be "fsl,<soc>-gpio"
-  The following <soc>s are known to be supported:
-	mpc5121, mpc5125, mpc8349, mpc8572, mpc8610, pq3, qoriq,
-	ls1021a, ls1043a, ls2080a, ls1028a, ls1088a.
-- reg : Address and length of the register set for the device
-- interrupts : Should be the port interrupt shared by all 32 pins.
-- #gpio-cells : Should be two.  The first cell is the pin number and
-  the second cell is used to specify the gpio polarity:
-      0 = active high
-      1 = active low
-
-Optional properties:
-- little-endian : GPIO registers are used as little endian. If not
-                  present registers are used as big endian by default.
-
-Example of gpio-controller node for a mpc5125 SoC:
-
-gpio0: gpio@1100 {
-	compatible = "fsl,mpc5125-gpio";
-	#gpio-cells = <2>;
-	reg = <0x1100 0x080>;
-	interrupts = <78 0x8>;
-};
-
-Example of gpio-controller node for a ls2080a SoC:
-
-gpio0: gpio@2300000 {
-	compatible = "fsl,ls2080a-gpio", "fsl,qoriq-gpio";
-	reg = <0x0 0x2300000 0x0 0x10000>;
-	interrupts = <0 36 0x4>; /* Level high type */
-	gpio-controller;
-	little-endian;
-	#gpio-cells = <2>;
-	interrupt-controller;
-	#interrupt-cells = <2>;
-};
-
-
-Example of gpio-controller node for a ls1028a/ls1088a SoC:
-
-gpio1: gpio@2300000 {
-	compatible = "fsl,ls1028a-gpio", "fsl,ls1088a-gpio", "fsl,qoriq-gpio";
-	reg = <0x0 0x2300000 0x0 0x10000>;
-	interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
-	gpio-controller;
-	#gpio-cells = <2>;
-	interrupt-controller;
-	#interrupt-cells = <2>;
-	little-endian;
-};
-- 
2.34.1


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

* Re: [PATCH v2 1/1] dt-bindings: gpio: mpc8xxx: Convert to yaml format
  2024-05-30 16:54 [PATCH v2 1/1] dt-bindings: gpio: mpc8xxx: Convert to yaml format Frank Li
@ 2024-05-31  6:16 ` Alexander Stein
  2024-05-31  8:07 ` Krzysztof Kozlowski
  2024-06-12  9:46 ` Linus Walleij
  2 siblings, 0 replies; 4+ messages in thread
From: Alexander Stein @ 2024-05-31  6:16 UTC (permalink / raw)
  To: robh, Frank Li
  Cc: Frank.Li, brgl, conor+dt, devicetree, imx, krzk+dt, linus.walleij,
	linux-gpio, linux-kernel

Hi Frank,

thanks for your patch.

Am Donnerstag, 30. Mai 2024, 18:54:24 CEST schrieb Frank Li:
> Convert binding doc from txt to yaml.
> 
> Remove redundated "gpio1: gpio@2300000" example.
> Add gpio-controller at example "gpio@1100".
> 
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
> 
> Notes:
>     Change from v1 to v2
>      - Add gpio-controller at example "gpio@1100". to fix bot error.
>     Strangely, I can't reproduce locally.
>     
>     Pass dt_binding_check
>     make dt_binding_check DT_SCHEMA_FILES=fsl,qoriq-gpio.yaml
>       SCHEMA  Documentation/devicetree/bindings/processed-schema.json
>       CHKDT   Documentation/devicetree/bindings
>       LINT    Documentation/devicetree/bindings
>       DTC_CHK Documentation/devicetree/bindings/gpio/fsl,qoriq-gpio.example.dtb
> 
>  .../bindings/gpio/fsl,qoriq-gpio.yaml         | 82 +++++++++++++++++++
>  .../devicetree/bindings/gpio/gpio-mpc8xxx.txt | 53 ------------
>  2 files changed, 82 insertions(+), 53 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/gpio/fsl,qoriq-gpio.yaml
>  delete mode 100644 Documentation/devicetree/bindings/gpio/gpio-mpc8xxx.txt
> 
> diff --git a/Documentation/devicetree/bindings/gpio/fsl,qoriq-gpio.yaml b/Documentation/devicetree/bindings/gpio/fsl,qoriq-gpio.yaml
> new file mode 100644
> index 0000000000000..adc955679d066
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/gpio/fsl,qoriq-gpio.yaml
> @@ -0,0 +1,82 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/gpio/fsl,qoriq-gpio.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Freescale MPC512x/MPC8xxx/QorIQ/Layerscape GPIO controller
> +
> +maintainers:
> +  - Frank Li <Frank.Li@nxp.com>
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - enum:
> +          - fsl,mpc5121-gpio
> +          - fsl,mpc5125-gpio
> +          - fsl,mpc8349-gpio
> +          - fsl,mpc8572-gpio
> +          - fsl,mpc8610-gpio
> +          - fsl,pq3-gpio
> +      - items:
> +          - enum:
> +              - fsl,ls1021a-gpio
> +              - fsl,ls1028a-gpio
> +              - fsl,ls1043a-gpio
> +              - fsl,ls1088a-gpio
> +              - fsl,ls2080a-gpio
> +          - const: fsl,qoriq-gpio
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  "#gpio-cells":
> +    const: 2
> +
> +  gpio-controller: true
> +
> +  interrupt-controller: true
> +
> +  "#interrupt-cells":
> +    const: 2
> +
> +  little-endian:
> +    $ref: /schemas/types.yaml#/definitions/flag
> +    description:
> +      GPIO registers are used as little endian. If not
> +      present registers are used as big endian by default.
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - "#gpio-cells"
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    gpio@1100 {
> +        compatible = "fsl,mpc5125-gpio";
> +        reg = <0x1100 0x080>;
> +        interrupts = <78 0x8>;
> +        gpio-controller;
> +        #gpio-cells = <2>;
> +    };
> +
> +  - |
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +    gpio@2300000 {
> +        compatible = "fsl,ls2080a-gpio", "fsl,qoriq-gpio";
> +        reg = <0x2300000 0x10000>;
> +        interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
> +        gpio-controller;
> +        little-endian;
> +        #gpio-cells = <2>;

Please keep 'gpio-controller' and '#gpio-cells' together. I would move
little-endian either below reg directly or below interrupts.

Thanks
Alexander

> +        interrupt-controller;
> +        #interrupt-cells = <2>;
> +    };
> diff --git a/Documentation/devicetree/bindings/gpio/gpio-mpc8xxx.txt b/Documentation/devicetree/bindings/gpio/gpio-mpc8xxx.txt
> deleted file mode 100644
> index cd28e932bf50e..0000000000000
> --- a/Documentation/devicetree/bindings/gpio/gpio-mpc8xxx.txt
> +++ /dev/null
> @@ -1,53 +0,0 @@
> -* Freescale MPC512x/MPC8xxx/QorIQ/Layerscape GPIO controller
> -
> -Required properties:
> -- compatible : Should be "fsl,<soc>-gpio"
> -  The following <soc>s are known to be supported:
> -	mpc5121, mpc5125, mpc8349, mpc8572, mpc8610, pq3, qoriq,
> -	ls1021a, ls1043a, ls2080a, ls1028a, ls1088a.
> -- reg : Address and length of the register set for the device
> -- interrupts : Should be the port interrupt shared by all 32 pins.
> -- #gpio-cells : Should be two.  The first cell is the pin number and
> -  the second cell is used to specify the gpio polarity:
> -      0 = active high
> -      1 = active low
> -
> -Optional properties:
> -- little-endian : GPIO registers are used as little endian. If not
> -                  present registers are used as big endian by default.
> -
> -Example of gpio-controller node for a mpc5125 SoC:
> -
> -gpio0: gpio@1100 {
> -	compatible = "fsl,mpc5125-gpio";
> -	#gpio-cells = <2>;
> -	reg = <0x1100 0x080>;
> -	interrupts = <78 0x8>;
> -};
> -
> -Example of gpio-controller node for a ls2080a SoC:
> -
> -gpio0: gpio@2300000 {
> -	compatible = "fsl,ls2080a-gpio", "fsl,qoriq-gpio";
> -	reg = <0x0 0x2300000 0x0 0x10000>;
> -	interrupts = <0 36 0x4>; /* Level high type */
> -	gpio-controller;
> -	little-endian;
> -	#gpio-cells = <2>;
> -	interrupt-controller;
> -	#interrupt-cells = <2>;
> -};
> -
> -
> -Example of gpio-controller node for a ls1028a/ls1088a SoC:
> -
> -gpio1: gpio@2300000 {
> -	compatible = "fsl,ls1028a-gpio", "fsl,ls1088a-gpio", "fsl,qoriq-gpio";
> -	reg = <0x0 0x2300000 0x0 0x10000>;
> -	interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
> -	gpio-controller;
> -	#gpio-cells = <2>;
> -	interrupt-controller;
> -	#interrupt-cells = <2>;
> -	little-endian;
> -};
> 


-- 
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/



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

* Re: [PATCH v2 1/1] dt-bindings: gpio: mpc8xxx: Convert to yaml format
  2024-05-30 16:54 [PATCH v2 1/1] dt-bindings: gpio: mpc8xxx: Convert to yaml format Frank Li
  2024-05-31  6:16 ` Alexander Stein
@ 2024-05-31  8:07 ` Krzysztof Kozlowski
  2024-06-12  9:46 ` Linus Walleij
  2 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2024-05-31  8:07 UTC (permalink / raw)
  To: Frank Li, robh
  Cc: brgl, conor+dt, devicetree, imx, krzk+dt, linus.walleij,
	linux-gpio, linux-kernel

On 30/05/2024 18:54, Frank Li wrote:
> Convert binding doc from txt to yaml.
> 
> Remove redundated "gpio1: gpio@2300000" example.
> Add gpio-controller at example "gpio@1100".
> 
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


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

* Re: [PATCH v2 1/1] dt-bindings: gpio: mpc8xxx: Convert to yaml format
  2024-05-30 16:54 [PATCH v2 1/1] dt-bindings: gpio: mpc8xxx: Convert to yaml format Frank Li
  2024-05-31  6:16 ` Alexander Stein
  2024-05-31  8:07 ` Krzysztof Kozlowski
@ 2024-06-12  9:46 ` Linus Walleij
  2 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2024-06-12  9:46 UTC (permalink / raw)
  To: Frank Li
  Cc: robh, brgl, conor+dt, devicetree, imx, krzk+dt, linux-gpio,
	linux-kernel

On Thu, May 30, 2024 at 6:54 PM Frank Li <Frank.Li@nxp.com> wrote:

> Convert binding doc from txt to yaml.
>
> Remove redundated "gpio1: gpio@2300000" example.
> Add gpio-controller at example "gpio@1100".
>
> Signed-off-by: Frank Li <Frank.Li@nxp.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

end of thread, other threads:[~2024-06-12  9:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-30 16:54 [PATCH v2 1/1] dt-bindings: gpio: mpc8xxx: Convert to yaml format Frank Li
2024-05-31  6:16 ` Alexander Stein
2024-05-31  8:07 ` Krzysztof Kozlowski
2024-06-12  9:46 ` Linus Walleij

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