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

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

Merge "power: smb2: Fix fake USB insertion from ext_5v_boost"

parents 0fa746c9 287e3e92
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -3524,6 +3524,11 @@ void smblib_usb_plugin_locked(struct smb_charger *chg)
						chg->chg_freq.freq_removal);

	if (vbus_rising) {
		if (smblib_get_prop_dfp_mode(chg) != POWER_SUPPLY_TYPEC_NONE) {
			chg->fake_usb_insertion = true;
			return;
		}

		rc = smblib_request_dpdm(chg, true);
		if (rc < 0)
			smblib_err(chg, "Couldn't to enable DPDM rc=%d\n", rc);
@@ -3537,6 +3542,11 @@ void smblib_usb_plugin_locked(struct smb_charger *chg)
				!chg->pd_active)
			pr_err("APSD disabled on vbus rising without PD\n");
	} else {
		if (chg->fake_usb_insertion) {
			chg->fake_usb_insertion = false;
			return;
		}

		if (chg->wa_flags & BOOST_BACK_WA) {
			data = chg->irq_info[SWITCH_POWER_OK_IRQ].irq_data;
			if (data) {
@@ -3899,6 +3909,9 @@ irqreturn_t smblib_handle_usb_source_change(int irq, void *data)
	int rc = 0;
	u8 stat;

	if (chg->fake_usb_insertion)
		return IRQ_HANDLED;

	rc = smblib_read(chg, APSD_STATUS_REG, &stat);
	if (rc < 0) {
		smblib_err(chg, "Couldn't read APSD_STATUS rc=%d\n", rc);
+1 −0
Original line number Diff line number Diff line
@@ -358,6 +358,7 @@ struct smb_charger {
	bool			try_sink_active;
	int			boost_current_ua;
	int			temp_speed_reading_count;
	bool			fake_usb_insertion;

	/* extcon for VBUS / ID notification to USB for uUSB */
	struct extcon_dev	*extcon;