switch (dwc->current_dr_role) {
case DWC3_GCTL_PRTCAP_DEVICE:
+ case DWC3_GCTL_PRTCAP_OTG:
spin_lock_irqsave(&dwc->lock, flags);
dwc3_gadget_suspend(dwc);
spin_unlock_irqrestore(&dwc->lock, flags);
- dwc3_core_exit(dwc);
break;
case DWC3_GCTL_PRTCAP_HOST:
if (!PMSG_IS_AUTO(msg)) {
break;
}
+ dwc3_core_exit(dwc);
+
return 0;
}
int ret;
u32 reg;
+ ret = dwc3_core_init(dwc);
+ if (ret)
+ return ret;
+
switch (dwc->current_dr_role) {
case DWC3_GCTL_PRTCAP_DEVICE:
ret = dwc3_core_init_for_resume(dwc);
if (ret)
return ret;
-
+ case DWC3_GCTL_PRTCAP_OTG:
dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_DEVICE);
spin_lock_irqsave(&dwc->lock, flags);
dwc3_gadget_resume(dwc);
switch (dwc->current_dr_role) {
case DWC3_GCTL_PRTCAP_DEVICE:
+ case DWC3_GCTL_PRTCAP_OTG:
dwc3_gadget_process_pending_events(dwc);
break;
case DWC3_GCTL_PRTCAP_HOST:
}
pm_runtime_mark_last_busy(dev);
- /* maybe drop this? */
pm_runtime_get(dev);
return 0;
switch (dwc->current_dr_role) {
case DWC3_GCTL_PRTCAP_DEVICE:
+ case DWC3_GCTL_PRTCAP_OTG:
if (dwc3_runtime_checks(dwc))
return -EBUSY;
break;