Merge "smb-lib: report FULL regardless of charger presence"
This commit is contained in:
commit
f5145b90f3
1 changed files with 0 additions and 23 deletions
|
@ -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",
|
||||
|
|
Loading…
Add table
Reference in a new issue