summaryrefslogtreecommitdiff
path: root/drivers/usb/common
diff options
context:
space:
mode:
authorHemant Kumar <hemantk@codeaurora.org>2015-04-07 14:42:39 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:06:09 -0700
commit0cfa0c949f94d01544a19bf8cfc336d0666a7b5d (patch)
treea435e5f7f3f7f034d0177d106a7c96840de1173e /drivers/usb/common
parent5bf0c1d26a0dc6f4640e381e0029456add62c91a (diff)
usb: phy: Add new OTG state OTG_STATE_B_SUSPENDED
This state is used to handle:- - Bus suspend followed by cable disconnect: pm usage count is incremented upon cable connect. Upon bus suspend, suspend interrupt kicks in otg state machine which moves device state to OTG_STATE_B_SUSPENDED from OTG_STATE_B_PERIPHERAL and decrements pm usage count. Upon cable unplug additional decrement of pm usage count is prevented. This state also takes care the handling of cable unplug followed by bus suspend interrupt. - Host initiated resume after bus suspend: Being in OTG_STATE_B_SUSPENDED after bus suspend, upon host initiated resume, wakeup interrupt kicks in otg state machine which moves device to OTG_STATE_B_PERIPHERAL state by incrementing pm usage count. - PC reboot with cable plugged in: After PC shutdown device goes to OTG_STATE_B_SUSPENDED state. After PC start power event irq thread kicks in otg state machine to move device to OTG_STATE_B_PERIPHERAL state and increments pm usage count. - Composition switch after bus suspend: dwc3_gadget_pullup() kicks in otg state machine to move device state from OTG_STATE_B_SUSPENDED to OTG_STATE_B_PERIPHERAL and increments pm usage count to prevent runtime suspend during device enumeration. Also, remove pm_runtime_set_active() which sets the PM runtime stauts as active to avoid pm_runtime_get_sync() failures which explicitly checks for runtime pm status. For example, if status is active, pm_runtime_get_sync() will just increments the counter without actually resuming the device. Change-Id: Id33b81911ef3894a00802b3e553840b9447f6269 Signed-off-by: Hemant Kumar <hemantk@codeaurora.org> [jackp@codeaurora.org: cherry-pick only phy.h and common.c] Signed-off-by: Jack Pham <jackp@codeaurora.org>
Diffstat (limited to 'drivers/usb/common')
-rw-r--r--drivers/usb/common/common.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/common/common.c b/drivers/usb/common/common.c
index 673d53038ed2..666155f1a185 100644
--- a/drivers/usb/common/common.c
+++ b/drivers/usb/common/common.c
@@ -34,6 +34,7 @@ const char *usb_otg_state_string(enum usb_otg_state state)
[OTG_STATE_B_PERIPHERAL] = "b_peripheral",
[OTG_STATE_B_WAIT_ACON] = "b_wait_acon",
[OTG_STATE_B_HOST] = "b_host",
+ [OTG_STATE_B_SUSPEND] = "b_suspend",
};
if (state < 0 || state >= ARRAY_SIZE(names))