[1/5] dt-bindings: clock: qcom,gpucc: Fix SM6350 clock names

Message ID 20230315-topic-lagoon_gpu-v1-1-a74cbec4ecfc@linaro.org
State New
Headers
Series SM6350 GPU |

Commit Message

Konrad Dybcio March 16, 2023, 11:16 a.m. UTC
  SM6350 GPUCC uses the same clock names as the rest of the gang, except
without a _src suffix. Account for that.

Fixes: 7b91b9d8cc6c ("dt-bindings: clock: add SM6350 QCOM Graphics clock bindings")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 .../devicetree/bindings/clock/qcom,gpucc.yaml      | 29 +++++++++++++++++++---
 1 file changed, 25 insertions(+), 4 deletions(-)
  

Comments

Krzysztof Kozlowski March 17, 2023, 8:37 a.m. UTC | #1
On 16/03/2023 12:16, Konrad Dybcio wrote:
> SM6350 GPUCC uses the same clock names as the rest of the gang, except
> without a _src suffix. Account for that.

Why not fixing the names instead (to use the same)? If the clocks are
the same, why using different names for the inputs? To remind - these
are not names of clocks in GCC, but names of clock inputs to the device.

> 
> Fixes: 7b91b9d8cc6c ("dt-bindings: clock: add SM6350 QCOM Graphics clock bindings")
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
>  .../devicetree/bindings/clock/qcom,gpucc.yaml      | 29 +++++++++++++++++++---
>  1 file changed, 25 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/clock/qcom,gpucc.yaml b/Documentation/devicetree/bindings/clock/qcom,gpucc.yaml
> index db53eb288995..d209060a619d 100644
> --- a/Documentation/devicetree/bindings/clock/qcom,gpucc.yaml
> +++ b/Documentation/devicetree/bindings/clock/qcom,gpucc.yaml
> @@ -43,10 +43,8 @@ properties:
>        - description: GPLL0 div branch source
>  
>    clock-names:
> -    items:
> -      - const: bi_tcxo
> -      - const: gcc_gpu_gpll0_clk_src
> -      - const: gcc_gpu_gpll0_div_clk_src
> +    minItems: 3

Drop minItems, not needed as it is implied by maxItems.

> +    maxItems: 3
>  
>    '#clock-cells':
>      const: 1
> @@ -71,6 +69,29 @@ required:
>  
>  additionalProperties: false
>
> 

Best regards,
Krzysztof
  
Konrad Dybcio March 17, 2023, 12:11 p.m. UTC | #2
On 17.03.2023 09:37, Krzysztof Kozlowski wrote:
> On 16/03/2023 12:16, Konrad Dybcio wrote:
>> SM6350 GPUCC uses the same clock names as the rest of the gang, except
>> without a _src suffix. Account for that.
> 
> Why not fixing the names instead (to use the same)? If the clocks are
> the same, why using different names for the inputs? To remind - these
> are not names of clocks in GCC, but names of clock inputs to the device.
Considering SM6350 is the only used of SM6350_GPUCC and it's not yet
in next and I don't think any other project using devicetree has
Adreno up on any platform, let alone this one, I suppose the ABI could
be broken and the driver could be made to expect the more common set
of names? Or I could transition it to index-based lookup?

Konrad
> 
>>
>> Fixes: 7b91b9d8cc6c ("dt-bindings: clock: add SM6350 QCOM Graphics clock bindings")
>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>> ---
>>  .../devicetree/bindings/clock/qcom,gpucc.yaml      | 29 +++++++++++++++++++---
>>  1 file changed, 25 insertions(+), 4 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/clock/qcom,gpucc.yaml b/Documentation/devicetree/bindings/clock/qcom,gpucc.yaml
>> index db53eb288995..d209060a619d 100644
>> --- a/Documentation/devicetree/bindings/clock/qcom,gpucc.yaml
>> +++ b/Documentation/devicetree/bindings/clock/qcom,gpucc.yaml
>> @@ -43,10 +43,8 @@ properties:
>>        - description: GPLL0 div branch source
>>  
>>    clock-names:
>> -    items:
>> -      - const: bi_tcxo
>> -      - const: gcc_gpu_gpll0_clk_src
>> -      - const: gcc_gpu_gpll0_div_clk_src
>> +    minItems: 3
> 
> Drop minItems, not needed as it is implied by maxItems.
> 
>> +    maxItems: 3
>>  
>>    '#clock-cells':
>>      const: 1
>> @@ -71,6 +69,29 @@ required:
>>  
>>  additionalProperties: false
>>
>>
> 
> Best regards,
> Krzysztof
>
  
Konrad Dybcio April 3, 2023, 6:05 p.m. UTC | #3
On 17.03.2023 13:11, Konrad Dybcio wrote:
> 
> 
> On 17.03.2023 09:37, Krzysztof Kozlowski wrote:
>> On 16/03/2023 12:16, Konrad Dybcio wrote:
>>> SM6350 GPUCC uses the same clock names as the rest of the gang, except
>>> without a _src suffix. Account for that.
>>
>> Why not fixing the names instead (to use the same)? If the clocks are
>> the same, why using different names for the inputs? To remind - these
>> are not names of clocks in GCC, but names of clock inputs to the device.
> Considering SM6350 is the only used of SM6350_GPUCC and it's not yet
> in next and I don't think any other project using devicetree has
> Adreno up on any platform, let alone this one, I suppose the ABI could
> be broken and the driver could be made to expect the more common set
> of names? Or I could transition it to index-based lookup?
Comments, please?

Konrad
> 
> Konrad
>>
>>>
>>> Fixes: 7b91b9d8cc6c ("dt-bindings: clock: add SM6350 QCOM Graphics clock bindings")
>>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>>> ---
>>>  .../devicetree/bindings/clock/qcom,gpucc.yaml      | 29 +++++++++++++++++++---
>>>  1 file changed, 25 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/clock/qcom,gpucc.yaml b/Documentation/devicetree/bindings/clock/qcom,gpucc.yaml
>>> index db53eb288995..d209060a619d 100644
>>> --- a/Documentation/devicetree/bindings/clock/qcom,gpucc.yaml
>>> +++ b/Documentation/devicetree/bindings/clock/qcom,gpucc.yaml
>>> @@ -43,10 +43,8 @@ properties:
>>>        - description: GPLL0 div branch source
>>>  
>>>    clock-names:
>>> -    items:
>>> -      - const: bi_tcxo
>>> -      - const: gcc_gpu_gpll0_clk_src
>>> -      - const: gcc_gpu_gpll0_div_clk_src
>>> +    minItems: 3
>>
>> Drop minItems, not needed as it is implied by maxItems.
>>
>>> +    maxItems: 3
>>>  
>>>    '#clock-cells':
>>>      const: 1
>>> @@ -71,6 +69,29 @@ required:
>>>  
>>>  additionalProperties: false
>>>
>>>
>>
>> Best regards,
>> Krzysztof
>>
  

Patch

diff --git a/Documentation/devicetree/bindings/clock/qcom,gpucc.yaml b/Documentation/devicetree/bindings/clock/qcom,gpucc.yaml
index db53eb288995..d209060a619d 100644
--- a/Documentation/devicetree/bindings/clock/qcom,gpucc.yaml
+++ b/Documentation/devicetree/bindings/clock/qcom,gpucc.yaml
@@ -43,10 +43,8 @@  properties:
       - description: GPLL0 div branch source
 
   clock-names:
-    items:
-      - const: bi_tcxo
-      - const: gcc_gpu_gpll0_clk_src
-      - const: gcc_gpu_gpll0_div_clk_src
+    minItems: 3
+    maxItems: 3
 
   '#clock-cells':
     const: 1
@@ -71,6 +69,29 @@  required:
 
 additionalProperties: false
 
+allOf:
+  - if:
+      properties:
+        compatible:
+          items:
+            - const: qcom,sm6350-gpucc
+
+    then:
+      properties:
+        clock-names:
+          items:
+            - const: bi_tcxo
+            - const: gcc_gpu_gpll0_clk
+            - const: gcc_gpu_gpll0_div_clk
+
+    else:
+      properties:
+        clock-names:
+          items:
+            - const: bi_tcxo
+            - const: gcc_gpu_gpll0_clk_src
+            - const: gcc_gpu_gpll0_div_clk_src
+
 examples:
   - |
     #include <dt-bindings/clock/qcom,gcc-sdm845.h>