public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@ingics.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Daniel Jeong <gshark.jeong@gmail.com>, Liam Girdwood <lrg@ti.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] regulator: lp8755: Fix mask for pchip->mphase
Date: Wed, 26 Dec 2012 10:12:07 +0800	[thread overview]
Message-ID: <1356487927.18626.1.camel@phoenix> (raw)

According to lp8755.h:
enum lp8755_mphase_config {
        MPHASE_CONF0,
        MPHASE_CONF1,
        MPHASE_CONF2,
        MPHASE_CONF3,
        MPHASE_CONF4,
        MPHASE_CONF5,
        MPHASE_CONF6,
        MPHASE_CONF7,
        MPHASE_CONF8,
        MPHASE_CONF_MAX
};

MPHASE_CONF_MAX is 9, the mask for pchip->mphase should be 0x17.
Otherwise, we cannot differentiate MPHASE_CONF0 and MPHASE_CONF8.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
Hi Daniel,
I don't have the datasheet, can you check if this patch is correct?

BTW, I'm Axel, not Alex.

Regards,
Axel
 drivers/regulator/lp8755.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/lp8755.c b/drivers/regulator/lp8755.c
index 06a82e2..6d5a11d 100644
--- a/drivers/regulator/lp8755.c
+++ b/drivers/regulator/lp8755.c
@@ -301,7 +301,7 @@ static int lp8755_init_data(struct lp8755_chip *pchip)
 	ret = lp8755_read(pchip, 0x3D, &regval);
 	if (ret < 0)
 		goto out_i2c_error;
-	pchip->mphase = regval & 0x07;
+	pchip->mphase = regval & 0x17;
 
 	/* set default data based on multi-phase config */
 	for (icnt = 0; icnt < mphase_buck[pchip->mphase].nreg; icnt++) {
-- 
1.7.9.5




             reply	other threads:[~2012-12-26  2:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-26  2:12 Axel Lin [this message]
2012-12-26  3:47 ` [PATCH] regulator: lp8755: Fix mask for pchip->mphase gshark

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=1356487927.18626.1.camel@phoenix \
    --to=axel.lin@ingics.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=gshark.jeong@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox