summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2/usb-musb.c
diff options
context:
space:
mode:
authorPeter 'p2' De Schrijver <peter.de-schrijver@nokia.com>2009-01-19 19:09:22 +0200
committerKevin Hilman <khilman@deeprootsystems.com>2009-05-28 10:59:09 -0700
commit94a3ef6f2888ae995a8d112e277ed8465a9457fb (patch)
treee5ffaac8e9da9200faeae481f052b06e41ae8b99 /arch/arm/mach-omap2/usb-musb.c
parent01cbd4d11558e2e4c10f14bb8aecd799b22bca35 (diff)
OMAP3: PM: Ensure MUSB block can idle when driver not loaded
Otherwise, bootloaders may leave MUSB in a state which prevents retention. Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-omap2/usb-musb.c')
-rw-r--r--arch/arm/mach-omap2/usb-musb.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index 215d463b70e3..d85296dc896c 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -31,6 +31,17 @@
#include <mach/mux.h>
#include <mach/usb.h>
+#define OTG_SYSCONFIG (OMAP34XX_HSUSB_OTG_BASE + 0x404)
+
+static void __init usb_musb_pm_init(void)
+{
+ /* Ensure force-idle mode for OTG controller */
+ if (cpu_is_omap34xx())
+ omap_writel(0, OTG_SYSCONFIG);
+}
+
+#ifdef CONFIG_USB_MUSB_SOC
+
static struct resource musb_resources[] = {
[0] = { /* start and end set dynamically */
.flags = IORESOURCE_MEM,
@@ -183,4 +194,13 @@ void __init usb_musb_init(void)
printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n");
return;
}
+
+ usb_musb_pm_init();
+}
+
+#else
+void __init usb_musb_init(void)
+{
+ usb_musb_pm_init();
}
+#endif /* CONFIG_USB_MUSB_SOC */