diff options
-rw-r--r-- | drivers/regulator/tps65090-regulator.c | 76 |
1 files changed, 42 insertions, 34 deletions
diff --git a/drivers/regulator/tps65090-regulator.c b/drivers/regulator/tps65090-regulator.c index 2064b3fd45f7..d5df1e9ad1da 100644 --- a/drivers/regulator/tps65090-regulator.c +++ b/drivers/regulator/tps65090-regulator.c | |||
@@ -192,12 +192,14 @@ static struct regulator_ops tps65090_fet_control_ops = { | |||
192 | static struct regulator_ops tps65090_ldo_ops = { | 192 | static struct regulator_ops tps65090_ldo_ops = { |
193 | }; | 193 | }; |
194 | 194 | ||
195 | #define tps65090_REG_DESC(_id, _sname, _en_reg, _en_bits, _ops) \ | 195 | #define tps65090_REG_DESC(_id, _sname, _en_reg, _en_bits, _nvolt, _volt, _ops) \ |
196 | { \ | 196 | { \ |
197 | .name = "TPS65090_RAILS"#_id, \ | 197 | .name = "TPS65090_RAILS"#_id, \ |
198 | .supply_name = _sname, \ | 198 | .supply_name = _sname, \ |
199 | .id = TPS65090_REGULATOR_##_id, \ | 199 | .id = TPS65090_REGULATOR_##_id, \ |
200 | .n_voltages = _nvolt, \ | ||
200 | .ops = &_ops, \ | 201 | .ops = &_ops, \ |
202 | .fixed_uV = _volt, \ | ||
201 | .enable_reg = _en_reg, \ | 203 | .enable_reg = _en_reg, \ |
202 | .enable_val = _en_bits, \ | 204 | .enable_val = _en_bits, \ |
203 | .enable_mask = _en_bits, \ | 205 | .enable_mask = _en_bits, \ |
@@ -205,40 +207,46 @@ static struct regulator_ops tps65090_ldo_ops = { | |||
205 | .owner = THIS_MODULE, \ | 207 | .owner = THIS_MODULE, \ |
206 | } | 208 | } |
207 | 209 | ||
210 | #define tps65090_REG_FIXEDV(_id, _sname, en_reg, _en_bits, _volt, _ops) \ | ||
211 | tps65090_REG_DESC(_id, _sname, en_reg, _en_bits, 1, _volt, _ops) | ||
212 | |||
213 | #define tps65090_REG_SWITCH(_id, _sname, en_reg, _en_bits, _ops) \ | ||
214 | tps65090_REG_DESC(_id, _sname, en_reg, _en_bits, 0, 0, _ops) | ||
215 | |||
208 | static struct regulator_desc tps65090_regulator_desc[] = { | 216 | static struct regulator_desc tps65090_regulator_desc[] = { |
209 | tps65090_REG_DESC(DCDC1, "vsys1", 0x0C, BIT(CTRL_EN_BIT), | 217 | tps65090_REG_FIXEDV(DCDC1, "vsys1", 0x0C, BIT(CTRL_EN_BIT), 5000000, |
210 | tps65090_reg_control_ops), | 218 | tps65090_reg_control_ops), |
211 | tps65090_REG_DESC(DCDC2, "vsys2", 0x0D, BIT(CTRL_EN_BIT), | 219 | tps65090_REG_FIXEDV(DCDC2, "vsys2", 0x0D, BIT(CTRL_EN_BIT), 3300000, |
212 | tps65090_reg_control_ops), | 220 | tps65090_reg_control_ops), |
213 | tps65090_REG_DESC(DCDC3, "vsys3", 0x0E, BIT(CTRL_EN_BIT), | 221 | tps65090_REG_SWITCH(DCDC3, "vsys3", 0x0E, BIT(CTRL_EN_BIT), |
214 | tps65090_reg_control_ops), | 222 | tps65090_reg_control_ops), |
215 | 223 | ||
216 | tps65090_REG_DESC(FET1, "infet1", 0x0F, | 224 | tps65090_REG_SWITCH(FET1, "infet1", 0x0F, |
217 | BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT), | 225 | BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT), |
218 | tps65090_fet_control_ops), | 226 | tps65090_fet_control_ops), |
219 | tps65090_REG_DESC(FET2, "infet2", 0x10, | 227 | tps65090_REG_SWITCH(FET2, "infet2", 0x10, |
220 | BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT), | 228 | BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT), |
221 | tps65090_fet_control_ops), | 229 | tps65090_fet_control_ops), |
222 | tps65090_REG_DESC(FET3, "infet3", 0x11, | 230 | tps65090_REG_SWITCH(FET3, "infet3", 0x11, |
223 | BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT), | 231 | BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT), |
224 | tps65090_fet_control_ops), | 232 | tps65090_fet_control_ops), |
225 | tps65090_REG_DESC(FET4, "infet4", 0x12, | 233 | tps65090_REG_SWITCH(FET4, "infet4", 0x12, |
226 | BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT), | 234 | BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT), |
227 | tps65090_fet_control_ops), | 235 | tps65090_fet_control_ops), |
228 | tps65090_REG_DESC(FET5, "infet5", 0x13, | 236 | tps65090_REG_SWITCH(FET5, "infet5", 0x13, |
229 | BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT), | 237 | BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT), |
230 | tps65090_fet_control_ops), | 238 | tps65090_fet_control_ops), |
231 | tps65090_REG_DESC(FET6, "infet6", 0x14, | 239 | tps65090_REG_SWITCH(FET6, "infet6", 0x14, |
232 | BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT), | 240 | BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT), |
233 | tps65090_fet_control_ops), | 241 | tps65090_fet_control_ops), |
234 | tps65090_REG_DESC(FET7, "infet7", 0x15, | 242 | tps65090_REG_SWITCH(FET7, "infet7", 0x15, |
235 | BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT), | 243 | BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT), |
236 | tps65090_fet_control_ops), | 244 | tps65090_fet_control_ops), |
237 | 245 | ||
238 | tps65090_REG_DESC(LDO1, "vsys-l1", 0, 0, | 246 | tps65090_REG_FIXEDV(LDO1, "vsys-l1", 0, 0, 5000000, |
239 | tps65090_ldo_ops), | 247 | tps65090_ldo_ops), |
240 | tps65090_REG_DESC(LDO2, "vsys-l2", 0, 0, | 248 | tps65090_REG_FIXEDV(LDO2, "vsys-l2", 0, 0, 3300000, |
241 | tps65090_ldo_ops), | 249 | tps65090_ldo_ops), |
242 | }; | 250 | }; |
243 | 251 | ||
244 | static inline bool is_dcdc(int id) | 252 | static inline bool is_dcdc(int id) |