import PULS_20180308
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / arm / mach-mt8127 / ttab / power / cust_charging.h
CommitLineData
6fa3eb70
S
1#ifndef _CUST_BAT_H_
2#define _CUST_BAT_H_
3
4/* stop charging while in talking mode */
5#define STOP_CHARGING_IN_TAKLING
6#define TALKING_RECHARGE_VOLTAGE 3800
7#define TALKING_SYNC_TIME 60
8
9/* Battery Temperature Protection */
10#define MTK_TEMPERATURE_RECHARGE_SUPPORT
4b9e9796
S
11#define MAX_CHARGE_TEMPERATURE 55
12#define MAX_CHARGE_TEMPERATURE_MINUS_X_DEGREE 50 //47 Fixed to 50 degree for according to standard
13#define MIN_CHARGE_TEMPERATURE 2
14#define MIN_CHARGE_TEMPERATURE_PLUS_X_DEGREE 4 //6 Fixed to 2 degree accoding to TCL standard
15#define MAX_LIMIT_CHARGE_TEMPERATURE 45
16#define MIN_LIMIT_CHARGE_TEMPERATURE 43
17/* [PLATFORM]-ADD-BEGIN by TCTSZ leo.guo, 06/09/2015, BATTERY Notify for NTC*/
18#define MAX_RAISING_CHARGE_TEMPERATURE 58
19#define MIN_DROPPING_CHARGE_TEMPERATURE -18
20/* [PLATFORM]-ADD-END by TCTSZ leo.guo*/
6fa3eb70
S
21#define ERR_CHARGE_TEMPERATURE 0xFF
22
23/* Linear Charging Threshold */
24#define V_PRE2CC_THRES 3400 //mV
25#define V_CC2TOPOFF_THRES 4050
26#define RECHARGING_VOLTAGE 4110
27#define CHARGING_FULL_CURRENT 150 //mA
28
29/* Charging Current Setting */
30//#define CONFIG_USB_IF
31#define USB_CHARGER_CURRENT_SUSPEND 0 // def CONFIG_USB_IF
32#define USB_CHARGER_CURRENT_UNCONFIGURED CHARGE_CURRENT_70_00_MA // 70mA
33#define USB_CHARGER_CURRENT_CONFIGURED CHARGE_CURRENT_500_00_MA // 500mA
34
35#define USB_CHARGER_CURRENT CHARGE_CURRENT_500_00_MA //500mA
4b9e9796 36#define AC_CHARGER_CURRENT CHARGE_CURRENT_1200_00_MA
6fa3eb70
S
37#define NON_STD_AC_CHARGER_CURRENT CHARGE_CURRENT_500_00_MA
38#define CHARGING_HOST_CHARGER_CURRENT CHARGE_CURRENT_650_00_MA
39#define APPLE_0_5A_CHARGER_CURRENT CHARGE_CURRENT_500_00_MA
40#define APPLE_1_0A_CHARGER_CURRENT CHARGE_CURRENT_650_00_MA
41#define APPLE_2_1A_CHARGER_CURRENT CHARGE_CURRENT_800_00_MA
42
43
44/* Precise Tunning */
45#define BATTERY_AVERAGE_DATA_NUMBER 3
46#define BATTERY_AVERAGE_SIZE 30
47
48/* charger error check */
4b9e9796
S
49/* [PLATFORM]-Add-BEGIN by TCTSZ.leo.guo, 04/15/2015, modify ntc temperature function */
50#define BAT_LOW_TEMP_PROTECT_ENABLE // stop charging if temp < MIN_CHARGE_TEMPERATURE
51/* [PLATFORM]-Add-END by TCTSZ.leo.guo */
6fa3eb70
S
52#define V_CHARGER_ENABLE 0 // 1:ON , 0:OFF
53#define V_CHARGER_MAX 6500 // 6.5 V
54#define V_CHARGER_MIN 4400 // 4.4 V
55
56/* Tracking TIME */
57#define ONEHUNDRED_PERCENT_TRACKING_TIME 10 // 10 second
58#define NPERCENT_TRACKING_TIME 20 // 20 second
59#define SYNC_TO_REAL_TRACKING_TIME 60 // 60 second
60#define V_0PERCENT_TRACKING 3400 //3400mV
61
62/* Battery Notify */
63#define BATTERY_NOTIFY_CASE_0001_VCHARGER
64#define BATTERY_NOTIFY_CASE_0002_VBATTEMP
65//#define BATTERY_NOTIFY_CASE_0003_ICHARGING
66//#define BATTERY_NOTIFY_CASE_0004_VBAT
67//#define BATTERY_NOTIFY_CASE_0005_TOTAL_CHARGINGTIME
68
69/* JEITA parameter */
70//#define MTK_JEITA_STANDARD_SUPPORT
71#define CUST_SOC_JEITA_SYNC_TIME 30
72#define JEITA_RECHARGE_VOLTAGE 4110 // for linear charging
73#define JEITA_TEMP_ABOVE_POS_60_CV_VOLTAGE BATTERY_VOLT_04_100000_V
74#define JEITA_TEMP_POS_45_TO_POS_60_CV_VOLTAGE BATTERY_VOLT_04_100000_V
75#define JEITA_TEMP_POS_10_TO_POS_45_CV_VOLTAGE BATTERY_VOLT_04_200000_V
76#define JEITA_TEMP_POS_0_TO_POS_10_CV_VOLTAGE BATTERY_VOLT_04_100000_V
77#define JEITA_TEMP_NEG_10_TO_POS_0_CV_VOLTAGE BATTERY_VOLT_03_900000_V
78#define JEITA_TEMP_BELOW_NEG_10_CV_VOLTAGE BATTERY_VOLT_03_900000_V
79
80/* For JEITA Linear Charging only */
81#define JEITA_NEG_10_TO_POS_0_FULL_CURRENT 120 //mA
82#define JEITA_TEMP_POS_45_TO_POS_60_RECHARGE_VOLTAGE 4000
83#define JEITA_TEMP_POS_10_TO_POS_45_RECHARGE_VOLTAGE 4100
84#define JEITA_TEMP_POS_0_TO_POS_10_RECHARGE_VOLTAGE 4000
85#define JEITA_TEMP_NEG_10_TO_POS_0_RECHARGE_VOLTAGE 3800
86#define JEITA_TEMP_POS_45_TO_POS_60_CC2TOPOFF_THRESHOLD 4050
87#define JEITA_TEMP_POS_10_TO_POS_45_CC2TOPOFF_THRESHOLD 4050
88#define JEITA_TEMP_POS_0_TO_POS_10_CC2TOPOFF_THRESHOLD 4050
89#define JEITA_TEMP_NEG_10_TO_POS_0_CC2TOPOFF_THRESHOLD 3850
90
91
92#ifdef CONFIG_MTK_FAN5405_SUPPORT
93#define FAN5405_BUSNUM 1
94#endif
95
96#ifdef CONFIG_MTK_BQ24158_SUPPORT
97#define BQ24158_BUSNUM 1
98#endif
99
100#ifdef CONFIG_MTK_BQ24296_SUPPORT
101#define BQ24296_BUSNUM 1
102#endif
103
104#ifdef CONFIG_MTK_BQ24297_SUPPORT
105#define BQ24297_BUSNUM 1
106#endif
107
108/* High battery support */
4b9e9796 109#define HIGH_BATTERY_VOLTAGE_SUPPORT
6fa3eb70
S
110
111/* Disable Battery check for HQA */
112#ifdef MTK_DISABLE_POWER_ON_OFF_VOLTAGE_LIMITATION
113#define CONFIG_DIS_CHECK_BATTERY
114#endif
115
116
117//#define MTK_WIRELESS_CHARGER_SUPPORT 1
4b9e9796
S
118/* [PLATFORM]-Add-BEGIN by TCTSZ.leo.guo, 04/15/2015, modify ntc temperature function */
119#define MTK_BATTERY_PROTECT_FEATURE
120/* [PLATFORM]-Add-END by TCTSZ.leo.guo */
6fa3eb70
S
121/* Pump Express support (fast charging) */
122#ifdef CONFIG_MTK_PUMP_EXPRESS_SUPPORT
123#define TA_START_VCHR_TUNUNG_VOLTAGE 3400
124#define TA_CHARGING_CURRENT CHARGE_CURRENT_1500_00_MA
125#undef V_CHARGER_MAX
126#ifdef TA_9V_SUPPORT
127#define V_CHARGER_MAX 9500 // 9.5 V
128#else
129#define V_CHARGER_MAX 6000 // 6.0 V
130#endif
131#endif
132
133#endif /* _CUST_BAT_H_ */