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

Commit 0ab0296d authored by Jack Pham's avatar Jack Pham
Browse files

usb: pd: disable VBUS/VCONN upon shutdown



Upon system shutdown make sure to disable VBUS and VCONN
to prevent the HW from being in a state where VBUS is left
on and could cause the device to power back on again.

Change-Id: I8bb181a843c323a2d3251bccf83db3685d6c82bc
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 099e9fc7
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1038,6 +1038,16 @@ static void phy_msg_received(struct usbpd *pd, enum pd_sop_type sop,
static void phy_shutdown(struct usbpd *pd)
{
	usbpd_dbg(&pd->dev, "shutdown");

	if (pd->vconn_enabled) {
		regulator_disable(pd->vconn);
		pd->vconn_enabled = false;
	}

	if (pd->vbus_enabled) {
		regulator_disable(pd->vbus);
		pd->vbus_enabled = false;
	}
}

static enum hrtimer_restart pd_timeout(struct hrtimer *timer)