diff options
Diffstat (limited to 'drivers/cpufreq/pmac32-cpufreq.c')
-rw-r--r-- | drivers/cpufreq/pmac32-cpufreq.c | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/drivers/cpufreq/pmac32-cpufreq.c b/drivers/cpufreq/pmac32-cpufreq.c index a096cd3fa23d..05f705e1b7a2 100644 --- a/drivers/cpufreq/pmac32-cpufreq.c +++ b/drivers/cpufreq/pmac32-cpufreq.c | |||
@@ -86,11 +86,6 @@ static struct cpufreq_frequency_table pmac_cpu_freqs[] = { | |||
86 | {0, CPUFREQ_TABLE_END}, | 86 | {0, CPUFREQ_TABLE_END}, |
87 | }; | 87 | }; |
88 | 88 | ||
89 | static struct freq_attr* pmac_cpu_freqs_attr[] = { | ||
90 | &cpufreq_freq_attr_scaling_available_freqs, | ||
91 | NULL, | ||
92 | }; | ||
93 | |||
94 | static inline void local_delay(unsigned long ms) | 89 | static inline void local_delay(unsigned long ms) |
95 | { | 90 | { |
96 | if (no_schedule) | 91 | if (no_schedule) |
@@ -378,23 +373,12 @@ static unsigned int pmac_cpufreq_get_speed(unsigned int cpu) | |||
378 | return cur_freq; | 373 | return cur_freq; |
379 | } | 374 | } |
380 | 375 | ||
381 | static int pmac_cpufreq_verify(struct cpufreq_policy *policy) | ||
382 | { | ||
383 | return cpufreq_frequency_table_verify(policy, pmac_cpu_freqs); | ||
384 | } | ||
385 | |||
386 | static int pmac_cpufreq_target( struct cpufreq_policy *policy, | 376 | static int pmac_cpufreq_target( struct cpufreq_policy *policy, |
387 | unsigned int target_freq, | 377 | unsigned int index) |
388 | unsigned int relation) | ||
389 | { | 378 | { |
390 | unsigned int newstate = 0; | ||
391 | int rc; | 379 | int rc; |
392 | 380 | ||
393 | if (cpufreq_frequency_table_target(policy, pmac_cpu_freqs, | 381 | rc = do_set_cpu_speed(policy, index, 1); |
394 | target_freq, relation, &newstate)) | ||
395 | return -EINVAL; | ||
396 | |||
397 | rc = do_set_cpu_speed(policy, newstate, 1); | ||
398 | 382 | ||
399 | ppc_proc_freq = cur_freq * 1000ul; | 383 | ppc_proc_freq = cur_freq * 1000ul; |
400 | return rc; | 384 | return rc; |
@@ -402,14 +386,7 @@ static int pmac_cpufreq_target( struct cpufreq_policy *policy, | |||
402 | 386 | ||
403 | static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy) | 387 | static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy) |
404 | { | 388 | { |
405 | if (policy->cpu != 0) | 389 | return cpufreq_generic_init(policy, pmac_cpu_freqs, transition_latency); |
406 | return -ENODEV; | ||
407 | |||
408 | policy->cpuinfo.transition_latency = transition_latency; | ||
409 | policy->cur = cur_freq; | ||
410 | |||
411 | cpufreq_frequency_table_get_attr(pmac_cpu_freqs, policy->cpu); | ||
412 | return cpufreq_frequency_table_cpuinfo(policy, pmac_cpu_freqs); | ||
413 | } | 390 | } |
414 | 391 | ||
415 | static u32 read_gpio(struct device_node *np) | 392 | static u32 read_gpio(struct device_node *np) |
@@ -469,14 +446,14 @@ static int pmac_cpufreq_resume(struct cpufreq_policy *policy) | |||
469 | } | 446 | } |
470 | 447 | ||
471 | static struct cpufreq_driver pmac_cpufreq_driver = { | 448 | static struct cpufreq_driver pmac_cpufreq_driver = { |
472 | .verify = pmac_cpufreq_verify, | 449 | .verify = cpufreq_generic_frequency_table_verify, |
473 | .target = pmac_cpufreq_target, | 450 | .target_index = pmac_cpufreq_target, |
474 | .get = pmac_cpufreq_get_speed, | 451 | .get = pmac_cpufreq_get_speed, |
475 | .init = pmac_cpufreq_cpu_init, | 452 | .init = pmac_cpufreq_cpu_init, |
476 | .suspend = pmac_cpufreq_suspend, | 453 | .suspend = pmac_cpufreq_suspend, |
477 | .resume = pmac_cpufreq_resume, | 454 | .resume = pmac_cpufreq_resume, |
478 | .flags = CPUFREQ_PM_NO_WARN, | 455 | .flags = CPUFREQ_PM_NO_WARN, |
479 | .attr = pmac_cpu_freqs_attr, | 456 | .attr = cpufreq_generic_attr, |
480 | .name = "powermac", | 457 | .name = "powermac", |
481 | }; | 458 | }; |
482 | 459 | ||