u-boot/drivers/usb/dwc3
Neil Armstrong 043a9674b6 usb: dwc3-meson-gxl: force mode on child add/removal
arch/mach-meson has some custom usb logic, in particular:
* on board_usb_init(), we force USB_DR_MODE_PERIPHERAL
* on board_usb_cleanup(), we force USB_DR_MODE_HOST

With DM_USB_GADGET=y, board_usb_init/cleanup() are no
longer used when we call usb_gadget_initialize().
Instead, the generic (from udc-uclass) initialization/release is
called, which itself calls the controller driver's probe()/remove().

Therefore, enabling DM_USB_GADGET=y will mean that this mode
switching will break.

To prepare for enabling DM_USB_GADGET, perform the mode switching
when the "amlogic,meson-g12a-usb" (dwc2) driver is
probed()/removed() instead.

This is achieved via the glue driver, which gets notified each time one
of its children is probed()/removed.

Note: this change should be harmless without DM_USB_GADGET=y
because the amlogic-g12a-usb driver is not probed via driver model.

Thanks for Mattijs for the original work at [1].

[1] https://lore.kernel.org/all/20221024-meson-dm-usb-v1-1-2ab077a503b9@baylibre.com/

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20230117-u-boot-usb-gxl-otg-dm-v1-1-2853f6d75b06@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2023-01-20 16:21:31 +01:00
..
core.c usb: dwc3: Drop support for "snps, ref-clock-period-ns" DT property 2022-11-27 15:34:56 +01:00
core.h usb: dwc3: Program GFLADJ 2022-11-27 15:34:56 +01:00
dwc3-generic.c usb: dwc3: Cache ref_clk pointer in struct dwc3 2022-11-27 15:34:56 +01:00
dwc3-layerscape.c usb: dwc3: add layerscape support 2021-11-09 17:18:23 +05:30
dwc3-meson-g12a.c usb: dwc3-meson-g12a: force mode on child add/removal 2023-01-17 09:27:17 +01:00
dwc3-meson-gxl.c usb: dwc3-meson-gxl: force mode on child add/removal 2023-01-20 16:21:31 +01:00
dwc3-omap.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
dwc3-uniphier.c treewide: convert devfdt_get_addr() to dev_read_addr() 2020-07-25 14:46:57 -06:00
ep0.c usb: dwc3: Fix not calling dev_xxx with a device 2020-09-30 08:53:54 -04:00
gadget.c WS cleanup: remove SPACE(s) followed by TAB 2021-09-30 09:08:16 -04:00
gadget.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
io.h common: Move ARM cache operations out of common.h 2019-12-02 18:24:58 -05:00
Kconfig usb: dwc3: add a SPL_USB_DWC3_GENERIC option for the dwc3 driver 2022-07-15 14:10:39 +02:00
linux-compat.h lib: string: Implement strlcat 2021-04-12 17:44:55 -04:00
Makefile usb: dwc3: add a SPL_USB_DWC3_GENERIC option for the dwc3 driver 2022-07-15 14:10:39 +02:00
samsung_usb_phy.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
ti_usb_phy.c usb: dwc3: ti: Fix not calling dev_err with a device 2020-09-30 08:53:58 -04:00