cpufreq: add different freqs variable for big&little core [1/1]
authorHong Guo <hong.guo@amlogic.com>
Thu, 17 Oct 2019 02:09:51 +0000 (10:09 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Thu, 17 Oct 2019 03:57:09 +0000 (20:57 -0700)
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: I3fbe4c6ee4f2a0868c84b362acddf16ac41a3dbd
Signed-off-by: Hong Guo <hong.guo@amlogic.com>
drivers/amlogic/cpufreq/meson-cpufreq.c

index 166fdf8..3393628 100644 (file)
@@ -208,7 +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];
+       struct cpufreq_freqs freqs;
        int ret = 0;
 
        if (!policy) {
@@ -261,9 +261,9 @@ static int meson_cpufreq_set_target(struct cpufreq_policy *policy,
                }
        }
 
-       freqs[cur_cluster].old = freq_old / 1000;
-       freqs[cur_cluster].new = freq_new / 1000;
-       cpufreq_freq_transition_begin(policy, &freqs[cur_cluster]);
+       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);
@@ -278,7 +278,7 @@ static int meson_cpufreq_set_target(struct cpufreq_policy *policy,
                return ret;
        }
 
-       cpufreq_freq_transition_end(policy, &freqs[cur_cluster], 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,
@@ -286,15 +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[cur_cluster].old = freq_new / 1000;
-                       freqs[cur_cluster].new = freq_old / 1000;
+                       freqs.old = freq_new / 1000;
+                       freqs.new = freq_old / 1000;
                        cpufreq_freq_transition_begin(policy,
-                                                     &freqs[cur_cluster]);
+                                                     &freqs);
 
                        ret = meson_cpufreq_set_rate(policy, cur_cluster,
                                freq_old / 1000);
                        cpufreq_freq_transition_end(policy,
-                                                   &freqs[cur_cluster], ret);
+                                                   &freqs, ret);
                }
        }