summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/f_uac2.c
Commit message (Collapse)AuthorAgeFilesLines
* usb: gadget: always update HS/SS descriptors and create a copy of themSebastian Andrzej Siewior2012-10-311-11/+5
| | | | | | | | | | | | | | | | | | | | | | | | HS and SS descriptors are staticaly created. They are updated during the bind process with the endpoint address, string id or interface numbers. After that, the descriptor chain is linked to struct usb_function which is used by composite in order to serve the GET_DESCRIPTOR requests, number of available configs and so on. There is no need to assign the HS descriptor only if the UDC supports HS speed because composite won't report those to the host if HS support has not been reached. The same reasoning is valid for SS. This patch makes sure each function updates HS/SS descriptors unconditionally and uses the newly introduced helper function to create a copy the descriptors for the speed which is supported by the UDC. While at that, also rename f->descriptors to f->fs_descriptors in order to make it more explicit what that means. Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: uac2: add some error recovery in afunc_bind()Sebastian Andrzej Siewior2012-10-311-3/+22
| | | | | | | | In case something goes wrong here, don't leak memory / endpoints. Acked-by: Jassi Brar <jassisinghbrar@gmail.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: remove __devexit in f_uac2Sebastian Andrzej Siewior2012-09-101-1/+1
| | | | | | | | | | | | | | | | avoids the following section missmatch |WARNING: drivers/usb/gadget/g_audio.o(.init.text+0x2e7): Section |mismatch in reference from the function afunc_bind() to the function |.devexit.text:snd_uac2_remove() |The function __init afunc_bind() references |a function __devexit snd_uac2_remove(). |This is often seen when error handling in the init function |uses functionality in the exit path. |The fix is often to remove the __devexit annotation of |snd_uac2_remove() so it may be used outside an exit section. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: Add Audio Class 2.0 DriverJassi Brar2012-02-151-0/+1449
This is a flexible USB Audio Class 2.0 compliant gadget driver that implements a simple topology with a virtual sound card exposed at the function side. The driver doesn't expect any real audio codec to be present on the function - the audio streams are simply sinked to and sourced from a virtual ALSA sound card created. The user-space application may choose to do whatever it wants with the data received from the USB Host and choose to provide whatever it wants as audio data to the USB Host. Capture(USB-Out) and Playback(USB-In) can be run at independent configurations specified via module parameters while loading the driver. Make this new version as the default selection by a new Kconfig choice. Signed-off-by: Yadi Brar <yadi.brar01@gmail.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
OpenPOWER on IntegriCloud