diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2013-09-16 18:56:04 +0530 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-09-30 20:18:41 +0200 |
commit | 6a77a1e6429c96be0dab06660b137847e2802806 (patch) | |
tree | 96ba7442a3d395a883500ebffbad0df441f253c1 /drivers/cpufreq/pxa3xx-cpufreq.c | |
parent | 27047a603645d0885bcd72d7a0b6cce6e3c94ca7 (diff) | |
download | blackbird-op-linux-6a77a1e6429c96be0dab06660b137847e2802806.tar.gz blackbird-op-linux-6a77a1e6429c96be0dab06660b137847e2802806.zip |
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>
Diffstat (limited to 'drivers/cpufreq/pxa3xx-cpufreq.c')
-rw-r--r-- | drivers/cpufreq/pxa3xx-cpufreq.c | 15 |
1 files changed, 13 insertions, 2 deletions
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, struct pxa3xx_freq_info *freqs, int num) { struct cpufreq_frequency_table *table; - int i; + int i, ret; table = kzalloc((num + 1) * sizeof(*table), GFP_KERNEL); if (table == NULL) @@ -108,7 +108,11 @@ static int setup_freqs_table(struct cpufreq_policy *policy, pxa3xx_freqs_num = num; pxa3xx_freqs_table = table; - return cpufreq_frequency_table_cpuinfo(policy, table); + ret = cpufreq_frequency_table_cpuinfo(policy, table); + if (!ret) + cpufreq_frequency_table_get_attr(table, policy->cpu); + + return ret; } static void __update_core_freq(struct pxa3xx_freq_info *info) @@ -229,10 +233,17 @@ static int pxa3xx_cpufreq_init(struct cpufreq_policy *policy) return 0; } +static int pxa3xx_cpufreq_exit(struct cpufreq_policy *policy) +{ + cpufreq_frequency_table_put_attr(policy->cpu); + return 0; +} + static struct cpufreq_driver pxa3xx_cpufreq_driver = { .verify = pxa3xx_cpufreq_verify, .target = pxa3xx_cpufreq_set, .init = pxa3xx_cpufreq_init, + .exit = pxa3xx_cpufreq_exit, .get = pxa3xx_cpufreq_get, .name = "pxa3xx-cpufreq", }; |