diff mbox series

[next,v7,06/10] usb: gadget: Add bcdDevice for the MTU3 USB Gadget Controller

Message ID 1600420213-25974-7-git-send-email-chunfeng.yun@mediatek.com
State Superseded
Delegated to: Marek Vasut
Headers show
Series Add support MediaTek USB3 DRD driver | expand

Commit Message

Chunfeng Yun Sept. 18, 2020, 9:10 a.m. UTC
Add an entry in usb_gadget_controller_number() for the MTU3
gadget controller. It is used to bind the USB Ethernet driver.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
v4~v7: no changes

v3: new patch
---
 drivers/usb/gadget/gadget_chips.h | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Bin Meng Oct. 13, 2020, 2:28 p.m. UTC | #1
On Fri, Sep 18, 2020 at 5:12 PM Chunfeng Yun <chunfeng.yun@mediatek.com> wrote:
>
> Add an entry in usb_gadget_controller_number() for the MTU3
> gadget controller. It is used to bind the USB Ethernet driver.
>
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> ---
> v4~v7: no changes
>
> v3: new patch
> ---
>  drivers/usb/gadget/gadget_chips.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
diff mbox series

Patch

diff --git a/drivers/usb/gadget/gadget_chips.h b/drivers/usb/gadget/gadget_chips.h
index 587204c..0cdf47c 100644
--- a/drivers/usb/gadget/gadget_chips.h
+++ b/drivers/usb/gadget/gadget_chips.h
@@ -161,6 +161,12 @@ 
 #define gadget_is_max3420(g)        0
 #endif
 
+#ifdef CONFIG_USB_MTU3_GADGET
+#define gadget_is_mtu3(g)        (!strcmp("mtu3-gadget", (g)->name))
+#else
+#define gadget_is_mtu3(g)        0
+#endif
+
 /**
  * usb_gadget_controller_number - support bcdDevice id convention
  * @gadget: the controller being driven
@@ -224,5 +230,7 @@  static inline int usb_gadget_controller_number(struct usb_gadget *gadget)
 		return 0x24;
 	else if (gadget_is_max3420(gadget))
 		return 0x25;
+	else if (gadget_is_mtu3(gadget))
+		return 0x26;
 	return -ENOENT;
 }