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

Commit 6c0a5377 authored by Abhijeet Dharmapurikar's avatar Abhijeet Dharmapurikar
Browse files

power: qpnp-smbcharger: reduce USB ICL to 500mA while shutting down



In the shutdown path the driver resets PMI's USB ICL to HVDCP limits while
disabling parallel charger and right after that the driver reruns AICL
by momentarily disabling it. Some HVDCP chargers collapse during this
time because the PMI attempts to draw the HVDCP limit current (default
2.7A).

To avoid this situation, reduce ICL to 500mA. The system is going to
shutdown and even though this register is dVdd backed, the CSIR
initialization will reset the ICL back to a higher value.

CRs-Fixed: 991066
Change-Id: I690b604435b03779cef40314bba262d4c684a7c0
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent 89be600d
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -343,6 +343,7 @@ enum icl_voters {
	WEAK_CHARGER_ICL_VOTER,
	WEAK_CHARGER_ICL_VOTER,
	SW_AICL_ICL_VOTER,
	SW_AICL_ICL_VOTER,
	CHG_SUSPEND_WORKAROUND_ICL_VOTER,
	CHG_SUSPEND_WORKAROUND_ICL_VOTER,
	SHUTDOWN_WORKAROUND_ICL_VOTER,
	NUM_ICL_VOTER,
	NUM_ICL_VOTER,
};
};


@@ -8258,6 +8259,12 @@ static void smbchg_shutdown(struct spmi_device *spmi)
	if (!is_hvdcp_present(chip))
	if (!is_hvdcp_present(chip))
		return;
		return;


	pr_smb(PR_MISC, "Reducing to 500mA\n");
	rc = vote(chip->usb_icl_votable, SHUTDOWN_WORKAROUND_ICL_VOTER, true,
			500);
	if (rc < 0)
		pr_err("Couldn't vote 500mA ICL\n");

	pr_smb(PR_MISC, "Disable Parallel\n");
	pr_smb(PR_MISC, "Disable Parallel\n");
	mutex_lock(&chip->parallel.lock);
	mutex_lock(&chip->parallel.lock);
	smbchg_parallel_en = 0;
	smbchg_parallel_en = 0;