|
|
Log in / Subscribe / Register

Media Device Allocator API

From:  Shuah Khan <shuahkh@osg.samsung.com>
To:  mchehab@osg.samsung.com, laurent.pinchart@ideasonboard.com, sakari.ailus@iki.fi, hans.verkuil@cisco.com, chehabrafael@gmail.com, javier@osg.samsung.com, inki.dae@samsung.com, g.liakhovetski@gmx.de, jh1009.sung@samsung.com
Subject:  [PATCH v2 0/2] Media Device Allocator API
Date:  Tue, 24 May 2016 17:39:46 -0600
Message-ID:  <cover.1464132578.git.shuahkh@osg.samsung.com>
Cc:  Shuah Khan <shuahkh@osg.samsung.com>, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Archive‑link:  Article

Media Device Allocator API to allows multiple drivers share a media device.
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.

This patch series has been tested with au0828 and snd-usb-audio drivers.
snd-us-audio patch isn't included in this series. Once this patch series
is reviews and gets a stable state, I will send out the snd-usb-audio
patch.

Changes since Patch v1 series: (based on Hans Virkuil's review)
- Removed media_device_get() and media_device_allocate(). These are
  unnecessary.
- media_device_usb_allocate() holds media_device_lock to do allocate
  and initialize the media device.
- Changed media_device_put() to media_device_delete() for symmetry with
  media_device_*_allocate().
- Dropped media_device_unregister_put(). au0828 calls media_device_delete()
  instead.

Shuah Khan (2):
  media: Media Device Allocator API
  media: change au0828 to use Media Device Allocator API

 drivers/media/Makefile                 |   3 +-
 drivers/media/media-dev-allocator.c    | 120 +++++++++++++++++++++++++++++++++
 drivers/media/usb/au0828/au0828-core.c |  12 ++--
 drivers/media/usb/au0828/au0828.h      |   1 +
 include/media/media-dev-allocator.h    |  85 +++++++++++++++++++++++
 5 files changed, 212 insertions(+), 9 deletions(-)
 create mode 100644 drivers/media/media-dev-allocator.c
 create mode 100644 include/media/media-dev-allocator.h

-- 
2.7.4



Copyright © 2016, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds