diff mbox series

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

Message ID 20230921184348.290261-3-festevam@gmail.com
State Not Applicable
Headers show
Series [1/3] dt-bindings: pwm: mxs: Document fsl,imx28-pwm | expand

Checks

Context Check Description
robh/checkpatch success
robh/patch-applied success
robh/dtbs-check warning build log
robh/dt-meta-schema success

Commit Message

Fabio Estevam Sept. 21, 2023, 6:43 p.m. UTC
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(-)

Comments

Uwe Kleine-König Sept. 21, 2023, 7:59 p.m. UTC | #1
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
Rob Herring (Arm) Sept. 22, 2023, 9:17 p.m. UTC | #2
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>
diff mbox series

Patch

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