projects/linux·commit 47a0925e

regulator: bd718x7: Fix voltages scaled by resistor divider

47a0925e · Maud Spierings <[email protected]> · 2025-10-30 07:35:38 +01:00

The .min_sel and .max_sel fields remained uninitialized in the new
linear_range, causing an error further down the line. Copy the old
values of these fields to the new one as they represent the range of
register values, which does not change.

Fixes: d2ad981151b3a ("regulator: bd718x7: Support external connection to scale voltages")
Signed-off-by: Maud Spierings <[email protected]>
Reviewed-by: Matti Vaittinen <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Commit
47a0925ee4bd2689f0aef4dbd67dd46442fe1ca2
Parents
dcb6fa37

Changes

1 files changed · +2 −0

FileStatusAddDelContent
drivers/regulator/bd718x7-regulator.cmodified+2−0View file

drivers/regulator/bd718x7-regulator.c

View file
diff --git a/drivers/regulator/bd718x7-regulator.c b/drivers/regulator/bd718x7-regulator.c
index 022d98f..ea9c405 100644
--- a/drivers/regulator/bd718x7-regulator.c
+++ b/drivers/regulator/bd718x7-regulator.c
@@ -1613,6 +1613,8 @@ static int setup_feedback_loop(struct device *dev, struct device_node *np,
step /= r1;
new[j].min = min;
+ new[j].min_sel = desc->linear_ranges[j].min_sel;
+ new[j].max_sel = desc->linear_ranges[j].max_sel;
new[j].step = step;
dev_dbg(dev, "%s: old range min %d, step %d\n",