1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef _AB8500_CHARGER_H_
4 #define _AB8500_CHARGER_H_
6 #include <linux/kernel.h>
9 * System control 2 register offsets.
12 #define AB8500_MAIN_WDOG_CTRL_REG 0x01
13 #define AB8500_LOW_BAT_REG 0x03
14 #define AB8500_BATT_OK_REG 0x04
16 * USB/ULPI register offsets
19 #define AB8500_USB_LINE_STAT_REG 0x80
20 #define AB8500_USB_LINE_CTRL2_REG 0x82
21 #define AB8500_USB_LINK1_STAT_REG 0x94
24 * Charger / status register offfsets
27 #define AB8500_CH_STATUS1_REG 0x00
28 #define AB8500_CH_STATUS2_REG 0x01
29 #define AB8500_CH_USBCH_STAT1_REG 0x02
30 #define AB8500_CH_USBCH_STAT2_REG 0x03
31 #define AB8540_CH_USBCH_STAT3_REG 0x04
32 #define AB8500_CH_STAT_REG 0x05
35 * Charger / control register offfsets
38 #define AB8500_CH_VOLT_LVL_REG 0x40
39 #define AB8500_CH_VOLT_LVL_MAX_REG 0x41 /*Only in Cut2.0*/
40 #define AB8500_CH_OPT_CRNTLVL_REG 0x42
41 #define AB8500_CH_OPT_CRNTLVL_MAX_REG 0x43 /*Only in Cut2.0*/
42 #define AB8500_CH_WD_TIMER_REG 0x50
43 #define AB8500_CHARG_WD_CTRL 0x51
44 #define AB8500_BTEMP_HIGH_TH 0x52
45 #define AB8500_LED_INDICATOR_PWM_CTRL 0x53
46 #define AB8500_LED_INDICATOR_PWM_DUTY 0x54
47 #define AB8500_BATT_OVV 0x55
48 #define AB8500_CHARGER_CTRL 0x56
49 #define AB8500_BAT_CTRL_CURRENT_SOURCE 0x60 /*Only in Cut2.0*/
52 * Charger / main control register offsets
55 #define AB8500_MCH_CTRL1 0x80
56 #define AB8500_MCH_CTRL2 0x81
57 #define AB8500_MCH_IPT_CURLVL_REG 0x82
58 #define AB8500_CH_WD_REG 0x83
61 * Charger / USB control register offsets
64 #define AB8500_USBCH_CTRL1_REG 0xC0
65 #define AB8500_USBCH_CTRL2_REG 0xC1
66 #define AB8500_USBCH_IPT_CRNTLVL_REG 0xC2
67 #define AB8540_USB_PP_MODE_REG 0xC5
68 #define AB8540_USB_PP_CHR_REG 0xC6
71 * Gas Gauge register offsets
74 #define AB8500_GASG_CC_CTRL_REG 0x00
75 #define AB8500_GASG_CC_ACCU1_REG 0x01
76 #define AB8500_GASG_CC_ACCU2_REG 0x02
77 #define AB8500_GASG_CC_ACCU3_REG 0x03
78 #define AB8500_GASG_CC_ACCU4_REG 0x04
79 #define AB8500_GASG_CC_SMPL_CNTRL_REG 0x05
80 #define AB8500_GASG_CC_SMPL_CNTRH_REG 0x06
81 #define AB8500_GASG_CC_SMPL_CNVL_REG 0x07
82 #define AB8500_GASG_CC_SMPL_CNVH_REG 0x08
83 #define AB8500_GASG_CC_CNTR_AVGOFF_REG 0x09
84 #define AB8500_GASG_CC_OFFSET_REG 0x0A
85 #define AB8500_GASG_CC_NCOV_ACCU 0x10
86 #define AB8500_GASG_CC_NCOV_ACCU_CTRL 0x11
87 #define AB8500_GASG_CC_NCOV_ACCU_LOW 0x12
88 #define AB8500_GASG_CC_NCOV_ACCU_MED 0x13
89 #define AB8500_GASG_CC_NCOV_ACCU_HIGH 0x14
92 * Interrupt register offsets
95 #define AB8500_IT_SOURCE2_REG 0x01
96 #define AB8500_IT_SOURCE21_REG 0x14
99 * RTC register offsets
102 #define AB8500_RTC_BACKUP_CHG_REG 0x0C
103 #define AB8500_RTC_CC_CONF_REG 0x01
104 #define AB8500_RTC_CTRL_REG 0x0B
105 #define AB8500_RTC_CTRL1_REG 0x11
108 * OTP register offsets
111 #define AB8500_OTP_CONF_15 0x0E
113 /* GPADC constants from AB8500 spec, UM0836 */
114 #define ADC_RESOLUTION 1024
115 #define ADC_CH_MAIN_MIN 0
116 #define ADC_CH_MAIN_MAX 20030
117 #define ADC_CH_VBUS_MIN 0
118 #define ADC_CH_VBUS_MAX 20030
119 #define ADC_CH_VBAT_MIN 2300
120 #define ADC_CH_VBAT_MAX 4800
121 #define ADC_CH_BKBAT_MIN 0
122 #define ADC_CH_BKBAT_MAX 3200
124 /* Main charge i/p current */
125 #define MAIN_CH_IP_CUR_0P9A 0x80
126 #define MAIN_CH_IP_CUR_1P0A 0x90
127 #define MAIN_CH_IP_CUR_1P1A 0xA0
128 #define MAIN_CH_IP_CUR_1P2A 0xB0
129 #define MAIN_CH_IP_CUR_1P3A 0xC0
130 #define MAIN_CH_IP_CUR_1P4A 0xD0
131 #define MAIN_CH_IP_CUR_1P5A 0xE0
134 #define CH_VOL_LVL_3P5 0x00
135 #define CH_VOL_LVL_4P0 0x14
136 #define CH_VOL_LVL_4P05 0x16
137 #define CH_VOL_LVL_4P1 0x1B
138 #define CH_VOL_LVL_4P15 0x20
139 #define CH_VOL_LVL_4P2 0x25
140 #define CH_VOL_LVL_4P6 0x4D
142 /* ChOutputCurrentLevel */
143 #define CH_OP_CUR_LVL_0P1 0x00
144 #define CH_OP_CUR_LVL_0P2 0x01
145 #define CH_OP_CUR_LVL_0P3 0x02
146 #define CH_OP_CUR_LVL_0P4 0x03
147 #define CH_OP_CUR_LVL_0P5 0x04
148 #define CH_OP_CUR_LVL_0P6 0x05
149 #define CH_OP_CUR_LVL_0P7 0x06
150 #define CH_OP_CUR_LVL_0P8 0x07
151 #define CH_OP_CUR_LVL_0P9 0x08
152 #define CH_OP_CUR_LVL_1P4 0x0D
153 #define CH_OP_CUR_LVL_1P5 0x0E
154 #define CH_OP_CUR_LVL_1P6 0x0F
155 #define CH_OP_CUR_LVL_2P 0x3F
157 /* BTEMP High thermal limits */
158 #define BTEMP_HIGH_TH_57_0 0x00
159 #define BTEMP_HIGH_TH_52 0x01
160 #define BTEMP_HIGH_TH_57_1 0x02
161 #define BTEMP_HIGH_TH_62 0x03
170 #define LOW_BAT_3P1V 0x20
171 #define LOW_BAT_2P3V 0x00
172 #define LOW_BAT_RESET 0x01
173 #define LOW_BAT_ENABLE 0x01
175 /* Backup battery constants */
176 #define BUP_ICH_SEL_50UA 0x00
177 #define BUP_ICH_SEL_150UA 0x04
178 #define BUP_ICH_SEL_300UA 0x08
179 #define BUP_ICH_SEL_700UA 0x0C
187 * Note that the following 5 values 2.7v, 2.9v, 3.0v, 3.2v, 3.3v
188 * are only available on ab8540. You can't choose these 5
189 * voltage on ab8500/ab8505/ab9540.
198 #define BUP_VCH_RANGE 0x02
199 #define VBUP33_VRTCN 0x01
201 /* Battery OVV constants */
202 #define BATT_OVV_ENA 0x02
203 #define BATT_OVV_TH_3P7 0x00
204 #define BATT_OVV_TH_4P75 0x01
206 /* A value to indicate over voltage */
207 #define BATT_OVV_VALUE 4750
209 /* VBUS OVV constants */
210 #define VBUS_OVV_SELECT_MASK 0x78
211 #define VBUS_OVV_SELECT_5P6V 0x00
212 #define VBUS_OVV_SELECT_5P7V 0x08
213 #define VBUS_OVV_SELECT_5P8V 0x10
214 #define VBUS_OVV_SELECT_5P9V 0x18
215 #define VBUS_OVV_SELECT_6P0V 0x20
216 #define VBUS_OVV_SELECT_6P1V 0x28
217 #define VBUS_OVV_SELECT_6P2V 0x30
218 #define VBUS_OVV_SELECT_6P3V 0x38
220 #define VBUS_AUTO_IN_CURR_LIM_ENA 0x04
222 /* Fuel Gauge constants */
223 #define RESET_ACCU 0x02
224 #define READ_REQ 0x01
225 #define CC_DEEP_SLEEP_ENA 0x02
226 #define CC_PWR_UP_ENA 0x01
227 #define CC_SAMPLES_40 0x28
228 #define RD_NCONV_ACCU_REQ 0x01
229 #define CC_CALIB 0x08
230 #define CC_INTAVGOFFSET_ENA 0x10
231 #define CC_MUXOFFSET 0x80
232 #define CC_INT_CAL_N_AVG_MASK 0x60
233 #define CC_INT_CAL_SAMPLES_16 0x40
234 #define CC_INT_CAL_SAMPLES_8 0x20
235 #define CC_INT_CAL_SAMPLES_4 0x00
238 #define RTC_BUP_CH_ENA 0x10
240 /* BatCtrl Current Source Constants */
241 #define BAT_CTRL_7U_ENA 0x01
242 #define BAT_CTRL_20U_ENA 0x02
243 #define BAT_CTRL_18U_ENA 0x01
244 #define BAT_CTRL_16U_ENA 0x02
245 #define BAT_CTRL_CMP_ENA 0x04
246 #define FORCE_BAT_CTRL_CMP_HIGH 0x08
247 #define BAT_CTRL_PULL_UP_ENA 0x10
250 #define BATTERY_UNKNOWN 00
252 /* Registers for pcut feature in ab8505 and ab9540 */
253 #define AB8505_RTC_PCUT_CTL_STATUS_REG 0x12
254 #define AB8505_RTC_PCUT_TIME_REG 0x13
255 #define AB8505_RTC_PCUT_MAX_TIME_REG 0x14
256 #define AB8505_RTC_PCUT_FLAG_TIME_REG 0x15
257 #define AB8505_RTC_PCUT_RESTART_REG 0x16
258 #define AB8505_RTC_PCUT_DEBOUNCE_REG 0x17
260 /* USB Power Path constants for ab8540 */
261 #define BUS_VSYS_VOL_SELECT_MASK 0x06
262 #define BUS_VSYS_VOL_SELECT_3P6V 0x00
263 #define BUS_VSYS_VOL_SELECT_3P325V 0x02
264 #define BUS_VSYS_VOL_SELECT_3P9V 0x04
265 #define BUS_VSYS_VOL_SELECT_4P3V 0x06
266 #define BUS_POWER_PATH_MODE_ENA 0x01
267 #define BUS_PP_PRECHG_CURRENT_MASK 0x0E
268 #define BUS_POWER_PATH_PRECHG_ENA 0x01
271 * ADC for the battery thermistor.
272 * When using the ABx500_ADC_THERM_BATCTRL the battery ID resistor is combined
273 * with a NTC resistor to both identify the battery and to measure its
274 * temperature. Different phone manufactures uses different techniques to both
275 * identify the battery and to read its temperature.
277 enum abx500_adc_therm {
278 ABx500_ADC_THERM_BATCTRL,
279 ABx500_ADC_THERM_BATTEMP,
283 * struct abx500_res_to_temp - defines one point in a temp to res curve. To
284 * be used in battery packs that combines the identification resistor with a
286 * @temp: battery pack temperature in Celsius
287 * @resist: NTC resistor net total resistance
289 struct abx500_res_to_temp {
295 * struct abx500_v_to_cap - Table for translating voltage to capacity
296 * @voltage: Voltage in mV
297 * @capacity: Capacity in percent
299 struct abx500_v_to_cap {
304 /* Forward declaration */
308 * struct abx500_fg_parameters - Fuel gauge algorithm parameters, in seconds
310 * @recovery_sleep_timer: Time between measurements while recovering
311 * @recovery_total_time: Total recovery time
312 * @init_timer: Measurement interval during startup
313 * @init_discard_time: Time we discard voltage measurement at startup
314 * @init_total_time: Total init time during startup
315 * @high_curr_time: Time current has to be high to go to recovery
316 * @accu_charging: FG accumulation time while charging
317 * @accu_high_curr: FG accumulation time in high current mode
318 * @high_curr_threshold: High current threshold, in mA
319 * @lowbat_threshold: Low battery threshold, in mV
320 * @overbat_threshold: Over battery threshold, in mV
321 * @battok_falling_th_sel0 Threshold in mV for battOk signal sel0
322 * Resolution in 50 mV step.
323 * @battok_raising_th_sel1 Threshold in mV for battOk signal sel1
324 * Resolution in 50 mV step.
325 * @user_cap_limit Capacity reported from user must be within this
326 * limit to be considered as sane, in percentage
328 * @maint_thres This is the threshold where we stop reporting
329 * battery full while in maintenance, in per cent
330 * @pcut_enable: Enable power cut feature in ab8505
331 * @pcut_max_time: Max time threshold
332 * @pcut_flag_time: Flagtime threshold
333 * @pcut_max_restart: Max number of restarts
334 * @pcut_debounce_time: Sets battery debounce time
336 struct abx500_fg_parameters {
337 int recovery_sleep_timer;
338 int recovery_total_time;
340 int init_discard_time;
345 int high_curr_threshold;
346 int lowbat_threshold;
347 int overbat_threshold;
348 int battok_falling_th_sel0;
349 int battok_raising_th_sel1;
356 u8 pcut_debounce_time;
360 * struct abx500_charger_maximization - struct used by the board config.
361 * @use_maxi: Enable maximization for this battery type
362 * @maxi_chg_curr: Maximum charger current allowed
363 * @maxi_wait_cycles: cycles to wait before setting charger current
364 * @charger_curr_step delta between two charger current settings (mA)
366 struct abx500_maxim_parameters {
370 int charger_curr_step;
374 * struct abx500_battery_type - different batteries supported
375 * @name: battery technology
376 * @resis_high: battery upper resistance limit
377 * @resis_low: battery lower resistance limit
378 * @charge_full_design: Maximum battery capacity in mAh
379 * @nominal_voltage: Nominal voltage of the battery in mV
380 * @termination_vol: max voltage upto which battery can be charged
381 * @termination_curr battery charging termination current in mA
382 * @recharge_cap battery capacity limit that will trigger a new
383 * full charging cycle in the case where maintenan-
384 * -ce charging has been disabled
385 * @normal_cur_lvl: charger current in normal state in mA
386 * @normal_vol_lvl: charger voltage in normal state in mV
387 * @maint_a_cur_lvl: charger current in maintenance A state in mA
388 * @maint_a_vol_lvl: charger voltage in maintenance A state in mV
389 * @maint_a_chg_timer_h: charge time in maintenance A state
390 * @maint_b_cur_lvl: charger current in maintenance B state in mA
391 * @maint_b_vol_lvl: charger voltage in maintenance B state in mV
392 * @maint_b_chg_timer_h: charge time in maintenance B state
393 * @low_high_cur_lvl: charger current in temp low/high state in mA
394 * @low_high_vol_lvl: charger voltage in temp low/high state in mV'
395 * @battery_resistance: battery inner resistance in mOhm.
396 * @n_r_t_tbl_elements: number of elements in r_to_t_tbl
397 * @r_to_t_tbl: table containing resistance to temp points
398 * @n_v_cap_tbl_elements: number of elements in v_to_cap_tbl
399 * @v_to_cap_tbl: Voltage to capacity (in %) table
400 * @n_batres_tbl_elements number of elements in the batres_tbl
401 * @batres_tbl battery internal resistance vs temperature table
403 struct abx500_battery_type {
407 int charge_full_design;
410 int termination_curr;
416 int maint_a_chg_timer_h;
419 int maint_b_chg_timer_h;
420 int low_high_cur_lvl;
421 int low_high_vol_lvl;
422 int battery_resistance;
423 int n_temp_tbl_elements;
424 const struct abx500_res_to_temp *r_to_t_tbl;
425 int n_v_cap_tbl_elements;
426 const struct abx500_v_to_cap *v_to_cap_tbl;
427 int n_batres_tbl_elements;
428 const struct batres_vs_temp *batres_tbl;
432 * struct abx500_bm_capacity_levels - abx500 capacity level data
433 * @critical: critical capacity level in percent
434 * @low: low capacity level in percent
435 * @normal: normal capacity level in percent
436 * @high: high capacity level in percent
437 * @full: full capacity level in percent
439 struct abx500_bm_capacity_levels {
448 * struct abx500_bm_charger_parameters - Charger specific parameters
449 * @usb_volt_max: maximum allowed USB charger voltage in mV
450 * @usb_curr_max: maximum allowed USB charger current in mA
451 * @ac_volt_max: maximum allowed AC charger voltage in mV
452 * @ac_curr_max: maximum allowed AC charger current in mA
454 struct abx500_bm_charger_parameters {
462 * struct abx500_bm_data - abx500 battery management data
463 * @temp_under under this temp, charging is stopped
464 * @temp_low between this temp and temp_under charging is reduced
465 * @temp_high between this temp and temp_over charging is reduced
466 * @temp_over over this temp, charging is stopped
467 * @temp_now present battery temperature
468 * @temp_interval_chg temperature measurement interval in s when charging
469 * @temp_interval_nochg temperature measurement interval in s when not charging
470 * @main_safety_tmr_h safety timer for main charger
471 * @usb_safety_tmr_h safety timer for usb charger
472 * @bkup_bat_v voltage which we charge the backup battery with
473 * @bkup_bat_i current which we charge the backup battery with
474 * @no_maintenance indicates that maintenance charging is disabled
475 * @capacity_scaling indicates whether capacity scaling is to be used
476 * @abx500_adc_therm placement of thermistor, batctrl or battemp adc
477 * @chg_unknown_bat flag to enable charging of unknown batteries
478 * @enable_overshoot flag to enable VBAT overshoot control
479 * @auto_trig flag to enable auto adc trigger
480 * @fg_res resistance of FG resistor in 0.1mOhm
481 * @n_btypes number of elements in array bat_type
482 * @batt_id index of the identified battery in array bat_type
483 * @interval_charging charge alg cycle period time when charging (sec)
484 * @interval_not_charging charge alg cycle period time when not charging (sec)
485 * @temp_hysteresis temperature hysteresis
486 * @gnd_lift_resistance Battery ground to phone ground resistance (mOhm)
487 * @n_chg_out_curr number of elements in array chg_output_curr
488 * @n_chg_in_curr number of elements in array chg_input_curr
489 * @chg_output_curr charger output current level map
490 * @chg_input_curr charger input current level map
491 * @maxi maximization parameters
492 * @cap_levels capacity in percent for the different capacity levels
493 * @bat_type table of supported battery types
494 * @chg_params charger parameters
495 * @fg_params fuel gauge parameters
497 struct abx500_bm_data {
503 int temp_interval_chg;
504 int temp_interval_nochg;
505 int main_safety_tmr_h;
506 int usb_safety_tmr_h;
510 bool capacity_scaling;
511 bool chg_unknown_bat;
512 bool enable_overshoot;
514 enum abx500_adc_therm adc_therm;
518 int interval_charging;
519 int interval_not_charging;
521 int gnd_lift_resistance;
524 int *chg_output_curr;
526 const struct abx500_maxim_parameters *maxi;
527 const struct abx500_bm_capacity_levels *cap_levels;
528 struct abx500_battery_type *bat_type;
529 const struct abx500_bm_charger_parameters *chg_params;
530 const struct abx500_fg_parameters *fg_params;
539 * struct res_to_temp - defines one point in a temp to res curve. To
540 * be used in battery packs that combines the identification resistor with a
542 * @temp: battery pack temperature in Celsius
543 * @resist: NTC resistor net total resistance
551 * struct batres_vs_temp - defines one point in a temp vs battery internal
553 * @temp: battery pack temperature in Celsius
554 * @resist: battery internal reistance in mOhm
556 struct batres_vs_temp {
561 /* Forward declaration */
565 * struct ab8500_fg_parameters - Fuel gauge algorithm parameters, in seconds
567 * @recovery_sleep_timer: Time between measurements while recovering
568 * @recovery_total_time: Total recovery time
569 * @init_timer: Measurement interval during startup
570 * @init_discard_time: Time we discard voltage measurement at startup
571 * @init_total_time: Total init time during startup
572 * @high_curr_time: Time current has to be high to go to recovery
573 * @accu_charging: FG accumulation time while charging
574 * @accu_high_curr: FG accumulation time in high current mode
575 * @high_curr_threshold: High current threshold, in mA
576 * @lowbat_threshold: Low battery threshold, in mV
577 * @battok_falling_th_sel0 Threshold in mV for battOk signal sel0
578 * Resolution in 50 mV step.
579 * @battok_raising_th_sel1 Threshold in mV for battOk signal sel1
580 * Resolution in 50 mV step.
581 * @user_cap_limit Capacity reported from user must be within this
582 * limit to be considered as sane, in percentage
584 * @maint_thres This is the threshold where we stop reporting
585 * battery full while in maintenance, in per cent
586 * @pcut_enable: Enable power cut feature in ab8505
587 * @pcut_max_time: Max time threshold
588 * @pcut_flag_time: Flagtime threshold
589 * @pcut_max_restart: Max number of restarts
590 * @pcut_debunce_time: Sets battery debounce time
592 struct ab8500_fg_parameters {
593 int recovery_sleep_timer;
594 int recovery_total_time;
596 int init_discard_time;
601 int high_curr_threshold;
602 int lowbat_threshold;
603 int battok_falling_th_sel0;
604 int battok_raising_th_sel1;
611 u8 pcut_debunce_time;
615 * struct ab8500_charger_maximization - struct used by the board config.
616 * @use_maxi: Enable maximization for this battery type
617 * @maxi_chg_curr: Maximum charger current allowed
618 * @maxi_wait_cycles: cycles to wait before setting charger current
619 * @charger_curr_step delta between two charger current settings (mA)
621 struct ab8500_maxim_parameters {
625 int charger_curr_step;
629 * struct ab8500_bm_capacity_levels - ab8500 capacity level data
630 * @critical: critical capacity level in percent
631 * @low: low capacity level in percent
632 * @normal: normal capacity level in percent
633 * @high: high capacity level in percent
634 * @full: full capacity level in percent
636 struct ab8500_bm_capacity_levels {
645 * struct ab8500_bm_charger_parameters - Charger specific parameters
646 * @usb_volt_max: maximum allowed USB charger voltage in mV
647 * @usb_curr_max: maximum allowed USB charger current in mA
648 * @ac_volt_max: maximum allowed AC charger voltage in mV
649 * @ac_curr_max: maximum allowed AC charger current in mA
651 struct ab8500_bm_charger_parameters {
659 * struct ab8500_bm_data - ab8500 battery management data
660 * @temp_under under this temp, charging is stopped
661 * @temp_low between this temp and temp_under charging is reduced
662 * @temp_high between this temp and temp_over charging is reduced
663 * @temp_over over this temp, charging is stopped
664 * @temp_interval_chg temperature measurement interval in s when charging
665 * @temp_interval_nochg temperature measurement interval in s when not charging
666 * @main_safety_tmr_h safety timer for main charger
667 * @usb_safety_tmr_h safety timer for usb charger
668 * @bkup_bat_v voltage which we charge the backup battery with
669 * @bkup_bat_i current which we charge the backup battery with
670 * @no_maintenance indicates that maintenance charging is disabled
671 * @capacity_scaling indicates whether capacity scaling is to be used
672 * @adc_therm placement of thermistor, batctrl or battemp adc
673 * @chg_unknown_bat flag to enable charging of unknown batteries
674 * @enable_overshoot flag to enable VBAT overshoot control
675 * @fg_res resistance of FG resistor in 0.1mOhm
676 * @n_btypes number of elements in array bat_type
677 * @batt_id index of the identified battery in array bat_type
678 * @interval_charging charge alg cycle period time when charging (sec)
679 * @interval_not_charging charge alg cycle period time when not charging (sec)
680 * @temp_hysteresis temperature hysteresis
681 * @gnd_lift_resistance Battery ground to phone ground resistance (mOhm)
682 * @maxi: maximization parameters
683 * @cap_levels capacity in percent for the different capacity levels
684 * @bat_type table of supported battery types
685 * @chg_params charger parameters
686 * @fg_params fuel gauge parameters
688 struct ab8500_bm_data {
693 int temp_interval_chg;
694 int temp_interval_nochg;
695 int main_safety_tmr_h;
696 int usb_safety_tmr_h;
700 bool capacity_scaling;
701 bool chg_unknown_bat;
702 bool enable_overshoot;
703 enum abx500_adc_therm adc_therm;
707 int interval_charging;
708 int interval_not_charging;
710 int gnd_lift_resistance;
711 const struct ab8500_maxim_parameters *maxi;
712 const struct ab8500_bm_capacity_levels *cap_levels;
713 const struct ab8500_bm_charger_parameters *chg_params;
714 const struct ab8500_fg_parameters *fg_params;
717 extern struct abx500_bm_data ab8500_bm_data;
719 void ab8500_charger_usb_state_changed(u8 bm_usb_state, u16 mA);
720 struct ab8500_fg *ab8500_fg_get(void);
721 int ab8500_fg_inst_curr_blocking(struct ab8500_fg *dev);
722 int ab8500_fg_inst_curr_start(struct ab8500_fg *di);
723 int ab8500_fg_inst_curr_finalize(struct ab8500_fg *di, int *res);
724 int ab8500_fg_inst_curr_started(struct ab8500_fg *di);
725 int ab8500_fg_inst_curr_done(struct ab8500_fg *di);
726 int ab8500_bm_of_probe(struct device *dev,
727 struct device_node *np,
728 struct abx500_bm_data *bm);
730 extern struct platform_driver ab8500_fg_driver;
731 extern struct platform_driver ab8500_btemp_driver;
732 extern struct platform_driver abx500_chargalg_driver;
734 #endif /* _AB8500_CHARGER_H_ */