OPP: Extend dev_pm_opp_data with a level
authorUlf Hansson <ulf.hansson@linaro.org>
Mon, 25 Sep 2023 13:17:10 +0000 (15:17 +0200)
committerViresh Kumar <viresh.kumar@linaro.org>
Fri, 6 Oct 2023 07:07:34 +0000 (12:37 +0530)
Let's extend the dev_pm_opp_data with a level variable, to allow users to
specify a corresponding level (performance state) for a dynamically added
OPP.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/opp/core.c
include/linux/pm_opp.h

index 54b6138e11897ff92adea8e023700569ef01d9de..ca8d1304b508703fe8cf44ded26d1763ed805fb1 100644 (file)
@@ -2035,6 +2035,7 @@ int _opp_add_v1(struct opp_table *opp_table, struct device *dev,
 
        /* populate the opp table */
        new_opp->rates[0] = data->freq;
+       new_opp->level = data->level;
        tol = u_volt * opp_table->voltage_tolerance_v1 / 100;
        new_opp->supplies[0].u_volt = u_volt;
        new_opp->supplies[0].u_volt_min = u_volt - tol;
index a8ee93ba41d84d6b157df2e0f926ed9727cf5644..9ad168f4cbf1319b8c53e6d3d1a54cb5d36e6e70 100644 (file)
@@ -94,10 +94,12 @@ struct dev_pm_opp_config {
 
 /**
  * struct dev_pm_opp_data - The data to use to initialize an OPP.
+ * @level: The performance level for the OPP.
  * @freq: The clock rate in Hz for the OPP.
  * @u_volt: The voltage in uV for the OPP.
  */
 struct dev_pm_opp_data {
+       unsigned int level;
        unsigned long freq;
        unsigned long u_volt;
 };