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

Commit f483dea8 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "power: qpnp-fg-gen4: retry ESR fast calibration based on delta ESR count"

parents 76e6c1c3 66267abc
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -2745,13 +2745,14 @@ static irqreturn_t fg_delta_msoc_irq_handler(int irq, void *data)
		pr_err("Error in adjusting ki_coeff_dischg, rc=%d\n", rc);

	/*
	 * If ESR fast calibration is done without a delta ESR interrupt, then
	 * it is possibly a failed attempt. In such cases, retry ESR fast
	 * calibration once again. This will get restored to normal config once
	 * a delta ESR interrupt fires or the timer expires.
	 * If ESR fast calibration is done even before 3 delta ESR interrupts
	 * had fired, then it is possibly a failed attempt. In such cases,
	 * retry ESR fast calibration once again. This will get restored to
	 * normal config once the timer expires or delta ESR interrupt count
	 * reaches the threshold.
	 */
	if (chip->esr_fast_calib && chip->esr_fast_calib_done &&
		!chip->delta_esr_count && !chip->esr_fast_calib_retry) {
		(chip->delta_esr_count < 3) && !chip->esr_fast_calib_retry) {
		rc = fg_gen4_esr_fast_calib_config(chip, true);
		if (rc < 0)
			pr_err("Error in configuring esr_fast_calib, rc=%d\n",