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

Commit fbd49499 authored by Abhijeet Dharmapurikar's avatar Abhijeet Dharmapurikar Committed by Nicholas Troast
Browse files

qpnp-qnovo: skip taking ESR measurement when disabled



Currently when ptrain_done interrupt is handled, the driver invariably
issues a ESR measurement. This is not required if qnovo is disabled.

Change-Id: I8c81dadc38da69ba7248905af2d772f7ce918239
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent c4205fe6
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1395,6 +1395,17 @@ static irqreturn_t handle_ptrain_done(int irq, void *data)
	struct qnovo *chip = data;
	union power_supply_propval pval = {0};

	/*
	 * In some cases (esp shutting down) the userspace would  disable by
	 * setting qnovo_enable=0. Also charger could be removed or there is
	 * an error (i.e. its not okay to run qnovo)-
	 * skip taking ESR measurement in such situations
	 */

	if (get_client_vote(chip->disable_votable, USER_VOTER)
		|| get_effective_result(chip->not_ok_to_qnovo_votable) > 0)
		return IRQ_HANDLED;

	/*
	 * hw resets pt_en bit once ptrain_done triggers.
	 * vote on behalf of QNI to disable it such that