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

Commit cdd54560 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: Handle USB removal during pulsing"

parents 25a9bd90 b153d2c7
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -4687,6 +4687,8 @@ static void handle_usb_removal(struct smbchg_chip *chip)
	/* Clear typec current status */
	if (chip->typec_psy)
		chip->typec_current_ma = 0;
	/* cancel/wait for hvdcp pending work if any */
	cancel_delayed_work_sync(&chip->hvdcp_det_work);
	smbchg_change_usb_supply_type(chip, POWER_SUPPLY_TYPE_UNKNOWN);
	if (!chip->skip_usb_notification) {
		pr_smb(PR_MISC, "setting usb psy present = %d\n",
@@ -5515,6 +5517,10 @@ static int smbchg_prepare_for_pulsing_lite(struct smbchg_chip *chip)
out:
	chip->hvdcp_3_det_ignore_uv = false;
	restore_from_hvdcp_detection(chip);
	if (!is_src_detect_high(chip)) {
		pr_smb(PR_MISC, "HVDCP removed - force removal\n");
		update_usb_status(chip, 0, true);
	}
	return rc;
}

@@ -5534,6 +5540,10 @@ static int smbchg_unprepare_for_pulsing_lite(struct smbchg_chip *chip)
	if (rc < 0)
		pr_err("Couldn't retract HVDCP ICL vote rc=%d\n", rc);

	if (!is_src_detect_high(chip)) {
		pr_smb(PR_MISC, "HVDCP removed\n");
		update_usb_status(chip, 0, 0);
	}
	smbchg_handle_hvdcp3_disable(chip);

	return rc;