msm: cpufreq: Update frequency index

A deprecated api can be used to limit the minimum and maximum cpu speeds.
Another driver temporarily needs to switch back to this api, instead of
using the new version. Make this api functional again by ensuring a stale
value is updated properly.

Change-Id: Ia63772e43ec534cf2bb58e7627a87315dae5d891
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
This commit is contained in:
Patrick Daly 2013-08-08 11:59:23 -07:00 committed by Steve Kondik
parent 6b455ff398
commit b881e37a47
1 changed files with 7 additions and 0 deletions

View File

@ -171,6 +171,7 @@ static int set_cpu_freq(struct cpufreq_policy *policy, unsigned int new_freq,
struct cpufreq_freqs freqs;
struct cpu_freq *limit = &per_cpu(cpu_freq_info, policy->cpu);
struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 };
struct cpufreq_frequency_table *table;
if (limit->limits_init) {
if (new_freq > limit->allowed_max) {
@ -206,6 +207,12 @@ static int set_cpu_freq(struct cpufreq_policy *policy, unsigned int new_freq,
}
#endif
/* limits applied above must be in cpufreq table */
table = cpufreq_frequency_get_table(policy->cpu);
if (cpufreq_frequency_table_target(policy, table, new_freq,
CPUFREQ_RELATION_H, &index))
return -EINVAL;
freqs.old = policy->cur;
freqs.new = new_freq;
freqs.cpu = policy->cpu;