[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250310055638.tvxz2y2sxm3e6hw3@vireshk-i7>
Date: Mon, 10 Mar 2025 11:26:38 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Zxyan Zhu <zxyan20@....com>
Cc: vireshk@...nel.org, nm@...com, sboyd@...nel.org,
linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] OPP: Support multiple frequency points with
opp-hz-<name>
On 04-03-25, 20:52, Zxyan Zhu wrote:
> Current OPP driver only supports a single frequency value per OPP
> entry using `opp-hz`. This patch extends the functionality to allow
> retrieving named frequency points using `opp-hz-<name>`, improving
> flexibility for different operating modes.
I believe you have a use case for this ? Can you post that too ?
> Signed-off-by: Zxyan Zhu <zxyan20@....com>
> ---
> drivers/opp/of.c | 28 ++++++++++++++++++++--------
> 1 file changed, 20 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/opp/of.c b/drivers/opp/of.c
> index a24f76f5fd01..d20802b0f89c 100644
> --- a/drivers/opp/of.c
> +++ b/drivers/opp/of.c
> @@ -752,18 +752,30 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_of_remove_table);
> static int _read_rate(struct dev_pm_opp *new_opp, struct opp_table *opp_table,
> struct device_node *np)
> {
> - struct property *prop;
> + struct property *prop = NULL;
> int i, count, ret;
> u64 *rates;
> + char name[NAME_MAX];
>
> - prop = of_find_property(np, "opp-hz", NULL);
> - if (!prop)
> - return -ENODEV;
> + /* Search for "opp-hz-<name>" */
> + if (opp_table->prop_name) {
There is a helper to do this job: _parse_named_prop() that you can
reuse.
You also need to update:
Documentation/devicetree/bindings/opp/opp-v2-base.yaml for this new
property. Entries are already there for other -named properties.
--
viresh
Powered by blists - more mailing lists