Commit 8e74475b authored by Felipe Balbi's avatar Felipe Balbi

usb: dwc3: gadget: use udc-core's reset notifier

Replace usb_gadget_driver's disconnect with udc-core's reset notifier at
bus reset handler.
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarPeter Chen <peter.chen@freescale.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 6876d58f
...@@ -2041,6 +2041,17 @@ static void dwc3_resume_gadget(struct dwc3 *dwc) ...@@ -2041,6 +2041,17 @@ static void dwc3_resume_gadget(struct dwc3 *dwc)
if (dwc->gadget_driver && dwc->gadget_driver->resume) { if (dwc->gadget_driver && dwc->gadget_driver->resume) {
spin_unlock(&dwc->lock); spin_unlock(&dwc->lock);
dwc->gadget_driver->resume(&dwc->gadget); dwc->gadget_driver->resume(&dwc->gadget);
}
}
static void dwc3_reset_gadget(struct dwc3 *dwc)
{
if (!dwc->gadget_driver)
return;
if (dwc->gadget.speed != USB_SPEED_UNKNOWN) {
spin_unlock(&dwc->lock);
usb_gadget_udc_reset(&dwc->gadget, dwc->gadget_driver);
spin_lock(&dwc->lock); spin_lock(&dwc->lock);
} }
} }
...@@ -2185,11 +2196,7 @@ static void dwc3_gadget_reset_interrupt(struct dwc3 *dwc) ...@@ -2185,11 +2196,7 @@ static void dwc3_gadget_reset_interrupt(struct dwc3 *dwc)
dwc3_gadget_disconnect_interrupt(dwc); dwc3_gadget_disconnect_interrupt(dwc);
} }
/* after reset -> Default State */ dwc3_reset_gadget(dwc);
usb_gadget_set_state(&dwc->gadget, USB_STATE_DEFAULT);
if (dwc->gadget.speed != USB_SPEED_UNKNOWN)
dwc3_disconnect_gadget(dwc);
reg = dwc3_readl(dwc->regs, DWC3_DCTL); reg = dwc3_readl(dwc->regs, DWC3_DCTL);
reg &= ~DWC3_DCTL_TSTCTRL_MASK; reg &= ~DWC3_DCTL_TSTCTRL_MASK;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment