From: Ajay Kumar Gupta Date: Tue, 24 Feb 2009 23:29:04 +0000 (-0800) Subject: USB: musb: only turn off vbus in OTG hosts X-Git-Tag: Ubuntu-snapdragon-4.4.0-1050.54~27336^2~31 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=743821717c611913a5a3f95010b141f0b4cb5463;p=mirror_ubuntu-artful-kernel.git USB: musb: only turn off vbus in OTG hosts Except on DaVinci, VBUS is now switched off as part of idling the USB link (after a_wait_bcon) whenever a device is disconnected from host. This is correct for OTG hosts, where either SRP or an ID interrupt could turn VBUS on again. However, for non-OTG hosts there's no way to turn VBUS on again, so the host becomes unusable. And the procfs entry which once allowed a manual workaround for this is now gone. This patch adds an is_otg_enabled() check before scheduling the switch-off timer in disconnect path, supporting a "classic host" mode where SRP is unavailable. [ dbrownell@users.sourceforge.net: tweak patch description ] Signed-off-by: Ajay Kumar Gupta Signed-off-by: David Brownell Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index af77e4659006..338cd1611ab3 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -769,7 +769,7 @@ static irqreturn_t musb_stage2_irq(struct musb *musb, u8 int_usb, case OTG_STATE_A_SUSPEND: usb_hcd_resume_root_hub(musb_to_hcd(musb)); musb_root_disconnect(musb); - if (musb->a_wait_bcon != 0) + if (musb->a_wait_bcon != 0 && is_otg_enabled(musb)) musb_platform_try_idle(musb, jiffies + msecs_to_jiffies(musb->a_wait_bcon)); break;