From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Liam Girdwood <lrg@ti.com>
Cc: Yadwinder Singh <yadi.brar@samsung.com>,
Graeme Gregory <gg@slimlogic.co.uk>,
linux-kernel@vger.kernel.org,
patches@opensource.wolfsonmicro.com,
Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: [PATCH 3/6] regulator: wm831x: Convert to regulator_list_voltage_linear()
Date: Thu, 10 May 2012 00:47:31 +0100 [thread overview]
Message-ID: <1336607255-4967-3-git-send-email-broonie@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1336607255-4967-1-git-send-email-broonie@opensource.wolfsonmicro.com>
Only the alive LDOs can actually use this as all the other regulators have
two linear ranges.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
drivers/regulator/wm831x-ldo.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/drivers/regulator/wm831x-ldo.c b/drivers/regulator/wm831x-ldo.c
index 5bf793d..74ee686 100644
--- a/drivers/regulator/wm831x-ldo.c
+++ b/drivers/regulator/wm831x-ldo.c
@@ -630,15 +630,6 @@ static struct platform_driver wm831x_aldo_driver = {
#define WM831X_ALIVE_LDO_MAX_SELECTOR 0xf
-static int wm831x_alive_ldo_list_voltage(struct regulator_dev *rdev,
- unsigned int selector)
-{
- /* 0.8-1.55V in 50mV steps */
- if (selector <= WM831X_ALIVE_LDO_MAX_SELECTOR)
- return 800000 + (selector * 50000);
- return -EINVAL;
-}
-
static int wm831x_alive_ldo_set_voltage_int(struct regulator_dev *rdev,
int reg,
int min_uV, int max_uV,
@@ -650,7 +641,7 @@ static int wm831x_alive_ldo_set_voltage_int(struct regulator_dev *rdev,
vsel = (min_uV - 800000) / 50000;
- ret = wm831x_alive_ldo_list_voltage(rdev, vsel);
+ ret = regulator_list_voltage_linear(rdev, vsel);
if (ret < 0)
return ret;
if (ret < min_uV || ret > max_uV)
@@ -700,7 +691,7 @@ static int wm831x_alive_ldo_get_status(struct regulator_dev *rdev)
}
static struct regulator_ops wm831x_alive_ldo_ops = {
- .list_voltage = wm831x_alive_ldo_list_voltage,
+ .list_voltage = regulator_list_voltage_linear,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
.set_voltage = wm831x_alive_ldo_set_voltage,
.set_suspend_voltage = wm831x_alive_ldo_set_suspend_voltage,
@@ -765,6 +756,8 @@ static __devinit int wm831x_alive_ldo_probe(struct platform_device *pdev)
ldo->desc.vsel_mask = WM831X_LDO11_ON_VSEL_MASK;
ldo->desc.enable_reg = WM831X_LDO_ENABLE;
ldo->desc.enable_mask = 1 << id;
+ ldo->desc.min_uV = 800000;
+ ldo->desc.uV_step = 50000;
config.dev = pdev->dev.parent;
config.init_data = pdata->ldo[id];
--
1.7.10
next prev parent reply other threads:[~2012-05-09 23:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-09 23:47 [PATCH 1/6] regulator: core: Allow regulators to provide a voltage to selector mapping Mark Brown
2012-05-09 23:47 ` [PATCH 2/6] regulator: core: Allow drivers to set simple linear voltage maps as data Mark Brown
2012-05-09 23:47 ` Mark Brown [this message]
2012-05-09 23:47 ` [PATCH 4/6] regulator: wm8350: Convert DCDCs to set_voltage_sel() and linear voltages Mark Brown
2012-05-09 23:47 ` [PATCH 5/6] regulator: wm8350: Convert LDOs to set_voltage_sel() Mark Brown
2012-05-09 23:47 ` [PATCH 6/6] regulator: wm8400: Modernise driver Mark Brown
2012-05-10 9:23 ` [PATCH 1/6] regulator: core: Allow regulators to provide a voltage to selector mapping Liam Girdwood
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=1336607255-4967-3-git-send-email-broonie@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=gg@slimlogic.co.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@ti.com \
--cc=patches@opensource.wolfsonmicro.com \
--cc=yadi.brar@samsung.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