summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/p4-clockmod.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpufreq/p4-clockmod.c')
-rw-r--r--drivers/cpufreq/p4-clockmod.c27
1 files changed, 4 insertions, 23 deletions
diff --git a/drivers/cpufreq/p4-clockmod.c b/drivers/cpufreq/p4-clockmod.c
index 2f0a2a65c37f..6164c1cca504 100644
--- a/drivers/cpufreq/p4-clockmod.c
+++ b/drivers/cpufreq/p4-clockmod.c
@@ -140,12 +140,6 @@ static int cpufreq_p4_target(struct cpufreq_policy *policy,
140} 140}
141 141
142 142
143static int cpufreq_p4_verify(struct cpufreq_policy *policy)
144{
145 return cpufreq_frequency_table_verify(policy, &p4clockmod_table[0]);
146}
147
148
149static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c) 143static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c)
150{ 144{
151 if (c->x86 == 0x06) { 145 if (c->x86 == 0x06) {
@@ -230,25 +224,17 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy)
230 else 224 else
231 p4clockmod_table[i].frequency = (stock_freq * i)/8; 225 p4clockmod_table[i].frequency = (stock_freq * i)/8;
232 } 226 }
233 cpufreq_frequency_table_get_attr(p4clockmod_table, policy->cpu);
234 227
235 /* cpuinfo and default policy values */ 228 /* cpuinfo and default policy values */
236 229
237 /* the transition latency is set to be 1 higher than the maximum 230 /* the transition latency is set to be 1 higher than the maximum
238 * transition latency of the ondemand governor */ 231 * transition latency of the ondemand governor */
239 policy->cpuinfo.transition_latency = 10000001; 232 policy->cpuinfo.transition_latency = 10000001;
240 policy->cur = stock_freq;
241 233
242 return cpufreq_frequency_table_cpuinfo(policy, &p4clockmod_table[0]); 234 return cpufreq_table_validate_and_show(policy, &p4clockmod_table[0]);
243} 235}
244 236
245 237
246static int cpufreq_p4_cpu_exit(struct cpufreq_policy *policy)
247{
248 cpufreq_frequency_table_put_attr(policy->cpu);
249 return 0;
250}
251
252static unsigned int cpufreq_p4_get(unsigned int cpu) 238static unsigned int cpufreq_p4_get(unsigned int cpu)
253{ 239{
254 u32 l, h; 240 u32 l, h;
@@ -267,19 +253,14 @@ static unsigned int cpufreq_p4_get(unsigned int cpu)
267 return stock_freq; 253 return stock_freq;
268} 254}
269 255
270static struct freq_attr *p4clockmod_attr[] = {
271 &cpufreq_freq_attr_scaling_available_freqs,
272 NULL,
273};
274
275static struct cpufreq_driver p4clockmod_driver = { 256static struct cpufreq_driver p4clockmod_driver = {
276 .verify = cpufreq_p4_verify, 257 .verify = cpufreq_generic_frequency_table_verify,
277 .target = cpufreq_p4_target, 258 .target = cpufreq_p4_target,
278 .init = cpufreq_p4_cpu_init, 259 .init = cpufreq_p4_cpu_init,
279 .exit = cpufreq_p4_cpu_exit, 260 .exit = cpufreq_generic_exit,
280 .get = cpufreq_p4_get, 261 .get = cpufreq_p4_get,
281 .name = "p4-clockmod", 262 .name = "p4-clockmod",
282 .attr = p4clockmod_attr, 263 .attr = cpufreq_generic_attr,
283}; 264};
284 265
285static const struct x86_cpu_id cpufreq_p4_id[] = { 266static const struct x86_cpu_id cpufreq_p4_id[] = {