Loading drivers/usb/dwc3/gadget.c +21 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ static void _dwc3_gadget_wakeup(struct dwc3 *dwc); struct dwc3_usb_gadget { struct work_struct wakeup_work; bool disable_during_lpm; struct dwc3 *dwc; }; Loading Loading @@ -1789,6 +1790,7 @@ static int dwc3_gadget_vbus_draw(struct usb_gadget *g, unsigned mA) static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on) { struct dwc3 *dwc = gadget_to_dwc(g); struct dwc3_usb_gadget *dwc3_gadget = g->private; unsigned long flags; int ret; Loading @@ -1810,6 +1812,24 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on) return 0; } /* * This insures that the core is not in LPM during the pullup * on/off toggling. */ spin_unlock_irqrestore(&dwc->lock, flags); if (atomic_read(&dwc->in_lpm) && !is_on) { pm_runtime_get_sync(dwc->dev); if (dwc3_gadget) dwc3_gadget->disable_during_lpm = true; } if (is_on && dwc3_gadget && dwc3_gadget->disable_during_lpm) { pm_runtime_put_sync(dwc->dev); if (dwc3_gadget) dwc3_gadget->disable_during_lpm = false; } spin_lock_irqsave(&dwc->lock, flags); ret = dwc3_gadget_run_stop(dwc, is_on); spin_unlock_irqrestore(&dwc->lock, flags); Loading Loading @@ -3273,6 +3293,7 @@ int dwc3_gadget_init(struct dwc3 *dwc) return -ENOMEM; } dwc3_gadget->dwc = dwc; dwc3_gadget->disable_during_lpm = false; INIT_WORK(&dwc3_gadget->wakeup_work, dwc3_gadget_wakeup_work); dwc->ctrl_req = dma_alloc_coherent(dwc->dev, sizeof(*dwc->ctrl_req), Loading Loading
drivers/usb/dwc3/gadget.c +21 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ static void _dwc3_gadget_wakeup(struct dwc3 *dwc); struct dwc3_usb_gadget { struct work_struct wakeup_work; bool disable_during_lpm; struct dwc3 *dwc; }; Loading Loading @@ -1789,6 +1790,7 @@ static int dwc3_gadget_vbus_draw(struct usb_gadget *g, unsigned mA) static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on) { struct dwc3 *dwc = gadget_to_dwc(g); struct dwc3_usb_gadget *dwc3_gadget = g->private; unsigned long flags; int ret; Loading @@ -1810,6 +1812,24 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on) return 0; } /* * This insures that the core is not in LPM during the pullup * on/off toggling. */ spin_unlock_irqrestore(&dwc->lock, flags); if (atomic_read(&dwc->in_lpm) && !is_on) { pm_runtime_get_sync(dwc->dev); if (dwc3_gadget) dwc3_gadget->disable_during_lpm = true; } if (is_on && dwc3_gadget && dwc3_gadget->disable_during_lpm) { pm_runtime_put_sync(dwc->dev); if (dwc3_gadget) dwc3_gadget->disable_during_lpm = false; } spin_lock_irqsave(&dwc->lock, flags); ret = dwc3_gadget_run_stop(dwc, is_on); spin_unlock_irqrestore(&dwc->lock, flags); Loading Loading @@ -3273,6 +3293,7 @@ int dwc3_gadget_init(struct dwc3 *dwc) return -ENOMEM; } dwc3_gadget->dwc = dwc; dwc3_gadget->disable_during_lpm = false; INIT_WORK(&dwc3_gadget->wakeup_work, dwc3_gadget_wakeup_work); dwc->ctrl_req = dma_alloc_coherent(dwc->dev, sizeof(*dwc->ctrl_req), Loading