5 #define MAX17040_I2C_ADDRESS 0x36
7 #define MAX17040_DEFAULT_RCOMP_VALUE 0x9700
8 #define MAX17040_I2C_PRO_VALUE 0x5400
9 #define MAX17040_QUICK_START_VALUE 0x4000
12 #define MAX17040_REG_VCELL 0x2
13 #define MAX17040_REG_SOC 0x4
14 #define MAX17040_REG_MODE 0x6
15 #define MAX17040_REG_VERSION 0x08
16 #define MAX17040_REG_RCOMP 0x0c
17 #define MAX17040_REG_COMMAND 0xfe
19 //quick start condition check
20 #define S1_QUICK_START 0x1
21 #define S1_RCOMP_VALUE 0xb000
23 #define SLP45_QUICK_START 0x2
24 #define SLP45_RCOMP_VALUE 0xd000
26 typedef struct max17040_fuel_gauge_linear_data {
27 unsigned int min_vcell;
29 unsigned int y_interception;
30 }fuel_gauge_linear_data;
32 unsigned int init_fuel_gauge(u32 i2c_bus, int qstart_table_list, fuel_gauge_linear_data fuel_gauge_quick_table[10]);