aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/speedstep-centrino.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpufreq/speedstep-centrino.c')
-rw-r--r--drivers/cpufreq/speedstep-centrino.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/drivers/cpufreq/speedstep-centrino.c b/drivers/cpufreq/speedstep-centrino.c
index 25e45f89acac..c51ec8c0e3a8 100644
--- a/drivers/cpufreq/speedstep-centrino.c
+++ b/drivers/cpufreq/speedstep-centrino.c
@@ -416,21 +416,17 @@ static int centrino_cpu_exit(struct cpufreq_policy *policy)
416/** 416/**
417 * centrino_setpolicy - set a new CPUFreq policy 417 * centrino_setpolicy - set a new CPUFreq policy
418 * @policy: new policy 418 * @policy: new policy
419 * @target_freq: the target frequency 419 * @index: index of target frequency
420 * @relation: how that frequency relates to achieved frequency
421 * (CPUFREQ_RELATION_L or CPUFREQ_RELATION_H)
422 * 420 *
423 * Sets a new CPUFreq policy. 421 * Sets a new CPUFreq policy.
424 */ 422 */
425static int centrino_target (struct cpufreq_policy *policy, 423static int centrino_target(struct cpufreq_policy *policy, unsigned int index)
426 unsigned int target_freq,
427 unsigned int relation)
428{ 424{
429 unsigned int newstate = 0;
430 unsigned int msr, oldmsr = 0, h = 0, cpu = policy->cpu; 425 unsigned int msr, oldmsr = 0, h = 0, cpu = policy->cpu;
431 struct cpufreq_freqs freqs; 426 struct cpufreq_freqs freqs;
432 int retval = 0; 427 int retval = 0;
433 unsigned int j, first_cpu, tmp; 428 unsigned int j, first_cpu, tmp;
429 struct cpufreq_frequency_table *op_points;
434 cpumask_var_t covered_cpus; 430 cpumask_var_t covered_cpus;
435 431
436 if (unlikely(!zalloc_cpumask_var(&covered_cpus, GFP_KERNEL))) 432 if (unlikely(!zalloc_cpumask_var(&covered_cpus, GFP_KERNEL)))
@@ -441,16 +437,8 @@ static int centrino_target (struct cpufreq_policy *policy,
441 goto out; 437 goto out;
442 } 438 }
443 439
444 if (unlikely(cpufreq_frequency_table_target(policy,
445 per_cpu(centrino_model, cpu)->op_points,
446 target_freq,
447 relation,
448 &newstate))) {
449 retval = -EINVAL;
450 goto out;
451 }
452
453 first_cpu = 1; 440 first_cpu = 1;
441 op_points = &per_cpu(centrino_model, cpu)->op_points[index];
454 for_each_cpu(j, policy->cpus) { 442 for_each_cpu(j, policy->cpus) {
455 int good_cpu; 443 int good_cpu;
456 444
@@ -474,7 +462,7 @@ static int centrino_target (struct cpufreq_policy *policy,
474 break; 462 break;
475 } 463 }
476 464
477 msr = per_cpu(centrino_model, cpu)->op_points[newstate].driver_data; 465 msr = op_points->driver_data;
478 466
479 if (first_cpu) { 467 if (first_cpu) {
480 rdmsr_on_cpu(good_cpu, MSR_IA32_PERF_CTL, &oldmsr, &h); 468 rdmsr_on_cpu(good_cpu, MSR_IA32_PERF_CTL, &oldmsr, &h);
@@ -489,7 +477,8 @@ static int centrino_target (struct cpufreq_policy *policy,
489 freqs.new = extract_clock(msr, cpu, 0); 477 freqs.new = extract_clock(msr, cpu, 0);
490 478
491 pr_debug("target=%dkHz old=%d new=%d msr=%04x\n", 479 pr_debug("target=%dkHz old=%d new=%d msr=%04x\n",
492 target_freq, freqs.old, freqs.new, msr); 480 op_points->frequency, freqs.old, freqs.new,
481 msr);
493 482
494 cpufreq_notify_transition(policy, &freqs, 483 cpufreq_notify_transition(policy, &freqs,
495 CPUFREQ_PRECHANGE); 484 CPUFREQ_PRECHANGE);
@@ -540,7 +529,7 @@ static struct cpufreq_driver centrino_driver = {
540 .init = centrino_cpu_init, 529 .init = centrino_cpu_init,
541 .exit = centrino_cpu_exit, 530 .exit = centrino_cpu_exit,
542 .verify = cpufreq_generic_frequency_table_verify, 531 .verify = cpufreq_generic_frequency_table_verify,
543 .target = centrino_target, 532 .target_index = centrino_target,
544 .get = get_cur_freq, 533 .get = get_cur_freq,
545 .attr = cpufreq_generic_attr, 534 .attr = cpufreq_generic_attr,
546}; 535};