All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabien Parent <fparent@baylibre.com>
To: u-boot@lists.denx.de
Subject: [PATCH 3/5] board: mediatek: pumpkin: initialize usb device
Date: Fri, 16 Oct 2020 17:40:07 +0200	[thread overview]
Message-ID: <20201016154009.3097917-4-fparent@baylibre.com> (raw)
In-Reply-To: <20201016154009.3097917-1-fparent@baylibre.com>

Initialize USB device on pumpkin if it is enabled in the config.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
---
 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 <common.h>
+#include <dm.h>
 
 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

  parent reply	other threads:[~2020-10-16 15:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-16 15:40 [PATCH 0/5] board: mediatek: pumpkin: add fastboot support Fabien Parent
2020-10-16 15:40 ` [PATCH 1/5] arm: dts: mt8516: add support for USB Fabien Parent
2021-01-19 13:02   ` Tom Rini
2020-10-16 15:40 ` [PATCH 2/5] arm: dts: mt8516-pumpkin: enable usb port Fabien Parent
2021-01-19 13:02   ` Tom Rini
2020-10-16 15:40 ` Fabien Parent [this message]
2021-01-19 13:02   ` [PATCH 3/5] board: mediatek: pumpkin: initialize usb device Tom Rini
2020-10-16 15:40 ` [PATCH 4/5] configs: pumpkin: enable USB gadget Fabien Parent
2021-01-19 13:02   ` Tom Rini
2020-10-16 15:40 ` [PATCH 5/5] configs: pumpkin: enable fastboot Fabien Parent
2021-01-19 13:03   ` Tom Rini
2021-11-13 14:20 ` [PATCH 0/5] board: mediatek: pumpkin: add fastboot support Simon Glass
2021-12-16 19:02   ` Fabien Parent

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201016154009.3097917-4-fparent@baylibre.com \
    --to=fparent@baylibre.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.