aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power/abx500_chargalg.c
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2012-11-30 05:09:42 -0500
committerLee Jones <lee.jones@linaro.org>2012-12-11 03:43:53 -0500
commitb0284de05e07d56ff7de154d0c9263788755f5eb (patch)
tree31821d80be26bdbc701f86192da26489d30c3d9a /drivers/power/abx500_chargalg.c
parent8e3a71e56c8c48862015ecf1ae0b9362dc28a453 (diff)
ab8500_bm: Rename battery management platform data to something more logical
The platform specific battery management configuration data structure is currently called 'bat' short for 'battery'; however, it contains information for all components of the battery management group, rather than information pertaining to the battery itself - there are other structures for that. So, in keeping with its structure namesake 'abx500_bm_data', we rename it to 'bm' here. Using similar logic, we're also renaming 'bmdevs_of_probe' to the more device specific 'ab8500_bm_of_probe'. Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/power/abx500_chargalg.c')
-rw-r--r--drivers/power/abx500_chargalg.c112
1 files changed, 56 insertions, 56 deletions
diff --git a/drivers/power/abx500_chargalg.c b/drivers/power/abx500_chargalg.c
index dcdc4393b9e7..ea2e2eb652ef 100644
--- a/drivers/power/abx500_chargalg.c
+++ b/drivers/power/abx500_chargalg.c
@@ -207,7 +207,7 @@ enum maxim_ret {
207 * @chg_info: information about connected charger types 207 * @chg_info: information about connected charger types
208 * @batt_data: data of the battery 208 * @batt_data: data of the battery
209 * @susp_status: current charger suspension status 209 * @susp_status: current charger suspension status
210 * @bat: pointer to the abx500_bm platform data 210 * @bm: Platform specific battery management information
211 * @chargalg_psy: structure that holds the battery properties exposed by 211 * @chargalg_psy: structure that holds the battery properties exposed by
212 * the charging algorithm 212 * the charging algorithm
213 * @events: structure for information about events triggered 213 * @events: structure for information about events triggered
@@ -232,7 +232,7 @@ struct abx500_chargalg {
232 struct abx500_chargalg_charger_info chg_info; 232 struct abx500_chargalg_charger_info chg_info;
233 struct abx500_chargalg_battery_data batt_data; 233 struct abx500_chargalg_battery_data batt_data;
234 struct abx500_chargalg_suspension_status susp_status; 234 struct abx500_chargalg_suspension_status susp_status;
235 struct abx500_bm_data *bat; 235 struct abx500_bm_data *bm;
236 struct power_supply chargalg_psy; 236 struct power_supply chargalg_psy;
237 struct ux500_charger *ac_chg; 237 struct ux500_charger *ac_chg;
238 struct ux500_charger *usb_chg; 238 struct ux500_charger *usb_chg;
@@ -367,13 +367,13 @@ static void abx500_chargalg_start_safety_timer(struct abx500_chargalg *di)
367 case AC_CHG: 367 case AC_CHG:
368 timer_expiration = 368 timer_expiration =
369 round_jiffies(jiffies + 369 round_jiffies(jiffies +
370 (di->bat->main_safety_tmr_h * 3600 * HZ)); 370 (di->bm->main_safety_tmr_h * 3600 * HZ));
371 break; 371 break;
372 372
373 case USB_CHG: 373 case USB_CHG:
374 timer_expiration = 374 timer_expiration =
375 round_jiffies(jiffies + 375 round_jiffies(jiffies +
376 (di->bat->usb_safety_tmr_h * 3600 * HZ)); 376 (di->bm->usb_safety_tmr_h * 3600 * HZ));
377 break; 377 break;
378 378
379 default: 379 default:
@@ -638,32 +638,32 @@ static void abx500_chargalg_start_charging(struct abx500_chargalg *di,
638 */ 638 */
639static void abx500_chargalg_check_temp(struct abx500_chargalg *di) 639static void abx500_chargalg_check_temp(struct abx500_chargalg *di)
640{ 640{
641 if (di->batt_data.temp > (di->bat->temp_low + di->t_hyst_norm) && 641 if (di->batt_data.temp > (di->bm->temp_low + di->t_hyst_norm) &&
642 di->batt_data.temp < (di->bat->temp_high - di->t_hyst_norm)) { 642 di->batt_data.temp < (di->bm->temp_high - di->t_hyst_norm)) {
643 /* Temp OK! */ 643 /* Temp OK! */
644 di->events.btemp_underover = false; 644 di->events.btemp_underover = false;
645 di->events.btemp_lowhigh = false; 645 di->events.btemp_lowhigh = false;
646 di->t_hyst_norm = 0; 646 di->t_hyst_norm = 0;
647 di->t_hyst_lowhigh = 0; 647 di->t_hyst_lowhigh = 0;
648 } else { 648 } else {
649 if (((di->batt_data.temp >= di->bat->temp_high) && 649 if (((di->batt_data.temp >= di->bm->temp_high) &&
650 (di->batt_data.temp < 650 (di->batt_data.temp <
651 (di->bat->temp_over - di->t_hyst_lowhigh))) || 651 (di->bm->temp_over - di->t_hyst_lowhigh))) ||
652 ((di->batt_data.temp > 652 ((di->batt_data.temp >
653 (di->bat->temp_under + di->t_hyst_lowhigh)) && 653 (di->bm->temp_under + di->t_hyst_lowhigh)) &&
654 (di->batt_data.temp <= di->bat->temp_low))) { 654 (di->batt_data.temp <= di->bm->temp_low))) {
655 /* TEMP minor!!!!! */ 655 /* TEMP minor!!!!! */
656 di->events.btemp_underover = false; 656 di->events.btemp_underover = false;
657 di->events.btemp_lowhigh = true; 657 di->events.btemp_lowhigh = true;
658 di->t_hyst_norm = di->bat->temp_hysteresis; 658 di->t_hyst_norm = di->bm->temp_hysteresis;
659 di->t_hyst_lowhigh = 0; 659 di->t_hyst_lowhigh = 0;
660 } else if (di->batt_data.temp <= di->bat->temp_under || 660 } else if (di->batt_data.temp <= di->bm->temp_under ||
661 di->batt_data.temp >= di->bat->temp_over) { 661 di->batt_data.temp >= di->bm->temp_over) {
662 /* TEMP major!!!!! */ 662 /* TEMP major!!!!! */
663 di->events.btemp_underover = true; 663 di->events.btemp_underover = true;
664 di->events.btemp_lowhigh = false; 664 di->events.btemp_lowhigh = false;
665 di->t_hyst_norm = 0; 665 di->t_hyst_norm = 0;
666 di->t_hyst_lowhigh = di->bat->temp_hysteresis; 666 di->t_hyst_lowhigh = di->bm->temp_hysteresis;
667 } else { 667 } else {
668 /* Within hysteresis */ 668 /* Within hysteresis */
669 dev_dbg(di->dev, "Within hysteresis limit temp: %d " 669 dev_dbg(di->dev, "Within hysteresis limit temp: %d "
@@ -682,12 +682,12 @@ static void abx500_chargalg_check_temp(struct abx500_chargalg *di)
682 */ 682 */
683static void abx500_chargalg_check_charger_voltage(struct abx500_chargalg *di) 683static void abx500_chargalg_check_charger_voltage(struct abx500_chargalg *di)
684{ 684{
685 if (di->chg_info.usb_volt > di->bat->chg_params->usb_volt_max) 685 if (di->chg_info.usb_volt > di->bm->chg_params->usb_volt_max)
686 di->chg_info.usb_chg_ok = false; 686 di->chg_info.usb_chg_ok = false;
687 else 687 else
688 di->chg_info.usb_chg_ok = true; 688 di->chg_info.usb_chg_ok = true;
689 689
690 if (di->chg_info.ac_volt > di->bat->chg_params->ac_volt_max) 690 if (di->chg_info.ac_volt > di->bm->chg_params->ac_volt_max)
691 di->chg_info.ac_chg_ok = false; 691 di->chg_info.ac_chg_ok = false;
692 else 692 else
693 di->chg_info.ac_chg_ok = true; 693 di->chg_info.ac_chg_ok = true;
@@ -707,10 +707,10 @@ static void abx500_chargalg_end_of_charge(struct abx500_chargalg *di)
707 if (di->charge_status == POWER_SUPPLY_STATUS_CHARGING && 707 if (di->charge_status == POWER_SUPPLY_STATUS_CHARGING &&
708 di->charge_state == STATE_NORMAL && 708 di->charge_state == STATE_NORMAL &&
709 !di->maintenance_chg && (di->batt_data.volt >= 709 !di->maintenance_chg && (di->batt_data.volt >=
710 di->bat->bat_type[di->bat->batt_id].termination_vol || 710 di->bm->bat_type[di->bm->batt_id].termination_vol ||
711 di->events.usb_cv_active || di->events.ac_cv_active) && 711 di->events.usb_cv_active || di->events.ac_cv_active) &&
712 di->batt_data.avg_curr < 712 di->batt_data.avg_curr <
713 di->bat->bat_type[di->bat->batt_id].termination_curr && 713 di->bm->bat_type[di->bm->batt_id].termination_curr &&
714 di->batt_data.avg_curr > 0) { 714 di->batt_data.avg_curr > 0) {
715 if (++di->eoc_cnt >= EOC_COND_CNT) { 715 if (++di->eoc_cnt >= EOC_COND_CNT) {
716 di->eoc_cnt = 0; 716 di->eoc_cnt = 0;
@@ -733,12 +733,12 @@ static void abx500_chargalg_end_of_charge(struct abx500_chargalg *di)
733static void init_maxim_chg_curr(struct abx500_chargalg *di) 733static void init_maxim_chg_curr(struct abx500_chargalg *di)
734{ 734{
735 di->ccm.original_iset = 735 di->ccm.original_iset =
736 di->bat->bat_type[di->bat->batt_id].normal_cur_lvl; 736 di->bm->bat_type[di->bm->batt_id].normal_cur_lvl;
737 di->ccm.current_iset = 737 di->ccm.current_iset =
738 di->bat->bat_type[di->bat->batt_id].normal_cur_lvl; 738 di->bm->bat_type[di->bm->batt_id].normal_cur_lvl;
739 di->ccm.test_delta_i = di->bat->maxi->charger_curr_step; 739 di->ccm.test_delta_i = di->bm->maxi->charger_curr_step;
740 di->ccm.max_current = di->bat->maxi->chg_curr; 740 di->ccm.max_current = di->bm->maxi->chg_curr;
741 di->ccm.condition_cnt = di->bat->maxi->wait_cycles; 741 di->ccm.condition_cnt = di->bm->maxi->wait_cycles;
742 di->ccm.level = 0; 742 di->ccm.level = 0;
743} 743}
744 744
@@ -755,7 +755,7 @@ static enum maxim_ret abx500_chargalg_chg_curr_maxim(struct abx500_chargalg *di)
755{ 755{
756 int delta_i; 756 int delta_i;
757 757
758 if (!di->bat->maxi->ena_maxi) 758 if (!di->bm->maxi->ena_maxi)
759 return MAXIM_RET_NOACTION; 759 return MAXIM_RET_NOACTION;
760 760
761 delta_i = di->ccm.original_iset - di->batt_data.inst_curr; 761 delta_i = di->ccm.original_iset - di->batt_data.inst_curr;
@@ -766,7 +766,7 @@ static enum maxim_ret abx500_chargalg_chg_curr_maxim(struct abx500_chargalg *di)
766 if (di->ccm.wait_cnt == 0) { 766 if (di->ccm.wait_cnt == 0) {
767 dev_dbg(di->dev, "lowering current\n"); 767 dev_dbg(di->dev, "lowering current\n");
768 di->ccm.wait_cnt++; 768 di->ccm.wait_cnt++;
769 di->ccm.condition_cnt = di->bat->maxi->wait_cycles; 769 di->ccm.condition_cnt = di->bm->maxi->wait_cycles;
770 di->ccm.max_current = 770 di->ccm.max_current =
771 di->ccm.current_iset - di->ccm.test_delta_i; 771 di->ccm.current_iset - di->ccm.test_delta_i;
772 di->ccm.current_iset = di->ccm.max_current; 772 di->ccm.current_iset = di->ccm.max_current;
@@ -791,7 +791,7 @@ static enum maxim_ret abx500_chargalg_chg_curr_maxim(struct abx500_chargalg *di)
791 if (di->ccm.current_iset == di->ccm.original_iset) 791 if (di->ccm.current_iset == di->ccm.original_iset)
792 return MAXIM_RET_NOACTION; 792 return MAXIM_RET_NOACTION;
793 793
794 di->ccm.condition_cnt = di->bat->maxi->wait_cycles; 794 di->ccm.condition_cnt = di->bm->maxi->wait_cycles;
795 di->ccm.current_iset = di->ccm.original_iset; 795 di->ccm.current_iset = di->ccm.original_iset;
796 di->ccm.level = 0; 796 di->ccm.level = 0;
797 797
@@ -803,7 +803,7 @@ static enum maxim_ret abx500_chargalg_chg_curr_maxim(struct abx500_chargalg *di)
803 di->ccm.max_current) { 803 di->ccm.max_current) {
804 if (di->ccm.condition_cnt-- == 0) { 804 if (di->ccm.condition_cnt-- == 0) {
805 /* Increse the iset with cco.test_delta_i */ 805 /* Increse the iset with cco.test_delta_i */
806 di->ccm.condition_cnt = di->bat->maxi->wait_cycles; 806 di->ccm.condition_cnt = di->bm->maxi->wait_cycles;
807 di->ccm.current_iset += di->ccm.test_delta_i; 807 di->ccm.current_iset += di->ccm.test_delta_i;
808 di->ccm.level++; 808 di->ccm.level++;
809 dev_dbg(di->dev, " Maximization needed, increase" 809 dev_dbg(di->dev, " Maximization needed, increase"
@@ -818,7 +818,7 @@ static enum maxim_ret abx500_chargalg_chg_curr_maxim(struct abx500_chargalg *di)
818 return MAXIM_RET_NOACTION; 818 return MAXIM_RET_NOACTION;
819 } 819 }
820 } else { 820 } else {
821 di->ccm.condition_cnt = di->bat->maxi->wait_cycles; 821 di->ccm.condition_cnt = di->bm->maxi->wait_cycles;
822 return MAXIM_RET_NOACTION; 822 return MAXIM_RET_NOACTION;
823 } 823 }
824} 824}
@@ -838,7 +838,7 @@ static void handle_maxim_chg_curr(struct abx500_chargalg *di)
838 break; 838 break;
839 case MAXIM_RET_IBAT_TOO_HIGH: 839 case MAXIM_RET_IBAT_TOO_HIGH:
840 result = abx500_chargalg_update_chg_curr(di, 840 result = abx500_chargalg_update_chg_curr(di,
841 di->bat->bat_type[di->bat->batt_id].normal_cur_lvl); 841 di->bm->bat_type[di->bm->batt_id].normal_cur_lvl);
842 if (result) 842 if (result)
843 dev_err(di->dev, "failed to set chg curr\n"); 843 dev_err(di->dev, "failed to set chg curr\n");
844 break; 844 break;
@@ -1210,7 +1210,7 @@ static void abx500_chargalg_algorithm(struct abx500_chargalg *di)
1210 * this way 1210 * this way
1211 */ 1211 */
1212 if (!charger_status || 1212 if (!charger_status ||
1213 (di->events.batt_unknown && !di->bat->chg_unknown_bat)) { 1213 (di->events.batt_unknown && !di->bm->chg_unknown_bat)) {
1214 if (di->charge_state != STATE_HANDHELD) { 1214 if (di->charge_state != STATE_HANDHELD) {
1215 di->events.safety_timer_expired = false; 1215 di->events.safety_timer_expired = false;
1216 abx500_chargalg_state_to(di, STATE_HANDHELD_INIT); 1216 abx500_chargalg_state_to(di, STATE_HANDHELD_INIT);
@@ -1394,8 +1394,8 @@ static void abx500_chargalg_algorithm(struct abx500_chargalg *di)
1394 1394
1395 case STATE_NORMAL_INIT: 1395 case STATE_NORMAL_INIT:
1396 abx500_chargalg_start_charging(di, 1396 abx500_chargalg_start_charging(di,
1397 di->bat->bat_type[di->bat->batt_id].normal_vol_lvl, 1397 di->bm->bat_type[di->bm->batt_id].normal_vol_lvl,
1398 di->bat->bat_type[di->bat->batt_id].normal_cur_lvl); 1398 di->bm->bat_type[di->bm->batt_id].normal_cur_lvl);
1399 abx500_chargalg_state_to(di, STATE_NORMAL); 1399 abx500_chargalg_state_to(di, STATE_NORMAL);
1400 abx500_chargalg_start_safety_timer(di); 1400 abx500_chargalg_start_safety_timer(di);
1401 abx500_chargalg_stop_maintenance_timer(di); 1401 abx500_chargalg_stop_maintenance_timer(di);
@@ -1411,7 +1411,7 @@ static void abx500_chargalg_algorithm(struct abx500_chargalg *di)
1411 handle_maxim_chg_curr(di); 1411 handle_maxim_chg_curr(di);
1412 if (di->charge_status == POWER_SUPPLY_STATUS_FULL && 1412 if (di->charge_status == POWER_SUPPLY_STATUS_FULL &&
1413 di->maintenance_chg) { 1413 di->maintenance_chg) {
1414 if (di->bat->no_maintenance) 1414 if (di->bm->no_maintenance)
1415 abx500_chargalg_state_to(di, 1415 abx500_chargalg_state_to(di,
1416 STATE_WAIT_FOR_RECHARGE_INIT); 1416 STATE_WAIT_FOR_RECHARGE_INIT);
1417 else 1417 else
@@ -1429,7 +1429,7 @@ static void abx500_chargalg_algorithm(struct abx500_chargalg *di)
1429 1429
1430 case STATE_WAIT_FOR_RECHARGE: 1430 case STATE_WAIT_FOR_RECHARGE:
1431 if (di->batt_data.volt <= 1431 if (di->batt_data.volt <=
1432 di->bat->bat_type[di->bat->batt_id].recharge_vol) { 1432 di->bm->bat_type[di->bm->batt_id].recharge_vol) {
1433 if (di->rch_cnt-- == 0) 1433 if (di->rch_cnt-- == 0)
1434 abx500_chargalg_state_to(di, STATE_NORMAL_INIT); 1434 abx500_chargalg_state_to(di, STATE_NORMAL_INIT);
1435 } else 1435 } else
@@ -1439,13 +1439,13 @@ static void abx500_chargalg_algorithm(struct abx500_chargalg *di)
1439 case STATE_MAINTENANCE_A_INIT: 1439 case STATE_MAINTENANCE_A_INIT:
1440 abx500_chargalg_stop_safety_timer(di); 1440 abx500_chargalg_stop_safety_timer(di);
1441 abx500_chargalg_start_maintenance_timer(di, 1441 abx500_chargalg_start_maintenance_timer(di,
1442 di->bat->bat_type[ 1442 di->bm->bat_type[
1443 di->bat->batt_id].maint_a_chg_timer_h); 1443 di->bm->batt_id].maint_a_chg_timer_h);
1444 abx500_chargalg_start_charging(di, 1444 abx500_chargalg_start_charging(di,
1445 di->bat->bat_type[ 1445 di->bm->bat_type[
1446 di->bat->batt_id].maint_a_vol_lvl, 1446 di->bm->batt_id].maint_a_vol_lvl,
1447 di->bat->bat_type[ 1447 di->bm->bat_type[
1448 di->bat->batt_id].maint_a_cur_lvl); 1448 di->bm->batt_id].maint_a_cur_lvl);
1449 abx500_chargalg_state_to(di, STATE_MAINTENANCE_A); 1449 abx500_chargalg_state_to(di, STATE_MAINTENANCE_A);
1450 power_supply_changed(&di->chargalg_psy); 1450 power_supply_changed(&di->chargalg_psy);
1451 /* Intentional fallthrough*/ 1451 /* Intentional fallthrough*/
@@ -1459,13 +1459,13 @@ static void abx500_chargalg_algorithm(struct abx500_chargalg *di)
1459 1459
1460 case STATE_MAINTENANCE_B_INIT: 1460 case STATE_MAINTENANCE_B_INIT:
1461 abx500_chargalg_start_maintenance_timer(di, 1461 abx500_chargalg_start_maintenance_timer(di,
1462 di->bat->bat_type[ 1462 di->bm->bat_type[
1463 di->bat->batt_id].maint_b_chg_timer_h); 1463 di->bm->batt_id].maint_b_chg_timer_h);
1464 abx500_chargalg_start_charging(di, 1464 abx500_chargalg_start_charging(di,
1465 di->bat->bat_type[ 1465 di->bm->bat_type[
1466 di->bat->batt_id].maint_b_vol_lvl, 1466 di->bm->batt_id].maint_b_vol_lvl,
1467 di->bat->bat_type[ 1467 di->bm->bat_type[
1468 di->bat->batt_id].maint_b_cur_lvl); 1468 di->bm->batt_id].maint_b_cur_lvl);
1469 abx500_chargalg_state_to(di, STATE_MAINTENANCE_B); 1469 abx500_chargalg_state_to(di, STATE_MAINTENANCE_B);
1470 power_supply_changed(&di->chargalg_psy); 1470 power_supply_changed(&di->chargalg_psy);
1471 /* Intentional fallthrough*/ 1471 /* Intentional fallthrough*/
@@ -1479,10 +1479,10 @@ static void abx500_chargalg_algorithm(struct abx500_chargalg *di)
1479 1479
1480 case STATE_TEMP_LOWHIGH_INIT: 1480 case STATE_TEMP_LOWHIGH_INIT:
1481 abx500_chargalg_start_charging(di, 1481 abx500_chargalg_start_charging(di,
1482 di->bat->bat_type[ 1482 di->bm->bat_type[
1483 di->bat->batt_id].low_high_vol_lvl, 1483 di->bm->batt_id].low_high_vol_lvl,
1484 di->bat->bat_type[ 1484 di->bm->bat_type[
1485 di->bat->batt_id].low_high_cur_lvl); 1485 di->bm->batt_id].low_high_cur_lvl);
1486 abx500_chargalg_stop_maintenance_timer(di); 1486 abx500_chargalg_stop_maintenance_timer(di);
1487 di->charge_status = POWER_SUPPLY_STATUS_CHARGING; 1487 di->charge_status = POWER_SUPPLY_STATUS_CHARGING;
1488 abx500_chargalg_state_to(di, STATE_TEMP_LOWHIGH); 1488 abx500_chargalg_state_to(di, STATE_TEMP_LOWHIGH);
@@ -1543,11 +1543,11 @@ static void abx500_chargalg_periodic_work(struct work_struct *work)
1543 if (di->chg_info.conn_chg) 1543 if (di->chg_info.conn_chg)
1544 queue_delayed_work(di->chargalg_wq, 1544 queue_delayed_work(di->chargalg_wq,
1545 &di->chargalg_periodic_work, 1545 &di->chargalg_periodic_work,
1546 di->bat->interval_charging * HZ); 1546 di->bm->interval_charging * HZ);
1547 else 1547 else
1548 queue_delayed_work(di->chargalg_wq, 1548 queue_delayed_work(di->chargalg_wq,
1549 &di->chargalg_periodic_work, 1549 &di->chargalg_periodic_work,
1550 di->bat->interval_not_charging * HZ); 1550 di->bm->interval_not_charging * HZ);
1551} 1551}
1552 1552
1553/** 1553/**
@@ -1614,7 +1614,7 @@ static int abx500_chargalg_get_property(struct power_supply *psy,
1614 if (di->events.batt_ovv) { 1614 if (di->events.batt_ovv) {
1615 val->intval = POWER_SUPPLY_HEALTH_OVERVOLTAGE; 1615 val->intval = POWER_SUPPLY_HEALTH_OVERVOLTAGE;
1616 } else if (di->events.btemp_underover) { 1616 } else if (di->events.btemp_underover) {
1617 if (di->batt_data.temp <= di->bat->temp_under) 1617 if (di->batt_data.temp <= di->bm->temp_under)
1618 val->intval = POWER_SUPPLY_HEALTH_COLD; 1618 val->intval = POWER_SUPPLY_HEALTH_COLD;
1619 else 1619 else
1620 val->intval = POWER_SUPPLY_HEALTH_OVERHEAT; 1620 val->intval = POWER_SUPPLY_HEALTH_OVERHEAT;
@@ -1814,10 +1814,10 @@ static int __devinit abx500_chargalg_probe(struct platform_device *pdev)
1814 dev_err(&pdev->dev, "%s no mem for ab8500_chargalg\n", __func__); 1814 dev_err(&pdev->dev, "%s no mem for ab8500_chargalg\n", __func__);
1815 return -ENOMEM; 1815 return -ENOMEM;
1816 } 1816 }
1817 di->bat = pdev->mfd_cell->platform_data; 1817 di->bm = pdev->mfd_cell->platform_data;
1818 if (!di->bat) { 1818 if (!di->bm) {
1819 if (np) { 1819 if (np) {
1820 ret = bmdevs_of_probe(&pdev->dev, np, &di->bat); 1820 ret = ab8500_bm_of_probe(&pdev->dev, np, &di->bm);
1821 if (ret) { 1821 if (ret) {
1822 dev_err(&pdev->dev, 1822 dev_err(&pdev->dev,
1823 "failed to get battery information\n"); 1823 "failed to get battery information\n");