summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/as3722-regulator.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2013-10-11 09:32:18 +0800
committerMark Brown <broonie@linaro.org>2013-10-11 12:49:16 +0100
commit8828bae464b129abed95b748263f1ab53bdc5755 (patch)
tree505148f6e9ed7a89a238cc8f1b3042e459f7c703 /drivers/regulator/as3722-regulator.c
parente277e656804c85a0729d4fd8cdd3c8ab3e6b3b86 (diff)
downloadblackbird-op-linux-8828bae464b129abed95b748263f1ab53bdc5755.tar.gz
blackbird-op-linux-8828bae464b129abed95b748263f1ab53bdc5755.zip
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/as3722-regulator.c')
-rw-r--r--drivers/regulator/as3722-regulator.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/drivers/regulator/as3722-regulator.c b/drivers/regulator/as3722-regulator.c
index 240ae6d2ee2a..5917fe3dc983 100644
--- a/drivers/regulator/as3722-regulator.c
+++ b/drivers/regulator/as3722-regulator.c
@@ -435,17 +435,9 @@ static struct regulator_ops as3722_ldo3_extcntrl_ops = {
.get_current_limit = as3722_ldo3_get_current_limit,
};
-#define regulator_lin_range(_min_sel, _max_sel, _min_uV, _step_uV) \
- { \
- .min_sel = _min_sel, \
- .max_sel = _max_sel, \
- .uV_step = _step_uV, \
- .min_uV = _min_uV, \
- }
-
static const struct regulator_linear_range as3722_ldo_ranges[] = {
- regulator_lin_range(0x01, 0x24, 825000, 25000),
- regulator_lin_range(0x40, 0x7F, 1725000, 25000),
+ REGULATOR_LINEAR_RANGE(825000, 0x01, 0x24, 25000),
+ REGULATOR_LINEAR_RANGE(1725000, 0x40, 0x7F, 25000),
};
static struct regulator_ops as3722_ldo_ops = {
@@ -604,9 +596,9 @@ static int as3722_sd016_set_current_limit(struct regulator_dev *rdev,
}
static const struct regulator_linear_range as3722_sd2345_ranges[] = {
- regulator_lin_range(0x01, 0x40, 612500, 12500),
- regulator_lin_range(0x41, 0x70, 1425000, 25000),
- regulator_lin_range(0x71, 0x7F, 2650000, 50000),
+ REGULATOR_LINEAR_RANGE(612500, 0x01, 0x40, 12500),
+ REGULATOR_LINEAR_RANGE(1425000, 0x41, 0x70, 25000),
+ REGULATOR_LINEAR_RANGE(2650000, 0x71, 0x7F, 50000),
};
static struct regulator_ops as3722_sd016_ops = {
OpenPOWER on IntegriCloud