]> git.kernelconcepts.de Git - karo-tx-linux.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)
commit544aca39e670421c2daae4b6706f1e405b19ba72
tree7de91b99523d1aab69e4dfb5007abebddeba8d95
parent32b8666589d5c274cea0ea4b07e202422bf975b1
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