aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDawei Chien <dawei.chien@mediatek.com>2015-12-16 08:29:14 -0500
committerEduardo Valentin <edubezval@gmail.com>2016-05-17 10:28:31 -0400
commitd29016034e5b2bb55fd370e3545685a8536f5474 (patch)
tree3ee79f522b4e9432c36f8c8a3556e18f7c445271
parentb3aef78f76959b94e6df54f80040669a11cc4897 (diff)
thermal: mediatek: Add cpu dynamic power cooling model.
MT8173 cpufreq driver select of_cpufreq_power_cooling_register registering cooling devices with dynamic power coefficient. Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Dawei Chien <dawei.chien@mediatek.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
-rw-r--r--drivers/cpufreq/mt8173-cpufreq.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/cpufreq/mt8173-cpufreq.c b/drivers/cpufreq/mt8173-cpufreq.c
index 2058e6d292ce..6e44651c2f39 100644
--- a/drivers/cpufreq/mt8173-cpufreq.c
+++ b/drivers/cpufreq/mt8173-cpufreq.c
@@ -310,17 +310,24 @@ static int mtk_cpufreq_set_target(struct cpufreq_policy *policy,
310 return 0; 310 return 0;
311} 311}
312 312
313#define DYNAMIC_POWER "dynamic-power-coefficient"
314
313static void mtk_cpufreq_ready(struct cpufreq_policy *policy) 315static void mtk_cpufreq_ready(struct cpufreq_policy *policy)
314{ 316{
315 struct mtk_cpu_dvfs_info *info = policy->driver_data; 317 struct mtk_cpu_dvfs_info *info = policy->driver_data;
316 struct device_node *np = of_node_get(info->cpu_dev->of_node); 318 struct device_node *np = of_node_get(info->cpu_dev->of_node);
319 u32 capacitance = 0;
317 320
318 if (WARN_ON(!np)) 321 if (WARN_ON(!np))
319 return; 322 return;
320 323
321 if (of_find_property(np, "#cooling-cells", NULL)) { 324 if (of_find_property(np, "#cooling-cells", NULL)) {
322 info->cdev = of_cpufreq_cooling_register(np, 325 of_property_read_u32(np, DYNAMIC_POWER, &capacitance);
323 policy->related_cpus); 326
327 info->cdev = of_cpufreq_power_cooling_register(np,
328 policy->related_cpus,
329 capacitance,
330 NULL);
324 331
325 if (IS_ERR(info->cdev)) { 332 if (IS_ERR(info->cdev)) {
326 dev_err(info->cpu_dev, 333 dev_err(info->cpu_dev,