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

Commit 296381e2 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "power: smb-lib: fix OTG enable error handling"

parents fed61785 618f67a8
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -725,6 +725,7 @@ static void smblib_uusb_removal(struct smb_charger *chg)
	vote(chg->pl_enable_votable_indirect, USBIN_V_VOTER, false, 0);
	vote(chg->usb_icl_votable, SW_QC3_VOTER, false, 0);
	vote(chg->hvdcp_hw_inov_dis_votable, OV_VOTER, false, 0);
	vote(chg->usb_icl_votable, USBIN_USBIN_BOOST_VOTER, false, 0);

	cancel_delayed_work_sync(&chg->hvdcp_detect_work);

@@ -1716,6 +1717,8 @@ int smblib_vbus_regulator_enable(struct regulator_dev *rdev)
	rc = _smblib_vbus_regulator_enable(rdev);
	if (rc >= 0)
		chg->otg_en = true;
	else
		vote(chg->usb_icl_votable, USBIN_USBIN_BOOST_VOTER, false, 0);

unlock:
	mutex_unlock(&chg->otg_oc_lock);
@@ -4388,6 +4391,7 @@ static void smblib_handle_typec_removal(struct smb_charger *chg)
	vote(chg->pl_enable_votable_indirect, USBIN_V_VOTER, false, 0);
	vote(chg->awake_votable, PL_DELAY_VOTER, false, 0);

	vote(chg->usb_icl_votable, USBIN_USBIN_BOOST_VOTER, false, 0);
	chg->vconn_attempts = 0;
	chg->otg_attempts = 0;
	chg->pulse_cnt = 0;