diff mbox

[PATCHv3,18/22] OMAP3: PM: Optional reset of voltage during Smartreflex disable.

Message ID 1271408597-3066-19-git-send-email-thara@ti.com (mailing list archive)
State Superseded
Delegated to: Kevin Hilman
Headers show

Commit Message

Thara Gopinath April 16, 2010, 9:03 a.m. UTC
None
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index f3994c0..f6c1df3 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -415,9 +415,9 @@  void omap_sram_idle(void)
 	 * Only needed if we are going to enter retention or off.
 	 */
 	if (mpu_next_state <= PWRDM_POWER_RET)
-		omap_smartreflex_disable(VDD1);
+		omap_smartreflex_disable(VDD1, 1);
 	if (core_next_state <= PWRDM_POWER_RET)
-		omap_smartreflex_disable(VDD2);
+		omap_smartreflex_disable(VDD2, 1);
 
 	/* CORE */
 	if (core_next_state < PWRDM_POWER_ON) {
diff --git a/arch/arm/mach-omap2/smartreflex-class3.c b/arch/arm/mach-omap2/smartreflex-class3.c
index 53bfd05..f1d6027 100644
--- a/arch/arm/mach-omap2/smartreflex-class3.c
+++ b/arch/arm/mach-omap2/smartreflex-class3.c
@@ -30,11 +30,12 @@  static int sr_class3_enable(int id)
 	return sr_enable(id, volt);
 }
 
-static int sr_class3_disable(int id)
+static int sr_class3_disable(int id, int is_volt_reset)
 {
 	omap_voltageprocessor_disable(id);
 	sr_disable(id);
-	omap_reset_voltage(id);
+	if (is_volt_reset)
+		omap_reset_voltage(id);
 
 	return true;
 }
diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
index eed7f9b..6b7d9aa 100644
--- a/arch/arm/mach-omap2/smartreflex.c
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -226,7 +226,7 @@  static void  sr_stop_vddautocomp(struct omap_sr *sr)
 	}
 
 	if (sr->is_autocomp_active == 1) {
-		sr_class->disable(sr->srid);
+		sr_class->disable(sr->srid, 1);
 		sr_clk_disable(sr);
 		sr->is_autocomp_active = 0;
 	}
@@ -506,12 +506,16 @@  void omap_smartreflex_enable(int srid)
  * omap_smartreflex_disable : API to disable SR clocks and to call into the
  * registered smartreflex class disable API.
  * @srid - The id of the sr module to be disabled.
+ * @is_volt_reset - Whether the voltage needs to be reset after disabling
+ *		    smartreflex module or not. This parameter is directly
+ *		    passed on to the smartreflex class disable which takes the
+ *		    appropriate action.
  *
  * This API is to be called from the kernel in order to disable
  * a particular smartreflex module. This API will in turn call
  * into the registered smartreflex class disable API.
  */
-void omap_smartreflex_disable(int srid)
+void omap_smartreflex_disable(int srid, int is_volt_reset)
 {
 	struct omap_sr *sr = _sr_lookup(srid);
 
@@ -528,7 +532,7 @@  void omap_smartreflex_disable(int srid)
 
 	if (sr->is_autocomp_active == 1) {
 		if (sr->is_sr_reset == 0) {
-			sr_class->disable(srid);
+			sr_class->disable(srid, is_volt_reset);
 			/* Disable SR clk */
 			sr_clk_disable(sr);
 		}
diff --git a/arch/arm/mach-omap2/smartreflex.h b/arch/arm/mach-omap2/smartreflex.h
index 9cc3204..476a3b6 100644
--- a/arch/arm/mach-omap2/smartreflex.h
+++ b/arch/arm/mach-omap2/smartreflex.h
@@ -180,7 +180,7 @@  struct omap_smartreflex_dev_data {
  */
 struct omap_smartreflex_class_data {
 	int (*enable)(int sr_id);
-	int (*disable)(int sr_id);
+	int (*disable)(int sr_id, int is_volt_reset);
 	void (*configure)(int sr_id);
 	int (*notify)(int sr_id, u32 status);
 	u8 notify_flags;
@@ -216,7 +216,7 @@  struct omap_smartreflex_data {
  * do anything.
  */
 void omap_smartreflex_enable(int srid);
-void omap_smartreflex_disable(int srid);
+void omap_smartreflex_disable(int srid, int is_volt_reset);
 
 /*
  * Smartreflex driver hooks to be called from Smartreflex class driver