Commit 363ea206 authored by Peter Chen's avatar Peter Chen Committed by Felipe Balbi

usb: gadget: fsl_udc_core: 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 avatarPeter Chen <peter.chen@freescale.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 373ef692
......@@ -1771,7 +1771,7 @@ static void bus_resume(struct fsl_udc *udc)
}
/* Clear up all ep queues */
static int reset_queues(struct fsl_udc *udc)
static int reset_queues(struct fsl_udc *udc, bool bus_reset)
{
u8 pipe;
......@@ -1780,6 +1780,9 @@ static int reset_queues(struct fsl_udc *udc)
/* report disconnect; the driver is already quiesced */
spin_unlock(&udc->lock);
if (bus_reset)
usb_gadget_udc_reset(&udc->gadget, udc->driver);
else
udc->driver->disconnect(&udc->gadget);
spin_lock(&udc->lock);
......@@ -1834,7 +1837,7 @@ static void reset_irq(struct fsl_udc *udc)
udc->bus_reset = 1;
/* Reset all the queues, include XD, dTD, EP queue
* head and TR Queue */
reset_queues(udc);
reset_queues(udc, true);
udc->usb_state = USB_STATE_DEFAULT;
} else {
VDBG("Controller reset");
......@@ -1843,7 +1846,7 @@ static void reset_irq(struct fsl_udc *udc)
dr_controller_setup(udc);
/* Reset all internal used Queues */
reset_queues(udc);
reset_queues(udc, false);
ep0_setup(udc);
......
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