diff mbox series

[U-Boot,v5,4/7] usb: gadget: Add gadget_is_cdns3 checking to provide bcdUSB value

Message ID 20190822023426.28114-5-sherry.sun@nxp.com
State New
Delegated to: Marek Vasut
Headers show
Series usb: Add cadence USB3 gadget/host/phy driver | expand

Commit Message

Sherry Sun Aug. 21, 2019, 2:36 p.m. UTC
Like other usb controllers, add gadget_is_cdns3 checking to
provide bcdUSB value in device descriptor.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
---
 drivers/usb/gadget/gadget_chips.h | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/drivers/usb/gadget/gadget_chips.h b/drivers/usb/gadget/gadget_chips.h
index 2c8f235d51..ba9114cf37 100644
--- a/drivers/usb/gadget/gadget_chips.h
+++ b/drivers/usb/gadget/gadget_chips.h
@@ -149,6 +149,11 @@ 
 #define gadget_is_dwc3(g)        0
 #endif
 
+#ifdef CONFIG_USB_CDNS3_GADGET
+#define gadget_is_cdns3(g)        (!strcmp("cdns3-gadget", (g)->name))
+#else
+#define gadget_is_cdns3(g)        0
+#endif
 /**
  * usb_gadget_controller_number - support bcdDevice id convention
  * @gadget: the controller being driven
@@ -208,5 +213,7 @@  static inline int usb_gadget_controller_number(struct usb_gadget *gadget)
 		return 0x22;
 	else if (gadget_is_dwc3(gadget))
 		return 0x23;
+	else if (gadget_is_cdns3(gadget))
+		return 0x24;
 	return -ENOENT;
 }