Commit 0365df81 authored by Jerome Neanne's avatar Jerome Neanne Committed by Mark Brown

regulator: tps65219: use generic set_bypass()

Due to wrong interpretation of the specification,
custom implementation was used instead of standard regmap helper.
LINK: https://lore.kernel.org/all/c2014039-f1e8-6976-33d6-52e2dd4e7b66@baylibre.com/

Fixes: c12ac5fc ("regulator: drivers: Add TI TPS65219 PMIC regulators support")

Regulator does NOT require to be off to be switched to bypass mode.
Signed-off-by: default avatarJerome Neanne <jneanne@baylibre.com>
Link: https://lore.kernel.org/r/20230203140119.13029-1-jneanne@baylibre.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent e314e15a
...@@ -173,24 +173,6 @@ static unsigned int tps65219_get_mode(struct regulator_dev *dev) ...@@ -173,24 +173,6 @@ static unsigned int tps65219_get_mode(struct regulator_dev *dev)
return REGULATOR_MODE_NORMAL; return REGULATOR_MODE_NORMAL;
} }
/*
* generic regulator_set_bypass_regmap does not fully match requirements
* TPS65219 Requires explicitly that regulator is disabled before switch
*/
static int tps65219_set_bypass(struct regulator_dev *dev, bool enable)
{
struct tps65219 *tps = rdev_get_drvdata(dev);
unsigned int rid = rdev_get_id(dev);
if (dev->desc->ops->is_enabled(dev)) {
dev_err(tps->dev,
"%s LDO%d enabled, must be shut down to set bypass ",
__func__, rid);
return -EBUSY;
}
return regulator_set_bypass_regmap(dev, enable);
}
/* Operations permitted on BUCK1/2/3 */ /* Operations permitted on BUCK1/2/3 */
static const struct regulator_ops tps65219_bucks_ops = { static const struct regulator_ops tps65219_bucks_ops = {
.is_enabled = regulator_is_enabled_regmap, .is_enabled = regulator_is_enabled_regmap,
...@@ -217,7 +199,7 @@ static const struct regulator_ops tps65219_ldos_1_2_ops = { ...@@ -217,7 +199,7 @@ static const struct regulator_ops tps65219_ldos_1_2_ops = {
.set_voltage_sel = regulator_set_voltage_sel_regmap, .set_voltage_sel = regulator_set_voltage_sel_regmap,
.list_voltage = regulator_list_voltage_linear_range, .list_voltage = regulator_list_voltage_linear_range,
.map_voltage = regulator_map_voltage_linear_range, .map_voltage = regulator_map_voltage_linear_range,
.set_bypass = tps65219_set_bypass, .set_bypass = regulator_set_bypass_regmap,
.get_bypass = regulator_get_bypass_regmap, .get_bypass = regulator_get_bypass_regmap,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment