diff options
author | Martin Blumenstingl <martin.blumenstingl@googlemail.com> | 2018-04-18 21:39:47 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-04-22 15:01:30 +0200 |
commit | 63cb03f5c11eef2c08b5812f4533ba87cf778fa8 (patch) | |
tree | 680492eccbd48a76d6b3b25b0089db9fb79bbfd6 /drivers/usb/core/phy.h | |
parent | dd40438fc6be7454c906093fe2a1b69ca98946fb (diff) | |
download | linux-63cb03f5c11eef2c08b5812f4533ba87cf778fa8.tar.gz linux-63cb03f5c11eef2c08b5812f4533ba87cf778fa8.tar.bz2 linux-63cb03f5c11eef2c08b5812f4533ba87cf778fa8.zip |
usb: core: split usb_phy_roothub_{init,alloc}
Before this patch usb_phy_roothub_init served two purposes (from a
caller's point of view - like hcd.c):
- parsing the PHYs and allocating the list entries
- calling phy_init on each list entry
While this worked so far it has one disadvantage: if we need to call
phy_init for each PHY instance then the existing code cannot be re-used.
Solve this by splitting off usb_phy_roothub_alloc which only parses the
PHYs and allocates the list entries.
usb_phy_roothub_init then gets a struct usb_phy_roothub and only calls
phy_init on each PHY instance (along with the corresponding cleanup if
that failed somewhere).
This is a preparation step for adding proper suspend support for some
hardware that requires phy_exit to be called during suspend and phy_init
to be called during resume.
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Tested-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: Roger Quadros <rogerq@ti.com>
Tested-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core/phy.h')
-rw-r--r-- | drivers/usb/core/phy.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/core/phy.h b/drivers/usb/core/phy.h index 6fde59bfbff8..eb31253201ad 100644 --- a/drivers/usb/core/phy.h +++ b/drivers/usb/core/phy.h @@ -1,6 +1,8 @@ struct usb_phy_roothub; -struct usb_phy_roothub *usb_phy_roothub_init(struct device *dev); +struct usb_phy_roothub *usb_phy_roothub_alloc(struct device *dev); + +int usb_phy_roothub_init(struct usb_phy_roothub *phy_roothub); int usb_phy_roothub_exit(struct usb_phy_roothub *phy_roothub); int usb_phy_roothub_power_on(struct usb_phy_roothub *phy_roothub); |