Merge branch 'ixp4xx-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/chris...
[pandora-kernel.git] / arch / arm / mach-omap2 / usb-musb.c
index 34a56a1..739e59e 100644 (file)
 
 #include <mach/hardware.h>
 #include <mach/irqs.h>
-#include <mach/pm.h>
 #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,
@@ -145,20 +155,6 @@ static struct platform_device musb_device = {
        .resource       = musb_resources,
 };
 
-#ifdef CONFIG_NOP_USB_XCEIV
-static u64 nop_xceiv_dmamask = DMA_BIT_MASK(32);
-
-static struct platform_device nop_xceiv_device = {
-       .name           = "nop_usb_xceiv",
-       .id             = -1,
-       .dev = {
-               .dma_mask               = &nop_xceiv_dmamask,
-               .coherent_dma_mask      = DMA_BIT_MASK(32),
-               .platform_data          = NULL,
-       },
-};
-#endif
-
 void __init usb_musb_init(void)
 {
        if (cpu_is_omap243x())
@@ -173,15 +169,17 @@ void __init usb_musb_init(void)
         */
        musb_plat.clock = "ick";
 
-#ifdef CONFIG_NOP_USB_XCEIV
-       if (platform_device_register(&nop_xceiv_device) < 0) {
-               printk(KERN_ERR "Unable to register NOP-XCEIV device\n");
-               return;
-       }
-#endif
-
        if (platform_device_register(&musb_device) < 0) {
                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 */