]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: provide a wrapper around SourceSink's setup function
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Sun, 23 Dec 2012 20:09:57 +0000 (21:09 +0100)
committerFelipe Balbi <balbi@ti.com>
Mon, 21 Jan 2013 18:52:38 +0000 (20:52 +0200)
commit5b57235463657e6e570c841775c366265e9978f3
tree7de91b99523d1aab69e4dfb5007abebddeba8d95
parent71ee99dd28a567244258d819302a04434868dbcf
usb: gadget: provide a wrapper around SourceSink's setup function

The setup request can be sent to an interface/endpoint or to the device
itself. If it is sent to an interface / endpoint then we forward it to
the function that is mapped to that interface / endpoint.
If the device is the target of the setup request then we forward it to the
->setup() callback of the currently active configuration.
In case of the sourcesink function the requests are function specific
but are sent to the device.
This patch introduces a setup wrapper at configuration level which
forwards the request to the function. By using this wrapper we can keep
the function specific code within the function file and we need just a
hint at config level to forward the request.
The here introduced global variable will be moved into the gadget (which
combines the two functions) in a later patch.
SourceSink is currently the only function using ->setup() at config level.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/f_sourcesink.c