1 /*
2  *  Copyright (C) 2011 Samsung Electronics
3  *  Lukasz Majewski <l.majewski@samsung.com>
4  *
5  * SPDX-License-Identifier:	GPL-2.0+
6  */
7 
8 #include <common.h>
9 #include <power/pmic.h>
10 #include <power/max8998_pmic.h>
11 #include <errno.h>
12 
13 int pmic_init(unsigned char bus)
14 {
15 	static const char name[] = "MAX8998_PMIC";
16 	struct pmic *p = pmic_alloc();
17 
18 	if (!p) {
19 		printf("%s: POWER allocation error!\n", __func__);
20 		return -ENOMEM;
21 	}
22 
23 	puts("Board PMIC init\n");
24 
25 	p->name = name;
26 	p->interface = PMIC_I2C;
27 	p->number_of_regs = PMIC_NUM_OF_REGS;
28 	p->hw.i2c.addr = MAX8998_I2C_ADDR;
29 	p->hw.i2c.tx_num = 1;
30 	p->bus = bus;
31 
32 	return 0;
33 }
34