linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Hohnstaedt <Christian.Hohnstaedt@wago.com>
To: J Keerthy <j-keerthy@ti.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Tony Lindgren <tony@atomide.com>, <devicetree@vger.kernel.org>,
	<linux-omap@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/3] regulator: tps65218.c: fix LS3 issues
Date: Wed, 20 Feb 2019 09:15:50 +0100	[thread overview]
Message-ID: <1550650552-26013-2-git-send-email-Christian.Hohnstaedt@wago.com> (raw)
In-Reply-To: <1550650552-26013-1-git-send-email-Christian.Hohnstaedt@wago.com>

- Fix list of valid LS3 currents from mA to µA
- Fix selection of min/max microAmps of LS3.
  Selecting one of the configured values as max value now really
  selects it instead of the next lower one

Signed-off-by: Christian Hohnstaedt <Christian.Hohnstaedt@wago.com>
---
 drivers/regulator/tps65218-regulator.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/tps65218-regulator.c b/drivers/regulator/tps65218-regulator.c
index 6209bee..5dd559e 100644
--- a/drivers/regulator/tps65218-regulator.c
+++ b/drivers/regulator/tps65218-regulator.c
@@ -188,7 +188,8 @@ static struct regulator_ops tps65218_ldo1_dcdc34_ops = {
 	.set_suspend_disable	= tps65218_pmic_set_suspend_disable,
 };
 
-static const int ls3_currents[] = { 100, 200, 500, 1000 };
+static const int ls3_currents[] = { 100000, 200000, 500000, 1000000 };
+
 
 static int tps65218_pmic_set_input_current_lim(struct regulator_dev *dev,
 					       int lim_uA)
@@ -214,7 +215,7 @@ static int tps65218_pmic_set_current_limit(struct regulator_dev *dev,
 	unsigned int num_currents = ARRAY_SIZE(ls3_currents);
 	struct tps65218 *tps = rdev_get_drvdata(dev);
 
-	while (index < num_currents && ls3_currents[index] < max_uA)
+	while (index < num_currents && ls3_currents[index] <= max_uA)
 		index++;
 
 	index--;
-- 
2.7.4


  reply	other threads:[~2019-02-20  8:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-20  8:15 [PATCH 0/3] regulator: tps65218: Fix LS3 and add LS2 Christian Hohnstaedt
2019-02-20  8:15 ` Christian Hohnstaedt [this message]
2019-02-20 16:40   ` [PATCH 1/3] regulator: tps65218.c: fix LS3 issues Mark Brown
2019-02-20  8:15 ` [PATCH 2/3] dt-bindings: regulator: Add LS2 load switch Christian Hohnstaedt
2019-02-20  8:15 ` [PATCH 3/3] regulator: tps65218: Add support for LS2 Christian Hohnstaedt
2019-02-20 16:48   ` Mark Brown
2019-02-22  8:38     ` [PATCH v2] " Christian Hohnstaedt
2019-02-22 12:19       ` Mark Brown
2019-02-25  6:41 ` [PATCH v2 0/2] regulator: tps65218: support LS2 Christian Hohnstaedt
2019-02-25  6:41   ` [PATCH v2 1/2] dt-bindings: regulator: add LS2 load switch documentation Christian Hohnstaedt
2019-02-27 23:44     ` Rob Herring
2019-02-25  6:41   ` [PATCH v2 2/2] regulator: tps65218: add support for LS2 Christian Hohnstaedt

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=1550650552-26013-2-git-send-email-Christian.Hohnstaedt@wago.com \
    --to=christian.hohnstaedt@wago.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=j-keerthy@ti.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=tony@atomide.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).