Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5ace3d00 authored by Bin Liu's avatar Bin Liu Committed by Felipe Balbi
Browse files

usb: musb: dsps: polling ID pin status only in otg mode



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: default avatarBin Liu <b-liu@ti.com>
Acked-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent e1d2e319
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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);