From f16bdc72dc139e4413e75ef5b91690e9ad8e1b05 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Mon, 18 Sep 2006 10:08:08 +0300 Subject: [PATCH] MUSB: TUSB peripheral connection bugfix 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 --- drivers/usb/musb/plat_uds.c | 2 ++ drivers/usb/musb/tusb6010.c | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/usb/musb/plat_uds.c b/drivers/usb/musb/plat_uds.c index 93bfa0bb105..8abdd6d2c45 100644 --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -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; diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index f436e5332ce..1481780d4a2 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c @@ -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", -- 2.41.1