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

Commit b17c35ad authored by Anirudh Ghayal's avatar Anirudh Ghayal Committed by Gerrit - the friendly Code Review server
Browse files

power: smb5-lib: Change the TORCH priority based on ICL



When a USB charger is connected, TORCH operates in BUCK mode
(drawing the current from USB). However, if the input is suspended
TORCH gets disabled as well. Fix this by changing the TORCH
priority based on input suspend status.

Change-Id: I2388d9b6c8fa480c8c18d0a72c1ff773d51e5bc2
Signed-off-by: default avatarAnirudh Ghayal <aghayal@codeaurora.org>
parent c1b031f8
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1366,6 +1366,10 @@ int smblib_set_icl_current(struct smb_charger *chg, int icl_ua)
	/* suspend if 25mA or less is requested */
	bool suspend = (icl_ua <= USBIN_25MA);

	if (chg->chg_param.smb_version == PMI632_SUBTYPE)
		schgm_flash_torch_priority(chg, suspend ? TORCH_BOOST_MODE :
					TORCH_BUCK_MODE);

	/* Do not configure ICL from SW for DAM cables */
	if (smblib_get_prop_typec_mode(chg) ==
			    POWER_SUPPLY_TYPEC_SINK_DEBUG_ACCESSORY)