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

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

power: qpnp-fg: update SRAM data when batt_profile_init is rescheduled



When the charger driver haven't been probed yet and batt_psy is
unavailable, batt_profile_init is rescheduled as it depends on
the charger to disable charging while loading profile. However,
this adds a constraint that SRAM parameters needs to be updated
every time just before batt_profile_init is called again. Else,
stale SRAM parameters will be used to decide whether the battery
profile can be loaded or not.

Hence, cancel and schedule the update_sram_data work whenever
battery profile loading is rescheduled again.

CRs-Fixed: 953448
Change-Id: I6e1108601baf744014227155b7b09e0ec4a0a9bb
Signed-off-by: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
parent 184e2ced
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -4806,6 +4806,10 @@ reschedule:
	schedule_delayed_work(
		&chip->batt_profile_init,
		msecs_to_jiffies(BATTERY_PSY_WAIT_MS));
	cancel_delayed_work(&chip->update_sram_data);
	schedule_delayed_work(
		&chip->update_sram_data,
		msecs_to_jiffies(0));
	fg_relax(&chip->profile_wakeup_source);
	return 0;
}