diff options
author | Joseph Lo <josephl@nvidia.com> | 2012-10-08 06:24:16 -0400 |
---|---|---|
committer | Stephen Warren <swarren@nvidia.com> | 2012-11-15 17:08:28 -0500 |
commit | d5db9a44229058ddfe4773aaefa5a465344d7b10 (patch) | |
tree | 48a1cf4fad52f89dc3383dc4ecbf9e7751de6024 /arch/arm/mach-tegra/cpuidle.c | |
parent | d1d3b978f67c2c000f9d91387cffa630e738d529 (diff) |
ARM: tegra: cpuidle: replace LP3 with ARM_CPUIDLE_WFI_STATE
The Tegra CPU idle LP3 state is doing ARM WFI only. So it's same with
the common ARM_CPUIDLE_WFI_STATE. Using it to replace LP3 now.
Signed-off-by: Joseph Lo <josephl@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
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; |