[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKohpon9G=JdZ1jSStHZH29VZDggZXm+EOqDAwedk2K0ZxD0Qg@mail.gmail.com>
Date: Wed, 4 Jun 2014 11:16:37 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Mark Brown <broonie@...nel.org>
Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>,
Lists linaro-kernel <linaro-kernel@...ts.linaro.org>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Arvind Chauhan <arvind.chauhan@....com>,
Eduardo Valentin <edubezval@...il.com>,
Pavel Machek <pavel@....cz>,
Liam Girdwood <lgirdwood@...il.com>
Subject: Re: [PATCH 1/2] regulators: Add definition of regulator_set_voltage_time()
for !CONFIG_REGULATOR
On 3 June 2014 21:18, Mark Brown <broonie@...nel.org> wrote:
> No, as I've explained repeatedly NULL is a perfectly valid regulator and
Okay, its been checked at multiple places already and that's obviously
wrong then.
> that's not going to work reliably. As I've previously requested please
> think about what happens to cpufreq if we fail to ramp voltages.
Okay, so here is the scenario:
- driver is generic (like cpufreq-cpu0) and some user platforms may have
regulator support and others might not..
- For platforms with regulators support, we _must_ check if the voltage
change is successful or not and fail if regulator_set_voltage() failed.
- But for platforms without regulators support (CONFIG_REGULATOR=n),
regulator_get() will return NULL (a valid regulator though) and
regulator_set_voltage() will fail. Because the platform doesn't care much
about regulators it must go on and change frequency as if nothing
happened.
How can we achieve both these requirements by a generic piece of
code?
The only way I could think of currently is by returning something
special like -ENOSYS from regulator_set_voltage() when
regulators aren't configured in kernel and check return value of
regulator_set_voltage() against this..
This also holds true for regulator_get_voltage() which is returning
-EINVAL currently..
Please share if you have some other solution in mind..
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists