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: Laxman Dewangan <ldewangan@nvidia.com>,
	Graeme Gregory <gg@slimlogic.co.uk>,
	Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH RFT] regulator: palmas: Remove wrong voltage setting for enabling LDO8 tracking mode
Date: Fri, 19 Apr 2013 11:14:49 +0800	[thread overview]
Message-ID: <1366341289.18636.2.camel@phoenix> (raw)

When SMPS45 is set to off and LDO8 tracking is enabled, LDO8 output can be set
from 0.45 to 1.65V and the steps of voltage change is 25mV.

This is done by setting:
        pmic->desc[id].min_uV = 450000;
        pmic->desc[id].uV_step = 25000;

I don't see the point of reading vsel register, multiple the register value by
2 and then write back to the register.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
Hi Laxman,

Current code looks strange (and wrong) to me.
I don't see the point of reading vsel register, multiple the register value by
2 and then write back to the register.
Can you double check this patch, in case I might misunderstand the code.

Thanks,
Axel

 drivers/regulator/palmas-regulator.c |   18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c
index 67ed5e5d..f26344e 100644
--- a/drivers/regulator/palmas-regulator.c
+++ b/drivers/regulator/palmas-regulator.c
@@ -643,24 +643,6 @@ static void palmas_enable_ldo8_track(struct palmas *palmas)
 		dev_err(palmas->dev, "Error in enabling tracking mode\n");
 		return;
 	}
-	/*
-	 * When SMPS45 is set to off and LDO8 tracking is enabled, the LDO8
-	 * output is defined by the LDO8_VOLTAGE.VSEL register divided by two,
-	 * and can be set from 0.45 to 1.65 V.
-	 */
-	addr = palmas_regs_info[PALMAS_REG_LDO8].vsel_addr;
-	ret = palmas_ldo_read(palmas, addr, &reg);
-	if (ret) {
-		dev_err(palmas->dev, "Error in reading ldo8 voltage reg\n");
-		return;
-	}
-
-	reg = (reg << 1) & PALMAS_LDO8_VOLTAGE_VSEL_MASK;
-	ret = palmas_ldo_write(palmas, addr, reg);
-	if (ret < 0)
-		dev_err(palmas->dev, "Error in setting ldo8 voltage reg\n");
-
-	return;
 }
 
 static struct of_regulator_match palmas_matches[] = {
-- 
1.7.10.4




             reply	other threads:[~2013-04-19  3:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-19  3:14 Axel Lin [this message]
2013-04-19  4:49 ` [PATCH RFT] regulator: palmas: Remove wrong voltage setting for enabling LDO8 tracking mode Laxman Dewangan

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=1366341289.18636.2.camel@phoenix \
    --to=axel.lin@ingics.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=gg@slimlogic.co.uk \
    --cc=ldewangan@nvidia.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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