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

Commit 476e837b authored by Subbaraman Narayanamurthy's avatar Subbaraman Narayanamurthy
Browse files

power: qpnp-fg-gen3: Report time_to_full only after SOC is ready



Currently, power supply framework tries to get properties from a
power supply (e.g. bms) as soon as the power supply is registered
when driver probes. Since the profile load work is scheduled to
run after probe, reading time_to_full property spews the log
causing misinterpretation.

Fix it by checking for soc_reporting_ready which will be set once
profile_load work completes its execution.

Change-Id: I3be3d2624efc217b153fb695a2f95fb17b46f972
Signed-off-by: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
parent 5a186617
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2862,6 +2862,9 @@ static int fg_get_time_to_full_locked(struct fg_chip *chip, int *val)
		t_predicted_cv, t_predicted = 0;
	s64 delta_ms;

	if (!chip->soc_reporting_ready)
		return -ENODATA;

	if (chip->bp.float_volt_uv <= 0) {
		pr_err("battery profile is not loaded\n");
		return -ENODATA;