[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171011110952epcms1p2f1c04c3cc0b078c07b55e7031cd175ac@epcms1p2>
Date: Wed, 11 Oct 2017 11:09:52 +0000
From: MyungJoo Ham <myungjoo.ham@...sung.com>
To: Chanwoo Choi <cw00.choi@...sung.com>,
Kyungmin Park <kyungmin.park@...sung.com>
CC: "rafael.j.wysocki@...el.com" <rafael.j.wysocki@...el.com>,
"chanwoo@...nel.org" <chanwoo@...nel.org>,
Inki Dae <inki.dae@...sung.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>
Subject: RE: [PATCH v3 1/8] PM / devfreq: Set min/max_freq when adding the
devfreq device
> Prior to that, the min/max_freq of the devfreq device are always zero
> before the user changes the min/max_freq through sysfs entries.
> It might make the confusion for the min/max_freq.
>
> This patch initializes the available min/max_freq by using the OPP
> during adding the devfreq device.
>
> Signed-off-by: Chanwoo Choi <cw00.choi@...sung.com>
> ---
> drivers/devfreq/devfreq.c | 43 +++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 43 insertions(+)
>
> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> index a1c4ee818614..ae8717a6eee1 100644
> --- a/drivers/devfreq/devfreq.c
> +++ b/drivers/devfreq/devfreq.c
> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> index a1c4ee818614..ae8717a6eee1 100644
> --- a/drivers/devfreq/devfreq.c
> +++ b/drivers/devfreq/devfreq.c
> @@ -69,6 +69,34 @@ static struct devfreq *find_device_devfreq(struct device *dev)
> return ERR_PTR(-ENODEV);
> }
>
> +static unsigned long find_available_min_freq(struct devfreq *devfreq)
> +{
> + struct dev_pm_opp *opp;
> + unsigned long min_freq = 0;
> +
> + opp = dev_pm_opp_find_freq_ceil(devfreq->dev.parent, &min_freq);
When min_freq is 0, dev_pm_opp_find_freq_ceil will return ERR_PTR(-EINVAL);
--- from drivers/base/power/opp/core.c ------
struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev,
unsigned long *freq)
{
struct opp_table *opp_table;
struct dev_pm_opp *opp;
if (!dev || !freq) {
dev_err(dev, "%s: Invalid argument freq=%p\n", __func__, freq);
return ERR_PTR(-EINVAL);
}
---------------------------------------------
Cheers,
MyungJoo
Powered by blists - more mailing lists