2020-05-14 11:54:50

by Anson Huang

[permalink] [raw]
Subject: [PATCH] dt-bindings: pwm: Convert mxs pwm to json-schema

Convert the mxs pwm binding to DT schema format using json-schema.

Signed-off-by: Anson Huang <[email protected]>
---
Documentation/devicetree/bindings/pwm/mxs-pwm.txt | 17 ---------
Documentation/devicetree/bindings/pwm/mxs-pwm.yaml | 43 ++++++++++++++++++++++
2 files changed, 43 insertions(+), 17 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/pwm/mxs-pwm.txt
create mode 100644 Documentation/devicetree/bindings/pwm/mxs-pwm.yaml

diff --git a/Documentation/devicetree/bindings/pwm/mxs-pwm.txt b/Documentation/devicetree/bindings/pwm/mxs-pwm.txt
deleted file mode 100644
index a1b8a48..0000000
--- a/Documentation/devicetree/bindings/pwm/mxs-pwm.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-Freescale MXS PWM controller
-
-Required properties:
-- compatible: should be "fsl,imx23-pwm"
-- reg: physical base address and length of the controller's registers
-- #pwm-cells: should be 3. See pwm.yaml in this directory for a description of
- the cells format.
-- fsl,pwm-number: the number of PWM devices
-
-Example:
-
-pwm: pwm@80064000 {
- compatible = "fsl,imx28-pwm", "fsl,imx23-pwm";
- reg = <0x80064000 0x2000>;
- #pwm-cells = <3>;
- fsl,pwm-number = <8>;
-};
diff --git a/Documentation/devicetree/bindings/pwm/mxs-pwm.yaml b/Documentation/devicetree/bindings/pwm/mxs-pwm.yaml
new file mode 100644
index 0000000..da68f4a
--- /dev/null
+++ b/Documentation/devicetree/bindings/pwm/mxs-pwm.yaml
@@ -0,0 +1,43 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pwm/mxs-pwm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale MXS PWM controller
+
+maintainers:
+ - Shawn Guo <[email protected]>
+ - Anson Huang <[email protected]>
+
+properties:
+ compatible:
+ enum:
+ - fsl,imx23-pwm
+
+ reg:
+ maxItems: 1
+
+ "#pwm-cells":
+ const: 3
+
+ fsl,pwm-number:
+ $ref: '/schemas/types.yaml#/definitions/uint32'
+ description: u32 value representing the number of PWM devices
+
+required:
+ - compatible
+ - reg
+ - "#pwm-cells"
+ - fsl,pwm-number
+
+additionalProperties: false
+
+examples:
+ - |
+ pwm@80064000 {
+ compatible = "fsl,imx23-pwm";
+ reg = <0x80064000 0x2000>;
+ #pwm-cells = <3>;
+ fsl,pwm-number = <8>;
+ };
--
2.7.4


2020-05-18 05:23:31

by Aisheng Dong

[permalink] [raw]
Subject: RE: [PATCH] dt-bindings: pwm: Convert mxs pwm to json-schema

> +title: Freescale MXS PWM controller
> +
> +maintainers:
> + - Shawn Guo <[email protected]>
> + - Anson Huang <[email protected]>
> +
> +properties:
> + compatible:
> + enum:
> + - fsl,imx23-pwm
> +
> + reg:
> + maxItems: 1
> +
> + "#pwm-cells":
> + const: 3

Seems you missed the reference to pwm.yaml.

Regards
Aisheng

> +
> + fsl,pwm-number:
> + $ref: '/schemas/types.yaml#/definitions/uint32'
> + description: u32 value representing the number of PWM devices
> +
> +required:
> + - compatible
> + - reg
> + - "#pwm-cells"
> + - fsl,pwm-number
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + pwm@80064000 {
> + compatible = "fsl,imx23-pwm";
> + reg = <0x80064000 0x2000>;
> + #pwm-cells = <3>;
> + fsl,pwm-number = <8>;
> + };
> --
> 2.7.4

2020-05-18 05:35:48

by Anson Huang

[permalink] [raw]
Subject: RE: [PATCH] dt-bindings: pwm: Convert mxs pwm to json-schema



> Subject: RE: [PATCH] dt-bindings: pwm: Convert mxs pwm to json-schema
>
> > +title: Freescale MXS PWM controller
> > +
> > +maintainers:
> > + - Shawn Guo <[email protected]>
> > + - Anson Huang <[email protected]>
> > +
> > +properties:
> > + compatible:
> > + enum:
> > + - fsl,imx23-pwm
> > +
> > + reg:
> > + maxItems: 1
> > +
> > + "#pwm-cells":
> > + const: 3
>
> Seems you missed the reference to pwm.yaml.

It is because many pwm yaml files also has no "#pwm-cells" reference, so I
am NOT sure if it is a MUST:

Documentation/devicetree/bindings/pwm/allwinner,sun4i-a10-pwm.yaml
Documentation/devicetree/bindings/pwm/google,cros-ec-pwm.yaml
Documentation/devicetree/bindings/pwm/iqs620a-pwm.yaml
...

Anson

2020-05-18 06:08:59

by Aisheng Dong

[permalink] [raw]
Subject: RE: [PATCH] dt-bindings: pwm: Convert mxs pwm to json-schema

> From: Anson Huang <[email protected]>
> Sent: Monday, May 18, 2020 1:32 PM
>
> > Subject: RE: [PATCH] dt-bindings: pwm: Convert mxs pwm to json-schema
> >
> > > +title: Freescale MXS PWM controller
> > > +
> > > +maintainers:
> > > + - Shawn Guo <[email protected]>
> > > + - Anson Huang <[email protected]>
> > > +
> > > +properties:
> > > + compatible:
> > > + enum:
> > > + - fsl,imx23-pwm
> > > +
> > > + reg:
> > > + maxItems: 1
> > > +
> > > + "#pwm-cells":
> > > + const: 3
> >
> > Seems you missed the reference to pwm.yaml.
>
> It is because many pwm yaml files also has no "#pwm-cells" reference, so I am
> NOT sure if it is a MUST:
>
> Documentation/devicetree/bindings/pwm/allwinner,sun4i-a10-pwm.yaml
> Documentation/devicetree/bindings/pwm/google,cros-ec-pwm.yaml
> Documentation/devicetree/bindings/pwm/iqs620a-pwm.yaml
> ...

I guess we'd better add it.
Let's wait for Rob's feedback.

Regards
Aisheng

>
> Anson

2020-05-28 15:22:48

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: pwm: Convert mxs pwm to json-schema

On Thu, 14 May 2020 19:41:10 +0800, Anson Huang wrote:
> Convert the mxs pwm binding to DT schema format using json-schema.
>
> Signed-off-by: Anson Huang <[email protected]>
> ---
> Documentation/devicetree/bindings/pwm/mxs-pwm.txt | 17 ---------
> Documentation/devicetree/bindings/pwm/mxs-pwm.yaml | 43 ++++++++++++++++++++++
> 2 files changed, 43 insertions(+), 17 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/pwm/mxs-pwm.txt
> create mode 100644 Documentation/devicetree/bindings/pwm/mxs-pwm.yaml
>

Applied, thanks!