Lines Matching +full:ocv +full:- +full:capacity +full:- +full:table +full:- +full:1
1 // SPDX-License-Identifier: GPL-2.0
6 #include "ab8500-bm.h"
20 { .ocv = 4186000, .capacity = 100},
21 { .ocv = 4163000, .capacity = 99},
22 { .ocv = 4114000, .capacity = 95},
23 { .ocv = 4068000, .capacity = 90},
24 { .ocv = 3990000, .capacity = 80},
25 { .ocv = 3926000, .capacity = 70},
26 { .ocv = 3898000, .capacity = 65},
27 { .ocv = 3866000, .capacity = 60},
28 { .ocv = 3833000, .capacity = 55},
29 { .ocv = 3812000, .capacity = 50},
30 { .ocv = 3787000, .capacity = 40},
31 { .ocv = 3768000, .capacity = 30},
32 { .ocv = 3747000, .capacity = 25},
33 { .ocv = 3730000, .capacity = 20},
34 { .ocv = 3705000, .capacity = 15},
35 { .ocv = 3699000, .capacity = 14},
36 { .ocv = 3684000, .capacity = 12},
37 { .ocv = 3672000, .capacity = 9},
38 { .ocv = 3657000, .capacity = 7},
39 { .ocv = 3638000, .capacity = 6},
40 { .ocv = 3556000, .capacity = 4},
41 { .ocv = 3424000, .capacity = 2},
42 { .ocv = 3317000, .capacity = 1},
43 { .ocv = 3094000, .capacity = 0},
47 * Note that the batres_vs_temp table must be strictly sorted by falling
57 { .temp = -10, .resistance = 158 /* 445 mOhm */ },
58 { .temp = -20, .resistance = 198 /* 595 mOhm */ },
87 .init_timer = 1,
99 .pcut_enable = 1,
144 struct device *dev = &psy->dev; in ab8500_bm_of_probe()
147 ret = power_supply_get_battery_info(psy, &bm->bi); in ab8500_bm_of_probe()
152 bi = bm->bi; in ab8500_bm_of_probe()
155 if (bi->charge_full_design_uah < 0) in ab8500_bm_of_probe()
156 /* The default capacity is 612 mAh for unknown batteries */ in ab8500_bm_of_probe()
157 bi->charge_full_design_uah = 612000; in ab8500_bm_of_probe()
163 if ((bi->voltage_min_design_uv < 0) || in ab8500_bm_of_probe()
164 (bi->voltage_max_design_uv < 0)) { in ab8500_bm_of_probe()
166 bi->voltage_min_design_uv = 3700000; in ab8500_bm_of_probe()
168 bi->voltage_max_design_uv = 4050000; in ab8500_bm_of_probe()
171 if (bi->constant_charge_current_max_ua < 0) in ab8500_bm_of_probe()
172 bi->constant_charge_current_max_ua = 400000; in ab8500_bm_of_probe()
174 if (bi->constant_charge_voltage_max_uv < 0) in ab8500_bm_of_probe()
175 bi->constant_charge_voltage_max_uv = 4100000; in ab8500_bm_of_probe()
177 if (bi->charge_term_current_ua) in ab8500_bm_of_probe()
179 bi->charge_term_current_ua = 200000; in ab8500_bm_of_probe()
181 if (!bi->maintenance_charge || !bi->maintenance_charge_size) { in ab8500_bm_of_probe()
182 bi->maintenance_charge = ab8500_maint_charg_table; in ab8500_bm_of_probe()
183 bi->maintenance_charge_size = ARRAY_SIZE(ab8500_maint_charg_table); in ab8500_bm_of_probe()
186 if (bi->alert_low_temp_charge_current_ua < 0 || in ab8500_bm_of_probe()
187 bi->alert_low_temp_charge_voltage_uv < 0) in ab8500_bm_of_probe()
189 bi->alert_low_temp_charge_current_ua = 300000; in ab8500_bm_of_probe()
190 bi->alert_low_temp_charge_voltage_uv = 4000000; in ab8500_bm_of_probe()
192 if (bi->alert_high_temp_charge_current_ua < 0 || in ab8500_bm_of_probe()
193 bi->alert_high_temp_charge_voltage_uv < 0) in ab8500_bm_of_probe()
195 bi->alert_high_temp_charge_current_ua = 300000; in ab8500_bm_of_probe()
196 bi->alert_high_temp_charge_voltage_uv = 4000000; in ab8500_bm_of_probe()
203 if ((bi->factory_internal_resistance_uohm < 0) || in ab8500_bm_of_probe()
204 !bi->resist_table) { in ab8500_bm_of_probe()
205 bi->factory_internal_resistance_uohm = 300000; in ab8500_bm_of_probe()
206 bi->resist_table = temp_to_batres_tbl_thermistor; in ab8500_bm_of_probe()
207 bi->resist_table_size = ARRAY_SIZE(temp_to_batres_tbl_thermistor); in ab8500_bm_of_probe()
211 if (bi->bti_resistance_ohm < 0 || in ab8500_bm_of_probe()
212 bi->bti_resistance_tolerance < 0) { in ab8500_bm_of_probe()
213 bi->bti_resistance_ohm = 7000; in ab8500_bm_of_probe()
214 bi->bti_resistance_tolerance = 20; in ab8500_bm_of_probe()
217 if (!bi->ocv_table[0]) { in ab8500_bm_of_probe()
218 /* Default capacity table at say 25 degrees Celsius */ in ab8500_bm_of_probe()
219 bi->ocv_temp[0] = 25; in ab8500_bm_of_probe()
220 bi->ocv_table[0] = ocv_cap_tbl; in ab8500_bm_of_probe()
221 bi->ocv_table_size[0] = ARRAY_SIZE(ocv_cap_tbl); in ab8500_bm_of_probe()
224 if (bi->temp_min == INT_MIN) in ab8500_bm_of_probe()
225 bi->temp_min = AB8500_TEMP_UNDER; in ab8500_bm_of_probe()
226 if (bi->temp_max == INT_MAX) in ab8500_bm_of_probe()
227 bi->temp_max = AB8500_TEMP_OVER; in ab8500_bm_of_probe()
228 if (bi->temp_alert_min == INT_MIN) in ab8500_bm_of_probe()
229 bi->temp_alert_min = AB8500_TEMP_LOW; in ab8500_bm_of_probe()
230 if (bi->temp_alert_max == INT_MAX) in ab8500_bm_of_probe()
231 bi->temp_alert_max = AB8500_TEMP_HIGH; in ab8500_bm_of_probe()
232 bm->temp_hysteresis = AB8500_TEMP_HYSTERESIS; in ab8500_bm_of_probe()
240 power_supply_put_battery_info(psy, bm->bi); in ab8500_bm_of_remove()