Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1aa573e9 authored by Satya Durga Srinivasu Prabhala's avatar Satya Durga Srinivasu Prabhala
Browse files

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: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent 1086d314
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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;
}