diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-07 13:13:52 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-07 13:13:52 -0500 |
commit | 3c00303206c3a1ccd86579efdc90bc35f140962e (patch) | |
tree | 66170c84b5ddaeb102aea3530517a26657b6ea29 /arch/arm/mach-exynos | |
parent | 83dbb15e9cd78a3619e3db36777e2f81d09b2914 (diff) | |
parent | efb90582c575084723cc14302c1300cb26c7e01f (diff) |
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux:
cpuidle: Single/Global registration of idle states
cpuidle: Split cpuidle_state structure and move per-cpu statistics fields
cpuidle: Remove CPUIDLE_FLAG_IGNORE and dev->prepare()
cpuidle: Move dev->last_residency update to driver enter routine; remove dev->last_state
ACPI: Fix CONFIG_ACPI_DOCK=n compiler warning
ACPI: Export FADT pm_profile integer value to userspace
thermal: Prevent polling from happening during system suspend
ACPI: Drop ACPI_NO_HARDWARE_INIT
ACPI atomicio: Convert width in bits to bytes in __acpi_ioremap_fast()
PNPACPI: Simplify disabled resource registration
ACPI: Fix possible recursive locking in hwregs.c
ACPI: use kstrdup()
mrst pmu: update comment
tools/power turbostat: less verbose debugging
Diffstat (limited to 'arch/arm/mach-exynos')
-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,"); |