[PATCH 3/3] cpufreq: Add a generic cpufreq-cpu0 driver
Shawn Guo
shawn.guo at linaro.org
Tue Jul 31 14:20:52 EST 2012
On Mon, Jul 30, 2012 at 07:53:45PM +0100, Mark Brown wrote:
> Quite honestly this seems totally unrealistic for the majority of users,
I doubt that. Searching drivers/cpufreq folder, I can see there are
several cpufreq drivers scaling voltage with regulator API, but none
of them is calling regulator_set_voltage_time to find voltage latency.
That said, all these users are specify transition latency on their own.
> especially given the very poor documentation for this stuff which SoC
> vendors typically provide. It's a reasonable amount of work to go back
> and figure this stuff out (especially given that it should be varying
> depending on the transition in question), and it's going to give us a
> bunch of magic numbers in people's bindings.
>
There will be only one magic number, and it can easily become "magic"
with some comments put there.
> No, add a new API.
>
Is the following patch what you are ordering here?
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index da339fd..bfd3cfb 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -352,4 +352,11 @@ static inline void regulator_set_drvdata(struct regulator *regulator,
#endif
+static inline int regulator_set_voltage_tolerance(struct regulator *regulator,
+ int new_uV, int tol_uV)
+{
+ return regulator_set_voltage(regulator,
+ new_uV - tol_uV, new_uV + tol_uV);
+}
+
#endif
--
Regards,
Shawn
More information about the devicetree-discuss
mailing list