diff mbox

[U-Boot,05/14] sunxi: axp221: Make dcdc1 voltage configurable

Message ID 1418761900-14035-5-git-send-email-hdegoede@redhat.com
State Superseded
Delegated to: Ian Campbell
Headers show

Commit Message

Hans de Goede Dec. 16, 2014, 8:31 p.m. UTC
The dcdc1 voltage is typically used as generic 3.3V IO voltage for things like
GPIO-s, sdcard interfaces, etc. On most boards this is undervolted to 3.0V to
safe battery, but not on all, make it configurable so that we can use the
same settings as the original firmware on all boards.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 board/sunxi/board.c       |  2 +-
 configs/Mele_M9_defconfig |  2 ++
 drivers/power/Kconfig     | 10 ++++++++++
 3 files changed, 13 insertions(+), 1 deletion(-)

Comments

Ian Campbell Dec. 18, 2014, 7:03 p.m. UTC | #1
On Tue, 2014-12-16 at 21:31 +0100, Hans de Goede wrote:
> The dcdc1 voltage is typically used as generic 3.3V IO voltage for things like
> GPIO-s, sdcard interfaces, etc. On most boards this is undervolted to 3.0V to
> safe battery, but not on all, make it configurable so that we can use the
> same settings as the original firmware on all boards.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Acked-by: Ian Campbell <ijc@hellion.org.uk>
diff mbox

Patch

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index b5dfe95..e2ebf83 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -175,7 +175,7 @@  void sunxi_board_init(void)
 #endif
 #ifdef CONFIG_AXP221_POWER
 	power_failed = axp221_init();
-	power_failed |= axp221_set_dcdc1(3000);
+	power_failed |= axp221_set_dcdc1(CONFIG_AXP221_DCDC1_VOLT);
 	power_failed |= axp221_set_dcdc2(1200);
 	power_failed |= axp221_set_dcdc3(1200);
 	power_failed |= axp221_set_dcdc4(1200);
diff --git a/configs/Mele_M9_defconfig b/configs/Mele_M9_defconfig
index 445cc57..e5ab0ec 100644
--- a/configs/Mele_M9_defconfig
+++ b/configs/Mele_M9_defconfig
@@ -7,6 +7,8 @@  CONFIG_FDTFILE="sun6i-a31-m9.dtb"
 +S:CONFIG_TARGET_MELE_M9=y
 +S:CONFIG_DRAM_CLK=312
 +S:CONFIG_DRAM_ZQ=120
+# The Mele M9 uses 3.3V for general IO
++S:CONFIG_AXP221_DCDC1_VOLT=3300
 # Ethernet phy power
 +S:CONFIG_AXP221_DLDO1_VOLT=3300
 # USB hub power
diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
index af66887..e132759 100644
--- a/drivers/power/Kconfig
+++ b/drivers/power/Kconfig
@@ -6,6 +6,16 @@  config AXP221_POWER
 	Say y here to enable support for the axp221 / axp223 pmic found on most
 	sun6i (A31) / sun8i (A23) boards.
 
+config AXP221_DCDC1_VOLT
+	int "axp221 dcdc1 voltage"
+	depends on AXP221_POWER
+	default 3000
+	---help---
+	Set the voltage (mV) to program the axp221 dcdc1 at, set to 0 to
+	disable dcdc1. This is typically used as generic 3.3V IO voltage for
+	things like GPIO-s, sdcard interfaces, etc. On most boards this is
+	undervolted to 3.0V to safe battery.
+
 config AXP221_DLDO1_VOLT
 	int "axp221 dldo1 voltage"
 	depends on AXP221_POWER