diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2013-09-16 09:26:04 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-09-30 14:18:41 -0400 |
commit | 6a77a1e6429c96be0dab06660b137847e2802806 (patch) | |
tree | 96ba7442a3d395a883500ebffbad0df441f253c1 | |
parent | 27047a603645d0885bcd72d7a0b6cce6e3c94ca7 (diff) |
cpufreq: pxa: 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: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/cpufreq/pxa2xx-cpufreq.c | 13 | ||||
-rw-r--r-- | drivers/cpufreq/pxa3xx-cpufreq.c | 15 |
2 files changed, 25 insertions, 3 deletions
diff --git a/drivers/cpufreq/pxa2xx-cpufreq.c b/drivers/cpufreq/pxa2xx-cpufreq.c index 8749eaf18793..b004cf1d07af 100644 --- a/drivers/cpufreq/pxa2xx-cpufreq.c +++ b/drivers/cpufreq/pxa2xx-cpufreq.c | |||
@@ -453,20 +453,31 @@ static int pxa_cpufreq_init(struct cpufreq_policy *policy) | |||
453 | find_freq_tables(&pxa255_freq_table, &pxa255_freqs); | 453 | find_freq_tables(&pxa255_freq_table, &pxa255_freqs); |
454 | pr_info("PXA255 cpufreq using %s frequency table\n", | 454 | pr_info("PXA255 cpufreq using %s frequency table\n", |
455 | pxa255_turbo_table ? "turbo" : "run"); | 455 | pxa255_turbo_table ? "turbo" : "run"); |
456 | |||
456 | cpufreq_frequency_table_cpuinfo(policy, pxa255_freq_table); | 457 | cpufreq_frequency_table_cpuinfo(policy, pxa255_freq_table); |
458 | cpufreq_frequency_table_get_attr(pxa255_freq_table, policy->cpu); | ||
457 | } | 459 | } |
458 | else if (cpu_is_pxa27x()) | 460 | else if (cpu_is_pxa27x()) { |
459 | cpufreq_frequency_table_cpuinfo(policy, pxa27x_freq_table); | 461 | cpufreq_frequency_table_cpuinfo(policy, pxa27x_freq_table); |
462 | cpufreq_frequency_table_get_attr(pxa27x_freq_table, policy->cpu); | ||
463 | } | ||
460 | 464 | ||
461 | printk(KERN_INFO "PXA CPU frequency change support initialized\n"); | 465 | printk(KERN_INFO "PXA CPU frequency change support initialized\n"); |
462 | 466 | ||
463 | return 0; | 467 | return 0; |
464 | } | 468 | } |
465 | 469 | ||
470 | static int pxa_cpufreq_exit(struct cpufreq_policy *policy) | ||
471 | { | ||
472 | cpufreq_frequency_table_put_attr(policy->cpu); | ||
473 | return 0; | ||
474 | } | ||
475 | |||
466 | static struct cpufreq_driver pxa_cpufreq_driver = { | 476 | static struct cpufreq_driver pxa_cpufreq_driver = { |
467 | .verify = pxa_verify_policy, | 477 | .verify = pxa_verify_policy, |
468 | .target = pxa_set_target, | 478 | .target = pxa_set_target, |
469 | .init = pxa_cpufreq_init, | 479 | .init = pxa_cpufreq_init, |
480 | .exit = pxa_cpufreq_exit, | ||
470 | .get = pxa_cpufreq_get, | 481 | .get = pxa_cpufreq_get, |
471 | .name = "PXA2xx", | 482 | .name = "PXA2xx", |
472 | }; | 483 | }; |
diff --git a/drivers/cpufreq/pxa3xx-cpufreq.c b/drivers/cpufreq/pxa3xx-cpufreq.c index d26306fb00d2..cebbed19765e 100644 --- a/drivers/cpufreq/pxa3xx-cpufreq.c +++ b/drivers/cpufreq/pxa3xx-cpufreq.c | |||
@@ -91,7 +91,7 @@ static int setup_freqs_table(struct cpufreq_policy *policy, | |||
91 | struct pxa3xx_freq_info *freqs, int num) | 91 | struct pxa3xx_freq_info *freqs, int num) |
92 | { | 92 | { |
93 | struct cpufreq_frequency_table *table; | 93 | struct cpufreq_frequency_table *table; |
94 | int i; | 94 | int i, ret; |
95 | 95 | ||
96 | table = kzalloc((num + 1) * sizeof(*table), GFP_KERNEL); | 96 | table = kzalloc((num + 1) * sizeof(*table), GFP_KERNEL); |
97 | if (table == NULL) | 97 | if (table == NULL) |
@@ -108,7 +108,11 @@ static int setup_freqs_table(struct cpufreq_policy *policy, | |||
108 | pxa3xx_freqs_num = num; | 108 | pxa3xx_freqs_num = num; |
109 | pxa3xx_freqs_table = table; | 109 | pxa3xx_freqs_table = table; |
110 | 110 | ||
111 | return cpufreq_frequency_table_cpuinfo(policy, table); | 111 | ret = cpufreq_frequency_table_cpuinfo(policy, table); |
112 | if (!ret) | ||
113 | cpufreq_frequency_table_get_attr(table, policy->cpu); | ||
114 | |||
115 | return ret; | ||
112 | } | 116 | } |
113 | 117 | ||
114 | static void __update_core_freq(struct pxa3xx_freq_info *info) | 118 | static void __update_core_freq(struct pxa3xx_freq_info *info) |
@@ -229,10 +233,17 @@ static int pxa3xx_cpufreq_init(struct cpufreq_policy *policy) | |||
229 | return 0; | 233 | return 0; |
230 | } | 234 | } |
231 | 235 | ||
236 | static int pxa3xx_cpufreq_exit(struct cpufreq_policy *policy) | ||
237 | { | ||
238 | cpufreq_frequency_table_put_attr(policy->cpu); | ||
239 | return 0; | ||
240 | } | ||
241 | |||
232 | static struct cpufreq_driver pxa3xx_cpufreq_driver = { | 242 | static struct cpufreq_driver pxa3xx_cpufreq_driver = { |
233 | .verify = pxa3xx_cpufreq_verify, | 243 | .verify = pxa3xx_cpufreq_verify, |
234 | .target = pxa3xx_cpufreq_set, | 244 | .target = pxa3xx_cpufreq_set, |
235 | .init = pxa3xx_cpufreq_init, | 245 | .init = pxa3xx_cpufreq_init, |
246 | .exit = pxa3xx_cpufreq_exit, | ||
236 | .get = pxa3xx_cpufreq_get, | 247 | .get = pxa3xx_cpufreq_get, |
237 | .name = "pxa3xx-cpufreq", | 248 | .name = "pxa3xx-cpufreq", |
238 | }; | 249 | }; |