aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/ppc-corenet-cpufreq.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpufreq/ppc-corenet-cpufreq.c')
-rw-r--r--drivers/cpufreq/ppc-corenet-cpufreq.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/cpufreq/ppc-corenet-cpufreq.c b/drivers/cpufreq/ppc-corenet-cpufreq.c
index a0f562ca292d..79d8e9c46b6d 100644
--- a/drivers/cpufreq/ppc-corenet-cpufreq.c
+++ b/drivers/cpufreq/ppc-corenet-cpufreq.c
@@ -251,27 +251,20 @@ static int __exit corenet_cpufreq_cpu_exit(struct cpufreq_policy *policy)
251} 251}
252 252
253static int corenet_cpufreq_target(struct cpufreq_policy *policy, 253static int corenet_cpufreq_target(struct cpufreq_policy *policy,
254 unsigned int target_freq, unsigned int relation) 254 unsigned int index)
255{ 255{
256 struct cpufreq_freqs freqs; 256 struct cpufreq_freqs freqs;
257 unsigned int new;
258 struct clk *parent; 257 struct clk *parent;
259 int ret; 258 int ret;
260 struct cpu_data *data = per_cpu(cpu_data, policy->cpu); 259 struct cpu_data *data = per_cpu(cpu_data, policy->cpu);
261 260
262 cpufreq_frequency_table_target(policy, data->table,
263 target_freq, relation, &new);
264
265 if (policy->cur == data->table[new].frequency)
266 return 0;
267
268 freqs.old = policy->cur; 261 freqs.old = policy->cur;
269 freqs.new = data->table[new].frequency; 262 freqs.new = data->table[index].frequency;
270 263
271 mutex_lock(&cpufreq_lock); 264 mutex_lock(&cpufreq_lock);
272 cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); 265 cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
273 266
274 parent = of_clk_get(data->parent, data->table[new].driver_data); 267 parent = of_clk_get(data->parent, data->table[index].driver_data);
275 ret = clk_set_parent(data->clk, parent); 268 ret = clk_set_parent(data->clk, parent);
276 if (ret) 269 if (ret)
277 freqs.new = freqs.old; 270 freqs.new = freqs.old;
@@ -288,7 +281,7 @@ static struct cpufreq_driver ppc_corenet_cpufreq_driver = {
288 .init = corenet_cpufreq_cpu_init, 281 .init = corenet_cpufreq_cpu_init,
289 .exit = __exit_p(corenet_cpufreq_cpu_exit), 282 .exit = __exit_p(corenet_cpufreq_cpu_exit),
290 .verify = cpufreq_generic_frequency_table_verify, 283 .verify = cpufreq_generic_frequency_table_verify,
291 .target = corenet_cpufreq_target, 284 .target_index = corenet_cpufreq_target,
292 .get = corenet_cpufreq_get_speed, 285 .get = corenet_cpufreq_get_speed,
293 .attr = cpufreq_generic_attr, 286 .attr = cpufreq_generic_attr,
294}; 287};