pdata->init(NULL);
}
if ((port1 == 1) && (hdev->level == 0)) {
- if (!(portstatus & USB_PORT_STAT_CONNECTION)) {
- /* Must clear HOSTDISCONDETECT when disconnect*/
- if (pdata->platform_set_disconnect_det)
- pdata->platform_set_disconnect_det(pdata, 0);
- }
+ /* Must clear HOSTDISCONDETECT when port connect change happen*/
+ if (pdata->platform_set_disconnect_det)
+ pdata->platform_set_disconnect_det(pdata, 0);
+
}
}
#endif
usb_host_set_wakeup(hcd->self.controller, true);
+#ifndef NO_FIX_DISCONNECT_ISSUE
+ /*Unplug&plug device during suspend without remote wakeup enabled
+ For Low and full speed device, we should power on and power off
+ the USB port to make sure USB internal state machine work well.
+ */
+ tmp = ehci_readl(ehci, &ehci->regs->port_status[0]);
+ if ((tmp & PORT_CONNECT) && !(tmp & PORT_SUSPEND) &&
+ ((tmp & (0x3<<26)) != (0x2<<26))) {
+ printk(KERN_DEBUG "%s will do power off and power on port.\n", pdata->name);
+ ehci_writel(ehci, tmp & ~(PORT_RWC_BITS | PORT_POWER),
+ &ehci->regs->port_status[0]);
+ ehci_writel(ehci, tmp | PORT_POWER,
+ &ehci->regs->port_status[0]);
+ }
+#endif
fsl_usb_clk_gate(hcd->self.controller->platform_data, false);
}
return 0;