Skip to contentSkip to conversation

dt-bindings: pwm: mxs: Document fsl,imx28-pwm

PATCH Superseded Fabio Estevam 4 participants 8 messages Sep 21, 2023 – Sep 22, 2023

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/3 dt-bindings: pwm: mxs: Document fsl,imx28-pwm

From: Fabio Estevam <[email protected]>

imx28 uses the same PWM block that is found on imx23.

Add an entry for fsl,imx28-pwm.

---
 Documentation/devicetree/bindings/pwm/mxs-pwm.yaml | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/pwm/mxs-pwm.yaml +6 -2
index 6ffbed204c25..655f008081d5 100644
@@ -15,8 +15,12 @@ allOf:
 
 properties:
   compatible:
-    enum:
-      - fsl,imx23-pwm
+    oneOf:
+      - const: fsl,imx23-pwm
+      - items:
+          - enum:
+              - fsl,imx28-pwm
+          - const: fsl,imx23-pwm
 
   reg:
     maxItems: 1
Signature · 1 line
2.34.1
author reviewer
#1 lore raw

PATCH 2/3 dt-bindings: pwm: mxs: Document the clocks property

From: Fabio Estevam <[email protected]>

The 'clocks' property is mandatory for the PWM to operate.

Document it.

---
 Documentation/devicetree/bindings/pwm/mxs-pwm.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/pwm/mxs-pwm.yaml +5 -0
index 655f008081d5..8f50e23ca8c9 100644
@@ -25,6 +25,9 @@ properties:
   reg:
     maxItems: 1
 
+  clocks:
+    maxItems: 1
+
   "#pwm-cells":
     const: 3
 
@@ -35,6 +38,7 @@ properties:
 required:
   - compatible
   - reg
+  - clocks
   - fsl,pwm-number
 
 additionalProperties: false
@@ -44,6 +48,7 @@ examples:
     pwm@80064000 {
         compatible = "fsl,imx23-pwm";
         reg = <0x80064000 0x2000>;
+        clocks = <&clks 30>;
         #pwm-cells = <3>;
         fsl,pwm-number = <8>;
     };
Signature · 1 line
2.34.1
Reviewed-by on v1 2/3
#2 lore raw

Re: [PATCH 2/3] dt-bindings: pwm: mxs: Document the clocks property

Hello,

Quoted 5 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

The 'clocks' property is mandatory for the PWM to operate.

Document it.

Indeed the driver does:

        mxs->clk = devm_clk_get(&pdev->dev, NULL);
        if (IS_ERR(mxs->clk))
                return PTR_ERR(mxs->clk);

so this is in line with the implementation.

Thanks
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
Acked-by on v1 2/3
#3 lore raw

Re: [PATCH 2/3] dt-bindings: pwm: mxs: Document the clocks property

In reply to Fabio Estevam
Quoted 5 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

The 'clocks' property is mandatory for the PWM to operate.

Document it.

Thanks,
Conor.

Quoted 39 lines
---
 Documentation/devicetree/bindings/pwm/mxs-pwm.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/pwm/mxs-pwm.yaml +5 -0
index 655f008081d5..8f50e23ca8c9 100644
@@ -25,6 +25,9 @@ properties:
   reg:
     maxItems: 1
 
+  clocks:
+    maxItems: 1
+
   "#pwm-cells":
     const: 3
 
@@ -35,6 +38,7 @@ properties:
 required:
   - compatible
   - reg
+  - clocks
   - fsl,pwm-number
 
 additionalProperties: false
@@ -44,6 +48,7 @@ examples:
     pwm@80064000 {
         compatible = "fsl,imx23-pwm";
         reg = <0x80064000 0x2000>;
+        clocks = <&clks 30>;
         #pwm-cells = <3>;
         fsl,pwm-number = <8>;
     };
Signature · 1 line
2.34.1
author reviewer
#4 lore raw

PATCH 3/3 dt-bindings: pwm: mxs: Allow passing #pwm-cells = <2>

In reply to Fabio Estevam

From: Fabio Estevam <[email protected]>

All the in-tree imx23 and imx28 devicetrees use #pwm-cells = <2>.

Allow it in the schema to avoid warnings.

It is still possible for a devicetree to pass the third cell with the PWM polarity though.

This is similar to imx-pwm.yaml that allows #pwm-cells to be 2 or 3.

---
 Documentation/devicetree/bindings/pwm/mxs-pwm.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/pwm/mxs-pwm.yaml +3 -1
index 8f50e23ca8c9..405c6412dd5f 100644
@@ -29,7 +29,9 @@ properties:
     maxItems: 1
 
   "#pwm-cells":
-    const: 3
+    enum:
+      - 2
+      - 3
 
   fsl,pwm-number:
     $ref: /schemas/types.yaml#/definitions/uint32
Signature · 1 line
2.34.1
#5 lore raw

Re: [PATCH 3/3] dt-bindings: pwm: mxs: Allow passing #pwm-cells = <2>

Hello Fabio,

Quoted 10 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

All the in-tree imx23 and imx28 devicetrees use #pwm-cells = <2>.

Allow it in the schema to avoid warnings.

It is still possible for a devicetree to pass the third cell with the PWM polarity though.

This is similar to imx-pwm.yaml that allows #pwm-cells to be 2 or 3.

Alternatively switch all devicetrees to use = <3>? That's what I'd prefer given that the PWM supports both polarities.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
maintainer Acked-by
#6 lore raw

Re: [PATCH 3/3] dt-bindings: pwm: mxs: Allow passing #pwm-cells = <2>

Quoted 9 lines · Uwe Kleine-König

Hello Fabio,

Quoted 6 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

All the in-tree imx23 and imx28 devicetrees use #pwm-cells = <2>.

Allow it in the schema to avoid warnings.

Quoted 7 lines
Quoted 4 lines

It is still possible for a devicetree to pass the third cell with the PWM polarity though.

This is similar to imx-pwm.yaml that allows #pwm-cells to be 2 or 3.

Alternatively switch all devicetrees to use = <3>? That's what I'd prefer given that the PWM supports both polarities.

Technically, that could break older clients predating 3 cell support. But maybe that's far back enough now to not care. Either way,