diff options
Diffstat (limited to 'drivers/cpuidle/governors/menu.c')
-rw-r--r-- | drivers/cpuidle/governors/menu.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c index af724e823c8e..bcbe88142135 100644 --- a/drivers/cpuidle/governors/menu.c +++ b/drivers/cpuidle/governors/menu.c | |||
@@ -182,7 +182,7 @@ static inline int performance_multiplier(void) | |||
182 | 182 | ||
183 | static DEFINE_PER_CPU(struct menu_device, menu_devices); | 183 | static DEFINE_PER_CPU(struct menu_device, menu_devices); |
184 | 184 | ||
185 | static void menu_update(struct cpuidle_device *dev); | 185 | static void menu_update(struct cpuidle_driver *drv, struct cpuidle_device *dev); |
186 | 186 | ||
187 | /* This implements DIV_ROUND_CLOSEST but avoids 64 bit division */ | 187 | /* This implements DIV_ROUND_CLOSEST but avoids 64 bit division */ |
188 | static u64 div_round64(u64 dividend, u32 divisor) | 188 | static u64 div_round64(u64 dividend, u32 divisor) |
@@ -228,9 +228,10 @@ static void detect_repeating_patterns(struct menu_device *data) | |||
228 | 228 | ||
229 | /** | 229 | /** |
230 | * menu_select - selects the next idle state to enter | 230 | * menu_select - selects the next idle state to enter |
231 | * @drv: cpuidle driver containing state data | ||
231 | * @dev: the CPU | 232 | * @dev: the CPU |
232 | */ | 233 | */ |
233 | static int menu_select(struct cpuidle_device *dev) | 234 | static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev) |
234 | { | 235 | { |
235 | struct menu_device *data = &__get_cpu_var(menu_devices); | 236 | struct menu_device *data = &__get_cpu_var(menu_devices); |
236 | int latency_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY); | 237 | int latency_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY); |
@@ -240,7 +241,7 @@ static int menu_select(struct cpuidle_device *dev) | |||
240 | struct timespec t; | 241 | struct timespec t; |
241 | 242 | ||
242 | if (data->needs_update) { | 243 | if (data->needs_update) { |
243 | menu_update(dev); | 244 | menu_update(drv, dev); |
244 | data->needs_update = 0; | 245 | data->needs_update = 0; |
245 | } | 246 | } |
246 | 247 | ||
@@ -285,8 +286,8 @@ static int menu_select(struct cpuidle_device *dev) | |||
285 | * Find the idle state with the lowest power while satisfying | 286 | * Find the idle state with the lowest power while satisfying |
286 | * our constraints. | 287 | * our constraints. |
287 | */ | 288 | */ |
288 | for (i = CPUIDLE_DRIVER_STATE_START; i < dev->state_count; i++) { | 289 | for (i = CPUIDLE_DRIVER_STATE_START; i < drv->state_count; i++) { |
289 | struct cpuidle_state *s = &dev->states[i]; | 290 | struct cpuidle_state *s = &drv->states[i]; |
290 | 291 | ||
291 | if (s->target_residency > data->predicted_us) | 292 | if (s->target_residency > data->predicted_us) |
292 | continue; | 293 | continue; |
@@ -323,14 +324,15 @@ static void menu_reflect(struct cpuidle_device *dev, int index) | |||
323 | 324 | ||
324 | /** | 325 | /** |
325 | * menu_update - attempts to guess what happened after entry | 326 | * menu_update - attempts to guess what happened after entry |
327 | * @drv: cpuidle driver containing state data | ||
326 | * @dev: the CPU | 328 | * @dev: the CPU |
327 | */ | 329 | */ |
328 | static void menu_update(struct cpuidle_device *dev) | 330 | static void menu_update(struct cpuidle_driver *drv, struct cpuidle_device *dev) |
329 | { | 331 | { |
330 | struct menu_device *data = &__get_cpu_var(menu_devices); | 332 | struct menu_device *data = &__get_cpu_var(menu_devices); |
331 | int last_idx = data->last_state_idx; | 333 | int last_idx = data->last_state_idx; |
332 | unsigned int last_idle_us = cpuidle_get_last_residency(dev); | 334 | unsigned int last_idle_us = cpuidle_get_last_residency(dev); |
333 | struct cpuidle_state *target = &dev->states[last_idx]; | 335 | struct cpuidle_state *target = &drv->states[last_idx]; |
334 | unsigned int measured_us; | 336 | unsigned int measured_us; |
335 | u64 new_factor; | 337 | u64 new_factor; |
336 | 338 | ||
@@ -384,9 +386,11 @@ static void menu_update(struct cpuidle_device *dev) | |||
384 | 386 | ||
385 | /** | 387 | /** |
386 | * menu_enable_device - scans a CPU's states and does setup | 388 | * menu_enable_device - scans a CPU's states and does setup |
389 | * @drv: cpuidle driver | ||
387 | * @dev: the CPU | 390 | * @dev: the CPU |
388 | */ | 391 | */ |
389 | static int menu_enable_device(struct cpuidle_device *dev) | 392 | static int menu_enable_device(struct cpuidle_driver *drv, |
393 | struct cpuidle_device *dev) | ||
390 | { | 394 | { |
391 | struct menu_device *data = &per_cpu(menu_devices, dev->cpu); | 395 | struct menu_device *data = &per_cpu(menu_devices, dev->cpu); |
392 | 396 | ||