[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-3.0 / pm-wip / voltdm / 0011-OMAP3-SR-enable-disable-SR-only-on-need.patch
1 From f77889fb5747c6fd6e4f1431641d603565adfc2d Mon Sep 17 00:00:00 2001
2 From: Nishanth Menon <nm@ti.com>
3 Date: Mon, 14 Feb 2011 21:14:17 +0530
4 Subject: [PATCH 011/149] OMAP3+: SR: enable/disable SR only on need
6 Since we already know the state of the autocomp enablement, we can
7 see if the requested state is different from the current state and
8 enable/disable SR only on the need basis.
10 Signed-off-by: Nishanth Menon <nm@ti.com>
11 Signed-off-by: Kevin Hilman <khilman@ti.com>
12 ---
13 arch/arm/mach-omap2/smartreflex.c | 11 +++++++----
14 1 files changed, 7 insertions(+), 4 deletions(-)
16 diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
17 index 616ef62..3bd9fac 100644
18 --- a/arch/arm/mach-omap2/smartreflex.c
19 +++ b/arch/arm/mach-omap2/smartreflex.c
20 @@ -807,10 +807,13 @@ static int omap_sr_autocomp_store(void *data, u64 val)
21 return -EINVAL;
22 }
24 - if (!val)
25 - sr_stop_vddautocomp(sr_info);
26 - else
27 - sr_start_vddautocomp(sr_info);
28 + /* control enable/disable only if there is a delta in value */
29 + if (sr_info->autocomp_active != val) {
30 + if (!val)
31 + sr_stop_vddautocomp(sr_info);
32 + else
33 + sr_start_vddautocomp(sr_info);
34 + }
36 return 0;
37 }
38 --
39 1.6.6.1