From: Axel Lin <axel.lin@ingics.com>
To: Mark Brown <broonie@kernel.org>
Cc: Matt Sealey <matt@genesi-usa.com>,
Steev Klimaszewski <steev@genesi-usa.com>,
Yong Shen <yong.shen@linaro.org>,
Liam Girdwood <lgirdwood@gmail.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH] regulator: mc13892: Fix MC13892_SWITCHERS0_SWxHI bit in set_voltage_sel
Date: Wed, 24 Apr 2013 11:51:12 +0800 [thread overview]
Message-ID: <1366775472.22788.1.camel@phoenix> (raw)
It is necessary to clear MC13892_SWITCHERS0_SWxHI bit when set voltage to the
voltage range from 1100000 to 1375000. Leaving MC13892_SWITCHERS0_SWxHI bit
untouched may result in wrong voltage setting.
For example, currently switch voltage from 1400000 to 1300000 will set the
voltage to 1800000 because the HI bit is still set.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/regulator/mc13892-regulator.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/regulator/mc13892-regulator.c b/drivers/regulator/mc13892-regulator.c
index 9891aec..cc76c52 100644
--- a/drivers/regulator/mc13892-regulator.c
+++ b/drivers/regulator/mc13892-regulator.c
@@ -465,13 +465,13 @@ static int mc13892_sw_regulator_set_voltage_sel(struct regulator_dev *rdev,
*/
if (mc13892_regulators[id].vsel_reg != MC13892_SWITCHERS0) {
+ mask |= MC13892_SWITCHERS0_SWxHI;
+
if (volt > 1375000) {
reg_value -= MC13892_SWxHI_SEL_OFFSET;
reg_value |= MC13892_SWITCHERS0_SWxHI;
- mask |= MC13892_SWITCHERS0_SWxHI;
- } else if (volt < 1100000) {
+ } else {
reg_value &= ~MC13892_SWITCHERS0_SWxHI;
- mask |= MC13892_SWITCHERS0_SWxHI;
}
}
--
1.7.10.4
next reply other threads:[~2013-04-24 3:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-24 3:51 Axel Lin [this message]
2013-04-25 10:52 ` [PATCH] regulator: mc13892: Fix MC13892_SWITCHERS0_SWxHI bit in set_voltage_sel Mark Brown
2013-04-28 1:13 ` 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=1366775472.22788.1.camel@phoenix \
--to=axel.lin@ingics.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matt@genesi-usa.com \
--cc=steev@genesi-usa.com \
--cc=yong.shen@linaro.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