diff mbox series

[v4,2/3] dt-bindings: phy: rockchip,inno-usb2phy: add rk3576

Message ID 20240929061025.3704-2-frawang.cn@gmail.com
State Superseded
Headers show
Series [v4,1/3] phy: rockchip: inno-usb2: convert clock management to bulk | expand

Commit Message

Frank Wang Sept. 29, 2024, 6:10 a.m. UTC
From: Frank Wang <frank.wang@rock-chips.com>

Add compatible for the USB2 phy in the Rockchip RK3576 SoC.

This change also refactor the clocks list as there are new clocks
adding used for the USB MMU in RK3576 SoC.

Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
---
Changelog:
v4:
 - refactor the clocks list used if:then:

v3:
 - narrowed rk3576 clocks by compatible property.

v2:
 - Categorize clock names by oneOf keyword.

v1:
 - https://patchwork.kernel.org/project/linux-phy/patch/20240923025326.10467-1-frank.wang@rock-chips.com/

 .../bindings/phy/rockchip,inno-usb2phy.yaml   | 46 ++++++++++++++++++-
 1 file changed, 44 insertions(+), 2 deletions(-)

Comments

Krzysztof Kozlowski Sept. 29, 2024, 7:36 p.m. UTC | #1
On Sun, Sep 29, 2024 at 02:10:24PM +0800, Frank Wang wrote:
> From: Frank Wang <frank.wang@rock-chips.com>
> 
> Add compatible for the USB2 phy in the Rockchip RK3576 SoC.
> 
> This change also refactor the clocks list as there are new clocks
> adding used for the USB MMU in RK3576 SoC.
> 
> Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
> ---
> Changelog:
> v4:
>  - refactor the clocks list used if:then:
> 
> v3:
>  - narrowed rk3576 clocks by compatible property.
> 
> v2:
>  - Categorize clock names by oneOf keyword.
> 
> v1:
>  - https://patchwork.kernel.org/project/linux-phy/patch/20240923025326.10467-1-frank.wang@rock-chips.com/
> 
>  .../bindings/phy/rockchip,inno-usb2phy.yaml   | 46 ++++++++++++++++++-
>  1 file changed, 44 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/phy/rockchip,inno-usb2phy.yaml b/Documentation/devicetree/bindings/phy/rockchip,inno-usb2phy.yaml
> index 5254413137c6..fc2c03d01a20 100644
> --- a/Documentation/devicetree/bindings/phy/rockchip,inno-usb2phy.yaml
> +++ b/Documentation/devicetree/bindings/phy/rockchip,inno-usb2phy.yaml
> @@ -20,6 +20,7 @@ properties:
>        - rockchip,rk3366-usb2phy
>        - rockchip,rk3399-usb2phy
>        - rockchip,rk3568-usb2phy
> +      - rockchip,rk3576-usb2phy
>        - rockchip,rk3588-usb2phy
>        - rockchip,rv1108-usb2phy
>  
> @@ -34,10 +35,12 @@ properties:
>      const: 0
>  
>    clocks:
> -    maxItems: 1
> +    minItems: 1
> +    maxItems: 3
>  
>    clock-names:
> -    const: phyclk
> +    minItems: 1
> +    maxItems: 3
>  
>    assigned-clocks:
>      description:
> @@ -172,6 +175,45 @@ allOf:
>              - interrupts
>              - interrupt-names
>  
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - rockchip,px30-usb2phy
> +              - rockchip,rk3128-usb2phy
> +              - rockchip,rk3228-usb2phy
> +              - rockchip,rk3308-usb2phy
> +              - rockchip,rk3328-usb2phy
> +              - rockchip,rk3366-usb2phy
> +              - rockchip,rk3399-usb2phy
> +              - rockchip,rk3568-usb2phy
> +              - rockchip,rk3588-usb2phy
> +              - rockchip,rv1108-usb2phy
> +    then:
> +      properties:
> +        clocks:
> +          maxItems: 1
> +        clock-names:
> +          const: phyclk

maxItems: 1 instead

> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - rockchip,rk3576-usb2phy
> +    then:
> +      properties:
> +        clocks:
> +          minItems: 3
> +          maxItems: 3
> +        clock-names:
> +          items:
> +            - const: phyclk
> +            - const: aclk
> +            - const: aclk_slv

This list goes to the top property with minItems: 1. Here you have only
minItems: 3.

This way you have only one definition of entire list with same order of
items between variants.

Best regards,
Krzysztof
Frank Wang Oct. 8, 2024, 3:04 a.m. UTC | #2
Hi Krzysztof,

On 2024/9/30 3:36, Krzysztof Kozlowski wrote:
> On Sun, Sep 29, 2024 at 02:10:24PM +0800, Frank Wang wrote:
>> From: Frank Wang <frank.wang@rock-chips.com>
>>
>> Add compatible for the USB2 phy in the Rockchip RK3576 SoC.
>>
>> This change also refactor the clocks list as there are new clocks
>> adding used for the USB MMU in RK3576 SoC.
>>
>> Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
>> ---
>> Changelog:
>> v4:
>>   - refactor the clocks list used if:then:
>>
>> v3:
>>   - narrowed rk3576 clocks by compatible property.
>>
>> v2:
>>   - Categorize clock names by oneOf keyword.
>>
>> v1:
>>   - https://patchwork.kernel.org/project/linux-phy/patch/20240923025326.10467-1-frank.wang@rock-chips.com/
>>
>>   .../bindings/phy/rockchip,inno-usb2phy.yaml   | 46 ++++++++++++++++++-
>>   1 file changed, 44 insertions(+), 2 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/phy/rockchip,inno-usb2phy.yaml b/Documentation/devicetree/bindings/phy/rockchip,inno-usb2phy.yaml
>> index 5254413137c6..fc2c03d01a20 100644
>> --- a/Documentation/devicetree/bindings/phy/rockchip,inno-usb2phy.yaml
>> +++ b/Documentation/devicetree/bindings/phy/rockchip,inno-usb2phy.yaml
>> @@ -20,6 +20,7 @@ properties:
>>         - rockchip,rk3366-usb2phy
>>         - rockchip,rk3399-usb2phy
>>         - rockchip,rk3568-usb2phy
>> +      - rockchip,rk3576-usb2phy
>>         - rockchip,rk3588-usb2phy
>>         - rockchip,rv1108-usb2phy
>>   
>> @@ -34,10 +35,12 @@ properties:
>>       const: 0
>>   
>>     clocks:
>> -    maxItems: 1
>> +    minItems: 1
>> +    maxItems: 3
>>   
>>     clock-names:
>> -    const: phyclk
>> +    minItems: 1
>> +    maxItems: 3
>>   
>>     assigned-clocks:
>>       description:
>> @@ -172,6 +175,45 @@ allOf:
>>               - interrupts
>>               - interrupt-names
>>   
>> +  - if:
>> +      properties:
>> +        compatible:
>> +          contains:
>> +            enum:
>> +              - rockchip,px30-usb2phy
>> +              - rockchip,rk3128-usb2phy
>> +              - rockchip,rk3228-usb2phy
>> +              - rockchip,rk3308-usb2phy
>> +              - rockchip,rk3328-usb2phy
>> +              - rockchip,rk3366-usb2phy
>> +              - rockchip,rk3399-usb2phy
>> +              - rockchip,rk3568-usb2phy
>> +              - rockchip,rk3588-usb2phy
>> +              - rockchip,rv1108-usb2phy
>> +    then:
>> +      properties:
>> +        clocks:
>> +          maxItems: 1
>> +        clock-names:
>> +          const: phyclk
> maxItems: 1 instead

Sorry for late reply.

Do you mean use "maxItems: 1" instead of "const: phyclk" ?


>> +
>> +  - if:
>> +      properties:
>> +        compatible:
>> +          contains:
>> +            enum:
>> +              - rockchip,rk3576-usb2phy
>> +    then:
>> +      properties:
>> +        clocks:
>> +          minItems: 3
>> +          maxItems: 3
>> +        clock-names:
>> +          items:
>> +            - const: phyclk
>> +            - const: aclk
>> +            - const: aclk_slv
> This list goes to the top property with minItems: 1. Here you have only
> minItems: 3.
>
> This way you have only one definition of entire list with same order of
> items between variants.

For rockchip,rk3576-usb2phy, three clocks are all required, and the 
driver does not care about the order of the clocks.

So is the above definition correct?


Best regards,
Frank

> Best regards,
> Krzysztof
>
Krzysztof Kozlowski Oct. 8, 2024, 2:36 p.m. UTC | #3
On 08/10/2024 05:04, Frank Wang wrote:
> Hi Krzysztof,
> 
> On 2024/9/30 3:36, Krzysztof Kozlowski wrote:
>> On Sun, Sep 29, 2024 at 02:10:24PM +0800, Frank Wang wrote:
>>> From: Frank Wang <frank.wang@rock-chips.com>
>>>
>>> Add compatible for the USB2 phy in the Rockchip RK3576 SoC.
>>>
>>> This change also refactor the clocks list as there are new clocks
>>> adding used for the USB MMU in RK3576 SoC.
>>>
>>> Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
>>> ---
>>> Changelog:
>>> v4:
>>>   - refactor the clocks list used if:then:
>>>
>>> v3:
>>>   - narrowed rk3576 clocks by compatible property.
>>>
>>> v2:
>>>   - Categorize clock names by oneOf keyword.
>>>
>>> v1:
>>>   - https://patchwork.kernel.org/project/linux-phy/patch/20240923025326.10467-1-frank.wang@rock-chips.com/
>>>
>>>   .../bindings/phy/rockchip,inno-usb2phy.yaml   | 46 ++++++++++++++++++-
>>>   1 file changed, 44 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/phy/rockchip,inno-usb2phy.yaml b/Documentation/devicetree/bindings/phy/rockchip,inno-usb2phy.yaml
>>> index 5254413137c6..fc2c03d01a20 100644
>>> --- a/Documentation/devicetree/bindings/phy/rockchip,inno-usb2phy.yaml
>>> +++ b/Documentation/devicetree/bindings/phy/rockchip,inno-usb2phy.yaml
>>> @@ -20,6 +20,7 @@ properties:
>>>         - rockchip,rk3366-usb2phy
>>>         - rockchip,rk3399-usb2phy
>>>         - rockchip,rk3568-usb2phy
>>> +      - rockchip,rk3576-usb2phy
>>>         - rockchip,rk3588-usb2phy
>>>         - rockchip,rv1108-usb2phy
>>>   
>>> @@ -34,10 +35,12 @@ properties:
>>>       const: 0
>>>   
>>>     clocks:
>>> -    maxItems: 1
>>> +    minItems: 1
>>> +    maxItems: 3
>>>   
>>>     clock-names:
>>> -    const: phyclk
>>> +    minItems: 1
>>> +    maxItems: 3
>>>   
>>>     assigned-clocks:
>>>       description:
>>> @@ -172,6 +175,45 @@ allOf:
>>>               - interrupts
>>>               - interrupt-names
>>>   
>>> +  - if:
>>> +      properties:
>>> +        compatible:
>>> +          contains:
>>> +            enum:
>>> +              - rockchip,px30-usb2phy
>>> +              - rockchip,rk3128-usb2phy
>>> +              - rockchip,rk3228-usb2phy
>>> +              - rockchip,rk3308-usb2phy
>>> +              - rockchip,rk3328-usb2phy
>>> +              - rockchip,rk3366-usb2phy
>>> +              - rockchip,rk3399-usb2phy
>>> +              - rockchip,rk3568-usb2phy
>>> +              - rockchip,rk3588-usb2phy
>>> +              - rockchip,rv1108-usb2phy
>>> +    then:
>>> +      properties:
>>> +        clocks:
>>> +          maxItems: 1
>>> +        clock-names:
>>> +          const: phyclk
>> maxItems: 1 instead
> 
> Sorry for late reply.
> 
> Do you mean use "maxItems: 1" instead of "const: phyclk" ?
> 
> 
>>> +
>>> +  - if:
>>> +      properties:
>>> +        compatible:
>>> +          contains:
>>> +            enum:
>>> +              - rockchip,rk3576-usb2phy
>>> +    then:
>>> +      properties:
>>> +        clocks:
>>> +          minItems: 3
>>> +          maxItems: 3
>>> +        clock-names:
>>> +          items:
>>> +            - const: phyclk
>>> +            - const: aclk
>>> +            - const: aclk_slv
>> This list goes to the top property with minItems: 1. Here you have only
>> minItems: 3.
>>
>> This way you have only one definition of entire list with same order of
>> items between variants.
> 
> For rockchip,rk3576-usb2phy, three clocks are all required, and the 
> driver does not care about the order of the clocks.
> 
> So is the above definition correct?

Of course not. What I wrote is correct.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/phy/rockchip,inno-usb2phy.yaml b/Documentation/devicetree/bindings/phy/rockchip,inno-usb2phy.yaml
index 5254413137c6..fc2c03d01a20 100644
--- a/Documentation/devicetree/bindings/phy/rockchip,inno-usb2phy.yaml
+++ b/Documentation/devicetree/bindings/phy/rockchip,inno-usb2phy.yaml
@@ -20,6 +20,7 @@  properties:
       - rockchip,rk3366-usb2phy
       - rockchip,rk3399-usb2phy
       - rockchip,rk3568-usb2phy
+      - rockchip,rk3576-usb2phy
       - rockchip,rk3588-usb2phy
       - rockchip,rv1108-usb2phy
 
@@ -34,10 +35,12 @@  properties:
     const: 0
 
   clocks:
-    maxItems: 1
+    minItems: 1
+    maxItems: 3
 
   clock-names:
-    const: phyclk
+    minItems: 1
+    maxItems: 3
 
   assigned-clocks:
     description:
@@ -172,6 +175,45 @@  allOf:
             - interrupts
             - interrupt-names
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - rockchip,px30-usb2phy
+              - rockchip,rk3128-usb2phy
+              - rockchip,rk3228-usb2phy
+              - rockchip,rk3308-usb2phy
+              - rockchip,rk3328-usb2phy
+              - rockchip,rk3366-usb2phy
+              - rockchip,rk3399-usb2phy
+              - rockchip,rk3568-usb2phy
+              - rockchip,rk3588-usb2phy
+              - rockchip,rv1108-usb2phy
+    then:
+      properties:
+        clocks:
+          maxItems: 1
+        clock-names:
+          const: phyclk
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - rockchip,rk3576-usb2phy
+    then:
+      properties:
+        clocks:
+          minItems: 3
+          maxItems: 3
+        clock-names:
+          items:
+            - const: phyclk
+            - const: aclk
+            - const: aclk_slv
+
 additionalProperties: false
 
 examples: