Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

power: supply: ab8500: Drop abx500 concept

Drop the entire idea with abx500 being abstract and different from ab8500
in the AB8500 charging drivers. This rids the two identical definitions
of a slew of structs in ab8500-bm.h and makes things less confusion and
easier to understand.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

authored by

Linus Walleij and committed by
Sebastian Reichel
484a9cc3 c5b64a99

+95 -248
+66 -219
drivers/power/supply/ab8500-bm.h
··· 269 269 270 270 /* 271 271 * ADC for the battery thermistor. 272 - * When using the ABx500_ADC_THERM_BATCTRL the battery ID resistor is combined 272 + * When using the AB8500_ADC_THERM_BATCTRL the battery ID resistor is combined 273 273 * with a NTC resistor to both identify the battery and to measure its 274 274 * temperature. Different phone manufactures uses different techniques to both 275 275 * identify the battery and to read its temperature. 276 276 */ 277 - enum abx500_adc_therm { 278 - ABx500_ADC_THERM_BATCTRL, 279 - ABx500_ADC_THERM_BATTEMP, 277 + enum ab8500_adc_therm { 278 + AB8500_ADC_THERM_BATCTRL, 279 + AB8500_ADC_THERM_BATTEMP, 280 280 }; 281 281 282 282 /** 283 - * struct abx500_res_to_temp - defines one point in a temp to res curve. To 283 + * struct ab8500_res_to_temp - defines one point in a temp to res curve. To 284 284 * be used in battery packs that combines the identification resistor with a 285 285 * NTC resistor. 286 286 * @temp: battery pack temperature in Celsius 287 287 * @resist: NTC resistor net total resistance 288 288 */ 289 - struct abx500_res_to_temp { 289 + struct ab8500_res_to_temp { 290 290 int temp; 291 291 int resist; 292 292 }; 293 293 294 294 /** 295 - * struct abx500_v_to_cap - Table for translating voltage to capacity 295 + * struct ab8500_v_to_cap - Table for translating voltage to capacity 296 296 * @voltage: Voltage in mV 297 297 * @capacity: Capacity in percent 298 298 */ 299 - struct abx500_v_to_cap { 299 + struct ab8500_v_to_cap { 300 300 int voltage; 301 301 int capacity; 302 302 }; 303 303 304 304 /* Forward declaration */ 305 - struct abx500_fg; 305 + struct ab8500_fg; 306 306 307 307 /** 308 - * struct abx500_fg_parameters - Fuel gauge algorithm parameters, in seconds 308 + * struct ab8500_fg_parameters - Fuel gauge algorithm parameters, in seconds 309 309 * if not specified 310 310 * @recovery_sleep_timer: Time between measurements while recovering 311 311 * @recovery_total_time: Total recovery time ··· 333 333 * @pcut_max_restart: Max number of restarts 334 334 * @pcut_debounce_time: Sets battery debounce time 335 335 */ 336 - struct abx500_fg_parameters { 336 + struct ab8500_fg_parameters { 337 337 int recovery_sleep_timer; 338 338 int recovery_total_time; 339 339 int init_timer; ··· 357 357 }; 358 358 359 359 /** 360 - * struct abx500_charger_maximization - struct used by the board config. 360 + * struct ab8500_charger_maximization - struct used by the board config. 361 361 * @use_maxi: Enable maximization for this battery type 362 362 * @maxi_chg_curr: Maximum charger current allowed 363 363 * @maxi_wait_cycles: cycles to wait before setting charger current 364 364 * @charger_curr_step delta between two charger current settings (mA) 365 365 */ 366 - struct abx500_maxim_parameters { 366 + struct ab8500_maxim_parameters { 367 367 bool ena_maxi; 368 368 int chg_curr; 369 369 int wait_cycles; ··· 371 371 }; 372 372 373 373 /** 374 - * struct abx500_battery_type - different batteries supported 374 + * struct ab8500_battery_type - different batteries supported 375 375 * @name: battery technology 376 376 * @resis_high: battery upper resistance limit 377 377 * @resis_low: battery lower resistance limit ··· 400 400 * @n_batres_tbl_elements number of elements in the batres_tbl 401 401 * @batres_tbl battery internal resistance vs temperature table 402 402 */ 403 - struct abx500_battery_type { 403 + struct ab8500_battery_type { 404 404 int name; 405 405 int resis_high; 406 406 int resis_low; ··· 421 421 int low_high_vol_lvl; 422 422 int battery_resistance; 423 423 int n_temp_tbl_elements; 424 - const struct abx500_res_to_temp *r_to_t_tbl; 424 + const struct ab8500_res_to_temp *r_to_t_tbl; 425 425 int n_v_cap_tbl_elements; 426 - const struct abx500_v_to_cap *v_to_cap_tbl; 426 + const struct ab8500_v_to_cap *v_to_cap_tbl; 427 427 int n_batres_tbl_elements; 428 428 const struct batres_vs_temp *batres_tbl; 429 - }; 430 - 431 - /** 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 438 - */ 439 - struct abx500_bm_capacity_levels { 440 - int critical; 441 - int low; 442 - int normal; 443 - int high; 444 - int full; 445 - }; 446 - 447 - /** 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 453 - */ 454 - struct abx500_bm_charger_parameters { 455 - int usb_volt_max; 456 - int usb_curr_max; 457 - int ac_volt_max; 458 - int ac_curr_max; 459 - }; 460 - 461 - /** 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 496 - */ 497 - struct abx500_bm_data { 498 - int temp_under; 499 - int temp_low; 500 - int temp_high; 501 - int temp_over; 502 - int temp_now; 503 - int temp_interval_chg; 504 - int temp_interval_nochg; 505 - int main_safety_tmr_h; 506 - int usb_safety_tmr_h; 507 - int bkup_bat_v; 508 - int bkup_bat_i; 509 - bool no_maintenance; 510 - bool capacity_scaling; 511 - bool chg_unknown_bat; 512 - bool enable_overshoot; 513 - bool auto_trig; 514 - enum abx500_adc_therm adc_therm; 515 - int fg_res; 516 - int n_btypes; 517 - int batt_id; 518 - int interval_charging; 519 - int interval_not_charging; 520 - int temp_hysteresis; 521 - int gnd_lift_resistance; 522 - int n_chg_out_curr; 523 - int n_chg_in_curr; 524 - int *chg_output_curr; 525 - int *chg_input_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; 531 - }; 532 - 533 - enum { 534 - NTC_EXTERNAL = 0, 535 - NTC_INTERNAL, 536 - }; 537 - 538 - /** 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 541 - * NTC resistor. 542 - * @temp: battery pack temperature in Celsius 543 - * @resist: NTC resistor net total resistance 544 - */ 545 - struct res_to_temp { 546 - int temp; 547 - int resist; 548 - }; 549 - 550 - /** 551 - * struct batres_vs_temp - defines one point in a temp vs battery internal 552 - * resistance curve. 553 - * @temp: battery pack temperature in Celsius 554 - * @resist: battery internal reistance in mOhm 555 - */ 556 - struct batres_vs_temp { 557 - int temp; 558 - int resist; 559 - }; 560 - 561 - /* Forward declaration */ 562 - struct ab8500_fg; 563 - 564 - /** 565 - * struct ab8500_fg_parameters - Fuel gauge algorithm parameters, in seconds 566 - * if not specified 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 583 - * points. 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 591 - */ 592 - struct ab8500_fg_parameters { 593 - int recovery_sleep_timer; 594 - int recovery_total_time; 595 - int init_timer; 596 - int init_discard_time; 597 - int init_total_time; 598 - int high_curr_time; 599 - int accu_charging; 600 - int accu_high_curr; 601 - int high_curr_threshold; 602 - int lowbat_threshold; 603 - int battok_falling_th_sel0; 604 - int battok_raising_th_sel1; 605 - int user_cap_limit; 606 - int maint_thres; 607 - bool pcut_enable; 608 - u8 pcut_max_time; 609 - u8 pcut_flag_time; 610 - u8 pcut_max_restart; 611 - u8 pcut_debunce_time; 612 - }; 613 - 614 - /** 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) 620 - */ 621 - struct ab8500_maxim_parameters { 622 - bool ena_maxi; 623 - int chg_curr; 624 - int wait_cycles; 625 - int charger_curr_step; 626 429 }; 627 430 628 431 /** ··· 464 661 * @temp_low between this temp and temp_under charging is reduced 465 662 * @temp_high between this temp and temp_over charging is reduced 466 663 * @temp_over over this temp, charging is stopped 664 + * @temp_now present battery temperature 467 665 * @temp_interval_chg temperature measurement interval in s when charging 468 666 * @temp_interval_nochg temperature measurement interval in s when not charging 469 667 * @main_safety_tmr_h safety timer for main charger ··· 473 669 * @bkup_bat_i current which we charge the backup battery with 474 670 * @no_maintenance indicates that maintenance charging is disabled 475 671 * @capacity_scaling indicates whether capacity scaling is to be used 476 - * @adc_therm placement of thermistor, batctrl or battemp adc 672 + * @ab8500_adc_therm placement of thermistor, batctrl or battemp adc 477 673 * @chg_unknown_bat flag to enable charging of unknown batteries 478 674 * @enable_overshoot flag to enable VBAT overshoot control 675 + * @auto_trig flag to enable auto adc trigger 479 676 * @fg_res resistance of FG resistor in 0.1mOhm 480 677 * @n_btypes number of elements in array bat_type 481 678 * @batt_id index of the identified battery in array bat_type ··· 484 679 * @interval_not_charging charge alg cycle period time when not charging (sec) 485 680 * @temp_hysteresis temperature hysteresis 486 681 * @gnd_lift_resistance Battery ground to phone ground resistance (mOhm) 487 - * @maxi: maximization parameters 682 + * @n_chg_out_curr number of elements in array chg_output_curr 683 + * @n_chg_in_curr number of elements in array chg_input_curr 684 + * @chg_output_curr charger output current level map 685 + * @chg_input_curr charger input current level map 686 + * @maxi maximization parameters 488 687 * @cap_levels capacity in percent for the different capacity levels 489 688 * @bat_type table of supported battery types 490 689 * @chg_params charger parameters ··· 499 690 int temp_low; 500 691 int temp_high; 501 692 int temp_over; 693 + int temp_now; 502 694 int temp_interval_chg; 503 695 int temp_interval_nochg; 504 696 int main_safety_tmr_h; ··· 510 700 bool capacity_scaling; 511 701 bool chg_unknown_bat; 512 702 bool enable_overshoot; 513 - enum abx500_adc_therm adc_therm; 703 + bool auto_trig; 704 + enum ab8500_adc_therm adc_therm; 514 705 int fg_res; 515 706 int n_btypes; 516 707 int batt_id; ··· 519 708 int interval_not_charging; 520 709 int temp_hysteresis; 521 710 int gnd_lift_resistance; 711 + int n_chg_out_curr; 712 + int n_chg_in_curr; 713 + int *chg_output_curr; 714 + int *chg_input_curr; 522 715 const struct ab8500_maxim_parameters *maxi; 523 716 const struct ab8500_bm_capacity_levels *cap_levels; 717 + struct ab8500_battery_type *bat_type; 524 718 const struct ab8500_bm_charger_parameters *chg_params; 525 719 const struct ab8500_fg_parameters *fg_params; 526 720 }; 527 721 528 - extern struct abx500_bm_data ab8500_bm_data; 722 + enum { 723 + NTC_EXTERNAL = 0, 724 + NTC_INTERNAL, 725 + }; 726 + 727 + /** 728 + * struct res_to_temp - defines one point in a temp to res curve. To 729 + * be used in battery packs that combines the identification resistor with a 730 + * NTC resistor. 731 + * @temp: battery pack temperature in Celsius 732 + * @resist: NTC resistor net total resistance 733 + */ 734 + struct res_to_temp { 735 + int temp; 736 + int resist; 737 + }; 738 + 739 + /** 740 + * struct batres_vs_temp - defines one point in a temp vs battery internal 741 + * resistance curve. 742 + * @temp: battery pack temperature in Celsius 743 + * @resist: battery internal reistance in mOhm 744 + */ 745 + struct batres_vs_temp { 746 + int temp; 747 + int resist; 748 + }; 749 + 750 + /* Forward declaration */ 751 + struct ab8500_fg; 752 + 753 + extern struct ab8500_bm_data ab8500_bm_data; 529 754 530 755 void ab8500_charger_usb_state_changed(u8 bm_usb_state, u16 mA); 531 756 struct ab8500_fg *ab8500_fg_get(void); ··· 572 725 int ab8500_fg_inst_curr_done(struct ab8500_fg *di); 573 726 int ab8500_bm_of_probe(struct device *dev, 574 727 struct device_node *np, 575 - struct abx500_bm_data *bm); 728 + struct ab8500_bm_data *bm); 576 729 577 730 extern struct platform_driver ab8500_fg_driver; 578 731 extern struct platform_driver ab8500_btemp_driver;
+16 -16
drivers/power/supply/ab8500_bmdata.c
··· 13 13 * Note that the res_to_temp table must be strictly sorted by falling resistance 14 14 * values to work. 15 15 */ 16 - const struct abx500_res_to_temp ab8500_temp_tbl_a_thermistor[] = { 16 + const struct ab8500_res_to_temp ab8500_temp_tbl_a_thermistor[] = { 17 17 {-5, 53407}, 18 18 { 0, 48594}, 19 19 { 5, 43804}, ··· 35 35 const int ab8500_temp_tbl_a_size = ARRAY_SIZE(ab8500_temp_tbl_a_thermistor); 36 36 EXPORT_SYMBOL(ab8500_temp_tbl_a_size); 37 37 38 - const struct abx500_res_to_temp ab8500_temp_tbl_b_thermistor[] = { 38 + const struct ab8500_res_to_temp ab8500_temp_tbl_b_thermistor[] = { 39 39 {-5, 200000}, 40 40 { 0, 159024}, 41 41 { 5, 151921}, ··· 57 57 const int ab8500_temp_tbl_b_size = ARRAY_SIZE(ab8500_temp_tbl_b_thermistor); 58 58 EXPORT_SYMBOL(ab8500_temp_tbl_b_size); 59 59 60 - static const struct abx500_v_to_cap cap_tbl_a_thermistor[] = { 60 + static const struct ab8500_v_to_cap cap_tbl_a_thermistor[] = { 61 61 {4171, 100}, 62 62 {4114, 95}, 63 63 {4009, 83}, ··· 80 80 {3247, 0}, 81 81 }; 82 82 83 - static const struct abx500_v_to_cap cap_tbl_b_thermistor[] = { 83 + static const struct ab8500_v_to_cap cap_tbl_b_thermistor[] = { 84 84 {4161, 100}, 85 85 {4124, 98}, 86 86 {4044, 90}, ··· 103 103 {3250, 0}, 104 104 }; 105 105 106 - static const struct abx500_v_to_cap cap_tbl[] = { 106 + static const struct ab8500_v_to_cap cap_tbl[] = { 107 107 {4186, 100}, 108 108 {4163, 99}, 109 109 {4114, 95}, ··· 134 134 * Note that the res_to_temp table must be strictly sorted by falling 135 135 * resistance values to work. 136 136 */ 137 - static const struct abx500_res_to_temp temp_tbl[] = { 137 + static const struct ab8500_res_to_temp temp_tbl[] = { 138 138 {-5, 214834}, 139 139 { 0, 162943}, 140 140 { 5, 124820}, ··· 191 191 {-20, 180}, 192 192 }; 193 193 194 - static struct abx500_battery_type bat_type_thermistor[] = { 194 + static struct ab8500_battery_type bat_type_thermistor[] = { 195 195 [BATTERY_UNKNOWN] = { 196 196 /* First element always represent the UNKNOWN battery */ 197 197 .name = POWER_SUPPLY_TECHNOLOGY_UNKNOWN, ··· 277 277 }, 278 278 }; 279 279 280 - static struct abx500_battery_type bat_type_ext_thermistor[] = { 280 + static struct ab8500_battery_type bat_type_ext_thermistor[] = { 281 281 [BATTERY_UNKNOWN] = { 282 282 /* First element always represent the UNKNOWN battery */ 283 283 .name = POWER_SUPPLY_TECHNOLOGY_UNKNOWN, ··· 394 394 }, 395 395 }; 396 396 397 - static const struct abx500_bm_capacity_levels cap_levels = { 397 + static const struct ab8500_bm_capacity_levels cap_levels = { 398 398 .critical = 2, 399 399 .low = 10, 400 400 .normal = 70, ··· 402 402 .full = 100, 403 403 }; 404 404 405 - static const struct abx500_fg_parameters fg = { 405 + static const struct ab8500_fg_parameters fg = { 406 406 .recovery_sleep_timer = 10, 407 407 .recovery_total_time = 100, 408 408 .init_timer = 1, ··· 424 424 .pcut_debounce_time = 2, 425 425 }; 426 426 427 - static const struct abx500_maxim_parameters ab8500_maxi_params = { 427 + static const struct ab8500_maxim_parameters ab8500_maxi_params = { 428 428 .ena_maxi = true, 429 429 .chg_curr = 910, 430 430 .wait_cycles = 10, 431 431 .charger_curr_step = 100, 432 432 }; 433 433 434 - static const struct abx500_bm_charger_parameters chg = { 434 + static const struct ab8500_bm_charger_parameters chg = { 435 435 .usb_volt_max = 5500, 436 436 .usb_curr_max = 1500, 437 437 .ac_volt_max = 7500, ··· 456 456 700, 800, 900, 1000, 1100, 1300, 1400, 1500, 457 457 }; 458 458 459 - struct abx500_bm_data ab8500_bm_data = { 459 + struct ab8500_bm_data ab8500_bm_data = { 460 460 .temp_under = 3, 461 461 .temp_low = 8, 462 462 .temp_high = 43, ··· 469 469 .bkup_bat_i = BUP_ICH_SEL_150UA, 470 470 .no_maintenance = false, 471 471 .capacity_scaling = false, 472 - .adc_therm = ABx500_ADC_THERM_BATCTRL, 472 + .adc_therm = AB8500_ADC_THERM_BATCTRL, 473 473 .chg_unknown_bat = false, 474 474 .enable_overshoot = false, 475 475 .fg_res = 100, ··· 492 492 493 493 int ab8500_bm_of_probe(struct device *dev, 494 494 struct device_node *np, 495 - struct abx500_bm_data *bm) 495 + struct ab8500_bm_data *bm) 496 496 { 497 497 const struct batres_vs_temp *tmp_batres_tbl; 498 498 struct device_node *battery_node; ··· 531 531 } else { 532 532 bm->n_btypes = 4; 533 533 bm->bat_type = bat_type_ext_thermistor; 534 - bm->adc_therm = ABx500_ADC_THERM_BATTEMP; 534 + bm->adc_therm = AB8500_ADC_THERM_BATTEMP; 535 535 tmp_batres_tbl = temp_to_batres_tbl_ext_thermistor; 536 536 } 537 537
+8 -8
drivers/power/supply/ab8500_btemp.c
··· 103 103 struct iio_channel *btemp_ball; 104 104 struct iio_channel *bat_ctrl; 105 105 struct ab8500_fg *fg; 106 - struct abx500_bm_data *bm; 106 + struct ab8500_bm_data *bm; 107 107 struct power_supply *btemp_psy; 108 108 struct ab8500_btemp_events events; 109 109 struct ab8500_btemp_ranges btemp_ranges; ··· 145 145 return (450000 * (v_batctrl)) / (1800 - v_batctrl); 146 146 } 147 147 148 - if (di->bm->adc_therm == ABx500_ADC_THERM_BATCTRL) { 148 + if (di->bm->adc_therm == AB8500_ADC_THERM_BATCTRL) { 149 149 /* 150 150 * If the battery has internal NTC, we use the current 151 151 * source to calculate the resistance. ··· 207 207 return 0; 208 208 209 209 /* Only do this for batteries with internal NTC */ 210 - if (di->bm->adc_therm == ABx500_ADC_THERM_BATCTRL && enable) { 210 + if (di->bm->adc_therm == AB8500_ADC_THERM_BATCTRL && enable) { 211 211 212 212 if (di->curr_source == BTEMP_BATCTRL_CURR_SRC_7UA) 213 213 curr = BAT_CTRL_7U_ENA; ··· 240 240 __func__); 241 241 goto disable_curr_source; 242 242 } 243 - } else if (di->bm->adc_therm == ABx500_ADC_THERM_BATCTRL && !enable) { 243 + } else if (di->bm->adc_therm == AB8500_ADC_THERM_BATCTRL && !enable) { 244 244 dev_dbg(di->dev, "Disable BATCTRL curr source\n"); 245 245 246 246 /* Write 0 to the curr bits */ ··· 418 418 * based on the NTC resistance. 419 419 */ 420 420 static int ab8500_btemp_res_to_temp(struct ab8500_btemp *di, 421 - const struct abx500_res_to_temp *tbl, int tbl_size, int res) 421 + const struct ab8500_res_to_temp *tbl, int tbl_size, int res) 422 422 { 423 423 int i; 424 424 /* ··· 458 458 459 459 id = di->bm->batt_id; 460 460 461 - if (di->bm->adc_therm == ABx500_ADC_THERM_BATCTRL && 461 + if (di->bm->adc_therm == AB8500_ADC_THERM_BATCTRL && 462 462 id != BATTERY_UNKNOWN) { 463 463 464 464 rbat = ab8500_btemp_get_batctrl_res(di); ··· 527 527 dev_dbg(di->dev, "Battery detected on %s" 528 528 " low %d < res %d < high: %d" 529 529 " index: %d\n", 530 - di->bm->adc_therm == ABx500_ADC_THERM_BATCTRL ? 530 + di->bm->adc_therm == AB8500_ADC_THERM_BATCTRL ? 531 531 "BATCTRL" : "BATTEMP", 532 532 di->bm->bat_type[i].resis_low, res, 533 533 di->bm->bat_type[i].resis_high, i); ··· 547 547 * We only have to change current source if the 548 548 * detected type is Type 1. 549 549 */ 550 - if (di->bm->adc_therm == ABx500_ADC_THERM_BATCTRL && 550 + if (di->bm->adc_therm == AB8500_ADC_THERM_BATCTRL && 551 551 di->bm->batt_id == 1) { 552 552 dev_dbg(di->dev, "Set BATCTRL current source to 20uA\n"); 553 553 di->curr_source = BTEMP_BATCTRL_CURR_SRC_20UA;
+1 -1
drivers/power/supply/ab8500_chargalg.c
··· 249 249 struct ab8500_chargalg_suspension_status susp_status; 250 250 struct ab8500 *parent; 251 251 struct ab8500_chargalg_current_step_status curr_status; 252 - struct abx500_bm_data *bm; 252 + struct ab8500_bm_data *bm; 253 253 struct power_supply *chargalg_psy; 254 254 struct ux500_charger *ac_chg; 255 255 struct ux500_charger *usb_chg;
+1 -1
drivers/power/supply/ab8500_charger.c
··· 292 292 struct iio_channel *adc_main_charger_c; 293 293 struct iio_channel *adc_vbus_v; 294 294 struct iio_channel *adc_usb_charger_c; 295 - struct abx500_bm_data *bm; 295 + struct ab8500_bm_data *bm; 296 296 struct ab8500_charger_event_flags flags; 297 297 struct ab8500_charger_usb_state usb_state; 298 298 struct ab8500_charger_max_usb_in_curr max_usb_in_curr;
+3 -3
drivers/power/supply/ab8500_fg.c
··· 225 225 struct ab8500_fg_avg_cap avg_cap; 226 226 struct ab8500 *parent; 227 227 struct iio_channel *main_bat_v; 228 - struct abx500_bm_data *bm; 228 + struct ab8500_bm_data *bm; 229 229 struct power_supply *fg_psy; 230 230 struct workqueue_struct *fg_wq; 231 231 struct delayed_work fg_periodic_work; ··· 854 854 static int ab8500_fg_volt_to_capacity(struct ab8500_fg *di, int voltage) 855 855 { 856 856 int i, tbl_size; 857 - const struct abx500_v_to_cap *tbl; 857 + const struct ab8500_v_to_cap *tbl; 858 858 int cap = 0; 859 859 860 860 tbl = di->bm->bat_type[di->bm->batt_id].v_to_cap_tbl; ··· 2233 2233 case POWER_SUPPLY_TYPE_BATTERY: 2234 2234 if (!di->flags.batt_id_received && 2235 2235 di->bm->batt_id != BATTERY_UNKNOWN) { 2236 - const struct abx500_battery_type *b; 2236 + const struct ab8500_battery_type *b; 2237 2237 2238 2238 b = &(di->bm->bat_type[di->bm->batt_id]); 2239 2239