aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJavier Martinez Canillas <javier.martinez@collabora.co.uk>2014-07-31 08:31:05 -0400
committerMark Brown <broonie@linaro.org>2014-07-31 15:24:29 -0400
commit4f2352cf52738bd980713e85e8ae631c6c3a8feb (patch)
tree6ba2db7c6cf1bc3428f35c35b6d045513ef2e86a
parent7171511eaec5bf23fb06078f59784a3a0626b38f (diff)
regulator: tps65090: Set voltage for fixed regulators
According to the tps65090 data manual [0], the DCDC1 and DCDC2 step-down converters and the LDO's have a fixed output voltage. Add this information to the driver since these fixed regulators can be used as parent input supply for switches that don't have an output voltage defined. So the regulator core needs to fetch the FET parent output voltage if the child voltage is queried. [0]: http://www.ti.com/lit/gpn/tps65090 Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--drivers/regulator/tps65090-regulator.c76
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 = {
192static struct regulator_ops tps65090_ldo_ops = { 192static 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
208static struct regulator_desc tps65090_regulator_desc[] = { 216static 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
244static inline bool is_dcdc(int id) 252static inline bool is_dcdc(int id)