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

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

power: qpnp-fg: Clear VACT_INT_ERROR after IMA error recovery



Currently when the IMA error recovery sequence is executed, we
restore some of the SRAM registers backed up. This includes
VACT_INT_ERROR as well. However, we have to clear VACT_INT_ERROR
for a good starting point after resetting FG. This will help in
accuracy of the SOC reported.

CRs-Fixed: 1039053
Change-Id: I2f908481ae2a265efb3fa29193f5a87fea096449
Signed-off-by: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
parent 42b112dc
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -300,7 +300,7 @@ enum fg_mem_backup_index {

static struct fg_mem_data fg_backup_regs[FG_BACKUP_MAX] = {
	/*       ID           Address, Offset, Length, Value*/
	BACKUP(SOC,		0x560,   0,      28,     -EINVAL),
	BACKUP(SOC,		0x564,   0,      24,     -EINVAL),
	BACKUP(CYCLE_COUNT,	0x5E8,   0,      16,     -EINVAL),
	BACKUP(CC_SOC_COEFF,	0x5BC,   0,      8,     -EINVAL),
	BACKUP(IGAIN,		0x424,   0,      4,     -EINVAL),
@@ -8215,6 +8215,7 @@ static void ima_error_recovery_work(struct work_struct *work)
				ima_error_recovery_work);
	bool tried_again = false;
	int rc;
	u8 buf[4] = {0, 0, 0, 0};

	fg_stay_awake(&chip->fg_reset_wakeup_source);
	mutex_lock(&chip->ima_recovery_lock);
@@ -8340,6 +8341,12 @@ wait:
		goto out;
	}

	rc = fg_mem_write(chip, buf, fg_data[FG_DATA_VINT_ERR].address,
			fg_data[FG_DATA_VINT_ERR].len,
			fg_data[FG_DATA_VINT_ERR].offset, 0);
	if (rc < 0)
		pr_err("Error in clearing VACT_INT_ERR, rc=%d\n", rc);

	if (fg_debug_mask & FG_STATUS)
		pr_info("IMA error recovery done...\n");
out: