diff mbox series

[1/3] dt-bindings: pwm: imx: Add compatible string imx8qxp-mipi-pwm

Message ID 20240711-pwm-v1-1-4d5766f99b8b@nxp.com
State Superseded
Headers show
Series pwm: imx: add 32k clock for 8qm/qxp and workaround a chip issue | expand

Commit Message

Frank Li July 11, 2024, 9:08 p.m. UTC
The pwm in imx8qxp mipi subsystem require one extra '32k' clock. So add
compatible string 'imx8qxp-mipi-pwm'. Increase maxItems for clock and
clock-names. Add allOf check to make sure other compatible string keep the
same restriction.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
 Documentation/devicetree/bindings/pwm/imx-pwm.yaml | 29 +++++++++++++++++++---
 1 file changed, 26 insertions(+), 3 deletions(-)

Comments

Rob Herring July 12, 2024, 2:09 p.m. UTC | #1
On Thu, Jul 11, 2024 at 05:08:56PM -0400, Frank Li wrote:
> The pwm in imx8qxp mipi subsystem require one extra '32k' clock. So add
> compatible string 'imx8qxp-mipi-pwm'. Increase maxItems for clock and
> clock-names. Add allOf check to make sure other compatible string keep the
> same restriction.
> 
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
>  Documentation/devicetree/bindings/pwm/imx-pwm.yaml | 29 +++++++++++++++++++---
>  1 file changed, 26 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/pwm/imx-pwm.yaml b/Documentation/devicetree/bindings/pwm/imx-pwm.yaml
> index 04148198e34d0..750636985f937 100644
> --- a/Documentation/devicetree/bindings/pwm/imx-pwm.yaml
> +++ b/Documentation/devicetree/bindings/pwm/imx-pwm.yaml
> @@ -9,9 +9,6 @@ title: Freescale i.MX PWM controller
>  maintainers:
>    - Philipp Zabel <p.zabel@pengutronix.de>
>  
> -allOf:
> -  - $ref: pwm.yaml#
> -
>  properties:
>    "#pwm-cells":
>      description:
> @@ -42,6 +39,7 @@ properties:
>                - fsl,imx8mp-pwm
>                - fsl,imx8mq-pwm
>                - fsl,imx8qxp-pwm
> +              - fsl,imx8qxp-mipi-pwm

I'm not sure I'd do a new compatible for this. Is the instance really 
different? It's fine if some instances have an optional clock.

Rob
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/pwm/imx-pwm.yaml b/Documentation/devicetree/bindings/pwm/imx-pwm.yaml
index 04148198e34d0..750636985f937 100644
--- a/Documentation/devicetree/bindings/pwm/imx-pwm.yaml
+++ b/Documentation/devicetree/bindings/pwm/imx-pwm.yaml
@@ -9,9 +9,6 @@  title: Freescale i.MX PWM controller
 maintainers:
   - Philipp Zabel <p.zabel@pengutronix.de>
 
-allOf:
-  - $ref: pwm.yaml#
-
 properties:
   "#pwm-cells":
     description:
@@ -42,6 +39,7 @@  properties:
               - fsl,imx8mp-pwm
               - fsl,imx8mq-pwm
               - fsl,imx8qxp-pwm
+              - fsl,imx8qxp-mipi-pwm
           - const: fsl,imx27-pwm
 
   reg:
@@ -51,11 +49,15 @@  properties:
     items:
       - description: SoC PWM ipg clock
       - description: SoC PWM per clock
+      - description: 32k clock
+    minItems: 2
 
   clock-names:
     items:
       - const: ipg
       - const: per
+      - const: 32k
+    minItems: 2
 
   interrupts:
     maxItems: 1
@@ -69,6 +71,27 @@  required:
   - clocks
   - clock-names
 
+allOf:
+  - $ref: pwm.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - fsl,imx8qxp-mipi-pwm
+    then:
+      properties:
+        clock:
+          minItems: 3
+        clock-names:
+          minItems: 3
+    else:
+      properties:
+        clock:
+          maxItems: 2
+        clock-name:
+          maxItems: 2
+
 additionalProperties: false
 
 examples: