linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@gmail.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@ti.com>,
	linux-kernel@vger.kernel.org, Gyungoh Yoo <jack.yoo@maxim-ic.com>,
	Stephen Warren <swarren@nvidia.com>,
	Laxman Dewangan <ldewangan@nvidia.com>
Subject: [PATCH] regulator: max8907: Fix n_voltages for MAX8907B SD1
Date: Thu, 16 Aug 2012 12:26:02 +0800	[thread overview]
Message-ID: <1345091162.14780.0.camel@phoenix> (raw)

For linear voltage mapping, the n_voltages is (max - min) / step + 1

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/regulator/max8907-regulator.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/max8907-regulator.c b/drivers/regulator/max8907-regulator.c
index bd3b28b..bdf21a1 100644
--- a/drivers/regulator/max8907-regulator.c
+++ b/drivers/regulator/max8907-regulator.c
@@ -286,7 +286,8 @@ static __devinit int max8907_regulator_probe(struct platform_device *pdev)
 	    MAX8907_II2RR_VERSION_REV_B) {
 		pmic->desc[MAX8907_SD1].min_uV = 637500;
 		pmic->desc[MAX8907_SD1].uV_step = 12500;
-		pmic->desc[MAX8907_SD1].n_voltages = (1425000 - 637500) / 12500;
+		pmic->desc[MAX8907_SD1].n_voltages =
+						(1425000 - 637500) / 12500 + 1;
 	}
 
 	for (i = 0; i < MAX8907_NUM_REGULATORS; i++) {
-- 
1.7.9.5




             reply	other threads:[~2012-08-16  4:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-16  4:26 Axel Lin [this message]
2012-08-16 16:06 ` [PATCH] regulator: max8907: Fix n_voltages for MAX8907B SD1 Stephen Warren
2012-08-17 22:01 ` 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=1345091162.14780.0.camel@phoenix \
    --to=axel.lin@gmail.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=jack.yoo@maxim-ic.com \
    --cc=ldewangan@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.com \
    --cc=swarren@nvidia.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).