Re: [U-Boot] [PATCH 2/7] sunxi: power: Make all voltages configurable through Kconfig

2015-10-09 Thread Ian Campbell
On Sat, 2015-10-03 at 16:26 +0200, Hans de Goede wrote:
> On boards with axp221/223 pmic-s we already allow configuring most
> voltages. Make the Kconfig options for these also apply to boards
> with
> axp152 / axp209 pmic-s and extend them to configure all voltages.
> 
> The Kconfig defaults are chosen so that this commit does not
> introduce any
> functional changes.
> 
> Signed-off-by: Hans de Goede 

Acked-by: Ian Campbell 

(I'm afraid I have to go to the dentist now, I'll try and get to the
remainder after that, or if not then at the w/e.

Ian)

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/7] sunxi: power: Make all voltages configurable through Kconfig

2015-10-03 Thread Hans de Goede
On boards with axp221/223 pmic-s we already allow configuring most
voltages. Make the Kconfig options for these also apply to boards with
axp152 / axp209 pmic-s and extend them to configure all voltages.

The Kconfig defaults are chosen so that this commit does not introduce any
functional changes.

Signed-off-by: Hans de Goede 
---
 board/sunxi/board.c  |  48 -
 configs/CSQ_CS908_defconfig  |   4 +-
 configs/Colombus_defconfig   |   4 +-
 configs/Hummingbird_A31_defconfig|   2 +-
 configs/MSI_Primo81_defconfig|   2 +-
 configs/Mele_A1000G_quad_defconfig   |   8 +-
 configs/Mele_I7_defconfig|   8 +-
 configs/Mele_M9_defconfig|   8 +-
 configs/Sinlinx_SinA33_defconfig |   2 +-
 configs/ga10h_v1_1_defconfig |   4 +-
 configs/gt90h_v4_defconfig   |   6 +-
 configs/mixtile_loftq_defconfig  |   2 +-
 configs/q8_a23_tablet_800x480_defconfig  |   4 +-
 configs/q8_a33_tablet_1024x600_defconfig |   4 +-
 configs/q8_a33_tablet_800x480_defconfig  |   4 +-
 drivers/power/Kconfig| 174 +++
 16 files changed, 185 insertions(+), 99 deletions(-)

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 1b90678..bc0376b 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -444,36 +444,36 @@ void sunxi_board_init(void)
 
 #ifdef CONFIG_AXP152_POWER
power_failed = axp152_init();
-   power_failed |= axp152_set_dcdc2(1400);
-   power_failed |= axp152_set_dcdc3(1500);
-   power_failed |= axp152_set_dcdc4(1250);
-   power_failed |= axp152_set_ldo2(3000);
+   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);
 #endif
 #ifdef CONFIG_AXP209_POWER
power_failed |= axp209_init();
-   power_failed |= axp209_set_dcdc2(1400);
-   power_failed |= axp209_set_dcdc3(1250);
-   power_failed |= axp209_set_ldo2(3000);
-   power_failed |= axp209_set_ldo3(2800);
-   power_failed |= axp209_set_ldo4(2800);
+   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);
 #endif
 #ifdef CONFIG_AXP221_POWER
power_failed = axp221_init();
-   power_failed |= axp221_set_dcdc1(CONFIG_AXP221_DCDC1_VOLT);
-   power_failed |= axp221_set_dcdc2(CONFIG_AXP221_DCDC2_VOLT);
-   power_failed |= axp221_set_dcdc3(1200); /* VDD-CPU */
-#ifdef CONFIG_MACH_SUN6I
-   power_failed |= axp221_set_dcdc4(1200); /* A31:VDD-SYS */
-#else
-   power_failed |= axp221_set_dcdc4(0);/* A23:unused */
-#endif
-   power_failed |= axp221_set_dcdc5(1500); /* VCC-DRAM */
-   power_failed |= axp221_set_dldo1(CONFIG_AXP221_DLDO1_VOLT);
-   power_failed |= axp221_set_dldo4(CONFIG_AXP221_DLDO4_VOLT);
-   power_failed |= axp221_set_aldo1(CONFIG_AXP221_ALDO1_VOLT);
-   power_failed |= axp221_set_aldo2(CONFIG_AXP221_ALDO2_VOLT);
-   power_failed |= axp221_set_aldo3(CONFIG_AXP221_ALDO3_VOLT);
-   power_failed |= axp221_set_eldo(3, CONFIG_AXP221_ELDO3_VOLT);
+   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);
 #endif
 
printf("DRAM:");
diff --git a/configs/CSQ_CS908_defconfig b/configs/CSQ_CS908_defconfig
index 7c8eca8..3ffd34e 100644
--- a/configs/CSQ_CS908_defconfig
+++ b/configs/CSQ_CS908_defconfig
@@ -12,7 +12,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC"
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_ETH_DESIGNWARE=y
-CONFIG_AXP221_DLDO1_VOLT=3300
-CONFIG_AXP221_ALDO1_VOLT=3300
+CONFIG_AXP_DLDO1_VOLT=3300
+CONFIG_AXP_ALDO1_VOLT=3300
 CONFIG_USB_EHCI_HCD=y