Skip to content

Commit

Permalink
regulator: Fix voltage range selection
Browse files Browse the repository at this point in the history
Use the correct field to fix wrong voltage range selection on regulators
such as tps6287x since the blamed commit.

Fixes: 269cb04 ("regulator: Use bitfield values for range selectors")
Signed-off-by: Vincent Whitchurch <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
vwax authored and broonie committed Sep 11, 2023
1 parent 0bb80ec commit 6223e07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/regulator/helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6223e07

Please sign in to comment.