Commit e18162353afbb1b58622add7ea0f7a78c11ee44a
Committed by
Mark Brown
1 parent
eed06517e1
Exists in
master
and in
20 other branches
regulator: Merge tps6586x_regulator_ldo_ops and tps6586x_regulator_dvm_ops
Now all the callback implementation are the same for both ldo and dvm regulator_ops, merge them to tps6586x_regulator_ops. Also rename tps6586x_ldo_list_voltage to tps6586x_list_voltage. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Showing 1 changed file with 7 additions and 18 deletions Side-by-side Diff
drivers/regulator/tps6586x-regulator.c
... | ... | @@ -75,8 +75,7 @@ |
75 | 75 | return rdev_get_dev(rdev)->parent->parent; |
76 | 76 | } |
77 | 77 | |
78 | -static int tps6586x_ldo_list_voltage(struct regulator_dev *rdev, | |
79 | - unsigned selector) | |
78 | +static int tps6586x_list_voltage(struct regulator_dev *rdev, unsigned selector) | |
80 | 79 | { |
81 | 80 | struct tps6586x_regulator *info = rdev_get_drvdata(rdev); |
82 | 81 | |
... | ... | @@ -163,8 +162,8 @@ |
163 | 162 | return !!(reg_val & (1 << ri->enable_bit[0])); |
164 | 163 | } |
165 | 164 | |
166 | -static struct regulator_ops tps6586x_regulator_ldo_ops = { | |
167 | - .list_voltage = tps6586x_ldo_list_voltage, | |
165 | +static struct regulator_ops tps6586x_regulator_ops = { | |
166 | + .list_voltage = tps6586x_list_voltage, | |
168 | 167 | .get_voltage_sel = tps6586x_get_voltage_sel, |
169 | 168 | .set_voltage_sel = tps6586x_set_voltage_sel, |
170 | 169 | |
... | ... | @@ -173,16 +172,6 @@ |
173 | 172 | .disable = tps6586x_regulator_disable, |
174 | 173 | }; |
175 | 174 | |
176 | -static struct regulator_ops tps6586x_regulator_dvm_ops = { | |
177 | - .list_voltage = tps6586x_ldo_list_voltage, | |
178 | - .get_voltage_sel = tps6586x_get_voltage_sel, | |
179 | - .set_voltage_sel = tps6586x_set_voltage_sel, | |
180 | - | |
181 | - .is_enabled = tps6586x_regulator_is_enabled, | |
182 | - .enable = tps6586x_regulator_enable, | |
183 | - .disable = tps6586x_regulator_disable, | |
184 | -}; | |
185 | - | |
186 | 175 | static int tps6586x_ldo_voltages[] = { |
187 | 176 | 1250, 1500, 1800, 2500, 2700, 2850, 3100, 3300, |
188 | 177 | }; |
189 | 178 | |
... | ... | @@ -208,11 +197,11 @@ |
208 | 197 | 1325, 1350, 1375, 1400, 1425, 1450, 1475, 1500, |
209 | 198 | }; |
210 | 199 | |
211 | -#define TPS6586X_REGULATOR(_id, vdata, _ops, vreg, shift, nbits, \ | |
200 | +#define TPS6586X_REGULATOR(_id, vdata, vreg, shift, nbits, \ | |
212 | 201 | ereg0, ebit0, ereg1, ebit1) \ |
213 | 202 | .desc = { \ |
214 | 203 | .name = "REG-" #_id, \ |
215 | - .ops = &tps6586x_regulator_##_ops, \ | |
204 | + .ops = &tps6586x_regulator_ops, \ | |
216 | 205 | .type = REGULATOR_VOLTAGE, \ |
217 | 206 | .id = TPS6586X_ID_##_id, \ |
218 | 207 | .n_voltages = ARRAY_SIZE(tps6586x_##vdata##_voltages), \ |
219 | 208 | |
... | ... | @@ -234,14 +223,14 @@ |
234 | 223 | #define TPS6586X_LDO(_id, vdata, vreg, shift, nbits, \ |
235 | 224 | ereg0, ebit0, ereg1, ebit1) \ |
236 | 225 | { \ |
237 | - TPS6586X_REGULATOR(_id, vdata, ldo_ops, vreg, shift, nbits, \ | |
226 | + TPS6586X_REGULATOR(_id, vdata, vreg, shift, nbits, \ | |
238 | 227 | ereg0, ebit0, ereg1, ebit1) \ |
239 | 228 | } |
240 | 229 | |
241 | 230 | #define TPS6586X_DVM(_id, vdata, vreg, shift, nbits, \ |
242 | 231 | ereg0, ebit0, ereg1, ebit1, goreg, gobit) \ |
243 | 232 | { \ |
244 | - TPS6586X_REGULATOR(_id, vdata, dvm_ops, vreg, shift, nbits, \ | |
233 | + TPS6586X_REGULATOR(_id, vdata, vreg, shift, nbits, \ | |
245 | 234 | ereg0, ebit0, ereg1, ebit1) \ |
246 | 235 | TPS6586X_REGULATOR_DVM_GOREG(goreg, gobit) \ |
247 | 236 | } |