aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/cell/cbe_cpufreq.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/cell/cbe_cpufreq.c')
-rw-r--r--arch/powerpc/platforms/cell/cbe_cpufreq.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/powerpc/platforms/cell/cbe_cpufreq.c b/arch/powerpc/platforms/cell/cbe_cpufreq.c
index ac445998d83..ab511d5b65a 100644
--- a/arch/powerpc/platforms/cell/cbe_cpufreq.c
+++ b/arch/powerpc/platforms/cell/cbe_cpufreq.c
@@ -74,6 +74,7 @@ static unsigned int pmi_frequency_limit = 0;
74 74
75static struct of_device *pmi_dev; 75static struct of_device *pmi_dev;
76 76
77#ifdef CONFIG_PPC_PMI
77static int set_pmode_pmi(int cpu, unsigned int pmode) 78static int set_pmode_pmi(int cpu, unsigned int pmode)
78{ 79{
79 int ret; 80 int ret;
@@ -102,7 +103,7 @@ static int set_pmode_pmi(int cpu, unsigned int pmode)
102#endif 103#endif
103 return ret; 104 return ret;
104} 105}
105 106#endif
106 107
107static int get_pmode(int cpu) 108static int get_pmode(int cpu)
108{ 109{
@@ -157,9 +158,11 @@ static int set_pmode_reg(int cpu, unsigned int pmode)
157} 158}
158 159
159static int set_pmode(int cpu, unsigned int slow_mode) { 160static int set_pmode(int cpu, unsigned int slow_mode) {
161#ifdef CONFIG_PPC_PMI
160 if (pmi_dev) 162 if (pmi_dev)
161 return set_pmode_pmi(cpu, slow_mode); 163 return set_pmode_pmi(cpu, slow_mode);
162 else 164 else
165#endif
163 return set_pmode_reg(cpu, slow_mode); 166 return set_pmode_reg(cpu, slow_mode);
164} 167}
165 168
@@ -323,26 +326,28 @@ static struct cpufreq_driver cbe_cpufreq_driver = {
323 326
324static int __init cbe_cpufreq_init(void) 327static int __init cbe_cpufreq_init(void)
325{ 328{
329#ifdef CONFIG_PPC_PMI
326 struct device_node *np; 330 struct device_node *np;
327 331#endif
328 if (!machine_is(cell)) 332 if (!machine_is(cell))
329 return -ENODEV; 333 return -ENODEV;
330 334#ifdef CONFIG_PPC_PMI
331 np = of_find_node_by_type(NULL, "ibm,pmi"); 335 np = of_find_node_by_type(NULL, "ibm,pmi");
332 336
333 pmi_dev = of_find_device_by_node(np); 337 pmi_dev = of_find_device_by_node(np);
334 338
335 if (pmi_dev) 339 if (pmi_dev)
336 pmi_register_handler(pmi_dev, &cbe_pmi_handler); 340 pmi_register_handler(pmi_dev, &cbe_pmi_handler);
337 341#endif
338 return cpufreq_register_driver(&cbe_cpufreq_driver); 342 return cpufreq_register_driver(&cbe_cpufreq_driver);
339} 343}
340 344
341static void __exit cbe_cpufreq_exit(void) 345static void __exit cbe_cpufreq_exit(void)
342{ 346{
347#ifdef CONFIG_PPC_PMI
343 if (pmi_dev) 348 if (pmi_dev)
344 pmi_unregister_handler(pmi_dev, &cbe_pmi_handler); 349 pmi_unregister_handler(pmi_dev, &cbe_pmi_handler);
345 350#endif
346 cpufreq_unregister_driver(&cbe_cpufreq_driver); 351 cpufreq_unregister_driver(&cbe_cpufreq_driver);
347} 352}
348 353