Commit a24c67b2 authored by Dave Jones's avatar Dave Jones Committed by Dave Jones

[CPUFREQ] use speedstep_centrino's internal get function as ->get()

parent fdbfdd0b
...@@ -225,9 +225,11 @@ static unsigned extract_clock(unsigned msr) ...@@ -225,9 +225,11 @@ static unsigned extract_clock(unsigned msr)
} }
/* Return the current CPU frequency in kHz */ /* Return the current CPU frequency in kHz */
static unsigned get_cur_freq(void) static unsigned int get_cur_freq(unsigned int cpu)
{ {
unsigned l, h; unsigned l, h;
if (cpu)
return 0;
rdmsr(MSR_IA32_PERF_STATUS, l, h); rdmsr(MSR_IA32_PERF_STATUS, l, h);
return extract_clock(l); return extract_clock(l);
...@@ -322,7 +324,7 @@ static int centrino_cpu_init_acpi(struct cpufreq_policy *policy) ...@@ -322,7 +324,7 @@ static int centrino_cpu_init_acpi(struct cpufreq_policy *policy)
goto err_kfree; goto err_kfree;
} }
cur_freq = get_cur_freq(); cur_freq = get_cur_freq(0);
for (i=0; i<p.state_count; i++) { for (i=0; i<p.state_count; i++) {
centrino_model->op_points[i].index = p.states[i].control; centrino_model->op_points[i].index = p.states[i].control;
...@@ -391,7 +393,7 @@ static int centrino_cpu_init(struct cpufreq_policy *policy) ...@@ -391,7 +393,7 @@ static int centrino_cpu_init(struct cpufreq_policy *policy)
} }
} }
freq = get_cur_freq(); freq = get_cur_freq(0);
policy->governor = CPUFREQ_DEFAULT_GOVERNOR; policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
policy->cpuinfo.transition_latency = 10; /* 10uS transition latency */ policy->cpuinfo.transition_latency = 10; /* 10uS transition latency */
...@@ -516,6 +518,7 @@ static struct cpufreq_driver centrino_driver = { ...@@ -516,6 +518,7 @@ static struct cpufreq_driver centrino_driver = {
.exit = centrino_cpu_exit, .exit = centrino_cpu_exit,
.verify = centrino_verify, .verify = centrino_verify,
.target = centrino_target, .target = centrino_target,
.get = get_cur_freq,
.attr = centrino_attr, .attr = centrino_attr,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment