[PATCH 7/12] musb_hdrc: Don't idle as host if VBUS timeout is 0

Tony Lindgren
2007-10-11T17:05:20Z

VBUS must be on all the time in this case.

Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c
index 16eaa48..3008b6d 100644
--- a/drivers/usb/musb/tusb6010.c
+++ b/drivers/usb/musb/tusb6010.c
@@ -482,7 +482,9 @@ void musb_platform_try_idle(struct musb *musb, unsigned long timeout)
if (timeout == 0)
timeout = default_timeout;

- if (musb->is_active) {
+ /* Never idle if active, or when VBUS timeout is not set as host */
+ if (musb->is_active || ((musb->a_wait_bcon == 0)
+ && (musb->xceiv.state == OTG_STATE_A_WAIT_BCON))) {
DBG(4, "%s active, deleting timer\n", otg_state_string(musb));
del_timer(&musb_idle_timer);
last_timer = jiffies;
--
1.5.2.5