summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2012-03-14 13:54:17 +0800
committermake shi <b15407@freescale.com>2012-03-26 15:00:18 +0800
commit94642f3235907f905149f3e0a1f7471f8a7c9324 (patch)
treeda6e54357ae59e487941bbff81e6cf32c824fef8
parent62b790884f6d4b6fbd3f47ccc9f8331ecbec8a71 (diff)
ENGR00177589 USB: fix two USB common bug for i.MX6
- Without host wakeup enable, after doing system suspend/resume, plug in usb cable(both host/device) with no response, the reason is usb wakeup is not enable after suspend resume. - clock refcount will not be 0 after usb enters low power mode,the reason is OTG ID wake up not do recover hcd. Signed-off-by: Peter Chen <peter.chen@freescale.com>
-rwxr-xr-xdrivers/usb/host/ehci-arc.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/usb/host/ehci-arc.c b/drivers/usb/host/ehci-arc.c
index 0bac00b9e30b..3fddb2f27245 100755
--- a/drivers/usb/host/ehci-arc.c
+++ b/drivers/usb/host/ehci-arc.c
@@ -147,7 +147,8 @@ static irqreturn_t ehci_fsl_pre_irq(int irq, void *dev)
pdata = hcd->self.controller->platform_data;
if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) {
- if (pdata->irq_delay || pdata->wakeup_event != WAKEUP_EVENT_DPDM)
+ if (pdata->irq_delay || (pdata->wakeup_event == WAKEUP_EVENT_VBUS)
+ || (pdata->wakeup_event == WAKEUP_EVENT_INVALID))
return IRQ_NONE;
pr_debug("%s\n", __func__);
@@ -669,14 +670,15 @@ static int ehci_fsl_drv_suspend(struct platform_device *pdev,
/* Only handles OTG mode switch event, system suspend event will be done in bus suspend */
if (pdata->pmflags == 0) {
printk(KERN_DEBUG "%s, pm event \n", __func__);
- /* Need open clock for register access */
- if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))
+ if (!host_can_wakeup_system(pdev)) {
+ /* Need open clock for register access */
fsl_usb_clk_gate(hcd->self.controller->platform_data, true);
- if (!host_can_wakeup_system(pdev))
usb_host_set_wakeup(hcd->self.controller, false);
- fsl_usb_clk_gate(hcd->self.controller->platform_data, false);
+ fsl_usb_clk_gate(hcd->self.controller->platform_data, false);
+ }
+
printk(KERN_DEBUG "host suspend ends\n");
return 0;
}
@@ -763,6 +765,14 @@ static int ehci_fsl_drv_resume(struct platform_device *pdev)
if (pdata->pmflags == 0) {
printk(KERN_DEBUG "%s,pm event, wait for wakeup irq if needed\n", __func__);
wait_event_interruptible(wake_up_pdata->wq, !wake_up_pdata->usb_wakeup_is_pending);
+ if (!host_can_wakeup_system(pdev)) {
+ /* Need open clock for register access */
+ fsl_usb_clk_gate(hcd->self.controller->platform_data, true);
+
+ usb_host_set_wakeup(hcd->self.controller, true);
+
+ fsl_usb_clk_gate(hcd->self.controller->platform_data, false);
+ }
return 0;
}
if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) {