From c7336815078ff3745e3130aeff35991e3e98e61e Mon Sep 17 00:00:00 2001 From: Ɓukasz Majewski Date: Tue, 13 Nov 2012 03:21:55 +0000 Subject: pmic: Extend PMIC framework to support multiple instances of PMIC devices The PMIC framework has been extended to support multiple instances of the variety of devices responsible for power management. This change allows supporting of e.g. fuel gauge, charger, MUIC (Micro USB Interface Circuit). Power related includes have been moved to ./include/power directory. This is a first of a series of patches - in the future "pmic" will be replaced with "power". Two important issues: 1. The PMIC needs to be initialized just after malloc is configured 2. It uses list to hold information about available PMIC devices Signed-off-by: Lukasz Majewski Signed-off-by: Kyungmin Park Cc: Stefano Babic --- board/samsung/trats/trats.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'board/samsung/trats/trats.c') diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c index e11a8922fc..e0a98901f7 100644 --- a/board/samsung/trats/trats.c +++ b/board/samsung/trats/trats.c @@ -34,9 +34,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include "setup.h" @@ -69,7 +69,7 @@ int board_init(void) printf("HW Revision:\t0x%x\n", board_rev); #if defined(CONFIG_PMIC) - pmic_init(); + pmic_init(I2C_5); #endif return 0; @@ -238,7 +238,9 @@ static int s5pc210_phy_control(int on) { int ret = 0; u32 val = 0; - struct pmic *p = get_pmic(); + struct pmic *p = pmic_get("MAX8997_PMIC"); + if (!p) + return -ENODEV; if (pmic_probe(p)) return -1; @@ -413,7 +415,9 @@ static void lcd_reset(void) static int lcd_power(void) { int ret = 0; - struct pmic *p = get_pmic(); + struct pmic *p = pmic_get("MAX8997_PMIC"); + if (!p) + return -ENODEV; if (pmic_probe(p)) return 0; @@ -473,7 +477,9 @@ static struct mipi_dsim_lcd_device mipi_lcd_device = { static int mipi_power(void) { int ret = 0; - struct pmic *p = get_pmic(); + struct pmic *p = pmic_get("MAX8997_PMIC"); + if (!p) + return -ENODEV; if (pmic_probe(p)) return 0; -- cgit