regulator: tps65023: Set missing bit for update core-voltage
authorMarcus Folkesson <marcus.folkesson@gmail.com>
Mon, 8 Aug 2011 18:29:33 +0000 (20:29 +0200)
committerLiam Girdwood <lrg@slimlogic.co.uk>
Sun, 28 Aug 2011 16:43:40 +0000 (17:43 +0100)
Setting the GO bit in CTRL2 for updating the core voltage

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
drivers/regulator/tps65023-regulator.c

index b912daae9fa0a0863d572b3449d4a41fee3906b3..11c9e1f1407964871a2235640e9d7e5127202e57 100644 (file)
@@ -284,6 +284,7 @@ static int tps65023_dcdc_set_voltage(struct regulator_dev *dev,
        struct tps_pmic *tps = rdev_get_drvdata(dev);
        int dcdc = rdev_get_id(dev);
        int vsel;
+       int ret;
 
        if (dcdc != TPS65023_DCDC_1)
                return -EINVAL;
@@ -306,11 +307,21 @@ static int tps65023_dcdc_set_voltage(struct regulator_dev *dev,
 
        *selector = vsel;
 
-       /* write to the register in case we found a match */
        if (vsel == tps->info[dcdc]->table_len)
-               return -EINVAL;
-       else
-               return tps_65023_reg_write(tps, TPS65023_REG_DEF_CORE, vsel);
+               goto failed;
+
+       ret = tps_65023_reg_write(tps, TPS65023_REG_DEF_CORE, vsel);
+
+       /* Tell the chip that we have changed the value in DEFCORE
+        * and its time to update the core voltage
+        */
+       tps_65023_set_bits(tps, TPS65023_REG_CON_CTRL2,
+                                               TPS65023_REG_CTRL2_GO);
+
+       return ret;
+
+failed:
+       return -EINVAL;
 }
 
 static int tps65023_ldo_get_voltage(struct regulator_dev *dev)