devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] dt-bindings: pwm: mxs: Document fsl,imx28-pwm
@ 2023-09-21 18:43 Fabio Estevam
  2023-09-21 18:43 ` [PATCH 2/3] dt-bindings: pwm: mxs: Document the clocks property Fabio Estevam
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Fabio Estevam @ 2023-09-21 18:43 UTC (permalink / raw)
  To: thierry.reding
  Cc: u.kleine-koenig, krzysztof.kozlowski+dt, conor+dt, robh+dt,
	linux-pwm, devicetree, Fabio Estevam

From: Fabio Estevam <festevam@denx.de>

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

Add an entry for fsl,imx28-pwm.

Signed-off-by: Fabio Estevam <festevam@denx.de>
---
 Documentation/devicetree/bindings/pwm/mxs-pwm.yaml | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/pwm/mxs-pwm.yaml b/Documentation/devicetree/bindings/pwm/mxs-pwm.yaml
index 6ffbed204c25..655f008081d5 100644
--- a/Documentation/devicetree/bindings/pwm/mxs-pwm.yaml
+++ b/Documentation/devicetree/bindings/pwm/mxs-pwm.yaml
@@ -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
-- 
2.34.1


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

* [PATCH 2/3] dt-bindings: pwm: mxs: Document the clocks property
  2023-09-21 18:43 [PATCH 1/3] dt-bindings: pwm: mxs: Document fsl,imx28-pwm Fabio Estevam
@ 2023-09-21 18:43 ` Fabio Estevam
  2023-09-21 20:07   ` Uwe Kleine-König
  2023-09-22 11:31   ` Conor Dooley
  2023-09-21 18:43 ` [PATCH 3/3] dt-bindings: pwm: mxs: Allow passing #pwm-cells = <2> Fabio Estevam
  2023-09-21 19:59 ` [PATCH 1/3] dt-bindings: pwm: mxs: Document fsl,imx28-pwm Uwe Kleine-König
  2 siblings, 2 replies; 8+ messages in thread
From: Fabio Estevam @ 2023-09-21 18:43 UTC (permalink / raw)
  To: thierry.reding
  Cc: u.kleine-koenig, krzysztof.kozlowski+dt, conor+dt, robh+dt,
	linux-pwm, devicetree, Fabio Estevam

From: Fabio Estevam <festevam@denx.de>

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

Document it.

Signed-off-by: Fabio Estevam <festevam@denx.de>
---
 Documentation/devicetree/bindings/pwm/mxs-pwm.yaml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/pwm/mxs-pwm.yaml b/Documentation/devicetree/bindings/pwm/mxs-pwm.yaml
index 655f008081d5..8f50e23ca8c9 100644
--- a/Documentation/devicetree/bindings/pwm/mxs-pwm.yaml
+++ b/Documentation/devicetree/bindings/pwm/mxs-pwm.yaml
@@ -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>;
     };
-- 
2.34.1


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

* [PATCH 3/3] dt-bindings: pwm: mxs: Allow passing #pwm-cells = <2>
  2023-09-21 18:43 [PATCH 1/3] dt-bindings: pwm: mxs: Document fsl,imx28-pwm Fabio Estevam
  2023-09-21 18:43 ` [PATCH 2/3] dt-bindings: pwm: mxs: Document the clocks property Fabio Estevam
@ 2023-09-21 18:43 ` Fabio Estevam
  2023-09-21 19:59   ` Uwe Kleine-König
  2023-09-21 19:59 ` [PATCH 1/3] dt-bindings: pwm: mxs: Document fsl,imx28-pwm Uwe Kleine-König
  2 siblings, 1 reply; 8+ messages in thread
From: Fabio Estevam @ 2023-09-21 18:43 UTC (permalink / raw)
  To: thierry.reding
  Cc: u.kleine-koenig, krzysztof.kozlowski+dt, conor+dt, robh+dt,
	linux-pwm, devicetree, Fabio Estevam

From: Fabio Estevam <festevam@denx.de>

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.

Signed-off-by: Fabio Estevam <festevam@denx.de>
---
 Documentation/devicetree/bindings/pwm/mxs-pwm.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/pwm/mxs-pwm.yaml b/Documentation/devicetree/bindings/pwm/mxs-pwm.yaml
index 8f50e23ca8c9..405c6412dd5f 100644
--- a/Documentation/devicetree/bindings/pwm/mxs-pwm.yaml
+++ b/Documentation/devicetree/bindings/pwm/mxs-pwm.yaml
@@ -29,7 +29,9 @@ properties:
     maxItems: 1
 
   "#pwm-cells":
-    const: 3
+    enum:
+      - 2
+      - 3
 
   fsl,pwm-number:
     $ref: /schemas/types.yaml#/definitions/uint32
-- 
2.34.1


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

* Re: [PATCH 3/3] dt-bindings: pwm: mxs: Allow passing #pwm-cells = <2>
  2023-09-21 18:43 ` [PATCH 3/3] dt-bindings: pwm: mxs: Allow passing #pwm-cells = <2> Fabio Estevam
@ 2023-09-21 19:59   ` Uwe Kleine-König
  2023-09-22 21:17     ` Rob Herring
  0 siblings, 1 reply; 8+ messages in thread
From: Uwe Kleine-König @ 2023-09-21 19:59 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: thierry.reding, krzysztof.kozlowski+dt, conor+dt, robh+dt,
	linux-pwm, devicetree, Fabio Estevam

[-- Attachment #1: Type: text/plain, Size: 724 bytes --]

Hello Fabio,

On Thu, Sep 21, 2023 at 03:43:48PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@denx.de>
> 
> 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

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH 1/3] dt-bindings: pwm: mxs: Document fsl,imx28-pwm
  2023-09-21 18:43 [PATCH 1/3] dt-bindings: pwm: mxs: Document fsl,imx28-pwm Fabio Estevam
  2023-09-21 18:43 ` [PATCH 2/3] dt-bindings: pwm: mxs: Document the clocks property Fabio Estevam
  2023-09-21 18:43 ` [PATCH 3/3] dt-bindings: pwm: mxs: Allow passing #pwm-cells = <2> Fabio Estevam
@ 2023-09-21 19:59 ` Uwe Kleine-König
  2 siblings, 0 replies; 8+ messages in thread
From: Uwe Kleine-König @ 2023-09-21 19:59 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: thierry.reding, krzysztof.kozlowski+dt, conor+dt, robh+dt,
	linux-pwm, devicetree, Fabio Estevam

[-- Attachment #1: Type: text/plain, Size: 499 bytes --]

On Thu, Sep 21, 2023 at 03:43:46PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@denx.de>
> 
> imx28 uses the same PWM block that is found on imx23.
> 
> Add an entry for fsl,imx28-pwm.
> 
> Signed-off-by: Fabio Estevam <festevam@denx.de>

Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Thanks,
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH 2/3] dt-bindings: pwm: mxs: Document the clocks property
  2023-09-21 18:43 ` [PATCH 2/3] dt-bindings: pwm: mxs: Document the clocks property Fabio Estevam
@ 2023-09-21 20:07   ` Uwe Kleine-König
  2023-09-22 11:31   ` Conor Dooley
  1 sibling, 0 replies; 8+ messages in thread
From: Uwe Kleine-König @ 2023-09-21 20:07 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: thierry.reding, krzysztof.kozlowski+dt, conor+dt, robh+dt,
	linux-pwm, devicetree, Fabio Estevam

[-- Attachment #1: Type: text/plain, Size: 644 bytes --]

Hello,

On Thu, Sep 21, 2023 at 03:43:47PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@denx.de>
> 
> 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.

Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Thanks
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH 2/3] dt-bindings: pwm: mxs: Document the clocks property
  2023-09-21 18:43 ` [PATCH 2/3] dt-bindings: pwm: mxs: Document the clocks property Fabio Estevam
  2023-09-21 20:07   ` Uwe Kleine-König
@ 2023-09-22 11:31   ` Conor Dooley
  1 sibling, 0 replies; 8+ messages in thread
From: Conor Dooley @ 2023-09-22 11:31 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: thierry.reding, u.kleine-koenig, krzysztof.kozlowski+dt, conor+dt,
	robh+dt, linux-pwm, devicetree, Fabio Estevam

[-- Attachment #1: Type: text/plain, Size: 1285 bytes --]

On Thu, Sep 21, 2023 at 03:43:47PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@denx.de>
> 
> The 'clocks' property is mandatory for the PWM to operate.
> 
> Document it.

Acked-by: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.

> 
> Signed-off-by: Fabio Estevam <festevam@denx.de>
> ---
>  Documentation/devicetree/bindings/pwm/mxs-pwm.yaml | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/pwm/mxs-pwm.yaml b/Documentation/devicetree/bindings/pwm/mxs-pwm.yaml
> index 655f008081d5..8f50e23ca8c9 100644
> --- a/Documentation/devicetree/bindings/pwm/mxs-pwm.yaml
> +++ b/Documentation/devicetree/bindings/pwm/mxs-pwm.yaml
> @@ -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>;
>      };
> -- 
> 2.34.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH 3/3] dt-bindings: pwm: mxs: Allow passing #pwm-cells = <2>
  2023-09-21 19:59   ` Uwe Kleine-König
@ 2023-09-22 21:17     ` Rob Herring
  0 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2023-09-22 21:17 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Fabio Estevam, thierry.reding, krzysztof.kozlowski+dt, conor+dt,
	linux-pwm, devicetree, Fabio Estevam

On Thu, Sep 21, 2023 at 09:59:09PM +0200, Uwe Kleine-König wrote:
> Hello Fabio,
> 
> On Thu, Sep 21, 2023 at 03:43:48PM -0300, Fabio Estevam wrote:
> > From: Fabio Estevam <festevam@denx.de>
> > 
> > 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.

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

Acked-by: Rob Herring <robh@kernel.org>

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

end of thread, other threads:[~2023-09-22 21:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-21 18:43 [PATCH 1/3] dt-bindings: pwm: mxs: Document fsl,imx28-pwm Fabio Estevam
2023-09-21 18:43 ` [PATCH 2/3] dt-bindings: pwm: mxs: Document the clocks property Fabio Estevam
2023-09-21 20:07   ` Uwe Kleine-König
2023-09-22 11:31   ` Conor Dooley
2023-09-21 18:43 ` [PATCH 3/3] dt-bindings: pwm: mxs: Allow passing #pwm-cells = <2> Fabio Estevam
2023-09-21 19:59   ` Uwe Kleine-König
2023-09-22 21:17     ` Rob Herring
2023-09-21 19:59 ` [PATCH 1/3] dt-bindings: pwm: mxs: Document fsl,imx28-pwm Uwe Kleine-König

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