mbox series

[0/6] OPP: Indexed searching based on frequency

Message ID cover.1689932341.git.viresh.kumar@linaro.org
Headers show
Series OPP: Indexed searching based on frequency | expand

Message

Viresh Kumar July 21, 2023, 9:40 a.m. UTC
Hi,

This series adds support for indexed versions OPP finding helpers.
Some of these are picked from the series posted by Manivannan.

--
Viresh

Manivannan Sadhasivam (2):
  OPP: Introduce dev_pm_opp_find_freq_{ceil/floor}_indexed() APIs
  OPP: Introduce dev_pm_opp_get_freq_indexed() API

Viresh Kumar (4):
  OPP: Rearrange entries in pm_opp.h
  OPP: Add dev_pm_opp_find_freq_exact_indexed()
  OPP: Update _read_freq() to return the correct frequency
  OPP: Reuse dev_pm_opp_get_freq_indexed()

 drivers/opp/core.c     | 109 ++++++++++++++++++++++++++++++++++++-----
 include/linux/pm_opp.h |  62 ++++++++++++++++++-----
 2 files changed, 146 insertions(+), 25 deletions(-)

Comments

Manivannan Sadhasivam July 24, 2023, 6:25 a.m. UTC | #1
On Fri, Jul 21, 2023 at 03:10:58PM +0530, Viresh Kumar wrote:
> Now that we support finding indexed frequencies, lets update
> _read_freq() to return the right one.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

- Mani

> ---
>  drivers/opp/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/opp/core.c b/drivers/opp/core.c
> index 7b1d5724b3d8..95f49fbe431c 100644
> --- a/drivers/opp/core.c
> +++ b/drivers/opp/core.c
> @@ -472,7 +472,7 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_get_opp_count);
>  /* Helpers to read keys */
>  static unsigned long _read_freq(struct dev_pm_opp *opp, int index)
>  {
> -	return opp->rates[0];
> +	return opp->rates[index];
>  }
>  
>  static unsigned long _read_level(struct dev_pm_opp *opp, int index)
> -- 
> 2.31.1.272.g89b43f80a514
>