]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
MUSB: TUSB peripheral connection bugfix
authorDavid Brownell <dbrownell@users.sourceforge.net>
Mon, 18 Sep 2006 07:08:08 +0000 (10:08 +0300)
committerTony Lindgren <tony@atomide.com>
Mon, 18 Sep 2006 07:08:08 +0000 (10:08 +0300)
When booting with a USB Mini-B connecting TUSB to a host, the peripheral
will agin notice the connection and let the host enumerate it.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
drivers/usb/musb/plat_uds.c
drivers/usb/musb/tusb6010.c

index 93bfa0bb105af47f835020e40084a3b85060afe1..8abdd6d2c45ba4ca77ccf8f5782c0338a1d31ada 100644 (file)
@@ -693,6 +693,8 @@ void musb_start(struct musb *musb)
                break;
        case MUSB_PERIPHERAL:
                devctl = musb_readb(regs, MGC_O_HDRC_DEVCTL);
+               if ((devctl & MGC_M_DEVCTL_VBUS) == MGC_M_DEVCTL_VBUS)
+                       musb->is_active = 1;
                musb_writeb(regs, MGC_O_HDRC_DEVCTL,
                        devctl & ~MGC_M_DEVCTL_SESSION);
                break;
index f436e5332ce46c83b605d41446ccf5c10580ede0..1481780d4a23b670d50d3ae1b1bf24bc7e7b7fa3 100644 (file)
@@ -613,8 +613,11 @@ void musb_platform_enable(struct musb * musb)
 
        set_irq_type(musb->nIrq, IRQ_TYPE_LEVEL_LOW);
 
-       /* kickstart:  force into the correct OTG state machine */
-       musb_writel(base, TUSB_INT_SRC_SET, TUSB_INT_SRC_ID_STATUS_CHNG);
+       /* maybe force into the Default-A OTG state machine */
+       if (!(musb_readl(base, TUSB_DEV_OTG_STAT)
+                       & TUSB_DEV_OTG_STAT_ID_STATUS))
+               musb_writel(base, TUSB_INT_SRC_SET,
+                               TUSB_INT_SRC_ID_STATUS_CHNG);
 
        if (is_dma_capable() && dma_off)
                printk(KERN_WARNING "%s %s: dma not reactivated\n",