Merge tag 'v3.10.55' into update
[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 #define ERR_CHARGE_TEMPERATURE 0xFF
18
19 /* Linear Charging Threshold */
20 #define V_PRE2CC_THRES 3400 //mV
21 #define V_CC2TOPOFF_THRES 4050
22 #define RECHARGING_VOLTAGE 4110
23 #define CHARGING_FULL_CURRENT 230 //mA
24
25 /* Charging Current Setting */
26 //#define CONFIG_USB_IF
27 #define USB_CHARGER_CURRENT_SUSPEND 0 // def CONFIG_USB_IF
28 #define USB_CHARGER_CURRENT_UNCONFIGURED CHARGE_CURRENT_70_00_MA // 70mA
29 #define USB_CHARGER_CURRENT_CONFIGURED CHARGE_CURRENT_500_00_MA // 500mA
30
31 #define USB_CHARGER_CURRENT CHARGE_CURRENT_500_00_MA //500mA
32 #define AC_CHARGER_CURRENT CHARGE_CURRENT_1000_00_MA
33 #define NON_STD_AC_CHARGER_CURRENT CHARGE_CURRENT_1000_00_MA
34 #define CHARGING_HOST_CHARGER_CURRENT CHARGE_CURRENT_650_00_MA
35 #define APPLE_0_5A_CHARGER_CURRENT CHARGE_CURRENT_500_00_MA
36 #define APPLE_1_0A_CHARGER_CURRENT CHARGE_CURRENT_650_00_MA
37 #define APPLE_2_1A_CHARGER_CURRENT CHARGE_CURRENT_800_00_MA
38
39
40 /* Precise Tunning */
41 #define BATTERY_AVERAGE_DATA_NUMBER 3
42 #define BATTERY_AVERAGE_SIZE 30
43
44 /* charger error check */
45 /* [PLATFORM]-Add-BEGIN by TCTSZ.leo.guo, 04/15/2015, modify ntc temperature function */
46 #define BAT_LOW_TEMP_PROTECT_ENABLE // stop charging if temp < MIN_CHARGE_TEMPERATURE
47 /* [PLATFORM]-Add-END by TCTSZ.leo.guo */
48 #define V_CHARGER_ENABLE 0 // 1:ON , 0:OFF
49 #define V_CHARGER_MAX 6500 // 6.5 V
50 #define V_CHARGER_MIN 4400 // 4.4 V
51
52 /* Tracking TIME */
53 #define ONEHUNDRED_PERCENT_TRACKING_TIME 10 // 10 second
54 #define NPERCENT_TRACKING_TIME 20 // 20 second
55 #define SYNC_TO_REAL_TRACKING_TIME 60 // 60 second
56 #define V_0PERCENT_TRACKING 3400 //3400mV
57
58 /* Battery Notify */
59 #define BATTERY_NOTIFY_CASE_0001_VCHARGER
60 #define BATTERY_NOTIFY_CASE_0002_VBATTEMP
61 //#define BATTERY_NOTIFY_CASE_0003_ICHARGING
62 //#define BATTERY_NOTIFY_CASE_0004_VBAT
63 //#define BATTERY_NOTIFY_CASE_0005_TOTAL_CHARGINGTIME
64
65 /* JEITA parameter */
66 //#define MTK_JEITA_STANDARD_SUPPORT
67 #define CUST_SOC_JEITA_SYNC_TIME 30
68 #define JEITA_RECHARGE_VOLTAGE 4110 // for linear charging
69 #define JEITA_TEMP_ABOVE_POS_60_CV_VOLTAGE BATTERY_VOLT_04_100000_V
70 #define JEITA_TEMP_POS_45_TO_POS_60_CV_VOLTAGE BATTERY_VOLT_04_100000_V
71 #define JEITA_TEMP_POS_10_TO_POS_45_CV_VOLTAGE BATTERY_VOLT_04_200000_V
72 #define JEITA_TEMP_POS_0_TO_POS_10_CV_VOLTAGE BATTERY_VOLT_04_100000_V
73 #define JEITA_TEMP_NEG_10_TO_POS_0_CV_VOLTAGE BATTERY_VOLT_03_900000_V
74 #define JEITA_TEMP_BELOW_NEG_10_CV_VOLTAGE BATTERY_VOLT_03_900000_V
75
76 /* For JEITA Linear Charging only */
77 #define JEITA_NEG_10_TO_POS_0_FULL_CURRENT 120 //mA
78 #define JEITA_TEMP_POS_45_TO_POS_60_RECHARGE_VOLTAGE 4000
79 #define JEITA_TEMP_POS_10_TO_POS_45_RECHARGE_VOLTAGE 4100
80 #define JEITA_TEMP_POS_0_TO_POS_10_RECHARGE_VOLTAGE 4000
81 #define JEITA_TEMP_NEG_10_TO_POS_0_RECHARGE_VOLTAGE 3800
82 #define JEITA_TEMP_POS_45_TO_POS_60_CC2TOPOFF_THRESHOLD 4050
83 #define JEITA_TEMP_POS_10_TO_POS_45_CC2TOPOFF_THRESHOLD 4050
84 #define JEITA_TEMP_POS_0_TO_POS_10_CC2TOPOFF_THRESHOLD 4050
85 #define JEITA_TEMP_NEG_10_TO_POS_0_CC2TOPOFF_THRESHOLD 3850
86
87
88 #ifdef CONFIG_MTK_FAN5405_SUPPORT
89 #define FAN5405_BUSNUM 1
90 #endif
91
92 #ifdef CONFIG_MTK_BQ24158_SUPPORT
93 #define BQ24158_BUSNUM 1
94 #endif
95
96 #ifdef CONFIG_MTK_BQ24296_SUPPORT
97 #define BQ24296_BUSNUM 1
98 #endif
99
100 #ifdef CONFIG_MTK_BQ24297_SUPPORT
101 #define BQ24297_BUSNUM 1
102 #endif
103
104 /* High battery support */
105 //#define HIGH_BATTERY_VOLTAGE_SUPPORT
106
107 /* Disable Battery check for HQA */
108 #ifdef MTK_DISABLE_POWER_ON_OFF_VOLTAGE_LIMITATION
109 #define CONFIG_DIS_CHECK_BATTERY
110 #endif
111
112
113 //#define MTK_WIRELESS_CHARGER_SUPPORT 1
114 /* [PLATFORM]-Add-BEGIN by TCTSZ.leo.guo, 04/15/2015, modify ntc temperature function */
115 #define MTK_BATTERY_PROTECT_FEATURE
116 /* [PLATFORM]-Add-END by TCTSZ.leo.guo */
117 /* Pump Express support (fast charging) */
118 #ifdef CONFIG_MTK_PUMP_EXPRESS_SUPPORT
119 #define TA_START_VCHR_TUNUNG_VOLTAGE 3400
120 #define TA_CHARGING_CURRENT CHARGE_CURRENT_1500_00_MA
121 #undef V_CHARGER_MAX
122 #ifdef TA_9V_SUPPORT
123 #define V_CHARGER_MAX 9500 // 9.5 V
124 #else
125 #define V_CHARGER_MAX 6000 // 6.0 V
126 #endif
127 #endif
128
129 #endif /* _CUST_BAT_H_ */