public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: PoShao Chen <poshao.chen@mediatek.com>
To: <linux-kernel@vger.kernel.org>, <linux-pm@vger.kernel.org>
Cc: <lukasz.luba@arm.com>, <dietmar.eggemann@arm.com>,
	<rafael@kernel.org>, <mingo@kernel.org>,
	<rafael.j.wysocki@intel.com>, <rui.zhang@intel.com>,
	<vincent.guittot@linaro.org>, <daniel.lezcano@linaro.org>,
	<viresh.kumar@linaro.org>, <amit.kachhap@gmail.com>,
	<clive.lin@mediatek.com>, <ccj.yeh@mediatek.com>,
	<ching-hao.hsu@mediatek.com>, <poshao.chen@mediatek.com>
Subject: [PATCH 1/2] PM: EM: Add macro em_is_microwatts()
Date: Fri, 8 Mar 2024 14:59:21 +0800	[thread overview]
Message-ID: <20240308065922.10329-1-poshao.chen@mediatek.com> (raw)

This patch adds a new macro, em_is_microwatts(), which checks if
the EM_PERF_DOMAIN_MICROWATTS flag is set for a given Energy Model.
This macro enables other parts of the kernel, such as cooling
devices, to easily determine the unit of power used by the Energy
Model and to perform the necessary conversions if the values
are provided in microwatts.

Signed-off-by: PoShao Chen <poshao.chen@mediatek.com>
---
 include/linux/energy_model.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/energy_model.h b/include/linux/energy_model.h
index 770755df852f..68145b4368d1 100644
--- a/include/linux/energy_model.h
+++ b/include/linux/energy_model.h
@@ -92,6 +92,7 @@ struct em_perf_domain {
 
 #define em_span_cpus(em) (to_cpumask((em)->cpus))
 #define em_is_artificial(em) ((em)->flags & EM_PERF_DOMAIN_ARTIFICIAL)
+#define em_is_microwatts(em) ((em)->flags & EM_PERF_DOMAIN_MICROWATTS)
 
 #ifdef CONFIG_ENERGY_MODEL
 /*
-- 
2.18.0


             reply	other threads:[~2024-03-08  7:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08  6:59 PoShao Chen [this message]
2024-03-08  6:59 ` [PATCH 2/2] thermal: cooling: Fix unneeded conversions in cpufreq_cooling and devfreq_cooling PoShao Chen
2024-03-08  8:44   ` Lukasz Luba

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=20240308065922.10329-1-poshao.chen@mediatek.com \
    --to=poshao.chen@mediatek.com \
    --cc=amit.kachhap@gmail.com \
    --cc=ccj.yeh@mediatek.com \
    --cc=ching-hao.hsu@mediatek.com \
    --cc=clive.lin@mediatek.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=dietmar.eggemann@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=mingo@kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=vincent.guittot@linaro.org \
    --cc=viresh.kumar@linaro.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox