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>
This commit is contained in:
Mayank Rana 2016-04-04 13:24:57 -07:00 committed by Jeevan Shriram
parent dd7665e708
commit b35bd9c58b

View file

@ -2094,6 +2094,9 @@ static int dwc3_gadget_stop(struct usb_gadget *g)
unsigned long flags; unsigned long flags;
int irq; 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); dwc3_gadget_disable_irq(dwc);
tasklet_kill(&dwc->bh); tasklet_kill(&dwc->bh);
@ -2107,6 +2110,10 @@ static int dwc3_gadget_stop(struct usb_gadget *g)
spin_unlock_irqrestore(&dwc->lock, flags); 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); irq = platform_get_irq(to_platform_device(dwc->dev), 0);
free_irq(irq, dwc); free_irq(irq, dwc);