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

Commit 2a66004f authored by Guru Das Srinagesh's avatar Guru Das Srinagesh
Browse files

power: qpnp-qnovo5: Revoke vote to disable CP upon USB disconnect



Once userspace enables "standalone" mode, the charge pump will remain
disabled until userspace disables it via a zero-write to that parameter.
Fix this so that the charge pump may get re-enabled upon USB reinsertion
following a disconnection.

Change-Id: I9e700a2e9811190d701d950ef293b603ca66396e
Signed-off-by: default avatarGuru Das Srinagesh <gurus@codeaurora.org>
parent 079f3c30
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1166,6 +1166,7 @@ static void status_change_work(struct work_struct *work)
	union power_supply_propval pval;
	bool usb_present = false, hw_ok_to_qnovo = false;
	int rc, battery_health, charge_status;
	struct votable *cp_disable_votable = find_votable("CP_DISABLE");

	if (is_usb_available(chip)) {
		rc = power_supply_get_property(chip->usb_psy,
@@ -1179,6 +1180,9 @@ static void status_change_work(struct work_struct *work)
		cancel_delayed_work_sync(&chip->usb_debounce_work);
		vote(chip->awake_votable, USB_READY_VOTER, false, 0);
		vote(chip->chg_ready_votable, USB_READY_VOTER, false, 0);
		if (cp_disable_votable)
			vote(cp_disable_votable, QNOVO_VOTER, false, 0);

		if (chip->pinctrl) {
			rc = pinctrl_select_state(chip->pinctrl,
					chip->pinctrl_state1);