diff options
| -rw-r--r-- | drivers/regulator/as3711-regulator.c | 61 |
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 | ||
| 23 | struct as3711_regulator_info { | 23 | struct as3711_regulator_info { |
| 24 | struct regulator_desc desc; | 24 | struct regulator_desc desc; |
| 25 | unsigned int max_uV; | ||
| 26 | }; | 25 | }; |
| 27 | 26 | ||
| 28 | struct as3711_regulator { | 27 | struct 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 | ||
| 155 | static struct as3711_regulator_info as3711_reg_info[] = { | 151 | static 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; |
