From: Marcus Folkesson <marcus.folkesson@gmail.com>
To: Liam Girdwood <lrg@ti.com>,
Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: linux-kernel@vger.kernel.org,
Marcus Folkesson <marcus.folkesson@gmail.com>
Subject: [PATCH 2/4] regulator: tps65023: Set missing bit for update core-voltage
Date: Mon, 8 Aug 2011 20:29:33 +0200 [thread overview]
Message-ID: <1312828175-11999-3-git-send-email-marcus.folkesson@gmail.com> (raw)
In-Reply-To: <1312828175-11999-1-git-send-email-marcus.folkesson@gmail.com>
Setting the GO bit in CTRL2 for updating the core voltage
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
---
drivers/regulator/tps65023-regulator.c | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/drivers/regulator/tps65023-regulator.c b/drivers/regulator/tps65023-regulator.c
index 7bd3c4d..1011470 100644
--- a/drivers/regulator/tps65023-regulator.c
+++ b/drivers/regulator/tps65023-regulator.c
@@ -277,6 +277,7 @@ static int tps65023_dcdc_set_voltage(struct regulator_dev *dev,
struct tps_pmic *tps = rdev_get_drvdata(dev);
int dcdc = rdev_get_id(dev);
int vsel;
+ int ret;
if (dcdc != TPS65023_DCDC_1)
return -EINVAL;
@@ -299,11 +300,21 @@ static int tps65023_dcdc_set_voltage(struct regulator_dev *dev,
*selector = vsel;
- /* write to the register in case we found a match */
if (vsel == tps->info[dcdc]->table_len)
- return -EINVAL;
- else
- return tps_65023_reg_write(tps, TPS65023_REG_DEF_CORE, vsel);
+ goto failed;
+
+ ret = tps_65023_reg_write(tps, TPS65023_REG_DEF_CORE, vsel);
+
+ /* Tell the chip that we have changed the value in DEFCORE
+ * and its time to update the core voltage
+ */
+ tps_65023_set_bits(tps, TPS65023_REG_CON_CTRL2,
+ TPS65023_REG_CTRL2_GO);
+
+ return ret;
+
+failed:
+ return -EINVAL;
}
static int tps65023_ldo_get_voltage(struct regulator_dev *dev)
--
1.7.4.1
next prev parent reply other threads:[~2011-08-08 18:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-08 18:29 [PATCHv3 0/4] Marcus Folkesson
2011-08-08 18:29 ` [PATCH 1/4] regulator: tps65023: Fixes i2c configuration issues Marcus Folkesson
2011-08-28 16:49 ` Liam Girdwood
2011-08-08 18:29 ` Marcus Folkesson [this message]
2011-08-09 0:52 ` [PATCH 2/4] regulator: tps65023: Set missing bit for update core-voltage Mark Brown
2011-08-08 18:29 ` [PATCH 3/4] regulator: tps65023: Setting correct core regulator for tps65021 Marcus Folkesson
2011-08-08 18:29 ` [PATCH 4/4] regulator: tps65023: Added support for the similiar TPS65020 chip Marcus Folkesson
-- strict thread matches above, loose matches on Subject: below --
2011-08-04 11:33 [PATCH 0/4] regulator: tps65023: patch updates Marcus Folkesson
2011-08-04 11:33 ` [PATCH 2/4] regulator: tps65023: Set missing bit for update core-voltage Marcus Folkesson
2011-08-04 12:26 ` Mark Brown
2011-08-02 10:59 [PATCHv2 0/4] regulator: tps65023: patch updates Marcus Folkesson
2011-08-02 10:59 ` [PATCH 2/4] regulator: tps65023: Set missing bit for update core-voltage Marcus Folkesson
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=1312828175-11999-3-git-send-email-marcus.folkesson@gmail.com \
--to=marcus.folkesson@gmail.com \
--cc=broonie@opensource.wolfsonmicro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.