aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2018-03-22 22:44:06 -0400
committerFelipe Balbi <felipe.balbi@linux.intel.com>2018-03-23 03:51:43 -0400
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 {
129 int (*enable) (struct usb_ep *ep, 129 int (*enable) (struct usb_ep *ep,
130 const struct usb_endpoint_descriptor *desc); 130 const struct usb_endpoint_descriptor *desc);
131 int (*disable) (struct usb_ep *ep); 131 int (*disable) (struct usb_ep *ep);
132 void (*dispose) (struct usb_ep *ep);
132 133
133 struct usb_request *(*alloc_request) (struct usb_ep *ep, 134 struct usb_request *(*alloc_request) (struct usb_ep *ep,
134 gfp_t gfp_flags); 135 gfp_t gfp_flags);