summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/pmac64-cpufreq.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpufreq/pmac64-cpufreq.c')
-rw-r--r--drivers/cpufreq/pmac64-cpufreq.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/cpufreq/pmac64-cpufreq.c b/drivers/cpufreq/pmac64-cpufreq.c
index 5ffe0855ba8f..267e0894c62d 100644
--- a/drivers/cpufreq/pmac64-cpufreq.c
+++ b/drivers/cpufreq/pmac64-cpufreq.c
@@ -12,6 +12,8 @@
12 12
13#undef DEBUG 13#undef DEBUG
14 14
15#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
16
15#include <linux/module.h> 17#include <linux/module.h>
16#include <linux/types.h> 18#include <linux/types.h>
17#include <linux/errno.h> 19#include <linux/errno.h>
@@ -138,7 +140,7 @@ static void g5_vdnap_switch_volt(int speed_mode)
138 usleep_range(1000, 1000); 140 usleep_range(1000, 1000);
139 } 141 }
140 if (done == 0) 142 if (done == 0)
141 pr_warn("cpufreq: Timeout in clock slewing !\n"); 143 pr_warn("Timeout in clock slewing !\n");
142} 144}
143 145
144 146
@@ -266,7 +268,7 @@ static int g5_pfunc_switch_freq(int speed_mode)
266 rc = pmf_call_one(pfunc_cpu_setfreq_low, NULL); 268 rc = pmf_call_one(pfunc_cpu_setfreq_low, NULL);
267 269
268 if (rc) 270 if (rc)
269 pr_warn("cpufreq: pfunc switch error %d\n", rc); 271 pr_warn("pfunc switch error %d\n", rc);
270 272
271 /* It's an irq GPIO so we should be able to just block here, 273 /* It's an irq GPIO so we should be able to just block here,
272 * I'll do that later after I've properly tested the IRQ code for 274 * I'll do that later after I've properly tested the IRQ code for
@@ -282,7 +284,7 @@ static int g5_pfunc_switch_freq(int speed_mode)
282 usleep_range(500, 500); 284 usleep_range(500, 500);
283 } 285 }
284 if (done == 0) 286 if (done == 0)
285 pr_warn("cpufreq: Timeout in clock slewing !\n"); 287 pr_warn("Timeout in clock slewing !\n");
286 288
287 /* If frequency is going down, last ramp the voltage */ 289 /* If frequency is going down, last ramp the voltage */
288 if (speed_mode > g5_pmode_cur) 290 if (speed_mode > g5_pmode_cur)
@@ -368,7 +370,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpunode)
368 } 370 }
369 pvr_hi = (*valp) >> 16; 371 pvr_hi = (*valp) >> 16;
370 if (pvr_hi != 0x3c && pvr_hi != 0x44) { 372 if (pvr_hi != 0x3c && pvr_hi != 0x44) {
371 pr_err("cpufreq: Unsupported CPU version\n"); 373 pr_err("Unsupported CPU version\n");
372 goto bail_noprops; 374 goto bail_noprops;
373 } 375 }
374 376
@@ -403,7 +405,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpunode)
403 405
404 root = of_find_node_by_path("/"); 406 root = of_find_node_by_path("/");
405 if (root == NULL) { 407 if (root == NULL) {
406 pr_err("cpufreq: Can't find root of device tree\n"); 408 pr_err("Can't find root of device tree\n");
407 goto bail_noprops; 409 goto bail_noprops;
408 } 410 }
409 pfunc_set_vdnap0 = pmf_find_function(root, "set-vdnap0"); 411 pfunc_set_vdnap0 = pmf_find_function(root, "set-vdnap0");
@@ -411,7 +413,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpunode)
411 pmf_find_function(root, "slewing-done"); 413 pmf_find_function(root, "slewing-done");
412 if (pfunc_set_vdnap0 == NULL || 414 if (pfunc_set_vdnap0 == NULL ||
413 pfunc_vdnap0_complete == NULL) { 415 pfunc_vdnap0_complete == NULL) {
414 pr_err("cpufreq: Can't find required platform function\n"); 416 pr_err("Can't find required platform function\n");
415 goto bail_noprops; 417 goto bail_noprops;
416 } 418 }
417 419
@@ -491,7 +493,7 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpunode)
491 if (cpuid != NULL) 493 if (cpuid != NULL)
492 eeprom = of_get_property(cpuid, "cpuid", NULL); 494 eeprom = of_get_property(cpuid, "cpuid", NULL);
493 if (eeprom == NULL) { 495 if (eeprom == NULL) {
494 pr_err("cpufreq: Can't find cpuid EEPROM !\n"); 496 pr_err("Can't find cpuid EEPROM !\n");
495 rc = -ENODEV; 497 rc = -ENODEV;
496 goto bail; 498 goto bail;
497 } 499 }
@@ -509,7 +511,7 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpunode)
509 break; 511 break;
510 } 512 }
511 if (hwclock == NULL) { 513 if (hwclock == NULL) {
512 pr_err("cpufreq: Can't find i2c clock chip !\n"); 514 pr_err("Can't find i2c clock chip !\n");
513 rc = -ENODEV; 515 rc = -ENODEV;
514 goto bail; 516 goto bail;
515 } 517 }
@@ -537,7 +539,7 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpunode)
537 /* Check we have minimum requirements */ 539 /* Check we have minimum requirements */
538 if (pfunc_cpu_getfreq == NULL || pfunc_cpu_setfreq_high == NULL || 540 if (pfunc_cpu_getfreq == NULL || pfunc_cpu_setfreq_high == NULL ||
539 pfunc_cpu_setfreq_low == NULL || pfunc_slewing_done == NULL) { 541 pfunc_cpu_setfreq_low == NULL || pfunc_slewing_done == NULL) {
540 pr_err("cpufreq: Can't find platform functions !\n"); 542 pr_err("Can't find platform functions !\n");
541 rc = -ENODEV; 543 rc = -ENODEV;
542 goto bail; 544 goto bail;
543 } 545 }
@@ -565,7 +567,7 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpunode)
565 /* Get max frequency from device-tree */ 567 /* Get max frequency from device-tree */
566 valp = of_get_property(cpunode, "clock-frequency", NULL); 568 valp = of_get_property(cpunode, "clock-frequency", NULL);
567 if (!valp) { 569 if (!valp) {
568 pr_err("cpufreq: Can't find CPU frequency !\n"); 570 pr_err("Can't find CPU frequency !\n");
569 rc = -ENODEV; 571 rc = -ENODEV;
570 goto bail; 572 goto bail;
571 } 573 }
@@ -581,7 +583,7 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpunode)
581 583
582 /* Check for machines with no useful settings */ 584 /* Check for machines with no useful settings */
583 if (il == ih) { 585 if (il == ih) {
584 pr_warn("cpufreq: No low frequency mode available on this model !\n"); 586 pr_warn("No low frequency mode available on this model !\n");
585 rc = -ENODEV; 587 rc = -ENODEV;
586 goto bail; 588 goto bail;
587 } 589 }
@@ -592,7 +594,7 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpunode)
592 594
593 /* Sanity check */ 595 /* Sanity check */
594 if (min_freq >= max_freq || min_freq < 1000) { 596 if (min_freq >= max_freq || min_freq < 1000) {
595 pr_err("cpufreq: Can't calculate low frequency !\n"); 597 pr_err("Can't calculate low frequency !\n");
596 rc = -ENXIO; 598 rc = -ENXIO;
597 goto bail; 599 goto bail;
598 } 600 }
@@ -651,7 +653,7 @@ static int __init g5_cpufreq_init(void)
651 /* Get first CPU node */ 653 /* Get first CPU node */
652 cpunode = of_cpu_device_node_get(0); 654 cpunode = of_cpu_device_node_get(0);
653 if (cpunode == NULL) { 655 if (cpunode == NULL) {
654 pr_err("cpufreq: Can't find any CPU node\n"); 656 pr_err("Can't find any CPU node\n");
655 return -ENODEV; 657 return -ENODEV;
656 } 658 }
657 659