xref: /openbmc/u-boot/include/power/max8997_muic.h (revision 87a62bce)
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  *  Copyright (C) 2012 Samsung Electronics
4  *  Lukasz Majewski <l.majewski@samsung.com>
5  */
6 
7 #ifndef __MAX8997_MUIC_H_
8 #define __MAX8997_MUIC_H_
9 
10 #include <power/power_chrg.h>
11 
12 /* MAX8997_MUIC_STATUS2 */
13 #define MAX8997_MUIC_CHG_NO	0x00
14 #define MAX8997_MUIC_CHG_USB	0x01
15 #define MAX8997_MUIC_CHG_USB_D	0x02
16 #define MAX8997_MUIC_CHG_TA	0x03
17 #define MAX8997_MUIC_CHG_TA_500 0x04
18 #define MAX8997_MUIC_CHG_TA_1A	0x05
19 #define MAX8997_MUIC_CHG_MASK	0x07
20 
21 /* MAX 8997 MUIC registers */
22 enum {
23 	MAX8997_MUIC_ID         = 0x00,
24 	MAX8997_MUIC_INT1	= 0x01,
25 	MAX8997_MUIC_INT2	= 0x02,
26 	MAX8997_MUIC_INT3	= 0x03,
27 	MAX8997_MUIC_STATUS1	= 0x04,
28 	MAX8997_MUIC_STATUS2	= 0x05,
29 	MAX8997_MUIC_STATUS3	= 0x06,
30 	MAX8997_MUIC_INTMASK1	= 0x07,
31 	MAX8997_MUIC_INTMASK2	= 0x08,
32 	MAX8997_MUIC_INTMASK3	= 0x09,
33 	MAX8997_MUIC_CDETCTRL	= 0x0A,
34 	MAX8997_MUIC_CONTROL1	= 0x0C,
35 	MAX8997_MUIC_CONTROL2	= 0x0D,
36 	MAX8997_MUIC_CONTROL3	= 0x0E,
37 
38 	MUIC_NUM_OF_REGS = 0x0F,
39 };
40 
41 #define MAX8997_MUIC_I2C_ADDR	(0x4A >> 1)
42 
43 int power_muic_init(unsigned int bus);
44 #endif /* __MAX8997_MUIC_H_ */
45