linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] regulator: wm831x-isink: Select maximum current in specific range
@ 2019-03-12 16:33 Axel Lin
  2019-03-12 16:33 ` [PATCH 2/4] regulator: wm8350: " Axel Lin
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Axel Lin @ 2019-03-12 16:33 UTC (permalink / raw)
  To: Mark Brown; +Cc: Charles Keepax, patches, Liam Girdwood, linux-kernel, Axel Lin

.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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-03-13 14:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-12 16:33 [PATCH 1/4] regulator: wm831x-isink: Select maximum current in specific range Axel Lin
2019-03-12 16:33 ` [PATCH 2/4] regulator: wm8350: " 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

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).