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

Commit a21367c5 authored by Anirudh Ghayal's avatar Anirudh Ghayal Committed by Gerrit - the friendly Code Review server
Browse files

power: qpnp-qg: Update GOOD_OCV after clearing the old data



The current implementation, during resume clears the stored
FIFO data after updating it with the GOOD_OCV value. Fix this by
clearing the data before storing GOOD_OCV.

Change-Id: I2dd744bf7bbdf13539eb6dedcebab18d381d6216
Signed-off-by: default avatarAnirudh Ghayal <aghayal@codeaurora.org>
parent 46902abd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3460,10 +3460,10 @@ static int process_resume(struct qpnp_qg *chip)
			return rc;
		}

		chip->kdata.param[QG_GOOD_OCV_UV].data = ocv_uv;
		chip->kdata.param[QG_GOOD_OCV_UV].valid = true;
		 /* Clear suspend data as there has been a GOOD OCV */
		memset(&chip->kdata, 0, sizeof(chip->kdata));
		chip->kdata.param[QG_GOOD_OCV_UV].data = ocv_uv;
		chip->kdata.param[QG_GOOD_OCV_UV].valid = true;
		chip->suspend_data = false;

		qg_dbg(chip, QG_DEBUG_PM, "GOOD OCV @ resume good_ocv=%d uV\n",