From 45f308f0cf6fad39a1dcb1349d6f3ee222edd728 Mon Sep 17 00:00:00 2001 From: Satya Durga Srinivasu Prabhala Date: Thu, 13 Dec 2018 12:39:58 -0800 Subject: [PATCH] cpufreq: qcom-hw: register with Energy Model framework To be able to use Energy Model based on values supplied in DT for "dynamic-power-coefficient" property, need to register with Energy Model framework. This is to make placement decisions based on Energy Model by Energy Aware Scheduler (EAS). Change-Id: Iecc5c12bec2bf5e50d405cf43b501537274249df Signed-off-by: Satya Durga Srinivasu Prabhala Signed-off-by: Taniya Das --- drivers/cpufreq/qcom-cpufreq-hw.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c index 4c74b146d0b8..cc0e3e0e18e5 100644 --- a/drivers/cpufreq/qcom-cpufreq-hw.c +++ b/drivers/cpufreq/qcom-cpufreq-hw.c @@ -10,6 +10,7 @@ #include #include #include +#include #define LUT_MAX_ENTRIES 40U #define CORE_COUNT_VAL(val) (((val) & (GENMASK(18, 16))) >> 16) @@ -90,6 +91,7 @@ qcom_cpufreq_hw_fast_switch(struct cpufreq_policy *policy, static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy) { + struct em_data_callback em_cb = EM_DATA_CB(of_dev_pm_opp_get_cpu_power); struct cpufreq_qcom *c; struct device *cpu_dev; int ret; @@ -117,6 +119,8 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy) policy->freq_table = c->table; policy->driver_data = c; + em_register_perf_domain(policy->cpus, ret, &em_cb); + return 0; }