[PATCH 2/5] cpufreq: exynos: Check old & new frequency early

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If old & new freq have the same frequency, no need to call
cpufreq notifier & regulator function.

Signed-off-by: Jonghwan Choi <jhbird.choi@xxxxxxxxxxx>
---
 drivers/cpufreq/exynos-cpufreq.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/exynos-cpufreq.c
b/drivers/cpufreq/exynos-cpufreq.c
index 5888aee..82963a3 100644
--- a/drivers/cpufreq/exynos-cpufreq.c
+++ b/drivers/cpufreq/exynos-cpufreq.c
@@ -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
@@ -112,8 +115,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);

        cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);

--
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  Powered by Linux