[2/3] Documentation: dt-bindings: Add snps, need-phy-for-wake for dwc2 USB
diff mbox

Message ID 1435017144-2971-3-git-send-email-dianders@chromium.org
State New
Headers show

Commit Message

Doug Anderson June 22, 2015, 11:52 p.m. UTC
Some SoCs with a dwc2 USB controller may need to keep the PHY on to
support remote wakeup.  Allow specifying this as a device tree
property.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
 Documentation/devicetree/bindings/usb/dwc2.txt | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Rob Herring June 23, 2015, 2:17 p.m. UTC | #1
On Mon, Jun 22, 2015 at 6:52 PM, Douglas Anderson <dianders@chromium.org> wrote:
> Some SoCs with a dwc2 USB controller may need to keep the PHY on to
> support remote wakeup.  Allow specifying this as a device tree
> property.

I find it hard to believe that any host can support wake-up without
the PHY. Does this really need to be conditional? Perhaps other cases
are just always-on or remote wake-up has not been tested.

Assuming the PHY was provided with the knowledge that remote wakeup is
enabled, it would be able to figure out within its driver how to
support that. Unfortunately the generic PHY framework is a completely
lacking in its ability to support protocol specific features like this
or other USB PHY features like Vbus detect or charger detection.

Rob

>
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---
>  Documentation/devicetree/bindings/usb/dwc2.txt | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/usb/dwc2.txt b/Documentation/devicetree/bindings/usb/dwc2.txt
> index fd132cb..84d258d 100644
> --- a/Documentation/devicetree/bindings/usb/dwc2.txt
> +++ b/Documentation/devicetree/bindings/usb/dwc2.txt
> @@ -17,6 +17,9 @@ Refer to clk/clock-bindings.txt for generic clock consumer properties
>  Optional properties:
>  - phys: phy provider specifier
>  - phy-names: shall be "usb2-phy"
> +- snps,need-phy-for-wake: if present indicates that the phy needs to be left
> +  on for remote wakeup during suspend.
> +
>  Refer to phy/phy-bindings.txt for generic phy consumer properties
>  - dr_mode: shall be one of "host", "peripheral" and "otg"
>    Refer to usb/generic.txt
> @@ -35,4 +38,5 @@ Example:
>                 clock-names = "otg";
>                 phys = <&usbphy>;
>                 phy-names = "usb2-phy";
> +               snps,need-phy-for-wake;
>          };
> --
> 2.4.3.573.g4eafbef
>
Doug Anderson June 23, 2015, 3:12 p.m. UTC | #2
Rob,

On Tue, Jun 23, 2015 at 7:17 AM, Rob Herring <robherring2@gmail.com> wrote:
> On Mon, Jun 22, 2015 at 6:52 PM, Douglas Anderson <dianders@chromium.org> wrote:
>> Some SoCs with a dwc2 USB controller may need to keep the PHY on to
>> support remote wakeup.  Allow specifying this as a device tree
>> property.
>
> I find it hard to believe that any host can support wake-up without
> the PHY.

I am told by Andrew Bresticker that on tegra there is complicated
logic in the PMU that allows USB wakeup while powering off the PHY.
If I hadn't been aware of such a feature I probably would have called
the property "wakeup-supported" or something like that.

> Does this really need to be conditional? Perhaps other cases
> are just always-on or remote wake-up has not been tested.

When I worked on exynos products I was told by Samsung that USB wakeup
was simply not possible.  True that they have a different USB
controller, but I can certainly believe that someone could design a
system with dwc2 where USB wakeup was not possible.

Specifically, in order to get USB wakeup we had to switch on the 24MHz
clock at suspend time.  Had that not been possible (or had the 24MHz
clock not been able to be a clock source for the USB controller) then
USB wakeup would not be possible on rk3288 even if we left the phy on.

So to me the three states are:
1. USB wake not possible
2. USB wake possible, don't need PHY
3. USB wake possible, do need PHY

I don't know of any dwc2 users that are in #2 (so I didn't add a
property now), but I figure that when they exist someone should add a
property then.


-Doug

Patch
diff mbox

diff --git a/Documentation/devicetree/bindings/usb/dwc2.txt b/Documentation/devicetree/bindings/usb/dwc2.txt
index fd132cb..84d258d 100644
--- a/Documentation/devicetree/bindings/usb/dwc2.txt
+++ b/Documentation/devicetree/bindings/usb/dwc2.txt
@@ -17,6 +17,9 @@  Refer to clk/clock-bindings.txt for generic clock consumer properties
 Optional properties:
 - phys: phy provider specifier
 - phy-names: shall be "usb2-phy"
+- snps,need-phy-for-wake: if present indicates that the phy needs to be left
+  on for remote wakeup during suspend.
+
 Refer to phy/phy-bindings.txt for generic phy consumer properties
 - dr_mode: shall be one of "host", "peripheral" and "otg"
   Refer to usb/generic.txt
@@ -35,4 +38,5 @@  Example:
 		clock-names = "otg";
 		phys = <&usbphy>;
 		phy-names = "usb2-phy";
+		snps,need-phy-for-wake;
         };