summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJavier Martinez Canillas <javier.martinez@collabora.co.uk>2014-07-31 16:31:05 +0400
committerMark Brown <broonie@linaro.org>2014-07-31 23:24:29 +0400
commit4f2352cf52738bd980713e85e8ae631c6c3a8feb (patch)
tree6ba2db7c6cf1bc3428f35c35b6d045513ef2e86a /drivers
parent7171511eaec5bf23fb06078f59784a3a0626b38f (diff)
downloadlinux-4f2352cf52738bd980713e85e8ae631c6c3a8feb.tar.xz
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>
Diffstat (limited to 'drivers')
-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 = {
static struct regulator_ops tps65090_ldo_ops = {
};
-#define tps65090_REG_DESC(_id, _sname, _en_reg, _en_bits, _ops) \
+#define tps65090_REG_DESC(_id, _sname, _en_reg, _en_bits, _nvolt, _volt, _ops) \
{ \
.name = "TPS65090_RAILS"#_id, \
.supply_name = _sname, \
.id = TPS65090_REGULATOR_##_id, \
+ .n_voltages = _nvolt, \
.ops = &_ops, \
+ .fixed_uV = _volt, \
.enable_reg = _en_reg, \
.enable_val = _en_bits, \
.enable_mask = _en_bits, \
@@ -205,40 +207,46 @@ static struct regulator_ops tps65090_ldo_ops = {
.owner = THIS_MODULE, \
}
+#define tps65090_REG_FIXEDV(_id, _sname, en_reg, _en_bits, _volt, _ops) \
+ tps65090_REG_DESC(_id, _sname, en_reg, _en_bits, 1, _volt, _ops)
+
+#define tps65090_REG_SWITCH(_id, _sname, en_reg, _en_bits, _ops) \
+ tps65090_REG_DESC(_id, _sname, en_reg, _en_bits, 0, 0, _ops)
+
static struct regulator_desc tps65090_regulator_desc[] = {
- tps65090_REG_DESC(DCDC1, "vsys1", 0x0C, BIT(CTRL_EN_BIT),
- tps65090_reg_control_ops),
- tps65090_REG_DESC(DCDC2, "vsys2", 0x0D, BIT(CTRL_EN_BIT),
- tps65090_reg_control_ops),
- tps65090_REG_DESC(DCDC3, "vsys3", 0x0E, BIT(CTRL_EN_BIT),
- tps65090_reg_control_ops),
-
- tps65090_REG_DESC(FET1, "infet1", 0x0F,
- BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT),
- tps65090_fet_control_ops),
- tps65090_REG_DESC(FET2, "infet2", 0x10,
- BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT),
- tps65090_fet_control_ops),
- tps65090_REG_DESC(FET3, "infet3", 0x11,
- BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT),
- tps65090_fet_control_ops),
- tps65090_REG_DESC(FET4, "infet4", 0x12,
- BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT),
- tps65090_fet_control_ops),
- tps65090_REG_DESC(FET5, "infet5", 0x13,
- BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT),
- tps65090_fet_control_ops),
- tps65090_REG_DESC(FET6, "infet6", 0x14,
- BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT),
- tps65090_fet_control_ops),
- tps65090_REG_DESC(FET7, "infet7", 0x15,
- BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT),
- tps65090_fet_control_ops),
-
- tps65090_REG_DESC(LDO1, "vsys-l1", 0, 0,
- tps65090_ldo_ops),
- tps65090_REG_DESC(LDO2, "vsys-l2", 0, 0,
- tps65090_ldo_ops),
+ tps65090_REG_FIXEDV(DCDC1, "vsys1", 0x0C, BIT(CTRL_EN_BIT), 5000000,
+ tps65090_reg_control_ops),
+ tps65090_REG_FIXEDV(DCDC2, "vsys2", 0x0D, BIT(CTRL_EN_BIT), 3300000,
+ tps65090_reg_control_ops),
+ tps65090_REG_SWITCH(DCDC3, "vsys3", 0x0E, BIT(CTRL_EN_BIT),
+ tps65090_reg_control_ops),
+
+ tps65090_REG_SWITCH(FET1, "infet1", 0x0F,
+ BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT),
+ tps65090_fet_control_ops),
+ tps65090_REG_SWITCH(FET2, "infet2", 0x10,
+ BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT),
+ tps65090_fet_control_ops),
+ tps65090_REG_SWITCH(FET3, "infet3", 0x11,
+ BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT),
+ tps65090_fet_control_ops),
+ tps65090_REG_SWITCH(FET4, "infet4", 0x12,
+ BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT),
+ tps65090_fet_control_ops),
+ tps65090_REG_SWITCH(FET5, "infet5", 0x13,
+ BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT),
+ tps65090_fet_control_ops),
+ tps65090_REG_SWITCH(FET6, "infet6", 0x14,
+ BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT),
+ tps65090_fet_control_ops),
+ tps65090_REG_SWITCH(FET7, "infet7", 0x15,
+ BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT),
+ tps65090_fet_control_ops),
+
+ tps65090_REG_FIXEDV(LDO1, "vsys-l1", 0, 0, 5000000,
+ tps65090_ldo_ops),
+ tps65090_REG_FIXEDV(LDO2, "vsys-l2", 0, 0, 3300000,
+ tps65090_ldo_ops),
};
static inline bool is_dcdc(int id)