Commit b3f9d6e4 authored by Jan Remmet's avatar Jan Remmet Committed by Greg Kroah-Hartman
Browse files

usb: typec: hd3ss3220: Check if regulator needs to be switched



Check regulator state as peripheral and detach can disable vbus.
Without this check we will try to disable the regulator twice if
we disconnect host and then connect as device.

Fixes: 27fbc19e ("usb: typec: hd3ss3220: Enable VBUS based on role state")
Signed-off-by: default avatarJan Remmet <j.remmet@phytec.de>
Reviewed-by: default avatarHeikki Krogerus <heikki.krogerus@linu.intel.com>
Link: https://patch.msgid.link/20260206-wip-jremmet-hd3ss3220_vbus_split-v4-1-ee5b4e402187@phytec.de


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e5b25021
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -208,6 +208,9 @@ static void hd3ss3220_regulator_control(struct hd3ss3220 *hd3ss3220, bool on)
{
	int ret;

	if (regulator_is_enabled(hd3ss3220->vbus) == on)
		return;

	if (on)
		ret = regulator_enable(hd3ss3220->vbus);
	else