diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-04-05 20:01:36 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-04-06 04:49:18 -0400 |
commit | 95e301ba83612e616bea0151868b7160111227f3 (patch) | |
tree | ba600aa25ac2f125396c052d9041244eccfe6816 | |
parent | e3a7384c3e98c48b5f122e449e22cc8a1a6c7e0d (diff) |
regulator: rc5t583: Simplify RC5T583_REG macro
Simplify RC5T583_REG macro by removing _vout_reg and _ds_reg parameters.
The naming for vout_reg and deepsleep_reg can be replaced by:
.vout_reg = RC5T583_REG_##_id##DAC,
.deepsleep_reg = RC5T583_REG_##_id##DAC_DS,
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | drivers/regulator/rc5t583-regulator.c | 50 |
1 files changed, 18 insertions, 32 deletions
diff --git a/drivers/regulator/rc5t583-regulator.c b/drivers/regulator/rc5t583-regulator.c index 578bd5d48858..fcb9cc746659 100644 --- a/drivers/regulator/rc5t583-regulator.c +++ b/drivers/regulator/rc5t583-regulator.c | |||
@@ -196,16 +196,16 @@ static struct regulator_ops rc5t583_ops = { | |||
196 | .set_voltage_time_sel = rc5t583_set_voltage_time_sel, | 196 | .set_voltage_time_sel = rc5t583_set_voltage_time_sel, |
197 | }; | 197 | }; |
198 | 198 | ||
199 | #define RC5T583_REG(_id, _en_reg, _en_bit, _disc_reg, _disc_bit, _vout_reg, \ | 199 | #define RC5T583_REG(_id, _en_reg, _en_bit, _disc_reg, _disc_bit, \ |
200 | _vout_mask, _ds_reg, _min_mv, _max_mv, _step_uV, _enable_mv) \ | 200 | _vout_mask, _min_mv, _max_mv, _step_uV, _enable_mv) \ |
201 | { \ | 201 | { \ |
202 | .reg_en_reg = RC5T583_REG_##_en_reg, \ | 202 | .reg_en_reg = RC5T583_REG_##_en_reg, \ |
203 | .en_bit = _en_bit, \ | 203 | .en_bit = _en_bit, \ |
204 | .reg_disc_reg = RC5T583_REG_##_disc_reg, \ | 204 | .reg_disc_reg = RC5T583_REG_##_disc_reg, \ |
205 | .disc_bit = _disc_bit, \ | 205 | .disc_bit = _disc_bit, \ |
206 | .vout_reg = RC5T583_REG_##_vout_reg, \ | 206 | .vout_reg = RC5T583_REG_##_id##DAC, \ |
207 | .vout_mask = _vout_mask, \ | 207 | .vout_mask = _vout_mask, \ |
208 | .deepsleep_reg = RC5T583_REG_##_ds_reg, \ | 208 | .deepsleep_reg = RC5T583_REG_##_id##DAC_DS, \ |
209 | .min_uV = _min_mv * 1000, \ | 209 | .min_uV = _min_mv * 1000, \ |
210 | .max_uV = _max_mv * 1000, \ | 210 | .max_uV = _max_mv * 1000, \ |
211 | .step_uV = _step_uV, \ | 211 | .step_uV = _step_uV, \ |
@@ -223,34 +223,20 @@ static struct regulator_ops rc5t583_ops = { | |||
223 | } | 223 | } |
224 | 224 | ||
225 | static struct rc5t583_regulator_info rc5t583_reg_info[RC5T583_REGULATOR_MAX] = { | 225 | static struct rc5t583_regulator_info rc5t583_reg_info[RC5T583_REGULATOR_MAX] = { |
226 | RC5T583_REG(DC0, DC0CTL, 0, DC0CTL, 1, DC0DAC, 0x7F, DC0DAC_DS, | 226 | RC5T583_REG(DC0, DC0CTL, 0, DC0CTL, 1, 0x7F, 700, 1500, 12500, 4), |
227 | 700, 1500, 12500, 4), | 227 | RC5T583_REG(DC1, DC1CTL, 0, DC1CTL, 1, 0x7F, 700, 1500, 12500, 14), |
228 | RC5T583_REG(DC1, DC1CTL, 0, DC1CTL, 1, DC1DAC, 0x7F, DC1DAC_DS, | 228 | RC5T583_REG(DC2, DC2CTL, 0, DC2CTL, 1, 0x7F, 900, 2400, 12500, 14), |
229 | 700, 1500, 12500, 14), | 229 | RC5T583_REG(DC3, DC3CTL, 0, DC3CTL, 1, 0x7F, 900, 2400, 12500, 14), |
230 | RC5T583_REG(DC2, DC2CTL, 0, DC2CTL, 1, DC2DAC, 0x7F, DC2DAC_DS, | 230 | RC5T583_REG(LDO0, LDOEN2, 0, LDODIS2, 0, 0x7F, 900, 3400, 25000, 160), |
231 | 900, 2400, 12500, 14), | 231 | RC5T583_REG(LDO1, LDOEN2, 1, LDODIS2, 1, 0x7F, 900, 3400, 25000, 160), |
232 | RC5T583_REG(DC3, DC3CTL, 0, DC3CTL, 1, DC3DAC, 0x7F, DC3DAC_DS, | 232 | RC5T583_REG(LDO2, LDOEN2, 2, LDODIS2, 2, 0x7F, 900, 3400, 25000, 160), |
233 | 900, 2400, 12500, 14), | 233 | RC5T583_REG(LDO3, LDOEN2, 3, LDODIS2, 3, 0x7F, 900, 3400, 25000, 160), |
234 | RC5T583_REG(LDO0, LDOEN2, 0, LDODIS2, 0, LDO0DAC, 0x7F, LDO0DAC_DS, | 234 | RC5T583_REG(LDO4, LDOEN2, 4, LDODIS2, 4, 0x3F, 750, 1500, 12500, 133), |
235 | 900, 3400, 25000, 160), | 235 | RC5T583_REG(LDO5, LDOEN2, 5, LDODIS2, 5, 0x7F, 900, 3400, 25000, 267), |
236 | RC5T583_REG(LDO1, LDOEN2, 1, LDODIS2, 1, LDO1DAC, 0x7F, LDO1DAC_DS, | 236 | RC5T583_REG(LDO6, LDOEN2, 6, LDODIS2, 6, 0x7F, 900, 3400, 25000, 133), |
237 | 900, 3400, 25000, 160), | 237 | RC5T583_REG(LDO7, LDOEN2, 7, LDODIS2, 7, 0x7F, 900, 3400, 25000, 233), |
238 | RC5T583_REG(LDO2, LDOEN2, 2, LDODIS2, 2, LDO2DAC, 0x7F, LDO2DAC_DS, | 238 | RC5T583_REG(LDO8, LDOEN1, 0, LDODIS1, 0, 0x7F, 900, 3400, 25000, 233), |
239 | 900, 3400, 25000, 160), | 239 | RC5T583_REG(LDO9, LDOEN1, 1, LDODIS1, 1, 0x7F, 900, 3400, 25000, 133), |
240 | RC5T583_REG(LDO3, LDOEN2, 3, LDODIS2, 3, LDO3DAC, 0x7F, LDO3DAC_DS, | ||
241 | 900, 3400, 25000, 160), | ||
242 | RC5T583_REG(LDO4, LDOEN2, 4, LDODIS2, 4, LDO4DAC, 0x3F, LDO4DAC_DS, | ||
243 | 750, 1500, 12500, 133), | ||
244 | RC5T583_REG(LDO5, LDOEN2, 5, LDODIS2, 5, LDO5DAC, 0x7F, LDO5DAC_DS, | ||
245 | 900, 3400, 25000, 267), | ||
246 | RC5T583_REG(LDO6, LDOEN2, 6, LDODIS2, 6, LDO6DAC, 0x7F, LDO6DAC_DS, | ||
247 | 900, 3400, 25000, 133), | ||
248 | RC5T583_REG(LDO7, LDOEN2, 7, LDODIS2, 7, LDO7DAC, 0x7F, LDO7DAC_DS, | ||
249 | 900, 3400, 25000, 233), | ||
250 | RC5T583_REG(LDO8, LDOEN1, 0, LDODIS1, 0, LDO8DAC, 0x7F, LDO8DAC_DS, | ||
251 | 900, 3400, 25000, 233), | ||
252 | RC5T583_REG(LDO9, LDOEN1, 1, LDODIS1, 1, LDO9DAC, 0x7F, LDO9DAC_DS, | ||
253 | 900, 3400, 25000, 133), | ||
254 | }; | 240 | }; |
255 | 241 | ||
256 | static int __devinit rc5t583_regulator_probe(struct platform_device *pdev) | 242 | static int __devinit rc5t583_regulator_probe(struct platform_device *pdev) |