summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Goger <klaus.goger@theobroma-systems.com>2015-07-19 08:09:13 +0200
committerKlaus Goger <klaus.goger@theobroma-systems.com>2015-07-30 18:44:07 +0200
commit199ea0062091b6dee4b096ed7b56af493fddc431 (patch)
tree90d103cb69389614f92f39261e9228adf93498bb
parent936c8adaf0fb8b008870fe6acb8f935b6eebe607 (diff)
ARM: sun6i: configure axp221 for dual supply
switch to ACIN even if it's shorted with VBUS Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
-rw-r--r--board/sunxi/board.c3
-rw-r--r--drivers/power/axp221.c5
-rw-r--r--include/axp221.h1
3 files changed, 9 insertions, 0 deletions
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 4c86401f83..c9a8c55c98 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -445,6 +445,9 @@ void sunxi_board_init(void)
#endif
#ifdef CONFIG_AXP221_POWER
power_failed = axp221_init();
+ power_failed |= axp221_write(0x8f,0x41);
+ power_failed |= axp221_write(0x30,0x66);
+ power_failed |= axp221_write(0x30,0x62);
power_failed |= axp221_set_dcdc1(CONFIG_AXP221_DCDC1_VOLT);
power_failed |= axp221_set_dcdc2(1200); /* A31:VDD-GPU, A23:VDD-SYS */
power_failed |= axp221_set_dcdc3(1200); /* VDD-CPU */
diff --git a/drivers/power/axp221.c b/drivers/power/axp221.c
index 7bbaec87e4..ba7dbec948 100644
--- a/drivers/power/axp221.c
+++ b/drivers/power/axp221.c
@@ -26,6 +26,11 @@ static u8 axp221_mvolt_to_cfg(int mvolt, int min, int max, int div)
return (mvolt - min) / div;
}
+int axp221_write(u8 reg, u8 val)
+{
+ return pmic_bus_write(reg, val);
+}
+
int axp221_set_dcdc1(unsigned int mvolt)
{
int ret;
diff --git a/include/axp221.h b/include/axp221.h
index 9c871623a8..6b7ca4822f 100644
--- a/include/axp221.h
+++ b/include/axp221.h
@@ -63,6 +63,7 @@
#define AXP_GPIO_STATE 0x94
#define AXP_GPIO_STATE_OFFSET 0
+int axp221_write(u8 reg, u8 val);
int axp221_set_dcdc1(unsigned int mvolt);
int axp221_set_dcdc2(unsigned int mvolt);
int axp221_set_dcdc3(unsigned int mvolt);