summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorVignesh Raghavendra <vigneshr@ti.com>2019-10-01 14:56:31 +0300
committerMarek Vasut <marek.vasut+renesas@gmail.com>2019-11-07 02:24:59 +0300
commit77dcbdf3c1ce96de19c00caca0766b5bbaa0cf28 (patch)
treeeefc5d1229c93ed6afa73860f8d33137449500b7 /drivers/usb/gadget
parentc93e305af72a344c66f467899b6277b4d3d94db9 (diff)
downloadu-boot-77dcbdf3c1ce96de19c00caca0766b5bbaa0cf28.tar.xz
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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index 179b94cdd0..e61fe5d114 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))