Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934143AbbLPNaP (ORCPT ); Wed, 16 Dec 2015 08:30:15 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:41727 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S933152AbbLPN3Z (ORCPT ); Wed, 16 Dec 2015 08:29:25 -0500 X-Listener-Flag: 11101 From: Dawei Chien To: Viresh Kumar CC: "Rafael J. Wysocki" , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Matthias Brugger , Daniel Kurtz , Sascha Hauer , Daniel Lezcano , Dawei Chien , , , , , , , Sascha Hauer , Punit Agrawal Subject: [PATCH v6 1/3] thermal: mediatek: Add cpu dynamic power cooling model. Date: Wed, 16 Dec 2015 21:29:14 +0800 Message-ID: <1450272556-29770-2-git-send-email-dawei.chien@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1450272556-29770-1-git-send-email-dawei.chien@mediatek.com> References: <1450272556-29770-1-git-send-email-dawei.chien@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1574 Lines: 50 MT8173 cpufreq driver select of_cpufreq_power_cooling_register registering cooling devices with dynamic power coefficient. Signed-off-by: Dawei Chien --- This patch is base on patchset: https://lkml.org/lkml/2015/11/17/251 --- drivers/cpufreq/mt8173-cpufreq.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/mt8173-cpufreq.c b/drivers/cpufreq/mt8173-cpufreq.c index 83001dc..d00bab5 100644 --- a/drivers/cpufreq/mt8173-cpufreq.c +++ b/drivers/cpufreq/mt8173-cpufreq.c @@ -263,17 +263,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, -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/