From: Vignesh Raghavendra Date: Tue, 1 Oct 2019 17:26:36 +0530 Subject: [U-Boot] [PATCH 8/8] usb: gadget: Add gadget_is_cdns3() macro In-Reply-To: <20191001115636.21052-1-vigneshr@ti.com> References: <20191001115636.21052-1-vigneshr@ti.com> Message-ID: <20191001115636.21052-9-vigneshr@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- drivers/usb/gadget/gadget_chips.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/usb/gadget/gadget_chips.h b/drivers/usb/gadget/gadget_chips.h index 2c8f235d51c8..91b0285244ec 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; } -- 2.23.0