regulator: tps80031: Set selector in __tps80031_ldo_set_voltage
Antti P Miettinen [Thu, 3 Nov 2011 08:39:22 +0000 (10:39 +0200)]
Set selector also in __tps80031_ldo_set_voltage().

Bug 886170

Change-Id: I17dab9cdfa6397dbdf9dba0232e4f8de0cf364f0
Signed-off-by: Antti P Miettinen <amiettinen@nvidia.com>
Reviewed-on: http://git-master/r/62147
Reviewed-by: Lokesh Pathak <lpathak@nvidia.com>
Tested-by: Lokesh Pathak <lpathak@nvidia.com>

drivers/regulator/tps80031-regulator.c

index deca7ad..342809f 100644 (file)
@@ -565,6 +565,8 @@ static int __tps80031_ldo_set_voltage(struct device *parent,
         * mV = 1000mv + 100mv * (vsel - 1)
         */
        vsel = (min_uV/1000 - 1000)/100 + 1;
+       if (selector)
+               *selector = vsel;
        ret = tps80031_write(parent, ri->volt_id, ri->volt_reg, vsel);
        if (ret < 0)
                dev_err(ri->dev, "Error in writing the Voltage register\n");