]> asedeno.scripts.mit.edu Git - linux.git/commit
usb/gadget: Add an EP dispose() callback for EP lifetime tracking
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 23 Mar 2018 02:44:06 +0000 (13:44 +1100)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Fri, 23 Mar 2018 07:51:43 +0000 (09:51 +0200)
commitaaeab02ddcc830e31c33cdb72a3c117b2d499ae2
treeb18844fb0d090abf753ad32777dcb496a4f0412b
parent2f710c1bb666ffd68ed44db190238d4660766f2d
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>
drivers/usb/gadget/composite.c
include/linux/usb/gadget.h