exynos: acme: check need awake when get/set freq.
authorSoohyun Kim <soohyuni.kim@samsung.com>
Thu, 29 Mar 2018 04:12:35 +0000 (13:12 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:33:20 +0000 (17:33 +0900)
Change-Id: Iea6c79e32612dc40e4d7b3e4ceacaa2c4efb1fb0
Signed-off-by: Soohyun Kim <soohyuni.kim@samsung.com>
drivers/cpufreq/exynos-acme.c

index 354cb3acfd95ac2909cba4f10d87ce7b6b83a0f1..a5af5b602c813138ac274044dc06971d772a460d 100644 (file)
@@ -144,7 +144,8 @@ static unsigned int get_freq(struct exynos_cpufreq_domain *domain)
 {
        unsigned int freq;
 
-       disable_power_mode(cpumask_any(&domain->cpus), POWERMODE_TYPE_CLUSTER);
+       if (domain->need_awake)
+               disable_power_mode(cpumask_any(&domain->cpus), POWERMODE_TYPE_CLUSTER);
 
        freq = (unsigned int)cal_dfs_get_rate(domain->cal_id);
        if (!freq) {
@@ -152,7 +153,8 @@ static unsigned int get_freq(struct exynos_cpufreq_domain *domain)
                freq = domain->old;
        }
 
-       enable_power_mode(cpumask_any(&domain->cpus), POWERMODE_TYPE_CLUSTER);
+       if (domain->need_awake)
+               enable_power_mode(cpumask_any(&domain->cpus), POWERMODE_TYPE_CLUSTER);
 
        return freq;
 }
@@ -162,7 +164,8 @@ static int set_freq(struct exynos_cpufreq_domain *domain,
 {
        int err;
 
-       disable_power_mode(cpumask_any(&domain->cpus), POWERMODE_TYPE_CLUSTER);
+       if (domain->need_awake)
+               disable_power_mode(cpumask_any(&domain->cpus), POWERMODE_TYPE_CLUSTER);
 
        exynos_ss_printk("ID %d: %d -> %d (%d)\n",
                domain->id, domain->old, target_freq, ESS_FLAG_IN);
@@ -175,7 +178,8 @@ static int set_freq(struct exynos_cpufreq_domain *domain,
        exynos_ss_printk("ID %d: %d -> %d (%d)\n",
                domain->id, domain->old, target_freq, ESS_FLAG_OUT);
 
-       enable_power_mode(cpumask_any(&domain->cpus), POWERMODE_TYPE_CLUSTER);
+       if (domain->need_awake)
+               enable_power_mode(cpumask_any(&domain->cpus), POWERMODE_TYPE_CLUSTER);
 
        return err;
 }