merge with master
[platform/kernel/u-boot.git] / include / fuelgauge_battery_data.h
1 /*
2  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
3  * Sanghee Kim <sh0130.kim@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 #ifndef _FUELGUAGE_BATTERY_DATA_H_
24 #define _FUELGUAGE_BATTERY_DATA_H_
25
26 /* common parameter */
27 #define DSG_DV                  65      /* mV */
28 #define CHG_DV                  40      /* mV */
29 #define T_DV                    100     /* mV, voltage tolerance */
30 #define T_SOC_DSG_UPPER         10      /* 10%, soc tolerance */
31 #define T_SOC_DSG_BELOW         20      /* 20%, soc tolerance */
32 #define T_SOC_CHG_UPPER         10      /* 10%, soc tolerance */
33 #define T_SOC_CHG_BELOW         10      /* 10%, soc tolerance */
34 #define T_SOC_W                 27      /* 27%, soc tolerance(reset case) */
35 #define T_SOC_LOW               3       /* 3%, soc tolerance(low batt) */
36 #define T_SOC_HIGH              97      /* 97%, soc tolerance(high batt) */
37
38 #define PLAT_VOL_HIGH_DSG       380000  /* unit : 0.01mV */
39 #define PLAT_VOL_LOW_DSG        365000  /* unit : 0.01mV */
40 #define PLAT_VOL_HIGH_CHG       385000  /* unit : 0.01mV */
41 #define PLAT_VOL_LOW_CHG        370000  /* unit : 0.01mV */
42 #define PLAT_T_SOC              0       /* 0%, soc tolerance */
43 #define DSG_VCELL_COMP          -2000   /* vcell compensation for table soc, unit : 0.01mV */
44 #define CHG_VCELL_COMP          -1500   /* vcell compensation for table soc, unit : 0.01mV */
45 #define AVER_SAMPLE_CNT         5
46
47 #define FUELGAUGE_POWER_CHECK_COUNT     20
48 #define SOC_DIFF_CHECK_COUNT    5
49 #define SOC_DIFF_TH     10
50
51 /* parameter for SDI 1750mA 2012.02.17 */
52 #define SDI_1750_RCOMP0                 0x004F
53 #define SDI_1750_TEMPCO                 0x102B
54
55 /* parameter for SDI 2100mA 2012.01.25 */
56 #define SDI_2100_RCOMP0                 0x0065
57 #define SDI_2100_TEMPCO                 0x0930
58
59 enum battery_type {
60         BATTERY_UNKNOWN = 0,
61         BATTERY_SDI_1750,
62         BATTERY_SDI_2100,
63 };
64
65 struct table_soc_data {
66         u32 table_vcell;
67         u32 table_soc;
68         u32 table_slope;
69         u32 table_yaxis;
70 };
71
72 #endif