aboutsummaryrefslogtreecommitdiff
path: root/include/linux/usb
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt2018-03-23 13:44:06 +1100
committerFelipe Balbi2018-03-23 09:51:43 +0200
commitaaeab02ddcc830e31c33cdb72a3c117b2d499ae2 (patch)
treeb18844fb0d090abf753ad32777dcb496a4f0412b /include/linux/usb
parent2f710c1bb666ffd68ed44db190238d4660766f2d (diff)
usb/gadget: Add an EP dispose() callback for EP lifetime tracking
Some UDC may want to allocate endpoints dynamically, either because the HW supports an arbitrary large number or because (like the Aspeed BMC SoCs), the pool of HW endpoints is shared between multiple gadgets. The allocation side can be done rather easily using the existing match_ep() UDC hook. However we have no good place to "free" them. This implements a "simple" variant of this, which calls an EP dispose callback on all EPs associated with a gadget when the composite device gets unbound. This is required by my upcoming Aspeed vHub driver. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'include/linux/usb')
-rw-r--r--include/linux/usb/gadget.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 66a5cff7ee14..e3424234b23a 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -129,6 +129,7 @@ struct usb_ep_ops {
int (*enable) (struct usb_ep *ep,
const struct usb_endpoint_descriptor *desc);
int (*disable) (struct usb_ep *ep);
+ void (*dispose) (struct usb_ep *ep);
struct usb_request *(*alloc_request) (struct usb_ep *ep,
gfp_t gfp_flags);