From 8d22c0c502af480d7e9f6e0c0544d2cf78f2b860 Mon Sep 17 00:00:00 2001 From: Hong Guo Date: Thu, 25 Jul 2019 16:20:45 +0800 Subject: [PATCH] dvfs: update cpu clk after adjust cpufeq for g12b big core [1/1] PD#SWPL-11796 Problem: update cpu clk after adjust cpufeq Solution: update cpu clk after adjust cpufeq Verify: test pass on g12b_w400 Change-Id: I5e4593e4b65de5f7536ddde793d682cc67df0e64 Signed-off-by: Hong Guo --- drivers/amlogic/cpufreq/meson-cpufreq.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/amlogic/cpufreq/meson-cpufreq.c b/drivers/amlogic/cpufreq/meson-cpufreq.c index 996b63b..26ebcd0 100644 --- a/drivers/amlogic/cpufreq/meson-cpufreq.c +++ b/drivers/amlogic/cpufreq/meson-cpufreq.c @@ -261,11 +261,9 @@ static int meson_cpufreq_set_target(struct cpufreq_policy *policy, } } - if (cur_cluster == 0) { - freqs.old = freq_old / 1000; - freqs.new = freq_new / 1000; - cpufreq_freq_transition_begin(policy, &freqs); - } + freqs.old = freq_old / 1000; + freqs.new = freq_new / 1000; + cpufreq_freq_transition_begin(policy, &freqs); /*scale clock frequency*/ ret = meson_cpufreq_set_rate(policy, cur_cluster, freq_new / 1000); @@ -280,8 +278,7 @@ static int meson_cpufreq_set_target(struct cpufreq_policy *policy, return ret; } - if (cur_cluster == 0) - cpufreq_freq_transition_end(policy, &freqs, ret); + cpufreq_freq_transition_end(policy, &freqs, ret); /*cpufreq down,change voltage after frequency*/ if (freq_new < freq_old) { ret = meson_regulator_set_volate(cpu_reg, volt_old, @@ -289,16 +286,13 @@ static int meson_cpufreq_set_target(struct cpufreq_policy *policy, if (ret) { pr_err("failed to scale volt %u %u down: %d\n", volt_new, volt_tol, ret); - if (cur_cluster == 0) { - freqs.old = freq_new / 1000; - freqs.new = freq_old / 1000; - cpufreq_freq_transition_begin(policy, &freqs); - } + freqs.old = freq_new / 1000; + freqs.new = freq_old / 1000; + cpufreq_freq_transition_begin(policy, &freqs); ret = meson_cpufreq_set_rate(policy, cur_cluster, freq_old / 1000); - if (cur_cluster == 0) - cpufreq_freq_transition_end(policy, + cpufreq_freq_transition_end(policy, &freqs, ret); } } -- 2.7.4