From: Axel Lin <axel.lin@ingics.com>
To: Mark Brown <broonie@kernel.org>
Cc: Charles Keepax <ckeepax@opensource.cirrus.com>,
patches@opensource.cirrus.com,
Liam Girdwood <lgirdwood@gmail.com>,
linux-kernel@vger.kernel.org, Axel Lin <axel.lin@ingics.com>
Subject: [PATCH 1/4] regulator: wm831x-isink: Select maximum current in specific range
Date: Wed, 13 Mar 2019 00:33:54 +0800 [thread overview]
Message-ID: <20190312163357.27785-1-axel.lin@ingics.com> (raw)
.set_current_limit callback should select the current closest to max_uA.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/regulator/wm831x-isink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/regulator/wm831x-isink.c b/drivers/regulator/wm831x-isink.c
index 6dd891d7eee3..676a4701c986 100644
--- a/drivers/regulator/wm831x-isink.c
+++ b/drivers/regulator/wm831x-isink.c
@@ -99,7 +99,7 @@ static int wm831x_isink_set_current(struct regulator_dev *rdev,
struct wm831x *wm831x = isink->wm831x;
int ret, i;
- for (i = 0; i < ARRAY_SIZE(wm831x_isinkv_values); i++) {
+ for (i = ARRAY_SIZE(wm831x_isinkv_values) - 1; i >= 0; i--) {
int val = wm831x_isinkv_values[i];
if (min_uA <= val && val <= max_uA) {
ret = wm831x_set_bits(wm831x, isink->reg,
--
2.17.1
next reply other threads:[~2019-03-12 16:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-12 16:33 Axel Lin [this message]
2019-03-12 16:33 ` [PATCH 2/4] regulator: wm8350: Select maximum current in specific range Axel Lin
2019-03-13 14:04 ` Charles Keepax
2019-03-12 16:33 ` [PATCH 3/4] regulator: wm831x-isink: Convert to use regulator_set/get_current_limit_regmap Axel Lin
2019-03-13 14:04 ` Charles Keepax
2019-03-12 16:33 ` [PATCH 4/4] regulator: wm8350: " Axel Lin
2019-03-13 14:05 ` Charles Keepax
2019-03-13 14:04 ` [PATCH 1/4] regulator: wm831x-isink: Select maximum current in specific range Charles Keepax
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=20190312163357.27785-1-axel.lin@ingics.com \
--to=axel.lin@ingics.com \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.cirrus.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
/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).