The media_device structure abstracts functions common to all kind of
media devices (v4l2, dvb, alsa, ...). It manages media entities and
offers a userspace API to discover and configure the media device
internal topology.
Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
---
Documentation/DocBook/media-entities.tmpl |2 +
Documentation/DocBook/media.tmpl |3 +
Documentation/DocBook/v4l/media-controller.xml | 56 +
Documentation/media-framework.txt | 68
drivers/media/Makefile |2 +-
drivers/media/media-device.c | 100
include/media/media-device.h | 66
7 files changed, 296 insertions(+), 1 deletions(-)
create mode 100644 Documentation/DocBook/v4l/media-controller.xml
create mode 100644 Documentation/media-framework.txt
create mode 100644 drivers/media/media-device.c
create mode 100644 include/media/media-device.h
diff --git a/Documentation/DocBook/media-entities.tmpl
b/Documentation/DocBook/media-entities.tmpl
index be34dcb..61d6f11 100644
--- a/Documentation/DocBook/media-entities.tmpl
+++ b/Documentation/DocBook/media-entities.tmpl
@@ -321,6 +321,8 @@
!ENTITY sub-media-entities SYSTEM media-entities.tmpl
!ENTITY sub-media-indices SYSTEM media-indices.tmpl
+!ENTITY sub-media-controller SYSTEM v4l/media-controller.xml
+
!-- Function Reference --
!ENTITY close SYSTEM v4l/func-close.xml
!ENTITY ioctl SYSTEM v4l/func-ioctl.xml
diff --git a/Documentation/DocBook/media.tmpl b/Documentation/DocBook/media.tmpl
index f11048d..73464b0 100644
--- a/Documentation/DocBook/media.tmpl
+++ b/Documentation/DocBook/media.tmpl
@@ -106,6 +106,9 @@ Foundation. A copy of the license is included in the
chapter entitled
sub-remote_controllers;
/chapter
/part
+part id=media_common
+sub-media-controller;
+/part
sub-fdl-appendix;
diff --git a/Documentation/DocBook/v4l/media-controller.xml
b/Documentation/DocBook/v4l/media-controller.xml
new file mode 100644
index 000..253ddb4
--- /dev/null
+++ b/Documentation/DocBook/v4l/media-controller.xml
@@ -0,0 +1,56 @@
+partinfo
+ authorgroup
+author
+ firstnameLaurent/firstname
+ surnamePinchart/surname
+
affiliationaddressemaillaurent.pinch...@ideasonboard.com/email/address/affiliation
+ contribInitial version./contrib
+/author
+ /authorgroup
+ copyright
+year2010/year
+holderLaurent Pinchart/holder
+ /copyright
+
+ revhistory
+!-- Put document revisions here, newest first. --
+revision
+ revnumber1.0.0/revnumber
+ date2010-11-10/date
+ authorinitialslp/authorinitials
+ revremarkInitial revision/revremark
+/revision
+ /revhistory
+/partinfo
+
+titleMedia Controller API/title
+
+chapter id=media_controller
+ titleMedia Controller/title
+
+ section id=media-controller-intro
+titleIntroduction/title
+paraMedia devices increasingly handle multiple related functions. Many
USB
+cameras include microphones, video capture hardware can also output video,
+or SoC camera interfaces also perform memory-to-memory operations similar
to
+video codecs./para
+paraIndependent functions, even when implemented in the same hardware,
can
+be modelled as separate devices. A USB camera with a microphone will be
+presented to userspace applications as V4L2 and ALSA capture devices. The
+devices' relationships (when using a webcam, end-users shouldn't have to
+manually select the associated USB microphone), while not made available
+directly to applications by the drivers, can usually be retrieved from
+sysfs./para
+paraWith more and more advanced SoC devices being introduced, the current
+approach will not scale. Device topologies are getting increasingly complex
+and can't always be represented by a tree structure. Hardware blocks are
+shared between different functions, creating dependencies between seemingly
+unrelated devices./para
+paraKernel abstraction APIs such as V4L2 and ALSA provide means for
+applications to access hardware parameters. As newer hardware expose an
+increasingly high number of those parameters, drivers need to guess what
+applications really require based on limited information, thereby
+implementing policies that belong to userspace./para
+paraThe media controller API aims at solving those problems./para
+ /section
+/chapter
diff --git a/Documentation/media-framework.txt
b/Documentation/media-framework.txt
new file mode 100644
index 000..84fa43a
--- /dev/null
+++ b/Documentation/media-framework.txt
@@ -0,0 +1,68 @@
+Linux kernel media framework
+
+
+This document describes the Linux kernel media framework, its data structures,
+functions and their usage.
+
+
+Introduction
+
+
+The media controller API is documented in DocBook format in