|
@@ -22,13 +22,19 @@
|
|
*/
|
|
*/
|
|
|
|
|
|
#include <common.h>
|
|
#include <common.h>
|
|
-#include <pmic.h>
|
|
|
|
-#include <max77686_pmic.h>
|
|
|
|
|
|
+#include <power/pmic.h>
|
|
|
|
+#include <power/max77686_pmic.h>
|
|
|
|
+#include <errno.h>
|
|
|
|
|
|
-int pmic_init(void)
|
|
|
|
|
|
+int pmic_init(unsigned char bus)
|
|
{
|
|
{
|
|
- struct pmic *p = get_pmic();
|
|
|
|
static const char name[] = "MAX77686_PMIC";
|
|
static const char name[] = "MAX77686_PMIC";
|
|
|
|
+ struct pmic *p = pmic_alloc();
|
|
|
|
+
|
|
|
|
+ if (!p) {
|
|
|
|
+ printf("%s: POWER allocation error!\n", __func__);
|
|
|
|
+ return -ENOMEM;
|
|
|
|
+ }
|
|
|
|
|
|
puts("Board PMIC init\n");
|
|
puts("Board PMIC init\n");
|
|
p->name = name;
|
|
p->name = name;
|
|
@@ -36,7 +42,7 @@ int pmic_init(void)
|
|
p->number_of_regs = PMIC_NUM_OF_REGS;
|
|
p->number_of_regs = PMIC_NUM_OF_REGS;
|
|
p->hw.i2c.addr = MAX77686_I2C_ADDR;
|
|
p->hw.i2c.addr = MAX77686_I2C_ADDR;
|
|
p->hw.i2c.tx_num = 1;
|
|
p->hw.i2c.tx_num = 1;
|
|
- p->bus = I2C_PMIC;
|
|
|
|
|
|
+ p->bus = bus;
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|