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

Commit ca064e42 authored by Subbaraman Narayanamurthy's avatar Subbaraman Narayanamurthy Committed by Gerrit - the friendly Code Review server
Browse files

power: qpnp-smbcharger: do not float DP/DM lines during QC3.0 detection



Currently, we request USB PHY to float DP/DM lines in usbin_uv
handler whenever USBIN_UV and SRC_DET bits are not set during
a charger insertion. This is to help with charger to run APSD
on DP/DM lines without any interference from USB PHY.
Eventually during QC3.0 detection, we run fake removal and
insertion in between. During this sequence, we disable APSD in
charger as well thereby floating DP/DM lines for a period of
~800ms. On some charger adaptors, this is detected as a different
charger type failing QC3.0 detection and also failing to operate
in QC2.0 mode.
Fix this by setting DP to 0.6V and DM to floating after fake
removal and before disabling APSD. Also, do not request USB PHY
to float DP/DM lines again during fake insertion.

CRs-Fixed: 1006776
Change-Id: Ic669128171f5dd6befa180f1217609ff8358dc83
Signed-off-by: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
Signed-off-by: default avatarKiran Gunda <kgunda@codeaurora.org>
parent b3002d22
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -5214,6 +5214,8 @@ static int smbchg_prepare_for_pulsing(struct smbchg_chip *chip)
		goto handle_removal;
	}

	set_usb_psy_dp_dm(chip, POWER_SUPPLY_DP_DM_DP0P6_DMF);

	/* disable APSD */
	pr_smb(PR_MISC, "Disabling APSD\n");
	rc = smbchg_sec_masked_write(chip,
@@ -5237,7 +5239,6 @@ static int smbchg_prepare_for_pulsing(struct smbchg_chip *chip)
	smbchg_sec_masked_write(chip, chip->usb_chgpth_base + USB_AICL_CFG,
			AICL_EN_BIT, AICL_EN_BIT);

	set_usb_psy_dp_dm(chip, POWER_SUPPLY_DP_DM_DP0P6_DMF);
	/*
	 * DCP will switch to HVDCP in this time by removing the short
	 * between DP DM
@@ -6592,7 +6593,8 @@ static irqreturn_t usbin_uv_handler(int irq, void *_chip)
	if (chip->hvdcp_3_det_ignore_uv)
		goto out;

	if ((reg & USBIN_UV_BIT) && (reg & USBIN_SRC_DET_BIT)) {
	if ((reg & USBIN_UV_BIT) && (reg & USBIN_SRC_DET_BIT) &&
		!chip->hvdcp_3_det_ignore_uv) {
		pr_smb(PR_STATUS, "Very weak charger detected\n");
		chip->very_weak_charger = true;
		rc = smbchg_read(chip, &reg,