Skip to content

Commit

Permalink
cpufreq: exynos: Check old & new frequency early
Browse files Browse the repository at this point in the history
If old & new freq have the same frequency, no need to call
cpufreq notifier & regulator function.

Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
  • Loading branch information
Jonghwan Choi authored and Kukjin Kim committed Dec 23, 2012
1 parent 184cddd commit 857d90f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/cpufreq/exynos-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ static int exynos_target(struct cpufreq_policy *policy,
freqs.new = freq_table[index].frequency;
freqs.cpu = policy->cpu;

if (freqs.new == freqs.old)
goto out;

/*
* ARM clock source will be changed APLL to MPLL temporary
* To support this level, need to control regulator for
Expand All @@ -113,8 +116,8 @@ static int exynos_target(struct cpufreq_policy *policy,
if (safe_arm_volt)
regulator_set_voltage(arm_regulator, safe_arm_volt,
safe_arm_volt);
if (freqs.new != freqs.old)
exynos_info->set_freq(old_index, index);

exynos_info->set_freq(old_index, index);

for_each_cpu(freqs.cpu, policy->cpus)
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
Expand Down

0 comments on commit 857d90f

Please sign in to comment.