xref: /openbmc/u-boot/include/power/max8997_muic.h (revision 713cb680)
1 /*
2  *  Copyright (C) 2012 Samsung Electronics
3  *  Lukasz Majewski <l.majewski@samsung.com>
4  *
5  * See file CREDITS for list of people who contributed to this
6  * project.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License as
10  * published by the Free Software Foundation; either version 2 of
11  * the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21  * MA 02111-1307 USA
22  */
23 
24 #ifndef __MAX8997_MUIC_H_
25 #define __MAX8997_MUIC_H_
26 
27 #include <power/power_chrg.h>
28 
29 /* MAX8997_MUIC_STATUS2 */
30 #define MAX8997_MUIC_CHG_NO	0x00
31 #define MAX8997_MUIC_CHG_USB	0x01
32 #define MAX8997_MUIC_CHG_USB_D	0x02
33 #define MAX8997_MUIC_CHG_TA	0x03
34 #define MAX8997_MUIC_CHG_TA_500 0x04
35 #define MAX8997_MUIC_CHG_TA_1A	0x05
36 #define MAX8997_MUIC_CHG_MASK	0x07
37 
38 /* MAX 8997 MUIC registers */
39 enum {
40 	MAX8997_MUIC_ID         = 0x00,
41 	MAX8997_MUIC_INT1	= 0x01,
42 	MAX8997_MUIC_INT2	= 0x02,
43 	MAX8997_MUIC_INT3	= 0x03,
44 	MAX8997_MUIC_STATUS1	= 0x04,
45 	MAX8997_MUIC_STATUS2	= 0x05,
46 	MAX8997_MUIC_STATUS3	= 0x06,
47 	MAX8997_MUIC_INTMASK1	= 0x07,
48 	MAX8997_MUIC_INTMASK2	= 0x08,
49 	MAX8997_MUIC_INTMASK3	= 0x09,
50 	MAX8997_MUIC_CDETCTRL	= 0x0A,
51 	MAX8997_MUIC_CONTROL1	= 0x0C,
52 	MAX8997_MUIC_CONTROL2	= 0x0D,
53 	MAX8997_MUIC_CONTROL3	= 0x0E,
54 
55 	MUIC_NUM_OF_REGS = 0x0F,
56 };
57 
58 #define MAX8997_MUIC_I2C_ADDR	(0x4A >> 1)
59 
60 int power_muic_init(unsigned int bus);
61 #endif /* __MAX8997_MUIC_H_ */
62