]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
regulator: max8907: Fix n_voltages for MAX8907B SD1
authorAxel Lin <axel.lin@gmail.com>
Thu, 16 Aug 2012 04:26:02 +0000 (12:26 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 28 Aug 2012 18:00:28 +0000 (11:00 -0700)
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>
drivers/regulator/max8907-regulator.c

index bd3b28b55231a0af132f23b4eb00abd28eb9eea2..bdf21a1996126e22b629a00c584e0f60a1e00a2a 100644 (file)
@@ -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++) {