summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorPatrice Chotard <patrice.chotard@foss.st.com>2021-09-10 17:16:21 +0300
committerPatrice Chotard <patrice.chotard@foss.st.com>2021-10-12 15:20:04 +0300
commit9d591106dc22bae57a614a7b42ab9d52c6b921f8 (patch)
tree9078b720970daaa84e9a7937e5f9b3a470bacdee /drivers/usb
parent38f7d3b6530edae4c4d506d6b9dbd0ae8b8ee5e6 (diff)
downloadu-boot-9d591106dc22bae57a614a7b42ab9d52c6b921f8.tar.xz
usb: gadget: Add bcdDevice for the DWC2 USB Gadget Controller
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>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/gadget_chips.h8
1 files changed, 8 insertions, 0 deletions
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;
}