regulator: palmas: Don't update tstep register for SMPS3 and SMPS7
authorAxel Lin <axel.lin@ingics.com>
Fri, 19 Apr 2013 06:18:48 +0000 (14:18 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 19 Apr 2013 10:47:29 +0000 (11:47 +0100)
SMPS3 and SMPS7 do not have tstep_addr setting, so current code actually
writes 0 to smps12_ctl (offset is 0) register when set_ramp_delay callback
is called for SMPS3 and SMPS7.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/palmas-regulator.c

index 8e5331c0b338f5d9ea0ae6db22d1d850d63c47da..a741063226044c91023c6f9bd320bd465931a2ac 100644 (file)
@@ -437,6 +437,13 @@ static int palmas_smps_set_ramp_delay(struct regulator_dev *rdev,
        unsigned int addr = palmas_regs_info[id].tstep_addr;
        int ret;
 
+       /* SMPS3 and SMPS7 do not have tstep_addr setting */
+       switch (id) {
+       case PALMAS_REG_SMPS3:
+       case PALMAS_REG_SMPS7:
+               return 0;
+       }
+
        if (ramp_delay <= 0)
                reg = 0;
        else if (ramp_delay < 2500)