diff mbox series

[1/2] dt-bindings: usb: dwc2: Add support for additional clock

Message ID 20210125093825.4292-2-s.hauer@pengutronix.de (mailing list archive)
State New, archived
Headers show
Series usb: dwc2: Use clk bulk API for supporting multiple clocks | expand

Commit Message

Sascha Hauer Jan. 25, 2021, 9:38 a.m. UTC
This adds support for an additional clock for the dwc2 core in case
there is another clock to the phy which must be enabled.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 Documentation/devicetree/bindings/usb/dwc2.yaml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Rob Herring (Arm) Feb. 9, 2021, 4:46 p.m. UTC | #1
On Mon, Jan 25, 2021 at 10:38:24AM +0100, Sascha Hauer wrote:
> This adds support for an additional clock for the dwc2 core in case
> there is another clock to the phy which must be enabled.

to the phy? 'clocks' is inputs to DWC2. Shouldn't there be a phy 
device/driver?

> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  Documentation/devicetree/bindings/usb/dwc2.yaml | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/usb/dwc2.yaml b/Documentation/devicetree/bindings/usb/dwc2.yaml
> index e5ee51b7b470..56dd0d18d535 100644
> --- a/Documentation/devicetree/bindings/usb/dwc2.yaml
> +++ b/Documentation/devicetree/bindings/usb/dwc2.yaml
> @@ -57,11 +57,14 @@ properties:
>      maxItems: 1
>  
>    clocks:
> -    maxItems: 1
> +    minItems: 1
> +    maxItems: 2
>  
>    clock-names:
>      items:
>        - const: otg
> +      - const: phy
> +    minItems: 1
>  
>    resets:
>      items:
> -- 
> 2.20.1
>
Sascha Hauer Feb. 10, 2021, 8:39 a.m. UTC | #2
On Tue, Feb 09, 2021 at 10:46:59AM -0600, Rob Herring wrote:
> On Mon, Jan 25, 2021 at 10:38:24AM +0100, Sascha Hauer wrote:
> > This adds support for an additional clock for the dwc2 core in case
> > there is another clock to the phy which must be enabled.
> 
> to the phy? 'clocks' is inputs to DWC2. Shouldn't there be a phy 
> device/driver?

Maybe I should have said "from the phy". I have a USB3320 ULPI phy here
connected to the DWC2. The usual setup would look like this:

-----.    clk60M   .------------
DWC2 |<------------| USB3320 Phy
-----'             '------------

I don't think this clock is abstracted anywhere in this case, it's just
there and always enabled.

For reasons unknown to me our customer decided to not let the USB3320
generate the clock, but used an external clock generator instead, so
my setup looks like this:

        | SI5351a |
        '---------'
  clk60M_1 |  | clk60M_2
-----.     |  |    .------------
DWC2 |<----'  '--->| USB3320 Phy
-----'             '------------

The SI5351a is abstracted as a clock driver in Linux. Note that clk60M_1
and clk60M_2 are really two clocks which must both be enabled. clk60M_2
is handled by the phy driver (which is the usb-nop-xceiver in my case),
what I am trying to add here in this patch is support for clk60M_1.

Sascha
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/usb/dwc2.yaml b/Documentation/devicetree/bindings/usb/dwc2.yaml
index e5ee51b7b470..56dd0d18d535 100644
--- a/Documentation/devicetree/bindings/usb/dwc2.yaml
+++ b/Documentation/devicetree/bindings/usb/dwc2.yaml
@@ -57,11 +57,14 @@  properties:
     maxItems: 1
 
   clocks:
-    maxItems: 1
+    minItems: 1
+    maxItems: 2
 
   clock-names:
     items:
       - const: otg
+      - const: phy
+    minItems: 1
 
   resets:
     items: