aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)
390 /* Both presence and absence of sram regulator are valid cases. */ 390 /* Both presence and absence of sram regulator are valid cases. */
391 sram_reg = regulator_get_exclusive(cpu_dev, "sram"); 391 sram_reg = regulator_get_exclusive(cpu_dev, "sram");
392 392
393 ret = dev_pm_opp_of_add_table(cpu_dev); 393 /* Get OPP-sharing information from "operating-points-v2" bindings */
394 ret = dev_pm_opp_of_get_sharing_cpus(cpu_dev, &info->cpus);
395 if (ret) {
396 pr_err("failed to get OPP-sharing information for cpu%d\n",
397 cpu);
398 goto out_free_resources;
399 }
400
401 ret = dev_pm_opp_of_cpumask_add_table(&info->cpus);
394 if (ret) { 402 if (ret) {
395 pr_warn("no OPP table for cpu%d\n", cpu); 403 pr_warn("no OPP table for cpu%d\n", cpu);
396 goto out_free_resources; 404 goto out_free_resources;
@@ -421,13 +429,10 @@ static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info, int cpu)
421 */ 429 */
422 info->need_voltage_tracking = !IS_ERR(sram_reg); 430 info->need_voltage_tracking = !IS_ERR(sram_reg);
423 431
424 /* CPUs in the same cluster share a clock and power domain. */
425 cpumask_copy(&info->cpus, &cpu_topology[cpu].core_sibling);
426
427 return 0; 432 return 0;
428 433
429out_free_opp_table: 434out_free_opp_table:
430 dev_pm_opp_of_remove_table(cpu_dev); 435 dev_pm_opp_of_cpumask_remove_table(&info->cpus);
431 436
432out_free_resources: 437out_free_resources:
433 if (!IS_ERR(proc_reg)) 438 if (!IS_ERR(proc_reg))
@@ -453,7 +458,7 @@ static void mtk_cpu_dvfs_info_release(struct mtk_cpu_dvfs_info *info)
453 if (!IS_ERR(info->inter_clk)) 458 if (!IS_ERR(info->inter_clk))
454 clk_put(info->inter_clk); 459 clk_put(info->inter_clk);
455 460
456 dev_pm_opp_of_remove_table(info->cpu_dev); 461 dev_pm_opp_of_cpumask_remove_table(&info->cpus);
457} 462}
458 463
459static int mtk_cpufreq_init(struct cpufreq_policy *policy) 464static int mtk_cpufreq_init(struct cpufreq_policy *policy)