cpufreq: dt: change frequency to a specific value when cpufreq exits
authorFinley Xiao <finley.xiao@rock-chips.com>
Tue, 29 Nov 2016 12:23:13 +0000 (20:23 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Wed, 7 Dec 2016 12:10:39 +0000 (20:10 +0800)
Sometimes all cpus of big cluster are closed and its frequency
keep a high value, in order to reduce power and reset normally,
set frequency to a specific value after close all the cpus.

Change-Id: I88bce25812d1b0ff3f78a898cb161642a65cc523
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
drivers/cpufreq/cpufreq-dt.c

index d4df226e475dbb92561ff287670e3469e921b77c..73d8102ff19d46ef40b297451b8d5ad55b4134bf 100644 (file)
@@ -300,6 +300,12 @@ static int cpufreq_exit(struct cpufreq_policy *policy)
        struct cpumask cpus;
        struct private_data *priv = policy->driver_data;
 
+#ifdef CONFIG_ARCH_ROCKCHIP
+       cpumask_set_cpu(policy->cpu, policy->cpus);
+       if (cpufreq_generic_suspend(policy))
+               pr_err("%s: Failed to suspend driver: %p\n", __func__, policy);
+       cpumask_clear_cpu(policy->cpu, policy->cpus);
+#endif
        priv->cpu_dev = get_cpu_device(policy->cpu);
        cpufreq_cooling_unregister(priv->cdev);
        dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table);