]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
usb: gadget: Add bcdDevice for the MTU3 USB Gadget Controller
authorChunfeng Yun <chunfeng.yun@mediatek.com>
Wed, 14 Oct 2020 07:08:30 +0000 (15:08 +0800)
committerMarek Vasut <marex@denx.de>
Mon, 19 Oct 2020 22:49:05 +0000 (00:49 +0200)
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>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
drivers/usb/gadget/gadget_chips.h

index 587204cfb7a1d97b25994196a484732e9829c760..0cdf47c2ddae48106a0c451ca930a1f153ff882c 100644 (file)
 #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;
 }