diff mbox series

[v2,2/6] ARM: Mediatek: Add board_late_init to init usb gadget driver

Message ID 20200116081142.4849-3-mingming.lee@mediatek.com
State Accepted
Commit e65016150e2b66dfee0521cb3b2d477694b341ef
Headers show
Series Add fastboot support for MediaTek mt8518 | expand

Commit Message

mingming lee Jan. 16, 2020, 8:11 a.m. UTC
Add board_late_init function to init usb gadget driver for mt8518

Signed-off-by: mingming lee <mingming.lee at mediatek.com>
---
 board/mediatek/mt8518/mt8518_ap1.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comments

Tom Rini Jan. 25, 2020, 5:08 p.m. UTC | #1
On Thu, Jan 16, 2020 at 04:11:38PM +0800, mingming lee wrote:

> Add board_late_init function to init usb gadget driver for mt8518
> 
> Signed-off-by: mingming lee <mingming.lee at mediatek.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/board/mediatek/mt8518/mt8518_ap1.c b/board/mediatek/mt8518/mt8518_ap1.c
index 9710907fe2..2ac7c6cd18 100644
--- a/board/mediatek/mt8518/mt8518_ap1.c
+++ b/board/mediatek/mt8518/mt8518_ap1.c
@@ -16,3 +16,21 @@  int board_init(void)
 	debug("gd->fdt_blob is %p\n", gd->fdt_blob);
 	return 0;
 }
+
+int board_late_init(void)
+{
+#ifdef CONFIG_USB_GADGET
+	struct udevice *dev;
+	int ret;
+#endif
+
+#ifdef CONFIG_USB_GADGET
+	ret = uclass_get_device(UCLASS_USB_GADGET_GENERIC, 0, &dev);
+	if (ret) {
+		pr_err("%s: Cannot find USB device\n", __func__);
+		return ret;
+	}
+#endif
+
+	return 0;
+}