usb: musb: dsps: polling ID pin status only in otg mode
authorBin Liu <b-liu@ti.com>
Wed, 30 Oct 2013 14:38:23 +0000 (09:38 -0500)
committerFelipe Balbi <balbi@ti.com>
Tue, 26 Nov 2013 17:44:40 +0000 (11:44 -0600)
Only start the otg_timer in dual role mode; otherwise in peripheral mode
when musb is disconnected from the host port, otg_timer starts and
continuously toggles the session, which causes VBUS pulse.

Signed-off-by: Bin Liu <b-liu@ti.com>
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/musb/musb_dsps.c

index 7cfa6e80ad6071b6d63168e31e074870e85105b2..593d3c9625651265082fafb6b6b446423a450ace 100644 (file)
@@ -359,8 +359,9 @@ static irqreturn_t dsps_interrupt(int irq, void *hci)
        if (musb->int_tx || musb->int_rx || musb->int_usb)
                ret |= musb_interrupt(musb);
 
-       /* Poll for ID change */
-       if (musb->xceiv->state == OTG_STATE_B_IDLE)
+       /* Poll for ID change in OTG port mode */
+       if (musb->xceiv->state == OTG_STATE_B_IDLE &&
+                       musb->port_mode == MUSB_PORT_MODE_DUAL_ROLE)
                mod_timer(&glue->timer, jiffies + wrp->poll_seconds * HZ);
 out:
        spin_unlock_irqrestore(&musb->lock, flags);