switch (musb->xceiv.state) {
case OTG_STATE_A_WAIT_BCON:
- case OTG_STATE_A_WAIT_VRISE:
- case OTG_STATE_A_IDLE:
if ((musb->a_wait_bcon != 0)
&& (musb->idle_timeout == 0
|| time_after(jiffies, musb->idle_timeout))) {
DBG(4, "Nothing connected %s, turning off VBUS\n",
otg_state_string(musb));
- tusb_source_power(musb, 0);
- musb->xceiv.state = OTG_STATE_A_WAIT_VFALL;
- musb->is_active = 0;
}
- break;
+ /* FALLTHROUGH */
+ case OTG_STATE_A_IDLE:
+ tusb_source_power(musb, 0);
default:
break;
}
if (is_on) {
if (musb->set_clock)
musb->set_clock(musb->clock, 1);
- musb->is_active = 1;
timer = OTG_TIMER_MS(OTG_TIME_A_WAIT_VRISE);
musb->xceiv.default_a = 1;
musb->xceiv.state = OTG_STATE_A_WAIT_VRISE;
otg_stat = musb_readl(tbase, TUSB_DEV_OTG_STAT);
if (!(otg_stat & TUSB_DEV_OTG_STAT_ID_STATUS)) {
switch (musb->xceiv.state) {
- case OTG_STATE_A_WAIT_VFALL:
- break;
case OTG_STATE_A_WAIT_VRISE:
+ case OTG_STATE_A_WAIT_BCON:
musb->xceiv.state = OTG_STATE_A_WAIT_VFALL;
break;
+ case OTG_STATE_A_WAIT_VFALL:
+ musb->xceiv.state = OTG_STATE_A_IDLE;
+ break;
default:
musb->xceiv.state = OTG_STATE_A_IDLE;
}
break;
}
}
+ schedule_work(&musb->irq_work);
return idle_timeout;
}