diff options
author | Keerthy <j-keerthy@ti.com> | 2015-12-14 12:06:55 +0530 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-12-16 19:22:42 +0000 |
commit | b554e1450658039df28486f19216d6962d29dba6 (patch) | |
tree | b042c7f0e9d88ce7eae17944a11d67e25c95706a /drivers/regulator | |
parent | 8005c49d9aea74d382f474ce11afbbc7d7130bec (diff) | |
download | linux-b554e1450658039df28486f19216d6962d29dba6.tar.bz2 |
regulator: tps65917/palmas: Add bypass ops for LDOs with bypass capability
set/get_bypass ops were missing for ldo1/ldo2 on tps65917 and
ldo9 on palmas/tps659038 which support bypass mode.
Adding the bypass ops helps consumers configure these ldos in
bypass mode or remove bypass mode if need be.
Signed-off-by: Keerthy <j-keerthy@ti.com>
Reported-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/palmas-regulator.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index 8217613807d3..6efc7ee8aea3 100644 --- a/drivers/regulator/palmas-regulator.c +++ b/drivers/regulator/palmas-regulator.c @@ -612,6 +612,18 @@ static struct regulator_ops palmas_ops_ldo = { .map_voltage = regulator_map_voltage_linear, }; +static struct regulator_ops palmas_ops_ldo9 = { + .is_enabled = palmas_is_enabled_ldo, + .enable = regulator_enable_regmap, + .disable = regulator_disable_regmap, + .get_voltage_sel = regulator_get_voltage_sel_regmap, + .set_voltage_sel = regulator_set_voltage_sel_regmap, + .list_voltage = regulator_list_voltage_linear, + .map_voltage = regulator_map_voltage_linear, + .set_bypass = regulator_set_bypass_regmap, + .get_bypass = regulator_get_bypass_regmap, +}; + static struct regulator_ops palmas_ops_ext_control_ldo = { .get_voltage_sel = regulator_get_voltage_sel_regmap, .set_voltage_sel = regulator_set_voltage_sel_regmap, @@ -639,6 +651,19 @@ static struct regulator_ops tps65917_ops_ldo = { .set_voltage_time_sel = regulator_set_voltage_time_sel, }; +static struct regulator_ops tps65917_ops_ldo_1_2 = { + .is_enabled = palmas_is_enabled_ldo, + .enable = regulator_enable_regmap, + .disable = regulator_disable_regmap, + .get_voltage_sel = regulator_get_voltage_sel_regmap, + .set_voltage_sel = regulator_set_voltage_sel_regmap, + .list_voltage = regulator_list_voltage_linear, + .map_voltage = regulator_map_voltage_linear, + .set_voltage_time_sel = regulator_set_voltage_time_sel, + .set_bypass = regulator_set_bypass_regmap, + .get_bypass = regulator_get_bypass_regmap, +}; + static int palmas_regulator_config_external(struct palmas *palmas, int id, struct palmas_reg_init *reg_init) { @@ -915,6 +940,13 @@ static int palmas_ldo_registration(struct palmas_pmic *pmic, if (pdata && pdata->ldo6_vibrator && (id == PALMAS_REG_LDO6)) desc->enable_time = 2000; + + if (id == PALMAS_REG_LDO9) { + desc->ops = &palmas_ops_ldo9; + desc->bypass_reg = desc->enable_reg; + desc->bypass_mask = + PALMAS_LDO9_CTRL_LDO_BYPASS_EN; + } } else { if (!ddata->has_regen3 && id == PALMAS_REG_REGEN3) continue; @@ -1019,6 +1051,13 @@ static int tps65917_ldo_registration(struct palmas_pmic *pmic, * It is of the order of ~60mV/uS. */ desc->ramp_delay = 2500; + if (id == TPS65917_REG_LDO1 || + id == TPS65917_REG_LDO2) { + desc->ops = &tps65917_ops_ldo_1_2; + desc->bypass_reg = desc->enable_reg; + desc->bypass_mask = + TPS65917_LDO1_CTRL_BYPASS_EN; + } } else { desc->n_voltages = 1; if (reg_init && reg_init->roof_floor) |