usb: phy: hold wakeupsource on usb phy events.
v6 cover usb: phy: hold wakeupsource on usb phy events.
This patch set aims to hold wakeupsource per-PHY on usb connect/disconnect events.
First patch introduces usb_phy_set_event which just sets event to phy event.
In second patch, phy drivers call usb_phy_set_event for each phy event. In third patch, wakeupsource is held when usb is enumerated in peripheral mode and wakeupsource held temporarily on disconnect event(to allow other parts of the system react to disconnect event).
v6:
* Break the patch into three sub patches
patch 1: Introduce usb_phy_set_event
patch 2: Call usb_phy_set_event from phy drivers
patch 3: Hold wakeupsource for connect events and
temporarily hold wakeupsource for disconnect events.
* Include usb_phy_wsource_init and usb_phy_wource_trash functionality in usb_add_phy and usb_remove_phy respectively.
v5:
* with the new approach,i was able to chnage only 5 phy drivers as mentioned below to use the wakeupsource funtionality.
drivers/phy/phy-omap-control.cdrivers/usb/phy/phy-ab8500-usb.cdrivers/usb/phy/phy-tahvo.cdrivers/usb/phy/phy-mv-usb.cdrivers/usb/phy/phy-gpio-vbus-usb.c
* Notification method not used any more.
* introduced usb_phy_set_event in phy.c to hold wakeupsource
* introduced usb_phy_wsource_init/usb_phy_wsource_trash in phy.c to initialize/relese per-PHY wakeupsource.These interfaces called from probe/remove functions of phy drivers.
* usb_phy_set_event called from phy drivers where usb enumeration event is handled.
* usb_phy_set_event expects usb_phy handle where as phy-omap-control.c provides its own type(omap_control_phy), so directly called __pm_stay_awake and� __pm_awake_event from phy-omap-control.c instead of calling usb_phy_set_event.
v4:
* Temporarily hold wakeupsource patch integrated into main patch.
* As per feedback,dropped "enabled" module parameter.
* Introduced otgws_otg_usb3_notifications function to handle event notifications from usb3 phy.
* Handled wakeupsource initialization,spinlock,registration of notifier block per-PHY.
* Updated usb_phy structure.
v3:
* As per the feedback,no global phy pointer used.
* called the one-liner wakeupsource handling calls directly instead of indirect functions implemented in v2.
* Removed indirect function get_phy_hook and used usb_get_phy to get the phy handle..
v2:
* wakeupsource handling implemeted per-PHY
* Implemented wakeupsource handling calls in phy
* included Todd's refactoring logic.
v1:
* changed to "disabled by default" from "enable by default".
* Kconfig help text modified
* Included better commit text
* otgws_nb moved to otg_wakeupsource_init function
* Introduced get_phy_hook to handle otgws_xceiv per-PHY
Initial RFC:
* Included build fix from Benoit Goby and Arve Hj�nnev�g
* Removed lock->held field in driver as this mechanism is provided in wakeupsource driver.
* wakelock(wl) terminology replaced with wakeup_source(ws).
Todd Poynor (3):
usb: phy: introduce usb_phy_set_event interface
usb: phy: Handle per-PHY event for connect and disconnect events
usb: phy: Hold wakeupsource when USB is enumerated in peripheral mode
drivers/usb/phy/phy-ab8500-usb.c | 15 +++++++++++++++ drivers/usb/phy/phy-gpio-vbus-usb.c | 2 ++ drivers/usb/phy/phy-mv-usb.c | 2 ++ drivers/usb/phy/phy-tahvo.c | 2 ++ drivers/usb/phy/phy.c | 37 +++++++++++++++++++++++++++++++++++++ include/linux/usb/phy.h | 10 ++++++++++ 6 files changed, 68 insertions(+)
Signature · 1 line
1.8.2.1
Hi Felipe,
Just a gentle reminder. Could you please review/share your comments for the below v6 patches which i sent earlier.
[RFC v6 1/3] usb: phy: introduce usb_phy_set_event interface [RFC v6 2/3] usb: phy: handle per-PHY connect and disconnect events [RFC v6 3/3] usb: phy: hold wakeupsource when USB is enumerated in peripheral mode
Thanks in advance for your time.
Regards,
Kiran
Quoted 91 lines · Kiran Kumar Raparthy
This patch set aims to hold wakeupsource per-PHY on usb connect/disconnect events.
First patch introduces
usb_phy_set_eventwhich just sets event to phy event.
In second patch, phy drivers callusb_phy_set_eventfor each phy event. In third patch, wakeupsource is held when usb is enumerated in peripheral mode and wakeupsource held temporarily on disconnect event(to allow other parts of the system react to disconnect event).v6:
* Break the patch into three sub patches
patch 1: Introduceusb_phy_set_event
patch 2: Callusb_phy_set_eventfrom phy drivers
patch 3: Hold wakeupsource for connect events and
temporarily hold wakeupsource for disconnect events.
* Includeusb_phy_wsource_initandusb_phy_wource_trashfunctionality inusb_add_phyandusb_remove_phyrespectively.v5:
* with the new approach,i was able to chnage only 5 phy drivers as mentioned below to use the wakeupsource funtionality.
drivers/phy/phy-omap-control.cdrivers/usb/phy/phy-ab8500-usb.cdrivers/usb/phy/phy-tahvo.cdrivers/usb/phy/phy-mv-usb.cdrivers/usb/phy/phy-gpio-vbus-usb.c* Notification method not used any more.
* introducedusb_phy_set_eventinphy.cto hold wakeupsource
* introduced usb_phy_wsource_init/usb_phy_wsource_trash inphy.cto initialize/relese per-PHY wakeupsource.These interfaces called from probe/remove functions of phy drivers.
*usb_phy_set_eventcalled from phy drivers where usb enumeration event is handled.
*usb_phy_set_eventexpectsusb_phyhandle where asphy-omap-control.cprovides its owntype(omap_control_phy), so directly called__pm_stay_awakeand__pm_awake_eventfromphy-omap-control.cinstead of callingusb_phy_set_event.v4:
* Temporarily hold wakeupsource patch integrated into main patch.
* As per feedback,dropped "enabled" module parameter.
* Introducedotgws_otg_usb3_notificationsfunction to handle event notifications from usb3 phy.
* Handled wakeupsource initialization,spinlock,registration of notifier block per-PHY.
* Updatedusb_phystructure.v3:
* As per the feedback,no global phy pointer used.
* called the one-liner wakeupsource handling calls directly instead of indirect functions implemented in v2.
* Removed indirect functionget_phy_hookand usedusb_get_phyto get the phy handle..v2:
* wakeupsource handling implemeted per-PHY
* Implemented wakeupsource handling calls in phy
* included Todd's refactoring logic.v1:
* changed to "disabled by default" from "enable by default".
*Kconfighelp text modified
* Included better commit text
*otgws_nbmoved tootg_wakeupsource_initfunction
* Introducedget_phy_hookto handleotgws_xceivper-PHYInitial RFC:
* Included build fix from Benoit Goby and Arve Hjønnevåg
* Removedlock->heldfield in driver as this mechanism is provided in wakeupsource driver.
* wakelock(wl) terminology replaced withwakeup_source(ws).Todd Poynor (3):
usb: phy: introduceusb_phy_set_eventinterface
usb: phy: Handle per-PHY event for connect and disconnect events
usb: phy: Hold wakeupsource when USB is enumerated in peripheral modedrivers/usb/phy/phy-ab8500-usb.c | 15 +++++++++++++++ drivers/usb/phy/phy-gpio-vbus-usb.c | 2 ++ drivers/usb/phy/phy-mv-usb.c | 2 ++ drivers/usb/phy/phy-tahvo.c | 2 ++ drivers/usb/phy/phy.c | 37 +++++++++++++++++++++++++++++++++++++ include/linux/usb/phy.h | 10 ++++++++++ 6 files changed, 68 insertions(+)--
1.8.2.1