From 9d1e44535cebc73926ff8da08923519602b82940 Mon Sep 17 00:00:00 2001 From: Hong Guo Date: Tue, 15 Oct 2019 17:02:02 +0800 Subject: [PATCH] cpufreq: add different freqs variable for big&little core [1/1] PD#SWPL-15315 Problem: add different freqs variable for big&little core Solution: add different freqs variable for big&little core Verify: test pass on g12b_w400 Change-Id: I2a5e00b5bbd4a1d084b925733a051497c6e92b0b Signed-off-by: Hong Guo --- drivers/amlogic/cpufreq/meson-cpufreq.c | 18 ++++++++++-------- drivers/amlogic/cpufreq/meson-cpufreq.h | 1 - 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/amlogic/cpufreq/meson-cpufreq.c b/drivers/amlogic/cpufreq/meson-cpufreq.c index 039272e..166fdf8 100644 --- a/drivers/amlogic/cpufreq/meson-cpufreq.c +++ b/drivers/amlogic/cpufreq/meson-cpufreq.c @@ -208,6 +208,7 @@ static int meson_cpufreq_set_target(struct cpufreq_policy *policy, struct meson_cpufreq_driver_data *cpufreq_data; struct device *cpu_dev; struct regulator *cpu_reg; + struct cpufreq_freqs freqs[MAX_CLUSTERS]; int ret = 0; if (!policy) { @@ -260,9 +261,9 @@ static int meson_cpufreq_set_target(struct cpufreq_policy *policy, } } - freqs.old = freq_old / 1000; - freqs.new = freq_new / 1000; - cpufreq_freq_transition_begin(policy, &freqs); + freqs[cur_cluster].old = freq_old / 1000; + freqs[cur_cluster].new = freq_new / 1000; + cpufreq_freq_transition_begin(policy, &freqs[cur_cluster]); /*scale clock frequency*/ ret = meson_cpufreq_set_rate(policy, cur_cluster, freq_new / 1000); @@ -277,7 +278,7 @@ static int meson_cpufreq_set_target(struct cpufreq_policy *policy, return ret; } - cpufreq_freq_transition_end(policy, &freqs, ret); + cpufreq_freq_transition_end(policy, &freqs[cur_cluster], ret); /*cpufreq down,change voltage after frequency*/ if (freq_new < freq_old) { ret = meson_regulator_set_volate(cpu_reg, volt_old, @@ -285,14 +286,15 @@ 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); - freqs.old = freq_new / 1000; - freqs.new = freq_old / 1000; - cpufreq_freq_transition_begin(policy, &freqs); + freqs[cur_cluster].old = freq_new / 1000; + freqs[cur_cluster].new = freq_old / 1000; + cpufreq_freq_transition_begin(policy, + &freqs[cur_cluster]); ret = meson_cpufreq_set_rate(policy, cur_cluster, freq_old / 1000); cpufreq_freq_transition_end(policy, - &freqs, ret); + &freqs[cur_cluster], ret); } } diff --git a/drivers/amlogic/cpufreq/meson-cpufreq.h b/drivers/amlogic/cpufreq/meson-cpufreq.h index d7b16a0..836074e 100644 --- a/drivers/amlogic/cpufreq/meson-cpufreq.h +++ b/drivers/amlogic/cpufreq/meson-cpufreq.h @@ -42,7 +42,6 @@ static struct cpufreq_frequency_table *freq_table[MAX_CLUSTERS]; /*mid rate for set parent,Khz*/ static unsigned int mid_rate = (1000 * 1000); static unsigned int gap_rate = (10 * 1000 * 1000); -static struct cpufreq_freqs freqs; /* * DSU_LOW_RATE:cpu clk less than DSU_LOW_RATE(1.2G) -- 2.7.4