xref: /openbmc/u-boot/include/power/max77693_fg.h (revision fabbeb33)
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2013 Samsung Electronics
4  * Piotr Wilczek <p.wilczek@samsung.com>
5  */
6 
7 #ifndef __MAX77693_FG_H_
8 #define __MAX77693_FG_H_
9 
10 /* MAX 77693 registers */
11 enum {
12 	MAX77693_STATUS		= 0x00,
13 	MAX77693_SOCREP		= 0x06,
14 	MAX77693_VCELL		= 0x09,
15 	MAX77693_CURRENT	= 0x0A,
16 	MAX77693_AVG_CURRENT	= 0x0B,
17 	MAX77693_SOCMIX		= 0x0D,
18 	MAX77693_SOCAV		= 0x0E,
19 	MAX77693_DESIGN_CAP	= 0x18,
20 	MAX77693_AVG_VCELL	= 0x19,
21 	MAX77693_CONFIG		= 0x1D,
22 	MAX77693_VERSION	= 0x21,
23 	MAX77693_LEARNCFG	= 0x28,
24 	MAX77693_FILTERCFG	= 0x29,
25 	MAX77693_RELAXCFG	= 0x2A,
26 	MAX77693_MISCCFG	= 0x2B,
27 	MAX77693_CGAIN		= 0x2E,
28 	MAX77693_COFF		= 0x2F,
29 	MAX77693_RCOMP0		= 0x38,
30 	MAX77693_TEMPCO		= 0x39,
31 	MAX77693_FSTAT		= 0x3D,
32 	MAX77693_VFOCV		= 0xEE,
33 	MAX77693_VFSOC		= 0xFF,
34 
35 	FG_NUM_OF_REGS		= 0x100,
36 };
37 
38 #define MAX77693_POR (1 << 1)
39 
40 #define MODEL_UNLOCK1		0x0059
41 #define MODEL_UNLOCK2		0x00c4
42 #define MODEL_LOCK1		0x0000
43 #define MODEL_LOCK2		0x0000
44 
45 #define MAX77693_FUEL_I2C_ADDR	(0x6C >> 1)
46 
47 int power_fg_init(unsigned char bus);
48 #endif /* __MAX77693_FG_H_ */
49