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

Commit a24252e6 authored by Ashay Jaiswal's avatar Ashay Jaiswal Committed by Gerrit - the friendly Code Review server
Browse files

power: qpnp-fg: fix capacity learning wake-up source handling



In case of hardware coulomb counting based capacity learning the
wake-up source is not released in error conditions. Fix the same.

CRs-Fixed: 977956
Change-Id: I816642281aa2663b504ef3532653ff49aecc4f30
Signed-off-by: default avatarAshay Jaiswal <ashayj@codeaurora.org>
parent 53d1dd96
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -2944,11 +2944,8 @@ static void fg_cap_learning_work(struct work_struct *work)
		goto fail;
	}

	if (chip->wa_flag & USE_CC_SOC_REG) {
		mutex_unlock(&chip->learning_data.learning_lock);
		fg_relax(&chip->capacity_learning_wakeup_source);
		return;
	}
	if (chip->wa_flag & USE_CC_SOC_REG)
		goto fail;

	fg_mem_lock(chip);

@@ -2979,6 +2976,8 @@ static void fg_cap_learning_work(struct work_struct *work)
		pr_info("total_cc_uah = %lld\n", chip->learning_data.cc_uah);

fail:
	if (chip->wa_flag & USE_CC_SOC_REG)
		fg_relax(&chip->capacity_learning_wakeup_source);
	mutex_unlock(&chip->learning_data.learning_lock);
	return;