mirror of
https://github.com/torvalds/linux.git
synced 2024-11-30 16:11:38 +00:00
66354f18fe
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>
34 lines
738 B
Makefile
34 lines
738 B
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# Makefile for ALSA
|
|
#
|
|
|
|
snd-usb-audio-objs := card.o \
|
|
clock.o \
|
|
endpoint.o \
|
|
format.o \
|
|
helper.o \
|
|
mixer.o \
|
|
mixer_quirks.o \
|
|
mixer_scarlett.o \
|
|
mixer_us16x08.o \
|
|
pcm.o \
|
|
power.o \
|
|
proc.o \
|
|
quirks.o \
|
|
stream.o
|
|
|
|
snd-usb-audio-$(CONFIG_SND_USB_AUDIO_USE_MEDIA_CONTROLLER) += media.o
|
|
|
|
snd-usbmidi-lib-objs := midi.o
|
|
|
|
# Toplevel Module Dependency
|
|
obj-$(CONFIG_SND_USB_AUDIO) += snd-usb-audio.o snd-usbmidi-lib.o
|
|
|
|
obj-$(CONFIG_SND_USB_UA101) += snd-usbmidi-lib.o
|
|
obj-$(CONFIG_SND_USB_USX2Y) += snd-usbmidi-lib.o
|
|
obj-$(CONFIG_SND_USB_US122L) += snd-usbmidi-lib.o
|
|
|
|
obj-$(CONFIG_SND) += misc/ usx2y/ caiaq/ 6fire/ hiface/ bcd2000/
|
|
obj-$(CONFIG_SND_USB_LINE6) += line6/
|