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

Commit 91324f24 authored by Anirudh Ghayal's avatar Anirudh Ghayal Committed by Jishnu Prakash
Browse files

power: qpnp-qg: Update the qg_esr_mod_count based on fifo-length



Shorter FIFO updates lead to frequent ESR estimation. Avoid this
by updating the esr-estimation frequency based on fifo-length.

Change-Id: I26b3ad75c88d5cbf97766e86710f677e11a77df1
Signed-off-by: default avatarAnirudh Ghayal <aghayal@codeaurora.org>
parent 8809578f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -279,6 +279,7 @@ static int qg_store_soc_params(struct qpnp_qg *chip)
	return rc;
}

#define MAX_FIFO_CNT_FOR_ESR			50
static int qg_config_s2_state(struct qpnp_qg *chip,
		enum s2_state requested_state, bool state_enable,
		bool process_fifo)
@@ -336,6 +337,9 @@ static int qg_config_s2_state(struct qpnp_qg *chip,
		return -EINVAL;
	}

	if (fifo_length)
		qg_esr_mod_count = MAX_FIFO_CNT_FOR_ESR / fifo_length;

	rc = qg_master_hold(chip, true);
	if (rc < 0) {
		pr_err("Failed to hold master, rc=%d\n", rc);