{
gintsts_data_t intr;
dwc_otg_hcd_t *dwc_otg_hcd = p;
+ hprt0_data_t hprt0;
+
+ dwc_otg_hcd->non_periodic_qh_ptr = &dwc_otg_hcd->non_periodic_sched_active;
+ dwc_otg_hcd->non_periodic_channels = 0;
+ dwc_otg_hcd->periodic_channels = 0;
+ hprt0.d32 = DWC_READ_REG32(dwc_otg_hcd->core_if->host_if->hprt0);
+ /* In some case, we don't disconnect a usb device, but
+ * disconnect intr was triggered, so check hprt0 here. */
+ if ((!hprt0.b.prtenchng)
+ && (hprt0.d32 != 0x1000)
+ && (hprt0.d32 != 0x1100)) {
+ DWC_PRINTF("%s: hprt0 = 0x%08x\n", __func__, hprt0.d32);
+ return 1;
+ }
/*
* Set status flags for the hub driver.
*/
/** Delete timers if become device */
del_timers(dwc_otg_hcd);
dwc_otg_disable_host_interrupts(dwc_otg_hcd->core_if);
+ goto out;
}
/* Respond with an error status to all URBs in the schedule. */
}
}
+out:
if (dwc_otg_hcd->fops->disconnect) {
dwc_otg_hcd->fops->disconnect(dwc_otg_hcd);
}
int32_t dwc_otg_hcd_handle_intr(dwc_otg_hcd_t *dwc_otg_hcd)
{
int retval = 0;
- dwc_irqflags_t flags;
dwc_otg_core_if_t *core_if = dwc_otg_hcd->core_if;
gintsts_data_t gintsts;
if (core_if->hibernation_suspend == 1) {
return retval;
}
- DWC_SPINLOCK_IRQSAVE(dwc_otg_hcd->lock, &flags);
+ DWC_SPINLOCK(dwc_otg_hcd->lock);
/* Check if HOST Mode */
if (dwc_otg_is_host_mode(core_if)) {
gintsts.d32 = dwc_otg_read_core_intr(core_if);
if (!gintsts.d32) {
- DWC_SPINUNLOCK_IRQRESTORE(dwc_otg_hcd->lock, flags);
+ DWC_SPINUNLOCK(dwc_otg_hcd->lock);
return 0;
}
#ifdef DEBUG
#endif
}
- DWC_SPINUNLOCK_IRQRESTORE(dwc_otg_hcd->lock, flags);
+ DWC_SPINUNLOCK(dwc_otg_hcd->lock);
return retval;
}