summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMayank Rana <mrana@codeaurora.org>2016-04-04 13:24:57 -0700
committerJeevan Shriram <jshriram@codeaurora.org>2016-04-07 15:56:45 -0700
commitb35bd9c58baace7f9357cd7b341cf8ae4342ccf7 (patch)
tree74430ea29a091a1e6a16b29f35ade1d13ce7980a /drivers
parentdd7665e7088610117096056e7f20651e4df02d38 (diff)
dwc3: gadget: Resume controller when udc_stop is called
Wehn adbd is closing eps, it is trying to unregister gadget and UDC. When VBUS is not present and cotroller is into low power mode. ffs_func_disable() also invokes controller's PM idle as well. This results into unclock register access when dwc3_gadget_stop() is called by unregister_gadget_item(). Fix this issue by resuming controller from dwc3_gadget_stop(). Change-Id: I469e8609bf23bee97b3f9c612401aaf92bc72a30 Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/dwc3/gadget.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 3da70925d565..448cbdf6fa40 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2094,6 +2094,9 @@ static int dwc3_gadget_stop(struct usb_gadget *g)
unsigned long flags;
int irq;
+ pm_runtime_get_sync(dwc->dev);
+ dbg_event(0xFF, "Stop gsync",
+ atomic_read(&dwc->dev->power.usage_count));
dwc3_gadget_disable_irq(dwc);
tasklet_kill(&dwc->bh);
@@ -2107,6 +2110,10 @@ static int dwc3_gadget_stop(struct usb_gadget *g)
spin_unlock_irqrestore(&dwc->lock, flags);
+ pm_runtime_mark_last_busy(dwc->dev);
+ pm_runtime_put_autosuspend(dwc->dev);
+ dbg_event(0xFF, "Auto_susgsync", 0);
+
irq = platform_get_irq(to_platform_device(dwc->dev), 0);
free_irq(irq, dwc);