• Martin Blumenstingl's avatar
    usb: core: hcd: integrate the PHY wrapper into the HCD core · 178a0bce
    Martin Blumenstingl authored
    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: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
    Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
    Acked-by: default avatarChunfeng Yun <chunfeng.yun@mediatek.com>
    Tested-by: default avatarYixun Lan <yixun.lan@amlogic.com>
    Tested-by: default avatarNeil Armstrong <narmstrong@baylibre.con>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    178a0bce
hcd.c 88.3 KB