diff mbox

[U-Boot,1/2] power: regulator: act8846: fix reading values

Message ID 5ed690c142e19e4d6bdc77857b7ccdd730634cd9.1470570924.git.john@metanate.com
State Accepted
Commit 65f89be2ef73c6605ffe08eb671c425603ec765a
Delegated to: Simon Glass
Headers show

Commit Message

John Keeping Aug. 7, 2016, 11:55 a.m. UTC
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>
---

 drivers/power/regulator/act8846.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Simon Glass Aug. 8, 2016, 9:44 p.m. UTC | #1
On 7 August 2016 at 05:55, John Keeping <john@metanate.com> wrote:
> 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>
> ---
>
>  drivers/power/regulator/act8846.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Acked-by: Simon Glass <sjg@chromium.org>
Simon Glass Aug. 12, 2016, 5:04 p.m. UTC | #2
On 8 August 2016 at 15:44, Simon Glass <sjg@chromium.org> wrote:
> On 7 August 2016 at 05:55, John Keeping <john@metanate.com> wrote:
>> 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>
>> ---
>>
>>  drivers/power/regulator/act8846.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> Acked-by: Simon Glass <sjg@chromium.org>

Applied to u-boot-dm, thanks!
diff mbox

Patch

diff --git a/drivers/power/regulator/act8846.c b/drivers/power/regulator/act8846.c
index 255f8b0..d506165 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;