diff options
Diffstat (limited to 'arch/arm/mach-tegra/cpuidle.c')
-rw-r--r-- | arch/arm/mach-tegra/cpuidle.c | 42 |
1 files changed, 3 insertions, 39 deletions
diff --git a/arch/arm/mach-tegra/cpuidle.c b/arch/arm/mach-tegra/cpuidle.c index 9a6f051b382e..4e0b07c7963c 100644 --- a/arch/arm/mach-tegra/cpuidle.c +++ b/arch/arm/mach-tegra/cpuidle.c | |||
@@ -23,58 +23,22 @@ | |||
23 | 23 | ||
24 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
26 | #include <linux/cpu.h> | ||
27 | #include <linux/cpuidle.h> | 26 | #include <linux/cpuidle.h> |
28 | #include <linux/hrtimer.h> | ||
29 | 27 | ||
30 | #include <asm/proc-fns.h> | 28 | #include <asm/cpuidle.h> |
31 | |||
32 | static int tegra_idle_enter_lp3(struct cpuidle_device *dev, | ||
33 | struct cpuidle_driver *drv, int index); | ||
34 | 29 | ||
35 | struct cpuidle_driver tegra_idle_driver = { | 30 | struct cpuidle_driver tegra_idle_driver = { |
36 | .name = "tegra_idle", | 31 | .name = "tegra_idle", |
37 | .owner = THIS_MODULE, | 32 | .owner = THIS_MODULE, |
33 | .en_core_tk_irqen = 1, | ||
38 | .state_count = 1, | 34 | .state_count = 1, |
39 | .states = { | 35 | .states = { |
40 | [0] = { | 36 | [0] = ARM_CPUIDLE_WFI_STATE_PWR(600), |
41 | .enter = tegra_idle_enter_lp3, | ||
42 | .exit_latency = 10, | ||
43 | .target_residency = 10, | ||
44 | .power_usage = 600, | ||
45 | .flags = CPUIDLE_FLAG_TIME_VALID, | ||
46 | .name = "LP3", | ||
47 | .desc = "CPU flow-controlled", | ||
48 | }, | ||
49 | }, | 37 | }, |
50 | }; | 38 | }; |
51 | 39 | ||
52 | static DEFINE_PER_CPU(struct cpuidle_device, tegra_idle_device); | 40 | static DEFINE_PER_CPU(struct cpuidle_device, tegra_idle_device); |
53 | 41 | ||
54 | static int tegra_idle_enter_lp3(struct cpuidle_device *dev, | ||
55 | struct cpuidle_driver *drv, int index) | ||
56 | { | ||
57 | ktime_t enter, exit; | ||
58 | s64 us; | ||
59 | |||
60 | local_irq_disable(); | ||
61 | local_fiq_disable(); | ||
62 | |||
63 | enter = ktime_get(); | ||
64 | |||
65 | cpu_do_idle(); | ||
66 | |||
67 | exit = ktime_sub(ktime_get(), enter); | ||
68 | us = ktime_to_us(exit); | ||
69 | |||
70 | local_fiq_enable(); | ||
71 | local_irq_enable(); | ||
72 | |||
73 | dev->last_residency = us; | ||
74 | |||
75 | return index; | ||
76 | } | ||
77 | |||
78 | static int __init tegra_cpuidle_init(void) | 42 | static int __init tegra_cpuidle_init(void) |
79 | { | 43 | { |
80 | int ret; | 44 | int ret; |