All of lore.kernel.org
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Liam Girdwood <lrg@ti.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: [PATCH 2/4] regulator: wm831x-isink: Fix the logic to choose best current limit setting
Date: Tue, 27 Mar 2012 15:18:53 +0800	[thread overview]
Message-ID: <1332832733.9942.3.camel@phoenix> (raw)
In-Reply-To: <1332832646.9942.1.camel@phoenix>

Current code in wm831x_isink_set_current actually set the current limit setting
smaller than specified range.

Fix the logic in wm831x_isink_set_current to choose the smallest current limit
setting falls within the specified range.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/regulator/wm831x-isink.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/regulator/wm831x-isink.c b/drivers/regulator/wm831x-isink.c
index 634aac3..b414e09 100644
--- a/drivers/regulator/wm831x-isink.c
+++ b/drivers/regulator/wm831x-isink.c
@@ -101,7 +101,7 @@ static int wm831x_isink_set_current(struct regulator_dev *rdev,
 
 	for (i = 0; i < ARRAY_SIZE(wm831x_isinkv_values); i++) {
 		int val = wm831x_isinkv_values[i];
-		if (min_uA >= val && val <= max_uA) {
+		if (min_uA <= val && val <= max_uA) {
 			ret = wm831x_set_bits(wm831x, isink->reg,
 					      WM831X_CS1_ISEL_MASK, i);
 			return ret;
-- 
1.7.5.4




  reply	other threads:[~2012-03-27  7:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-27  7:17 [PATCH 1/4] regulator: wm831x-dcdc: Fix the logic to choose best current limit setting Axel Lin
2012-03-27  7:18 ` Axel Lin [this message]
2012-03-27  7:20 ` [PATCH 3/4] regulator: wm8350: " Axel Lin
2012-03-27  7:21 ` [PATCH 4/4] regulator: Return microamps in wm8350_isink_get_current Axel Lin
2012-03-28 11:44 ` [PATCH 1/4] regulator: wm831x-dcdc: Fix the logic to choose best current limit setting Mark Brown

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=1332832733.9942.3.camel@phoenix \
    --to=axel.lin@gmail.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.