mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 06:14:39 +01:00
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: 27fbc19e52 ("usb: typec: hd3ss3220: Enable VBUS based on role state")
Signed-off-by: Jan Remmet <[email protected]>
Reviewed-by: Heikki Krogerus <[email protected]>
Link: https://patch.msgid.link/20260206-wip-jremmet-hd3ss3220_vbus_split-v4-1-ee5b4e402187@phytec.de
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
1 parent
e5b250214a
commit
b3f9d6e491
1 file changed
+3
@@ -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
|
||||
|
||||
Reference in new issue
Block a user