diff options
author | Robert Baldyga <r.baldyga@samsung.com> | 2015-08-06 14:11:10 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-08-06 09:31:45 -0500 |
commit | 596c154d62330ea0bb4e3c3e50afa3682e50b617 (patch) | |
tree | c11473878bca679d2c70d49116a6c6821b5bba84 /drivers/usb/gadget | |
parent | 26bf956aa9952a8141a12f314df70dcd020572d6 (diff) | |
download | linux-596c154d62330ea0bb4e3c3e50afa3682e50b617.tar.bz2 |
usb: gadget: add 'ep_match' callback to usb_gadget_ops
Add callback that is called by epautoconf to allow UDC driver match the
best endpoint for specific descriptor. It's intended to supply mechanism
which allows to get rid of chip-specific endpoint matching code from
epautoconf.
If gadget has set 'ep_match' callback we prefer to call it first, and
if it fails to find matching endpoint, then we try to use default matching
algorithm.
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/epautoconf.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c index 95e12759af4d..f000c73319f4 100644 --- a/drivers/usb/gadget/epautoconf.c +++ b/drivers/usb/gadget/epautoconf.c @@ -165,6 +165,12 @@ struct usb_ep *usb_ep_autoconfig_ss( type = desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK; + if (gadget->ops->match_ep) { + ep = gadget->ops->match_ep(gadget, desc, ep_comp); + if (ep) + goto found_ep; + } + /* First, apply chip-specific "best usage" knowledge. * This might make a good usb_gadget_ops hook ... */ |