diff options
author | Vignesh Raghavendra <vigneshr@ti.com> | 2019-10-01 17:26:31 +0530 |
---|---|---|
committer | Marek Vasut <marek.vasut+renesas@gmail.com> | 2019-11-07 00:24:59 +0100 |
commit | 77dcbdf3c1ce96de19c00caca0766b5bbaa0cf28 (patch) | |
tree | eefc5d1229c93ed6afa73860f8d33137449500b7 /drivers/usb/gadget | |
parent | c93e305af72a344c66f467899b6277b4d3d94db9 (diff) | |
download | u-boot-77dcbdf3c1ce96de19c00caca0766b5bbaa0cf28.zip u-boot-77dcbdf3c1ce96de19c00caca0766b5bbaa0cf28.tar.gz u-boot-77dcbdf3c1ce96de19c00caca0766b5bbaa0cf28.tar.bz2 |
usb: gadget: Add match_ep() op to usb_gadget_ops
Add match_ep() op to usb_gadget_ops similar to Linux kernel which is
useful in finding a suitable ep match for the function driver. This will
avoid adding more gadget_is_xxx() handling code to usb_ep_autoconfig().
Also sync usb_ep_caps struct thats is usually used in the match_ep()
callback by the gadget controller driver
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/epautoconf.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c index 179b94c..e61fe5d 100644 --- a/drivers/usb/gadget/epautoconf.c +++ b/drivers/usb/gadget/epautoconf.c @@ -282,6 +282,9 @@ struct usb_ep *usb_ep_autoconfig( return ep; } + if (gadget->ops->match_ep) + ep = gadget->ops->match_ep(gadget, desc, NULL); + /* Second, look at endpoints until an unclaimed one looks usable */ list_for_each_entry(ep, &gadget->ep_list, ep_list) { if (ep_matches(gadget, ep, desc)) |