USB: musb: blackfin: fix dynamic device<->host changing
authorBob Liu <lliubbo@gmail.com>
Sat, 23 Oct 2010 10:12:00 +0000 (05:12 -0500)
committerFelipe Balbi <balbi@ti.com>
Fri, 5 Nov 2010 12:12:22 +0000 (14:12 +0200)
We need to restart the timer in order to recognize USB devices in
host-only mode.

Signed-off-by: Bob Liu <lliubbo@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/musb/blackfin.c

index 32cc6d9..ade45a2 100644 (file)
@@ -171,8 +171,9 @@ static irqreturn_t blackfin_interrupt(int irq, void *__hci)
        }
 
        /* Start sampling ID pin, when plug is removed from MUSB */
-       if (is_otg_enabled(musb) && (musb->xceiv->state == OTG_STATE_B_IDLE
-               || musb->xceiv->state == OTG_STATE_A_WAIT_BCON)) {
+       if ((is_otg_enabled(musb) && (musb->xceiv->state == OTG_STATE_B_IDLE
+               || musb->xceiv->state == OTG_STATE_A_WAIT_BCON)) ||
+               (musb->int_usb & MUSB_INTR_DISCONNECT && is_host_active(musb))) {
                mod_timer(&musb_conn_timer, jiffies + TIMER_DELAY);
                musb->a_wait_bcon = TIMER_DELAY;
        }