import PULS_20160108
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / arm / mach-mt8127 / kr076_nand / power / cust_charging.h
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
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 huichen@tcl.com, 05/21/2015, BATTERY Notify PR-1007717*/
18 #define MAX_RAISING_CHARGE_TEMPERATURE 58
19 #define MIN_DROPPING_CHARGE_TEMPERATURE -18
20 /* [PLATFORM]-ADD-END by TCTSZ huichen@tcl.com*/
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 230 //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
36 #define AC_CHARGER_CURRENT CHARGE_CURRENT_1000_00_MA
37 #define NON_STD_AC_CHARGER_CURRENT CHARGE_CURRENT_1000_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 */
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 */
52 #define V_CHARGER_ENABLE 0 // 1:ON , 0:OFF
53 /* [PLATFORM]-MOD-BEGIN by TCTSZ huichen@tcl.com, 05/18/2015, modify OVP function FR-1005346*/
54 //#define V_CHARGER_MAX 6500 // 6.5 V
55 #define V_CHARGER_MAX 6900 // 6.9 V
56 /* [PLATFORM]-MOD-END by TCTSZ huichen@tcl.com, 05/18/2015*/
57 #define V_CHARGER_MIN 4400 // 4.4 V
58
59 /* Tracking TIME */
60 #define ONEHUNDRED_PERCENT_TRACKING_TIME 10 // 10 second
61 #define NPERCENT_TRACKING_TIME 20 // 20 second
62 #define SYNC_TO_REAL_TRACKING_TIME 60 // 60 second
63 #define V_0PERCENT_TRACKING 3400 //3400mV
64
65 /* Battery Notify */
66 #define BATTERY_NOTIFY_CASE_0001_VCHARGER
67 #define BATTERY_NOTIFY_CASE_0002_VBATTEMP
68 //#define BATTERY_NOTIFY_CASE_0003_ICHARGING
69 //#define BATTERY_NOTIFY_CASE_0004_VBAT
70 //#define BATTERY_NOTIFY_CASE_0005_TOTAL_CHARGINGTIME
71
72 /* JEITA parameter */
73 //#define MTK_JEITA_STANDARD_SUPPORT
74 #define CUST_SOC_JEITA_SYNC_TIME 30
75 #define JEITA_RECHARGE_VOLTAGE 4110 // for linear charging
76 #define JEITA_TEMP_ABOVE_POS_60_CV_VOLTAGE BATTERY_VOLT_04_100000_V
77 #define JEITA_TEMP_POS_45_TO_POS_60_CV_VOLTAGE BATTERY_VOLT_04_100000_V
78 #define JEITA_TEMP_POS_10_TO_POS_45_CV_VOLTAGE BATTERY_VOLT_04_200000_V
79 #define JEITA_TEMP_POS_0_TO_POS_10_CV_VOLTAGE BATTERY_VOLT_04_100000_V
80 #define JEITA_TEMP_NEG_10_TO_POS_0_CV_VOLTAGE BATTERY_VOLT_03_900000_V
81 #define JEITA_TEMP_BELOW_NEG_10_CV_VOLTAGE BATTERY_VOLT_03_900000_V
82
83 /* For JEITA Linear Charging only */
84 #define JEITA_NEG_10_TO_POS_0_FULL_CURRENT 120 //mA
85 #define JEITA_TEMP_POS_45_TO_POS_60_RECHARGE_VOLTAGE 4000
86 #define JEITA_TEMP_POS_10_TO_POS_45_RECHARGE_VOLTAGE 4100
87 #define JEITA_TEMP_POS_0_TO_POS_10_RECHARGE_VOLTAGE 4000
88 #define JEITA_TEMP_NEG_10_TO_POS_0_RECHARGE_VOLTAGE 3800
89 #define JEITA_TEMP_POS_45_TO_POS_60_CC2TOPOFF_THRESHOLD 4050
90 #define JEITA_TEMP_POS_10_TO_POS_45_CC2TOPOFF_THRESHOLD 4050
91 #define JEITA_TEMP_POS_0_TO_POS_10_CC2TOPOFF_THRESHOLD 4050
92 #define JEITA_TEMP_NEG_10_TO_POS_0_CC2TOPOFF_THRESHOLD 3850
93
94
95 #ifdef CONFIG_MTK_FAN5405_SUPPORT
96 #define FAN5405_BUSNUM 1
97 #endif
98
99 #ifdef CONFIG_MTK_BQ24158_SUPPORT
100 #define BQ24158_BUSNUM 1
101 #endif
102
103 #ifdef CONFIG_MTK_BQ24296_SUPPORT
104 #define BQ24296_BUSNUM 1
105 #endif
106
107 #ifdef CONFIG_MTK_BQ24297_SUPPORT
108 #define BQ24297_BUSNUM 1
109 #endif
110
111 /* High battery support */
112 //#define HIGH_BATTERY_VOLTAGE_SUPPORT
113
114 /* Disable Battery check for HQA */
115 #ifdef MTK_DISABLE_POWER_ON_OFF_VOLTAGE_LIMITATION
116 #define CONFIG_DIS_CHECK_BATTERY
117 #endif
118
119
120 //#define MTK_WIRELESS_CHARGER_SUPPORT 1
121 /* [PLATFORM]-Add-BEGIN by TCTSZ.leo.guo, 04/15/2015, modify ntc temperature function */
122 #define MTK_BATTERY_PROTECT_FEATURE
123 /* [PLATFORM]-Add-END by TCTSZ.leo.guo */
124 /* Pump Express support (fast charging) */
125 #ifdef CONFIG_MTK_PUMP_EXPRESS_SUPPORT
126 #define TA_START_VCHR_TUNUNG_VOLTAGE 3400
127 #define TA_CHARGING_CURRENT CHARGE_CURRENT_1500_00_MA
128 #undef V_CHARGER_MAX
129 #ifdef TA_9V_SUPPORT
130 #define V_CHARGER_MAX 9500 // 9.5 V
131 #else
132 #define V_CHARGER_MAX 6000 // 6.0 V
133 #endif
134 #endif
135
136 #endif /* _CUST_BAT_H_ */