diff options
author | Jun Li <r65092@freescale.com> | 2009-09-16 11:23:32 -0500 |
---|---|---|
committer | Rob Herring <r.herring@freescale.com> | 2009-10-16 15:45:07 -0500 |
commit | c0307156a4a5aec6ecaf917ecc40015291abbff2 (patch) | |
tree | d29e928f34b9af6d1a3527a3784537ff059be918 /drivers/usb | |
parent | b9696bc8cf020c1af668516f0fa40e1238bf1a27 (diff) |
ENGR00114795 fix usb OTG co-work with remote wakeup issue.
This patch fix OTG pin-detect failure issue.
via sysfs set power/wakeup, i.MX51 can:
Put usb phy into low power mode when system enters stop or
standby mode; Enable usb device remote wakeup system by Vbus
and usb host remote wakeup system by device connection or
disconnection.
Signed-off-by: Li Jun <r65092@freescale.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/core/hcd.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 95ccfa0b9fc5..d622f7099a7d 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -117,6 +117,10 @@ static inline int is_root_hub(struct usb_device *udev) return (udev->parent == NULL); } +#if CONFIG_PM +extern int usb_host_wakeup_irq(struct device *wkup_dev); +extern void usb_host_set_wakeup(struct device *wkup_dev, bool para); +#endif /*-------------------------------------------------------------------------*/ /* @@ -1882,8 +1886,17 @@ irqreturn_t usb_hcd_irq (int irq, void *__hcd) */ local_irq_save(flags); - if (unlikely(hcd->state == HC_STATE_HALT || - !test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))) { + if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) { + /* if receive a remote wakeup interrrupt after suspend */ + if (usb_host_wakeup_irq(hcd->self.controller)) { + /* disable remote wake up irq */ + usb_host_set_wakeup(hcd->self.controller, false); + set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); + hcd->driver->irq(hcd); + rc = IRQ_HANDLED; + } else + rc = IRQ_NONE; + } else if (unlikely(hcd->state == HC_STATE_HALT)) { rc = IRQ_NONE; } else if (hcd->driver->irq(hcd) == IRQ_NONE) { rc = IRQ_NONE; |