[1/3] OPP: Extend dev_pm_opp_data with turbo support

Message ID 20240117110443.2060704-2-quic_sibis@quicinc.com
State New
Headers
Series cpufreq: scmi: Add boost frequency support |

Commit Message

Sibi Sankar Jan. 17, 2024, 11:04 a.m. UTC
  Let's extend the dev_pm_opp_data with a turbo variable, to allow users to
specify if it's a boost frequency for a dynamically added OPP.

Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>
---
 drivers/opp/core.c     | 1 +
 include/linux/pm_opp.h | 1 +
 2 files changed, 2 insertions(+)
  

Comments

Lukasz Luba Feb. 26, 2024, 4:29 p.m. UTC | #1
On 1/17/24 11:04, Sibi Sankar wrote:
> Let's extend the dev_pm_opp_data with a turbo variable, to allow users to
> specify if it's a boost frequency for a dynamically added OPP.
> 
> Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>
> ---
>   drivers/opp/core.c     | 1 +
>   include/linux/pm_opp.h | 1 +
>   2 files changed, 2 insertions(+)
> 
> diff --git a/drivers/opp/core.c b/drivers/opp/core.c
> index c4e0432ae42a..e233734b7220 100644
> --- a/drivers/opp/core.c
> +++ b/drivers/opp/core.c
> @@ -2065,6 +2065,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;
> +	new_opp->turbo = data->turbo;
>   	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;
> diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h
> index 76dcb7f37bcd..a08a1fb1ca2a 100644
> --- a/include/linux/pm_opp.h
> +++ b/include/linux/pm_opp.h
> @@ -93,6 +93,7 @@ struct dev_pm_opp_config {
>    * @u_volt: The voltage in uV for the OPP.
>    */
>   struct dev_pm_opp_data {
> +	bool turbo;

Please add description of that new field, like other
fields in the comment above.

>   	unsigned int level;
>   	unsigned long freq;
>   	unsigned long u_volt;
  

Patch

diff --git a/drivers/opp/core.c b/drivers/opp/core.c
index c4e0432ae42a..e233734b7220 100644
--- a/drivers/opp/core.c
+++ b/drivers/opp/core.c
@@ -2065,6 +2065,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;
+	new_opp->turbo = data->turbo;
 	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;
diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h
index 76dcb7f37bcd..a08a1fb1ca2a 100644
--- a/include/linux/pm_opp.h
+++ b/include/linux/pm_opp.h
@@ -93,6 +93,7 @@  struct dev_pm_opp_config {
  * @u_volt: The voltage in uV for the OPP.
  */
 struct dev_pm_opp_data {
+	bool turbo;
 	unsigned int level;
 	unsigned long freq;
 	unsigned long u_volt;