summaryrefslogtreecommitdiff
path: root/drivers/cpufreq/mt8173-cpufreq.c
diff options
context:
space:
mode:
authorPi-Cheng Chen <pi-cheng.chen@linaro.org>2015-12-27 09:21:57 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-01-02 02:49:33 +0300
commita889331d759453fa7f424330f75ae4e2b9e02db4 (patch)
treeed0a5a4c63918e9d186d6c6cc21359f9532b9126 /drivers/cpufreq/mt8173-cpufreq.c
parentc6f48119a1771c078dce0fca3ede77cd0062e2e4 (diff)
downloadlinux-a889331d759453fa7f424330f75ae4e2b9e02db4.tar.xz
cpufreq: mt8173: migrate to use operating-points-v2 bindings
Modify mt8173-cpufreq driver to get OPP-sharing information and set up OPP table provided by operating-points-v2 bindings. Signed-off-by: Pi-Cheng Chen <pi-cheng.chen@linaro.org> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/mt8173-cpufreq.c')
-rw-r--r--drivers/cpufreq/mt8173-cpufreq.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/cpufreq/mt8173-cpufreq.c b/drivers/cpufreq/mt8173-cpufreq.c
index fd601b92f5ec..1efba340456d 100644
--- a/drivers/cpufreq/mt8173-cpufreq.c
+++ b/drivers/cpufreq/mt8173-cpufreq.c
@@ -390,7 +390,15 @@ static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info, int cpu)
/* Both presence and absence of sram regulator are valid cases. */
sram_reg = regulator_get_exclusive(cpu_dev, "sram");
- ret = dev_pm_opp_of_add_table(cpu_dev);
+ /* Get OPP-sharing information from "operating-points-v2" bindings */
+ ret = dev_pm_opp_of_get_sharing_cpus(cpu_dev, &info->cpus);
+ if (ret) {
+ pr_err("failed to get OPP-sharing information for cpu%d\n",
+ cpu);
+ goto out_free_resources;
+ }
+
+ ret = dev_pm_opp_of_cpumask_add_table(&info->cpus);
if (ret) {
pr_warn("no OPP table for cpu%d\n", cpu);
goto out_free_resources;
@@ -421,13 +429,10 @@ static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info, int cpu)
*/
info->need_voltage_tracking = !IS_ERR(sram_reg);
- /* CPUs in the same cluster share a clock and power domain. */
- cpumask_copy(&info->cpus, &cpu_topology[cpu].core_sibling);
-
return 0;
out_free_opp_table:
- dev_pm_opp_of_remove_table(cpu_dev);
+ dev_pm_opp_of_cpumask_remove_table(&info->cpus);
out_free_resources:
if (!IS_ERR(proc_reg))
@@ -453,7 +458,7 @@ static void mtk_cpu_dvfs_info_release(struct mtk_cpu_dvfs_info *info)
if (!IS_ERR(info->inter_clk))
clk_put(info->inter_clk);
- dev_pm_opp_of_remove_table(info->cpu_dev);
+ dev_pm_opp_of_cpumask_remove_table(&info->cpus);
}
static int mtk_cpufreq_init(struct cpufreq_policy *policy)