diff mbox series

[1/2] PM: EM: Add macro em_is_microwatts()

Message ID 20240308065922.10329-1-poshao.chen@mediatek.com (mailing list archive)
State Superseded, archived
Headers show
Series [1/2] PM: EM: Add macro em_is_microwatts() | expand

Commit Message

PoShao Chen March 8, 2024, 6:59 a.m. UTC
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 mbox series

Patch

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
 /*