diff options
author | Robert Lee <rob.lee@linaro.org> | 2012-03-20 16:22:48 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2012-03-21 02:01:19 -0400 |
commit | ee807dd89c0003a5cc0ec961132cd83542e5c30c (patch) | |
tree | a3f2012ca62452a9ac5679f86e69d408d6ce4b2c /arch/arm | |
parent | d13e9261ac026f90cccac1e6de3978fb18d4af7b (diff) |
ARM: shmobile: Consolidate time keeping and irq enable
Enable core cpuidle timekeeping and irq enabling and remove that
handling from this code.
Signed-off-by: Robert Lee <rob.lee@linaro.org>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Jean Pihet <j-pihet@ti.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-shmobile/cpuidle.c | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/arch/arm/mach-shmobile/cpuidle.c b/arch/arm/mach-shmobile/cpuidle.c index 1b2334277e85..ca23b202b02d 100644 --- a/arch/arm/mach-shmobile/cpuidle.c +++ b/arch/arm/mach-shmobile/cpuidle.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
15 | #include <linux/err.h> | 15 | #include <linux/err.h> |
16 | #include <asm/system.h> | 16 | #include <asm/system.h> |
17 | #include <asm/cpuidle.h> | ||
17 | #include <asm/io.h> | 18 | #include <asm/io.h> |
18 | 19 | ||
19 | static void shmobile_enter_wfi(void) | 20 | static void shmobile_enter_wfi(void) |
@@ -29,37 +30,19 @@ static int shmobile_cpuidle_enter(struct cpuidle_device *dev, | |||
29 | struct cpuidle_driver *drv, | 30 | struct cpuidle_driver *drv, |
30 | int index) | 31 | int index) |
31 | { | 32 | { |
32 | ktime_t before, after; | ||
33 | |||
34 | before = ktime_get(); | ||
35 | |||
36 | local_irq_disable(); | ||
37 | local_fiq_disable(); | ||
38 | |||
39 | shmobile_cpuidle_modes[index](); | 33 | shmobile_cpuidle_modes[index](); |
40 | 34 | ||
41 | local_irq_enable(); | ||
42 | local_fiq_enable(); | ||
43 | |||
44 | after = ktime_get(); | ||
45 | dev->last_residency = ktime_to_ns(ktime_sub(after, before)) >> 10; | ||
46 | |||
47 | return index; | 35 | return index; |
48 | } | 36 | } |
49 | 37 | ||
50 | static struct cpuidle_device shmobile_cpuidle_dev; | 38 | static struct cpuidle_device shmobile_cpuidle_dev; |
51 | static struct cpuidle_driver shmobile_cpuidle_driver = { | 39 | static struct cpuidle_driver shmobile_cpuidle_driver = { |
52 | .name = "shmobile_cpuidle", | 40 | .name = "shmobile_cpuidle", |
53 | .owner = THIS_MODULE, | 41 | .owner = THIS_MODULE, |
54 | .states[0] = { | 42 | .en_core_tk_irqen = 1, |
55 | .name = "C1", | 43 | .states[0] = ARM_CPUIDLE_WFI_STATE, |
56 | .desc = "WFI", | 44 | .safe_state_index = 0, /* C1 */ |
57 | .exit_latency = 1, | 45 | .state_count = 1, |
58 | .target_residency = 1 * 2, | ||
59 | .flags = CPUIDLE_FLAG_TIME_VALID, | ||
60 | }, | ||
61 | .safe_state_index = 0, /* C1 */ | ||
62 | .state_count = 1, | ||
63 | }; | 46 | }; |
64 | 47 | ||
65 | void (*shmobile_cpuidle_setup)(struct cpuidle_driver *drv); | 48 | void (*shmobile_cpuidle_setup)(struct cpuidle_driver *drv); |