From: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: cpufreq-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Kevin Hilman <khilman-l0cyMroinI0@public.gmane.org>,
Nishanth Menon <nm-l0cyMroinI0@public.gmane.org>,
Russell King - ARM Linux
<linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
Mike Turquette
<mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
Mark Brown
<broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>,
"Rafael J. Wysocki" <rjw-KKrjLPT3xs0@public.gmane.org>,
Shilimkar Santosh
<santosh.shilimkar-l0cyMroinI0@public.gmane.org>,
Richard Zhao
<richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: [PATCH v2 3/4] regulator: add a new API regulator_set_voltage_tol()
Date: Sun, 5 Aug 2012 23:05:20 +0800 [thread overview]
Message-ID: <1344179121-17738-4-git-send-email-shawn.guo@linaro.org> (raw)
In-Reply-To: <1344179121-17738-1-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
There are some use cases where a voltage range could be reasonably
specified by a target voltage and tolerance. Add a new API
regulator_set_voltage_tol() wrapping regulator_set_voltage() call
to ease the users.
Signed-off-by: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
include/linux/regulator/consumer.h | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index da339fd..2160352 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_tol(struct regulator *regulator,
+ int new_uV, int tol_uV)
+{
+ return regulator_set_voltage(regulator,
+ new_uV - tol_uV, new_uV + tol_uV);
+}
+
#endif
--
1.7.5.4
next prev parent reply other threads:[~2012-08-05 15:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-05 15:05 [PATCH v2 0/4] Add a generic cpufreq-cpu0 driver Shawn Guo
[not found] ` <1344179121-17738-1-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2012-08-05 15:05 ` [PATCH v2 1/4] ARM: add cpufreq transiton notifier to adjust loops_per_jiffy for smp Shawn Guo
2012-08-05 15:05 ` [PATCH v2 2/4] PM / OPP: Initialize OPP table from device tree Shawn Guo
[not found] ` <1344179121-17738-3-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2012-08-06 2:50 ` Rob Herring
2012-08-06 3:19 ` Shawn Guo
2012-08-06 4:43 ` Rob Herring
2012-08-06 5:23 ` Shawn Guo
2012-08-05 15:05 ` Shawn Guo [this message]
2012-08-08 13:35 ` [PATCH v2 3/4] regulator: add a new API regulator_set_voltage_tol() Mark Brown
2012-08-08 14:30 ` Shawn Guo
2012-08-09 10:53 ` Mark Brown
2012-08-05 15:05 ` [PATCH v2 4/4] cpufreq: Add a generic cpufreq-cpu0 driver Shawn Guo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1344179121-17738-4-git-send-email-shawn.guo@linaro.org \
--to=shawn.guo-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
--cc=broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org \
--cc=cpufreq-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=khilman-l0cyMroinI0@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
--cc=linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=nm-l0cyMroinI0@public.gmane.org \
--cc=richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
--cc=rjw-KKrjLPT3xs0@public.gmane.org \
--cc=santosh.shilimkar-l0cyMroinI0@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).