aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-shmobile/cpuidle.c31
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
19static void shmobile_enter_wfi(void) 20static 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
50static struct cpuidle_device shmobile_cpuidle_dev; 38static struct cpuidle_device shmobile_cpuidle_dev;
51static struct cpuidle_driver shmobile_cpuidle_driver = { 39static 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
65void (*shmobile_cpuidle_setup)(struct cpuidle_driver *drv); 48void (*shmobile_cpuidle_setup)(struct cpuidle_driver *drv);