power: pm8921-charger: prevent recharging when batt is overheat

When battery is forced to stop charging by overheat, re-charging
should not be initiated even if re-charging condition is satisfied.

Change-Id: I0070039a186ccf3f12c0e79a8696a7aa3c61e538
This commit is contained in:
choongryeol.lee 2012-09-20 21:50:16 -07:00 committed by Iliyan Malchev
parent e62e15cc2e
commit 0338875786
3 changed files with 21 additions and 2 deletions

View file

@ -1962,8 +1962,10 @@ static int is_recharging(struct pm8921_bms_chip *chip, int soc)
{
if (soc == -EINVAL)
return 0;
if (pm8921_get_batt_state() == POWER_SUPPLY_STATUS_FULL
&& soc < 100)
if ((pm8921_get_batt_state() == POWER_SUPPLY_STATUS_FULL)
&& (soc < 100)
&& (pm8921_get_batt_health()
!= POWER_SUPPLY_HEALTH_OVERHEAT))
return 1;
return 0;
}

View file

@ -2098,6 +2098,22 @@ int pm8921_get_batt_state(void)
}
EXPORT_SYMBOL(pm8921_get_batt_state);
int pm8921_get_batt_health(void)
{
int batt_health;
if (!the_chip) {
pr_err("called before init\n");
return -EINVAL;
}
batt_health = get_prop_batt_health(the_chip);
pr_debug("batt health = %d\n", batt_health);
return batt_health;
}
EXPORT_SYMBOL(pm8921_get_batt_health);
int pm8921_batt_temperature(void)
{
if (!the_chip) {

View file

@ -288,6 +288,7 @@ int pm8921_usb_ovp_disable(int disable);
int pm8921_get_batt_state(void);
int pm8921_force_start_charging(void);
int pm8921_get_batt_health(void);
/**
* pm8921_is_batfet_closed - battery fet status