summaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-07-02 18:16:04 -0600
committerSimon Glass <sjg@chromium.org>2015-08-05 21:06:12 -0600
commit8c4287090cc9bfa172370976c77b420d9c37f94c (patch)
tree35880b5e99c7be7b5862c8e54c5987f51dc92ad3 /drivers/power
parentcd367d89979c0476e2fcbca445a49008b372872b (diff)
downloadtalos-obmc-uboot-8c4287090cc9bfa172370976c77b420d9c37f94c.tar.gz
talos-obmc-uboot-8c4287090cc9bfa172370976c77b420d9c37f94c.zip
dm: power: max77686: Correct BUCK register access
Some regulators use the wrong voltage register and thus it is not possible to control them. Fix this. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/regulator/max77686.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/power/regulator/max77686.c b/drivers/power/regulator/max77686.c
index 37ebe94521..21173fc3ee 100644
--- a/drivers/power/regulator/max77686.c
+++ b/drivers/power/regulator/max77686.c
@@ -61,10 +61,14 @@ static struct dm_regulator_mode max77686_buck_mode_onoff[] = {
MODE(OPMODE_ON, MAX77686_BUCK_MODE_ON, "ON"),
};
-static const char max77686_buck_addr[] = {
+static const char max77686_buck_ctrl[] = {
0xff, 0x10, 0x12, 0x1c, 0x26, 0x30, 0x32, 0x34, 0x36, 0x38
};
+static const char max77686_buck_out[] = {
+ 0xff, 0x11, 0x14, 0x1e, 0x28, 0x31, 0x33, 0x35, 0x37, 0x39
+};
+
static int max77686_buck_volt2hex(int buck, int uV)
{
unsigned int hex = 0;
@@ -368,7 +372,7 @@ static int max77686_buck_val(struct udevice *dev, int op, int *uV)
*uV = 0;
/* &buck_out = ctrl + 1 */
- adr = max77686_buck_addr[buck] + 1;
+ adr = max77686_buck_out[buck];
/* mask */
switch (buck) {
@@ -549,7 +553,7 @@ static int max77686_buck_mode(struct udevice *dev, int op, int *opmode)
return -EINVAL;
}
- adr = max77686_buck_addr[buck];
+ adr = max77686_buck_ctrl[buck];
/* mask */
switch (buck) {
OpenPOWER on IntegriCloud