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

Commit b74c6d18 authored by Anirudh Ghayal's avatar Anirudh Ghayal Committed by Ashay Jaiswal
Browse files

power: qpnp-smbcharger: Add a workaround for USB100 on PMI8950 v2.0



During battery-hot conditions on PMI8950 v2.0 the IUSB=100mA
drops to 0mA. Fix this by forcing 150mA instead of 100mA.

CRs-Fixed: 865824
Change-Id: Ibb3b11310baa45235f5c9837d2a10ce6917e80f8
Signed-off-by: default avatarAnirudh Ghayal <aghayal@codeaurora.org>
parent 84c39c23
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -264,6 +264,7 @@ enum pmic_subtype {
enum smbchg_wa {
	SMBCHG_AICL_DEGLITCH_WA = BIT(0),
	SMBCHG_HVDCP_9V_EN_WA	= BIT(1),
	SMBCHG_USB100_WA = BIT(2),
};

enum print_reason {
@@ -1420,6 +1421,10 @@ static int smbchg_set_usb_current_max(struct smbchg_chip *chip,

	switch (usb_supply_type) {
	case POWER_SUPPLY_TYPE_USB:
		if ((current_ma < CURRENT_150_MA) &&
				(chip->wa_flags & SMBCHG_USB100_WA))
			current_ma = CURRENT_150_MA;

		if (current_ma < CURRENT_150_MA) {
			/* force 100mA */
			rc = smbchg_sec_masked_write(chip,
@@ -6629,10 +6634,12 @@ static int smbchg_wa_config(struct smbchg_chip *chip)
	case PMI8994:
		chip->wa_flags |= SMBCHG_AICL_DEGLITCH_WA;
	case PMI8950:
		if (pmic_rev_id->rev4 < 2) /* PMI8950 1.0 */
		if (pmic_rev_id->rev4 < 2) /* PMI8950 1.0 */ {
			chip->wa_flags |= SMBCHG_AICL_DEGLITCH_WA;
		else	/* rev > PMI8950 v1.0 */
			chip->wa_flags |= SMBCHG_HVDCP_9V_EN_WA;
		} else	{ /* rev > PMI8950 v1.0 */
			chip->wa_flags |= SMBCHG_HVDCP_9V_EN_WA
					| SMBCHG_USB100_WA;
		}
		break;
	default:
		pr_err("PMIC subtype %d not supported, WA flags not set\n",