@@ -26,18 +26,32 @@
#include <linux/usb/musb.h>
+#include <asm/sizes.h>
+
#include <mach/hardware.h>
#include <mach/irqs.h>
#include <mach/mux.h>
#include <mach/usb.h>
-#define OTG_SYSCONFIG (OMAP34XX_HSUSB_OTG_BASE + 0x404)
+#define OTG_SYSCONFIG 0x404
+#define OTG_SYSC_SOFTRESET BIT(1)
static void __init usb_musb_pm_init(void)
{
- /* Ensure force-idle mode for OTG controller */
- if (cpu_is_omap34xx())
- omap_writel(0, OTG_SYSCONFIG);
+ void __iomem *otg_base;
+
+ if (!cpu_is_omap34xx())
+ return;
+
+ otg_base = ioremap(OMAP34XX_HSUSB_OTG_BASE, SZ_4K);
+ if (WARN_ON(!otg_base))
+ return;
+
+ /* Reset OTG controller. After reset, it will be in
+ * force-idle, force-standby mode. */
+ __raw_writel(OTG_SYSC_SOFTRESET, otg_base + OTG_SYSCONFIG);
+
+ iounmap(otg_base);
}
#ifdef CONFIG_USB_MUSB_SOC