diff mbox

[3/5] OMAP: hwmod: add option for no locking in idle/enable paths

Message ID 1274994816-30335-4-git-send-email-khilman@deeprootsystems.com (mailing list archive)
State Superseded
Delegated to: Kevin Hilman
Headers show

Commit Message

Kevin Hilman May 27, 2010, 9:13 p.m. UTC
None
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 77fef90..1ee2fb2 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1304,9 +1304,13 @@  int omap_hwmod_enable(struct omap_hwmod *oh)
 	if (!oh)
 		return -EINVAL;
 
-	mutex_lock(&omap_hwmod_mutex);
+	if (!(oh->flags & HWMOD_NO_IDLE_LOCKING))
+		mutex_lock(&omap_hwmod_mutex);
+
 	r = _enable(oh);
-	mutex_unlock(&omap_hwmod_mutex);
+
+	if (!(oh->flags & HWMOD_NO_IDLE_LOCKING))
+		mutex_unlock(&omap_hwmod_mutex);
 
 	return r;
 }
@@ -1323,9 +1327,13 @@  int omap_hwmod_idle(struct omap_hwmod *oh)
 	if (!oh)
 		return -EINVAL;
 
-	mutex_lock(&omap_hwmod_mutex);
+	if (!(oh->flags & HWMOD_NO_IDLE_LOCKING))
+		mutex_lock(&omap_hwmod_mutex);
+
 	_idle(oh);
-	mutex_unlock(&omap_hwmod_mutex);
+
+	if (!(oh->flags & HWMOD_NO_IDLE_LOCKING))
+		mutex_unlock(&omap_hwmod_mutex);
 
 	return 0;
 }
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 0eccc09..cc3f9a7 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -360,6 +360,7 @@  struct omap_hwmod_omap4_prcm {
 #define HWMOD_NO_OCP_AUTOIDLE			(1 << 4)
 #define HWMOD_SET_DEFAULT_CLOCKACT		(1 << 5)
 #define HWMOD_NO_IDLEST				(1 << 6)
+#define HWMOD_NO_IDLE_LOCKING       (1 << 7)
 
 /*
  * omap_hwmod._int_flags definitions