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

login
register
mail settings
Submitter Simon Glass
Date April 2, 2013, 12:04 a.m.
Message ID <1364861055-21670-5-git-send-email-sjg@chromium.org>
Download mbox | patch
Permalink /patch/232844/
State New, archived
Delegated to: Minkyu Kang
Headers show

Comments

Simon Glass - April 2, 2013, 12:04 a.m.
From: Aaron Durbin <adurbin@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@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
 board/samsung/smdk5250/smdk5250.c | 33 +++++++++++++++++++++++++--------
 1 file changed, 25 insertions(+), 8 deletions(-)

Patch

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)