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__);
/* 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;
}
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)) {