aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/elanfreq.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@rjwysocki.net>2013-10-25 16:36:40 -0400
committerRafael J. Wysocki <rjw@rjwysocki.net>2013-10-25 16:36:40 -0400
commit6ddee424fea2d269c2f402278d93165c7b92dc58 (patch)
treec1b1d0d9058846a6da22def648dea61e16faacd0 /drivers/cpufreq/elanfreq.c
parente4db1c7439b31993a4886b273bb9235a8eea82bf (diff)
parenta814613b9a32d9ab9578d9dab396265c826d37f0 (diff)
Merge back earlier 'pm-cpufreq' material.
Conflicts: drivers/cpufreq/omap-cpufreq.c
Diffstat (limited to 'drivers/cpufreq/elanfreq.c')
-rw-r--r--drivers/cpufreq/elanfreq.c41
1 files changed, 4 insertions, 37 deletions
diff --git a/drivers/cpufreq/elanfreq.c b/drivers/cpufreq/elanfreq.c
index 823a400d98fd..d91a645a27ae 100644
--- a/drivers/cpufreq/elanfreq.c
+++ b/drivers/cpufreq/elanfreq.c
@@ -165,19 +165,6 @@ static void elanfreq_set_cpu_state(struct cpufreq_policy *policy,
165}; 165};
166 166
167 167
168/**
169 * elanfreq_validatespeed: test if frequency range is valid
170 * @policy: the policy to validate
171 *
172 * This function checks if a given frequency range in kHz is valid
173 * for the hardware supported by the driver.
174 */
175
176static int elanfreq_verify(struct cpufreq_policy *policy)
177{
178 return cpufreq_frequency_table_verify(policy, &elanfreq_table[0]);
179}
180
181static int elanfreq_target(struct cpufreq_policy *policy, 168static int elanfreq_target(struct cpufreq_policy *policy,
182 unsigned int target_freq, 169 unsigned int target_freq,
183 unsigned int relation) 170 unsigned int relation)
@@ -202,7 +189,6 @@ static int elanfreq_cpu_init(struct cpufreq_policy *policy)
202{ 189{
203 struct cpuinfo_x86 *c = &cpu_data(0); 190 struct cpuinfo_x86 *c = &cpu_data(0);
204 unsigned int i; 191 unsigned int i;
205 int result;
206 192
207 /* capability check */ 193 /* capability check */
208 if ((c->x86_vendor != X86_VENDOR_AMD) || 194 if ((c->x86_vendor != X86_VENDOR_AMD) ||
@@ -221,21 +207,8 @@ static int elanfreq_cpu_init(struct cpufreq_policy *policy)
221 207
222 /* cpuinfo and default policy values */ 208 /* cpuinfo and default policy values */
223 policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; 209 policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
224 policy->cur = elanfreq_get_cpu_frequency(0);
225 210
226 result = cpufreq_frequency_table_cpuinfo(policy, elanfreq_table); 211 return cpufreq_table_validate_and_show(policy, elanfreq_table);
227 if (result)
228 return result;
229
230 cpufreq_frequency_table_get_attr(elanfreq_table, policy->cpu);
231 return 0;
232}
233
234
235static int elanfreq_cpu_exit(struct cpufreq_policy *policy)
236{
237 cpufreq_frequency_table_put_attr(policy->cpu);
238 return 0;
239} 212}
240 213
241 214
@@ -261,20 +234,14 @@ __setup("elanfreq=", elanfreq_setup);
261#endif 234#endif
262 235
263 236
264static struct freq_attr *elanfreq_attr[] = {
265 &cpufreq_freq_attr_scaling_available_freqs,
266 NULL,
267};
268
269
270static struct cpufreq_driver elanfreq_driver = { 237static struct cpufreq_driver elanfreq_driver = {
271 .get = elanfreq_get_cpu_frequency, 238 .get = elanfreq_get_cpu_frequency,
272 .verify = elanfreq_verify, 239 .verify = cpufreq_generic_frequency_table_verify,
273 .target = elanfreq_target, 240 .target = elanfreq_target,
274 .init = elanfreq_cpu_init, 241 .init = elanfreq_cpu_init,
275 .exit = elanfreq_cpu_exit, 242 .exit = cpufreq_generic_exit,
276 .name = "elanfreq", 243 .name = "elanfreq",
277 .attr = elanfreq_attr, 244 .attr = cpufreq_generic_attr,
278}; 245};
279 246
280static const struct x86_cpu_id elan_id[] = { 247static const struct x86_cpu_id elan_id[] = {