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

Commit 7b6eb962 authored by Ashay Jaiswal's avatar Ashay Jaiswal Committed by Harry Yang
Browse files

power: smb-lib: Fix charger type reporting



Charger type gets updated in 'smblib_update_usb_type' function
and this should only be called after completion of APSD.
Update the calling sites of 'smblib_update_usb_type' to use
'smblib_get_apsd_result' instead of 'smblib_update_usb_type'.
This ensures charger type doesn't get updated inadvertently.

CRs-Fixed: 2038837
Change-Id: Iaa380c8f02bb71ad0f4367c16ec39d86d825dfa2
Signed-off-by: default avatarAshay Jaiswal <ashayj@codeaurora.org>
parent d56766f7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2822,7 +2822,7 @@ int smblib_get_prop_fcc_delta(struct smb_charger *chg,
int smblib_get_charge_current(struct smb_charger *chg,
				int *total_current_ua)
{
	const struct apsd_result *apsd_result = smblib_update_usb_type(chg);
	const struct apsd_result *apsd_result = smblib_get_apsd_result(chg);
	union power_supply_propval val = {0, };
	int rc = 0, typec_source_rd, current_ua;
	bool non_compliant;
@@ -3336,7 +3336,7 @@ static void smblib_handle_hvdcp_3p0_auth_done(struct smb_charger *chg,
static void smblib_handle_hvdcp_check_timeout(struct smb_charger *chg,
					      bool rising, bool qc_charger)
{
	const struct apsd_result *apsd_result = smblib_update_usb_type(chg);
	const struct apsd_result *apsd_result = smblib_get_apsd_result(chg);

	/* Hold off PD only until hvdcp 2.0 detection timeout */
	if (rising) {