Lines Matching +full:chg +full:- +full:int

1 // SPDX-License-Identifier: GPL-2.0
6 #include "ab8500-bm.h"
57 { .temp = -10, .resistance = 158 /* 445 mOhm */ },
58 { .temp = -20, .resistance = 198 /* 595 mOhm */ },
113 static const struct ab8500_bm_charger_parameters chg = { variable
136 .chg_params = &chg,
140 int ab8500_bm_of_probe(struct power_supply *psy, in ab8500_bm_of_probe()
144 struct device *dev = &psy->dev; in ab8500_bm_of_probe()
145 int ret; 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()
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()
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()