diff options
author | Vignesh Raghavendra <vigneshr@ti.com> | 2019-10-01 17:26:36 +0530 |
---|---|---|
committer | Marek Vasut <marek.vasut+renesas@gmail.com> | 2019-11-07 00:24:59 +0100 |
commit | d80effb1847822e521cda17b4c73c83629b035d0 (patch) | |
tree | 9169bdbe83d801b6990dbce90ecca992c3aa7602 /drivers/usb/gadget/gadget_chips.h | |
parent | a9ca4193bd3d96f1545d30c4b6a6845442403f26 (diff) |
usb: gadget: Add gadget_is_cdns3() macro
Add a new bcdDevice entry for Cadence USB gadget controller similar to
other controller and add gadget_is_cdns3() macro as well.
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Diffstat (limited to 'drivers/usb/gadget/gadget_chips.h')
-rw-r--r-- | drivers/usb/gadget/gadget_chips.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/usb/gadget/gadget_chips.h b/drivers/usb/gadget/gadget_chips.h index 2c8f235d51..91b0285244 100644 --- a/drivers/usb/gadget/gadget_chips.h +++ b/drivers/usb/gadget/gadget_chips.h @@ -149,6 +149,12 @@ #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 +214,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; } |