From patchwork Tue Nov 17 12:06:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Punit Agrawal X-Patchwork-Id: 56788 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1892160lbb; Tue, 17 Nov 2015 04:07:24 -0800 (PST) X-Received: by 10.66.253.135 with SMTP id aa7mr62278365pad.14.1447762044652; Tue, 17 Nov 2015 04:07:24 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pu2si57119305pac.80.2015.11.17.04.07.24; Tue, 17 Nov 2015 04:07:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753286AbbKQMHJ (ORCPT + 28 others); Tue, 17 Nov 2015 07:07:09 -0500 Received: from fw-tnat.cambridge.arm.com ([217.140.96.140]:25823 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752879AbbKQMHG (ORCPT ); Tue, 17 Nov 2015 07:07:06 -0500 Received: from e105922-lin.cambridge.arm.com (e105922-lin.cambridge.arm.com [10.1.207.164]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with SMTP id tAHC6psv025098; Tue, 17 Nov 2015 12:06:51 GMT Received: by e105922-lin.cambridge.arm.com (sSMTP sendmail emulation); Tue, 17 Nov 2015 12:06:51 +0000 From: Punit Agrawal To: linux-pm@vger.kernel.org Cc: Punit Agrawal , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, edubezval@gmail.com, dawei.chien@mediatek.com, javi.merino@arm.com, viresh.kumar@linaro.org, rjw@rjwysocki.net Subject: [PATCH v5 2/3] cpufreq-dt: Supply power coefficient when registering cooling devices Date: Tue, 17 Nov 2015 12:06:22 +0000 Message-Id: <1447761983-12415-3-git-send-email-punit.agrawal@arm.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1447761983-12415-1-git-send-email-punit.agrawal@arm.com> References: <1447761983-12415-1-git-send-email-punit.agrawal@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Support registering cooling devices with dynamic power coefficient where provided by the device tree. This allows OF registered cooling devices driver to be used with the power_allocator thermal governor. Signed-off-by: Punit Agrawal Acked-by: Viresh Kumar Reviewed-by: Javi Merino Cc: Eduardo Valentin --- drivers/cpufreq/cpufreq-dt.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.6.2 -- 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/ diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index 90d6408..1ceece9 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -407,8 +407,13 @@ static void cpufreq_ready(struct cpufreq_policy *policy) * thermal DT code takes care of matching them. */ if (of_find_property(np, "#cooling-cells", NULL)) { - priv->cdev = of_cpufreq_cooling_register(np, - policy->related_cpus); + u32 power_coefficient = 0; + + of_property_read_u32(np, "dynamic-power-coefficient", + &power_coefficient); + + priv->cdev = of_cpufreq_power_cooling_register(np, + policy->related_cpus, power_coefficient, NULL); if (IS_ERR(priv->cdev)) { dev_err(priv->cpu_dev, "running cpufreq without cooling device: %ld\n",