diff mbox series

[06/15] dt-bindings: pwm: rockchip: include generic pwm schema

Message ID 20220214081605.161394-6-krzysztof.kozlowski@canonical.com (mailing list archive)
State New, archived
Headers show
Series [01/15] dt-bindings: pwm: allwinner, sun4i-a10: include generic pwm schema | expand

Commit Message

Krzysztof Kozlowski Feb. 14, 2022, 8:15 a.m. UTC
Include generic pwm.yaml schema, which enforces PWM node naming and
brings pwm-cells requirement.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
---
 .../devicetree/bindings/pwm/pwm-rockchip.yaml | 74 ++++++++++---------
 1 file changed, 38 insertions(+), 36 deletions(-)

Comments

Heiko Stuebner Feb. 14, 2022, 10:58 a.m. UTC | #1
Am Montag, 14. Februar 2022, 09:15:56 CET schrieb Krzysztof Kozlowski:
> Include generic pwm.yaml schema, which enforces PWM node naming and
> brings pwm-cells requirement.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>

Reviewed-by: Heiko Stuebner <heiko@sntech.de>

> ---
>  .../devicetree/bindings/pwm/pwm-rockchip.yaml | 74 ++++++++++---------
>  1 file changed, 38 insertions(+), 36 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/pwm/pwm-rockchip.yaml b/Documentation/devicetree/bindings/pwm/pwm-rockchip.yaml
> index 81a54a4e8e3e..a336ff9364a9 100644
> --- a/Documentation/devicetree/bindings/pwm/pwm-rockchip.yaml
> +++ b/Documentation/devicetree/bindings/pwm/pwm-rockchip.yaml
> @@ -51,42 +51,44 @@ properties:
>  required:
>    - compatible
>    - reg
> -  - "#pwm-cells"
> -
> -if:
> -  properties:
> -    compatible:
> -      contains:
> -        enum:
> -          - rockchip,rk3328-pwm
> -          - rockchip,rv1108-pwm
> -
> -then:
> -  properties:
> -    clocks:
> -      items:
> -        - description: Used to derive the functional clock for the device.
> -        - description: Used as the APB bus clock.
> -
> -    clock-names:
> -      items:
> -        - const: pwm
> -        - const: pclk
> -
> -  required:
> -    - clocks
> -    - clock-names
> -
> -else:
> -  properties:
> -    clocks:
> -      maxItems: 1
> -      description:
> -        Used both to derive the functional clock
> -        for the device and as the bus clock.
> -
> -  required:
> -    - clocks
> +
> +allOf:
> +  - $ref: pwm.yaml#
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - rockchip,rk3328-pwm
> +              - rockchip,rv1108-pwm
> +
> +    then:
> +      properties:
> +        clocks:
> +          items:
> +            - description: Used to derive the functional clock for the device.
> +            - description: Used as the APB bus clock.
> +
> +        clock-names:
> +          items:
> +            - const: pwm
> +            - const: pclk
> +
> +      required:
> +        - clocks
> +        - clock-names
> +
> +    else:
> +      properties:
> +        clocks:
> +          maxItems: 1
> +          description:
> +            Used both to derive the functional clock
> +            for the device and as the bus clock.
> +
> +      required:
> +        - clocks
>  
>  additionalProperties: false
>  
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/pwm/pwm-rockchip.yaml b/Documentation/devicetree/bindings/pwm/pwm-rockchip.yaml
index 81a54a4e8e3e..a336ff9364a9 100644
--- a/Documentation/devicetree/bindings/pwm/pwm-rockchip.yaml
+++ b/Documentation/devicetree/bindings/pwm/pwm-rockchip.yaml
@@ -51,42 +51,44 @@  properties:
 required:
   - compatible
   - reg
-  - "#pwm-cells"
-
-if:
-  properties:
-    compatible:
-      contains:
-        enum:
-          - rockchip,rk3328-pwm
-          - rockchip,rv1108-pwm
-
-then:
-  properties:
-    clocks:
-      items:
-        - description: Used to derive the functional clock for the device.
-        - description: Used as the APB bus clock.
-
-    clock-names:
-      items:
-        - const: pwm
-        - const: pclk
-
-  required:
-    - clocks
-    - clock-names
-
-else:
-  properties:
-    clocks:
-      maxItems: 1
-      description:
-        Used both to derive the functional clock
-        for the device and as the bus clock.
-
-  required:
-    - clocks
+
+allOf:
+  - $ref: pwm.yaml#
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - rockchip,rk3328-pwm
+              - rockchip,rv1108-pwm
+
+    then:
+      properties:
+        clocks:
+          items:
+            - description: Used to derive the functional clock for the device.
+            - description: Used as the APB bus clock.
+
+        clock-names:
+          items:
+            - const: pwm
+            - const: pclk
+
+      required:
+        - clocks
+        - clock-names
+
+    else:
+      properties:
+        clocks:
+          maxItems: 1
+          description:
+            Used both to derive the functional clock
+            for the device and as the bus clock.
+
+      required:
+        - clocks
 
 additionalProperties: false