diff mbox series

[v2,1/6] dt-bindings: phy: samsung,ufs-phy: make pmu-syscon as phandle-array

Message ID 20220602053250.62593-2-chanho61.park@samsung.com (mailing list archive)
State New
Headers show
Series [v2,1/6] dt-bindings: phy: samsung,ufs-phy: make pmu-syscon as phandle-array | expand

Commit Message

Chanho Park June 2, 2022, 5:32 a.m. UTC
To support secondary ufs phy devices, we need to get an offset value
from pmu-syscon.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
---
 .../devicetree/bindings/phy/samsung,ufs-phy.yaml    | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

Comments

Krzysztof Kozlowski June 2, 2022, 9:34 a.m. UTC | #1
On 02/06/2022 07:32, Chanho Park wrote:
> To support secondary ufs phy devices, we need to get an offset value
> from pmu-syscon.
> 
> Signed-off-by: Chanho Park <chanho61.park@samsung.com>
> ---
>  .../devicetree/bindings/phy/samsung,ufs-phy.yaml    | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml b/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml
> index f6ed1a005e7a..d0ba92aa578d 100644
> --- a/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml
> +++ b/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml
> @@ -40,9 +40,16 @@ properties:
>        - const: tx0_symbol_clk
>  
>    samsung,pmu-syscon:
> -    $ref: '/schemas/types.yaml#/definitions/phandle'
> -    description: phandle for PMU system controller interface, used to
> -                 control pmu registers bits for ufs m-phy
> +    $ref: '/schemas/types.yaml#/definitions/phandle-array'
> +    items:
> +      minItems: 1
> +      items:
> +        - description: phandle for PMU system controller interface, used to
> +                       control pmu registers bits for ufs m-phy
> +        - description: offset of the pmu control register

This does not work... Please test your bindings with different cases.

Best regards,
Krzysztof
Krzysztof Kozlowski June 2, 2022, 9:37 a.m. UTC | #2
On 02/06/2022 11:34, Krzysztof Kozlowski wrote:
> On 02/06/2022 07:32, Chanho Park wrote:
>> To support secondary ufs phy devices, we need to get an offset value
>> from pmu-syscon.
>>
>> Signed-off-by: Chanho Park <chanho61.park@samsung.com>
>> ---
>>  .../devicetree/bindings/phy/samsung,ufs-phy.yaml    | 13 ++++++++++---
>>  1 file changed, 10 insertions(+), 3 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml b/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml
>> index f6ed1a005e7a..d0ba92aa578d 100644
>> --- a/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml
>> +++ b/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml
>> @@ -40,9 +40,16 @@ properties:
>>        - const: tx0_symbol_clk
>>  
>>    samsung,pmu-syscon:
>> -    $ref: '/schemas/types.yaml#/definitions/phandle'
>> -    description: phandle for PMU system controller interface, used to
>> -                 control pmu registers bits for ufs m-phy
>> +    $ref: '/schemas/types.yaml#/definitions/phandle-array'
>> +    items:
>> +      minItems: 1
>> +      items:
>> +        - description: phandle for PMU system controller interface, used to
>> +                       control pmu registers bits for ufs m-phy
>> +        - description: offset of the pmu control register
> 
> This does not work... Please test your bindings with different cases.

Just to be clear - when I mentioned that minItems should be on second
items level, I meant it should affect the second items list, not the
first. Now you can have 1, 2 or 10 phandles.


Best regards,
Krzysztof
Chanho Park June 2, 2022, 10:10 a.m. UTC | #3
> >>    samsung,pmu-syscon:
> >> -    $ref: '/schemas/types.yaml#/definitions/phandle'
> >> -    description: phandle for PMU system controller interface, used to
> >> -                 control pmu registers bits for ufs m-phy
> >> +    $ref: '/schemas/types.yaml#/definitions/phandle-array'
> >> +    items:
> >> +      minItems: 1
> >> +      items:
> >> +        - description: phandle for PMU system controller interface, used
> to
> >> +                       control pmu registers bits for ufs m-phy
> >> +        - description: offset of the pmu control register
> >
> > This does not work... Please test your bindings with different cases.
> 
> Just to be clear - when I mentioned that minItems should be on second
> items level, I meant it should affect the second items list, not the first.
> Now you can have 1, 2 or 10 phandles.

I put the minItems to the second level as you mentioned but I got below error from dt_binding_check.

--- a/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml
@@ -42,8 +42,8 @@ properties:
   samsung,pmu-syscon:
     $ref: '/schemas/types.yaml#/definitions/phandle-array'
     items:
-      minItems: 1
       items:
+        - minItems: 1
         - description: phandle for PMU system controller interface, used to
                        control pmu registers bits for ufs m-phy
         - description: offset of the pmu control register

$ make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml
ufs-phy@15571800: samsung,pmu-syscon:0: [4294967295, 1828] is too short

Best Regards,
Chanho Park
Krzysztof Kozlowski June 2, 2022, 11:42 a.m. UTC | #4
On 02/06/2022 12:10, Chanho Park wrote:
>>>>    samsung,pmu-syscon:
>>>> -    $ref: '/schemas/types.yaml#/definitions/phandle'
>>>> -    description: phandle for PMU system controller interface, used to
>>>> -                 control pmu registers bits for ufs m-phy
>>>> +    $ref: '/schemas/types.yaml#/definitions/phandle-array'
>>>> +    items:
>>>> +      minItems: 1
>>>> +      items:
>>>> +        - description: phandle for PMU system controller interface, used
>> to
>>>> +                       control pmu registers bits for ufs m-phy
>>>> +        - description: offset of the pmu control register
>>>
>>> This does not work... Please test your bindings with different cases.
>>
>> Just to be clear - when I mentioned that minItems should be on second
>> items level, I meant it should affect the second items list, not the first.
>> Now you can have 1, 2 or 10 phandles.
> 
> I put the minItems to the second level as you mentioned but I got below error from dt_binding_check.
> 
> --- a/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml
> +++ b/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml
> @@ -42,8 +42,8 @@ properties:
>    samsung,pmu-syscon:
>      $ref: '/schemas/types.yaml#/definitions/phandle-array'
>      items:
> -      minItems: 1
>        items:
> +        - minItems: 1

Ah, you are right. This above is not good, but your original code was
almost good. I think it should be:

43     $ref: '/schemas/types.yaml#/definitions/phandle-array'

44     maxItems: 1

45     items:

46       minItems: 1

47       items:

48         - description: phandle for PMU sysused to

50         - description: offset of the pmu control register


Apologies for the confusion.

>          - description: phandle for PMU system controller interface, used to
>                         control pmu registers bits for ufs m-phy
>          - description: offset of the pmu control register
> 
> $ make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml
> ufs-phy@15571800: samsung,pmu-syscon:0: [4294967295, 1828] is too short


Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml b/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml
index f6ed1a005e7a..d0ba92aa578d 100644
--- a/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml
@@ -40,9 +40,16 @@  properties:
       - const: tx0_symbol_clk
 
   samsung,pmu-syscon:
-    $ref: '/schemas/types.yaml#/definitions/phandle'
-    description: phandle for PMU system controller interface, used to
-                 control pmu registers bits for ufs m-phy
+    $ref: '/schemas/types.yaml#/definitions/phandle-array'
+    items:
+      minItems: 1
+      items:
+        - description: phandle for PMU system controller interface, used to
+                       control pmu registers bits for ufs m-phy
+        - description: offset of the pmu control register
+    description:
+      It can be phandle/offset pair. The second cell which can represent an
+      offset is optional.
 
 required:
   - "#phy-cells"