Skip to content

Commit 3166383

Browse files
storulfvireshk
authored andcommitted
OPP: Extend dev_pm_opp_data with a level
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 <[email protected]> Signed-off-by: Viresh Kumar <[email protected]>
1 parent 248a38d commit 3166383

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

drivers/opp/core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2035,6 +2035,7 @@ int _opp_add_v1(struct opp_table *opp_table, struct device *dev,
20352035

20362036
/* populate the opp table */
20372037
new_opp->rates[0] = data->freq;
2038+
new_opp->level = data->level;
20382039
tol = u_volt * opp_table->voltage_tolerance_v1 / 100;
20392040
new_opp->supplies[0].u_volt = u_volt;
20402041
new_opp->supplies[0].u_volt_min = u_volt - tol;

include/linux/pm_opp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,12 @@ struct dev_pm_opp_config {
9494

9595
/**
9696
* struct dev_pm_opp_data - The data to use to initialize an OPP.
97+
* @level: The performance level for the OPP.
9798
* @freq: The clock rate in Hz for the OPP.
9899
* @u_volt: The voltage in uV for the OPP.
99100
*/
100101
struct dev_pm_opp_data {
102+
unsigned int level;
101103
unsigned long freq;
102104
unsigned long u_volt;
103105
};

0 commit comments

Comments
 (0)