From: Axel Lin <axel.lin@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Linus Walleij <linus.walleij@stericsson.com>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Liam Girdwood <lrg@ti.com>
Subject: [PATCH RFC/RFT 6/7] regulator: tps6105x: Use regulator_list_voltage_table()
Date: Sun, 20 May 2012 10:37:33 +0800 [thread overview]
Message-ID: <1337481453.7204.8.camel@phoenix> (raw)
In-Reply-To: <1337481021.7204.1.camel@phoenix>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/regulator/tps6105x-regulator.c | 14 +++-----------
1 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/drivers/regulator/tps6105x-regulator.c b/drivers/regulator/tps6105x-regulator.c
index d840d84..1378409 100644
--- a/drivers/regulator/tps6105x-regulator.c
+++ b/drivers/regulator/tps6105x-regulator.c
@@ -20,7 +20,7 @@
#include <linux/mfd/core.h>
#include <linux/mfd/tps6105x.h>
-static const int tps6105x_voltages[] = {
+static const unsigned int tps6105x_voltages[] = {
4500000,
5000000,
5250000,
@@ -105,22 +105,13 @@ static int tps6105x_regulator_set_voltage_sel(struct regulator_dev *rdev,
return 0;
}
-static int tps6105x_regulator_list_voltage(struct regulator_dev *rdev,
- unsigned selector)
-{
- if (selector >= ARRAY_SIZE(tps6105x_voltages))
- return -EINVAL;
-
- return tps6105x_voltages[selector];
-}
-
static struct regulator_ops tps6105x_regulator_ops = {
.enable = tps6105x_regulator_enable,
.disable = tps6105x_regulator_disable,
.is_enabled = tps6105x_regulator_is_enabled,
.get_voltage_sel = tps6105x_regulator_get_voltage_sel,
.set_voltage_sel = tps6105x_regulator_set_voltage_sel,
- .list_voltage = tps6105x_regulator_list_voltage,
+ .list_voltage = regulator_list_voltage_table,
};
static const struct regulator_desc tps6105x_regulator_desc = {
@@ -130,6 +121,7 @@ static const struct regulator_desc tps6105x_regulator_desc = {
.id = 0,
.owner = THIS_MODULE,
.n_voltages = ARRAY_SIZE(tps6105x_voltages),
+ .volt_table = tps6105x_voltages,
};
/*
--
1.7.5.4
next prev parent reply other threads:[~2012-05-20 2:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-20 2:30 [PATCH RFC/RFT 1/7] regulator: core: Allow drivers to set voltage mapping table in regulator_desc Axel Lin
2012-05-20 2:31 ` [PATCH RFC/RFT 2/7] regulator: ab3100: Use regulator_list_voltage_table() Axel Lin
2012-05-21 9:16 ` Linus Walleij
2012-05-20 2:33 ` [PATCH RFC/RFT 3/7] regulator: ab8500: " Axel Lin
2012-05-21 10:43 ` Linus Walleij
2012-05-21 11:17 ` Mark Brown
2012-05-20 2:34 ` [PATCH RFC/RFT 4/7] regulator: lp3971: " Axel Lin
2012-05-20 2:36 ` [PATCH RFC/RFT 5/7] regulator: lp3972: " Axel Lin
2012-05-20 2:37 ` Axel Lin [this message]
2012-05-21 16:06 ` [PATCH RFC/RFT 6/7] regulator: tps6105x: " Linus Walleij
2012-05-20 2:39 ` [PATCH RFC/RFT 7/7] regulator: tps6507x: " Axel Lin
2012-05-20 21:48 ` [PATCH RFC/RFT 1/7] regulator: core: Allow drivers to set voltage mapping table in regulator_desc 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=1337481453.7204.8.camel@phoenix \
--to=axel.lin@gmail.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linus.walleij@stericsson.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