diff mbox series

sunxi: board: probe USB gadget

Message ID 20240711200806.2929452-1-mwalle@kernel.org
State New
Delegated to: Andre Przywara
Headers show
Series sunxi: board: probe USB gadget | expand

Commit Message

Michael Walle July 11, 2024, 8:08 p.m. UTC
Due to the lazy probing, the gadget driver might not be probed when the
u-boot cli is active. In this case the "ums" command won't work, for
example. If enabled, probe the USB gadget during board_init().

Signed-off-by: Michael Walle <mwalle@kernel.org>
---
 board/sunxi/board.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index ed86f1df5dc..7f93aba9ee7 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -189,6 +189,7 @@  enum env_location env_get_location(enum env_operation op, int prio)
 int board_init(void)
 {
 	__maybe_unused int id_pfr1, ret;
+	struct udevice *dev;
 
 	gd->bd->bi_boot_params = (PHYS_SDRAM_0 + 0x100);
 
@@ -225,6 +226,9 @@  int board_init(void)
 	if (ret)
 		return ret;
 
+	if (CONFIG_IS_ENABLED(USB_GADGET))
+		uclass_get_device(UCLASS_USB_GADGET_GENERIC, 0, &dev);
+
 	eth_init_board();
 
 	return 0;