diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2013-09-16 09:26:06 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-09-30 14:18:41 -0400 |
commit | 18f130ed75ab98573694fa6d8542c7891ccc9447 (patch) | |
tree | 2f81963a38aacba02c2aed0629de2bb96a8486d0 /drivers/cpufreq/sparc-us2e-cpufreq.c | |
parent | 5c40e052bb04381302c748497076b5b4526ed6cb (diff) |
cpufreq: sparc: call cpufreq_frequency_table_get_attr()
This exposes frequency table of driver to cpufreq core and is required for core
to guess what the index for a target frequency is, when it calls
cpufreq_frequency_table_target(). And so this driver needs to expose it.
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/sparc-us2e-cpufreq.c')
-rw-r--r-- | drivers/cpufreq/sparc-us2e-cpufreq.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/cpufreq/sparc-us2e-cpufreq.c b/drivers/cpufreq/sparc-us2e-cpufreq.c index cf5bc2ca16fa..63b3eae5ffdc 100644 --- a/drivers/cpufreq/sparc-us2e-cpufreq.c +++ b/drivers/cpufreq/sparc-us2e-cpufreq.c | |||
@@ -307,6 +307,7 @@ static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy) | |||
307 | unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000; | 307 | unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000; |
308 | struct cpufreq_frequency_table *table = | 308 | struct cpufreq_frequency_table *table = |
309 | &us2e_freq_table[cpu].table[0]; | 309 | &us2e_freq_table[cpu].table[0]; |
310 | int ret; | ||
310 | 311 | ||
311 | table[0].driver_data = 0; | 312 | table[0].driver_data = 0; |
312 | table[0].frequency = clock_tick / 1; | 313 | table[0].frequency = clock_tick / 1; |
@@ -324,13 +325,18 @@ static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy) | |||
324 | policy->cpuinfo.transition_latency = 0; | 325 | policy->cpuinfo.transition_latency = 0; |
325 | policy->cur = clock_tick; | 326 | policy->cur = clock_tick; |
326 | 327 | ||
327 | return cpufreq_frequency_table_cpuinfo(policy, table); | 328 | ret = cpufreq_frequency_table_cpuinfo(policy, table); |
329 | if (!ret) | ||
330 | cpufreq_frequency_table_get_attr(table, policy->cpu); | ||
331 | return ret; | ||
328 | } | 332 | } |
329 | 333 | ||
330 | static int us2e_freq_cpu_exit(struct cpufreq_policy *policy) | 334 | static int us2e_freq_cpu_exit(struct cpufreq_policy *policy) |
331 | { | 335 | { |
332 | if (cpufreq_us2e_driver) | 336 | if (cpufreq_us2e_driver) { |
337 | cpufreq_frequency_table_put_attr(policy->cpu); | ||
333 | us2e_set_cpu_divider_index(policy, 0); | 338 | us2e_set_cpu_divider_index(policy, 0); |
339 | } | ||
334 | 340 | ||
335 | return 0; | 341 | return 0; |
336 | } | 342 | } |