Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cpufreq: rename index as driver_data in cpufreq_frequency_table

The "index" field of struct cpufreq_frequency_table was never an
index and isn't used at all by the cpufreq core. It only is useful
for cpufreq drivers for their internal purposes.

Many people nowadays blindly set it in ascending order with the
assumption that the core will use it, which is a mistake.

Rename it to "driver_data" as that's what its purpose is. All of its
users are updated accordingly.

[rjw: Changelog]
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Viresh Kumar and committed by
Rafael J. Wysocki
50701588 2361be23

+223 -227
+2 -8
Documentation/cpu-freq/cpu-drivers.txt
··· 186 186 frequencies, a "frequency table" with some functions might assist in 187 187 some work of the processor driver. Such a "frequency table" consists 188 188 of an array of struct cpufreq_frequency_table entries, with any value in 189 - "index" you want to use, and the corresponding frequency in 189 + "driver_data" you want to use, and the corresponding frequency in 190 190 "frequency". At the end of the table, you need to add a 191 191 cpufreq_frequency_table entry with frequency set to CPUFREQ_TABLE_END. And 192 192 if you want to skip one entry in the table, set the frequency to ··· 214 214 is the corresponding frequency table helper for the ->target 215 215 stage. Just pass the values to this function, and the unsigned int 216 216 index returns the number of the frequency table entry which contains 217 - the frequency the CPU shall be set to. PLEASE NOTE: This is not the 218 - "index" which is in this cpufreq_table_entry.index, but instead 219 - cpufreq_table[index]. So, the new frequency is 220 - cpufreq_table[index].frequency, and the value you stored into the 221 - frequency table "index" field is 222 - cpufreq_table[index].index. 223 - 217 + the frequency the CPU shall be set to.
+4 -4
arch/arm/mach-davinci/da850.c
··· 1004 1004 1005 1005 #define OPP(freq) \ 1006 1006 { \ 1007 - .index = (unsigned int) &da850_opp_##freq, \ 1007 + .driver_data = (unsigned int) &da850_opp_##freq, \ 1008 1008 .frequency = freq * 1000, \ 1009 1009 } 1010 1010 ··· 1016 1016 OPP(200), 1017 1017 OPP(96), 1018 1018 { 1019 - .index = 0, 1019 + .driver_data = 0, 1020 1020 .frequency = CPUFREQ_TABLE_END, 1021 1021 }, 1022 1022 }; ··· 1044 1044 if (!cvdd) 1045 1045 return -ENODEV; 1046 1046 1047 - opp = (struct da850_opp *) cpufreq_info.freq_table[index].index; 1047 + opp = (struct da850_opp *) cpufreq_info.freq_table[index].driver_data; 1048 1048 1049 1049 return regulator_set_voltage(cvdd, opp->cvdd_min, opp->cvdd_max); 1050 1050 } ··· 1125 1125 struct pll_data *pll = clk->pll_data; 1126 1126 int ret; 1127 1127 1128 - opp = (struct da850_opp *) cpufreq_info.freq_table[index].index; 1128 + opp = (struct da850_opp *) cpufreq_info.freq_table[index].driver_data; 1129 1129 prediv = opp->prediv; 1130 1130 mult = opp->mult; 1131 1131 postdiv = opp->postdiv;
+1 -1
arch/arm/mach-s3c24xx/cpufreq-utils.c
··· 60 60 */ 61 61 void s3c2410_set_fvco(struct s3c_cpufreq_config *cfg) 62 62 { 63 - __raw_writel(cfg->pll.index, S3C2410_MPLLCON); 63 + __raw_writel(cfg->pll.driver_data, S3C2410_MPLLCON); 64 64 }
+2 -2
arch/arm/mach-s3c24xx/cpufreq.c
··· 70 70 cfg->freq.pclk = pclk = clk_get_rate(clk_pclk); 71 71 cfg->freq.armclk = armclk = clk_get_rate(clk_arm); 72 72 73 - cfg->pll.index = __raw_readl(S3C2410_MPLLCON); 73 + cfg->pll.driver_data = __raw_readl(S3C2410_MPLLCON); 74 74 cfg->pll.frequency = fclk; 75 75 76 76 cfg->freq.hclk_tns = 1000000000 / (cfg->freq.hclk / 10); ··· 431 431 static int s3c_cpufreq_suspend(struct cpufreq_policy *policy) 432 432 { 433 433 suspend_pll.frequency = clk_get_rate(_clk_mpll); 434 - suspend_pll.index = __raw_readl(S3C2410_MPLLCON); 434 + suspend_pll.driver_data = __raw_readl(S3C2410_MPLLCON); 435 435 suspend_freq = s3c_cpufreq_get(0) * 1000; 436 436 437 437 return 0;
+27 -27
arch/arm/mach-s3c24xx/pll-s3c2410.c
··· 33 33 #include <plat/cpu-freq-core.h> 34 34 35 35 static struct cpufreq_frequency_table pll_vals_12MHz[] = { 36 - { .frequency = 34000000, .index = PLLVAL(82, 2, 3), }, 37 - { .frequency = 45000000, .index = PLLVAL(82, 1, 3), }, 38 - { .frequency = 51000000, .index = PLLVAL(161, 3, 3), }, 39 - { .frequency = 48000000, .index = PLLVAL(120, 2, 3), }, 40 - { .frequency = 56000000, .index = PLLVAL(142, 2, 3), }, 41 - { .frequency = 68000000, .index = PLLVAL(82, 2, 2), }, 42 - { .frequency = 79000000, .index = PLLVAL(71, 1, 2), }, 43 - { .frequency = 85000000, .index = PLLVAL(105, 2, 2), }, 44 - { .frequency = 90000000, .index = PLLVAL(112, 2, 2), }, 45 - { .frequency = 101000000, .index = PLLVAL(127, 2, 2), }, 46 - { .frequency = 113000000, .index = PLLVAL(105, 1, 2), }, 47 - { .frequency = 118000000, .index = PLLVAL(150, 2, 2), }, 48 - { .frequency = 124000000, .index = PLLVAL(116, 1, 2), }, 49 - { .frequency = 135000000, .index = PLLVAL(82, 2, 1), }, 50 - { .frequency = 147000000, .index = PLLVAL(90, 2, 1), }, 51 - { .frequency = 152000000, .index = PLLVAL(68, 1, 1), }, 52 - { .frequency = 158000000, .index = PLLVAL(71, 1, 1), }, 53 - { .frequency = 170000000, .index = PLLVAL(77, 1, 1), }, 54 - { .frequency = 180000000, .index = PLLVAL(82, 1, 1), }, 55 - { .frequency = 186000000, .index = PLLVAL(85, 1, 1), }, 56 - { .frequency = 192000000, .index = PLLVAL(88, 1, 1), }, 57 - { .frequency = 203000000, .index = PLLVAL(161, 3, 1), }, 36 + { .frequency = 34000000, .driver_data = PLLVAL(82, 2, 3), }, 37 + { .frequency = 45000000, .driver_data = PLLVAL(82, 1, 3), }, 38 + { .frequency = 51000000, .driver_data = PLLVAL(161, 3, 3), }, 39 + { .frequency = 48000000, .driver_data = PLLVAL(120, 2, 3), }, 40 + { .frequency = 56000000, .driver_data = PLLVAL(142, 2, 3), }, 41 + { .frequency = 68000000, .driver_data = PLLVAL(82, 2, 2), }, 42 + { .frequency = 79000000, .driver_data = PLLVAL(71, 1, 2), }, 43 + { .frequency = 85000000, .driver_data = PLLVAL(105, 2, 2), }, 44 + { .frequency = 90000000, .driver_data = PLLVAL(112, 2, 2), }, 45 + { .frequency = 101000000, .driver_data = PLLVAL(127, 2, 2), }, 46 + { .frequency = 113000000, .driver_data = PLLVAL(105, 1, 2), }, 47 + { .frequency = 118000000, .driver_data = PLLVAL(150, 2, 2), }, 48 + { .frequency = 124000000, .driver_data = PLLVAL(116, 1, 2), }, 49 + { .frequency = 135000000, .driver_data = PLLVAL(82, 2, 1), }, 50 + { .frequency = 147000000, .driver_data = PLLVAL(90, 2, 1), }, 51 + { .frequency = 152000000, .driver_data = PLLVAL(68, 1, 1), }, 52 + { .frequency = 158000000, .driver_data = PLLVAL(71, 1, 1), }, 53 + { .frequency = 170000000, .driver_data = PLLVAL(77, 1, 1), }, 54 + { .frequency = 180000000, .driver_data = PLLVAL(82, 1, 1), }, 55 + { .frequency = 186000000, .driver_data = PLLVAL(85, 1, 1), }, 56 + { .frequency = 192000000, .driver_data = PLLVAL(88, 1, 1), }, 57 + { .frequency = 203000000, .driver_data = PLLVAL(161, 3, 1), }, 58 58 59 59 /* 2410A extras */ 60 60 61 - { .frequency = 210000000, .index = PLLVAL(132, 2, 1), }, 62 - { .frequency = 226000000, .index = PLLVAL(105, 1, 1), }, 63 - { .frequency = 266000000, .index = PLLVAL(125, 1, 1), }, 64 - { .frequency = 268000000, .index = PLLVAL(126, 1, 1), }, 65 - { .frequency = 270000000, .index = PLLVAL(127, 1, 1), }, 61 + { .frequency = 210000000, .driver_data = PLLVAL(132, 2, 1), }, 62 + { .frequency = 226000000, .driver_data = PLLVAL(105, 1, 1), }, 63 + { .frequency = 266000000, .driver_data = PLLVAL(125, 1, 1), }, 64 + { .frequency = 268000000, .driver_data = PLLVAL(126, 1, 1), }, 65 + { .frequency = 270000000, .driver_data = PLLVAL(127, 1, 1), }, 66 66 }; 67 67 68 68 static int s3c2410_plls_add(struct device *dev, struct subsys_interface *sif)
+27 -27
arch/arm/mach-s3c24xx/pll-s3c2440-12000000.c
··· 21 21 #include <plat/cpu-freq-core.h> 22 22 23 23 static struct cpufreq_frequency_table s3c2440_plls_12[] __initdata = { 24 - { .frequency = 75000000, .index = PLLVAL(0x75, 3, 3), }, /* FVco 600.000000 */ 25 - { .frequency = 80000000, .index = PLLVAL(0x98, 4, 3), }, /* FVco 640.000000 */ 26 - { .frequency = 90000000, .index = PLLVAL(0x70, 2, 3), }, /* FVco 720.000000 */ 27 - { .frequency = 100000000, .index = PLLVAL(0x5c, 1, 3), }, /* FVco 800.000000 */ 28 - { .frequency = 110000000, .index = PLLVAL(0x66, 1, 3), }, /* FVco 880.000000 */ 29 - { .frequency = 120000000, .index = PLLVAL(0x70, 1, 3), }, /* FVco 960.000000 */ 30 - { .frequency = 150000000, .index = PLLVAL(0x75, 3, 2), }, /* FVco 600.000000 */ 31 - { .frequency = 160000000, .index = PLLVAL(0x98, 4, 2), }, /* FVco 640.000000 */ 32 - { .frequency = 170000000, .index = PLLVAL(0x4d, 1, 2), }, /* FVco 680.000000 */ 33 - { .frequency = 180000000, .index = PLLVAL(0x70, 2, 2), }, /* FVco 720.000000 */ 34 - { .frequency = 190000000, .index = PLLVAL(0x57, 1, 2), }, /* FVco 760.000000 */ 35 - { .frequency = 200000000, .index = PLLVAL(0x5c, 1, 2), }, /* FVco 800.000000 */ 36 - { .frequency = 210000000, .index = PLLVAL(0x84, 2, 2), }, /* FVco 840.000000 */ 37 - { .frequency = 220000000, .index = PLLVAL(0x66, 1, 2), }, /* FVco 880.000000 */ 38 - { .frequency = 230000000, .index = PLLVAL(0x6b, 1, 2), }, /* FVco 920.000000 */ 39 - { .frequency = 240000000, .index = PLLVAL(0x70, 1, 2), }, /* FVco 960.000000 */ 40 - { .frequency = 300000000, .index = PLLVAL(0x75, 3, 1), }, /* FVco 600.000000 */ 41 - { .frequency = 310000000, .index = PLLVAL(0x93, 4, 1), }, /* FVco 620.000000 */ 42 - { .frequency = 320000000, .index = PLLVAL(0x98, 4, 1), }, /* FVco 640.000000 */ 43 - { .frequency = 330000000, .index = PLLVAL(0x66, 2, 1), }, /* FVco 660.000000 */ 44 - { .frequency = 340000000, .index = PLLVAL(0x4d, 1, 1), }, /* FVco 680.000000 */ 45 - { .frequency = 350000000, .index = PLLVAL(0xa7, 4, 1), }, /* FVco 700.000000 */ 46 - { .frequency = 360000000, .index = PLLVAL(0x70, 2, 1), }, /* FVco 720.000000 */ 47 - { .frequency = 370000000, .index = PLLVAL(0xb1, 4, 1), }, /* FVco 740.000000 */ 48 - { .frequency = 380000000, .index = PLLVAL(0x57, 1, 1), }, /* FVco 760.000000 */ 49 - { .frequency = 390000000, .index = PLLVAL(0x7a, 2, 1), }, /* FVco 780.000000 */ 50 - { .frequency = 400000000, .index = PLLVAL(0x5c, 1, 1), }, /* FVco 800.000000 */ 24 + { .frequency = 75000000, .driver_data = PLLVAL(0x75, 3, 3), }, /* FVco 600.000000 */ 25 + { .frequency = 80000000, .driver_data = PLLVAL(0x98, 4, 3), }, /* FVco 640.000000 */ 26 + { .frequency = 90000000, .driver_data = PLLVAL(0x70, 2, 3), }, /* FVco 720.000000 */ 27 + { .frequency = 100000000, .driver_data = PLLVAL(0x5c, 1, 3), }, /* FVco 800.000000 */ 28 + { .frequency = 110000000, .driver_data = PLLVAL(0x66, 1, 3), }, /* FVco 880.000000 */ 29 + { .frequency = 120000000, .driver_data = PLLVAL(0x70, 1, 3), }, /* FVco 960.000000 */ 30 + { .frequency = 150000000, .driver_data = PLLVAL(0x75, 3, 2), }, /* FVco 600.000000 */ 31 + { .frequency = 160000000, .driver_data = PLLVAL(0x98, 4, 2), }, /* FVco 640.000000 */ 32 + { .frequency = 170000000, .driver_data = PLLVAL(0x4d, 1, 2), }, /* FVco 680.000000 */ 33 + { .frequency = 180000000, .driver_data = PLLVAL(0x70, 2, 2), }, /* FVco 720.000000 */ 34 + { .frequency = 190000000, .driver_data = PLLVAL(0x57, 1, 2), }, /* FVco 760.000000 */ 35 + { .frequency = 200000000, .driver_data = PLLVAL(0x5c, 1, 2), }, /* FVco 800.000000 */ 36 + { .frequency = 210000000, .driver_data = PLLVAL(0x84, 2, 2), }, /* FVco 840.000000 */ 37 + { .frequency = 220000000, .driver_data = PLLVAL(0x66, 1, 2), }, /* FVco 880.000000 */ 38 + { .frequency = 230000000, .driver_data = PLLVAL(0x6b, 1, 2), }, /* FVco 920.000000 */ 39 + { .frequency = 240000000, .driver_data = PLLVAL(0x70, 1, 2), }, /* FVco 960.000000 */ 40 + { .frequency = 300000000, .driver_data = PLLVAL(0x75, 3, 1), }, /* FVco 600.000000 */ 41 + { .frequency = 310000000, .driver_data = PLLVAL(0x93, 4, 1), }, /* FVco 620.000000 */ 42 + { .frequency = 320000000, .driver_data = PLLVAL(0x98, 4, 1), }, /* FVco 640.000000 */ 43 + { .frequency = 330000000, .driver_data = PLLVAL(0x66, 2, 1), }, /* FVco 660.000000 */ 44 + { .frequency = 340000000, .driver_data = PLLVAL(0x4d, 1, 1), }, /* FVco 680.000000 */ 45 + { .frequency = 350000000, .driver_data = PLLVAL(0xa7, 4, 1), }, /* FVco 700.000000 */ 46 + { .frequency = 360000000, .driver_data = PLLVAL(0x70, 2, 1), }, /* FVco 720.000000 */ 47 + { .frequency = 370000000, .driver_data = PLLVAL(0xb1, 4, 1), }, /* FVco 740.000000 */ 48 + { .frequency = 380000000, .driver_data = PLLVAL(0x57, 1, 1), }, /* FVco 760.000000 */ 49 + { .frequency = 390000000, .driver_data = PLLVAL(0x7a, 2, 1), }, /* FVco 780.000000 */ 50 + { .frequency = 400000000, .driver_data = PLLVAL(0x5c, 1, 1), }, /* FVco 800.000000 */ 51 51 }; 52 52 53 53 static int s3c2440_plls12_add(struct device *dev, struct subsys_interface *sif)
+55 -55
arch/arm/mach-s3c24xx/pll-s3c2440-16934400.c
··· 21 21 #include <plat/cpu-freq-core.h> 22 22 23 23 static struct cpufreq_frequency_table s3c2440_plls_169344[] __initdata = { 24 - { .frequency = 78019200, .index = PLLVAL(121, 5, 3), }, /* FVco 624.153600 */ 25 - { .frequency = 84067200, .index = PLLVAL(131, 5, 3), }, /* FVco 672.537600 */ 26 - { .frequency = 90115200, .index = PLLVAL(141, 5, 3), }, /* FVco 720.921600 */ 27 - { .frequency = 96163200, .index = PLLVAL(151, 5, 3), }, /* FVco 769.305600 */ 28 - { .frequency = 102135600, .index = PLLVAL(185, 6, 3), }, /* FVco 817.084800 */ 29 - { .frequency = 108259200, .index = PLLVAL(171, 5, 3), }, /* FVco 866.073600 */ 30 - { .frequency = 114307200, .index = PLLVAL(127, 3, 3), }, /* FVco 914.457600 */ 31 - { .frequency = 120234240, .index = PLLVAL(134, 3, 3), }, /* FVco 961.873920 */ 32 - { .frequency = 126161280, .index = PLLVAL(141, 3, 3), }, /* FVco 1009.290240 */ 33 - { .frequency = 132088320, .index = PLLVAL(148, 3, 3), }, /* FVco 1056.706560 */ 34 - { .frequency = 138015360, .index = PLLVAL(155, 3, 3), }, /* FVco 1104.122880 */ 35 - { .frequency = 144789120, .index = PLLVAL(163, 3, 3), }, /* FVco 1158.312960 */ 36 - { .frequency = 150100363, .index = PLLVAL(187, 9, 2), }, /* FVco 600.401454 */ 37 - { .frequency = 156038400, .index = PLLVAL(121, 5, 2), }, /* FVco 624.153600 */ 38 - { .frequency = 162086400, .index = PLLVAL(126, 5, 2), }, /* FVco 648.345600 */ 39 - { .frequency = 168134400, .index = PLLVAL(131, 5, 2), }, /* FVco 672.537600 */ 40 - { .frequency = 174048000, .index = PLLVAL(177, 7, 2), }, /* FVco 696.192000 */ 41 - { .frequency = 180230400, .index = PLLVAL(141, 5, 2), }, /* FVco 720.921600 */ 42 - { .frequency = 186278400, .index = PLLVAL(124, 4, 2), }, /* FVco 745.113600 */ 43 - { .frequency = 192326400, .index = PLLVAL(151, 5, 2), }, /* FVco 769.305600 */ 44 - { .frequency = 198132480, .index = PLLVAL(109, 3, 2), }, /* FVco 792.529920 */ 45 - { .frequency = 204271200, .index = PLLVAL(185, 6, 2), }, /* FVco 817.084800 */ 46 - { .frequency = 210268800, .index = PLLVAL(141, 4, 2), }, /* FVco 841.075200 */ 47 - { .frequency = 216518400, .index = PLLVAL(171, 5, 2), }, /* FVco 866.073600 */ 48 - { .frequency = 222264000, .index = PLLVAL(97, 2, 2), }, /* FVco 889.056000 */ 49 - { .frequency = 228614400, .index = PLLVAL(127, 3, 2), }, /* FVco 914.457600 */ 50 - { .frequency = 234259200, .index = PLLVAL(158, 4, 2), }, /* FVco 937.036800 */ 51 - { .frequency = 240468480, .index = PLLVAL(134, 3, 2), }, /* FVco 961.873920 */ 52 - { .frequency = 246960000, .index = PLLVAL(167, 4, 2), }, /* FVco 987.840000 */ 53 - { .frequency = 252322560, .index = PLLVAL(141, 3, 2), }, /* FVco 1009.290240 */ 54 - { .frequency = 258249600, .index = PLLVAL(114, 2, 2), }, /* FVco 1032.998400 */ 55 - { .frequency = 264176640, .index = PLLVAL(148, 3, 2), }, /* FVco 1056.706560 */ 56 - { .frequency = 270950400, .index = PLLVAL(120, 2, 2), }, /* FVco 1083.801600 */ 57 - { .frequency = 276030720, .index = PLLVAL(155, 3, 2), }, /* FVco 1104.122880 */ 58 - { .frequency = 282240000, .index = PLLVAL(92, 1, 2), }, /* FVco 1128.960000 */ 59 - { .frequency = 289578240, .index = PLLVAL(163, 3, 2), }, /* FVco 1158.312960 */ 60 - { .frequency = 294235200, .index = PLLVAL(131, 2, 2), }, /* FVco 1176.940800 */ 61 - { .frequency = 300200727, .index = PLLVAL(187, 9, 1), }, /* FVco 600.401454 */ 62 - { .frequency = 306358690, .index = PLLVAL(191, 9, 1), }, /* FVco 612.717380 */ 63 - { .frequency = 312076800, .index = PLLVAL(121, 5, 1), }, /* FVco 624.153600 */ 64 - { .frequency = 318366720, .index = PLLVAL(86, 3, 1), }, /* FVco 636.733440 */ 65 - { .frequency = 324172800, .index = PLLVAL(126, 5, 1), }, /* FVco 648.345600 */ 66 - { .frequency = 330220800, .index = PLLVAL(109, 4, 1), }, /* FVco 660.441600 */ 67 - { .frequency = 336268800, .index = PLLVAL(131, 5, 1), }, /* FVco 672.537600 */ 68 - { .frequency = 342074880, .index = PLLVAL(93, 3, 1), }, /* FVco 684.149760 */ 69 - { .frequency = 348096000, .index = PLLVAL(177, 7, 1), }, /* FVco 696.192000 */ 70 - { .frequency = 355622400, .index = PLLVAL(118, 4, 1), }, /* FVco 711.244800 */ 71 - { .frequency = 360460800, .index = PLLVAL(141, 5, 1), }, /* FVco 720.921600 */ 72 - { .frequency = 366206400, .index = PLLVAL(165, 6, 1), }, /* FVco 732.412800 */ 73 - { .frequency = 372556800, .index = PLLVAL(124, 4, 1), }, /* FVco 745.113600 */ 74 - { .frequency = 378201600, .index = PLLVAL(126, 4, 1), }, /* FVco 756.403200 */ 75 - { .frequency = 384652800, .index = PLLVAL(151, 5, 1), }, /* FVco 769.305600 */ 76 - { .frequency = 391608000, .index = PLLVAL(177, 6, 1), }, /* FVco 783.216000 */ 77 - { .frequency = 396264960, .index = PLLVAL(109, 3, 1), }, /* FVco 792.529920 */ 78 - { .frequency = 402192000, .index = PLLVAL(87, 2, 1), }, /* FVco 804.384000 */ 24 + { .frequency = 78019200, .driver_data = PLLVAL(121, 5, 3), }, /* FVco 624.153600 */ 25 + { .frequency = 84067200, .driver_data = PLLVAL(131, 5, 3), }, /* FVco 672.537600 */ 26 + { .frequency = 90115200, .driver_data = PLLVAL(141, 5, 3), }, /* FVco 720.921600 */ 27 + { .frequency = 96163200, .driver_data = PLLVAL(151, 5, 3), }, /* FVco 769.305600 */ 28 + { .frequency = 102135600, .driver_data = PLLVAL(185, 6, 3), }, /* FVco 817.084800 */ 29 + { .frequency = 108259200, .driver_data = PLLVAL(171, 5, 3), }, /* FVco 866.073600 */ 30 + { .frequency = 114307200, .driver_data = PLLVAL(127, 3, 3), }, /* FVco 914.457600 */ 31 + { .frequency = 120234240, .driver_data = PLLVAL(134, 3, 3), }, /* FVco 961.873920 */ 32 + { .frequency = 126161280, .driver_data = PLLVAL(141, 3, 3), }, /* FVco 1009.290240 */ 33 + { .frequency = 132088320, .driver_data = PLLVAL(148, 3, 3), }, /* FVco 1056.706560 */ 34 + { .frequency = 138015360, .driver_data = PLLVAL(155, 3, 3), }, /* FVco 1104.122880 */ 35 + { .frequency = 144789120, .driver_data = PLLVAL(163, 3, 3), }, /* FVco 1158.312960 */ 36 + { .frequency = 150100363, .driver_data = PLLVAL(187, 9, 2), }, /* FVco 600.401454 */ 37 + { .frequency = 156038400, .driver_data = PLLVAL(121, 5, 2), }, /* FVco 624.153600 */ 38 + { .frequency = 162086400, .driver_data = PLLVAL(126, 5, 2), }, /* FVco 648.345600 */ 39 + { .frequency = 168134400, .driver_data = PLLVAL(131, 5, 2), }, /* FVco 672.537600 */ 40 + { .frequency = 174048000, .driver_data = PLLVAL(177, 7, 2), }, /* FVco 696.192000 */ 41 + { .frequency = 180230400, .driver_data = PLLVAL(141, 5, 2), }, /* FVco 720.921600 */ 42 + { .frequency = 186278400, .driver_data = PLLVAL(124, 4, 2), }, /* FVco 745.113600 */ 43 + { .frequency = 192326400, .driver_data = PLLVAL(151, 5, 2), }, /* FVco 769.305600 */ 44 + { .frequency = 198132480, .driver_data = PLLVAL(109, 3, 2), }, /* FVco 792.529920 */ 45 + { .frequency = 204271200, .driver_data = PLLVAL(185, 6, 2), }, /* FVco 817.084800 */ 46 + { .frequency = 210268800, .driver_data = PLLVAL(141, 4, 2), }, /* FVco 841.075200 */ 47 + { .frequency = 216518400, .driver_data = PLLVAL(171, 5, 2), }, /* FVco 866.073600 */ 48 + { .frequency = 222264000, .driver_data = PLLVAL(97, 2, 2), }, /* FVco 889.056000 */ 49 + { .frequency = 228614400, .driver_data = PLLVAL(127, 3, 2), }, /* FVco 914.457600 */ 50 + { .frequency = 234259200, .driver_data = PLLVAL(158, 4, 2), }, /* FVco 937.036800 */ 51 + { .frequency = 240468480, .driver_data = PLLVAL(134, 3, 2), }, /* FVco 961.873920 */ 52 + { .frequency = 246960000, .driver_data = PLLVAL(167, 4, 2), }, /* FVco 987.840000 */ 53 + { .frequency = 252322560, .driver_data = PLLVAL(141, 3, 2), }, /* FVco 1009.290240 */ 54 + { .frequency = 258249600, .driver_data = PLLVAL(114, 2, 2), }, /* FVco 1032.998400 */ 55 + { .frequency = 264176640, .driver_data = PLLVAL(148, 3, 2), }, /* FVco 1056.706560 */ 56 + { .frequency = 270950400, .driver_data = PLLVAL(120, 2, 2), }, /* FVco 1083.801600 */ 57 + { .frequency = 276030720, .driver_data = PLLVAL(155, 3, 2), }, /* FVco 1104.122880 */ 58 + { .frequency = 282240000, .driver_data = PLLVAL(92, 1, 2), }, /* FVco 1128.960000 */ 59 + { .frequency = 289578240, .driver_data = PLLVAL(163, 3, 2), }, /* FVco 1158.312960 */ 60 + { .frequency = 294235200, .driver_data = PLLVAL(131, 2, 2), }, /* FVco 1176.940800 */ 61 + { .frequency = 300200727, .driver_data = PLLVAL(187, 9, 1), }, /* FVco 600.401454 */ 62 + { .frequency = 306358690, .driver_data = PLLVAL(191, 9, 1), }, /* FVco 612.717380 */ 63 + { .frequency = 312076800, .driver_data = PLLVAL(121, 5, 1), }, /* FVco 624.153600 */ 64 + { .frequency = 318366720, .driver_data = PLLVAL(86, 3, 1), }, /* FVco 636.733440 */ 65 + { .frequency = 324172800, .driver_data = PLLVAL(126, 5, 1), }, /* FVco 648.345600 */ 66 + { .frequency = 330220800, .driver_data = PLLVAL(109, 4, 1), }, /* FVco 660.441600 */ 67 + { .frequency = 336268800, .driver_data = PLLVAL(131, 5, 1), }, /* FVco 672.537600 */ 68 + { .frequency = 342074880, .driver_data = PLLVAL(93, 3, 1), }, /* FVco 684.149760 */ 69 + { .frequency = 348096000, .driver_data = PLLVAL(177, 7, 1), }, /* FVco 696.192000 */ 70 + { .frequency = 355622400, .driver_data = PLLVAL(118, 4, 1), }, /* FVco 711.244800 */ 71 + { .frequency = 360460800, .driver_data = PLLVAL(141, 5, 1), }, /* FVco 720.921600 */ 72 + { .frequency = 366206400, .driver_data = PLLVAL(165, 6, 1), }, /* FVco 732.412800 */ 73 + { .frequency = 372556800, .driver_data = PLLVAL(124, 4, 1), }, /* FVco 745.113600 */ 74 + { .frequency = 378201600, .driver_data = PLLVAL(126, 4, 1), }, /* FVco 756.403200 */ 75 + { .frequency = 384652800, .driver_data = PLLVAL(151, 5, 1), }, /* FVco 769.305600 */ 76 + { .frequency = 391608000, .driver_data = PLLVAL(177, 6, 1), }, /* FVco 783.216000 */ 77 + { .frequency = 396264960, .driver_data = PLLVAL(109, 3, 1), }, /* FVco 792.529920 */ 78 + { .frequency = 402192000, .driver_data = PLLVAL(87, 2, 1), }, /* FVco 804.384000 */ 79 79 }; 80 80 81 81 static int s3c2440_plls169344_add(struct device *dev,
+3 -3
arch/arm/mach-shmobile/clock-sh7372.c
··· 142 142 /* Initialise PLLC2 frequency table */ 143 143 for (i = 0; i < ARRAY_SIZE(pllc2_freq_table) - 2; i++) { 144 144 pllc2_freq_table[i].frequency = clk->parent->rate * (i + 20) * 2; 145 - pllc2_freq_table[i].index = i; 145 + pllc2_freq_table[i].driver_data = i; 146 146 } 147 147 148 148 /* This is a special entry - switching PLL off makes it a repeater */ 149 149 pllc2_freq_table[i].frequency = clk->parent->rate; 150 - pllc2_freq_table[i].index = i; 150 + pllc2_freq_table[i].driver_data = i; 151 151 152 152 pllc2_freq_table[++i].frequency = CPUFREQ_TABLE_END; 153 - pllc2_freq_table[i].index = i; 153 + pllc2_freq_table[i].driver_data = i; 154 154 } 155 155 156 156 static unsigned long pllc2_recalc(struct clk *clk)
+1 -1
arch/arm/plat-samsung/include/plat/cpu-freq-core.h
··· 285 285 s3c_freq_dbg("%s: { %d = %u kHz }\n", 286 286 __func__, index, freq); 287 287 288 - table[index].index = index; 288 + table[index].driver_data = index; 289 289 table[index].frequency = freq; 290 290 } 291 291
+2 -1
arch/mips/loongson/lemote-2f/clock.c
··· 121 121 clk->rate = rate; 122 122 123 123 regval = LOONGSON_CHIPCFG0; 124 - regval = (regval & ~0x7) | (loongson2_clockmod_table[i].index - 1); 124 + regval = (regval & ~0x7) | 125 + (loongson2_clockmod_table[i].driver_data - 1); 125 126 LOONGSON_CHIPCFG0 = regval; 126 127 127 128 return ret;
+3 -2
arch/powerpc/platforms/pasemi/cpufreq.c
··· 204 204 205 205 /* initialize frequency table */ 206 206 for (i=0; pas_freqs[i].frequency!=CPUFREQ_TABLE_END; i++) { 207 - pas_freqs[i].frequency = get_astate_freq(pas_freqs[i].index) * 100000; 207 + pas_freqs[i].frequency = 208 + get_astate_freq(pas_freqs[i].driver_data) * 100000; 208 209 pr_debug("%d: %d\n", i, pas_freqs[i].frequency); 209 210 } 210 211 ··· 281 280 pr_debug("setting frequency for cpu %d to %d kHz, 1/%d of max frequency\n", 282 281 policy->cpu, 283 282 pas_freqs[pas_astate_new].frequency, 284 - pas_freqs[pas_astate_new].index); 283 + pas_freqs[pas_astate_new].driver_data); 285 284 286 285 current_astate = pas_astate_new; 287 286
+2 -2
drivers/base/power/opp.c
··· 648 648 649 649 list_for_each_entry(opp, &dev_opp->opp_list, node) { 650 650 if (opp->available) { 651 - freq_table[i].index = i; 651 + freq_table[i].driver_data = i; 652 652 freq_table[i].frequency = opp->rate / 1000; 653 653 i++; 654 654 } 655 655 } 656 656 mutex_unlock(&dev_opp_list_lock); 657 657 658 - freq_table[i].index = i; 658 + freq_table[i].driver_data = i; 659 659 freq_table[i].frequency = CPUFREQ_TABLE_END; 660 660 661 661 *table = &freq_table[0];
+3 -3
drivers/cpufreq/acpi-cpufreq.c
··· 232 232 perf = data->acpi_data; 233 233 234 234 for (i = 0; data->freq_table[i].frequency != CPUFREQ_TABLE_END; i++) { 235 - if (msr == perf->states[data->freq_table[i].index].status) 235 + if (msr == perf->states[data->freq_table[i].driver_data].status) 236 236 return data->freq_table[i].frequency; 237 237 } 238 238 return data->freq_table[0].frequency; ··· 442 442 goto out; 443 443 } 444 444 445 - next_perf_state = data->freq_table[next_state].index; 445 + next_perf_state = data->freq_table[next_state].driver_data; 446 446 if (perf->state == next_perf_state) { 447 447 if (unlikely(data->resume)) { 448 448 pr_debug("Called after resume, resetting to P%d\n", ··· 811 811 data->freq_table[valid_states-1].frequency / 1000) 812 812 continue; 813 813 814 - data->freq_table[valid_states].index = i; 814 + data->freq_table[valid_states].driver_data = i; 815 815 data->freq_table[valid_states].frequency = 816 816 perf->states[i].core_frequency * 1000; 817 817 valid_states++;
+5 -5
drivers/cpufreq/blackfin-cpufreq.c
··· 20 20 21 21 22 22 /* this is the table of CCLK frequencies, in Hz */ 23 - /* .index is the entry in the auxiliary dpm_state_table[] */ 23 + /* .driver_data is the entry in the auxiliary dpm_state_table[] */ 24 24 static struct cpufreq_frequency_table bfin_freq_table[] = { 25 25 { 26 26 .frequency = CPUFREQ_TABLE_END, 27 - .index = 0, 27 + .driver_data = 0, 28 28 }, 29 29 { 30 30 .frequency = CPUFREQ_TABLE_END, 31 - .index = 1, 31 + .driver_data = 1, 32 32 }, 33 33 { 34 34 .frequency = CPUFREQ_TABLE_END, 35 - .index = 2, 35 + .driver_data = 2, 36 36 }, 37 37 { 38 38 .frequency = CPUFREQ_TABLE_END, 39 - .index = 0, 39 + .driver_data = 0, 40 40 }, 41 41 }; 42 42
+4 -4
drivers/cpufreq/e_powersaver.c
··· 188 188 } 189 189 190 190 /* Make frequency transition */ 191 - dest_state = centaur->freq_table[newstate].index & 0xffff; 191 + dest_state = centaur->freq_table[newstate].driver_data & 0xffff; 192 192 ret = eps_set_state(centaur, policy, dest_state); 193 193 if (ret) 194 194 printk(KERN_ERR "eps: Timeout!\n"); ··· 380 380 f_table = &centaur->freq_table[0]; 381 381 if (brand != EPS_BRAND_C7M) { 382 382 f_table[0].frequency = fsb * min_multiplier; 383 - f_table[0].index = (min_multiplier << 8) | min_voltage; 383 + f_table[0].driver_data = (min_multiplier << 8) | min_voltage; 384 384 f_table[1].frequency = fsb * max_multiplier; 385 - f_table[1].index = (max_multiplier << 8) | max_voltage; 385 + f_table[1].driver_data = (max_multiplier << 8) | max_voltage; 386 386 f_table[2].frequency = CPUFREQ_TABLE_END; 387 387 } else { 388 388 k = 0; ··· 391 391 for (i = min_multiplier; i <= max_multiplier; i++) { 392 392 voltage = (k * step) / 256 + min_voltage; 393 393 f_table[k].frequency = fsb * i; 394 - f_table[k].index = (i << 8) | voltage; 394 + f_table[k].driver_data = (i << 8) | voltage; 395 395 k++; 396 396 } 397 397 f_table[k].frequency = CPUFREQ_TABLE_END;
+13 -13
drivers/cpufreq/freq_table.c
··· 34 34 35 35 continue; 36 36 } 37 - pr_debug("table entry %u: %u kHz, %u index\n", 38 - i, freq, table[i].index); 37 + pr_debug("table entry %u: %u kHz, %u driver_data\n", 38 + i, freq, table[i].driver_data); 39 39 if (freq < min_freq) 40 40 min_freq = freq; 41 41 if (freq > max_freq) ··· 97 97 unsigned int *index) 98 98 { 99 99 struct cpufreq_frequency_table optimal = { 100 - .index = ~0, 100 + .driver_data = ~0, 101 101 .frequency = 0, 102 102 }; 103 103 struct cpufreq_frequency_table suboptimal = { 104 - .index = ~0, 104 + .driver_data = ~0, 105 105 .frequency = 0, 106 106 }; 107 107 unsigned int i; ··· 129 129 if (freq <= target_freq) { 130 130 if (freq >= optimal.frequency) { 131 131 optimal.frequency = freq; 132 - optimal.index = i; 132 + optimal.driver_data = i; 133 133 } 134 134 } else { 135 135 if (freq <= suboptimal.frequency) { 136 136 suboptimal.frequency = freq; 137 - suboptimal.index = i; 137 + suboptimal.driver_data = i; 138 138 } 139 139 } 140 140 break; ··· 142 142 if (freq >= target_freq) { 143 143 if (freq <= optimal.frequency) { 144 144 optimal.frequency = freq; 145 - optimal.index = i; 145 + optimal.driver_data = i; 146 146 } 147 147 } else { 148 148 if (freq >= suboptimal.frequency) { 149 149 suboptimal.frequency = freq; 150 - suboptimal.index = i; 150 + suboptimal.driver_data = i; 151 151 } 152 152 } 153 153 break; 154 154 } 155 155 } 156 - if (optimal.index > i) { 157 - if (suboptimal.index > i) 156 + if (optimal.driver_data > i) { 157 + if (suboptimal.driver_data > i) 158 158 return -EINVAL; 159 - *index = suboptimal.index; 159 + *index = suboptimal.driver_data; 160 160 } else 161 - *index = optimal.index; 161 + *index = optimal.driver_data; 162 162 163 163 pr_debug("target is %u (%u kHz, %u)\n", *index, table[*index].frequency, 164 - table[*index].index); 164 + table[*index].driver_data); 165 165 166 166 return 0; 167 167 }
+1 -1
drivers/cpufreq/ia64-acpi-cpufreq.c
··· 326 326 /* table init */ 327 327 for (i = 0; i <= data->acpi_data.state_count; i++) 328 328 { 329 - data->freq_table[i].index = i; 329 + data->freq_table[i].driver_data = i; 330 330 if (i < data->acpi_data.state_count) { 331 331 data->freq_table[i].frequency = 332 332 data->acpi_data.states[i].core_frequency * 1000;
+1 -1
drivers/cpufreq/kirkwood-cpufreq.c
··· 59 59 unsigned int index) 60 60 { 61 61 struct cpufreq_freqs freqs; 62 - unsigned int state = kirkwood_freq_table[index].index; 62 + unsigned int state = kirkwood_freq_table[index].driver_data; 63 63 unsigned long reg; 64 64 65 65 freqs.old = kirkwood_cpufreq_get_cpu_frequency(0);
+8 -8
drivers/cpufreq/longhaul.c
··· 254 254 u32 bm_timeout = 1000; 255 255 unsigned int dir = 0; 256 256 257 - mults_index = longhaul_table[table_index].index; 257 + mults_index = longhaul_table[table_index].driver_data; 258 258 /* Safety precautions */ 259 259 mult = mults[mults_index & 0x1f]; 260 260 if (mult == -1) ··· 487 487 if (ratio > maxmult || ratio < minmult) 488 488 continue; 489 489 longhaul_table[k].frequency = calc_speed(ratio); 490 - longhaul_table[k].index = j; 490 + longhaul_table[k].driver_data = j; 491 491 k++; 492 492 } 493 493 if (k <= 1) { ··· 508 508 if (min_i != j) { 509 509 swap(longhaul_table[j].frequency, 510 510 longhaul_table[min_i].frequency); 511 - swap(longhaul_table[j].index, 512 - longhaul_table[min_i].index); 511 + swap(longhaul_table[j].driver_data, 512 + longhaul_table[min_i].driver_data); 513 513 } 514 514 } 515 515 ··· 517 517 518 518 /* Find index we are running on */ 519 519 for (j = 0; j < k; j++) { 520 - if (mults[longhaul_table[j].index & 0x1f] == mult) { 520 + if (mults[longhaul_table[j].driver_data & 0x1f] == mult) { 521 521 longhaul_index = j; 522 522 break; 523 523 } ··· 613 613 pos = (speed - min_vid_speed) / kHz_step + minvid.pos; 614 614 else 615 615 pos = minvid.pos; 616 - longhaul_table[j].index |= mV_vrm_table[pos] << 8; 616 + longhaul_table[j].driver_data |= mV_vrm_table[pos] << 8; 617 617 vid = vrm_mV_table[mV_vrm_table[pos]]; 618 618 printk(KERN_INFO PFX "f: %d kHz, index: %d, vid: %d mV\n", 619 619 speed, j, vid.mV); ··· 656 656 * this in hardware, C3 is old and we need to do this 657 657 * in software. */ 658 658 i = longhaul_index; 659 - current_vid = (longhaul_table[longhaul_index].index >> 8); 659 + current_vid = (longhaul_table[longhaul_index].driver_data >> 8); 660 660 current_vid &= 0x1f; 661 661 if (table_index > longhaul_index) 662 662 dir = 1; 663 663 while (i != table_index) { 664 - vid = (longhaul_table[i].index >> 8) & 0x1f; 664 + vid = (longhaul_table[i].driver_data >> 8) & 0x1f; 665 665 if (vid != current_vid) { 666 666 longhaul_setstate(policy, i); 667 667 current_vid = vid;
+1 -1
drivers/cpufreq/loongson2_cpufreq.c
··· 72 72 73 73 freq = 74 74 ((cpu_clock_freq / 1000) * 75 - loongson2_clockmod_table[newstate].index) / 8; 75 + loongson2_clockmod_table[newstate].driver_data) / 8; 76 76 if (freq < policy->min || freq > policy->max) 77 77 return -EINVAL; 78 78
+2 -2
drivers/cpufreq/p4-clockmod.c
··· 118 118 return -EINVAL; 119 119 120 120 freqs.old = cpufreq_p4_get(policy->cpu); 121 - freqs.new = stock_freq * p4clockmod_table[newstate].index / 8; 121 + freqs.new = stock_freq * p4clockmod_table[newstate].driver_data / 8; 122 122 123 123 if (freqs.new == freqs.old) 124 124 return 0; ··· 131 131 * Developer's Manual, Volume 3 132 132 */ 133 133 for_each_cpu(i, policy->cpus) 134 - cpufreq_p4_setdc(i, p4clockmod_table[newstate].index); 134 + cpufreq_p4_setdc(i, p4clockmod_table[newstate].driver_data); 135 135 136 136 /* notifiers */ 137 137 cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+4 -4
drivers/cpufreq/powernow-k6.c
··· 58 58 msrval = POWERNOW_IOPORT + 0x0; 59 59 wrmsr(MSR_K6_EPMR, msrval, 0); /* disable it again */ 60 60 61 - return clock_ratio[(invalue >> 5)&7].index; 61 + return clock_ratio[(invalue >> 5)&7].driver_data; 62 62 } 63 63 64 64 ··· 75 75 unsigned long msrval; 76 76 struct cpufreq_freqs freqs; 77 77 78 - if (clock_ratio[best_i].index > max_multiplier) { 78 + if (clock_ratio[best_i].driver_data > max_multiplier) { 79 79 printk(KERN_ERR PFX "invalid target frequency\n"); 80 80 return; 81 81 } 82 82 83 83 freqs.old = busfreq * powernow_k6_get_cpu_multiplier(); 84 - freqs.new = busfreq * clock_ratio[best_i].index; 84 + freqs.new = busfreq * clock_ratio[best_i].driver_data; 85 85 86 86 cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); 87 87 ··· 156 156 157 157 /* table init */ 158 158 for (i = 0; (clock_ratio[i].frequency != CPUFREQ_TABLE_END); i++) { 159 - f = clock_ratio[i].index; 159 + f = clock_ratio[i].driver_data; 160 160 if (f > max_multiplier) 161 161 clock_ratio[i].frequency = CPUFREQ_ENTRY_INVALID; 162 162 else
+8 -8
drivers/cpufreq/powernow-k7.c
··· 186 186 fid = *pst++; 187 187 188 188 powernow_table[j].frequency = (fsb * fid_codes[fid]) / 10; 189 - powernow_table[j].index = fid; /* lower 8 bits */ 189 + powernow_table[j].driver_data = fid; /* lower 8 bits */ 190 190 191 191 speed = powernow_table[j].frequency; 192 192 ··· 203 203 maximum_speed = speed; 204 204 205 205 vid = *pst++; 206 - powernow_table[j].index |= (vid << 8); /* upper 8 bits */ 206 + powernow_table[j].driver_data |= (vid << 8); /* upper 8 bits */ 207 207 208 208 pr_debug(" FID: 0x%x (%d.%dx [%dMHz]) " 209 209 "VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10, ··· 212 212 mobile_vid_table[vid]%1000); 213 213 } 214 214 powernow_table[number_scales].frequency = CPUFREQ_TABLE_END; 215 - powernow_table[number_scales].index = 0; 215 + powernow_table[number_scales].driver_data = 0; 216 216 217 217 return 0; 218 218 } ··· 260 260 * vid are the upper 8 bits. 261 261 */ 262 262 263 - fid = powernow_table[index].index & 0xFF; 264 - vid = (powernow_table[index].index & 0xFF00) >> 8; 263 + fid = powernow_table[index].driver_data & 0xFF; 264 + vid = (powernow_table[index].driver_data & 0xFF00) >> 8; 265 265 266 266 rdmsrl(MSR_K7_FID_VID_STATUS, fidvidstatus.val); 267 267 cfid = fidvidstatus.bits.CFID; ··· 373 373 fid = pc.bits.fid; 374 374 375 375 powernow_table[i].frequency = fsb * fid_codes[fid] / 10; 376 - powernow_table[i].index = fid; /* lower 8 bits */ 377 - powernow_table[i].index |= (vid << 8); /* upper 8 bits */ 376 + powernow_table[i].driver_data = fid; /* lower 8 bits */ 377 + powernow_table[i].driver_data |= (vid << 8); /* upper 8 bits */ 378 378 379 379 speed = powernow_table[i].frequency; 380 380 speed_mhz = speed / 1000; ··· 417 417 } 418 418 419 419 powernow_table[i].frequency = CPUFREQ_TABLE_END; 420 - powernow_table[i].index = 0; 420 + powernow_table[i].driver_data = 0; 421 421 422 422 /* notify BIOS that we exist */ 423 423 acpi_processor_notify_smm(THIS_MODULE);
+9 -9
drivers/cpufreq/powernow-k8.c
··· 584 584 CPUFREQ_ENTRY_INVALID) { 585 585 printk(KERN_INFO PFX 586 586 "fid 0x%x (%d MHz), vid 0x%x\n", 587 - data->powernow_table[j].index & 0xff, 587 + data->powernow_table[j].driver_data & 0xff, 588 588 data->powernow_table[j].frequency/1000, 589 - data->powernow_table[j].index >> 8); 589 + data->powernow_table[j].driver_data >> 8); 590 590 } 591 591 } 592 592 if (data->batps) ··· 632 632 633 633 for (j = 0; j < data->numps; j++) { 634 634 int freq; 635 - powernow_table[j].index = pst[j].fid; /* lower 8 bits */ 636 - powernow_table[j].index |= (pst[j].vid << 8); /* upper 8 bits */ 635 + powernow_table[j].driver_data = pst[j].fid; /* lower 8 bits */ 636 + powernow_table[j].driver_data |= (pst[j].vid << 8); /* upper 8 bits */ 637 637 freq = find_khz_freq_from_fid(pst[j].fid); 638 638 powernow_table[j].frequency = freq; 639 639 } 640 640 powernow_table[data->numps].frequency = CPUFREQ_TABLE_END; 641 - powernow_table[data->numps].index = 0; 641 + powernow_table[data->numps].driver_data = 0; 642 642 643 643 if (query_current_values_with_pending_wait(data)) { 644 644 kfree(powernow_table); ··· 810 810 811 811 powernow_table[data->acpi_data.state_count].frequency = 812 812 CPUFREQ_TABLE_END; 813 - powernow_table[data->acpi_data.state_count].index = 0; 813 + powernow_table[data->acpi_data.state_count].driver_data = 0; 814 814 data->powernow_table = powernow_table; 815 815 816 816 if (cpumask_first(cpu_core_mask(data->cpu)) == data->cpu) ··· 865 865 pr_debug(" %d : fid 0x%x, vid 0x%x\n", i, fid, vid); 866 866 867 867 index = fid | (vid<<8); 868 - powernow_table[i].index = index; 868 + powernow_table[i].driver_data = index; 869 869 870 870 freq = find_khz_freq_from_fid(fid); 871 871 powernow_table[i].frequency = freq; ··· 941 941 * the cpufreq frequency table in find_psb_table, vid 942 942 * are the upper 8 bits. 943 943 */ 944 - fid = data->powernow_table[index].index & 0xFF; 945 - vid = (data->powernow_table[index].index & 0xFF00) >> 8; 944 + fid = data->powernow_table[index].driver_data & 0xFF; 945 + vid = (data->powernow_table[index].driver_data & 0xFF00) >> 8; 946 946 947 947 pr_debug("table matched fid 0x%x, giving vid 0x%x\n", fid, vid); 948 948
+2 -2
drivers/cpufreq/ppc_cbe_cpufreq.c
··· 106 106 107 107 /* initialize frequency table */ 108 108 for (i=0; cbe_freqs[i].frequency!=CPUFREQ_TABLE_END; i++) { 109 - cbe_freqs[i].frequency = max_freq / cbe_freqs[i].index; 109 + cbe_freqs[i].frequency = max_freq / cbe_freqs[i].driver_data; 110 110 pr_debug("%d: %d\n", i, cbe_freqs[i].frequency); 111 111 } 112 112 ··· 165 165 "1/%d of max frequency\n", 166 166 policy->cpu, 167 167 cbe_freqs[cbe_pmode_new].frequency, 168 - cbe_freqs[cbe_pmode_new].index); 168 + cbe_freqs[cbe_pmode_new].driver_data); 169 169 170 170 rc = set_pmode(policy->cpu, cbe_pmode_new); 171 171
+4 -4
drivers/cpufreq/pxa2xx-cpufreq.c
··· 420 420 /* Generate pxa25x the run cpufreq_frequency_table struct */ 421 421 for (i = 0; i < NUM_PXA25x_RUN_FREQS; i++) { 422 422 pxa255_run_freq_table[i].frequency = pxa255_run_freqs[i].khz; 423 - pxa255_run_freq_table[i].index = i; 423 + pxa255_run_freq_table[i].driver_data = i; 424 424 } 425 425 pxa255_run_freq_table[i].frequency = CPUFREQ_TABLE_END; 426 426 ··· 428 428 for (i = 0; i < NUM_PXA25x_TURBO_FREQS; i++) { 429 429 pxa255_turbo_freq_table[i].frequency = 430 430 pxa255_turbo_freqs[i].khz; 431 - pxa255_turbo_freq_table[i].index = i; 431 + pxa255_turbo_freq_table[i].driver_data = i; 432 432 } 433 433 pxa255_turbo_freq_table[i].frequency = CPUFREQ_TABLE_END; 434 434 ··· 440 440 if (freq > pxa27x_maxfreq) 441 441 break; 442 442 pxa27x_freq_table[i].frequency = freq; 443 - pxa27x_freq_table[i].index = i; 443 + pxa27x_freq_table[i].driver_data = i; 444 444 } 445 - pxa27x_freq_table[i].index = i; 445 + pxa27x_freq_table[i].driver_data = i; 446 446 pxa27x_freq_table[i].frequency = CPUFREQ_TABLE_END; 447 447 448 448 /*
+2 -2
drivers/cpufreq/pxa3xx-cpufreq.c
··· 98 98 return -ENOMEM; 99 99 100 100 for (i = 0; i < num; i++) { 101 - table[i].index = i; 101 + table[i].driver_data = i; 102 102 table[i].frequency = freqs[i].cpufreq_mhz * 1000; 103 103 } 104 - table[num].index = i; 104 + table[num].driver_data = i; 105 105 table[num].frequency = CPUFREQ_TABLE_END; 106 106 107 107 pxa3xx_freqs = freqs;
+1 -1
drivers/cpufreq/s3c2416-cpufreq.c
··· 244 244 if (ret != 0) 245 245 goto out; 246 246 247 - idx = s3c_freq->freq_table[i].index; 247 + idx = s3c_freq->freq_table[i].driver_data; 248 248 249 249 if (idx == SOURCE_HCLK) 250 250 to_dvs = 1;
+1 -1
drivers/cpufreq/s3c64xx-cpufreq.c
··· 87 87 freqs.old = clk_get_rate(armclk) / 1000; 88 88 freqs.new = s3c64xx_freq_table[i].frequency; 89 89 freqs.flags = 0; 90 - dvfs = &s3c64xx_dvfs_table[s3c64xx_freq_table[i].index]; 90 + dvfs = &s3c64xx_dvfs_table[s3c64xx_freq_table[i].driver_data]; 91 91 92 92 if (freqs.old == freqs.new) 93 93 return 0;
+1 -1
drivers/cpufreq/sc520_freq.c
··· 71 71 local_irq_disable(); 72 72 73 73 clockspeed_reg = *cpuctl & ~0x03; 74 - *cpuctl = clockspeed_reg | sc520_freq_table[state].index; 74 + *cpuctl = clockspeed_reg | sc520_freq_table[state].driver_data; 75 75 76 76 local_irq_enable(); 77 77
+6 -6
drivers/cpufreq/sparc-us2e-cpufreq.c
··· 308 308 struct cpufreq_frequency_table *table = 309 309 &us2e_freq_table[cpu].table[0]; 310 310 311 - table[0].index = 0; 311 + table[0].driver_data = 0; 312 312 table[0].frequency = clock_tick / 1; 313 - table[1].index = 1; 313 + table[1].driver_data = 1; 314 314 table[1].frequency = clock_tick / 2; 315 - table[2].index = 2; 315 + table[2].driver_data = 2; 316 316 table[2].frequency = clock_tick / 4; 317 - table[2].index = 3; 317 + table[2].driver_data = 3; 318 318 table[2].frequency = clock_tick / 6; 319 - table[2].index = 4; 319 + table[2].driver_data = 4; 320 320 table[2].frequency = clock_tick / 8; 321 - table[2].index = 5; 321 + table[2].driver_data = 5; 322 322 table[3].frequency = CPUFREQ_TABLE_END; 323 323 324 324 policy->cpuinfo.transition_latency = 0;
+4 -4
drivers/cpufreq/sparc-us3-cpufreq.c
··· 169 169 struct cpufreq_frequency_table *table = 170 170 &us3_freq_table[cpu].table[0]; 171 171 172 - table[0].index = 0; 172 + table[0].driver_data = 0; 173 173 table[0].frequency = clock_tick / 1; 174 - table[1].index = 1; 174 + table[1].driver_data = 1; 175 175 table[1].frequency = clock_tick / 2; 176 - table[2].index = 2; 176 + table[2].driver_data = 2; 177 177 table[2].frequency = clock_tick / 32; 178 - table[3].index = 0; 178 + table[3].driver_data = 0; 179 179 table[3].frequency = CPUFREQ_TABLE_END; 180 180 181 181 policy->cpuinfo.transition_latency = 0;
+2 -2
drivers/cpufreq/spear-cpufreq.c
··· 250 250 } 251 251 252 252 for (i = 0; i < cnt; i++) { 253 - freq_tbl[i].index = i; 253 + freq_tbl[i].driver_data = i; 254 254 freq_tbl[i].frequency = be32_to_cpup(val++); 255 255 } 256 256 257 - freq_tbl[i].index = i; 257 + freq_tbl[i].driver_data = i; 258 258 freq_tbl[i].frequency = CPUFREQ_TABLE_END; 259 259 260 260 spear_cpufreq.freq_tbl = freq_tbl;
+4 -4
drivers/cpufreq/speedstep-centrino.c
··· 79 79 80 80 /* Computes the correct form for IA32_PERF_CTL MSR for a particular 81 81 frequency/voltage operating point; frequency in MHz, volts in mV. 82 - This is stored as "index" in the structure. */ 82 + This is stored as "driver_data" in the structure. */ 83 83 #define OP(mhz, mv) \ 84 84 { \ 85 85 .frequency = (mhz) * 1000, \ 86 - .index = (((mhz)/100) << 8) | ((mv - 700) / 16) \ 86 + .driver_data = (((mhz)/100) << 8) | ((mv - 700) / 16) \ 87 87 } 88 88 89 89 /* ··· 307 307 per_cpu(centrino_model, cpu)->op_points[i].frequency 308 308 != CPUFREQ_TABLE_END; 309 309 i++) { 310 - if (msr == per_cpu(centrino_model, cpu)->op_points[i].index) 310 + if (msr == per_cpu(centrino_model, cpu)->op_points[i].driver_data) 311 311 return per_cpu(centrino_model, cpu)-> 312 312 op_points[i].frequency; 313 313 } ··· 501 501 break; 502 502 } 503 503 504 - msr = per_cpu(centrino_model, cpu)->op_points[newstate].index; 504 + msr = per_cpu(centrino_model, cpu)->op_points[newstate].driver_data; 505 505 506 506 if (first_cpu) { 507 507 rdmsr_on_cpu(good_cpu, MSR_IA32_PERF_CTL, &oldmsr, &h);
+5 -5
drivers/mfd/db8500-prcmu.c
··· 1724 1724 1725 1725 /* CPU FREQ table, may be changed due to if MAX_OPP is supported. */ 1726 1726 static struct cpufreq_frequency_table db8500_cpufreq_table[] = { 1727 - { .frequency = 200000, .index = ARM_EXTCLK,}, 1728 - { .frequency = 400000, .index = ARM_50_OPP,}, 1729 - { .frequency = 800000, .index = ARM_100_OPP,}, 1727 + { .frequency = 200000, .driver_data = ARM_EXTCLK,}, 1728 + { .frequency = 400000, .driver_data = ARM_50_OPP,}, 1729 + { .frequency = 800000, .driver_data = ARM_100_OPP,}, 1730 1730 { .frequency = CPUFREQ_TABLE_END,}, /* To be used for MAX_OPP. */ 1731 1731 { .frequency = CPUFREQ_TABLE_END,}, 1732 1732 }; ··· 1901 1901 return -EINVAL; 1902 1902 1903 1903 /* Set the new arm opp. */ 1904 - return db8500_prcmu_set_arm_opp(db8500_cpufreq_table[i].index); 1904 + return db8500_prcmu_set_arm_opp(db8500_cpufreq_table[i].driver_data); 1905 1905 } 1906 1906 1907 1907 static int set_plldsi_rate(unsigned long rate) ··· 3105 3105 { 3106 3106 if (prcmu_has_arm_maxopp()) { 3107 3107 db8500_cpufreq_table[3].frequency = 1000000; 3108 - db8500_cpufreq_table[3].index = ARM_MAX_OPP; 3108 + db8500_cpufreq_table[3].driver_data = ARM_MAX_OPP; 3109 3109 } 3110 3110 } 3111 3111
+2 -2
drivers/sh/clk/core.c
··· 63 63 else 64 64 freq = clk->parent->rate * mult / div; 65 65 66 - freq_table[i].index = i; 66 + freq_table[i].driver_data = i; 67 67 freq_table[i].frequency = freq; 68 68 } 69 69 70 70 /* Termination entry */ 71 - freq_table[i].index = i; 71 + freq_table[i].driver_data = i; 72 72 freq_table[i].frequency = CPUFREQ_TABLE_END; 73 73 } 74 74
+1 -1
include/linux/cpufreq.h
··· 410 410 #define CPUFREQ_TABLE_END ~1 411 411 412 412 struct cpufreq_frequency_table { 413 - unsigned int index; /* any */ 413 + unsigned int driver_data; /* driver specific data, not used by core */ 414 414 unsigned int frequency; /* kHz - doesn't need to be in ascending 415 415 * order */ 416 416 };