diff options
author | Dave Jones <davej@redhat.com> | 2006-02-28 00:43:23 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2006-02-28 00:43:23 -0500 |
commit | 32ee8c3e470d86588b51dc42ed01e85c5fa0f180 (patch) | |
tree | d544cc24c37c02f44f9cf89cb5647d74a61d7ce6 /arch/i386/kernel/cpu/cpufreq/speedstep-smi.c | |
parent | 8ad5496d2359a19127ad9f2eda69485025c9917f (diff) |
[CPUFREQ] Lots of whitespace & CodingStyle cleanup.
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'arch/i386/kernel/cpu/cpufreq/speedstep-smi.c')
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/speedstep-smi.c | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c b/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c index 28cc5d524afc..336ba49e526d 100644 --- a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c +++ b/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c | |||
@@ -13,8 +13,8 @@ | |||
13 | *********************************************************************/ | 13 | *********************************************************************/ |
14 | 14 | ||
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | #include <linux/moduleparam.h> | 17 | #include <linux/moduleparam.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/cpufreq.h> | 19 | #include <linux/cpufreq.h> |
20 | #include <linux/pci.h> | 20 | #include <linux/pci.h> |
@@ -28,21 +28,21 @@ | |||
28 | * | 28 | * |
29 | * These parameters are got from IST-SMI BIOS call. | 29 | * These parameters are got from IST-SMI BIOS call. |
30 | * If user gives it, these are used. | 30 | * If user gives it, these are used. |
31 | * | 31 | * |
32 | */ | 32 | */ |
33 | static int smi_port = 0; | 33 | static int smi_port = 0; |
34 | static int smi_cmd = 0; | 34 | static int smi_cmd = 0; |
35 | static unsigned int smi_sig = 0; | 35 | static unsigned int smi_sig = 0; |
36 | 36 | ||
37 | /* info about the processor */ | 37 | /* info about the processor */ |
38 | static unsigned int speedstep_processor = 0; | 38 | static unsigned int speedstep_processor = 0; |
39 | 39 | ||
40 | /* | 40 | /* |
41 | * There are only two frequency states for each processor. Values | 41 | * There are only two frequency states for each processor. Values |
42 | * are in kHz for the time being. | 42 | * are in kHz for the time being. |
43 | */ | 43 | */ |
44 | static struct cpufreq_frequency_table speedstep_freqs[] = { | 44 | static struct cpufreq_frequency_table speedstep_freqs[] = { |
45 | {SPEEDSTEP_HIGH, 0}, | 45 | {SPEEDSTEP_HIGH, 0}, |
46 | {SPEEDSTEP_LOW, 0}, | 46 | {SPEEDSTEP_LOW, 0}, |
47 | {0, CPUFREQ_TABLE_END}, | 47 | {0, CPUFREQ_TABLE_END}, |
48 | }; | 48 | }; |
@@ -123,7 +123,7 @@ static int speedstep_smi_get_freqs (unsigned int *low, unsigned int *high) | |||
123 | *low = low_mhz * 1000; | 123 | *low = low_mhz * 1000; |
124 | 124 | ||
125 | return result; | 125 | return result; |
126 | } | 126 | } |
127 | 127 | ||
128 | /** | 128 | /** |
129 | * speedstep_get_state - set the SpeedStep state | 129 | * speedstep_get_state - set the SpeedStep state |
@@ -204,7 +204,7 @@ static void speedstep_set_state (unsigned int state) | |||
204 | * speedstep_target - set a new CPUFreq policy | 204 | * speedstep_target - set a new CPUFreq policy |
205 | * @policy: new policy | 205 | * @policy: new policy |
206 | * @target_freq: new freq | 206 | * @target_freq: new freq |
207 | * @relation: | 207 | * @relation: |
208 | * | 208 | * |
209 | * Sets a new CPUFreq policy/freq. | 209 | * Sets a new CPUFreq policy/freq. |
210 | */ | 210 | */ |
@@ -283,7 +283,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy) | |||
283 | state = speedstep_get_state(); | 283 | state = speedstep_get_state(); |
284 | speed = speedstep_freqs[state].frequency; | 284 | speed = speedstep_freqs[state].frequency; |
285 | 285 | ||
286 | dprintk("currently at %s speed setting - %i MHz\n", | 286 | dprintk("currently at %s speed setting - %i MHz\n", |
287 | (speed == speedstep_freqs[SPEEDSTEP_LOW].frequency) ? "low" : "high", | 287 | (speed == speedstep_freqs[SPEEDSTEP_LOW].frequency) ? "low" : "high", |
288 | (speed / 1000)); | 288 | (speed / 1000)); |
289 | 289 | ||
@@ -296,7 +296,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy) | |||
296 | if (result) | 296 | if (result) |
297 | return (result); | 297 | return (result); |
298 | 298 | ||
299 | cpufreq_frequency_table_get_attr(speedstep_freqs, policy->cpu); | 299 | cpufreq_frequency_table_get_attr(speedstep_freqs, policy->cpu); |
300 | 300 | ||
301 | return 0; | 301 | return 0; |
302 | } | 302 | } |
@@ -332,8 +332,8 @@ static struct freq_attr* speedstep_attr[] = { | |||
332 | 332 | ||
333 | static struct cpufreq_driver speedstep_driver = { | 333 | static struct cpufreq_driver speedstep_driver = { |
334 | .name = "speedstep-smi", | 334 | .name = "speedstep-smi", |
335 | .verify = speedstep_verify, | 335 | .verify = speedstep_verify, |
336 | .target = speedstep_target, | 336 | .target = speedstep_target, |
337 | .init = speedstep_cpu_init, | 337 | .init = speedstep_cpu_init, |
338 | .exit = speedstep_cpu_exit, | 338 | .exit = speedstep_cpu_exit, |
339 | .get = speedstep_get, | 339 | .get = speedstep_get, |
@@ -370,13 +370,12 @@ static int __init speedstep_init(void) | |||
370 | return -ENODEV; | 370 | return -ENODEV; |
371 | } | 371 | } |
372 | 372 | ||
373 | dprintk("signature:0x%.8lx, command:0x%.8lx, event:0x%.8lx, perf_level:0x%.8lx.\n", | 373 | dprintk("signature:0x%.8lx, command:0x%.8lx, event:0x%.8lx, perf_level:0x%.8lx.\n", |
374 | ist_info.signature, ist_info.command, ist_info.event, ist_info.perf_level); | 374 | ist_info.signature, ist_info.command, ist_info.event, ist_info.perf_level); |
375 | 375 | ||
376 | 376 | /* Error if no IST-SMI BIOS or no PARM | |
377 | /* Error if no IST-SMI BIOS or no PARM | ||
378 | sig= 'ISGE' aka 'Intel Speedstep Gate E' */ | 377 | sig= 'ISGE' aka 'Intel Speedstep Gate E' */ |
379 | if ((ist_info.signature != 0x47534943) && ( | 378 | if ((ist_info.signature != 0x47534943) && ( |
380 | (smi_port == 0) || (smi_cmd == 0))) | 379 | (smi_port == 0) || (smi_cmd == 0))) |
381 | return -ENODEV; | 380 | return -ENODEV; |
382 | 381 | ||
@@ -386,17 +385,15 @@ static int __init speedstep_init(void) | |||
386 | smi_sig = ist_info.signature; | 385 | smi_sig = ist_info.signature; |
387 | 386 | ||
388 | /* setup smi_port from MODLULE_PARM or BIOS */ | 387 | /* setup smi_port from MODLULE_PARM or BIOS */ |
389 | if ((smi_port > 0xff) || (smi_port < 0)) { | 388 | if ((smi_port > 0xff) || (smi_port < 0)) |
390 | return -EINVAL; | 389 | return -EINVAL; |
391 | } else if (smi_port == 0) { | 390 | else if (smi_port == 0) |
392 | smi_port = ist_info.command & 0xff; | 391 | smi_port = ist_info.command & 0xff; |
393 | } | ||
394 | 392 | ||
395 | if ((smi_cmd > 0xff) || (smi_cmd < 0)) { | 393 | if ((smi_cmd > 0xff) || (smi_cmd < 0)) |
396 | return -EINVAL; | 394 | return -EINVAL; |
397 | } else if (smi_cmd == 0) { | 395 | else if (smi_cmd == 0) |
398 | smi_cmd = (ist_info.command >> 16) & 0xff; | 396 | smi_cmd = (ist_info.command >> 16) & 0xff; |
399 | } | ||
400 | 397 | ||
401 | return cpufreq_register_driver(&speedstep_driver); | 398 | return cpufreq_register_driver(&speedstep_driver); |
402 | } | 399 | } |