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

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

Merge "power: smb5: fix PD disable handling"

parents 2df0b5b2 f2ca709e
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -244,7 +244,7 @@ static int smb5_chg_config_init(struct smb5 *chip)
		chg->use_extcon = true;
		chg->use_extcon = true;
		chg->name = "pmi632_charger";
		chg->name = "pmi632_charger";
		/* PMI632 does not support PD */
		/* PMI632 does not support PD */
		__pd_disabled = 1;
		chg->pd_not_supported = true;
		chg->hw_max_icl_ua =
		chg->hw_max_icl_ua =
			(chip->dt.usb_icl_ua > 0) ? chip->dt.usb_icl_ua
			(chip->dt.usb_icl_ua > 0) ? chip->dt.usb_icl_ua
						: PMI632_MAX_ICL_UA;
						: PMI632_MAX_ICL_UA;
+5 −4
Original line number Original line Diff line number Diff line
@@ -517,7 +517,7 @@ int smblib_configure_hvdcp_apsd(struct smb_charger *chg, bool enable)
	int rc;
	int rc;
	u8 mask = HVDCP_EN_BIT | BC1P2_SRC_DETECT_BIT;
	u8 mask = HVDCP_EN_BIT | BC1P2_SRC_DETECT_BIT;


	if (chg->pd_disabled)
	if (chg->pd_not_supported)
		return 0;
		return 0;


	rc = smblib_masked_write(chg, USBIN_OPTIONS_1_CFG_REG, mask,
	rc = smblib_masked_write(chg, USBIN_OPTIONS_1_CFG_REG, mask,
@@ -3078,7 +3078,8 @@ static void typec_sink_insertion(struct smb_charger *chg)
	}
	}


	if (!chg->pr_swap_in_progress)
	if (!chg->pr_swap_in_progress)
		chg->ok_to_pd = !(*chg->pd_disabled) || chg->early_usb_attach;
		chg->ok_to_pd = (!(*chg->pd_disabled) || chg->early_usb_attach)
					&& !chg->pd_not_supported;
}
}


static void typec_src_insertion(struct smb_charger *chg)
static void typec_src_insertion(struct smb_charger *chg)
@@ -3097,8 +3098,8 @@ static void typec_src_insertion(struct smb_charger *chg)
	}
	}


	chg->typec_legacy = stat & TYPEC_LEGACY_CABLE_STATUS_BIT;
	chg->typec_legacy = stat & TYPEC_LEGACY_CABLE_STATUS_BIT;
	chg->ok_to_pd = !(chg->typec_legacy || *chg->pd_disabled)
	chg->ok_to_pd = (!(chg->typec_legacy || *chg->pd_disabled)
						|| chg->early_usb_attach;
			|| chg->early_usb_attach) && !chg->pd_not_supported;
	if (!chg->ok_to_pd) {
	if (!chg->ok_to_pd) {
		rc = smblib_configure_hvdcp_apsd(chg, true);
		rc = smblib_configure_hvdcp_apsd(chg, true);
		if (rc < 0) {
		if (rc < 0) {
+1 −0
Original line number Original line Diff line number Diff line
@@ -272,6 +272,7 @@ struct smb_charger {
	int			otg_delay_ms;
	int			otg_delay_ms;
	int			*weak_chg_icl_ua;
	int			*weak_chg_icl_ua;
	struct qpnp_vadc_chip	*vadc_dev;
	struct qpnp_vadc_chip	*vadc_dev;
	bool			pd_not_supported;


	/* locks */
	/* locks */
	struct mutex		lock;
	struct mutex		lock;