From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabien Parent Date: Fri, 16 Oct 2020 17:40:07 +0200 Subject: [PATCH 3/5] board: mediatek: pumpkin: initialize usb device In-Reply-To: <20201016154009.3097917-1-fparent@baylibre.com> References: <20201016154009.3097917-1-fparent@baylibre.com> Message-ID: <20201016154009.3097917-4-fparent@baylibre.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Initialize USB device on pumpkin if it is enabled in the config. Signed-off-by: Fabien Parent --- board/mediatek/pumpkin/pumpkin.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/board/mediatek/pumpkin/pumpkin.c b/board/mediatek/pumpkin/pumpkin.c index 666e4d6a26fe..37daf1c51b92 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; +} -- 2.28.0