diff mbox

OMAP: hwmod: Set autoidle after smartidle during _sysc_enable

Message ID 1285300039-6384-1-git-send-email-hemahk@ti.com (mailing list archive)
State Accepted, archived
Delegated to: Paul Walmsley
Headers show

Commit Message

Kalliguddi, Hema Sept. 24, 2010, 3:47 a.m. UTC
None
diff mbox

Patch

Index: linux-omap-pm/arch/arm/mach-omap2/omap_hwmod.c
===================================================================
--- linux-omap-pm.orig/arch/arm/mach-omap2/omap_hwmod.c
+++ linux-omap-pm/arch/arm/mach-omap2/omap_hwmod.c
@@ -654,12 +654,6 @@  static void _sysc_enable(struct omap_hwm
 		_set_master_standbymode(oh, idlemode, &v);
 	}
 
-	if (sf & SYSC_HAS_AUTOIDLE) {
-		idlemode = (oh->flags & HWMOD_NO_OCP_AUTOIDLE) ?
-			0 : 1;
-		_set_module_autoidle(oh, idlemode, &v);
-	}
-
 	/* XXX OCP ENAWAKEUP bit? */
 
 	/*
@@ -672,6 +666,18 @@  static void _sysc_enable(struct omap_hwm
 		_set_clockactivity(oh, oh->class->sysc->clockact, &v);
 
 	_write_sysconfig(v, oh);
+
+	/*
+	 * Set the autoidle bit only after setting the smartidle bit
+	 * as this is requirement for some modules like USBOTG.
+	 * Setting this will not have any impact on the other modules.
+	 */
+	if (sf & SYSC_HAS_AUTOIDLE) {
+		idlemode = (oh->flags & HWMOD_NO_OCP_AUTOIDLE) ?
+			0 : 1;
+		_set_module_autoidle(oh, idlemode, &v);
+		_write_sysconfig(v, oh);
+	}
 }
 
 /**