mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-17 07:54:54 +08:00
82f5332d3b
Some boards might use USB-A female connector for USB ports, however,
the port could be connected to a dual-mode USB controller, making it
also behaves as a peripheral device if male-to-male cable is connected.
In this case, the dts looks like this:
&usb0 {
status = "okay";
dr_mode = "otg";
usb-role-switch;
role-switch-default-mode = "host";
};
After boot, dwc2_ovr_init() sets GOTGCTL to GOTGCTL_AVALOVAL and call
dwc2_force_mode() with parameter host=false, which causes inconsistent
mode - The hardware is in peripheral mode while the kernel status is
in host mode.
What we can do now is to call dwc2_drd_role_sw_set() to switch to
device mode, and everything should work just fine now, even switching
back to none(default) mode afterwards.
Fixes:
|
||
---|---|---|
.. | ||
core_intr.c | ||
core.c | ||
core.h | ||
debug.h | ||
debugfs.c | ||
drd.c | ||
gadget.c | ||
hcd_ddma.c | ||
hcd_intr.c | ||
hcd_queue.c | ||
hcd.c | ||
hcd.h | ||
hw.h | ||
Kconfig | ||
Makefile | ||
params.c | ||
pci.c | ||
platform.c |