summaryrefslogtreecommitdiffstats
path: root/board/samsung
diff options
context:
space:
mode:
authorŁukasz Majewski <l.majewski@samsung.com>2012-11-13 03:21:55 +0000
committerAnatolij Gustschin <agust@denx.de>2012-11-14 11:21:09 +0100
commitc7336815078ff3745e3130aeff35991e3e98e61e (patch)
tree8ace1a85705cbd5b6484a45fefd093161a7a5b05 /board/samsung
parent452329f1d57fe7cbc54e65617e84d5bb1f93f631 (diff)
downloadblackbird-obmc-uboot-c7336815078ff3745e3130aeff35991e3e98e61e.tar.gz
blackbird-obmc-uboot-c7336815078ff3745e3130aeff35991e3e98e61e.zip
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 <l.majewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Cc: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'board/samsung')
-rw-r--r--board/samsung/goni/goni.c11
-rw-r--r--board/samsung/trats/trats.c18
-rw-r--r--board/samsung/universal_c210/universal.c14
3 files changed, 28 insertions, 15 deletions
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c
index e8fb1ea413..71ed618c6f 100644
--- a/board/samsung/goni/goni.c
+++ b/board/samsung/goni/goni.c
@@ -25,10 +25,10 @@
#include <common.h>
#include <asm/arch/gpio.h>
#include <asm/arch/mmc.h>
-#include <pmic.h>
+#include <power/pmic.h>
#include <usb/s3c_udc.h>
#include <asm/arch/cpu.h>
-#include <max8998_pmic.h>
+#include <power/max8998_pmic.h>
DECLARE_GLOBAL_DATA_PTR;
static struct s5pc110_gpio *s5pc110_gpio;
@@ -42,8 +42,9 @@ int board_init(void)
gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
#if defined(CONFIG_PMIC)
- pmic_init();
+ pmic_init(I2C_5);
#endif
+
return 0;
}
@@ -108,7 +109,9 @@ static int s5pc1xx_phy_control(int on)
{
int ret;
static int status;
- struct pmic *p = get_pmic();
+ struct pmic *p = pmic_get("MAX8998_PMIC");
+ if (!p)
+ return -ENODEV;
if (pmic_probe(p))
return -1;
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 <asm/arch/mipi_dsim.h>
#include <asm/arch/watchdog.h>
#include <asm/arch/power.h>
-#include <pmic.h>
+#include <power/pmic.h>
#include <usb/s3c_udc.h>
-#include <max8997_pmic.h>
+#include <power/max8997_pmic.h>
#include <libtizen.h>
#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;
diff --git a/board/samsung/universal_c210/universal.c b/board/samsung/universal_c210/universal.c
index 90fff5cf5e..c4950ddc26 100644
--- a/board/samsung/universal_c210/universal.c
+++ b/board/samsung/universal_c210/universal.c
@@ -27,10 +27,10 @@
#include <asm/arch/adc.h>
#include <asm/arch/gpio.h>
#include <asm/arch/mmc.h>
-#include <pmic.h>
+#include <power/pmic.h>
#include <usb/s3c_udc.h>
#include <asm/arch/cpu.h>
-#include <max8998_pmic.h>
+#include <power/max8998_pmic.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -59,7 +59,7 @@ int board_init(void)
gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
#if defined(CONFIG_PMIC)
- pmic_init();
+ pmic_init(I2C_5);
#endif
check_hw_revision();
@@ -112,7 +112,9 @@ static unsigned short get_adc_value(int channel)
static int adc_power_control(int on)
{
int ret;
- struct pmic *p = get_pmic();
+ struct pmic *p = pmic_get("MAX8998_PMIC");
+ if (!p)
+ return -ENODEV;
if (pmic_probe(p))
return -1;
@@ -280,7 +282,9 @@ int board_mmc_init(bd_t *bis)
static int s5pc210_phy_control(int on)
{
int ret = 0;
- struct pmic *p = get_pmic();
+ struct pmic *p = pmic_get("MAX8998_PMIC");
+ if (!p)
+ return -ENODEV;
if (pmic_probe(p))
return -1;
OpenPOWER on IntegriCloud