diff options
Diffstat (limited to 'arch/arm/mach-omap2/cpuidle34xx.c')
-rw-r--r-- | arch/arm/mach-omap2/cpuidle34xx.c | 52 |
1 files changed, 13 insertions, 39 deletions
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index 80392fca86c6..cca045c95fbf 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/cpuidle.h> | 26 | #include <linux/cpuidle.h> |
27 | #include <linux/export.h> | 27 | #include <linux/export.h> |
28 | #include <linux/cpu_pm.h> | 28 | #include <linux/cpu_pm.h> |
29 | #include <asm/cpuidle.h> | ||
29 | 30 | ||
30 | #include "powerdomain.h" | 31 | #include "powerdomain.h" |
31 | #include "clockdomain.h" | 32 | #include "clockdomain.h" |
@@ -99,11 +100,15 @@ static struct omap3_idle_statedata omap3_idle_data[] = { | |||
99 | }, | 100 | }, |
100 | }; | 101 | }; |
101 | 102 | ||
102 | /* Private functions */ | 103 | /** |
103 | 104 | * omap3_enter_idle - Programs OMAP3 to enter the specified state | |
104 | static int __omap3_enter_idle(struct cpuidle_device *dev, | 105 | * @dev: cpuidle device |
105 | struct cpuidle_driver *drv, | 106 | * @drv: cpuidle driver |
106 | int index) | 107 | * @index: the index of state to be entered |
108 | */ | ||
109 | static int omap3_enter_idle(struct cpuidle_device *dev, | ||
110 | struct cpuidle_driver *drv, | ||
111 | int index) | ||
107 | { | 112 | { |
108 | struct omap3_idle_statedata *cx = &omap3_idle_data[index]; | 113 | struct omap3_idle_statedata *cx = &omap3_idle_data[index]; |
109 | 114 | ||
@@ -149,22 +154,6 @@ return_sleep_time: | |||
149 | } | 154 | } |
150 | 155 | ||
151 | /** | 156 | /** |
152 | * omap3_enter_idle - Programs OMAP3 to enter the specified state | ||
153 | * @dev: cpuidle device | ||
154 | * @drv: cpuidle driver | ||
155 | * @index: the index of state to be entered | ||
156 | * | ||
157 | * Called from the CPUidle framework to program the device to the | ||
158 | * specified target state selected by the governor. | ||
159 | */ | ||
160 | static inline int omap3_enter_idle(struct cpuidle_device *dev, | ||
161 | struct cpuidle_driver *drv, | ||
162 | int index) | ||
163 | { | ||
164 | return cpuidle_wrap_enter(dev, drv, index, __omap3_enter_idle); | ||
165 | } | ||
166 | |||
167 | /** | ||
168 | * next_valid_state - Find next valid C-state | 157 | * next_valid_state - Find next valid C-state |
169 | * @dev: cpuidle device | 158 | * @dev: cpuidle device |
170 | * @drv: cpuidle driver | 159 | * @drv: cpuidle driver |
@@ -271,11 +260,9 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev, | |||
271 | return ret; | 260 | return ret; |
272 | } | 261 | } |
273 | 262 | ||
274 | static DEFINE_PER_CPU(struct cpuidle_device, omap3_idle_dev); | ||
275 | |||
276 | static struct cpuidle_driver omap3_idle_driver = { | 263 | static struct cpuidle_driver omap3_idle_driver = { |
277 | .name = "omap3_idle", | 264 | .name = "omap3_idle", |
278 | .owner = THIS_MODULE, | 265 | .owner = THIS_MODULE, |
279 | .states = { | 266 | .states = { |
280 | { | 267 | { |
281 | .enter = omap3_enter_idle_bm, | 268 | .enter = omap3_enter_idle_bm, |
@@ -348,8 +335,6 @@ static struct cpuidle_driver omap3_idle_driver = { | |||
348 | */ | 335 | */ |
349 | int __init omap3_idle_init(void) | 336 | int __init omap3_idle_init(void) |
350 | { | 337 | { |
351 | struct cpuidle_device *dev; | ||
352 | |||
353 | mpu_pd = pwrdm_lookup("mpu_pwrdm"); | 338 | mpu_pd = pwrdm_lookup("mpu_pwrdm"); |
354 | core_pd = pwrdm_lookup("core_pwrdm"); | 339 | core_pd = pwrdm_lookup("core_pwrdm"); |
355 | per_pd = pwrdm_lookup("per_pwrdm"); | 340 | per_pd = pwrdm_lookup("per_pwrdm"); |
@@ -358,16 +343,5 @@ int __init omap3_idle_init(void) | |||
358 | if (!mpu_pd || !core_pd || !per_pd || !cam_pd) | 343 | if (!mpu_pd || !core_pd || !per_pd || !cam_pd) |
359 | return -ENODEV; | 344 | return -ENODEV; |
360 | 345 | ||
361 | cpuidle_register_driver(&omap3_idle_driver); | 346 | return cpuidle_register(&omap3_idle_driver, NULL); |
362 | |||
363 | dev = &per_cpu(omap3_idle_dev, smp_processor_id()); | ||
364 | dev->cpu = 0; | ||
365 | |||
366 | if (cpuidle_register_device(dev)) { | ||
367 | printk(KERN_ERR "%s: CPUidle register device failed\n", | ||
368 | __func__); | ||
369 | return -EIO; | ||
370 | } | ||
371 | |||
372 | return 0; | ||
373 | } | 347 | } |