1
0
Fork 0
alistair23-linux/sound/usb
Shuah Khan 66354f18fe media: sound/usb: Use Media Controller API to share media resources
Media Device Allocator API to allows multiple drivers share a media device.
This API solves a very common use-case for media devices where one physical
device (an USB stick) provides both audio and video. When such media device
exposes a standard USB Audio class, a proprietary Video class, two or more
independent drivers will share a single physical USB bridge. In such cases,
it is necessary to coordinate access to the shared resource.

Using this API, drivers can allocate a media device with the shared struct
device as the key. Once the media device is allocated by a driver, other
drivers can get a reference to it. The media device is released when all
the references are released.

Change the ALSA driver to use the Media Controller API to share media
resources with DVB, and V4L2 drivers on a AU0828 media device.

The Media Controller specific initialization is done after sound card is
registered. ALSA creates Media interface and entity function graph nodes
for Control, Mixer, PCM Playback, and PCM Capture devices.

snd_usb_hw_params() will call Media Controller enable source handler
interface to request the media resource. If resource request is granted,
it will release it from snd_usb_hw_free(). If resource is busy, -EBUSY is
returned.

Media specific cleanup is done in usb_audio_disconnect().

Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Shuah Khan <shuah@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-04-22 11:21:06 -04:00
..
6fire ALSA: pcm: Nuke snd_pcm_lib_mmap_vmalloc() 2018-07-18 08:24:29 +02:00
bcd2000 sound updates for 4.15-rc1 2017-11-14 18:01:46 -08:00
caiaq ALSA: caiaq: Add fall-through annotation 2018-10-12 09:31:26 +02:00
hiface ALSA: pcm: Nuke snd_pcm_lib_mmap_vmalloc() 2018-07-18 08:24:29 +02:00
line6 Merge branch 'topic/pcm-device-suspend' into for-next 2019-01-18 17:37:21 +01:00
misc ALSA: pcm: Nuke snd_pcm_lib_mmap_vmalloc() 2018-07-18 08:24:29 +02:00
usx2y ALSA: usx2y: Fix potential NULL pointer dereference 2019-03-13 11:27:06 +01:00
Kconfig media: sound/usb: Use Media Controller API to share media resources 2019-04-22 11:21:06 -04:00
Makefile media: sound/usb: Use Media Controller API to share media resources 2019-04-22 11:21:06 -04:00
card.c media: sound/usb: Use Media Controller API to share media resources 2019-04-22 11:21:06 -04:00
card.h media: sound/usb: Use Media Controller API to share media resources 2019-04-22 11:21:06 -04:00
clock.c ALSA: usb-audio: Allow changing from a bad sample rate 2018-07-19 08:44:46 +02:00
clock.h ALSA: usb: initial USB Audio Device Class 3.0 support 2018-03-21 11:46:33 +01:00
debug.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
endpoint.c ALSA: usb-audio: remove redundant pointer 'urb' 2018-08-01 14:00:32 +02:00
endpoint.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
format.c ALSA: usb-audio: Expose sample resolution through proc interface 2019-02-18 09:36:09 +01:00
format.h ALSA: usb: initial USB Audio Device Class 3.0 support 2018-03-21 11:46:33 +01:00
helper.c ALSA: usb-audio: correct speed checking 2016-05-08 11:42:04 +02:00
helper.h ALSA: usb-audio: Drop superfluous ifndef 2018-05-24 11:19:42 +02:00
media.c media: sound/usb: Use Media Controller API to share media resources 2019-04-22 11:21:06 -04:00
media.h media: sound/usb: Use Media Controller API to share media resources 2019-04-22 11:21:06 -04:00
midi.c ALSA: rawmidi: A lightweight function to discard pending bytes 2018-10-04 20:13:17 +02:00
midi.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mixer.c ALSA: usb: Clean up with new procfs helpers 2019-02-06 18:11:57 +01:00
mixer.h media: sound/usb: Use Media Controller API to share media resources 2019-04-22 11:21:06 -04:00
mixer_maps.c ALSA: usb: add UAC3 BADD profiles support 2018-05-13 08:54:35 +02:00
mixer_quirks.c ALSA: usb: Clean up with new procfs helpers 2019-02-06 18:11:57 +01:00
mixer_quirks.h ALSA: usb-audio: Initialize Dell Dock playback volumes 2018-05-02 16:02:32 +02:00
mixer_scarlett.c ALSA: usb-audio: Clean up mixer element list traverse 2018-05-03 12:35:19 +02:00
mixer_scarlett.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mixer_us16x08.c ALSA: usb: Avoid VLA in mixer_us16x08.c 2017-05-31 08:46:19 +02:00
mixer_us16x08.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pcm.c media: sound/usb: Use Media Controller API to share media resources 2019-04-22 11:21:06 -04:00
pcm.h ALSA: usb-audio: Add UAC3 Power Domains to suspend/resume 2018-07-31 15:01:36 +02:00
power.c ALSA: usb-audio: Initial Power Domain support 2018-07-31 15:01:22 +02:00
power.h ALSA: usb-audio: Initial Power Domain support 2018-07-31 15:01:22 +02:00
proc.c ALSA: usb-audio: Expose sample resolution through proc interface 2019-02-18 09:36:09 +01:00
proc.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
quirks-table.h media: sound/usb: Use Media Controller API to share media resources 2019-04-22 11:21:06 -04:00
quirks.c ALSA: usb-audio: Add quirk for MOTU MicroBook II 2019-02-28 22:23:11 +01:00
quirks.h ALSA: usb-audio: move audioformat quirks to quirks.c 2018-03-19 17:00:12 +01:00
stream.c media: sound/usb: Use Media Controller API to share media resources 2019-04-22 11:21:06 -04:00
stream.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
usbaudio.h media: sound/usb: Use Media Controller API to share media resources 2019-04-22 11:21:06 -04:00