tizen 2.3.1 release
[platform/kernel/u-boot.git] / include / max17040.h
1
2 #ifndef _MAX17040_H
3 #define _MAX17040_H
4
5 #define MAX17040_I2C_ADDRESS                            0x36
6
7 #define MAX17040_DEFAULT_RCOMP_VALUE            0x9700
8 #define MAX17040_I2C_PRO_VALUE                          0x5400
9 #define MAX17040_QUICK_START_VALUE                      0x4000
10
11 //register map
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
18
19 //quick start condition check
20 #define S1_QUICK_START                                          0x1
21 #define S1_RCOMP_VALUE                                          0xb000
22
23 #define SLP45_QUICK_START                   0x2
24 #define SLP45_RCOMP_VALUE                   0xd000
25
26 typedef struct max17040_fuel_gauge_linear_data {
27         unsigned int min_vcell;
28         unsigned int slope;
29         unsigned int y_interception;
30 }fuel_gauge_linear_data;
31  
32 unsigned int init_fuel_gauge(u32 i2c_bus, int qstart_table_list, fuel_gauge_linear_data fuel_gauge_quick_table[10]);
33
34 #endif
35
36
37