mt_battery_custom_data.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. #ifndef _BATTERY_CUSTOM_DATA_H
  2. #define _BATTERY_CUSTOM_DATA_H
  3. #include <linux/device.h>
  4. struct BATTERY_PROFILE_STRUCT {
  5. s32 percentage;
  6. s32 voltage;
  7. };
  8. struct R_PROFILE_STRUCT {
  9. s32 resistance; /* Ohm */
  10. s32 voltage;
  11. };
  12. struct BATTERY_CYCLE_STRUCT {
  13. s32 cycle;
  14. s32 aging_factor;
  15. };
  16. struct BATT_TEMPERATURE {
  17. s32 BatteryTemp;
  18. s32 TemperatureR;
  19. };
  20. struct mt_battery_meter_custom_data {
  21. /* ADC Channel Number */
  22. int cust_tabt_number;
  23. int vbat_channel_number;
  24. int isense_channel_number;
  25. int vcharger_channel_number;
  26. int vbattemp_channel_number;
  27. /*ADC resistor */
  28. int r_bat_sense;
  29. int r_i_sense;
  30. int r_charger_1;
  31. int r_charger_2;
  32. int temperature_t0;
  33. int tempearture_t1;
  34. int temperature_t2;
  35. int temperature_t3;
  36. int temperature_t;
  37. int fg_meter_resistance;
  38. int q_max_pos_50;
  39. int q_max_pos_25;
  40. int q_max_pos_0;
  41. int q_max_neg_10;
  42. int q_max_pos_50_h_current;
  43. int q_max_pos_25_h_current;
  44. int q_max_pos_0_h_current;
  45. int q_max_neg_10_h_current;
  46. /* Discharge Percentage */
  47. int oam_d5;
  48. int cust_tracking_point;
  49. int cust_r_sense;
  50. int cust_hw_cc;
  51. int aging_tuning_value;
  52. int cust_r_fg_offset;
  53. int ocv_board_compesate; /* mV */
  54. int r_fg_board_base;
  55. int r_fg_board_slope;
  56. int car_tune_value;
  57. /* HW Fuel gague */
  58. int current_detect_r_fg;
  59. int min_error_offset;
  60. int fg_vbat_average_size;
  61. int r_fg_value;
  62. int poweron_delta_capacity_tolerance;
  63. int poweron_low_capacity_tolerance;
  64. int poweron_max_vbat_tolerance;
  65. int poweron_delta_vbat_tolerance;
  66. int vbat_normal_wakeup;
  67. int vbat_low_power_wakeup;
  68. int normal_wakeup_period;
  69. int low_power_wakeup_period;
  70. int close_poweroff_wakeup_period;
  71. /* meter table */
  72. int rbat_pull_up_r;
  73. int rbat_pull_down_r;
  74. int rbat_pull_up_volt;
  75. int battery_profile_saddles;
  76. int battery_r_profile_saddles;
  77. int battery_aging_table_saddles;
  78. int battery_ntc_table_saddles;
  79. void *p_batt_temperature_table;
  80. void *p_battery_profile_t0;
  81. void *p_battery_profile_t1;
  82. void *p_battery_profile_t2;
  83. void *p_battery_profile_t3;
  84. void *p_r_profile_t0;
  85. void *p_r_profile_t1;
  86. void *p_r_profile_t2;
  87. void *p_r_profile_t3;
  88. void *p_battery_profile_temperature;
  89. void *p_r_profile_temperature;
  90. void *p_battery_aging_table;
  91. };
  92. struct mt_battery_charging_custom_data {
  93. int talking_recharge_voltage;
  94. int talking_sync_time;
  95. /* Battery Temperature Protection */
  96. int max_discharge_temperature;
  97. int min_discharge_temperature;
  98. int max_charge_temperature;
  99. int min_charge_temperature;
  100. int err_charge_temperature;
  101. int use_avg_temperature;
  102. /* Linear Charging Threshold */
  103. int v_pre2cc_thres;
  104. int v_cc2topoff_thres;
  105. int recharging_voltage;
  106. int charging_full_current;
  107. /* CONFIG_USB_IF */
  108. int usb_charger_current_suspend;
  109. int usb_charger_current_unconfigured;
  110. int usb_charger_current_configured;
  111. int usb_charger_current;
  112. int ac_charger_current;
  113. int non_std_ac_charger_current;
  114. int charging_host_charger_current;
  115. int apple_0_5a_charger_current;
  116. int apple_1_0a_charger_current;
  117. int apple_2_1a_charger_current;
  118. /* Charger error check */
  119. /* BAT_LOW_TEMP_PROTECT_ENABLE */
  120. int v_charger_enable;
  121. int v_charger_max;
  122. int v_charger_min;
  123. /* Tracking time */
  124. int onehundred_percent_tracking_time;
  125. int npercent_tracking_time;
  126. int sync_to_real_tracking_time;
  127. /* JEITA parameter */
  128. int cust_soc_jeita_sync_time;
  129. int jeita_recharge_voltage;
  130. int jeita_temp_above_pos_60_cv_voltage;
  131. int jeita_temp_pos_45_to_pos_60_cv_voltage;
  132. int jeita_temp_pos_10_to_pos_45_cv_voltage;
  133. int jeita_temp_pos_0_to_pos_10_cv_voltage;
  134. int jeita_temp_neg_10_to_pos_0_cv_voltage;
  135. int jeita_temp_below_neg_10_cv_voltage;
  136. int temp_pos_60_threshold;
  137. int temp_pos_60_thres_minus_x_degree;
  138. int temp_pos_45_threshold;
  139. int temp_pos_45_thres_minus_x_degree;
  140. int temp_pos_10_threshold;
  141. int temp_pos_10_thres_plus_x_degree;
  142. int temp_pos_0_threshold;
  143. int temp_pos_0_thres_plus_x_degree;
  144. int temp_neg_10_threshold;
  145. int temp_neg_10_thres_plus_x_degree;
  146. /* For JEITA Linear Charging Only */
  147. int jeita_neg_10_to_pos_0_full_current;
  148. int jeita_temp_pos_45_to_pos_60_recharge_voltage;
  149. int jeita_temp_pos_10_to_pos_45_recharge_voltage;
  150. int jeita_temp_pos_0_to_pos_10_recharge_voltage;
  151. int jeita_temp_neg_10_to_pos_0_recharge_voltage;
  152. int jeita_temp_pos_45_to_pos_60_cc2topoff_threshold;
  153. int jeita_temp_pos_10_to_pos_45_cc2topoff_threshold;
  154. int jeita_temp_pos_0_to_pos_10_cc2topoff_threshold;
  155. int jeita_temp_neg_10_to_pos_0_cc2topoff_threshold;
  156. /* For charger IC GPIO config */
  157. int charger_enable_pin;
  158. int charger_otg_pin;
  159. /* for Pump Expresss Plus */
  160. int ta_start_battery_soc;
  161. int ta_stop_battery_soc;
  162. int ta_ac_9v_input_current;
  163. int ta_ac_7v_input_current;
  164. int ta_ac_charging_current;
  165. int ta_9v_support;
  166. };
  167. extern int mt_bm_of_probe(struct device *dev, struct mt_battery_meter_custom_data **p_meter_data);
  168. #endif /* #ifndef _BATTERY_CUSTOM_DATA_H */