]> git.baikalelectronics.ru Git - kernel.git/commit
media: Media Device Allocator API
authorShuah Khan <shuah@kernel.org>
Tue, 2 Apr 2019 00:40:19 +0000 (20:40 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 22 Apr 2019 15:18:26 +0000 (11:18 -0400)
commit20027a5f2040a4f713121debdb81c6581a3836d9
treedd135d8fd4f43d2375e1716eb0b6cb0dfc055ee7
parent72f2f794805d6d851bf47359a5d6b7905bfa46a8
media: 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.

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>
Documentation/media/kapi/mc-core.rst
drivers/media/Makefile
drivers/media/media-dev-allocator.c [new file with mode: 0644]
include/media/media-dev-allocator.h [new file with mode: 0644]