Merge "smb-lib: report FULL regardless of charger presence"

This commit is contained in:
Linux Build Service Account 2016-12-19 17:04:36 -08:00 committed by Gerrit - the friendly Code Review server
commit f5145b90f3

View file

@ -1145,32 +1145,9 @@ int smblib_get_prop_batt_capacity(struct smb_charger *chg,
int smblib_get_prop_batt_status(struct smb_charger *chg,
union power_supply_propval *val)
{
union power_supply_propval pval = {0, };
bool usb_online, dc_online;
u8 stat;
int rc;
rc = smblib_get_prop_usb_online(chg, &pval);
if (rc < 0) {
smblib_err(chg, "Couldn't get usb online property rc=%d\n",
rc);
return rc;
}
usb_online = (bool)pval.intval;
rc = smblib_get_prop_dc_online(chg, &pval);
if (rc < 0) {
smblib_err(chg, "Couldn't get dc online property rc=%d\n",
rc);
return rc;
}
dc_online = (bool)pval.intval;
if (!usb_online && !dc_online) {
val->intval = POWER_SUPPLY_STATUS_DISCHARGING;
return rc;
}
rc = smblib_read(chg, BATTERY_CHARGER_STATUS_1_REG, &stat);
if (rc < 0) {
smblib_err(chg, "Couldn't read BATTERY_CHARGER_STATUS_1 rc=%d\n",