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

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

power: smbcharger: Suspend USB for IUSB requests <= 2mA



In certain conditions (such as RESET event) the USB driver
can request 0mA IUSB. Force the USB to suspend for all
ISUB requests <= 2mA.

Change-Id: Iaafaffc7327dc0ea0e55f473395d5aadfb3c1ddd
Signed-off-by: default avatarAnirudh Ghayal <aghayal@codeaurora.org>
parent ee630a97
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1574,8 +1574,8 @@ static int smbchg_set_usb_current_max(struct smbchg_chip *chip,
	}
	pr_smb(PR_STATUS, "USB current_ma = %d\n", current_ma);

	if (current_ma == SUSPEND_CURRENT_MA) {
		/* suspend the usb if current set to 2mA */
	if (current_ma <= SUSPEND_CURRENT_MA) {
		/* suspend the usb if current <= 2mA */
		rc = smbchg_primary_usb_en(chip, false, REASON_USB, &changed);
		chip->usb_max_current_ma = 0;
		goto out;