mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 05:39:54 -04:00
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:
parent
063759141a
commit
a8800b4bb0
1 changed files with 4 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue