qcom: smblib: report discharging in case of input OV
The register BATTERY_CHARGER_STATUS continues to show charging state (like FULLON or TAPER mode) in cases where charging was paused due to input OV. Look at BATTERY_CHARGER_STATUS_7_REG to determine if charging was paused. This fix modifies previous similar change for JEITA hard condition but continue to cover the case. Change-Id: Ibc5f4f5e85651708b656f06814008b0c319db02d Signed-off-by: Harry Yang <harryy@codeaurora.org>
This commit is contained in:
parent
d5311c5d43
commit
d8c64ab421
1 changed files with 4 additions and 2 deletions
|
@ -1537,14 +1537,16 @@ int smblib_get_prop_batt_status(struct smb_charger *chg,
|
|||
if (val->intval != POWER_SUPPLY_STATUS_CHARGING)
|
||||
return 0;
|
||||
|
||||
rc = smblib_read(chg, BATTERY_CHARGER_STATUS_2_REG, &stat);
|
||||
rc = smblib_read(chg, BATTERY_CHARGER_STATUS_7_REG, &stat);
|
||||
if (rc < 0) {
|
||||
smblib_err(chg, "Couldn't read BATTERY_CHARGER_STATUS_2 rc=%d\n",
|
||||
rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (stat & (BAT_TEMP_STATUS_TOO_HOT_BIT | BAT_TEMP_STATUS_TOO_COLD_BIT))
|
||||
stat &= ENABLE_TRICKLE_BIT | ENABLE_PRE_CHARGING_BIT |
|
||||
ENABLE_FAST_CHARGING_BIT | ENABLE_FULLON_MODE_BIT;
|
||||
if (!stat)
|
||||
val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING;
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue