diff options
Diffstat (limited to 'arch/arm/mach-shmobile/cpuidle.c')
-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 21b09b6455e4..7e6559105d40 100644 --- a/arch/arm/mach-shmobile/cpuidle.c +++ b/arch/arm/mach-shmobile/cpuidle.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/suspend.h> | 13 | #include <linux/suspend.h> |
14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
15 | #include <linux/err.h> | 15 | #include <linux/err.h> |
16 | #include <asm/cpuidle.h> | ||
16 | #include <asm/io.h> | 17 | #include <asm/io.h> |
17 | 18 | ||
18 | static void shmobile_enter_wfi(void) | 19 | static void shmobile_enter_wfi(void) |
@@ -28,37 +29,19 @@ static int shmobile_cpuidle_enter(struct cpuidle_device *dev, | |||
28 | struct cpuidle_driver *drv, | 29 | struct cpuidle_driver *drv, |
29 | int index) | 30 | int index) |
30 | { | 31 | { |
31 | ktime_t before, after; | ||
32 | |||
33 | before = ktime_get(); | ||
34 | |||
35 | local_irq_disable(); | ||
36 | local_fiq_disable(); | ||
37 | |||
38 | shmobile_cpuidle_modes[index](); | 32 | shmobile_cpuidle_modes[index](); |
39 | 33 | ||
40 | local_irq_enable(); | ||
41 | local_fiq_enable(); | ||
42 | |||
43 | after = ktime_get(); | ||
44 | dev->last_residency = ktime_to_ns(ktime_sub(after, before)) >> 10; | ||
45 | |||
46 | return index; | 34 | return index; |
47 | } | 35 | } |
48 | 36 | ||
49 | static struct cpuidle_device shmobile_cpuidle_dev; | 37 | static struct cpuidle_device shmobile_cpuidle_dev; |
50 | static struct cpuidle_driver shmobile_cpuidle_driver = { | 38 | static struct cpuidle_driver shmobile_cpuidle_driver = { |
51 | .name = "shmobile_cpuidle", | 39 | .name = "shmobile_cpuidle", |
52 | .owner = THIS_MODULE, | 40 | .owner = THIS_MODULE, |
53 | .states[0] = { | 41 | .en_core_tk_irqen = 1, |
54 | .name = "C1", | 42 | .states[0] = ARM_CPUIDLE_WFI_STATE, |
55 | .desc = "WFI", | 43 | .safe_state_index = 0, /* C1 */ |
56 | .exit_latency = 1, | 44 | .state_count = 1, |
57 | .target_residency = 1 * 2, | ||
58 | .flags = CPUIDLE_FLAG_TIME_VALID, | ||
59 | }, | ||
60 | .safe_state_index = 0, /* C1 */ | ||
61 | .state_count = 1, | ||
62 | }; | 45 | }; |
63 | 46 | ||
64 | void (*shmobile_cpuidle_setup)(struct cpuidle_driver *drv); | 47 | void (*shmobile_cpuidle_setup)(struct cpuidle_driver *drv); |