Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8800b4b authored by Subbaraman Narayanamurthy's avatar Subbaraman Narayanamurthy
Browse files

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: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
parent 06375914
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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;
}