summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/smartreflex.c
diff options
context:
space:
mode:
authorNishanth Menon <nm@ti.com>2011-02-14 16:44:17 +0100
committerKevin Hilman <khilman@ti.com>2011-06-20 23:12:31 +0200
commitac77a6f7a9352d10c4942c24c8fbf61ee54ea196 (patch)
tree5d8787b8564c3ede939bfdd12fb54fba1ea76a8c /arch/arm/mach-omap2/smartreflex.c
parentOMAP3+: SR: disable interrupt by default (diff)
downloadlinux-ac77a6f7a9352d10c4942c24c8fbf61ee54ea196.tar.xz
linux-ac77a6f7a9352d10c4942c24c8fbf61ee54ea196.zip
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>
Diffstat (limited to 'arch/arm/mach-omap2/smartreflex.c')
-rw-r--r--arch/arm/mach-omap2/smartreflex.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
index 616ef62b3fa5..3bd9facd8e0d 100644
--- a/arch/arm/mach-omap2/smartreflex.c
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -807,10 +807,13 @@ static int omap_sr_autocomp_store(void *data, u64 val)
return -EINVAL;
}
- if (!val)
- sr_stop_vddautocomp(sr_info);
- else
- sr_start_vddautocomp(sr_info);
+ /* control enable/disable only if there is a delta in value */
+ if (sr_info->autocomp_active != val) {
+ if (!val)
+ sr_stop_vddautocomp(sr_info);
+ else
+ sr_start_vddautocomp(sr_info);
+ }
return 0;
}