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 <satyap@codeaurora.org>
This commit is contained in:
Satya Durga Srinivasu Prabhala 2018-12-13 12:39:58 -08:00
parent 1086d31484
commit 1aa573e9a1

View file

@ -10,6 +10,7 @@
#include <linux/of_address.h>
#include <linux/of_platform.h>
#include <linux/pm_opp.h>
#include <linux/energy_model.h>
#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;
}