From: mgautam@codeaurora.org (Manu Gautam)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH v7 usb-next 3/4] usb: core: hcd: integrate the PHY roothub wrapper
Date: Thu, 26 Oct 2017 11:12:42 +0530 [thread overview]
Message-ID: <89fc89e9-4510-2283-aad4-59eacf5cf925@codeaurora.org> (raw)
In-Reply-To: <20171023215718.3446-4-martin.blumenstingl@googlemail.com>
Hi,
On 10/24/2017 3:27 AM, Martin Blumenstingl wrote:
> This integrates the PHY roothub wrapper into the core hcd
> infrastructure. Multiple PHYs which are part of the roothub devicetree
> node (which is a sub-node of the sysdev's node) are now managed
> (= powered on/off when needed), by the new usb_phy_roothub code.
>
> One example where this is required is the Amlogic GXL and GXM SoCs:
> They are using a dwc3 USB controller with up to three ports enabled on
> the internal roothub. Using only the top-level "phy" properties does not
> work here since one can only specify one "usb2-phy" and one "usb3-phy",
> while actually at least two "usb2-phy" have to be specified.
>
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> Tested-by: Neil Armstrong <narmstrong@baylibre.com>
> Acked-by: Alan Stern <stern@rowland.harvard.edu>
> ---
> drivers/usb/core/hcd.c | 26 ++++++++++++++++++++++++++
> include/linux/usb/hcd.h | 1 +
> 2 files changed, 27 insertions(+)
>
> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
> index 67aa3d039b9b..6ee97222cdad 100644
> --- a/drivers/usb/core/hcd.c
> +++ b/drivers/usb/core/hcd.c
> @@ -50,6 +50,7 @@
> #include <linux/usb/otg.h>
>
> #include "usb.h"
> +#include "phy.h"
>
>
> /*-------------------------------------------------------------------------*/
> @@ -2271,6 +2272,8 @@ int hcd_bus_suspend(struct usb_device *rhdev, pm_message_t msg)
> usb_set_device_state(rhdev, USB_STATE_SUSPENDED);
> hcd->state = HC_STATE_SUSPENDED;
>
> + usb_phy_roothub_power_off(hcd->phy_roothub);
> +
For system-suspend it should be ok.
But, in case of runtime/auto suspend, I think PHYs shouldn't be powered off.
Should we have check for that like-
if (!PMSG_IS_AUTO(msg))
??? usb_phy_roothub_power_off()
Similar check in hcd_bus_resume?
> /* Did we race with a root-hub wakeup event? */
> if (rhdev->do_remote_wakeup) {
> char buffer[6];
> @@ -2307,6 +2310,11 @@ int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg)
> dev_dbg(&rhdev->dev, "skipped %s of dead bus\n", "resume");
> return 0;
> }
> +
> + status = usb_phy_roothub_power_on(hcd->phy_roothub);
> + if (status)
> + return status;
> +
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2017-10-26 5:42 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-23 21:57 [PATCH v7 usb-next 0/4] initialize (multiple) PHYs on the roothub Martin Blumenstingl
2017-10-23 21:57 ` [PATCH v7 usb-next 1/4] dt-bindings: usb: add the documentation for USB root-hub Martin Blumenstingl
2017-10-23 21:57 ` [PATCH v7 usb-next 2/4] usb: core: add a wrapper for the USB PHYs on the root-hub Martin Blumenstingl
2017-10-24 0:06 ` Chunfeng Yun
2017-10-23 21:57 ` [PATCH v7 usb-next 3/4] usb: core: hcd: integrate the PHY roothub wrapper Martin Blumenstingl
2017-10-24 0:07 ` Chunfeng Yun
2017-10-26 5:42 ` Manu Gautam [this message]
2017-10-30 23:10 ` Martin Blumenstingl
2017-10-31 11:30 ` Chunfeng Yun
2017-10-23 21:57 ` [PATCH v7 usb-next 4/4] dt-bindings: usb: xhci: include the roothub and a device in the example Martin Blumenstingl
2017-10-27 3:29 ` Rob Herring
2017-10-27 19:20 ` Martin Blumenstingl
2017-10-27 19:55 ` Alan Stern
2017-10-28 13:33 ` Martin Blumenstingl
2017-10-30 14:08 ` Arnd Bergmann
2017-10-30 22:59 ` Martin Blumenstingl
2017-11-12 20:48 ` Martin Blumenstingl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=89fc89e9-4510-2283-aad4-59eacf5cf925@codeaurora.org \
--to=mgautam@codeaurora.org \
--cc=linus-amlogic@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).