[PATCH] OMAP3: PM: Force USB to standby if not used

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Tero Kristo <tero.kristo@xxxxxxxxx>

This patch will allow device to enter sleep mode while a USB cable is
connected and USB is either disabled or built as a module from kernel
config.

Applies on top of PM branch.

Signed-off-by: Tero Kristo <tero.kristo@xxxxxxxxx>
---
 arch/arm/mach-omap2/usb-musb.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index 12a9b0a..dd51d2f 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -32,7 +32,9 @@
 #include <mach/usb.h>
 
 #define AUTOIDLE        (1 << 0)
+#define FORCESTDBY	(1 << 0)
 #define OTG_SYSCONFIG	(OMAP34XX_HSUSB_OTG_BASE + 0x404)
+#define OTG_FORCESTDBY	(OMAP34XX_HSUSB_OTG_BASE + 0x414)
 
 static struct resource musb_resources[] = {
 	[0] = { /* start and end set dynamically */
@@ -185,7 +187,11 @@ void __init usb_musb_init(void)
 		return;
 	}
 
-	/* Enable smartidle on MUSB to improve C1 wakeup latency */
-	if (cpu_is_omap34xx())
+#if !defined(CONFIG_USB) || defined(CONFIG_USB_MODULE)
+	/* Force MUSB to standby if not used */
+	if (cpu_is_omap34xx()) {
 		omap_writel(AUTOIDLE, OTG_SYSCONFIG);
+		omap_writel(FORCESTDBY, OTG_FORCESTDBY);
+	}
+#endif
 }
-- 
1.5.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux