@@ -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) {
@@ -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;
}
@@ -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);
}
@@ -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