diff options
-rw-r--r-- | Documentation/cpu-freq/cpu-drivers.txt | 5 | ||||
-rw-r--r-- | arch/arm/mach-davinci/cpufreq.c | 21 | ||||
-rw-r--r-- | arch/arm/mach-imx/cpufreq.c | 3 | ||||
-rw-r--r-- | arch/sh/kernel/cpufreq.c | 9 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq-nforce2.c | 6 | ||||
-rw-r--r-- | drivers/cpufreq/omap-cpufreq.c | 4 |
6 files changed, 17 insertions, 31 deletions
diff --git a/Documentation/cpu-freq/cpu-drivers.txt b/Documentation/cpu-freq/cpu-drivers.txt index 7c7721d042ff..a3585eac83b6 100644 --- a/Documentation/cpu-freq/cpu-drivers.txt +++ b/Documentation/cpu-freq/cpu-drivers.txt | |||
@@ -108,8 +108,9 @@ policy->governor must contain the "default policy" for | |||
108 | cpufreq_driver.target is called with | 108 | cpufreq_driver.target is called with |
109 | these values. | 109 | these values. |
110 | 110 | ||
111 | For setting some of these values, the frequency table helpers might be | 111 | For setting some of these values (cpuinfo.min[max]_freq, policy->min[max]), the |
112 | helpful. See the section 2 for more information on them. | 112 | frequency table helpers might be helpful. See the section 2 for more information |
113 | on them. | ||
113 | 114 | ||
114 | SMP systems normally have same clock source for a group of cpus. For these the | 115 | SMP systems normally have same clock source for a group of cpus. For these the |
115 | .init() would be called only once for the first online cpu. Here the .init() | 116 | .init() would be called only once for the first online cpu. Here the .init() |
diff --git a/arch/arm/mach-davinci/cpufreq.c b/arch/arm/mach-davinci/cpufreq.c index 8fb0c2ac227e..7c2e943c5500 100644 --- a/arch/arm/mach-davinci/cpufreq.c +++ b/arch/arm/mach-davinci/cpufreq.c | |||
@@ -137,21 +137,16 @@ static int davinci_cpu_init(struct cpufreq_policy *policy) | |||
137 | return result; | 137 | return result; |
138 | } | 138 | } |
139 | 139 | ||
140 | policy->cur = policy->min = policy->max = davinci_getspeed(0); | 140 | policy->cur = davinci_getspeed(0); |
141 | 141 | ||
142 | if (freq_table) { | 142 | result = cpufreq_frequency_table_cpuinfo(policy, freq_table); |
143 | result = cpufreq_frequency_table_cpuinfo(policy, freq_table); | 143 | if (result) { |
144 | if (!result) | 144 | pr_err("%s: cpufreq_frequency_table_cpuinfo() failed", |
145 | cpufreq_frequency_table_get_attr(freq_table, | 145 | __func__); |
146 | policy->cpu); | 146 | return result; |
147 | } else { | ||
148 | policy->cpuinfo.min_freq = policy->min; | ||
149 | policy->cpuinfo.max_freq = policy->max; | ||
150 | } | 147 | } |
151 | 148 | ||
152 | policy->min = policy->cpuinfo.min_freq; | 149 | cpufreq_frequency_table_get_attr(freq_table, policy->cpu); |
153 | policy->max = policy->cpuinfo.max_freq; | ||
154 | policy->cur = davinci_getspeed(0); | ||
155 | 150 | ||
156 | /* | 151 | /* |
157 | * Time measurement across the target() function yields ~1500-1800us | 152 | * Time measurement across the target() function yields ~1500-1800us |
diff --git a/arch/arm/mach-imx/cpufreq.c b/arch/arm/mach-imx/cpufreq.c index cfce5e3f67f5..387dc4cceca2 100644 --- a/arch/arm/mach-imx/cpufreq.c +++ b/arch/arm/mach-imx/cpufreq.c | |||
@@ -144,14 +144,11 @@ static int mxc_cpufreq_init(struct cpufreq_policy *policy) | |||
144 | imx_freq_table[i].frequency = CPUFREQ_TABLE_END; | 144 | imx_freq_table[i].frequency = CPUFREQ_TABLE_END; |
145 | 145 | ||
146 | policy->cur = clk_get_rate(cpu_clk) / 1000; | 146 | policy->cur = clk_get_rate(cpu_clk) / 1000; |
147 | policy->min = policy->cpuinfo.min_freq = cpu_freq_khz_min; | ||
148 | policy->max = policy->cpuinfo.max_freq = cpu_freq_khz_max; | ||
149 | 147 | ||
150 | /* Manual states, that PLL stabilizes in two CLK32 periods */ | 148 | /* Manual states, that PLL stabilizes in two CLK32 periods */ |
151 | policy->cpuinfo.transition_latency = 2 * NANOSECOND / CLK32_FREQ; | 149 | policy->cpuinfo.transition_latency = 2 * NANOSECOND / CLK32_FREQ; |
152 | 150 | ||
153 | ret = cpufreq_frequency_table_cpuinfo(policy, imx_freq_table); | 151 | ret = cpufreq_frequency_table_cpuinfo(policy, imx_freq_table); |
154 | |||
155 | if (ret < 0) { | 152 | if (ret < 0) { |
156 | printk(KERN_ERR "%s: failed to register i.MXC CPUfreq with error code %d\n", | 153 | printk(KERN_ERR "%s: failed to register i.MXC CPUfreq with error code %d\n", |
157 | __func__, ret); | 154 | __func__, ret); |
diff --git a/arch/sh/kernel/cpufreq.c b/arch/sh/kernel/cpufreq.c index 0fdf64b759c8..88c8feedf785 100644 --- a/arch/sh/kernel/cpufreq.c +++ b/arch/sh/kernel/cpufreq.c | |||
@@ -116,7 +116,7 @@ static int sh_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
116 | return PTR_ERR(cpuclk); | 116 | return PTR_ERR(cpuclk); |
117 | } | 117 | } |
118 | 118 | ||
119 | policy->cur = policy->min = policy->max = sh_cpufreq_get(cpu); | 119 | policy->cur = sh_cpufreq_get(cpu); |
120 | 120 | ||
121 | freq_table = cpuclk->nr_freqs ? cpuclk->freq_table : NULL; | 121 | freq_table = cpuclk->nr_freqs ? cpuclk->freq_table : NULL; |
122 | if (freq_table) { | 122 | if (freq_table) { |
@@ -129,15 +129,12 @@ static int sh_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
129 | dev_notice(dev, "no frequency table found, falling back " | 129 | dev_notice(dev, "no frequency table found, falling back " |
130 | "to rate rounding.\n"); | 130 | "to rate rounding.\n"); |
131 | 131 | ||
132 | policy->cpuinfo.min_freq = | 132 | policy->min = policy->cpuinfo.min_freq = |
133 | (clk_round_rate(cpuclk, 1) + 500) / 1000; | 133 | (clk_round_rate(cpuclk, 1) + 500) / 1000; |
134 | policy->cpuinfo.max_freq = | 134 | policy->max = policy->cpuinfo.max_freq = |
135 | (clk_round_rate(cpuclk, ~0UL) + 500) / 1000; | 135 | (clk_round_rate(cpuclk, ~0UL) + 500) / 1000; |
136 | } | 136 | } |
137 | 137 | ||
138 | policy->min = policy->cpuinfo.min_freq; | ||
139 | policy->max = policy->cpuinfo.max_freq; | ||
140 | |||
141 | policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; | 138 | policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; |
142 | 139 | ||
143 | dev_info(dev, "CPU Frequencies - Minimum %u.%03u MHz, " | 140 | dev_info(dev, "CPU Frequencies - Minimum %u.%03u MHz, " |
diff --git a/drivers/cpufreq/cpufreq-nforce2.c b/drivers/cpufreq/cpufreq-nforce2.c index 224a4787ecc2..af1542d41440 100644 --- a/drivers/cpufreq/cpufreq-nforce2.c +++ b/drivers/cpufreq/cpufreq-nforce2.c | |||
@@ -359,12 +359,10 @@ static int nforce2_cpu_init(struct cpufreq_policy *policy) | |||
359 | min_fsb = NFORCE2_MIN_FSB; | 359 | min_fsb = NFORCE2_MIN_FSB; |
360 | 360 | ||
361 | /* cpuinfo and default policy values */ | 361 | /* cpuinfo and default policy values */ |
362 | policy->cpuinfo.min_freq = min_fsb * fid * 100; | 362 | policy->min = policy->cpuinfo.min_freq = min_fsb * fid * 100; |
363 | policy->cpuinfo.max_freq = max_fsb * fid * 100; | 363 | policy->max = policy->cpuinfo.max_freq = max_fsb * fid * 100; |
364 | policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; | 364 | policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; |
365 | policy->cur = nforce2_get(policy->cpu); | 365 | policy->cur = nforce2_get(policy->cpu); |
366 | policy->min = policy->cpuinfo.min_freq; | ||
367 | policy->max = policy->cpuinfo.max_freq; | ||
368 | 366 | ||
369 | return 0; | 367 | return 0; |
370 | } | 368 | } |
diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c index b610edd820b1..ad7549c13ed2 100644 --- a/drivers/cpufreq/omap-cpufreq.c +++ b/drivers/cpufreq/omap-cpufreq.c | |||
@@ -177,7 +177,7 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy) | |||
177 | goto fail_ck; | 177 | goto fail_ck; |
178 | } | 178 | } |
179 | 179 | ||
180 | policy->cur = policy->min = policy->max = omap_getspeed(policy->cpu); | 180 | policy->cur = omap_getspeed(policy->cpu); |
181 | 181 | ||
182 | if (!freq_table) | 182 | if (!freq_table) |
183 | result = opp_init_cpufreq_table(mpu_dev, &freq_table); | 183 | result = opp_init_cpufreq_table(mpu_dev, &freq_table); |
@@ -196,8 +196,6 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy) | |||
196 | 196 | ||
197 | cpufreq_frequency_table_get_attr(freq_table, policy->cpu); | 197 | cpufreq_frequency_table_get_attr(freq_table, policy->cpu); |
198 | 198 | ||
199 | policy->min = policy->cpuinfo.min_freq; | ||
200 | policy->max = policy->cpuinfo.max_freq; | ||
201 | policy->cur = omap_getspeed(policy->cpu); | 199 | policy->cur = omap_getspeed(policy->cpu); |
202 | 200 | ||
203 | /* | 201 | /* |