summaryrefslogtreecommitdiff
path: root/board/sunxi
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2015-10-03 15:18:33 +0200
committerHans de Goede <hdegoede@redhat.com>2015-10-20 18:40:27 +0200
commit6944aff1ca91e8cf2c373193982cbb0417b4d4cc (patch)
tree02549285ee6718f207188a977ac197a1cf5ac7c8 /board/sunxi
parent401175220d169ba2bfe7fbb50d73ccc9c1d6a635 (diff)
downloadu-boot-imx-6944aff1ca91e8cf2c373193982cbb0417b4d4cc.zip
u-boot-imx-6944aff1ca91e8cf2c373193982cbb0417b4d4cc.tar.gz
u-boot-imx-6944aff1ca91e8cf2c373193982cbb0417b4d4cc.tar.bz2
sunxi: power: Unify axp pmic function names
Stop prefixing the axp functions for setting voltages, etc. with the model number, there ever is only one pmic driver built into u-boot, this allows simplifying the callers. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
Diffstat (limited to 'board/sunxi')
-rw-r--r--board/sunxi/board.c70
1 files changed, 32 insertions, 38 deletions
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 55a880e..6ac398c 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -13,15 +13,7 @@
#include <common.h>
#include <mmc.h>
-#ifdef CONFIG_AXP152_POWER
-#include <axp152.h>
-#endif
-#ifdef CONFIG_AXP209_POWER
-#include <axp209.h>
-#endif
-#ifdef CONFIG_AXP221_POWER
-#include <axp221.h>
-#endif
+#include <axp_pmic.h>
#include <asm/arch/clock.h>
#include <asm/arch/cpu.h>
#include <asm/arch/display.h>
@@ -438,40 +430,42 @@ void sunxi_board_init(void)
int power_failed = 0;
unsigned long ramsize;
-#ifdef CONFIG_AXP152_POWER
- power_failed = axp152_init();
- power_failed |= axp152_set_dcdc2(CONFIG_AXP_DCDC2_VOLT);
- power_failed |= axp152_set_dcdc3(CONFIG_AXP_DCDC3_VOLT);
- power_failed |= axp152_set_dcdc4(CONFIG_AXP_DCDC4_VOLT);
- power_failed |= axp152_set_ldo2(CONFIG_AXP_ALDO2_VOLT);
+#if defined CONFIG_AXP152_POWER || defined CONFIG_AXP209_POWER || defined CONFIG_AXP221_POWER
+ power_failed = axp_init();
+
+#ifdef CONFIG_AXP221_POWER
+ power_failed |= axp_set_dcdc1(CONFIG_AXP_DCDC1_VOLT);
#endif
-#ifdef CONFIG_AXP209_POWER
- power_failed |= axp209_init();
- power_failed |= axp209_set_dcdc2(CONFIG_AXP_DCDC2_VOLT);
- power_failed |= axp209_set_dcdc3(CONFIG_AXP_DCDC3_VOLT);
- power_failed |= axp209_set_ldo2(CONFIG_AXP_ALDO2_VOLT);
- power_failed |= axp209_set_ldo3(CONFIG_AXP_ALDO3_VOLT);
- power_failed |= axp209_set_ldo4(CONFIG_AXP_ALDO4_VOLT);
+ power_failed |= axp_set_dcdc2(CONFIG_AXP_DCDC2_VOLT);
+ power_failed |= axp_set_dcdc3(CONFIG_AXP_DCDC3_VOLT);
+#ifndef CONFIG_AXP209_POWER
+ power_failed |= axp_set_dcdc4(CONFIG_AXP_DCDC4_VOLT);
#endif
#ifdef CONFIG_AXP221_POWER
- power_failed = axp221_init();
- power_failed |= axp221_set_dcdc1(CONFIG_AXP_DCDC1_VOLT);
- power_failed |= axp221_set_dcdc2(CONFIG_AXP_DCDC2_VOLT);
- power_failed |= axp221_set_dcdc3(CONFIG_AXP_DCDC3_VOLT);
- power_failed |= axp221_set_dcdc4(CONFIG_AXP_DCDC4_VOLT);
- power_failed |= axp221_set_dcdc5(CONFIG_AXP_DCDC5_VOLT);
- power_failed |= axp221_set_aldo1(CONFIG_AXP_ALDO1_VOLT);
- power_failed |= axp221_set_aldo2(CONFIG_AXP_ALDO2_VOLT);
- power_failed |= axp221_set_aldo3(CONFIG_AXP_ALDO3_VOLT);
- power_failed |= axp221_set_dldo1(CONFIG_AXP_DLDO1_VOLT);
- power_failed |= axp221_set_dldo2(CONFIG_AXP_DLDO2_VOLT);
- power_failed |= axp221_set_dldo3(CONFIG_AXP_DLDO3_VOLT);
- power_failed |= axp221_set_dldo4(CONFIG_AXP_DLDO4_VOLT);
- power_failed |= axp221_set_eldo(1, CONFIG_AXP_ELDO1_VOLT);
- power_failed |= axp221_set_eldo(2, CONFIG_AXP_ELDO2_VOLT);
- power_failed |= axp221_set_eldo(3, CONFIG_AXP_ELDO3_VOLT);
+ power_failed |= axp_set_dcdc5(CONFIG_AXP_DCDC5_VOLT);
#endif
+#ifdef CONFIG_AXP221_POWER
+ power_failed |= axp_set_aldo1(CONFIG_AXP_ALDO1_VOLT);
+#endif
+ power_failed |= axp_set_aldo2(CONFIG_AXP_ALDO2_VOLT);
+#ifndef CONFIG_AXP152_POWER
+ power_failed |= axp_set_aldo3(CONFIG_AXP_ALDO3_VOLT);
+#endif
+#ifdef CONFIG_AXP209_POWER
+ power_failed |= axp_set_aldo4(CONFIG_AXP_ALDO4_VOLT);
+#endif
+
+#ifdef CONFIG_AXP221_POWER
+ power_failed |= axp_set_dldo1(CONFIG_AXP_DLDO1_VOLT);
+ power_failed |= axp_set_dldo2(CONFIG_AXP_DLDO2_VOLT);
+ power_failed |= axp_set_dldo3(CONFIG_AXP_DLDO3_VOLT);
+ power_failed |= axp_set_dldo4(CONFIG_AXP_DLDO4_VOLT);
+ power_failed |= axp_set_eldo(1, CONFIG_AXP_ELDO1_VOLT);
+ power_failed |= axp_set_eldo(2, CONFIG_AXP_ELDO2_VOLT);
+ power_failed |= axp_set_eldo(3, CONFIG_AXP_ELDO3_VOLT);
+#endif
+#endif
printf("DRAM:");
ramsize = sunxi_dram_init();
printf(" %lu MiB\n", ramsize >> 20);