usb: dwc3: debugfs: Fix mode switch for rockchip

When switch dwc3 mode to device on rockchip platform,
it may fails to connect to usb host because the auto
suspend delay is only 100ms. This patch sets the switch
mode to desired_role_sw_mode, and it can avoid to enter
runtime suspend.

Fixes: 5ac62b80f7 ("usb: dwc3: fix runtime pm for rockchip")
Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: If3f7faee1e9550322a80f297136b8faf1ebed301
This commit is contained in:
William Wu
2021-12-14 09:53:36 +08:00
committed by Tao Huang
parent e6ae079436
commit 2cbfa1f019

View File

@@ -440,6 +440,10 @@ static ssize_t dwc3_mode_write(struct file *file,
if (!strncmp(buf, "otg", 3))
mode = DWC3_GCTL_PRTCAP_OTG;
#if defined(CONFIG_ARCH_ROCKCHIP) && defined(CONFIG_NO_GKI)
dwc->desired_role_sw_mode = mode;
#endif
dwc3_set_mode(dwc, mode);
return count;