aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/longhaul.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpufreq/longhaul.c')
-rw-r--r--drivers/cpufreq/longhaul.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/cpufreq/longhaul.c b/drivers/cpufreq/longhaul.c
index 1180d536d1eb..b448638e34de 100644
--- a/drivers/cpufreq/longhaul.c
+++ b/drivers/cpufreq/longhaul.c
@@ -242,7 +242,8 @@ static void do_powersaver(int cx_address, unsigned int mults_index,
242 * Sets a new clock ratio. 242 * Sets a new clock ratio.
243 */ 243 */
244 244
245static void longhaul_setstate(unsigned int table_index) 245static void longhaul_setstate(struct cpufreq_policy *policy,
246 unsigned int table_index)
246{ 247{
247 unsigned int mults_index; 248 unsigned int mults_index;
248 int speed, mult; 249 int speed, mult;
@@ -267,9 +268,8 @@ static void longhaul_setstate(unsigned int table_index)
267 268
268 freqs.old = calc_speed(longhaul_get_cpu_mult()); 269 freqs.old = calc_speed(longhaul_get_cpu_mult());
269 freqs.new = speed; 270 freqs.new = speed;
270 freqs.cpu = 0; /* longhaul.c is UP only driver */
271 271
272 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 272 cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
273 273
274 pr_debug("Setting to FSB:%dMHz Mult:%d.%dx (%s)\n", 274 pr_debug("Setting to FSB:%dMHz Mult:%d.%dx (%s)\n",
275 fsb, mult/10, mult%10, print_speed(speed/1000)); 275 fsb, mult/10, mult%10, print_speed(speed/1000));
@@ -386,7 +386,7 @@ retry_loop:
386 } 386 }
387 } 387 }
388 /* Report true CPU frequency */ 388 /* Report true CPU frequency */
389 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 389 cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
390 390
391 if (!bm_timeout) 391 if (!bm_timeout)
392 printk(KERN_INFO PFX "Warning: Timeout while waiting for " 392 printk(KERN_INFO PFX "Warning: Timeout while waiting for "
@@ -648,7 +648,7 @@ static int longhaul_target(struct cpufreq_policy *policy,
648 return 0; 648 return 0;
649 649
650 if (!can_scale_voltage) 650 if (!can_scale_voltage)
651 longhaul_setstate(table_index); 651 longhaul_setstate(policy, table_index);
652 else { 652 else {
653 /* On test system voltage transitions exceeding single 653 /* On test system voltage transitions exceeding single
654 * step up or down were turning motherboard off. Both 654 * step up or down were turning motherboard off. Both
@@ -663,7 +663,7 @@ static int longhaul_target(struct cpufreq_policy *policy,
663 while (i != table_index) { 663 while (i != table_index) {
664 vid = (longhaul_table[i].index >> 8) & 0x1f; 664 vid = (longhaul_table[i].index >> 8) & 0x1f;
665 if (vid != current_vid) { 665 if (vid != current_vid) {
666 longhaul_setstate(i); 666 longhaul_setstate(policy, i);
667 current_vid = vid; 667 current_vid = vid;
668 msleep(200); 668 msleep(200);
669 } 669 }
@@ -672,7 +672,7 @@ static int longhaul_target(struct cpufreq_policy *policy,
672 else 672 else
673 i--; 673 i--;
674 } 674 }
675 longhaul_setstate(table_index); 675 longhaul_setstate(policy, table_index);
676 } 676 }
677 longhaul_index = table_index; 677 longhaul_index = table_index;
678 return 0; 678 return 0;
@@ -998,15 +998,17 @@ static int __init longhaul_init(void)
998 998
999static void __exit longhaul_exit(void) 999static void __exit longhaul_exit(void)
1000{ 1000{
1001 struct cpufreq_policy *policy = cpufreq_cpu_get(0);
1001 int i; 1002 int i;
1002 1003
1003 for (i = 0; i < numscales; i++) { 1004 for (i = 0; i < numscales; i++) {
1004 if (mults[i] == maxmult) { 1005 if (mults[i] == maxmult) {
1005 longhaul_setstate(i); 1006 longhaul_setstate(policy, i);
1006 break; 1007 break;
1007 } 1008 }
1008 } 1009 }
1009 1010
1011 cpufreq_cpu_put(policy);
1010 cpufreq_unregister_driver(&longhaul_driver); 1012 cpufreq_unregister_driver(&longhaul_driver);
1011 kfree(longhaul_table); 1013 kfree(longhaul_table);
1012} 1014}