]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
usb: gadget: Add bcdDevice for the DWC2 USB Gadget Controller
authorPatrice Chotard <patrice.chotard@foss.st.com>
Fri, 10 Sep 2021 14:16:21 +0000 (16:16 +0200)
committerPatrice Chotard <patrice.chotard@foss.st.com>
Tue, 12 Oct 2021 12:20:04 +0000 (14:20 +0200)
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>
drivers/usb/gadget/gadget_chips.h

index 0cdf47c2ddae48106a0c451ca930a1f153ff882c..06e6a4894954e463d1a788ef94479d61a9bafd22 100644 (file)
 #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;
 }