usb: dwc2: Unify flush and reset logic with v4.20a support
authorKongyang Liu <seashell11234455@gmail.com>
Fri, 10 Jan 2025 13:55:26 +0000 (21:55 +0800)
committerMattijs Korpershoek <mkorpershoek@kernel.org>
Mon, 2 Jun 2025 07:57:43 +0000 (09:57 +0200)
commitc5d685b8993cf9e2fa4321dc3f9f866d5655e976
tree7afe7389f9cd16dd3161181fa8093ad56bada52d
parent24b0e2604e2980dd04078b85a7a8929588dc0988
usb: dwc2: Unify flush and reset logic with v4.20a support

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 <seashell11234455@gmail.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20250110-dwc2-dev-v4-7-987f4fd6f8b2@pigmoral.tech
Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
drivers/usb/common/Makefile
drivers/usb/common/dwc2_core.c [new file with mode: 0644]
drivers/usb/common/dwc2_core.h
drivers/usb/gadget/dwc2_udc_otg.c
drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
drivers/usb/host/dwc2.c