power: supply: qcom_fg: Report online property
This commit is contained in:
parent
f96cfaff29
commit
1918745f5f
2 changed files with 6 additions and 0 deletions
|
|
@ -594,6 +594,7 @@ int qcom_fg_get_prop_batt_status(struct qcom_fg_chip *chip, int *val){
|
|||
}
|
||||
dev_dbg(chip->dev, "USB ONLINE val : %d\n", usb_online_val);
|
||||
usb_online = (bool)usb_online_val;
|
||||
chip->online = usb_online;
|
||||
|
||||
if (!usb_online) {
|
||||
*val = POWER_SUPPLY_STATUS_DISCHARGING;
|
||||
|
|
@ -828,6 +829,9 @@ static int fg_get_property(struct power_supply *psy,
|
|||
case POWER_SUPPLY_PROP_STATUS:
|
||||
error = chip->ops->get_batt_status(chip, &val->intval);
|
||||
break;
|
||||
case POWER_SUPPLY_PROP_ONLINE:
|
||||
val->intval = chip->online;
|
||||
break;
|
||||
case POWER_SUPPLY_PROP_HEALTH:
|
||||
error = chip->ops->get_health_status(chip, &val->intval);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -125,6 +125,7 @@ static enum power_supply_property fg_properties[] = {
|
|||
POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
|
||||
POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN,
|
||||
POWER_SUPPLY_PROP_STATUS,
|
||||
POWER_SUPPLY_PROP_ONLINE,
|
||||
POWER_SUPPLY_PROP_HEALTH,
|
||||
POWER_SUPPLY_PROP_CHARGE_FULL,
|
||||
POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
|
||||
|
|
@ -171,4 +172,5 @@ struct qcom_fg_chip {
|
|||
|
||||
int health;
|
||||
int status;
|
||||
bool online;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue