Currently the SOC in userspace is not being updated with the latest SOC
from the fuel gauge. Add power supply changed events when the delta SOC
interrupt fires, empty SOC interrupt fires, or when the charging status
changes to full.
Change-Id: I4bbf404639a97dcc443c9ecc8391623e2fff13fd
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
if (chip->cyc_ctr.en)
schedule_work(&chip->cycle_count_work);
+ if (is_charger_available(chip))
+ power_supply_changed(chip->batt_psy);
+
fg_dbg(chip, FG_IRQ, "irq %d triggered\n", irq);
return IRQ_HANDLED;
}
{
struct fg_chip *chip = data;
+ if (is_charger_available(chip))
+ power_supply_changed(chip->batt_psy);
+
fg_dbg(chip, FG_IRQ, "irq %d triggered\n", irq);
return IRQ_HANDLED;
}
dev_err(chg->dev, "Couldn't get batt status type rc=%d\n", rc);
return IRQ_HANDLED;
}
- if (pval.intval == POWER_SUPPLY_STATUS_FULL)
+ if (pval.intval == POWER_SUPPLY_STATUS_FULL) {
+ power_supply_changed(chg->batt_psy);
vote(chg->pl_disable_votable, TAPER_END_VOTER, false, 0);
+ }
return IRQ_HANDLED;
}