]> git.baikalelectronics.ru Git - kernel.git/commit
media: change au0828 to use Media Device Allocator API
authorShuah Khan <shuah@kernel.org>
Tue, 2 Apr 2019 00:40:20 +0000 (20:40 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 22 Apr 2019 15:19:05 +0000 (11:19 -0400)
commitb14255dbb70a54aa8d23df2424b2d2606822f678
tree16a1c2ad1c31751a9ce551d170006ab2ec8374cb
parent8f635e4a54b7906bbb1a4b6656c8c7b91cbdb013
media: change au0828 to use Media Device Allocator API

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 au0828 to use Media Device Allocator API to allocate media device
with the parent usb struct device as the key, so it can be shared with the
snd_usb_audio driver.

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>
drivers/media/usb/au0828/Kconfig
drivers/media/usb/au0828/au0828-core.c
drivers/media/usb/au0828/au0828.h