upgrade to linux 2.6.10-1.12_FC2
[linux-2.6.git] / arch / i386 / kernel / cpu / cpufreq / speedstep-centrino.c
1 /*
2  * cpufreq driver for Enhanced SpeedStep, as found in Intel's Pentium
3  * M (part of the Centrino chipset).
4  *
5  * Despite the "SpeedStep" in the name, this is almost entirely unlike
6  * traditional SpeedStep.
7  *
8  * Modelled on speedstep.c
9  *
10  * Copyright (C) 2003 Jeremy Fitzhardinge <jeremy@goop.org>
11  *
12  * WARNING WARNING WARNING
13  *
14  * This driver manipulates the PERF_CTL MSR, which is only somewhat
15  * documented.  While it seems to work on my laptop, it has not been
16  * tested anywhere else, and it may not work for you, do strange
17  * things or simply crash.
18  */
19
20 #include <linux/kernel.h>
21 #include <linux/module.h>
22 #include <linux/init.h>
23 #include <linux/cpufreq.h>
24 #include <linux/config.h>
25
26 #ifdef CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI
27 #include <linux/acpi.h>
28 #include <acpi/processor.h>
29 #endif
30
31 #include <asm/msr.h>
32 #include <asm/processor.h>
33 #include <asm/cpufeature.h>
34
35 #define PFX             "speedstep-centrino: "
36 #define MAINTAINER      "Jeremy Fitzhardinge <jeremy@goop.org>"
37
38 #define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "speedstep-centrino", msg)
39
40
41 struct cpu_id
42 {
43         __u8    x86;            /* CPU family */
44         __u8    x86_model;      /* model */
45         __u8    x86_mask;       /* stepping */
46 };
47
48 enum {
49         CPU_BANIAS,
50         CPU_DOTHAN_A1,
51         CPU_DOTHAN_A2,
52         CPU_DOTHAN_B0,
53 };
54
55 static const struct cpu_id cpu_ids[] = {
56         [CPU_BANIAS]    = { 6,  9, 5 },
57         [CPU_DOTHAN_A1] = { 6, 13, 1 },
58         [CPU_DOTHAN_A2] = { 6, 13, 2 },
59         [CPU_DOTHAN_B0] = { 6, 13, 6 },
60 };
61 #define N_IDS   (sizeof(cpu_ids)/sizeof(cpu_ids[0]))
62
63 struct cpu_model
64 {
65         const struct cpu_id *cpu_id;
66         const char      *model_name;
67         unsigned        max_freq; /* max clock in kHz */
68
69         struct cpufreq_frequency_table *op_points; /* clock/voltage pairs */
70 };
71 static int centrino_verify_cpu_id(const struct cpuinfo_x86 *c, const struct cpu_id *x);
72
73 /* Operating points for current CPU */
74 static struct cpu_model *centrino_model;
75 static const struct cpu_id *centrino_cpu;
76
77 #ifdef CONFIG_X86_SPEEDSTEP_CENTRINO_TABLE
78
79 /* Computes the correct form for IA32_PERF_CTL MSR for a particular
80    frequency/voltage operating point; frequency in MHz, volts in mV.
81    This is stored as "index" in the structure. */
82 #define OP(mhz, mv)                                                     \
83         {                                                               \
84                 .frequency = (mhz) * 1000,                              \
85                 .index = (((mhz)/100) << 8) | ((mv - 700) / 16)         \
86         }
87
88 /*
89  * These voltage tables were derived from the Intel Pentium M
90  * datasheet, document 25261202.pdf, Table 5.  I have verified they
91  * are consistent with my IBM ThinkPad X31, which has a 1.3GHz Pentium
92  * M.
93  */
94
95 /* Ultra Low Voltage Intel Pentium M processor 900MHz (Banias) */
96 static struct cpufreq_frequency_table banias_900[] =
97 {
98         OP(600,  844),
99         OP(800,  988),
100         OP(900, 1004),
101         { .frequency = CPUFREQ_TABLE_END }
102 };
103
104 /* Ultra Low Voltage Intel Pentium M processor 1000MHz (Banias) */
105 static struct cpufreq_frequency_table banias_1000[] =
106 {
107         OP(600,   844),
108         OP(800,   972),
109         OP(900,   988),
110         OP(1000, 1004),
111         { .frequency = CPUFREQ_TABLE_END }
112 };
113
114 /* Low Voltage Intel Pentium M processor 1.10GHz (Banias) */
115 static struct cpufreq_frequency_table banias_1100[] =
116 {
117         OP( 600,  956),
118         OP( 800, 1020),
119         OP( 900, 1100),
120         OP(1000, 1164),
121         OP(1100, 1180),
122         { .frequency = CPUFREQ_TABLE_END }
123 };
124
125
126 /* Low Voltage Intel Pentium M processor 1.20GHz (Banias) */
127 static struct cpufreq_frequency_table banias_1200[] =
128 {
129         OP( 600,  956),
130         OP( 800, 1004),
131         OP( 900, 1020),
132         OP(1000, 1100),
133         OP(1100, 1164),
134         OP(1200, 1180),
135         { .frequency = CPUFREQ_TABLE_END }
136 };
137
138 /* Intel Pentium M processor 1.30GHz (Banias) */
139 static struct cpufreq_frequency_table banias_1300[] =
140 {
141         OP( 600,  956),
142         OP( 800, 1260),
143         OP(1000, 1292),
144         OP(1200, 1356),
145         OP(1300, 1388),
146         { .frequency = CPUFREQ_TABLE_END }
147 };
148
149 /* Intel Pentium M processor 1.40GHz (Banias) */
150 static struct cpufreq_frequency_table banias_1400[] =
151 {
152         OP( 600,  956),
153         OP( 800, 1180),
154         OP(1000, 1308),
155         OP(1200, 1436),
156         OP(1400, 1484),
157         { .frequency = CPUFREQ_TABLE_END }
158 };
159
160 /* Intel Pentium M processor 1.50GHz (Banias) */
161 static struct cpufreq_frequency_table banias_1500[] =
162 {
163         OP( 600,  956),
164         OP( 800, 1116),
165         OP(1000, 1228),
166         OP(1200, 1356),
167         OP(1400, 1452),
168         OP(1500, 1484),
169         { .frequency = CPUFREQ_TABLE_END }
170 };
171
172 /* Intel Pentium M processor 1.60GHz (Banias) */
173 static struct cpufreq_frequency_table banias_1600[] =
174 {
175         OP( 600,  956),
176         OP( 800, 1036),
177         OP(1000, 1164),
178         OP(1200, 1276),
179         OP(1400, 1420),
180         OP(1600, 1484),
181         { .frequency = CPUFREQ_TABLE_END }
182 };
183
184 /* Intel Pentium M processor 1.70GHz (Banias) */
185 static struct cpufreq_frequency_table banias_1700[] =
186 {
187         OP( 600,  956),
188         OP( 800, 1004),
189         OP(1000, 1116),
190         OP(1200, 1228),
191         OP(1400, 1308),
192         OP(1700, 1484),
193         { .frequency = CPUFREQ_TABLE_END }
194 };
195 #undef OP
196
197 #define _BANIAS(cpuid, max, name)       \
198 {       .cpu_id         = cpuid,        \
199         .model_name     = "Intel(R) Pentium(R) M processor " name "MHz", \
200         .max_freq       = (max)*1000,   \
201         .op_points      = banias_##max, \
202 }
203 #define BANIAS(max)     _BANIAS(&cpu_ids[CPU_BANIAS], max, #max)
204
205 /* CPU models, their operating frequency range, and freq/voltage
206    operating points */
207 static struct cpu_model models[] =
208 {
209         _BANIAS(&cpu_ids[CPU_BANIAS], 900, " 900"),
210         BANIAS(1000),
211         BANIAS(1100),
212         BANIAS(1200),
213         BANIAS(1300),
214         BANIAS(1400),
215         BANIAS(1500),
216         BANIAS(1600),
217         BANIAS(1700),
218
219         /* NULL model_name is a wildcard */
220         { &cpu_ids[CPU_DOTHAN_A1], NULL, 0, NULL },
221         { &cpu_ids[CPU_DOTHAN_A2], NULL, 0, NULL },
222         { &cpu_ids[CPU_DOTHAN_B0], NULL, 0, NULL },
223
224         { NULL, }
225 };
226 #undef _BANIAS
227 #undef BANIAS
228
229 static int centrino_cpu_init_table(struct cpufreq_policy *policy)
230 {
231         struct cpuinfo_x86 *cpu = &cpu_data[policy->cpu];
232         struct cpu_model *model;
233
234         for(model = models; model->cpu_id != NULL; model++)
235                 if (centrino_verify_cpu_id(cpu, model->cpu_id) &&
236                     (model->model_name == NULL ||
237                      strcmp(cpu->x86_model_id, model->model_name) == 0))
238                         break;
239
240         if (model->cpu_id == NULL) {
241                 /* No match at all */
242                 printk(KERN_INFO PFX "no support for CPU model \"%s\": "
243                        "send /proc/cpuinfo to " MAINTAINER "\n",
244                        cpu->x86_model_id);
245                 return -ENOENT;
246         }
247
248         if (model->op_points == NULL) {
249                 /* Matched a non-match */
250                 printk(KERN_INFO PFX "no table support for CPU model \"%s\": \n",
251                        cpu->x86_model_id);
252 #ifdef CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI
253                 printk(KERN_INFO PFX "try compiling with CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI enabled\n");
254 #endif
255                 return -ENOENT;
256         }
257
258         centrino_model = model;
259
260         dprintk("found \"%s\": max frequency: %dkHz\n",
261                model->model_name, model->max_freq);
262
263         return 0;
264 }
265
266 #else
267 static inline int centrino_cpu_init_table(struct cpufreq_policy *policy) { return -ENODEV; }
268 #endif /* CONFIG_X86_SPEEDSTEP_CENTRINO_TABLE */
269
270 static int centrino_verify_cpu_id(const struct cpuinfo_x86 *c, const struct cpu_id *x)
271 {
272         if ((c->x86 == x->x86) &&
273             (c->x86_model == x->x86_model) &&
274             (c->x86_mask == x->x86_mask))
275                 return 1;
276         return 0;
277 }
278
279 /* To be called only after centrino_model is initialized */
280 static unsigned extract_clock(unsigned msr)
281 {
282         int i;
283
284         /*
285          * Extract clock in kHz from PERF_CTL value
286          * for centrino, as some DSDTs are buggy.
287          * Ideally, this can be done using the acpi_data structure.
288          */
289         if ((centrino_cpu == &cpu_ids[CPU_BANIAS]) ||
290             (centrino_cpu == &cpu_ids[CPU_DOTHAN_A1]) ||
291             (centrino_cpu == &cpu_ids[CPU_DOTHAN_B0])) {
292                 msr = (msr >> 8) & 0xff;
293                 return msr * 100000;
294         }
295
296         if ((!centrino_model) || (!centrino_model->op_points))
297                 return 0;
298
299         msr &= 0xffff;
300         for (i=0;centrino_model->op_points[i].frequency != CPUFREQ_TABLE_END; i++) {
301                 if (msr == centrino_model->op_points[i].index)
302                 return centrino_model->op_points[i].frequency;
303         }
304         return 0;
305 }
306
307 /* Return the current CPU frequency in kHz */
308 static unsigned int get_cur_freq(unsigned int cpu)
309 {
310         unsigned l, h;
311         cpumask_t saved_mask;
312
313         saved_mask = current->cpus_allowed;
314         set_cpus_allowed(current, cpumask_of_cpu(cpu));
315         if (smp_processor_id() != cpu)
316                 return 0;
317
318         rdmsr(MSR_IA32_PERF_STATUS, l, h);
319         set_cpus_allowed(current, saved_mask);
320         return extract_clock(l);
321 }
322
323
324 #ifdef CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI
325
326 static struct acpi_processor_performance p;
327
328 /*
329  * centrino_cpu_init_acpi - register with ACPI P-States library
330  *
331  * Register with the ACPI P-States library (part of drivers/acpi/processor.c)
332  * in order to determine correct frequency and voltage pairings by reading
333  * the _PSS of the ACPI DSDT or SSDT tables.
334  */
335 static int centrino_cpu_init_acpi(struct cpufreq_policy *policy)
336 {
337         union acpi_object               arg0 = {ACPI_TYPE_BUFFER};
338         u32                             arg0_buf[3];
339         struct acpi_object_list         arg_list = {1, &arg0};
340         unsigned long                   cur_freq;
341         int                             result = 0, i;
342
343         /* _PDC settings */
344         arg0.buffer.length = 12;
345         arg0.buffer.pointer = (u8 *) arg0_buf;
346         arg0_buf[0] = ACPI_PDC_REVISION_ID;
347         arg0_buf[1] = 1;
348         arg0_buf[2] = ACPI_PDC_EST_CAPABILITY_SMP | ACPI_PDC_EST_CAPABILITY_MSR;
349
350         p.pdc = &arg_list;
351
352         /* register with ACPI core */
353         if (acpi_processor_register_performance(&p, policy->cpu)) {
354                 printk(KERN_INFO PFX "obtaining ACPI data failed\n");
355                 return -EIO;
356         }
357
358         /* verify the acpi_data */
359         if (p.state_count <= 1) {
360                 dprintk("No P-States\n");
361                 result = -ENODEV;
362                 goto err_unreg;
363         }
364
365         if ((p.control_register.space_id != ACPI_ADR_SPACE_FIXED_HARDWARE) ||
366             (p.status_register.space_id != ACPI_ADR_SPACE_FIXED_HARDWARE)) {
367                 dprintk("Invalid control/status registers (%x - %x)\n",
368                         p.control_register.space_id, p.status_register.space_id);
369                 result = -EIO;
370                 goto err_unreg;
371         }
372
373         for (i=0; i<p.state_count; i++) {
374                 if (p.states[i].control != p.states[i].status) {
375                         dprintk("Different control (%x) and status values (%x)\n",
376                                 p.states[i].control, p.states[i].status);
377                         result = -EINVAL;
378                         goto err_unreg;
379                 }
380
381                 if (!p.states[i].core_frequency) {
382                         dprintk("Zero core frequency for state %u\n", i);
383                         result = -EINVAL;
384                         goto err_unreg;
385                 }
386
387                 if (p.states[i].core_frequency > p.states[0].core_frequency) {
388                         dprintk("P%u has larger frequency (%u) than P0 (%u), skipping\n", i,
389                                 p.states[i].core_frequency, p.states[0].core_frequency);
390                         p.states[i].core_frequency = 0;
391                         continue;
392                 }
393         }
394
395         centrino_model = kmalloc(sizeof(struct cpu_model), GFP_KERNEL);
396         if (!centrino_model) {
397                 result = -ENOMEM;
398                 goto err_unreg;
399         }
400         memset(centrino_model, 0, sizeof(struct cpu_model));
401
402         centrino_model->model_name=NULL;
403         centrino_model->max_freq = p.states[0].core_frequency * 1000;
404         centrino_model->op_points =  kmalloc(sizeof(struct cpufreq_frequency_table) *
405                                              (p.state_count + 1), GFP_KERNEL);
406         if (!centrino_model->op_points) {
407                 result = -ENOMEM;
408                 goto err_kfree;
409         }
410
411         for (i=0; i<p.state_count; i++) {
412                 centrino_model->op_points[i].index = p.states[i].control;
413                 centrino_model->op_points[i].frequency = p.states[i].core_frequency * 1000;
414                 dprintk("adding state %i with frequency %u and control value %04x\n", 
415                         i, centrino_model->op_points[i].frequency, centrino_model->op_points[i].index);
416         }
417         centrino_model->op_points[p.state_count].frequency = CPUFREQ_TABLE_END;
418
419         cur_freq = get_cur_freq(policy->cpu);
420
421         for (i=0; i<p.state_count; i++) {
422                 if (!p.states[i].core_frequency) {
423                         dprintk("skipping state %u\n", i);
424                         centrino_model->op_points[i].frequency = CPUFREQ_ENTRY_INVALID;
425                         continue;
426                 }
427                 
428                 if (extract_clock(centrino_model->op_points[i].index) !=
429                     (centrino_model->op_points[i].frequency)) {
430                         dprintk("Invalid encoded frequency (%u vs. %u)\n",
431                                 extract_clock(centrino_model->op_points[i].index),
432                                 centrino_model->op_points[i].frequency);
433                         result = -EINVAL;
434                         goto err_kfree_all;
435                 }
436
437                 if (cur_freq == centrino_model->op_points[i].frequency)
438                         p.state = i;
439         }
440
441         /* notify BIOS that we exist */
442         acpi_processor_notify_smm(THIS_MODULE);
443
444         return 0;
445
446  err_kfree_all:
447         kfree(centrino_model->op_points);
448  err_kfree:
449         kfree(centrino_model);
450  err_unreg:
451         acpi_processor_unregister_performance(&p, policy->cpu);
452         printk(KERN_INFO PFX "invalid ACPI data\n");
453         return (result);
454 }
455 #else
456 static inline int centrino_cpu_init_acpi(struct cpufreq_policy *policy) { return -ENODEV; }
457 #endif
458
459 static int centrino_cpu_init(struct cpufreq_policy *policy)
460 {
461         struct cpuinfo_x86 *cpu = &cpu_data[policy->cpu];
462         unsigned freq;
463         unsigned l, h;
464         int ret;
465         int i;
466
467         /* Only Intel makes Enhanced Speedstep-capable CPUs */
468         if (cpu->x86_vendor != X86_VENDOR_INTEL || !cpu_has(cpu, X86_FEATURE_EST))
469                 return -ENODEV;
470
471         for (i = 0; i < N_IDS; i++)
472                 if (centrino_verify_cpu_id(cpu, &cpu_ids[i]))
473                         break;
474
475         if (i != N_IDS)
476                 centrino_cpu = &cpu_ids[i];
477
478         if (centrino_cpu_init_acpi(policy)) {
479                 if (policy->cpu != 0)
480                         return -ENODEV;
481
482                 if (!centrino_cpu) {
483                         printk(KERN_INFO PFX "found unsupported CPU with "
484                         "Enhanced SpeedStep: send /proc/cpuinfo to "
485                         MAINTAINER "\n");
486                         return -ENODEV;
487                 }
488
489                 if (centrino_cpu_init_table(policy)) {
490                         return -ENODEV;
491                 }
492         }
493
494         /* Check to see if Enhanced SpeedStep is enabled, and try to
495            enable it if not. */
496         rdmsr(MSR_IA32_MISC_ENABLE, l, h);
497
498         if (!(l & (1<<16))) {
499                 l |= (1<<16);
500                 dprintk("trying to enable Enhanced SpeedStep (%x)\n", l);
501                 wrmsr(MSR_IA32_MISC_ENABLE, l, h);
502
503                 /* check to see if it stuck */
504                 rdmsr(MSR_IA32_MISC_ENABLE, l, h);
505                 if (!(l & (1<<16))) {
506                         printk(KERN_INFO PFX "couldn't enable Enhanced SpeedStep\n");
507                         return -ENODEV;
508                 }
509         }
510
511         freq = get_cur_freq(policy->cpu);
512
513         policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
514         policy->cpuinfo.transition_latency = 10000; /* 10uS transition latency */
515         policy->cur = freq;
516
517         dprintk("centrino_cpu_init: cur=%dkHz\n", policy->cur);
518
519         ret = cpufreq_frequency_table_cpuinfo(policy, centrino_model->op_points);
520         if (ret)
521                 return (ret);
522
523         cpufreq_frequency_table_get_attr(centrino_model->op_points, policy->cpu);
524
525         return 0;
526 }
527
528 static int centrino_cpu_exit(struct cpufreq_policy *policy)
529 {
530         if (!centrino_model)
531                 return -ENODEV;
532
533         cpufreq_frequency_table_put_attr(policy->cpu);
534
535 #ifdef CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI
536         if (!centrino_model->model_name) {
537                 dprintk("unregistering and freeing ACPI data\n");
538                 acpi_processor_unregister_performance(&p, policy->cpu);
539                 kfree(centrino_model->op_points);
540                 kfree(centrino_model);
541         }
542 #endif
543
544         centrino_model = NULL;
545
546         return 0;
547 }
548
549 /**
550  * centrino_verify - verifies a new CPUFreq policy
551  * @policy: new policy
552  *
553  * Limit must be within this model's frequency range at least one
554  * border included.
555  */
556 static int centrino_verify (struct cpufreq_policy *policy)
557 {
558         return cpufreq_frequency_table_verify(policy, centrino_model->op_points);
559 }
560
561 /**
562  * centrino_setpolicy - set a new CPUFreq policy
563  * @policy: new policy
564  * @target_freq: the target frequency
565  * @relation: how that frequency relates to achieved frequency (CPUFREQ_RELATION_L or CPUFREQ_RELATION_H)
566  *
567  * Sets a new CPUFreq policy.
568  */
569 static int centrino_target (struct cpufreq_policy *policy,
570                             unsigned int target_freq,
571                             unsigned int relation)
572 {
573         unsigned int    newstate = 0;
574         unsigned int    msr, oldmsr, h;
575         struct cpufreq_freqs    freqs;
576         cpumask_t               saved_mask;
577         int                     retval;
578
579         if (centrino_model == NULL)
580                 return -ENODEV;
581
582         /*
583          * Support for SMP systems.
584          * Make sure we are running on the CPU that wants to change frequency
585          */
586         saved_mask = current->cpus_allowed;
587         set_cpus_allowed(current, policy->cpus);
588         if (smp_processor_id() != policy->cpu) {
589                 dprintk("couldn't limit to CPUs in this domain\n");
590                 return(-EAGAIN);
591         }
592
593         if (cpufreq_frequency_table_target(policy, centrino_model->op_points, target_freq,
594                                            relation, &newstate)) {
595                 retval = -EINVAL;
596                 goto migrate_end;
597         }
598
599         msr = centrino_model->op_points[newstate].index;
600         rdmsr(MSR_IA32_PERF_CTL, oldmsr, h);
601
602         if (msr == (oldmsr & 0xffff)) {
603                 retval = 0;
604                 dprintk("no change needed - msr was and needs to be %x\n", oldmsr);
605                 goto migrate_end;
606         }
607
608         freqs.cpu = policy->cpu;
609         freqs.old = extract_clock(oldmsr);
610         freqs.new = extract_clock(msr);
611
612         dprintk("target=%dkHz old=%d new=%d msr=%04x\n",
613                 target_freq, freqs.old, freqs.new, msr);
614
615         cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
616
617         /* all but 16 LSB are "reserved", so treat them with
618            care */
619         oldmsr &= ~0xffff;
620         msr &= 0xffff;
621         oldmsr |= msr;
622
623         wrmsr(MSR_IA32_PERF_CTL, oldmsr, h);
624
625         cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
626
627         retval = 0;
628 migrate_end:
629         set_cpus_allowed(current, saved_mask);
630         return (retval);
631 }
632
633 static struct freq_attr* centrino_attr[] = {
634         &cpufreq_freq_attr_scaling_available_freqs,
635         NULL,
636 };
637
638 static struct cpufreq_driver centrino_driver = {
639         .name           = "centrino", /* should be speedstep-centrino,
640                                          but there's a 16 char limit */
641         .init           = centrino_cpu_init,
642         .exit           = centrino_cpu_exit,
643         .verify         = centrino_verify,
644         .target         = centrino_target,
645         .get            = get_cur_freq,
646         .attr           = centrino_attr,
647         .owner          = THIS_MODULE,
648 };
649
650
651 /**
652  * centrino_init - initializes the Enhanced SpeedStep CPUFreq driver
653  *
654  * Initializes the Enhanced SpeedStep support. Returns -ENODEV on
655  * unsupported devices, -ENOENT if there's no voltage table for this
656  * particular CPU model, -EINVAL on problems during initiatization,
657  * and zero on success.
658  *
659  * This is quite picky.  Not only does the CPU have to advertise the
660  * "est" flag in the cpuid capability flags, we look for a specific
661  * CPU model and stepping, and we need to have the exact model name in
662  * our voltage tables.  That is, be paranoid about not releasing
663  * someone's valuable magic smoke.
664  */
665 static int __init centrino_init(void)
666 {
667         struct cpuinfo_x86 *cpu = cpu_data;
668
669         if (!cpu_has(cpu, X86_FEATURE_EST))
670                 return -ENODEV;
671
672         return cpufreq_register_driver(&centrino_driver);
673 }
674
675 static void __exit centrino_exit(void)
676 {
677         cpufreq_unregister_driver(&centrino_driver);
678 }
679
680 MODULE_AUTHOR ("Jeremy Fitzhardinge <jeremy@goop.org>");
681 MODULE_DESCRIPTION ("Enhanced SpeedStep driver for Intel Pentium M processors.");
682 MODULE_LICENSE ("GPL");
683
684 late_initcall(centrino_init);
685 module_exit(centrino_exit);