power: regulator: act8846: fix reading values
authorJohn Keeping <john@metanate.com>
Sun, 7 Aug 2016 11:55:39 +0000 (12:55 +0100)
committerSimon Glass <sjg@chromium.org>
Fri, 12 Aug 2016 15:23:12 +0000 (09:23 -0600)
The voltage and control registers need to be looked up from the value in
driver_data.  Adjust the get_value and get_enable functions to match the
corresponding set_* functions.

Signed-off-by: John Keeping <john@metanate.com>
Acked-by: Simon Glass <sjg@chromium.org>
drivers/power/regulator/act8846.c

index 255f8b096e1dd79523752f1f68c2082800a5fb21..d506165120865e1b760b6c1671772518b544792e 100644 (file)
@@ -88,7 +88,7 @@ static int reg_get_value(struct udevice *dev)
        int reg = dev->driver_data;
        int ret;
 
-       ret = pmic_reg_read(dev->parent, reg);
+       ret = pmic_reg_read(dev->parent, addr_vol[reg]);
        if (ret < 0)
                return ret;
 
@@ -120,7 +120,7 @@ static bool reg_get_enable(struct udevice *dev)
        int reg = dev->driver_data;
        int ret;
 
-       ret = pmic_reg_read(dev->parent, reg);
+       ret = pmic_reg_read(dev->parent, addr_ctl[reg]);
        if (ret < 0)
                return ret;