Skip to content
Snippets Groups Projects
Commit 253e62bf authored by Hans de Goede's avatar Hans de Goede
Browse files

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: default avatarHans de Goede <hdegoede@redhat.com>
Acked-by: default avatarIan Campbell <ijc@hellion.org.uk>
parent 8cbb389b
No related branches found
No related tags found
No related merge requests found
...@@ -167,6 +167,22 @@ int axp_init(void) ...@@ -167,6 +167,22 @@ int axp_init(void)
return rc; 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; return 0;
} }
......
...@@ -223,6 +223,18 @@ int axp_init(void) ...@@ -223,6 +223,18 @@ int axp_init(void)
if (!(axp_chip_id == 0x6 || axp_chip_id == 0x7 || axp_chip_id == 0x17)) if (!(axp_chip_id == 0x6 || axp_chip_id == 0x7 || axp_chip_id == 0x17))
return -ENODEV; return -ENODEV;
/*
* Turn off LDOIO regulators / tri-state GPIO pins, when rebooting
* from android these are sometimes on.
*/
ret = pmic_bus_write(AXP_GPIO0_CTRL, AXP_GPIO_CTRL_INPUT);
if (ret)
return ret;
ret = pmic_bus_write(AXP_GPIO1_CTRL, AXP_GPIO_CTRL_INPUT);
if (ret)
return ret;
return 0; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment