aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power/ab8500_bmdata.c
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2012-11-29 10:26:22 -0500
committerLee Jones <lee.jones@linaro.org>2012-12-11 03:43:52 -0500
commit43dc4470e3c8465b438676484280b6e4187b78e4 (patch)
tree16ac98e99bae931307c39492a965f853e44fae67 /drivers/power/ab8500_bmdata.c
parentf6271b4fb1d5ce7d6cf2c84a96b56cca4ceca372 (diff)
ab8500_btemp: Fix crazy tabbing implementation
Simple patch to rectify incorrect tabbing. Also adds some coding style clean-ups to make it easier to read. Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/power/ab8500_bmdata.c')
-rw-r--r--drivers/power/ab8500_bmdata.c457
1 files changed, 229 insertions, 228 deletions
diff --git a/drivers/power/ab8500_bmdata.c b/drivers/power/ab8500_bmdata.c
index f16b60cd67de..2623b16b47d1 100644
--- a/drivers/power/ab8500_bmdata.c
+++ b/drivers/power/ab8500_bmdata.c
@@ -182,206 +182,206 @@ static struct batres_vs_temp temp_to_batres_tbl_9100[] = {
182}; 182};
183 183
184static struct abx500_battery_type bat_type_thermistor[] = { 184static struct abx500_battery_type bat_type_thermistor[] = {
185[BATTERY_UNKNOWN] = { 185 [BATTERY_UNKNOWN] = {
186 /* First element always represent the UNKNOWN battery */ 186 /* First element always represent the UNKNOWN battery */
187 .name = POWER_SUPPLY_TECHNOLOGY_UNKNOWN, 187 .name = POWER_SUPPLY_TECHNOLOGY_UNKNOWN,
188 .resis_high = 0, 188 .resis_high = 0,
189 .resis_low = 0, 189 .resis_low = 0,
190 .battery_resistance = 300, 190 .battery_resistance = 300,
191 .charge_full_design = 612, 191 .charge_full_design = 612,
192 .nominal_voltage = 3700, 192 .nominal_voltage = 3700,
193 .termination_vol = 4050, 193 .termination_vol = 4050,
194 .termination_curr = 200, 194 .termination_curr = 200,
195 .recharge_vol = 3990, 195 .recharge_vol = 3990,
196 .normal_cur_lvl = 400, 196 .normal_cur_lvl = 400,
197 .normal_vol_lvl = 4100, 197 .normal_vol_lvl = 4100,
198 .maint_a_cur_lvl = 400, 198 .maint_a_cur_lvl = 400,
199 .maint_a_vol_lvl = 4050, 199 .maint_a_vol_lvl = 4050,
200 .maint_a_chg_timer_h = 60, 200 .maint_a_chg_timer_h = 60,
201 .maint_b_cur_lvl = 400, 201 .maint_b_cur_lvl = 400,
202 .maint_b_vol_lvl = 4000, 202 .maint_b_vol_lvl = 4000,
203 .maint_b_chg_timer_h = 200, 203 .maint_b_chg_timer_h = 200,
204 .low_high_cur_lvl = 300, 204 .low_high_cur_lvl = 300,
205 .low_high_vol_lvl = 4000, 205 .low_high_vol_lvl = 4000,
206 .n_temp_tbl_elements = ARRAY_SIZE(temp_tbl), 206 .n_temp_tbl_elements = ARRAY_SIZE(temp_tbl),
207 .r_to_t_tbl = temp_tbl, 207 .r_to_t_tbl = temp_tbl,
208 .n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl), 208 .n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl),
209 .v_to_cap_tbl = cap_tbl, 209 .v_to_cap_tbl = cap_tbl,
210 .n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor), 210 .n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor),
211 .batres_tbl = temp_to_batres_tbl_thermistor, 211 .batres_tbl = temp_to_batres_tbl_thermistor,
212}, 212 },
213{ 213 {
214 .name = POWER_SUPPLY_TECHNOLOGY_LIPO, 214 .name = POWER_SUPPLY_TECHNOLOGY_LIPO,
215 .resis_high = 53407, 215 .resis_high = 53407,
216 .resis_low = 12500, 216 .resis_low = 12500,
217 .battery_resistance = 300, 217 .battery_resistance = 300,
218 .charge_full_design = 900, 218 .charge_full_design = 900,
219 .nominal_voltage = 3600, 219 .nominal_voltage = 3600,
220 .termination_vol = 4150, 220 .termination_vol = 4150,
221 .termination_curr = 80, 221 .termination_curr = 80,
222 .recharge_vol = 4130, 222 .recharge_vol = 4130,
223 .normal_cur_lvl = 700, 223 .normal_cur_lvl = 700,
224 .normal_vol_lvl = 4200, 224 .normal_vol_lvl = 4200,
225 .maint_a_cur_lvl = 600, 225 .maint_a_cur_lvl = 600,
226 .maint_a_vol_lvl = 4150, 226 .maint_a_vol_lvl = 4150,
227 .maint_a_chg_timer_h = 60, 227 .maint_a_chg_timer_h = 60,
228 .maint_b_cur_lvl = 600, 228 .maint_b_cur_lvl = 600,
229 .maint_b_vol_lvl = 4100, 229 .maint_b_vol_lvl = 4100,
230 .maint_b_chg_timer_h = 200, 230 .maint_b_chg_timer_h = 200,
231 .low_high_cur_lvl = 300, 231 .low_high_cur_lvl = 300,
232 .low_high_vol_lvl = 4000, 232 .low_high_vol_lvl = 4000,
233 .n_temp_tbl_elements = ARRAY_SIZE(temp_tbl_A_thermistor), 233 .n_temp_tbl_elements = ARRAY_SIZE(temp_tbl_A_thermistor),
234 .r_to_t_tbl = temp_tbl_A_thermistor, 234 .r_to_t_tbl = temp_tbl_A_thermistor,
235 .n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl_A_thermistor), 235 .n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl_A_thermistor),
236 .v_to_cap_tbl = cap_tbl_A_thermistor, 236 .v_to_cap_tbl = cap_tbl_A_thermistor,
237 .n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor), 237 .n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor),
238 .batres_tbl = temp_to_batres_tbl_thermistor, 238 .batres_tbl = temp_to_batres_tbl_thermistor,
239 239
240}, 240 },
241{ 241 {
242 .name = POWER_SUPPLY_TECHNOLOGY_LIPO, 242 .name = POWER_SUPPLY_TECHNOLOGY_LIPO,
243 .resis_high = 200000, 243 .resis_high = 200000,
244 .resis_low = 82869, 244 .resis_low = 82869,
245 .battery_resistance = 300, 245 .battery_resistance = 300,
246 .charge_full_design = 900, 246 .charge_full_design = 900,
247 .nominal_voltage = 3600, 247 .nominal_voltage = 3600,
248 .termination_vol = 4150, 248 .termination_vol = 4150,
249 .termination_curr = 80, 249 .termination_curr = 80,
250 .recharge_vol = 4130, 250 .recharge_vol = 4130,
251 .normal_cur_lvl = 700, 251 .normal_cur_lvl = 700,
252 .normal_vol_lvl = 4200, 252 .normal_vol_lvl = 4200,
253 .maint_a_cur_lvl = 600, 253 .maint_a_cur_lvl = 600,
254 .maint_a_vol_lvl = 4150, 254 .maint_a_vol_lvl = 4150,
255 .maint_a_chg_timer_h = 60, 255 .maint_a_chg_timer_h = 60,
256 .maint_b_cur_lvl = 600, 256 .maint_b_cur_lvl = 600,
257 .maint_b_vol_lvl = 4100, 257 .maint_b_vol_lvl = 4100,
258 .maint_b_chg_timer_h = 200, 258 .maint_b_chg_timer_h = 200,
259 .low_high_cur_lvl = 300, 259 .low_high_cur_lvl = 300,
260 .low_high_vol_lvl = 4000, 260 .low_high_vol_lvl = 4000,
261 .n_temp_tbl_elements = ARRAY_SIZE(temp_tbl_B_thermistor), 261 .n_temp_tbl_elements = ARRAY_SIZE(temp_tbl_B_thermistor),
262 .r_to_t_tbl = temp_tbl_B_thermistor, 262 .r_to_t_tbl = temp_tbl_B_thermistor,
263 .n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl_B_thermistor), 263 .n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl_B_thermistor),
264 .v_to_cap_tbl = cap_tbl_B_thermistor, 264 .v_to_cap_tbl = cap_tbl_B_thermistor,
265 .n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor), 265 .n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor),
266 .batres_tbl = temp_to_batres_tbl_thermistor, 266 .batres_tbl = temp_to_batres_tbl_thermistor,
267}, 267 },
268}; 268};
269 269
270static struct abx500_battery_type bat_type_ext_thermistor[] = { 270static struct abx500_battery_type bat_type_ext_thermistor[] = {
271[BATTERY_UNKNOWN] = { 271 [BATTERY_UNKNOWN] = {
272 /* First element always represent the UNKNOWN battery */ 272 /* First element always represent the UNKNOWN battery */
273 .name = POWER_SUPPLY_TECHNOLOGY_UNKNOWN, 273 .name = POWER_SUPPLY_TECHNOLOGY_UNKNOWN,
274 .resis_high = 0, 274 .resis_high = 0,
275 .resis_low = 0, 275 .resis_low = 0,
276 .battery_resistance = 300, 276 .battery_resistance = 300,
277 .charge_full_design = 612, 277 .charge_full_design = 612,
278 .nominal_voltage = 3700, 278 .nominal_voltage = 3700,
279 .termination_vol = 4050, 279 .termination_vol = 4050,
280 .termination_curr = 200, 280 .termination_curr = 200,
281 .recharge_vol = 3990, 281 .recharge_vol = 3990,
282 .normal_cur_lvl = 400, 282 .normal_cur_lvl = 400,
283 .normal_vol_lvl = 4100, 283 .normal_vol_lvl = 4100,
284 .maint_a_cur_lvl = 400, 284 .maint_a_cur_lvl = 400,
285 .maint_a_vol_lvl = 4050, 285 .maint_a_vol_lvl = 4050,
286 .maint_a_chg_timer_h = 60, 286 .maint_a_chg_timer_h = 60,
287 .maint_b_cur_lvl = 400, 287 .maint_b_cur_lvl = 400,
288 .maint_b_vol_lvl = 4000, 288 .maint_b_vol_lvl = 4000,
289 .maint_b_chg_timer_h = 200, 289 .maint_b_chg_timer_h = 200,
290 .low_high_cur_lvl = 300, 290 .low_high_cur_lvl = 300,
291 .low_high_vol_lvl = 4000, 291 .low_high_vol_lvl = 4000,
292 .n_temp_tbl_elements = ARRAY_SIZE(temp_tbl), 292 .n_temp_tbl_elements = ARRAY_SIZE(temp_tbl),
293 .r_to_t_tbl = temp_tbl, 293 .r_to_t_tbl = temp_tbl,
294 .n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl), 294 .n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl),
295 .v_to_cap_tbl = cap_tbl, 295 .v_to_cap_tbl = cap_tbl,
296 .n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor), 296 .n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor),
297 .batres_tbl = temp_to_batres_tbl_thermistor, 297 .batres_tbl = temp_to_batres_tbl_thermistor,
298}, 298 },
299/* 299/*
300 * These are the batteries that doesn't have an internal NTC resistor to measure 300 * These are the batteries that doesn't have an internal NTC resistor to measure
301 * its temperature. The temperature in this case is measure with a NTC placed 301 * its temperature. The temperature in this case is measure with a NTC placed
302 * near the battery but on the PCB. 302 * near the battery but on the PCB.
303 */ 303 */
304{ 304 {
305 .name = POWER_SUPPLY_TECHNOLOGY_LIPO, 305 .name = POWER_SUPPLY_TECHNOLOGY_LIPO,
306 .resis_high = 76000, 306 .resis_high = 76000,
307 .resis_low = 53000, 307 .resis_low = 53000,
308 .battery_resistance = 300, 308 .battery_resistance = 300,
309 .charge_full_design = 900, 309 .charge_full_design = 900,
310 .nominal_voltage = 3700, 310 .nominal_voltage = 3700,
311 .termination_vol = 4150, 311 .termination_vol = 4150,
312 .termination_curr = 100, 312 .termination_curr = 100,
313 .recharge_vol = 4130, 313 .recharge_vol = 4130,
314 .normal_cur_lvl = 700, 314 .normal_cur_lvl = 700,
315 .normal_vol_lvl = 4200, 315 .normal_vol_lvl = 4200,
316 .maint_a_cur_lvl = 600, 316 .maint_a_cur_lvl = 600,
317 .maint_a_vol_lvl = 4150, 317 .maint_a_vol_lvl = 4150,
318 .maint_a_chg_timer_h = 60, 318 .maint_a_chg_timer_h = 60,
319 .maint_b_cur_lvl = 600, 319 .maint_b_cur_lvl = 600,
320 .maint_b_vol_lvl = 4100, 320 .maint_b_vol_lvl = 4100,
321 .maint_b_chg_timer_h = 200, 321 .maint_b_chg_timer_h = 200,
322 .low_high_cur_lvl = 300, 322 .low_high_cur_lvl = 300,
323 .low_high_vol_lvl = 4000, 323 .low_high_vol_lvl = 4000,
324 .n_temp_tbl_elements = ARRAY_SIZE(temp_tbl), 324 .n_temp_tbl_elements = ARRAY_SIZE(temp_tbl),
325 .r_to_t_tbl = temp_tbl, 325 .r_to_t_tbl = temp_tbl,
326 .n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl), 326 .n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl),
327 .v_to_cap_tbl = cap_tbl, 327 .v_to_cap_tbl = cap_tbl,
328 .n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor), 328 .n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor),
329 .batres_tbl = temp_to_batres_tbl_thermistor, 329 .batres_tbl = temp_to_batres_tbl_thermistor,
330}, 330 },
331{ 331 {
332 .name = POWER_SUPPLY_TECHNOLOGY_LION, 332 .name = POWER_SUPPLY_TECHNOLOGY_LION,
333 .resis_high = 30000, 333 .resis_high = 30000,
334 .resis_low = 10000, 334 .resis_low = 10000,
335 .battery_resistance = 300, 335 .battery_resistance = 300,
336 .charge_full_design = 950, 336 .charge_full_design = 950,
337 .nominal_voltage = 3700, 337 .nominal_voltage = 3700,
338 .termination_vol = 4150, 338 .termination_vol = 4150,
339 .termination_curr = 100, 339 .termination_curr = 100,
340 .recharge_vol = 4130, 340 .recharge_vol = 4130,
341 .normal_cur_lvl = 700, 341 .normal_cur_lvl = 700,
342 .normal_vol_lvl = 4200, 342 .normal_vol_lvl = 4200,
343 .maint_a_cur_lvl = 600, 343 .maint_a_cur_lvl = 600,
344 .maint_a_vol_lvl = 4150, 344 .maint_a_vol_lvl = 4150,
345 .maint_a_chg_timer_h = 60, 345 .maint_a_chg_timer_h = 60,
346 .maint_b_cur_lvl = 600, 346 .maint_b_cur_lvl = 600,
347 .maint_b_vol_lvl = 4100, 347 .maint_b_vol_lvl = 4100,
348 .maint_b_chg_timer_h = 200, 348 .maint_b_chg_timer_h = 200,
349 .low_high_cur_lvl = 300, 349 .low_high_cur_lvl = 300,
350 .low_high_vol_lvl = 4000, 350 .low_high_vol_lvl = 4000,
351 .n_temp_tbl_elements = ARRAY_SIZE(temp_tbl), 351 .n_temp_tbl_elements = ARRAY_SIZE(temp_tbl),
352 .r_to_t_tbl = temp_tbl, 352 .r_to_t_tbl = temp_tbl,
353 .n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl), 353 .n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl),
354 .v_to_cap_tbl = cap_tbl, 354 .v_to_cap_tbl = cap_tbl,
355 .n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor), 355 .n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor),
356 .batres_tbl = temp_to_batres_tbl_thermistor, 356 .batres_tbl = temp_to_batres_tbl_thermistor,
357}, 357 },
358{ 358 {
359 .name = POWER_SUPPLY_TECHNOLOGY_LION, 359 .name = POWER_SUPPLY_TECHNOLOGY_LION,
360 .resis_high = 95000, 360 .resis_high = 95000,
361 .resis_low = 76001, 361 .resis_low = 76001,
362 .battery_resistance = 300, 362 .battery_resistance = 300,
363 .charge_full_design = 950, 363 .charge_full_design = 950,
364 .nominal_voltage = 3700, 364 .nominal_voltage = 3700,
365 .termination_vol = 4150, 365 .termination_vol = 4150,
366 .termination_curr = 100, 366 .termination_curr = 100,
367 .recharge_vol = 4130, 367 .recharge_vol = 4130,
368 .normal_cur_lvl = 700, 368 .normal_cur_lvl = 700,
369 .normal_vol_lvl = 4200, 369 .normal_vol_lvl = 4200,
370 .maint_a_cur_lvl = 600, 370 .maint_a_cur_lvl = 600,
371 .maint_a_vol_lvl = 4150, 371 .maint_a_vol_lvl = 4150,
372 .maint_a_chg_timer_h = 60, 372 .maint_a_chg_timer_h = 60,
373 .maint_b_cur_lvl = 600, 373 .maint_b_cur_lvl = 600,
374 .maint_b_vol_lvl = 4100, 374 .maint_b_vol_lvl = 4100,
375 .maint_b_chg_timer_h = 200, 375 .maint_b_chg_timer_h = 200,
376 .low_high_cur_lvl = 300, 376 .low_high_cur_lvl = 300,
377 .low_high_vol_lvl = 4000, 377 .low_high_vol_lvl = 4000,
378 .n_temp_tbl_elements = ARRAY_SIZE(temp_tbl), 378 .n_temp_tbl_elements = ARRAY_SIZE(temp_tbl),
379 .r_to_t_tbl = temp_tbl, 379 .r_to_t_tbl = temp_tbl,
380 .n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl), 380 .n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl),
381 .v_to_cap_tbl = cap_tbl, 381 .v_to_cap_tbl = cap_tbl,
382 .n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor), 382 .n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor),
383 .batres_tbl = temp_to_batres_tbl_thermistor, 383 .batres_tbl = temp_to_batres_tbl_thermistor,
384}, 384 },
385}; 385};
386 386
387static const struct abx500_bm_capacity_levels cap_levels = { 387static const struct abx500_bm_capacity_levels cap_levels = {
@@ -424,42 +424,41 @@ static const struct abx500_bm_charger_parameters chg = {
424}; 424};
425 425
426struct abx500_bm_data ab8500_bm_data = { 426struct abx500_bm_data ab8500_bm_data = {
427 .temp_under = 3, 427 .temp_under = 3,
428 .temp_low = 8, 428 .temp_low = 8,
429 .temp_high = 43, 429 .temp_high = 43,
430 .temp_over = 48, 430 .temp_over = 48,
431 .main_safety_tmr_h = 4, 431 .main_safety_tmr_h = 4,
432 .temp_interval_chg = 20, 432 .temp_interval_chg = 20,
433 .temp_interval_nochg = 120, 433 .temp_interval_nochg = 120,
434 .usb_safety_tmr_h = 4, 434 .usb_safety_tmr_h = 4,
435 .bkup_bat_v = BUP_VCH_SEL_2P6V, 435 .bkup_bat_v = BUP_VCH_SEL_2P6V,
436 .bkup_bat_i = BUP_ICH_SEL_150UA, 436 .bkup_bat_i = BUP_ICH_SEL_150UA,
437 .no_maintenance = false, 437 .no_maintenance = false,
438 .adc_therm = ABx500_ADC_THERM_BATCTRL, 438 .adc_therm = ABx500_ADC_THERM_BATCTRL,
439 .chg_unknown_bat = false, 439 .chg_unknown_bat = false,
440 .enable_overshoot = false, 440 .enable_overshoot = false,
441 .fg_res = 100, 441 .fg_res = 100,
442 .cap_levels = &cap_levels, 442 .cap_levels = &cap_levels,
443 .bat_type = bat_type_thermistor, 443 .bat_type = bat_type_thermistor,
444 .n_btypes = 3, 444 .n_btypes = 3,
445 .batt_id = 0, 445 .batt_id = 0,
446 .interval_charging = 5, 446 .interval_charging = 5,
447 .interval_not_charging = 120, 447 .interval_not_charging = 120,
448 .temp_hysteresis = 3, 448 .temp_hysteresis = 3,
449 .gnd_lift_resistance = 34, 449 .gnd_lift_resistance = 34,
450 .maxi = &maxi_params, 450 .maxi = &maxi_params,
451 .chg_params = &chg, 451 .chg_params = &chg,
452 .fg_params = &fg, 452 .fg_params = &fg,
453}; 453};
454 454
455int __devinit 455int __devinit bmdevs_of_probe(struct device *dev,
456bmdevs_of_probe(struct device *dev, 456 struct device_node *np,
457 struct device_node *np, 457 struct abx500_bm_data **battery)
458 struct abx500_bm_data **battery)
459{ 458{
460 struct abx500_battery_type *btype; 459 struct abx500_battery_type *btype;
461 struct device_node *np_bat_supply; 460 struct device_node *np_bat_supply;
462 struct abx500_bm_data *bat; 461 struct abx500_bm_data *bat;
463 const char *btech; 462 const char *btech;
464 int i, thermistor; 463 int i, thermistor;
465 464
@@ -471,8 +470,8 @@ bmdevs_of_probe(struct device *dev,
471 dev_err(dev, "missing property battery\n"); 470 dev_err(dev, "missing property battery\n");
472 return -EINVAL; 471 return -EINVAL;
473 } 472 }
474 if (of_property_read_bool(np_bat_supply, 473
475 "thermistor-on-batctrl")) 474 if (of_property_read_bool(np_bat_supply, "thermistor-on-batctrl"))
476 thermistor = NTC_INTERNAL; 475 thermistor = NTC_INTERNAL;
477 else 476 else
478 thermistor = NTC_EXTERNAL; 477 thermistor = NTC_EXTERNAL;
@@ -483,8 +482,8 @@ bmdevs_of_probe(struct device *dev,
483 bat->bat_type = bat_type_ext_thermistor; 482 bat->bat_type = bat_type_ext_thermistor;
484 bat->adc_therm = ABx500_ADC_THERM_BATTEMP; 483 bat->adc_therm = ABx500_ADC_THERM_BATTEMP;
485 } 484 }
486 btech = of_get_property(np_bat_supply, 485
487 "stericsson,battery-type", NULL); 486 btech = of_get_property(np_bat_supply, "stericsson,battery-type", NULL);
488 if (!btech) { 487 if (!btech) {
489 dev_warn(dev, "missing property battery-name/type\n"); 488 dev_warn(dev, "missing property battery-name/type\n");
490 return -EINVAL; 489 return -EINVAL;
@@ -498,6 +497,7 @@ bmdevs_of_probe(struct device *dev,
498 bat->bat_type[BATTERY_UNKNOWN].normal_cur_lvl = 520; 497 bat->bat_type[BATTERY_UNKNOWN].normal_cur_lvl = 520;
499 bat->bat_type[BATTERY_UNKNOWN].normal_vol_lvl = 4200; 498 bat->bat_type[BATTERY_UNKNOWN].normal_vol_lvl = 4200;
500 } 499 }
500
501 /* select the battery resolution table */ 501 /* select the battery resolution table */
502 for (i = 0; i < bat->n_btypes; ++i) { 502 for (i = 0; i < bat->n_btypes; ++i) {
503 btype = (bat->bat_type + i); 503 btype = (bat->bat_type + i);
@@ -513,5 +513,6 @@ bmdevs_of_probe(struct device *dev,
513 } 513 }
514 } 514 }
515 of_node_put(np_bat_supply); 515 of_node_put(np_bat_supply);
516
516 return 0; 517 return 0;
517} 518}