diff options
Diffstat (limited to 'arch/arm/mach-exynos/cpuidle.c')
-rw-r--r-- | arch/arm/mach-exynos/cpuidle.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c index bf7e96f2793a..35f6502144ae 100644 --- a/arch/arm/mach-exynos/cpuidle.c +++ b/arch/arm/mach-exynos/cpuidle.c | |||
@@ -16,7 +16,8 @@ | |||
16 | #include <asm/proc-fns.h> | 16 | #include <asm/proc-fns.h> |
17 | 17 | ||
18 | static int exynos4_enter_idle(struct cpuidle_device *dev, | 18 | static int exynos4_enter_idle(struct cpuidle_device *dev, |
19 | struct cpuidle_state *state); | 19 | struct cpuidle_driver *drv, |
20 | int index); | ||
20 | 21 | ||
21 | static struct cpuidle_state exynos4_cpuidle_set[] = { | 22 | static struct cpuidle_state exynos4_cpuidle_set[] = { |
22 | [0] = { | 23 | [0] = { |
@@ -37,7 +38,8 @@ static struct cpuidle_driver exynos4_idle_driver = { | |||
37 | }; | 38 | }; |
38 | 39 | ||
39 | static int exynos4_enter_idle(struct cpuidle_device *dev, | 40 | static int exynos4_enter_idle(struct cpuidle_device *dev, |
40 | struct cpuidle_state *state) | 41 | struct cpuidle_driver *drv, |
42 | int index) | ||
41 | { | 43 | { |
42 | struct timeval before, after; | 44 | struct timeval before, after; |
43 | int idle_time; | 45 | int idle_time; |
@@ -52,29 +54,31 @@ static int exynos4_enter_idle(struct cpuidle_device *dev, | |||
52 | idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC + | 54 | idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC + |
53 | (after.tv_usec - before.tv_usec); | 55 | (after.tv_usec - before.tv_usec); |
54 | 56 | ||
55 | return idle_time; | 57 | dev->last_residency = idle_time; |
58 | return index; | ||
56 | } | 59 | } |
57 | 60 | ||
58 | static int __init exynos4_init_cpuidle(void) | 61 | static int __init exynos4_init_cpuidle(void) |
59 | { | 62 | { |
60 | int i, max_cpuidle_state, cpu_id; | 63 | int i, max_cpuidle_state, cpu_id; |
61 | struct cpuidle_device *device; | 64 | struct cpuidle_device *device; |
62 | 65 | struct cpuidle_driver *drv = &exynos4_idle_driver; | |
66 | |||
67 | /* Setup cpuidle driver */ | ||
68 | drv->state_count = (sizeof(exynos4_cpuidle_set) / | ||
69 | sizeof(struct cpuidle_state)); | ||
70 | max_cpuidle_state = drv->state_count; | ||
71 | for (i = 0; i < max_cpuidle_state; i++) { | ||
72 | memcpy(&drv->states[i], &exynos4_cpuidle_set[i], | ||
73 | sizeof(struct cpuidle_state)); | ||
74 | } | ||
63 | cpuidle_register_driver(&exynos4_idle_driver); | 75 | cpuidle_register_driver(&exynos4_idle_driver); |
64 | 76 | ||
65 | for_each_cpu(cpu_id, cpu_online_mask) { | 77 | for_each_cpu(cpu_id, cpu_online_mask) { |
66 | device = &per_cpu(exynos4_cpuidle_device, cpu_id); | 78 | device = &per_cpu(exynos4_cpuidle_device, cpu_id); |
67 | device->cpu = cpu_id; | 79 | device->cpu = cpu_id; |
68 | 80 | ||
69 | device->state_count = (sizeof(exynos4_cpuidle_set) / | 81 | device->state_count = drv->state_count; |
70 | sizeof(struct cpuidle_state)); | ||
71 | |||
72 | max_cpuidle_state = device->state_count; | ||
73 | |||
74 | for (i = 0; i < max_cpuidle_state; i++) { | ||
75 | memcpy(&device->states[i], &exynos4_cpuidle_set[i], | ||
76 | sizeof(struct cpuidle_state)); | ||
77 | } | ||
78 | 82 | ||
79 | if (cpuidle_register_device(device)) { | 83 | if (cpuidle_register_device(device)) { |
80 | printk(KERN_ERR "CPUidle register device failed\n,"); | 84 | printk(KERN_ERR "CPUidle register device failed\n,"); |