aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2014-09-07 06:34:51 -0400
committerMark Brown <broonie@linaro.org>2014-09-07 11:03:55 -0400
commit192264e0a5473015df28f47241bcdbf6b8c24873 (patch)
tree9577ae2333b67c39a787ec583f0817ba5b217c1e /drivers
parent7d1311b93e58ed55f3a31cc8f94c4b8fe988a2b9 (diff)
regulator: as3711: Remove unused fields from as3711_regulator_info and as3711_regulator
The max_uV is not used, so remove it from struct as3711_regulator_info. Current code is using devm_regulator_register(), so we don't need to store *rdev in struct as3711_regulator for clean up. Also clean up AS3711_REG macro to remove _vshift, _min_uV and _max_uV arguments. _vshift is always 0, so remove it. _min_uV and _max_uV are not required, all required settings are set in REGULATOR_LINEAR_RANGE macro. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/regulator/as3711-regulator.c61
1 files changed, 28 insertions, 33 deletions
diff --git a/drivers/regulator/as3711-regulator.c b/drivers/regulator/as3711-regulator.c
index b47283f91e2d..8459b0b648cd 100644
--- a/drivers/regulator/as3711-regulator.c
+++ b/drivers/regulator/as3711-regulator.c
@@ -22,12 +22,10 @@
22 22
23struct as3711_regulator_info { 23struct as3711_regulator_info {
24 struct regulator_desc desc; 24 struct regulator_desc desc;
25 unsigned int max_uV;
26}; 25};
27 26
28struct as3711_regulator { 27struct as3711_regulator {
29 struct as3711_regulator_info *reg_info; 28 struct as3711_regulator_info *reg_info;
30 struct regulator_dev *rdev;
31}; 29};
32 30
33/* 31/*
@@ -132,39 +130,37 @@ static const struct regulator_linear_range as3711_dldo_ranges[] = {
132 REGULATOR_LINEAR_RANGE(1750000, 0x20, 0x3f, 50000), 130 REGULATOR_LINEAR_RANGE(1750000, 0x20, 0x3f, 50000),
133}; 131};
134 132
135#define AS3711_REG(_id, _en_reg, _en_bit, _vmask, _vshift, _min_uV, _max_uV, _sfx) \ 133#define AS3711_REG(_id, _en_reg, _en_bit, _vmask, _sfx) \
136 [AS3711_REGULATOR_ ## _id] = { \ 134 [AS3711_REGULATOR_ ## _id] = { \
137 .desc = { \ 135 .desc = { \
138 .name = "as3711-regulator-" # _id, \ 136 .name = "as3711-regulator-" # _id, \
139 .id = AS3711_REGULATOR_ ## _id, \ 137 .id = AS3711_REGULATOR_ ## _id, \
140 .n_voltages = (_vmask + 1), \ 138 .n_voltages = (_vmask + 1), \
141 .ops = &as3711_ ## _sfx ## _ops, \ 139 .ops = &as3711_ ## _sfx ## _ops, \
142 .type = REGULATOR_VOLTAGE, \ 140 .type = REGULATOR_VOLTAGE, \
143 .owner = THIS_MODULE, \ 141 .owner = THIS_MODULE, \
144 .vsel_reg = AS3711_ ## _id ## _VOLTAGE, \ 142 .vsel_reg = AS3711_ ## _id ## _VOLTAGE, \
145 .vsel_mask = _vmask << _vshift, \ 143 .vsel_mask = _vmask, \
146 .enable_reg = AS3711_ ## _en_reg, \ 144 .enable_reg = AS3711_ ## _en_reg, \
147 .enable_mask = BIT(_en_bit), \ 145 .enable_mask = BIT(_en_bit), \
148 .min_uV = _min_uV, \ 146 .linear_ranges = as3711_ ## _sfx ## _ranges, \
149 .linear_ranges = as3711_ ## _sfx ## _ranges, \ 147 .n_linear_ranges = ARRAY_SIZE(as3711_ ## _sfx ## _ranges), \
150 .n_linear_ranges = ARRAY_SIZE(as3711_ ## _sfx ## _ranges), \ 148 }, \
151 }, \
152 .max_uV = _max_uV, \
153} 149}
154 150
155static struct as3711_regulator_info as3711_reg_info[] = { 151static struct as3711_regulator_info as3711_reg_info[] = {
156 AS3711_REG(SD_1, SD_CONTROL, 0, 0x7f, 0, 612500, 3350000, sd), 152 AS3711_REG(SD_1, SD_CONTROL, 0, 0x7f, sd),
157 AS3711_REG(SD_2, SD_CONTROL, 1, 0x7f, 0, 612500, 3350000, sd), 153 AS3711_REG(SD_2, SD_CONTROL, 1, 0x7f, sd),
158 AS3711_REG(SD_3, SD_CONTROL, 2, 0x7f, 0, 612500, 3350000, sd), 154 AS3711_REG(SD_3, SD_CONTROL, 2, 0x7f, sd),
159 AS3711_REG(SD_4, SD_CONTROL, 3, 0x7f, 0, 612500, 3350000, sd), 155 AS3711_REG(SD_4, SD_CONTROL, 3, 0x7f, sd),
160 AS3711_REG(LDO_1, LDO_1_VOLTAGE, 7, 0x1f, 0, 1200000, 3300000, aldo), 156 AS3711_REG(LDO_1, LDO_1_VOLTAGE, 7, 0x1f, aldo),
161 AS3711_REG(LDO_2, LDO_2_VOLTAGE, 7, 0x1f, 0, 1200000, 3300000, aldo), 157 AS3711_REG(LDO_2, LDO_2_VOLTAGE, 7, 0x1f, aldo),
162 AS3711_REG(LDO_3, LDO_3_VOLTAGE, 7, 0x3f, 0, 900000, 3300000, dldo), 158 AS3711_REG(LDO_3, LDO_3_VOLTAGE, 7, 0x3f, dldo),
163 AS3711_REG(LDO_4, LDO_4_VOLTAGE, 7, 0x3f, 0, 900000, 3300000, dldo), 159 AS3711_REG(LDO_4, LDO_4_VOLTAGE, 7, 0x3f, dldo),
164 AS3711_REG(LDO_5, LDO_5_VOLTAGE, 7, 0x3f, 0, 900000, 3300000, dldo), 160 AS3711_REG(LDO_5, LDO_5_VOLTAGE, 7, 0x3f, dldo),
165 AS3711_REG(LDO_6, LDO_6_VOLTAGE, 7, 0x3f, 0, 900000, 3300000, dldo), 161 AS3711_REG(LDO_6, LDO_6_VOLTAGE, 7, 0x3f, dldo),
166 AS3711_REG(LDO_7, LDO_7_VOLTAGE, 7, 0x3f, 0, 900000, 3300000, dldo), 162 AS3711_REG(LDO_7, LDO_7_VOLTAGE, 7, 0x3f, dldo),
167 AS3711_REG(LDO_8, LDO_8_VOLTAGE, 7, 0x3f, 0, 900000, 3300000, dldo), 163 AS3711_REG(LDO_8, LDO_8_VOLTAGE, 7, 0x3f, dldo),
168 /* StepUp output voltage depends on supplying regulator */ 164 /* StepUp output voltage depends on supplying regulator */
169}; 165};
170 166
@@ -263,7 +259,6 @@ static int as3711_regulator_probe(struct platform_device *pdev)
263 ri->desc.name); 259 ri->desc.name);
264 return PTR_ERR(rdev); 260 return PTR_ERR(rdev);
265 } 261 }
266 reg->rdev = rdev;
267 } 262 }
268 platform_set_drvdata(pdev, regs); 263 platform_set_drvdata(pdev, regs);
269 return 0; 264 return 0;