Skip to contentSkip to conversation

regulator: max8907: Fix n_voltages for MAX8907B SD1

PATCH Applied Axel Lin 3 participants 3 messages Aug 16, 2012 – Aug 17, 2012 Voltage and current regulator framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 regulator: max8907: Fix n_voltages for MAX8907B SD1

For linear voltage mapping, the n_voltages is (max - min) / step + 1

---
 drivers/regulator/max8907-regulator.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/regulator/max8907-regulator.c +2 -1
index bd3b28b..bdf21a1 100644
@@ -286,7 +286,8 @@ static __devinit int max8907_regulator_probe(struct platform_device *pdev)
 	    MAX8907_II2RR_VERSION_REV_B) {
 		pmic->desc[MAX8907_SD1].min_uV = 637500;
 		pmic->desc[MAX8907_SD1].uV_step = 12500;
-		pmic->desc[MAX8907_SD1].n_voltages = (1425000 - 637500) / 12500;
+		pmic->desc[MAX8907_SD1].n_voltages =
+						(1425000 - 637500) / 12500 + 1;
 	}
 
 	for (i = 0; i < MAX8907_NUM_REGULATORS; i++) {
Signature · 1 line
1.7.9.5