diff options
Diffstat (limited to 'arch/arm/mach-kirkwood/cpuidle.c')
-rw-r--r-- | arch/arm/mach-kirkwood/cpuidle.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/arch/arm/mach-kirkwood/cpuidle.c b/arch/arm/mach-kirkwood/cpuidle.c index 358dd80b3a07..ffd690dc3d33 100644 --- a/arch/arm/mach-kirkwood/cpuidle.c +++ b/arch/arm/mach-kirkwood/cpuidle.c | |||
@@ -32,6 +32,7 @@ static DEFINE_PER_CPU(struct cpuidle_device, kirkwood_cpuidle_device); | |||
32 | 32 | ||
33 | /* Actual code that puts the SoC in different idle states */ | 33 | /* Actual code that puts the SoC in different idle states */ |
34 | static int kirkwood_enter_idle(struct cpuidle_device *dev, | 34 | static int kirkwood_enter_idle(struct cpuidle_device *dev, |
35 | struct cpuidle_driver *drv, | ||
35 | int index) | 36 | int index) |
36 | { | 37 | { |
37 | struct timeval before, after; | 38 | struct timeval before, after; |
@@ -68,28 +69,29 @@ static int kirkwood_enter_idle(struct cpuidle_device *dev, | |||
68 | static int kirkwood_init_cpuidle(void) | 69 | static int kirkwood_init_cpuidle(void) |
69 | { | 70 | { |
70 | struct cpuidle_device *device; | 71 | struct cpuidle_device *device; |
71 | 72 | struct cpuidle_driver *driver = &kirkwood_idle_driver; | |
72 | cpuidle_register_driver(&kirkwood_idle_driver); | ||
73 | 73 | ||
74 | device = &per_cpu(kirkwood_cpuidle_device, smp_processor_id()); | 74 | device = &per_cpu(kirkwood_cpuidle_device, smp_processor_id()); |
75 | device->state_count = KIRKWOOD_MAX_STATES; | 75 | device->state_count = KIRKWOOD_MAX_STATES; |
76 | driver->state_count = KIRKWOOD_MAX_STATES; | ||
76 | 77 | ||
77 | /* Wait for interrupt state */ | 78 | /* Wait for interrupt state */ |
78 | device->states[0].enter = kirkwood_enter_idle; | 79 | driver->states[0].enter = kirkwood_enter_idle; |
79 | device->states[0].exit_latency = 1; | 80 | driver->states[0].exit_latency = 1; |
80 | device->states[0].target_residency = 10000; | 81 | driver->states[0].target_residency = 10000; |
81 | device->states[0].flags = CPUIDLE_FLAG_TIME_VALID; | 82 | driver->states[0].flags = CPUIDLE_FLAG_TIME_VALID; |
82 | strcpy(device->states[0].name, "WFI"); | 83 | strcpy(driver->states[0].name, "WFI"); |
83 | strcpy(device->states[0].desc, "Wait for interrupt"); | 84 | strcpy(driver->states[0].desc, "Wait for interrupt"); |
84 | 85 | ||
85 | /* Wait for interrupt and DDR self refresh state */ | 86 | /* Wait for interrupt and DDR self refresh state */ |
86 | device->states[1].enter = kirkwood_enter_idle; | 87 | driver->states[1].enter = kirkwood_enter_idle; |
87 | device->states[1].exit_latency = 10; | 88 | driver->states[1].exit_latency = 10; |
88 | device->states[1].target_residency = 10000; | 89 | driver->states[1].target_residency = 10000; |
89 | device->states[1].flags = CPUIDLE_FLAG_TIME_VALID; | 90 | driver->states[1].flags = CPUIDLE_FLAG_TIME_VALID; |
90 | strcpy(device->states[1].name, "DDR SR"); | 91 | strcpy(driver->states[1].name, "DDR SR"); |
91 | strcpy(device->states[1].desc, "WFI and DDR Self Refresh"); | 92 | strcpy(driver->states[1].desc, "WFI and DDR Self Refresh"); |
92 | 93 | ||
94 | cpuidle_register_driver(&kirkwood_idle_driver); | ||
93 | if (cpuidle_register_device(device)) { | 95 | if (cpuidle_register_device(device)) { |
94 | printk(KERN_ERR "kirkwood_init_cpuidle: Failed registering\n"); | 96 | printk(KERN_ERR "kirkwood_init_cpuidle: Failed registering\n"); |
95 | return -EIO; | 97 | return -EIO; |