OMAP3+: SR: enable/disable SR only on need

Since we already know the state of the autocomp enablement, we can
see if the requested state is different from the current state and
enable/disable SR only on the need basis.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
This commit is contained in:
Nishanth Menon 2011-02-14 21:14:17 +05:30 committed by Kevin Hilman
parent 1279ba5916
commit ac77a6f7a9

View file

@ -807,10 +807,13 @@ static int omap_sr_autocomp_store(void *data, u64 val)
return -EINVAL; return -EINVAL;
} }
if (!val) /* control enable/disable only if there is a delta in value */
sr_stop_vddautocomp(sr_info); if (sr_info->autocomp_active != val) {
else if (!val)
sr_start_vddautocomp(sr_info); sr_stop_vddautocomp(sr_info);
else
sr_start_vddautocomp(sr_info);
}
return 0; return 0;
} }