summaryrefslogtreecommitdiff
path: root/drivers/misc/pmic_max8998.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/pmic_max8998.c')
-rw-r--r--drivers/misc/pmic_max8998.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/misc/pmic_max8998.c b/drivers/misc/pmic_max8998.c
index cc69fd7..452e1c8 100644
--- a/drivers/misc/pmic_max8998.c
+++ b/drivers/misc/pmic_max8998.c
@@ -22,13 +22,19 @@
*/
#include <common.h>
-#include <pmic.h>
-#include <max8998_pmic.h>
+#include <power/pmic.h>
+#include <power/max8998_pmic.h>
+#include <errno.h>
-int pmic_init(void)
+int pmic_init(unsigned char bus)
{
- struct pmic *p = get_pmic();
static const char name[] = "MAX8998_PMIC";
+ struct pmic *p = pmic_alloc();
+
+ if (!p) {
+ printf("%s: POWER allocation error!\n", __func__);
+ return -ENOMEM;
+ }
puts("Board PMIC init\n");
@@ -37,7 +43,7 @@ int pmic_init(void)
p->number_of_regs = PMIC_NUM_OF_REGS;
p->hw.i2c.addr = MAX8998_I2C_ADDR;
p->hw.i2c.tx_num = 1;
- p->bus = I2C_PMIC;
+ p->bus = bus;
return 0;
}