Thread (19 messages) 19 messages, 3 authors, 2021-08-11

Re: [PATCH 5/8] cpufreq: omap: Use auto-registration for energy model

From: Lukasz Luba <lukasz.luba@arm.com>
Date: 2021-08-10 10:24:59
Also in: linux-pm, lkml


On 8/10/21 8:36 AM, Viresh Kumar wrote:
quoted hunk ↗ jump to hunk
Use the CPUFREQ_REGISTER_WITH_EM flag to allow cpufreq core to
automatically register with the energy model.

This allows removal of boiler plate code from the driver and fixes the
unregistration part as well.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
  drivers/cpufreq/omap-cpufreq.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
index e035ee216b0f..303136f97773 100644
--- a/drivers/cpufreq/omap-cpufreq.c
+++ b/drivers/cpufreq/omap-cpufreq.c
@@ -131,7 +131,6 @@ static int omap_cpu_init(struct cpufreq_policy *policy)
  
  	/* FIXME: what's the actual transition time? */
  	cpufreq_generic_init(policy, freq_table, 300 * 1000);
-	dev_pm_opp_of_register_em(mpu_dev, policy->cpus);
  
  	return 0;
  }
@@ -144,7 +143,8 @@ static int omap_cpu_exit(struct cpufreq_policy *policy)
  }
  
  static struct cpufreq_driver omap_driver = {
-	.flags		= CPUFREQ_NEED_INITIAL_FREQ_CHECK,
+	.flags		= CPUFREQ_NEED_INITIAL_FREQ_CHECK |
+			  CPUFREQ_REGISTER_WITH_EM,
  	.verify		= cpufreq_generic_frequency_table_verify,
  	.target_index	= omap_target,
  	.get		= cpufreq_generic_get,
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help