151
151
* status change events (from the transceiver) otherwise.
153
153
devctl = musb_readb(mregs, MUSB_DEVCTL);
154
DBG(7, "Poll devctl %02x (%s)\n", devctl, otg_state_string(musb));
154
dev_dbg(musb->controller, "Poll devctl %02x (%s)\n", devctl,
155
otg_state_string(musb->xceiv->state));
156
157
spin_lock_irqsave(&musb->lock, flags);
157
158
switch (musb->xceiv->state) {
202
203
/* Never idle if active, or when VBUS timeout is not set as host */
203
204
if (musb->is_active || (musb->a_wait_bcon == 0 &&
204
205
musb->xceiv->state == OTG_STATE_A_WAIT_BCON)) {
205
DBG(4, "%s active, deleting timer\n", otg_state_string(musb));
206
dev_dbg(musb->controller, "%s active, deleting timer\n",
207
otg_state_string(musb->xceiv->state));
206
208
del_timer(&otg_workaround);
207
209
last_timer = jiffies;
211
213
if (time_after(last_timer, timeout) && timer_pending(&otg_workaround)) {
212
DBG(4, "Longer idle timer already pending, ignoring...\n");
214
dev_dbg(musb->controller, "Longer idle timer already pending, ignoring...\n");
215
217
last_timer = timeout;
217
DBG(4, "%s inactive, starting idle timer for %u ms\n",
218
otg_state_string(musb), jiffies_to_msecs(timeout - jiffies));
219
dev_dbg(musb->controller, "%s inactive, starting idle timer for %u ms\n",
220
otg_state_string(musb->xceiv->state),
221
jiffies_to_msecs(timeout - jiffies));
219
222
mod_timer(&otg_workaround, timeout);
304
307
/* NOTE: this must complete power-on within 100 ms. */
305
DBG(2, "VBUS %s (%s)%s, devctl %02x\n",
308
dev_dbg(musb->controller, "VBUS %s (%s)%s, devctl %02x\n",
306
309
drvvbus ? "on" : "off",
307
otg_state_string(musb),
310
otg_state_string(musb->xceiv->state),
308
311
err ? " ERROR" : "",
310
313
ret = IRQ_HANDLED;