diff mbox series

[v2,01/16] dt-bindings: clock: qcom,sm8450-videocc: reference qcom,gcc.yaml

Message ID 20240605-dt-bindings-qcom-gcc-v2-1-f947b24f1283@linaro.org (mailing list archive)
State Accepted
Commit acc41014661cf424c262e8d532e461376bacbd90
Headers show
Series dt-bindings: clock: qcom: reference qcom-gcc.yaml | expand

Commit Message

Krzysztof Kozlowski June 5, 2024, 8:09 a.m. UTC
Just like most of Qualcomm clock controllers, we can reference common
qcom,gcc.yaml schema to unify the common parts of the binding.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 .../bindings/clock/qcom,sm8450-videocc.yaml          | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)

Comments

Stephen Boyd June 5, 2024, 3:07 p.m. UTC | #1
Quoting Krzysztof Kozlowski (2024-06-05 01:09:28)
> diff --git a/Documentation/devicetree/bindings/clock/qcom,sm8450-videocc.yaml b/Documentation/devicetree/bindings/clock/qcom,sm8450-videocc.yaml
> index bad8f019a8d3..74034e3f79b7 100644
> --- a/Documentation/devicetree/bindings/clock/qcom,sm8450-videocc.yaml
> +++ b/Documentation/devicetree/bindings/clock/qcom,sm8450-videocc.yaml
> @@ -39,26 +36,17 @@ properties:
>      description:
>        A phandle to an OPP node describing required MMCX performance point.
>  
> -  '#clock-cells':
> -    const: 1
> -
> -  '#reset-cells':
> -    const: 1
> -
> -  '#power-domain-cells':
> -    const: 1
> -
>  required:
>    - compatible
> -  - reg
>    - clocks
>    - power-domains
>    - required-opps
> -  - '#clock-cells'
> -  - '#reset-cells'
>    - '#power-domain-cells'

Missed removing this one?

>  
> -additionalProperties: false
> +allOf:
> +  - $ref: qcom,gcc.yaml#

Why not have a one-cell-clock-reset-power-domain.yaml binding that
combines all these things? It's quite common even outside of qcom.
Krzysztof Kozlowski June 5, 2024, 3:43 p.m. UTC | #2
On 05/06/2024 17:07, Stephen Boyd wrote:
> Quoting Krzysztof Kozlowski (2024-06-05 01:09:28)
>> diff --git a/Documentation/devicetree/bindings/clock/qcom,sm8450-videocc.yaml b/Documentation/devicetree/bindings/clock/qcom,sm8450-videocc.yaml
>> index bad8f019a8d3..74034e3f79b7 100644
>> --- a/Documentation/devicetree/bindings/clock/qcom,sm8450-videocc.yaml
>> +++ b/Documentation/devicetree/bindings/clock/qcom,sm8450-videocc.yaml
>> @@ -39,26 +36,17 @@ properties:
>>      description:
>>        A phandle to an OPP node describing required MMCX performance point.
>>  
>> -  '#clock-cells':
>> -    const: 1
>> -
>> -  '#reset-cells':
>> -    const: 1
>> -
>> -  '#power-domain-cells':
>> -    const: 1
>> -
>>  required:
>>    - compatible
>> -  - reg
>>    - clocks
>>    - power-domains
>>    - required-opps
>> -  - '#clock-cells'
>> -  - '#reset-cells'
>>    - '#power-domain-cells'
> 
> Missed removing this one?

No, as explained in cover letter this aligns code with Dmitry's
approach. power-domain-cells must stay.

> 
>>  
>> -additionalProperties: false
>> +allOf:
>> +  - $ref: qcom,gcc.yaml#
> 
> Why not have a one-cell-clock-reset-power-domain.yaml binding that
> combines all these things? It's quite common even outside of qcom.

We also have required-opps and power-domains... I am afraid that after
such simplification someone will come with some differences and not much
of code will be saved.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/clock/qcom,sm8450-videocc.yaml b/Documentation/devicetree/bindings/clock/qcom,sm8450-videocc.yaml
index bad8f019a8d3..74034e3f79b7 100644
--- a/Documentation/devicetree/bindings/clock/qcom,sm8450-videocc.yaml
+++ b/Documentation/devicetree/bindings/clock/qcom,sm8450-videocc.yaml
@@ -21,9 +21,6 @@  properties:
       - qcom,sm8450-videocc
       - qcom,sm8550-videocc
 
-  reg:
-    maxItems: 1
-
   clocks:
     items:
       - description: Board XO source
@@ -39,26 +36,17 @@  properties:
     description:
       A phandle to an OPP node describing required MMCX performance point.
 
-  '#clock-cells':
-    const: 1
-
-  '#reset-cells':
-    const: 1
-
-  '#power-domain-cells':
-    const: 1
-
 required:
   - compatible
-  - reg
   - clocks
   - power-domains
   - required-opps
-  - '#clock-cells'
-  - '#reset-cells'
   - '#power-domain-cells'
 
-additionalProperties: false
+allOf:
+  - $ref: qcom,gcc.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |