Re: [RFC usb-next v5 2/3] usb: core: add a wrapper for the USB PHYs on the root-hub
From: Martin Blumenstingl <hidden>
Date: 2017-10-12 21:00:40
Also in:
linux-amlogic
Hi Alan, thank you for taking the time to review my patches! On Mon, Oct 9, 2017 at 7:16 PM, Alan Stern [off-list ref] wrote:
On Sun, 8 Oct 2017, Martin Blumenstingl wrote:quoted
Many SoC platforms have separate devices for the USB PHY which are registered through the generic PHY framework. These PHYs have to be enabled to make the USB controller actually work. They also have to be disabled again on shutdown/suspend....quoted
--- /dev/null +++ b/drivers/usb/core/phy.h@@ -0,0 +1,7 @@ +struct usb_phy_roothub; + +struct usb_phy_roothub *usb_phy_roothub_init(struct device *dev); +int usb_phy_roothub_exit(struct usb_phy_roothub *phy_roothub); + +int usb_phy_roothub_power_on(struct usb_phy_roothub *phy_roothub); +int usb_phy_roothub_power_off(struct usb_phy_roothub *phy_roothub);Have you considered the possibility that a phy might need three power states, for on, off, and suspended?
I have not considered this yet - on the Mediatek platform (tested by
Chunfeng Yun) _power_{on,off} works fine for a suspend/resume cycle.
the other platform this was tested on is Amlogic Meson GXL/GXM,
however we don't have suspend support there
the underlying code relies on the generic PHY framework, which has
*runtime PM* support, but no suspend/resume PM functions - see [0]
Alan Stern
Regards, Martin [0] http://elixir.free-electrons.com/linux/v4.14-rc4/source/include/linux/phy/phy.h#L131 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html