aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-07-06 07:14:32 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-07-12 13:22:13 -0400
commit4506c6d5ea5dddab562fd06398fd9b8d1681bbd0 (patch)
tree2f4d6916b50567c7aa9add24f00939ca13ede7a1 /drivers/regulator
parente76b9cc7b88b4807e129779ca36298c76486a06c (diff)
regulator: aat2870: Convert to regulator_list_voltage_table
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/aat2870-regulator.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/regulator/aat2870-regulator.c b/drivers/regulator/aat2870-regulator.c
index 06776ca945f2..6644e83076b4 100644
--- a/drivers/regulator/aat2870-regulator.c
+++ b/drivers/regulator/aat2870-regulator.c
@@ -33,8 +33,6 @@ struct aat2870_regulator {
33 struct aat2870_data *aat2870; 33 struct aat2870_data *aat2870;
34 struct regulator_desc desc; 34 struct regulator_desc desc;
35 35
36 const int *voltages; /* uV */
37
38 int min_uV; 36 int min_uV;
39 int max_uV; 37 int max_uV;
40 38
@@ -47,14 +45,6 @@ struct aat2870_regulator {
47 u8 voltage_mask; 45 u8 voltage_mask;
48}; 46};
49 47
50static int aat2870_ldo_list_voltage(struct regulator_dev *rdev,
51 unsigned selector)
52{
53 struct aat2870_regulator *ri = rdev_get_drvdata(rdev);
54
55 return ri->voltages[selector];
56}
57
58static int aat2870_ldo_set_voltage_sel(struct regulator_dev *rdev, 48static int aat2870_ldo_set_voltage_sel(struct regulator_dev *rdev,
59 unsigned selector) 49 unsigned selector)
60{ 50{
@@ -111,7 +101,7 @@ static int aat2870_ldo_is_enabled(struct regulator_dev *rdev)
111} 101}
112 102
113static struct regulator_ops aat2870_ldo_ops = { 103static struct regulator_ops aat2870_ldo_ops = {
114 .list_voltage = aat2870_ldo_list_voltage, 104 .list_voltage = regulator_list_voltage_table,
115 .set_voltage_sel = aat2870_ldo_set_voltage_sel, 105 .set_voltage_sel = aat2870_ldo_set_voltage_sel,
116 .get_voltage_sel = aat2870_ldo_get_voltage_sel, 106 .get_voltage_sel = aat2870_ldo_get_voltage_sel,
117 .enable = aat2870_ldo_enable, 107 .enable = aat2870_ldo_enable,
@@ -119,7 +109,7 @@ static struct regulator_ops aat2870_ldo_ops = {
119 .is_enabled = aat2870_ldo_is_enabled, 109 .is_enabled = aat2870_ldo_is_enabled,
120}; 110};
121 111
122static const int aat2870_ldo_voltages[] = { 112static const unsigned int aat2870_ldo_voltages[] = {
123 1200000, 1300000, 1500000, 1600000, 113 1200000, 1300000, 1500000, 1600000,
124 1800000, 2000000, 2200000, 2500000, 114 1800000, 2000000, 2200000, 2500000,
125 2600000, 2700000, 2800000, 2900000, 115 2600000, 2700000, 2800000, 2900000,
@@ -132,11 +122,11 @@ static const int aat2870_ldo_voltages[] = {
132 .name = #ids, \ 122 .name = #ids, \
133 .id = AAT2870_ID_##ids, \ 123 .id = AAT2870_ID_##ids, \
134 .n_voltages = ARRAY_SIZE(aat2870_ldo_voltages), \ 124 .n_voltages = ARRAY_SIZE(aat2870_ldo_voltages), \
125 .volt_table = aat2870_ldo_voltages, \
135 .ops = &aat2870_ldo_ops, \ 126 .ops = &aat2870_ldo_ops, \
136 .type = REGULATOR_VOLTAGE, \ 127 .type = REGULATOR_VOLTAGE, \
137 .owner = THIS_MODULE, \ 128 .owner = THIS_MODULE, \
138 }, \ 129 }, \
139 .voltages = aat2870_ldo_voltages, \
140 .min_uV = 1200000, \ 130 .min_uV = 1200000, \
141 .max_uV = 3300000, \ 131 .max_uV = 3300000, \
142 } 132 }