Skip to contentSkip to conversation

sunxi: board: probe USB gadget

PATCH New Michael Walle 1 participant 1 message Jul 11, 2024 Arm/Allwinner sunXi SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sunxi: board: probe USB gadget

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().

---
 board/sunxi/board.c | 4 ++++
 1 file changed, 4 insertions(+)
board/sunxi/board.c +4 -0
index ed86f1df5dc..7f93aba9ee7 100644
@@ -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;
Signature · 1 line
2.39.2