summaryrefslogtreecommitdiff
path: root/drivers/cpufreq/mt8173-cpufreq.c
diff options
context:
space:
mode:
authorDawei Chien <dawei.chien@mediatek.com>2015-12-16 16:29:14 +0300
committerEduardo Valentin <edubezval@gmail.com>2016-05-17 17:28:31 +0300
commitd29016034e5b2bb55fd370e3545685a8536f5474 (patch)
tree3ee79f522b4e9432c36f8c8a3556e18f7c445271 /drivers/cpufreq/mt8173-cpufreq.c
parentb3aef78f76959b94e6df54f80040669a11cc4897 (diff)
downloadlinux-d29016034e5b2bb55fd370e3545685a8536f5474.tar.xz
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>
Diffstat (limited to 'drivers/cpufreq/mt8173-cpufreq.c')
-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,
return 0;
}
+#define DYNAMIC_POWER "dynamic-power-coefficient"
+
static void mtk_cpufreq_ready(struct cpufreq_policy *policy)
{
struct mtk_cpu_dvfs_info *info = policy->driver_data;
struct device_node *np = of_node_get(info->cpu_dev->of_node);
+ u32 capacitance = 0;
if (WARN_ON(!np))
return;
if (of_find_property(np, "#cooling-cells", NULL)) {
- info->cdev = of_cpufreq_cooling_register(np,
- policy->related_cpus);
+ of_property_read_u32(np, DYNAMIC_POWER, &capacitance);
+
+ info->cdev = of_cpufreq_power_cooling_register(np,
+ policy->related_cpus,
+ capacitance,
+ NULL);
if (IS_ERR(info->cdev)) {
dev_err(info->cpu_dev,