diff mbox series

[v2,1/5] dt-bindings: mailbox: Add binding for SDX55 APCS

Message ID 20210108113233.75418-2-manivannan.sadhasivam@linaro.org (mailing list archive)
State Not Applicable, archived
Headers show
Series Add APCS support for SDX55 | expand

Commit Message

Manivannan Sadhasivam Jan. 8, 2021, 11:32 a.m. UTC
Add devicetree YAML binding for SDX55 APCS GCC block. The APCS block
acts as the mailbox controller and also provides a clock output and
takes 3 clock sources (pll, aux, ref) as input.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 .../mailbox/qcom,apcs-kpss-global.yaml        | 59 ++++++++++++++++---
 1 file changed, 50 insertions(+), 9 deletions(-)

Comments

Rob Herring (Arm) Jan. 13, 2021, 3:27 a.m. UTC | #1
On Fri, Jan 08, 2021 at 05:02:29PM +0530, Manivannan Sadhasivam wrote:
> Add devicetree YAML binding for SDX55 APCS GCC block. The APCS block
> acts as the mailbox controller and also provides a clock output and
> takes 3 clock sources (pll, aux, ref) as input.
> 
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
>  .../mailbox/qcom,apcs-kpss-global.yaml        | 59 ++++++++++++++++---
>  1 file changed, 50 insertions(+), 9 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
> index ffd09b664ff5..3c75ea0b6040 100644
> --- a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
> +++ b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
> @@ -27,26 +27,24 @@ properties:
>        - qcom,sdm660-apcs-hmss-global
>        - qcom,sdm845-apss-shared
>        - qcom,sm8150-apss-shared
> +      - qcom,sdx55-apcs-gcc
>  
>    reg:
>      maxItems: 1
>  
> -  clocks:
> -    description: phandles to the parent clocks of the clock driver
> -    items:
> -      - description: primary pll parent of the clock driver
> -      - description: auxiliary parent

Keep this here and add the 3rd item and:

minItems: 2

Then the if/then can just restrict things to 2 or 3 items.

> -
>    '#mbox-cells':
>      const: 1
>  
>    '#clock-cells':
>      const: 0
>  
> +  clocks:
> +    minItems: 2
> +    maxItems: 3
> +
>    clock-names:
> -    items:
> -      - const: pll
> -      - const: aux
> +    minItems: 2
> +    maxItems: 3
>  
>  required:
>    - compatible
> @@ -55,6 +53,49 @@ required:
>  
>  additionalProperties: false
>  
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          enum:
> +            - qcom,ipq6018-apcs-apps-global
> +            - qcom,ipq8074-apcs-apps-global
> +            - qcom,msm8916-apcs-kpss-global
> +            - qcom,msm8994-apcs-kpss-global
> +            - qcom,msm8996-apcs-hmss-global
> +            - qcom,msm8998-apcs-hmss-global
> +            - qcom,qcs404-apcs-apps-global
> +            - qcom,sc7180-apss-shared
> +            - qcom,sdm660-apcs-hmss-global
> +            - qcom,sdm845-apss-shared
> +            - qcom,sm8150-apss-shared
> +    then:
> +      properties:
> +        clocks:
> +          items:
> +            - description: Primary PLL parent of the clock driver
> +            - description: Auxiliary parent
> +        clock-names:
> +          items:
> +            - const: pll
> +            - const: aux
> +  - if:
> +      properties:
> +        compatible:
> +          enum:
> +            - qcom,sdx55-apcs-gcc
> +    then:
> +      properties:
> +        clocks:
> +          items:
> +            - description: Primary PLL parent of the clock driver
> +            - description: Auxiliary parent
> +            - description: Reference clock
> +        clock-names:
> +          items:
> +            - const: pll
> +            - const: aux
> +            - const: ref
>  examples:
>  
>    # Example apcs with msm8996
> -- 
> 2.25.1
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
index ffd09b664ff5..3c75ea0b6040 100644
--- a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
+++ b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
@@ -27,26 +27,24 @@  properties:
       - qcom,sdm660-apcs-hmss-global
       - qcom,sdm845-apss-shared
       - qcom,sm8150-apss-shared
+      - qcom,sdx55-apcs-gcc
 
   reg:
     maxItems: 1
 
-  clocks:
-    description: phandles to the parent clocks of the clock driver
-    items:
-      - description: primary pll parent of the clock driver
-      - description: auxiliary parent
-
   '#mbox-cells':
     const: 1
 
   '#clock-cells':
     const: 0
 
+  clocks:
+    minItems: 2
+    maxItems: 3
+
   clock-names:
-    items:
-      - const: pll
-      - const: aux
+    minItems: 2
+    maxItems: 3
 
 required:
   - compatible
@@ -55,6 +53,49 @@  required:
 
 additionalProperties: false
 
+allOf:
+  - if:
+      properties:
+        compatible:
+          enum:
+            - qcom,ipq6018-apcs-apps-global
+            - qcom,ipq8074-apcs-apps-global
+            - qcom,msm8916-apcs-kpss-global
+            - qcom,msm8994-apcs-kpss-global
+            - qcom,msm8996-apcs-hmss-global
+            - qcom,msm8998-apcs-hmss-global
+            - qcom,qcs404-apcs-apps-global
+            - qcom,sc7180-apss-shared
+            - qcom,sdm660-apcs-hmss-global
+            - qcom,sdm845-apss-shared
+            - qcom,sm8150-apss-shared
+    then:
+      properties:
+        clocks:
+          items:
+            - description: Primary PLL parent of the clock driver
+            - description: Auxiliary parent
+        clock-names:
+          items:
+            - const: pll
+            - const: aux
+  - if:
+      properties:
+        compatible:
+          enum:
+            - qcom,sdx55-apcs-gcc
+    then:
+      properties:
+        clocks:
+          items:
+            - description: Primary PLL parent of the clock driver
+            - description: Auxiliary parent
+            - description: Reference clock
+        clock-names:
+          items:
+            - const: pll
+            - const: aux
+            - const: ref
 examples:
 
   # Example apcs with msm8996