Skip to content

Commit

Permalink
regulator: max8907: Fix n_voltages for MAX8907B SD1
Browse files Browse the repository at this point in the history
For linear voltage mapping, the n_voltages is (max - min) / step + 1

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Axel Lin authored and Mark Brown committed Aug 28, 2012
1 parent 8f52a58 commit 7305608
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/regulator/max8907-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit 7305608

Please sign in to comment.