Commit 6223e073 authored by Vincent Whitchurch's avatar Vincent Whitchurch Committed by Mark Brown

regulator: Fix voltage range selection

Use the correct field to fix wrong voltage range selection on regulators
such as tps6287x since the blamed commit.

Fixes: 269cb04b ("regulator: Use bitfield values for range selectors")
Signed-off-by: default avatarVincent Whitchurch <vincent.whitchurch@axis.com>
Link: https://lore.kernel.org/r/20230911-regulator-voltage-sel-v1-1-886eb1ade8d8@axis.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 0bb80ecc
......@@ -197,7 +197,7 @@ int regulator_set_voltage_sel_pickable_regmap(struct regulator_dev *rdev,
sel += rdev->desc->linear_ranges[i].min_sel;
range = rdev->desc->linear_range_selectors_bitfield[i];
range <<= ffs(rdev->desc->vsel_mask) - 1;
range <<= ffs(rdev->desc->vsel_range_mask) - 1;
if (rdev->desc->vsel_reg == rdev->desc->vsel_range_reg) {
ret = regmap_update_bits(rdev->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