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

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

power: qpnp-fg: read rslow configuration during hw_init



Currently, rslow compensation active settings are applied and
cleared based on certain conditions. However, if the device goes
for a reset, the flag used by FG driver to save the setting done
will vanish. For e.g. if an active setting is applied and the
device goes for a reset, even if there is a condition present to
clear the active setting, it will not be applied. This is due to
the fact that the flag (rslow_comp.active) is not set in first
place even though FG HW has that setting applied. Fix this by
reading rslow configuration during hw_init and set the flag.

CRs-Fixed: 977626
Change-Id: Ib6d9f7d79335b027f7ed7ee24dfd5c9bb303228d
Signed-off-by: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
parent 2547bf57
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -6266,6 +6266,20 @@ static int fg_common_hw_init(struct fg_chip *chip)
		if (fg_debug_mask & FG_STATUS)
			pr_info("imptr_pulse_slow is %sabled\n",
				chip->imptr_pulse_slow_en ? "en" : "dis");

		rc = fg_mem_read(chip, &val, RSLOW_CFG_REG, 1, RSLOW_CFG_OFFSET,
				0);
		if (rc) {
			pr_err("unable to read rslow cfg: %d\n", rc);
			return rc;
		}

		if (val & RSLOW_CFG_ON_VAL)
			chip->rslow_comp.active = true;

		if (fg_debug_mask & FG_STATUS)
			pr_info("rslow_comp active is %sabled\n",
				chip->rslow_comp.active ? "en" : "dis");
	}

	return 0;