[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220223055357.t3wulpla64vt3xus@vireshk-i7>
Date: Wed, 23 Feb 2022 11:23:57 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Lukasz Luba <lukasz.luba@....com>
Cc: linux-kernel@...r.kernel.org, dietmar.eggemann@....com,
rafael@...nel.org, daniel.lezcano@...aro.org, nm@...com,
sboyd@...nel.org, mka@...omium.org, dianders@...omium.org,
robh+dt@...nel.org, devicetree@...r.kernel.org,
linux-pm@...r.kernel.org
Subject: Re: [[PATCH v2 2/2] OPP: Add 'opp-microwatt' parsing for advanced EM
registration
On 22-02-22, 14:07, Lukasz Luba wrote:
> +static int _of_find_opp_microwatt_property(struct device *dev)
> +{
> + unsigned long freq = 0;
> + struct dev_pm_opp *opp;
> + struct device_node *np;
> + struct property *prop;
> +
> + /* We only support "operating-points-v2" */
> + np = dev_pm_opp_of_get_opp_desc_node(dev);
> + if (!np)
> + return -EINVAL;
> +
> + of_node_put(np);
> +
> + /* Check if an OPP has needed property */
> + opp = dev_pm_opp_find_freq_ceil(dev, &freq);
> + if (IS_ERR(opp))
> + return -EINVAL;
> +
> + prop = of_find_property(opp->np, "opp-microwatt", NULL);
> + dev_pm_opp_put(opp);
> + if (!prop)
> + return -EINVAL;
> +
> + return 0;
> +}
Please follow everything just like opp-microvolt is defined. Create a new field
in the struct dev_pm_opp, initialize it only once when the OPP is created, that
field should be used here instead of parsing the DT here again. There also needs
to be a debug file in debugfs for this new field.
Search for "supply" and "microvolt" in the OPP core, you will see all the places
that need it.
--
viresh
Powered by blists - more mailing lists