aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/longhaul.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-04-30 18:50:47 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-04-30 18:50:47 -0400
commit89d4f82aa5ccf08dc28dc8b463844e6d7eed591b (patch)
tree91e7e6ff2c5eda51bb48528244387f32c000433e /drivers/cpufreq/longhaul.c
parent6712d2931933ada259b82f06c03a855b19937074 (diff)
parent4229e1c61a4a7ac21d5d0790f6add1c9b98d33e7 (diff)
Merge branch 'cpufreq-macros' into pm-cpufreq
Diffstat (limited to 'drivers/cpufreq/longhaul.c')
-rw-r--r--drivers/cpufreq/longhaul.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/cpufreq/longhaul.c b/drivers/cpufreq/longhaul.c
index 5c4369b5d834..c913906a719e 100644
--- a/drivers/cpufreq/longhaul.c
+++ b/drivers/cpufreq/longhaul.c
@@ -530,6 +530,7 @@ static int longhaul_get_ranges(void)
530 530
531static void longhaul_setup_voltagescaling(void) 531static void longhaul_setup_voltagescaling(void)
532{ 532{
533 struct cpufreq_frequency_table *freq_pos;
533 union msr_longhaul longhaul; 534 union msr_longhaul longhaul;
534 struct mV_pos minvid, maxvid, vid; 535 struct mV_pos minvid, maxvid, vid;
535 unsigned int j, speed, pos, kHz_step, numvscales; 536 unsigned int j, speed, pos, kHz_step, numvscales;
@@ -608,18 +609,16 @@ static void longhaul_setup_voltagescaling(void)
608 /* Calculate kHz for one voltage step */ 609 /* Calculate kHz for one voltage step */
609 kHz_step = (highest_speed - min_vid_speed) / numvscales; 610 kHz_step = (highest_speed - min_vid_speed) / numvscales;
610 611
611 j = 0; 612 cpufreq_for_each_entry(freq_pos, longhaul_table) {
612 while (longhaul_table[j].frequency != CPUFREQ_TABLE_END) { 613 speed = freq_pos->frequency;
613 speed = longhaul_table[j].frequency;
614 if (speed > min_vid_speed) 614 if (speed > min_vid_speed)
615 pos = (speed - min_vid_speed) / kHz_step + minvid.pos; 615 pos = (speed - min_vid_speed) / kHz_step + minvid.pos;
616 else 616 else
617 pos = minvid.pos; 617 pos = minvid.pos;
618 longhaul_table[j].driver_data |= mV_vrm_table[pos] << 8; 618 freq_pos->driver_data |= mV_vrm_table[pos] << 8;
619 vid = vrm_mV_table[mV_vrm_table[pos]]; 619 vid = vrm_mV_table[mV_vrm_table[pos]];
620 printk(KERN_INFO PFX "f: %d kHz, index: %d, vid: %d mV\n", 620 printk(KERN_INFO PFX "f: %d kHz, index: %d, vid: %d mV\n",
621 speed, j, vid.mV); 621 speed, (int)(freq_pos - longhaul_table), vid.mV);
622 j++;
623 } 622 }
624 623
625 can_scale_voltage = 1; 624 can_scale_voltage = 1;