From: Fabien Parent Date: Fri, 16 Oct 2020 15:40:07 +0000 (+0200) Subject: board: mediatek: pumpkin: initialize usb device X-Git-Url: http://git.dujemihanovic.xyz/html/static/git-favicon.png?a=commitdiff_plain;h=c2984eb38ee308d0a16d3048d2eb61167fa4c6e6;p=u-boot.git board: mediatek: pumpkin: initialize usb device Initialize USB device on pumpkin if it is enabled in the config. Signed-off-by: Fabien Parent --- diff --git a/board/mediatek/pumpkin/pumpkin.c b/board/mediatek/pumpkin/pumpkin.c index 666e4d6a26..37daf1c51b 100644 --- a/board/mediatek/pumpkin/pumpkin.c +++ b/board/mediatek/pumpkin/pumpkin.c @@ -4,8 +4,25 @@ */ #include +#include int board_init(void) { return 0; } + +int board_late_init(void) +{ + struct udevice *dev; + int ret; + + if (CONFIG_IS_ENABLED(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; + } + } + + return 0; +}