diff options
Diffstat (limited to 'drivers/cpufreq/pxa2xx-cpufreq.c')
-rw-r--r-- | drivers/cpufreq/pxa2xx-cpufreq.c | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/drivers/cpufreq/pxa2xx-cpufreq.c b/drivers/cpufreq/pxa2xx-cpufreq.c index 183bc13f13e5..0a0f4369636a 100644 --- a/drivers/cpufreq/pxa2xx-cpufreq.c +++ b/drivers/cpufreq/pxa2xx-cpufreq.c | |||
@@ -271,7 +271,6 @@ static int pxa_set_target(struct cpufreq_policy *policy, unsigned int idx) | |||
271 | { | 271 | { |
272 | struct cpufreq_frequency_table *pxa_freqs_table; | 272 | struct cpufreq_frequency_table *pxa_freqs_table; |
273 | pxa_freqs_t *pxa_freq_settings; | 273 | pxa_freqs_t *pxa_freq_settings; |
274 | struct cpufreq_freqs freqs; | ||
275 | unsigned long flags; | 274 | unsigned long flags; |
276 | unsigned int new_freq_cpu, new_freq_mem; | 275 | unsigned int new_freq_cpu, new_freq_mem; |
277 | unsigned int unused, preset_mdrefr, postset_mdrefr, cclkcfg; | 276 | unsigned int unused, preset_mdrefr, postset_mdrefr, cclkcfg; |
@@ -282,24 +281,17 @@ static int pxa_set_target(struct cpufreq_policy *policy, unsigned int idx) | |||
282 | 281 | ||
283 | new_freq_cpu = pxa_freq_settings[idx].khz; | 282 | new_freq_cpu = pxa_freq_settings[idx].khz; |
284 | new_freq_mem = pxa_freq_settings[idx].membus; | 283 | new_freq_mem = pxa_freq_settings[idx].membus; |
285 | freqs.old = policy->cur; | ||
286 | freqs.new = new_freq_cpu; | ||
287 | 284 | ||
288 | if (freq_debug) | 285 | if (freq_debug) |
289 | pr_debug("Changing CPU frequency to %d Mhz, (SDRAM %d Mhz)\n", | 286 | pr_debug("Changing CPU frequency to %d Mhz, (SDRAM %d Mhz)\n", |
290 | freqs.new / 1000, (pxa_freq_settings[idx].div2) ? | 287 | new_freq_cpu / 1000, (pxa_freq_settings[idx].div2) ? |
291 | (new_freq_mem / 2000) : (new_freq_mem / 1000)); | 288 | (new_freq_mem / 2000) : (new_freq_mem / 1000)); |
292 | 289 | ||
293 | if (vcc_core && freqs.new > freqs.old) | 290 | if (vcc_core && new_freq_cpu > policy->cur) { |
294 | ret = pxa_cpufreq_change_voltage(&pxa_freq_settings[idx]); | 291 | ret = pxa_cpufreq_change_voltage(&pxa_freq_settings[idx]); |
295 | if (ret) | 292 | if (ret) |
296 | return ret; | 293 | return ret; |
297 | /* | 294 | } |
298 | * Tell everyone what we're about to do... | ||
299 | * you should add a notify client with any platform specific | ||
300 | * Vcc changing capability | ||
301 | */ | ||
302 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); | ||
303 | 295 | ||
304 | /* Calculate the next MDREFR. If we're slowing down the SDRAM clock | 296 | /* Calculate the next MDREFR. If we're slowing down the SDRAM clock |
305 | * we need to preset the smaller DRI before the change. If we're | 297 | * we need to preset the smaller DRI before the change. If we're |
@@ -350,13 +342,6 @@ static int pxa_set_target(struct cpufreq_policy *policy, unsigned int idx) | |||
350 | local_irq_restore(flags); | 342 | local_irq_restore(flags); |
351 | 343 | ||
352 | /* | 344 | /* |
353 | * Tell everyone what we've just done... | ||
354 | * you should add a notify client with any platform specific | ||
355 | * SDRAM refresh timer adjustments | ||
356 | */ | ||
357 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); | ||
358 | |||
359 | /* | ||
360 | * Even if voltage setting fails, we don't report it, as the frequency | 345 | * Even if voltage setting fails, we don't report it, as the frequency |
361 | * change succeeded. The voltage reduction is not a critical failure, | 346 | * change succeeded. The voltage reduction is not a critical failure, |
362 | * only power savings will suffer from this. | 347 | * only power savings will suffer from this. |
@@ -365,7 +350,7 @@ static int pxa_set_target(struct cpufreq_policy *policy, unsigned int idx) | |||
365 | * bug is triggered (seems a deadlock). Should anybody find out where, | 350 | * bug is triggered (seems a deadlock). Should anybody find out where, |
366 | * the "return 0" should become a "return ret". | 351 | * the "return 0" should become a "return ret". |
367 | */ | 352 | */ |
368 | if (vcc_core && freqs.new < freqs.old) | 353 | if (vcc_core && new_freq_cpu < policy->cur) |
369 | ret = pxa_cpufreq_change_voltage(&pxa_freq_settings[idx]); | 354 | ret = pxa_cpufreq_change_voltage(&pxa_freq_settings[idx]); |
370 | 355 | ||
371 | return 0; | 356 | return 0; |