]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
USB: MUSB: Better sysconf reg settings on PM point of view
authorFelipe Balbi <felipe.balbi@nokia.com>
Tue, 29 Apr 2008 11:05:51 +0000 (14:05 +0300)
committerTony Lindgren <tony@atomide.com>
Fri, 2 May 2008 22:57:07 +0000 (15:57 -0700)
The following patch is needed because usb is preventing core
powerdomain to enter sleep state.

Thanks to Jouni Högander for pointing this

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Jouni Högander <jouni.hogander@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/usb/musb/omap2430.c

index e092393c1596e2f8307480a2c206ae85a0f5788c..36f17397d80ebf96ea9a673e600bdb60e504e578 100644 (file)
@@ -224,6 +224,14 @@ int __init musb_platform_init(struct musb *musb)
        musb->xceiv = *xceiv;
        musb_platform_resume(musb);
 
+       OTG_SYSCONFIG_REG &= ~ENABLEWAKEUP;     /* disable wakeup */
+       OTG_SYSCONFIG_REG &= ~NOSTDBY;          /* remove possible nostdby */
+       OTG_SYSCONFIG_REG |= SMARTSTDBY;        /* enable smart standby */
+       OTG_SYSCONFIG_REG &= ~AUTOIDLE;         /* disable auto idle */
+       OTG_SYSCONFIG_REG &= ~NOIDLE;           /* remove possible noidle */
+       OTG_SYSCONFIG_REG |= SMARTIDLE;         /* enable smart idle */
+       OTG_SYSCONFIG_REG |= AUTOIDLE;          /* enable auto idle */
+
        OTG_INTERFSEL_REG |= ULPI_12PIN;
 
        pr_debug("HS USB OTG: revision 0x%x, sysconfig 0x%02x, "
@@ -250,12 +258,8 @@ int musb_platform_suspend(struct musb *musb)
                return 0;
 
        /* in any role */
-       OTG_FORCESTDBY_REG &= ~ENABLEFORCE; /* disable MSTANDBY */
-       OTG_SYSCONFIG_REG &= FORCESTDBY;        /* enable force standby */
-       OTG_SYSCONFIG_REG &= ~AUTOIDLE;         /* disable auto idle */
-       OTG_SYSCONFIG_REG |= SMARTIDLE;         /* enable smart idle */
-       OTG_FORCESTDBY_REG |= ENABLEFORCE; /* enable MSTANDBY */
-       OTG_SYSCONFIG_REG |= AUTOIDLE;          /* enable auto idle */
+       OTG_FORCESTDBY_REG |= ENABLEFORCE;      /* enable MSTANDBY */
+       OTG_SYSCONFIG_REG |= ENABLEWAKEUP;      /* enable wakeup */
 
        if (musb->xceiv.set_suspend)
                musb->xceiv.set_suspend(&musb->xceiv, 1);
@@ -281,11 +285,8 @@ int musb_platform_resume(struct musb *musb)
        else
                clk_enable(musb->clock);
 
-       OTG_FORCESTDBY_REG &= ~ENABLEFORCE; /* disable MSTANDBY */
-       OTG_SYSCONFIG_REG |= SMARTSTDBY;        /* enable smart standby */
-       OTG_SYSCONFIG_REG &= ~AUTOIDLE;         /* disable auto idle */
-       OTG_SYSCONFIG_REG |= SMARTIDLE;         /* enable smart idle */
-       OTG_SYSCONFIG_REG |= AUTOIDLE;          /* enable auto idle */
+       OTG_SYSCONFIG_REG &= ~ENABLEWAKEUP;     /* disable wakeup */
+       OTG_FORCESTDBY_REG &= ~ENABLEFORCE;     /* disable MSTANDBY */
 
        return 0;
 }