From: John Keeping Date: Sun, 7 Aug 2016 11:55:39 +0000 (+0100) Subject: power: regulator: act8846: fix reading values X-Git-Tag: v2016.09-rc2~64^2~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=65f89be2ef73c6605ffe08eb671c425603ec765a;p=u-boot power: regulator: act8846: fix reading values 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 Acked-by: Simon Glass --- diff --git a/drivers/power/regulator/act8846.c b/drivers/power/regulator/act8846.c index 255f8b096e..d506165120 100644 --- a/drivers/power/regulator/act8846.c +++ b/drivers/power/regulator/act8846.c @@ -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;