diff mbox series

[PATCHv1,1/3] dt-bindings: usb: Add RK3588 OHCI

Message ID 20230404145350.45388-2-sebastian.reichel@collabora.com
State Superseded, archived
Headers show
Series generic-ohci/ehci: add RK3588 support | expand

Checks

Context Check Description
robh/checkpatch success
robh/patch-applied success
robh/dtbs-check warning build log
robh/dt-meta-schema success

Commit Message

Sebastian Reichel April 4, 2023, 2:53 p.m. UTC
Add compatible for RK3588 OHCI. As far as I know it's fully
compatible with generic-ohci.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
 .../devicetree/bindings/usb/generic-ohci.yaml  | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

Comments

Krzysztof Kozlowski April 6, 2023, 7:45 a.m. UTC | #1
On 04/04/2023 16:53, Sebastian Reichel wrote:
> Add compatible for RK3588 OHCI. As far as I know it's fully
> compatible with generic-ohci.
> 
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> ---
>  .../devicetree/bindings/usb/generic-ohci.yaml  | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/usb/generic-ohci.yaml b/Documentation/devicetree/bindings/usb/generic-ohci.yaml
> index a9ba7257b884..d84732a100ba 100644
> --- a/Documentation/devicetree/bindings/usb/generic-ohci.yaml
> +++ b/Documentation/devicetree/bindings/usb/generic-ohci.yaml
> @@ -44,6 +44,7 @@ properties:
>                - hpe,gxp-ohci
>                - ibm,476gtr-ohci
>                - ingenic,jz4740-ohci
> +              - rockchip,rk3588-ohci
>                - snps,hsdk-v1.0-ohci
>            - const: generic-ohci
>        - enum:
> @@ -68,8 +69,6 @@ properties:
>      maxItems: 2
>  
>    clocks:
> -    minItems: 1
> -    maxItems: 3

The constraints here should stay.

Best regards,
Krzysztof
Sebastian Reichel April 6, 2023, 10:51 a.m. UTC | #2
Hi Krzysztof,

On Thu, Apr 06, 2023 at 09:45:11AM +0200, Krzysztof Kozlowski wrote:
> On 04/04/2023 16:53, Sebastian Reichel wrote:
> > Add compatible for RK3588 OHCI. As far as I know it's fully
> > compatible with generic-ohci.
> > 
> > Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> > ---
> >  .../devicetree/bindings/usb/generic-ohci.yaml  | 18 ++++++++++++++++--
> >  1 file changed, 16 insertions(+), 2 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/usb/generic-ohci.yaml b/Documentation/devicetree/bindings/usb/generic-ohci.yaml
> > index a9ba7257b884..d84732a100ba 100644
> > --- a/Documentation/devicetree/bindings/usb/generic-ohci.yaml
> > +++ b/Documentation/devicetree/bindings/usb/generic-ohci.yaml
> > @@ -44,6 +44,7 @@ properties:
> >                - hpe,gxp-ohci
> >                - ibm,476gtr-ohci
> >                - ingenic,jz4740-ohci
> > +              - rockchip,rk3588-ohci
> >                - snps,hsdk-v1.0-ohci
> >            - const: generic-ohci
> >        - enum:
> > @@ -68,8 +69,6 @@ properties:
> >      maxItems: 2
> >  
> >    clocks:
> > -    minItems: 1
> > -    maxItems: 3
> 
> The constraints here should stay.

dtbs_check complained about the 4 RK3588 clock entries if this
stays. That's why I moved them to the condition down below into
the else branch.

-- Sebastian
Krzysztof Kozlowski April 6, 2023, 11:02 a.m. UTC | #3
On 06/04/2023 12:51, Sebastian Reichel wrote:
> Hi Krzysztof,
> 
> On Thu, Apr 06, 2023 at 09:45:11AM +0200, Krzysztof Kozlowski wrote:
>> On 04/04/2023 16:53, Sebastian Reichel wrote:
>>> Add compatible for RK3588 OHCI. As far as I know it's fully
>>> compatible with generic-ohci.
>>>
>>> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
>>> ---
>>>  .../devicetree/bindings/usb/generic-ohci.yaml  | 18 ++++++++++++++++--
>>>  1 file changed, 16 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/usb/generic-ohci.yaml b/Documentation/devicetree/bindings/usb/generic-ohci.yaml
>>> index a9ba7257b884..d84732a100ba 100644
>>> --- a/Documentation/devicetree/bindings/usb/generic-ohci.yaml
>>> +++ b/Documentation/devicetree/bindings/usb/generic-ohci.yaml
>>> @@ -44,6 +44,7 @@ properties:
>>>                - hpe,gxp-ohci
>>>                - ibm,476gtr-ohci
>>>                - ingenic,jz4740-ohci
>>> +              - rockchip,rk3588-ohci
>>>                - snps,hsdk-v1.0-ohci
>>>            - const: generic-ohci
>>>        - enum:
>>> @@ -68,8 +69,6 @@ properties:
>>>      maxItems: 2
>>>  
>>>    clocks:
>>> -    minItems: 1
>>> -    maxItems: 3
>>
>> The constraints here should stay.
> 
> dtbs_check complained about the 4 RK3588 clock entries if this
> stays. That's why I moved them to the condition down below into
> the else branch.

Which is not what we want. We want the constraints here (the widest).

Best regards,
Krzysztof
Sebastian Reichel April 6, 2023, 12:33 p.m. UTC | #4
Hi,

On Thu, Apr 06, 2023 at 01:02:44PM +0200, Krzysztof Kozlowski wrote:
> On 06/04/2023 12:51, Sebastian Reichel wrote:
> >>>    clocks:
> >>> -    minItems: 1
> >>> -    maxItems: 3
> >>
> >> The constraints here should stay.
> > 
> > dtbs_check complained about the 4 RK3588 clock entries if this
> > stays. That's why I moved them to the condition down below into
> > the else branch.
> 
> Which is not what we want. We want the constraints here (the widest).

So it should look like this?

clocks:
    minItems: 1
    maxItems: 4

...

if rk3588:
    clocks:
        minItems: 4
        maxItems: 4
else:
    clocks:
        minItems: 1
        maxItems: 3

-- Sebastian
Krzysztof Kozlowski April 6, 2023, 12:47 p.m. UTC | #5
On 06/04/2023 14:33, Sebastian Reichel wrote:
> Hi,
> 
> On Thu, Apr 06, 2023 at 01:02:44PM +0200, Krzysztof Kozlowski wrote:
>> On 06/04/2023 12:51, Sebastian Reichel wrote:
>>>>>    clocks:
>>>>> -    minItems: 1
>>>>> -    maxItems: 3
>>>>
>>>> The constraints here should stay.
>>>
>>> dtbs_check complained about the 4 RK3588 clock entries if this
>>> stays. That's why I moved them to the condition down below into
>>> the else branch.
>>
>> Which is not what we want. We want the constraints here (the widest).
> 
> So it should look like this?
> 
> clocks:
>     minItems: 1
>     maxItems: 4
> 

Yes.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/usb/generic-ohci.yaml b/Documentation/devicetree/bindings/usb/generic-ohci.yaml
index a9ba7257b884..d84732a100ba 100644
--- a/Documentation/devicetree/bindings/usb/generic-ohci.yaml
+++ b/Documentation/devicetree/bindings/usb/generic-ohci.yaml
@@ -44,6 +44,7 @@  properties:
               - hpe,gxp-ohci
               - ibm,476gtr-ohci
               - ingenic,jz4740-ohci
+              - rockchip,rk3588-ohci
               - snps,hsdk-v1.0-ohci
           - const: generic-ohci
       - enum:
@@ -68,8 +69,6 @@  properties:
     maxItems: 2
 
   clocks:
-    minItems: 1
-    maxItems: 3
     description: |
       In case the Renesas R-Car Gen3 SoCs:
         - if a host only channel: first clock should be host.
@@ -147,6 +146,21 @@  allOf:
     then:
       properties:
         transceiver: false
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: rockchip,rk3588-ohci
+    then:
+      properties:
+        clocks:
+          minItems: 4
+          maxItems: 4
+    else:
+      properties:
+        clocks:
+          minItems: 1
+          maxItems: 3
 
 additionalProperties: false