aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/tps6105x-regulator.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-05-19 22:37:33 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-06-03 08:25:01 -0400
commitc55979b7bd78b8ee7999bcf5211bf0243260c675 (patch)
treeb15400609ca05e7c5236962ed2bce39be48609e4 /drivers/regulator/tps6105x-regulator.c
parent4f73ccad5ca0ce25d0fd73cf3b65975e93a45ce4 (diff)
regulator: tps6105x: Use regulator_list_voltage_table()
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/tps6105x-regulator.c')
-rw-r--r--drivers/regulator/tps6105x-regulator.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/regulator/tps6105x-regulator.c b/drivers/regulator/tps6105x-regulator.c
index d840d8440a91..1378409efaec 100644
--- a/drivers/regulator/tps6105x-regulator.c
+++ b/drivers/regulator/tps6105x-regulator.c
@@ -20,7 +20,7 @@
20#include <linux/mfd/core.h> 20#include <linux/mfd/core.h>
21#include <linux/mfd/tps6105x.h> 21#include <linux/mfd/tps6105x.h>
22 22
23static const int tps6105x_voltages[] = { 23static const unsigned int tps6105x_voltages[] = {
24 4500000, 24 4500000,
25 5000000, 25 5000000,
26 5250000, 26 5250000,
@@ -105,22 +105,13 @@ static int tps6105x_regulator_set_voltage_sel(struct regulator_dev *rdev,
105 return 0; 105 return 0;
106} 106}
107 107
108static int tps6105x_regulator_list_voltage(struct regulator_dev *rdev,
109 unsigned selector)
110{
111 if (selector >= ARRAY_SIZE(tps6105x_voltages))
112 return -EINVAL;
113
114 return tps6105x_voltages[selector];
115}
116
117static struct regulator_ops tps6105x_regulator_ops = { 108static struct regulator_ops tps6105x_regulator_ops = {
118 .enable = tps6105x_regulator_enable, 109 .enable = tps6105x_regulator_enable,
119 .disable = tps6105x_regulator_disable, 110 .disable = tps6105x_regulator_disable,
120 .is_enabled = tps6105x_regulator_is_enabled, 111 .is_enabled = tps6105x_regulator_is_enabled,
121 .get_voltage_sel = tps6105x_regulator_get_voltage_sel, 112 .get_voltage_sel = tps6105x_regulator_get_voltage_sel,
122 .set_voltage_sel = tps6105x_regulator_set_voltage_sel, 113 .set_voltage_sel = tps6105x_regulator_set_voltage_sel,
123 .list_voltage = tps6105x_regulator_list_voltage, 114 .list_voltage = regulator_list_voltage_table,
124}; 115};
125 116
126static const struct regulator_desc tps6105x_regulator_desc = { 117static const struct regulator_desc tps6105x_regulator_desc = {
@@ -130,6 +121,7 @@ static const struct regulator_desc tps6105x_regulator_desc = {
130 .id = 0, 121 .id = 0,
131 .owner = THIS_MODULE, 122 .owner = THIS_MODULE,
132 .n_voltages = ARRAY_SIZE(tps6105x_voltages), 123 .n_voltages = ARRAY_SIZE(tps6105x_voltages),
124 .volt_table = tps6105x_voltages,
133}; 125};
134 126
135/* 127/*