]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
regulator: wm8400: Simplify set REGULATOR_MODE_IDLE mode in wm8400_dcdc_set_mode
authorAxel Lin <axel.lin@gmail.com>
Wed, 1 Aug 2012 01:15:11 +0000 (09:15 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 3 Aug 2012 22:21:30 +0000 (23:21 +0100)
To set REGULATOR_MODE_IDLE mode, what we do is to clear DC1_ACTIVE and
DC1_SLEEP bits, this can be done in one wm8400_set_bits() call.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/wm8400-regulator.c

index 9035dd0536118df253769b6e7e5847621ebd9a5e..27c746ef06364d2f02e95b8928ed748a31de6b1d 100644 (file)
@@ -120,13 +120,8 @@ static int wm8400_dcdc_set_mode(struct regulator_dev *dev, unsigned int mode)
 
        case REGULATOR_MODE_IDLE:
                /* Datasheet: standby */
-               ret = wm8400_set_bits(wm8400, WM8400_DCDC1_CONTROL_1 + offset,
-                                     WM8400_DC1_ACTIVE, 0);
-               if (ret != 0)
-                       return ret;
                return wm8400_set_bits(wm8400, WM8400_DCDC1_CONTROL_1 + offset,
-                                      WM8400_DC1_SLEEP, 0);
-
+                                      WM8400_DC1_ACTIVE | WM8400_DC1_SLEEP, 0);
        default:
                return -EINVAL;
        }