Revert "OPP: Reuse dev_pm_opp_get_freq_indexed()"

This reverts commit e20fd4d3a4 which is
commit 746de82550 upstream.

It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.

Bug: 161946584
Change-Id: I13648075fb2871b25977bc22ce6d11bd9e795506
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2025-03-05 17:02:48 +00:00
parent f7d86656ca
commit 6811b9303c
2 changed files with 28 additions and 5 deletions

View File

@@ -179,6 +179,27 @@ unsigned long dev_pm_opp_get_power(struct dev_pm_opp *opp)
}
EXPORT_SYMBOL_GPL(dev_pm_opp_get_power);
/**
* dev_pm_opp_get_freq() - Gets the frequency corresponding to an available opp
* @opp: opp for which frequency has to be returned for
*
* Return: frequency in hertz corresponding to the opp, else
* return 0
*/
unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp)
{
if (IS_ERR_OR_NULL(opp)) {
pr_err("%s: Invalid parameters\n", __func__);
return 0;
}
if (!assert_single_clk(opp->opp_table))
return 0;
return opp->rates[0];
}
EXPORT_SYMBOL_GPL(dev_pm_opp_get_freq);
/**
* dev_pm_opp_get_freq_indexed() - Gets the frequency corresponding to an
* available opp with specified index

View File

@@ -115,6 +115,8 @@ int dev_pm_opp_get_supplies(struct dev_pm_opp *opp, struct dev_pm_opp_supply *su
unsigned long dev_pm_opp_get_power(struct dev_pm_opp *opp);
unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp);
unsigned long dev_pm_opp_get_freq_indexed(struct dev_pm_opp *opp, u32 index);
unsigned int dev_pm_opp_get_level(struct dev_pm_opp *opp);
@@ -225,6 +227,11 @@ static inline unsigned long dev_pm_opp_get_power(struct dev_pm_opp *opp)
return 0;
}
static inline unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp)
{
return 0;
}
static inline unsigned long dev_pm_opp_get_freq_indexed(struct dev_pm_opp *opp, u32 index)
{
return 0;
@@ -681,9 +688,4 @@ static inline void dev_pm_opp_put_prop_name(int token)
dev_pm_opp_clear_config(token);
}
static inline unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp)
{
return dev_pm_opp_get_freq_indexed(opp, 0);
}
#endif /* __LINUX_OPP_H__ */