[U-Boot] [PATCH 4/4] exynos5: support tps65090 pmic

Simon Glass sjg at chromium.org
Tue Apr 2 02:04:15 CEST 2013


From: Aaron Durbin <adurbin at chromium.org>

The TSP65090 is a PMIC on some exynos5 boards. The init function is
called for the TPS65090 pmic. If that device is not a part of the device
tree (returns -ENODEV) then continue. Otherwise return a failure.

Signed-off-by: Aaron Durbin <adurbin at chromium.org>
Signed-off-by: Simon Glass <sjg at chromium.org>
Reviewed-by: Simon Glass <sjg at chromium.org>
---
 board/samsung/smdk5250/smdk5250.c | 33 +++++++++++++++++++++++++--------
 1 file changed, 25 insertions(+), 8 deletions(-)

diff --git a/board/samsung/smdk5250/smdk5250.c b/board/samsung/smdk5250/smdk5250.c
index 217c6df..06f9ea6 100644
--- a/board/samsung/smdk5250/smdk5250.c
+++ b/board/samsung/smdk5250/smdk5250.c
@@ -37,6 +37,7 @@
 #include <asm/arch/dp_info.h>
 #include <power/pmic.h>
 #include <power/max77686_pmic.h>
+#include <power/tps65090_pmic.h>
 #include <tmu.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -155,17 +156,10 @@ static int pmic_reg_update(struct pmic *p, int reg, uint regval)
 	return 0;
 }
 
-int power_init_board(void)
+int max77686_init(void)
 {
 	struct pmic *p;
 
-	set_ps_hold_ctrl();
-
-	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
-
-	if (pmic_init(I2C_PMIC))
-		return -1;
-
 	p = pmic_get("MAX77686_PMIC");
 	if (!p)
 		return -ENODEV;
@@ -250,6 +244,29 @@ int power_init_board(void)
 
 	return 0;
 }
+
+int power_init_board(void)
+{
+	int ret;
+
+	set_ps_hold_ctrl();
+
+	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+
+	if (pmic_init(I2C_PMIC))
+		return -1;
+
+	if (max77686_init())
+		return -1;
+
+	/* The TPS65090 may not be in the device tree. If so, it is not
+	 * an error. */
+	ret = tps65090_init();
+	if (ret == 0 || ret == -ENODEV)
+		return 0;
+
+	return -1;
+}
 #endif
 
 void dram_init_banksize(void)
-- 
1.8.1.3



More information about the U-Boot mailing list