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

Commit baac96a2 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "power: qpnp-smbcharger: enable AICL while unpreparing"

parents 63667e70 d7475529
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -5305,6 +5305,15 @@ static int smbchg_unprepare_for_pulsing(struct smbchg_chip *chip)
	 */
	chip->parallel.enabled_once = false;

	/* Enable AICL */
	pr_smb(PR_MISC, "Enable AICL\n");
	rc = smbchg_sec_masked_write(chip, chip->usb_chgpth_base + USB_AICL_CFG,
			AICL_EN_BIT, AICL_EN_BIT);
	if (rc < 0) {
		pr_err("Couldn't enable AICL rc=%d\n", rc);
		goto out;
	}

	/* fake an insertion */
	pr_smb(PR_MISC, "Faking Insertion\n");
	rc = fake_insertion_removal(chip, true);
@@ -5314,15 +5323,6 @@ static int smbchg_unprepare_for_pulsing(struct smbchg_chip *chip)
	}
	chip->hvdcp_3_det_ignore_uv = false;

	/* Enable AICL */
	pr_smb(PR_MISC, "Enable AICL\n");
	rc = smbchg_sec_masked_write(chip, chip->usb_chgpth_base + USB_AICL_CFG,
			AICL_EN_BIT, 0);
	if (rc < 0) {
		pr_err("Couldn't enable AICL rc=%d\n", rc);
		return rc;
	}

out:
	/*
	 * There are many QC 2.0 chargers that collapse before the aicl deglitch