aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/function/f_audio_source.c
Commit message (Collapse)AuthorAgeFilesLines
* usb: android: Fix multiple issues seen with audio_sourceAzhar Shaikh2015-08-121-45/+10
| | | | | | | | | | | | | | | | Crash is seen when performing USB composition switch or USB cable disconnect from audio source USB composition. Usage of usb_remove_function() with audio_source_function_unbind_config() results into deletion of audio source function from function list in addition to unbind_config(). Fix this issue by removing audio_source_function_unbind_config(). snd pcm device is also not created using snd_card_setup(). Hence fix this issue by creating snd pcm device with audio_bind() and removing same with audio_unbind(). Change-Id: Ia96da8b33b924952a962a7170e3604af37020931 Signed-off-by: Azhar Shaikh <azhars@codeaurora.org>
* USB: f_audio_source: Enable audio endpoint for alternate setting oneTarun Gupta2015-07-241-6/+26
| | | | | | | | | | | | | | audio_source driver is having two interfaces and also audio streaming interface supports alternate settings. Only alternate setting one has endpoint. But other two interfaces have no endpoints. Hence endpoint is required to enable for only alternate setting one. But currently driver is enabling endpoint whenever set_alt callback is called. Due to this, enable endpoint will be called multiple times which causes exception. Fix this by enabling endpoint only for alternate setting one. Change-Id: Ib5910bf663f250250e8355bbdd746116e890f6d0 Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org> Signed-off-by: Tarun Gupta <tarung@codeaurora.org>
* USB: gadget: f_audio_source: Switch to DMA memory to support MMAPTarun Gupta2015-07-241-3/+41
| | | | | | | | | | | | | | | | | - Music takes more time to resume on speaker after USB unplug. - USB driver does not support the Non-blocking mode i.e. MMAP mode. When the USB is unplugged, write is blocked for 10 sec, and after a 10 sec timeout, the USB accessory device is closed and the device switch to speaker occurs. - Changes were made to implement the MMAP interface in the driver that is Non-blocking. Hence, the write thread gets unblocked immediately and the switch to speaker is instantaneous. CRs-Fixed: 453134 Change-Id: I3020f56db31e78aed114e6a4021f519b1ed234c3 Signed-off-by: Deepa Madiregama <dmadireg@codeaurora.org> Signed-off-by: Tarun Gupta <tarung@codeaurora.org>
* usb: gadget: Fix synchronization issue between f_audio_sourceChandanaKishori Chiluveru2015-07-241-3/+24
| | | | | | | | | | | | | | | | Race is happening when both audio_pcm_close() and audio_send() executes in parallel. When the PCM session is closed, the substream attribute of the audio_dev structure is set to NULL in audio_pcm_close(). As there is no synchronization protection for the audio_dev subtream attributes in audio_send(), it is causing NULL pointer dereference. Hence fixing the issue by adding proper synchronization protection for the audio_dev subtream attributes in audio_send(). CRs-Fixed: 613498 Change-Id: Id9ab0d4e347b8bb2f551f9033829e541bdcaf0e8 Signed-off-by: ChandanaKishori Chiluveru <cchilu@codeaurora.org> Signed-off-by: Tarun Gupta <tarung@codeaurora.org>
* usb: gadget: Move gadget functions codeBadhri Jagan Sridharan2015-03-301-0/+1054
3.18 kernel has reorganized drivers/usb/gadget directory. Moving gadget functions drivers from drivers/usb/gadget to drivers/usb/gadget/function Signed-off-by: Badhri Jagan Sridharan <Badhri@google.com> Change-Id: I1eab0190f8d42e3be1b4e91ad3bc3a2dc853b0ef