summaryrefslogtreecommitdiff
path: root/drivers/usb/common/dwc2_core.c
AgeCommit message (Collapse)Author
2025-08-23usb: dwc2: fix reset logic in dwc2_core_resetPatrick Delaunay
Use GUSBCFG_FORCEHOSTMODE to detected the HOST forced mode as it is done in the Linux driver drivers/usb/dwc2/core.c:dwc2_core_reset(). The host polling must be executed only if the current mode is host, either due to the force HOST mode (which persists after core reset) or the connector id pin. The GUSBCFG_FORCEDEVMODE bits is used to force the device mode (for example used on STM32MP1x platform) and when it is activated the DWC2 reset failed with the trace: "dwc2_core_reset: Waiting for GINTSTS_CURMODE_HOST timeout" Fixes: c5d685b8993c ("usb: dwc2: Unify flush and reset logic with v4.20a support") Signed-off-by: Patrick Delaunay <[email protected]> Reviewed-by: Junhui Liu <[email protected]> Tested-by: Patrice Chotard <[email protected]> Reviewed-by: Marek Vasut <[email protected]>
2025-06-02usb: dwc2: Unify flush and reset logic with v4.20a supportKongyang Liu
This patch merges flush and reset logic for both host and gadget code into a common set of functions, reducing duplication. It also adds support for the updated reset logic to compatible with core version since v4.20a. This patch mainly refers to the patch in the kernel. link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=65dc2e725286106f99c6f6b78e3d9c52c15f3a9c Signed-off-by: Kongyang Liu <[email protected]> Tested-by: Peter Robinson <[email protected]> Signed-off-by: Junhui Liu <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]> Reviewed-by: Marek Vasut <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mattijs Korpershoek <[email protected]>