diff options
author | Axel Lin <axel.lin@ingics.com> | 2013-10-11 09:32:18 +0800 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-10-11 12:49:16 +0100 |
commit | 8828bae464b129abed95b748263f1ab53bdc5755 (patch) | |
tree | 505148f6e9ed7a89a238cc8f1b3042e459f7c703 /drivers/regulator/as3711-regulator.c | |
parent | e277e656804c85a0729d4fd8cdd3c8ab3e6b3b86 (diff) |
regulator: Add REGULATOR_LINEAR_RANGE macro
Add REGULATOR_LINEAR_RANGE macro and convert regulator drivers to use it.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/regulator/as3711-regulator.c')
-rw-r--r-- | drivers/regulator/as3711-regulator.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/regulator/as3711-regulator.c b/drivers/regulator/as3711-regulator.c index d0a97e5ea431..f8524f988bdc 100644 --- a/drivers/regulator/as3711-regulator.c +++ b/drivers/regulator/as3711-regulator.c @@ -117,23 +117,19 @@ static struct regulator_ops as3711_dldo_ops = { }; static const struct regulator_linear_range as3711_sd_ranges[] = { - { .min_uV = 612500, .min_sel = 0x1, .max_sel = 0x40, .uV_step = 12500 }, - { .min_uV = 1425000, .min_sel = 0x41, .max_sel = 0x70, - .uV_step = 25000 }, - { .min_uV = 2650000, .min_sel = 0x71, .max_sel = 0x7f, - .uV_step = 50000 }, + REGULATOR_LINEAR_RANGE(612500, 0x1, 0x40, 12500), + REGULATOR_LINEAR_RANGE(1425000, 0x41, 0x70, 25000), + REGULATOR_LINEAR_RANGE(2650000, 0x71, 0x7f, 50000), }; static const struct regulator_linear_range as3711_aldo_ranges[] = { - { .min_uV = 1200000, .min_sel = 0, .max_sel = 0xf, .uV_step = 50000 }, - { .min_uV = 1800000, .min_sel = 0x10, .max_sel = 0x1f, - .uV_step = 100000 }, + REGULATOR_LINEAR_RANGE(1200000, 0, 0xf, 50000), + REGULATOR_LINEAR_RANGE(1800000, 0x10, 0x1f, 100000), }; static const struct regulator_linear_range as3711_dldo_ranges[] = { - { .min_uV = 900000, .min_sel = 0, .max_sel = 0x10, .uV_step = 50000 }, - { .min_uV = 1750000, .min_sel = 0x20, .max_sel = 0x3f, - .uV_step = 50000 }, + REGULATOR_LINEAR_RANGE(900000, 0, 0x10, 50000), + REGULATOR_LINEAR_RANGE(1750000, 0x20, 0x3f, 50000), }; #define AS3711_REG(_id, _en_reg, _en_bit, _vmask, _vshift, _min_uV, _max_uV, _sfx) \ |