power: qti_battery_charger: call power_supply_changed() if fake_soc is set

There are clients who are waiting for power supply change events
when fake soc is set during testing. Call power_supply_changed()
to support them.

Change-Id: I6a1f4e7daa136b3783f5ed35f37abafad7447378
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
This commit is contained in:
Subbaraman Narayanamurthy 2020-06-10 15:51:04 -07:00 committed by Anjelique Melendez
parent 70b2ee4bf0
commit de1b381518

View File

@ -864,6 +864,7 @@ static ssize_t fake_soc_store(struct class *c, struct class_attribute *attr,
{
struct battery_chg_dev *bcdev = container_of(c, struct battery_chg_dev,
battery_class);
struct psy_state *pst = &bcdev->psy_list[PSY_TYPE_BATTERY];
int val;
if (kstrtoint(buf, 0, &val))
@ -872,6 +873,9 @@ static ssize_t fake_soc_store(struct class *c, struct class_attribute *attr,
bcdev->fake_soc = val;
pr_debug("Set fake soc to %d\n", val);
if (IS_ENABLED(CONFIG_QTI_PMIC_GLINK_CLIENT_DEBUG) && pst->psy)
power_supply_changed(pst->psy);
return count;
}