summaryrefslogtreecommitdiff
path: root/drivers/usb/otg
diff options
context:
space:
mode:
authorHu hui <b29976@freescale.com>2010-10-09 13:40:11 +0800
committerHu Hui <b29976@freescale.com>2010-10-09 14:42:24 +0800
commit2293c37431ab42f48bb28b2ff6be9fe00125bee4 (patch)
tree3c02649eb1e5b3cf94932b7c22fac96f9ba53dab /drivers/usb/otg
parent52bd5df58dad37c994fc2b396c0c9bc20c321cb9 (diff)
ENGR00132418-2 I.MX USB ID debounce only needed when wakeup event is present
Driver Part We do need software ID debounce only when the wakeup event is present This is becasse that on some boards when an usb device is attached to otg port,the vbus wakeup event is present earlier than ID pin wakeup event,but the vbus wakeup event is not expected, So we must delay with some time (3ms) when wakup event is present to let the ID pin change to the correct value. Signed-off-by: Hu Hui <b29976@freescale.com>
Diffstat (limited to 'drivers/usb/otg')
-rw-r--r--drivers/usb/otg/fsl_otg.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/otg/fsl_otg.c b/drivers/usb/otg/fsl_otg.c
index 88d7d4b39f20..2395a639055c 100644
--- a/drivers/usb/otg/fsl_otg.c
+++ b/drivers/usb/otg/fsl_otg.c
@@ -792,6 +792,8 @@ irqreturn_t fsl_otg_isr_gpio(int irq, void *dev_id)
* intact. It needs to have knowledge of some USB interrupts
* such as port change.
*/
+extern int usb_event_is_otg_wakeup(void);
+extern void usb_debounce_id_pin(void);
irqreturn_t fsl_otg_isr(int irq, void *dev_id)
{
struct fsl_otg *fotg = (struct fsl_otg *)dev_id;
@@ -800,6 +802,11 @@ irqreturn_t fsl_otg_isr(int irq, void *dev_id)
irqreturn_t ret = IRQ_NONE;
fsl_otg_clk_ctl();
+ /* if this is an wakeup event, we should debounce ID pin
+ * so we can get the correct ID value(ID status) here */
+ if (usb_event_is_otg_wakeup())
+ usb_debounce_id_pin();
+
otg_sc = le32_to_cpu(usb_dr_regs->otgsc);
otg_int_src = otg_sc & OTGSC_INTSTS_MASK & (otg_sc >> 8);