aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoiz Sonasath <m-sonasath@ti.com>2011-11-10 13:46:02 -0600
committerZiyann <jaraidaniel@gmail.com>2014-10-01 12:59:40 +0200
commita28afca1dfea7f62d6675ba03b17d58e33e2630e (patch)
treeddaed918edf7067b139c6d5b76cabe8e31da3172
parent51000fdb4cacc60e96e7a954f1a98ac4c7fdee9c (diff)
downloadkernel_samsung_tuna-a28afca1dfea7f62d6675ba03b17d58e33e2630e.zip
kernel_samsung_tuna-a28afca1dfea7f62d6675ba03b17d58e33e2630e.tar.gz
kernel_samsung_tuna-a28afca1dfea7f62d6675ba03b17d58e33e2630e.tar.bz2
usb: musb: Dont start Host session on probe unless device attached
This patch makes sure that we dont start the Host session unless there is a cold boot scenario and a device(mouse) is attached. Without this patch, the Host session was started by default causing the gadget configuration to be not recognized by the Host machine on cold boot in device mode. Change-Id: Ibe8609a77dcb2c5c7455062a04337e4c123ce8a6 Signed-off-by: Moiz Sonasath <m-sonasath@ti.com> Conflicts: drivers/usb/musb/musb_core.c
-rwxr-xr-x[-rw-r--r--]drivers/usb/musb/musb_core.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index dd5bee2..1141aaa 100644..100755
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -936,15 +936,18 @@ void musb_start(struct musb *musb)
devctl = musb_readb(regs, MUSB_DEVCTL);
devctl &= ~MUSB_DEVCTL_SESSION;
+ /* Detects cold-boot scenario using omap2430_musb_enable() */
+ musb_platform_enable(musb);
+
if (is_otg_enabled(musb)) {
/* session started after:
* (a) ID-grounded irq, host mode;
* (b) vbus present/connect IRQ, peripheral mode;
* (c) peripheral initiates, using SRP
*/
- if ((devctl & MUSB_DEVCTL_VBUS) == MUSB_DEVCTL_VBUS)
+ if (musb->xceiv->last_event == USB_EVENT_VBUS)
musb->is_active = 1;
- else if (musb->xceiv->state == OTG_STATE_A_HOST)
+ else if (musb->xceiv->last_event == USB_EVENT_ID)
devctl |= MUSB_DEVCTL_SESSION;
} else if (is_host_enabled(musb)) {
@@ -952,10 +955,9 @@ void musb_start(struct musb *musb)
devctl |= MUSB_DEVCTL_SESSION;
} else /* peripheral is enabled */ {
- if ((devctl & MUSB_DEVCTL_VBUS) == MUSB_DEVCTL_VBUS)
+ if (musb->xceiv->last_event == USB_EVENT_VBUS)
musb->is_active = 1;
}
- musb_platform_enable(musb);
musb_writeb(regs, MUSB_DEVCTL, devctl);
}