aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb/hcd.h
diff options
context:
space:
mode:
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>2018-03-03 22:43:05 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-09 09:43:53 -0800
commit178a0bce05cbc17a27f9cba78258c5d12adc980c (patch)
tree751c5909d843e40454eb7b32c3a2f92c1baa50bb /include/linux/usb/hcd.h
parentusb: core: add a wrapper for the USB PHYs on the HCD (diff)
downloadlinux-dev-178a0bce05cbc17a27f9cba78258c5d12adc980c.tar.xz
linux-dev-178a0bce05cbc17a27f9cba78258c5d12adc980c.zip
usb: core: hcd: integrate the PHY wrapper into the HCD core
This integrates the PHY wrapper into the core hcd infrastructure. Multiple PHYs which are part of the HCD's device tree node are now managed (= powered on/off when needed), by the new usb_phy_roothub code. Suspend and resume is also supported, however not for runtime/auto-suspend (which is triggered for example when no devices are connected to the USB bus). This is needed on some SoCs (for example Amlogic Meson GXL) because if the PHYs are disabled during auto-suspend then devices which are plugged in afterwards are not seen by the host. 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. Each port has it's own PHY which must be enabled (if one of the PHYs is left disabled then none of the USB ports works at all). The new logic works on the Amlogic GXL and GXM SoCs because the dwc3 driver internally creates a xhci-hcd which then registers a HCD which then triggers our new PHY wrapper. USB controller drivers can opt out of this by setting "skip_phy_initialization" in struct usb_hcd to true. This is identical to how it works for a single USB PHY, so the "multiple PHY" handling is disabled for drivers that opted out of the management logic of a single PHY. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Acked-by: Chunfeng Yun <chunfeng.yun@mediatek.com> Tested-by: Yixun Lan <yixun.lan@amlogic.com> Tested-by: Neil Armstrong <narmstrong@baylibre.con> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/usb/hcd.h')
-rw-r--r--include/linux/usb/hcd.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index 693502c84c04..a042675e03ba 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -104,6 +104,7 @@ struct usb_hcd {
*/
struct usb_phy *usb_phy;
struct phy *phy;
+ struct usb_phy_roothub *phy_roothub;
/* Flags that need to be manipulated atomically because they can
* change while the host controller is running. Always use