All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrice Chotard <patrice.chotard@foss.st.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2 2/5] usb: gadget: Add bcdDevice for the DWC2 USB Gadget Controller
Date: Mon, 19 Apr 2021 11:45:31 +0200	[thread overview]
Message-ID: <20210419094534.9748-3-patrice.chotard@foss.st.com> (raw)
In-Reply-To: <20210419094534.9748-1-patrice.chotard@foss.st.com>

Add an entry in usb_gadget_controller_number() for the DWC2
gadget controller. It is used to bind the USB Ethernet driver.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reported-by: Herbert Poetzl <herbert@13thfloor.at>
Cc: Marek Vasut <marex@denx.de>
Cc: Herbert Poetzl <herbert@13thfloor.at>
---

(no changes since v1)

 drivers/usb/gadget/gadget_chips.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/usb/gadget/gadget_chips.h b/drivers/usb/gadget/gadget_chips.h
index 0cdf47c2dd..06e6a48949 100644
--- a/drivers/usb/gadget/gadget_chips.h
+++ b/drivers/usb/gadget/gadget_chips.h
@@ -167,6 +167,12 @@
 #define gadget_is_mtu3(g)        0
 #endif
 
+#ifdef CONFIG_USB_GADGET_DWC2_OTG
+#define gadget_is_dwc2(g)        (!strcmp("dwc2-udc", (g)->name))
+#else
+#define gadget_is_dwc2(g)        0
+#endif
+
 /**
  * usb_gadget_controller_number - support bcdDevice id convention
  * @gadget: the controller being driven
@@ -232,5 +238,7 @@ static inline int usb_gadget_controller_number(struct usb_gadget *gadget)
 		return 0x25;
 	else if (gadget_is_mtu3(gadget))
 		return 0x26;
+	else if (gadget_is_dwc2(gadget))
+		return 0x27;
 	return -ENOENT;
 }
-- 
2.17.1

  parent reply	other threads:[~2021-04-19  9:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-19  9:45 [PATCH v2 0/5] cmd: bind: Fix driver binding Patrice Chotard
2021-04-19  9:45 ` [PATCH v2 1/5] cmd: bind: Fix driver binding on a device Patrice Chotard
2021-04-19  9:45 ` Patrice Chotard [this message]
2021-06-18  6:55   ` [PATCH v2 2/5] usb: gadget: Add bcdDevice for the DWC2 USB Gadget Controller Patrice CHOTARD
2021-08-02 15:56     ` [Uboot-stm32] " Patrice CHOTARD
2021-09-01  9:12   ` Patrice CHOTARD
2021-04-19  9:45 ` [PATCH v2 3/5] usb: sandbox: Add gadget callbacks Patrice Chotard
2021-06-18  6:56   ` Patrice CHOTARD
2021-06-26 18:31   ` Simon Glass
2021-04-19  9:45 ` [PATCH v2 4/5] configs: sandbox: add USB_ETHER and GADGET_DOWNLOAD gadget support Patrice Chotard
2021-04-29 16:10   ` Simon Glass
2021-04-19  9:45 ` [PATCH v2 5/5] test/py: Add usb gadget binding test Patrice Chotard
2021-04-29 16:10   ` Simon Glass

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=20210419094534.9748-3-patrice.chotard@foss.st.com \
    --to=patrice.chotard@foss.st.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.