usb: gadget: introduce gadget_is_dwc3()

... to check whether we're running on DesignWare
USB3 DRD Controller.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
[idos@codeaurora.org: Conflicts: gadget_chips.h]
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
diff --git a/drivers/usb/gadget/gadget_chips.h b/drivers/usb/gadget/gadget_chips.h
index da312d4..a2edadf 100644
--- a/drivers/usb/gadget/gadget_chips.h
+++ b/drivers/usb/gadget/gadget_chips.h
@@ -120,6 +120,8 @@
 #define gadget_is_ci13xxx_pci(g)	0
 #endif
 
+#define gadget_is_dwc3(g)		(!strcmp("dwc3-gadget", (g)->name))
+
 #ifdef CONFIG_USB_GADGET_MSM_72K
 #define	gadget_is_msm72k(g)	!strcmp("msm72k_udc", (g)->name)
 #else
@@ -240,6 +242,8 @@
 		return 0x31;
 	else if (gadget_is_ci13xxx_msm_hsic(gadget))
 		return 0x32;
+	else if (gadget_is_dwc3(gadget))
+		return 0x33;
 
 	return -ENOENT;
 }