aboutsummaryrefslogtreecommitdiff
path: root/drivers/power/axp209.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2016-09-12 09:52:52 +0200
committerHans de Goede <hdegoede@redhat.com>2016-09-17 14:37:39 +0200
commit253e62bf4b118d38a9e4a396b68fac61dcae7bbc (patch)
tree7d84055ccd91417823986e1cff30c346709141f8 /drivers/power/axp209.c
parent8cbb389bb3da80cbf8911f8386cbff92c6a78afe (diff)
downloadu-boot-253e62bf4b118d38a9e4a396b68fac61dcae7bbc.zip
u-boot-253e62bf4b118d38a9e4a396b68fac61dcae7bbc.tar.gz
u-boot-253e62bf4b118d38a9e4a396b68fac61dcae7bbc.tar.bz2
sunxi: axp2xx: disable ldoio0/1 at boot
When cold-booting the ldoio0/1 regulators are always off / the gpios are always at tristate. But when re-booting from android these are sometimes on. Disable them at axp_init time (iow as early as possible) to remove this difference between a cold boot and a reboot. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
Diffstat (limited to 'drivers/power/axp209.c')
-rw-r--r--drivers/power/axp209.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/power/axp209.c b/drivers/power/axp209.c
index fc162a1..731b75e 100644
--- a/drivers/power/axp209.c
+++ b/drivers/power/axp209.c
@@ -167,6 +167,22 @@ int axp_init(void)
return rc;
}
+ /*
+ * Turn off LDOIO regulators / tri-state GPIO pins, when rebooting
+ * from android these are sometimes on.
+ */
+ rc = pmic_bus_write(AXP_GPIO0_CTRL, AXP_GPIO_CTRL_INPUT);
+ if (rc)
+ return rc;
+
+ rc = pmic_bus_write(AXP_GPIO1_CTRL, AXP_GPIO_CTRL_INPUT);
+ if (rc)
+ return rc;
+
+ rc = pmic_bus_write(AXP_GPIO2_CTRL, AXP_GPIO_CTRL_INPUT);
+ if (rc)
+ return rc;
+
return 0;
}