All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Chen-Yu Tsai (Moxa)" <wens@csie.org>
To: nobuhiro1.iwamatsu@toshiba.co.jp, pavel@denx.de
Cc: cip-dev@lists.cip-project.org, JohnsonCH.Chen@moxa.com
Subject: [cip-dev] [PATCH 4.4.y-cip v2 13/15] cpufreq-dt: Supply power coefficient when registering cooling devices
Date: Mon,  8 Jun 2020 17:30:26 +0800	[thread overview]
Message-ID: <20200608093028.21612-14-wens@csie.org> (raw)
In-Reply-To: <20200608093028.21612-1-wens@csie.org>

[-- Attachment #1: Type: text/plain, Size: 1518 bytes --]

From: Punit Agrawal <punit.agrawal@arm.com>

commit f8fa8ae06b8c2c25d81c99766f9226adc5c3e073 upstream.

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 <punit.agrawal@arm.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Javi Merino <javi.merino@arm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Chen-Yu Tsai (Moxa) <wens@csie.org>
---
 drivers/cpufreq/cpufreq-dt.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
index 90d64081ddb34..1ceece9d67112 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",
-- 
2.27.0.rc0


[-- Attachment #2: Type: text/plain, Size: 419 bytes --]

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#4745): https://lists.cip-project.org/g/cip-dev/message/4745
Mute This Topic: https://lists.cip-project.org/mt/74748505/4520388
Group Owner: cip-dev+owner@lists.cip-project.org
Unsubscribe: https://lists.cip-project.org/g/cip-dev/leave/8129055/727948398/xyzzy  [cip-dev@archiver.kernel.org]
-=-=-=-=-=-=-=-=-=-=-=-

  parent reply	other threads:[~2020-06-08  9:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-08  9:30 [cip-dev] [PATCH 4.4.y-cip v2 00/15] PM / OPP v2 & cpufreq backports part 1 Chen-Yu Tsai (Moxa)
2020-06-08  9:30 ` [cip-dev] [PATCH 4.4.y-cip v2 01/15] PM / OPP: Add debugfs support Chen-Yu Tsai (Moxa)
2020-06-08  9:30 ` [cip-dev] [PATCH 4.4.y-cip v2 02/15] PM / OPP: Add "opp-supported-hw" binding Chen-Yu Tsai (Moxa)
2020-06-08  9:30 ` [cip-dev] [PATCH 4.4.y-cip v2 03/15] PM / OPP: Add {opp-microvolt|opp-microamp}-<name> binding Chen-Yu Tsai (Moxa)
2020-06-08  9:30 ` [cip-dev] [PATCH 4.4.y-cip v2 04/15] PM / OPP: Remove 'operating-points-names' binding Chen-Yu Tsai (Moxa)
2020-06-08  9:30 ` [cip-dev] [PATCH 4.4.y-cip v2 05/15] PM / OPP: Rename OPP nodes as opp@<opp-hz> Chen-Yu Tsai (Moxa)
2020-06-08  9:30 ` [cip-dev] [PATCH 4.4.y-cip v2 06/15] PM / OPP: Add missing doc comments Chen-Yu Tsai (Moxa)
2020-06-08  9:30 ` [cip-dev] [PATCH 4.4.y-cip v2 07/15] PM / OPP: Parse 'opp-supported-hw' binding Chen-Yu Tsai (Moxa)
2020-06-08  9:30 ` [cip-dev] [PATCH 4.4.y-cip v2 08/15] PM / OPP: Parse 'opp-<prop>-<name>' bindings Chen-Yu Tsai (Moxa)
2020-06-08  9:30 ` [cip-dev] [PATCH 4.4.y-cip v2 09/15] PM / OPP: Fix parsing of opp-microvolt and opp-microamp properties Chen-Yu Tsai (Moxa)
2020-06-08  9:30 ` [cip-dev] [PATCH 4.4.y-cip v2 10/15] PM / OPP: Set cpu_dev->id in cpumask first Chen-Yu Tsai (Moxa)
2020-06-08  9:30 ` [cip-dev] [PATCH 4.4.y-cip v2 11/15] PM / OPP: Use snprintf() instead of sprintf() Chen-Yu Tsai (Moxa)
2020-06-08  9:30 ` [cip-dev] [PATCH 4.4.y-cip v2 12/15] devicetree: bindings: Add optional dynamic-power-coefficient property Chen-Yu Tsai (Moxa)
2020-06-08  9:30 ` Chen-Yu Tsai (Moxa) [this message]
2020-06-08  9:30 ` [cip-dev] [PATCH 4.4.y-cip v2 14/15] cpufreq-dt: fix handling regulator_get_voltage() result Chen-Yu Tsai (Moxa)
2020-06-08  9:30 ` [cip-dev] [PATCH 4.4.y-cip v2 15/15] cpufreq: cpufreq-dt: avoid uninitialized variable warnings: Chen-Yu Tsai (Moxa)
2020-06-08 21:37 ` [cip-dev] [PATCH 4.4.y-cip v2 00/15] PM / OPP v2 & cpufreq backports part 1 Pavel Machek
  -- strict thread matches above, loose matches on Subject: below --
2020-06-08  9:14 Chen-Yu Tsai (Moxa)
2020-06-08  9:14 ` [cip-dev] [PATCH 4.4.y-cip v2 13/15] cpufreq-dt: Supply power coefficient when registering cooling devices Chen-Yu Tsai (Moxa)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200608093028.21612-14-wens@csie.org \
    --to=wens@csie.org \
    --cc=JohnsonCH.Chen@moxa.com \
    --cc=cip-dev@lists.cip-project.org \
    --cc=nobuhiro1.iwamatsu@toshiba.co.jp \
    --cc=pavel@denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.