Linux drivers based on Video for Linux Two (V4L2) API, test addition:
Németh Márton <nm127@freemail.hu> wrote:
I started a project to test the Linux drivers based on Video for Linux Two (V4L2) API, release 0.24. This project is using the CUnit framework and is available at http://v4l-test.sourceforge.net/. I found your project at http://ltp.sourceforge.net/ . As far as I know the LTP currently do not have any tests for V4L2. Maybe test cases created for v4l-test project can be used for LTP also. What do you think?
Subrata Modak <subrata@linux.vnet.ibm.com> wrote back:
Yes, it can be. We have a rather old code base for Device Drivers testing. And time and again i was trying to revive the device drivers tests inside LTP, but, did not get sufficient volunteers to do the same. Your test code can be a starting point for us. I downloaded your testsuite and was able to compile the stuff, with some modification(s). However, i did not test it. Can you also share the logs of the run on your machine ?? More info is required in the documentation. I have prepared a patch(attached & embedded), which will integrate these tests inside LTP with minor modifications in documentation and some #defines in some source files (to be able to compile on machines not having respective header files containing the definition). Now, we have 2 choices:
1) You can voluntarily allow us to maintain this code inside LTP. Send your patches/modifications to us, whenever you want to add/modify/remove any tests out of: ltp/testcases/kernel/device-drivers/v4l-test/, We will then do the needful. You benefit by showcasing your test code to a bigger LTP community, and hence can attract more contribution from them. We gain by re-introducing/re-starting device drivers testing, which can then move to other device drivers as well. If you agree, please reply to this mail with a DCO Sign-off:  Signed-Off-By: Németh Márton <nm127@freemail.hu>, I can then go ahead and include this patch.
2) You can keep your project running at: http://v4l-test.sourceforge.net/, as well as agree to apply this patch to include in LTP. In such a case, send us updates whenever you update your project. In any case, i  would require a DCO Sign-off: Signed-Off-By: Németh Márton <nm127@freemail.hu>,  from you. I would like to thank you for deciding to contribute this to LTP, and would also request you to help us fix the  existing device drivers tests in LTP, so that we can start using them. If necessary we can delete the obsolete ones and add new ones: http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/kernel/device-drivers/. Do you think, you will also be able to help us here ??
Németh Márton <nm127@freemail.hu> wrote back:
Yes, sorry about that. I have had no access to my emails during the last days. I also wanted to think about this a little. I would like to choose the 2nd solution: I try to run my project forward and send you patches to include them in LTP. The source code and the test design was created by me. However, the V4L2 API specification which is also included in the tarball is only downloaded and saved under the 'doc' directory so I always have a local copy of the V4L2 API revision 0.24. This you might not want to include in the LTP source code. I had some difficulties with the inline patch you sent me, it was not usable at my side because my email client was not able to handle it correctly. Could you please send it as an attachment? What I could recognised that the v4l-test project was placed in LTP source directory under ltp-intermediate-20081223.orig/testcases/kernel/device-drivers/v4l-test . However, if I look around in the "device-drivers" subdirectory I would use the subdirectory: ltp/testcases/kernel/device-drivers/v4l/user_space . What do you think? Signed-Off-By: Márton Németh <nm127@freemail.hu>.
diff --git a/README b/README
index 673127f..62ac5b1 100644
--- a/README
+++ b/README
@@ -241,4 +241,15 @@
 CONFIG_HOTPLUG_PCI_CPCI_GENERIC=y
 CONFIG_HOTPLUG_PCI_SHPC=y
 ---------------------------------
+Video For Linux Two API testing Requirements:
+You need to have a video device (i.e. webcam, tuner card, etc.) connected to your system and available under /dev/video0. If you don't have any hardware device available, you can still test the "Virtual Video Driver". To compile this you need to compile your kernel with CONFIG_VIDEO_VIVI=m under:
+  -> Device Drivers
+    -> Multimedia devices
+      -> Video For Linux
+        -> Video capture adapters
+         -> Virtual Video Driver
+
+The tests also require CUnit Framework to be installed before compiling the tests. Download & Install the same from:
+http://sourceforge.net/projects/cunit/
+---------------------------------
 ---------------------------------
diff --git a/testcases/kernel/device-drivers/v4l/user_space/Makefile b/testcases/kernel/device-drivers/v4l/user_space/Makefile
new file mode 100644
index 0000000..d1f4a35
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/Makefile
@@ -0,0 +1,31 @@
+#
+# v4l-test: Test environment for Video For Linux Two API
+#
+# 22 Dec 2008  0.2  test_VIDIOC_QUERYCAP.c added
+# 18 Dec 2008  0.1  First release
+#
+# Written by Márton Németh <nm127@freemail.hu>
+# Released under GPL
+#
+
+CFLAGS = -O2 -Wall -Wextra
+#CFLAGS += -g
+LDFLAGS = -lcunit
+
+all:
+	gcc $(CFLAGS) $(LDFLAGS) \
+		dev_video.c \
+		test_VIDIOC_QUERYCAP.c \
+		test_VIDIOC_CROPCAP.c \
+		test_VIDIOC_STD.c \
+		test_VIDIOC_INPUT.c \
+		test_invalid_ioctl.c \
+		test_VIDIOC_ENUM_FMT.c \
+		test_VIDIOC_ENUMINPUT.c \
+		test_VIDIOC_ENUMSTD.c \
+		test_VIDIOC_ENUMAUDIO.c \
+		v4l2_test.c \
+		-o v4l-test
+
+clean:
+	rm -f v4l-test
diff --git a/testcases/kernel/device-drivers/v4l/user_space/README b/testcases/kernel/device-drivers/v4l/user_space/README
new file mode 100644
index 0000000..12c04ac
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/README
@@ -0,0 +1,146 @@
+
+           v4l-test: Test environment for Video For Linux Two API
+
+22 Dec 2008  0.2  Test cases with NULL parameter added;
+                  Test cases for VIDIOC_CROPCAP added
+18 Dec 2008  0.1  First release
+
+Written by Márton Németh <nm127@freemail.hu>
+Released under GPL
+
+What is this?
+-------------
+v4l-test is a test test environment for V4L2 drivers. The V4L2 drivers
+are running under Linux in kernel space. This test environment is running
+in userspace and tries what normal video application would do. It also
+tries some things which are supposed to test the error handling mechanisms
+of a V4L2 driver. These are the "invalid test cases".
+
+How to build?
+-------------
+To build the test environment you will need a C compiler, "make" and the
+CUnit development files installed. Just type "make" and the test environment
+is ready. The CUnit framework can be downloaded & installed from:
+http://sourceforge.net/projects/cunit/
+
+How to run?
+-----------
+You need to have a video device (i.e. webcam, tuner card, etc.) connected
+to your system and available under /dev/video0. If you don't have any
+hardware device available, you can still test the "Virtual Video Driver".
+To compile this you need to compile your kernel with CONFIG_VIDEO_VIVI=m
+under:
+
+  -> Device Drivers
+    -> Multimedia devices
+      -> Video For Linux
+        -> Video capture adapters
+         -> Virtual Video Driver
+
+At this point you can execute v4l-test.
+
+Video for Linux Two Specification
+---------------------------------
+The V4L2 API specification can be found at http://v4l2spec.bytesex.org/spec/ .
+Revision 0.42 of V4L2 is the base for this test environment.
+
+Code Coverage
+-------------
+The code coverage shows which lines of the code were executed and how many
+times. The measurement results gives you a feedback about the quality of
+the test cases.
+You can measure the code coverage of a kernel module with the gocv and lcov
+softwares. See http://ltp.sourceforge.net/coverage/gcov.php and
+http://ltp.sourceforge.net/coverage/lcov.php for details.
+
+Current status
+--------------
+Currently all test are running and evaluated automatically. This might
+change in future if we want to test for example plugging and unplugging
+a USB video device or ask the user if a received picture make sense or not.
+
+The following table gives an overview about the current state of implemented
+test cases.
+
+ V4L API element                  | Covered?
+ ---------------------------------+---------------------------------------------
+ V4L2 open()                      | yes, partly
+ V4L2 close()                     | yes
+ V4L2 ioctl()                     | yes
+ ioctl VIDIOC_CROPCAP             | yes, only when STREAM_OFF
+ ioctl VIDIOC_DBG_G_REGISTER      | no
+ ioctl VIDIOC_DBG_S_REGISTER      | no
+ ioctl VIDIOC_ENCODER_CMD         | no
+ ioctl VIDIOC_TRY_ENCODER_CMD     | no
+ ioctl VIDIOC_ENUMAUDIO           | yes, only valid cases
+ ioctl VIDIOC_ENUMAUDOUT          | no
+ ioctl VIDIOC_ENUM_FMT            | yes, only when STREAM_OFF
+ ioctl VIDIOC_ENUM_FRAMESIZES     | no
+ ioctl VIDIOC_ENUM_FRAMEINTERVALS | no
+ ioctl VIDIOC_ENUMINPUT           | yes, only when STREAM_OFF
+ ioctl VIDIOC_ENUMOUTPUT          | no
+ ioctl VIDIOC_ENUMSTD             | yes, only when STREAM_OFF
+ ioctl VIDIOC_G_AUDIO             | no
+ ioctl VIDIOC_S_AUDIO             | no
+ ioctl VIDIOC_G_AUDOUT            | no
+ ioctl VIDIOC_S_AUDOUT            | no
+ ioctl VIDIOC_G_CHIP_IDENT        | no
+ ioctl VIDIOC_G_CROP              | no
+ ioctl VIDIOC_S_CROP              | no
+ ioctl VIDIOC_G_CTRL              | no
+ ioctl VIDIOC_S_CTRL              | no
+ ioctl VIDIOC_G_ENC_INDEX         | no
+ ioctl VIDIOC_G_EXT_CTRLS         | no
+ ioctl VIDIOC_S_EXT_CTRLS         | no
+ ioctl VIDIOC_TRY_EXT_CTRLS       | no
+ ioctl VIDIOC_G_FBUF              | no
+ ioctl VIDIOC_S_FBUF              | no
+ ioctl VIDIOC_G_FMT               | no
+ ioctl VIDIOC_S_FMT               | no
+ ioctl VIDIOC_TRY_FMT             | no
+ ioctl VIDIOC_G_FREQUENCY         | no
+ ioctl VIDIOC_S_FREQUENCY         | no
+ ioctl VIDIOC_G_INPUT             | yes, only when STREAM_OFF
+ ioctl VIDIOC_S_INPUT             | yes, only when STREAM_OFF
+ ioctl VIDIOC_G_JPEGCOMP          | no
+ ioctl VIDIOC_S_JPEGCOMP          | no
+ ioctl VIDIOC_G_MODULATOR         | no
+ ioctl VIDIOC_S_MODULATOR         | no
+ ioctl VIDIOC_G_OUTPUT            | no
+ ioctl VIDIOC_S_OUTPUT            | no
+ ioctl VIDIOC_G_PARM              | no
+ ioctl VIDIOC_S_PARM              | no
+ ioctl VIDIOC_G_PRIORITY          | no
+ ioctl VIDIOC_S_PRIORITY          | no
+ ioctl VIDIOC_G_SLICED_VBI_CAP    | no
+ ioctl VIDIOC_G_STD               | yes, only when STREAM_OFF
+ ioctl VIDIOC_S_STD               | yes, only when STREAM_OFF
+ ioctl VIDIOC_G_TUNER             | no
+ ioctl VIDIOC_S_TUNER             | no
+ ioctl VIDIOC_LOG_STATUS          | no
+ ioctl VIDIOC_OVERLAY             | no
+ ioctl VIDIOC_QBUF                | no
+ ioctl VIDIOC_DQBUF               | no
+ ioctl VIDIOC_QUERYBUF            | no
+ ioctl VIDIOC_QUERYCAP            | no
+ ioctl VIDIOC_QUERYCTRL           | no
+ ioctl VIDIOC_QUERYMENU           | no
+ ioctl VIDIOC_QUERYSTD            | no
+ ioctl VIDIOC_REQBUFS             | no
+ ioctl VIDIOC_STREAMON            | no
+ ioctl VIDIOC_STREAMOFF           | no
+ V4L2 mmap()                      | no
+ V4L2 munmap()                    | no
+ V4L2 poll()                      | no
+ V4L2 read()                      | no
+ V4L2 select()                    | no
+ V4L2 write()                     | no
+
+Similar projects
+----------------
+http://www.linuxowl.com/v4ltest.html
+
+Feedbacks
+---------
+Any feedbacks, comments, ideas, etc. are welcome at the author's
+email address: Márton Németh <nm127@freemail.hu>.
diff --git a/testcases/kernel/device-drivers/v4l/user_space/dev_video.c b/testcases/kernel/device-drivers/v4l/user_space/dev_video.c
new file mode 100644
index 0000000..3fc158b
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/dev_video.c
@@ -0,0 +1,104 @@
+/*
+ * v4l-test: Test environment for Video For Linux Two API
+ *
+ * 18 Dec 2008  0.1  First release
+ *
+ * Written by Márton Németh <nm127@freemail.hu>
+ * Released under GPL
+ */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "dev_video.h"
+
+#define DEV_VIDEO_STATE_NORMAL		0
+#define DEV_VIDEO_STATE_ASUS		1
+
+static int f;
+static int dev_video_state;
+
+static int try_ASUS_camera(char *path, char* value) {
+	int ASUS_camera;
+	size_t s;
+	int ret;
+
+	ASUS_camera = open(path, O_WRONLY);
+	if (ASUS_camera < 0) {
+		fprintf(stderr, "Cannot open %s: %s\n", path, strerror(errno));
+		return ASUS_camera;
+	}
+	s = write(ASUS_camera, value, 1);
+	ret = close(ASUS_camera);
+	if (s != 1) {
+		return -1;
+	}
+	if (ret < 0) {
+		perror("Cannot close ASUS camera");
+		return ret;
+	}
+
+	sleep(1);
+
+	f = open("/dev/video0", O_RDWR);
+	if (f < 0) {
+		perror("Cannot open /dev/video0");
+		return f;
+	}
+	dev_video_state = DEV_VIDEO_STATE_ASUS;
+
+	return f;
+}
+
+int open_video() {
+	int error = 0;
+
+	fflush(stdout);
+
+	f = open("/dev/video0", O_RDWR);
+	if (f < 0) {
+		perror("Cannot open /dev/video0");
+		fprintf(stderr, "Retrying with ASUS camera...\n");
+		f = try_ASUS_camera("/proc/acpi/asus/camera", "1");
+		if (f < 0) {
+			error = 1;
+		} else {
+			dev_video_state = DEV_VIDEO_STATE_ASUS;
+		}
+	} else {
+		dev_video_state = DEV_VIDEO_STATE_NORMAL;
+	}
+	return error;
+}
+
+int close_video() {
+	int ret;
+
+	fflush(stdout);
+
+	ret = close(f);
+	if (ret < 0) {
+		perror("Cannot open close");
+		return 1;
+	}
+	switch (dev_video_state) {
+		case DEV_VIDEO_STATE_NORMAL:
+			break;
+		case DEV_VIDEO_STATE_ASUS:
+			try_ASUS_camera("/proc/acpi/asus/camera", "0");
+			break;
+	}
+
+	return 0;
+}
+
+int get_video_fd() {
+	return f;
+}
diff --git a/testcases/kernel/device-drivers/v4l/user_space/dev_video.h b/testcases/kernel/device-drivers/v4l/user_space/dev_video.h
new file mode 100644
index 0000000..628a3b6
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/dev_video.h
@@ -0,0 +1,12 @@
+/*
+ * v4l-test: Test environment for Video For Linux Two API
+ *
+ * 18 Dec 2008  0.1  First release
+ *
+ * Written by Márton Németh <nm127@freemail.hu>
+ * Released under GPL
+ */
+
+int open_video(void);
+int close_video(void);
+int get_video_fd(void);
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/index.html b/testcases/kernel/device-drivers/v4l/user_space/doc/index.html
new file mode 100644
index 0000000..6394099
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/index.html
@@ -0,0 +1,388 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+  <meta content="text/html;charset=ISO-8859-2" http-equiv="Content-Type">
+  <title>v4l-test: Test environment for Video For Linux Two API</title>
+</head>
+<body>
+<a href="#what">What is this?</a> |
+<a href="#build">How to build?</a> |
+<a href="#run">How to run?</a> |
+<a href="#v4l2">V4L2</a> |
+<a href="#code_coverage">Code Coverage</a> |
+<a href="#status">Status</a> |
+<a href="#others">Similar projects</a> |
+<a href="#feedback">Feedback</a><br>
+<hr style="width: 100%; height: 2px;">
+<h1>v4l-test: Test environment for Video For Linux Two API</h1>
+Download <a href="http://sourceforge.net/project/showfiles.php?group_id=247983">v4l-test</a>
+or visit <a href="http://sourceforge.net/projects/v4l-test/">v4l-test project page</a> at
+<a href="http://sourceforge.net">sourceforge.net</a> .<br>
+<a name="what"></a>
+<h2>What is this?</h2>
+v4l-test is a test test environment for V4L2 drivers. The V4L2 drivers
+are running under Linux in kernel space. This test environment is
+running in userspace and tries what normal video application would do.
+It also tries some things which are supposed to test the error handling
+mechanisms of a V4L2 driver. These are the "invalid test cases".<br>
+<a name="build"></a>
+<h2>How to build?</h2>
+To build the test environment you will need a C compiler, "make" and
+the CUnit development files installed. Just type "make" and the test
+environment is ready.<br>
+<a name="run"></a>
+<h2>How to run?</h2>
+You need to have a video device (i.e. webcam, tuner card, etc.)
+connected to your system and available under /dev/video0. If you don't
+have any hardware device available, you can still test the "Virtual
+Video Driver". To compile this you need to compile your kernel with
+CONFIG_VIDEO_VIVI=m under:<br>
+<pre>  -&gt; Device Drivers<br>    -&gt; Multimedia devices<br>      -&gt; Video For Linux<br>        -&gt; Video capture adapters<br>         -&gt; Virtual Video Driver<br></pre>
+At this point you can execute v4l-test.<br>
+<a name="v4l2"></a>
+<h2>Video for Linux Two Specification</h2>
+The <a href="spec/index.html">V4L2 API specification</a>
+revision 0.24 is the base for this test environment. The most recent
+version can be found at
+<a href="http://v4l2spec.bytesex.org/spec/">http://v4l2spec.bytesex.org/spec/</a><br>
+<a name="code_coverage"></a>
+<h2>Code Coverage</h2>
+The code coverage shows which lines of the code were executed and how
+many times. The measurement results gives you a feedback about the
+quality of the test cases. You can measure the code coverage of a
+kernel module with the <a
+ href="http://ltp.sourceforge.net/coverage/gcov.php">gocv</a> and <a
+ href="http://ltp.sourceforge.net/coverage/lcov.php">lcov</a> softwares.<br>
+<a name="status"></a>
+<h2>Current status</h2>
+Currently all test are running and evaluated automatically. This might
+change in future if we want to test for example plugging and unplugging
+a USB video device or ask the user if a received picture make sense or
+not.<br>
+<br>
+The following table gives an overview about the current state of
+implemented<br>
+test cases.<br>
+<br>
+<table border="1" cellpadding="2"
+ cellspacing="0">
+  <thead>
+    <tr>
+      <td><b>V4L API element</b></td><td><b>Covered?</b></td>
+    </tr>
+  </thead>
+  <tbody>
+    <tr>
+      <td>V4L2 <a href="spec/r7626.htm">close()</a></td>
+      <td>yes</td>
+    </tr>
+    <tr>
+      <td>V4L2 <a href="spec/r7667.htm">ioctl()</a></td>
+      <td>yes</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r7771.htm">VIDIOC_CROPCAP</a></td>
+      <td>yes, only when STREAM_OFF</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r7900.htm">VIDIOC_DBG_G_REGISTER</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r7900.htm">VIDIOC_DBG_S_REGISTER</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r8087.htm">VIDIOC_ENCODER_CMD</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r8087.htm">VIDIOC_TRY_ENCODER_CMD</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r8242.htm">VIDIOC_ENUMAUDIO</a></td>
+      <td>yes, only valid cases</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r8304.htm">VIDIOC_ENUMAUDOUT</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r8367.htm">VIDIOC_ENUM_FMT</a></td>
+      <td>yes, only when STREAM_OFF</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r8494.htm">VIDIOC_ENUM_FRAMESIZES</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r8724.htm">VIDIOC_ENUM_FRAMEINTERVALS</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r8936.htm">VIDIOC_ENUMINPUT</a></td>
+      <td>yes, only when STREAM_OFF</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r9149.htm">VIDIOC_ENUMOUTPUT</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r9288.htm">VIDIOC_ENUMSTD</a></td>
+      <td>yes, only when STREAM_OFF</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r9539.htm">VIDIOC_G_AUDIO</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r9539.htm">VIDIOC_S_AUDIO</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r9688.htm">VIDIOC_G_AUDOUT</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r9688.htm">VIDIOC_S_AUDOUT</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r9804.htm">VIDIOC_G_CHIP_IDENT</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r9994.htm">VIDIOC_G_CROP</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r9994.htm">VIDIOC_S_CROP</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r10104.htm">VIDIOC_G_CTRL</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r10104.htm">VIDIOC_S_CTRL</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r10211.htm">VIDIOC_G_ENC_INDEX</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r10386.htm">VIDIOC_G_EXT_CTRLS</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r10386.htm">VIDIOC_S_EXT_CTRLS</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r10386.htm">VIDIOC_TRY_EXT_CTRLS</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r10595.htm">VIDIOC_G_FBUF</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r10595.htm">VIDIOC_S_FBUF</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r10944.htm">VIDIOC_G_FMT</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r10944.htm">VIDIOC_S_FMT</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r10944.htm">VIDIOC_TRY_FMT</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r11094.htm">VIDIOC_G_FREQUENCY</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r11094.htm">VIDIOC_S_FREQUENCY</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r11217.htm">VIDIOC_G_INPUT</a></td>
+      <td>yes, only when STREAM_OFF</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r11217.htm">VIDIOC_S_INPUT</a></td>
+      <td>yes, only when STREAM_OFF</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r11285.htm">VIDIOC_G_JPEGCOMP</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r11285.htm">VIDIOC_S_JPEGCOMP</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r11430.htm">VIDIOC_G_MODULATOR</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r11430.htm">VIDIOC_S_MODULATOR</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r11612.htm">VIDIOC_G_OUTPUT</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r11612.htm">VIDIOC_S_OUTPUT</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r11680.htm">VIDIOC_G_PARM</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r11680.htm">VIDIOC_S_PARM</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r11946.htm">VIDIOC_G_PRIORITY</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r11946.htm">VIDIOC_S_PRIORITY</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r12051.htm">VIDIOC_G_SLICED_VBI_CAP</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r12265.htm">VIDIOC_G_STD</a></td>
+      <td>yes, only when STREAM_OFF</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r12265.htm">VIDIOC_S_STD</a></td>
+      <td>yes, only when STREAM_OFF</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r12342.htm">VIDIOC_G_TUNER</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r12342.htm">VIDIOC_S_TUNER</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r12784.htm">VIDIOC_LOG_STATUS</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r12816.htm">VIDIOC_OVERLAY</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r12878.htm">VIDIOC_QBUF</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r12878.htm">VIDIOC_DQBUF</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r13022.htm">VIDIOC_QUERYBUF</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r13105.htm">VIDIOC_QUERYCAP</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r13317.htm">VIDIOC_QUERYCTRL</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r13317.htm">VIDIOC_QUERYMENU</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r13641.htm">VIDIOC_QUERYSTD</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r13696.htm">VIDIOC_REQBUFS</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r13817.htm">VIDIOC_STREAMON</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>ioctl <a href="spec/r13817.htm">VIDIOC_STREAMOFF</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>V4L2 <a href="spec/r13889.htm">mmap()</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>V4L2 <a href="spec/r14037.htm">munmap()</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>V4L2 <a href="spec/r14090.htm">open()</a></td>
+      <td>yes, partly</td>
+    </tr>
+    <tr>
+      <td>V4L2 <a href="spec/r14169.htm">poll()</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>V4L2 <a href="spec/r14264.htm">read()</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>V4L2 <a href="spec/r14390.htm">select()</a></td>
+      <td>no</td>
+    </tr>
+    <tr>
+      <td>V4L2 <a href="spec/r14496.htm">write()</a></td>
+      <td>no</td>
+    </tr>
+  </tbody>
+</table>
+
+
+<a name="others"></a>
+<h2>Similar projects</h2>
+There migth be similar projects which also tries to test the V4L2 API.
+So far I could find the following:<br>
+<ul>
+  <li><a href="http://www.linuxowl.com/v4ltest.html">v4ltest</a><br>
+  </li>
+</ul>
+Please let me know if this list misses other V4L or V4L2 test project.<br>
+<a name="feedback"></a>
+<h2 >Feedbacks</h2>
+Any feedbacks, comments, ideas, etc. are welcome at the author's<br>
+email address.<br>
+<hr style="width: 100%; height: 2px;">
+Last changed:
+Mon Dec 22 07:43:59 2008
+<br>
+<p>
+    <a href="http://validator.w3.org/check?uri=referer"><img
+        src="http://www.w3.org/Icons/valid-html401"
+        alt="Valid HTML 4.01 Transitional" height="31" width="88"></a>
+    <a href="http://sourceforge.net"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=247983&amp;type=4" width="125" height="37" border="0" alt="SourceForge.net Logo"></a>
+  </p>
+
+</body>
+</html>
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/a16506.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/a16506.htm
new file mode 100644
index 0000000..bec853c
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/a16506.htm
@@ -0,0 +1,2189 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Video For Linux Two Header File</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="PREVIOUS"
+TITLE="Obsolete API Elements"
+HREF="x16497.htm"><LINK
+REL="NEXT"
+TITLE="Video Capture Example"
+HREF="a16706.htm"></HEAD
+><BODY
+CLASS="APPENDIX"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x16497.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="a16706.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="APPENDIX"
+><H1
+><A
+NAME="VIDEODEV"
+></A
+>Appendix A. Video For Linux Two Header File</H1
+><PRE
+CLASS="PROGRAMLISTING"
+>/*
+ *  Video for Linux Two header file
+ *
+ *  Copyright (C) 1999-2007 the contributors
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  Alternatively you can redistribute this file under the terms of the
+ *  BSD license as stated below:
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *  1. Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *  2. Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *  3. The names of its contributors may not be used to endorse or promote
+ *     products derived from this software without specific prior written
+ *     permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ *  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ *  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *      Header file for v4l or V4L2 drivers and applications
+ * with public API.
+ * All kernel-specific stuff were moved to media/v4l2-dev.h, so
+ * no #if __KERNEL tests are allowed here
+ *
+ *      See http://linuxtv.org for more info
+ *
+ *      Author: Bill Dirks &lt;bill@thedirks.org&gt;
+ *              Justin Schoeman
+ *              Hans Verkuil &lt;hverkuil@xs4all.nl&gt;
+ *              et al.
+ */
+#ifndef __LINUX_VIDEODEV2_H
+#define __LINUX_VIDEODEV2_H
+#ifdef __KERNEL__
+#include &lt;linux/time.h&gt;     /* need struct timeval */
+#include &lt;linux/compiler.h&gt; /* need __user */
+#else
+#define __user
+#include &lt;sys/time.h&gt;
+#endif
+#include &lt;linux/ioctl.h&gt;
+#include &lt;linux/types.h&gt;
+
+/*
+ * Common stuff for both V4L1 and V4L2
+ * Moved from videodev.h
+ */
+#define VIDEO_MAX_FRAME               32
+
+#define VID_TYPE_CAPTURE        1       /* Can capture */
+#define VID_TYPE_TUNER          2       /* Can tune */
+#define VID_TYPE_TELETEXT       4       /* Does teletext */
+#define VID_TYPE_OVERLAY        8       /* Overlay onto frame buffer */
+#define VID_TYPE_CHROMAKEY      16      /* Overlay by chromakey */
+#define VID_TYPE_CLIPPING       32      /* Can clip */
+#define VID_TYPE_FRAMERAM       64      /* Uses the frame buffer memory */
+#define VID_TYPE_SCALES         128     /* Scalable */
+#define VID_TYPE_MONOCHROME     256     /* Monochrome only */
+#define VID_TYPE_SUBCAPTURE     512     /* Can capture subareas of the image */
+#define VID_TYPE_MPEG_DECODER   1024    /* Can decode MPEG streams */
+#define VID_TYPE_MPEG_ENCODER   2048    /* Can encode MPEG streams */
+#define VID_TYPE_MJPEG_DECODER  4096    /* Can decode MJPEG streams */
+#define VID_TYPE_MJPEG_ENCODER  8192    /* Can encode MJPEG streams */
+
+/*
+ *      M I S C E L L A N E O U S
+ */
+
+/*  Four-character-code (FOURCC) */
+#define v4l2_fourcc(a,b,c,d)\
+        (((__u32)(a)&lt;&lt;0)|((__u32)(b)&lt;&lt;8)|((__u32)(c)&lt;&lt;16)|((__u32)(d)&lt;&lt;24))
+
+/*
+ *      E N U M S
+ */
+enum <A
+HREF="x6386.htm#V4L2-FIELD"
+>v4l2_field</A
+> {
+        V4L2_FIELD_ANY           = 0, /* driver can choose from none,
+                                         top, bottom, interlaced
+                                         depending on whatever it thinks
+                                         is approximate ... */
+        V4L2_FIELD_NONE          = 1, /* this device has no fields ... */
+        V4L2_FIELD_TOP           = 2, /* top field only */
+        V4L2_FIELD_BOTTOM        = 3, /* bottom field only */
+        V4L2_FIELD_INTERLACED    = 4, /* both fields interlaced */
+        V4L2_FIELD_SEQ_TB        = 5, /* both fields sequential into one
+                                         buffer, top-bottom order */
+        V4L2_FIELD_SEQ_BT        = 6, /* same as above + bottom-top order */
+        V4L2_FIELD_ALTERNATE     = 7, /* both fields alternating into
+                                         separate buffers */
+        V4L2_FIELD_INTERLACED_TB = 8, /* both fields interlaced, top field
+                                         first and the top field is
+                                         transmitted first */
+        V4L2_FIELD_INTERLACED_BT = 9, /* both fields interlaced, top field
+                                         first and the bottom field is
+                                         transmitted first */
+};
+#define V4L2_FIELD_HAS_TOP(field)       \
+        ((field) == V4L2_FIELD_TOP      ||\
+         (field) == V4L2_FIELD_INTERLACED ||\
+         (field) == V4L2_FIELD_INTERLACED_TB ||\
+         (field) == V4L2_FIELD_INTERLACED_BT ||\
+         (field) == V4L2_FIELD_SEQ_TB   ||\
+         (field) == V4L2_FIELD_SEQ_BT)
+#define V4L2_FIELD_HAS_BOTTOM(field)    \
+        ((field) == V4L2_FIELD_BOTTOM   ||\
+         (field) == V4L2_FIELD_INTERLACED ||\
+         (field) == V4L2_FIELD_INTERLACED_TB ||\
+         (field) == V4L2_FIELD_INTERLACED_BT ||\
+         (field) == V4L2_FIELD_SEQ_TB   ||\
+         (field) == V4L2_FIELD_SEQ_BT)
+#define V4L2_FIELD_HAS_BOTH(field)      \
+        ((field) == V4L2_FIELD_INTERLACED ||\
+         (field) == V4L2_FIELD_INTERLACED_TB ||\
+         (field) == V4L2_FIELD_INTERLACED_BT ||\
+         (field) == V4L2_FIELD_SEQ_TB ||\
+         (field) == V4L2_FIELD_SEQ_BT)
+
+enum <A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+> {
+        V4L2_BUF_TYPE_VIDEO_CAPTURE        = 1,
+        V4L2_BUF_TYPE_VIDEO_OUTPUT         = 2,
+        V4L2_BUF_TYPE_VIDEO_OVERLAY        = 3,
+        V4L2_BUF_TYPE_VBI_CAPTURE          = 4,
+        V4L2_BUF_TYPE_VBI_OUTPUT           = 5,
+        V4L2_BUF_TYPE_SLICED_VBI_CAPTURE   = 6,
+        V4L2_BUF_TYPE_SLICED_VBI_OUTPUT    = 7,
+#if 1 /*KEEP*/
+        /* Experimental */
+        V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8,
+#endif
+        V4L2_BUF_TYPE_PRIVATE              = 0x80,
+};
+
+enum <A
+HREF="r13317.htm#V4L2-CTRL-TYPE"
+>v4l2_ctrl_type</A
+> {
+        V4L2_CTRL_TYPE_INTEGER       = 1,
+        V4L2_CTRL_TYPE_BOOLEAN       = 2,
+        V4L2_CTRL_TYPE_MENU          = 3,
+        V4L2_CTRL_TYPE_BUTTON        = 4,
+        V4L2_CTRL_TYPE_INTEGER64     = 5,
+        V4L2_CTRL_TYPE_CTRL_CLASS    = 6,
+};
+
+enum <A
+HREF="r12342.htm#V4L2-TUNER-TYPE"
+>v4l2_tuner_type</A
+> {
+        V4L2_TUNER_RADIO             = 1,
+        V4L2_TUNER_ANALOG_TV         = 2,
+        V4L2_TUNER_DIGITAL_TV        = 3,
+};
+
+enum <A
+HREF="x5953.htm#V4L2-MEMORY"
+>v4l2_memory</A
+> {
+        V4L2_MEMORY_MMAP             = 1,
+        V4L2_MEMORY_USERPTR          = 2,
+        V4L2_MEMORY_OVERLAY          = 3,
+};
+
+/* see also http://vektor.theorem.ca/graphics/ycbcr/ */
+enum <A
+HREF="x2123.htm#V4L2-COLORSPACE"
+>v4l2_colorspace</A
+> {
+        /* ITU-R 601 -- broadcast NTSC/PAL */
+        V4L2_COLORSPACE_SMPTE170M     = 1,
+
+        /* 1125-Line (US) HDTV */
+        V4L2_COLORSPACE_SMPTE240M     = 2,
+
+        /* HD and modern captures. */
+        V4L2_COLORSPACE_REC709        = 3,
+
+        /* broken BT878 extents (601, luma range 16-253 instead of 16-235) */
+        V4L2_COLORSPACE_BT878         = 4,
+
+        /* These should be useful.  Assume 601 extents. */
+        V4L2_COLORSPACE_470_SYSTEM_M  = 5,
+        V4L2_COLORSPACE_470_SYSTEM_BG = 6,
+
+        /* I know there will be cameras that send this.  So, this is
+         * unspecified chromaticities and full 0-255 on each of the
+         * Y'CbCr components
+         */
+        V4L2_COLORSPACE_JPEG          = 7,
+
+        /* For RGB colourspaces, this is probably a good start. */
+        V4L2_COLORSPACE_SRGB          = 8,
+};
+
+enum <A
+HREF="r11946.htm#V4L2-PRIORITY"
+>v4l2_priority</A
+> {
+        V4L2_PRIORITY_UNSET       = 0,  /* not initialized */
+        V4L2_PRIORITY_BACKGROUND  = 1,
+        V4L2_PRIORITY_INTERACTIVE = 2,
+        V4L2_PRIORITY_RECORD      = 3,
+        V4L2_PRIORITY_DEFAULT     = V4L2_PRIORITY_INTERACTIVE,
+};
+
+struct <A
+HREF="x6570.htm#V4L2-RECT"
+>v4l2_rect</A
+> {
+        __s32   left;
+        __s32   top;
+        __s32   width;
+        __s32   height;
+};
+
+struct <A
+HREF="r9288.htm#V4L2-FRACT"
+>v4l2_fract</A
+> {
+        __u32   numerator;
+        __u32   denominator;
+};
+
+/*
+ *      D R I V E R   C A P A B I L I T I E S
+ */
+struct <A
+HREF="r13105.htm#V4L2-CAPABILITY"
+>v4l2_capability</A
+>
+{
+        __u8    driver[16];     /* i.e.ie; "bttv" */
+        __u8    card[32];       /* i.e.ie; "Hauppauge WinTV" */
+        __u8    bus_info[32];   /* "PCI:" + pci_name(pci_dev) */
+        __u32   version;        /* should use KERNEL_VERSION() */
+        __u32   capabilities;   /* Device capabilities */
+        __u32   reserved[4];
+};
+
+/* Values for 'capabilities' field */
+#define V4L2_CAP_VIDEO_CAPTURE          0x00000001  /* Is a video capture device */
+#define V4L2_CAP_VIDEO_OUTPUT           0x00000002  /* Is a video output device */
+#define V4L2_CAP_VIDEO_OVERLAY          0x00000004  /* Can do video overlay */
+#define V4L2_CAP_VBI_CAPTURE            0x00000010  /* Is a raw VBI capture device */
+#define V4L2_CAP_VBI_OUTPUT             0x00000020  /* Is a raw VBI output device */
+#define V4L2_CAP_SLICED_VBI_CAPTURE     0x00000040  /* Is a sliced VBI capture device */
+#define V4L2_CAP_SLICED_VBI_OUTPUT      0x00000080  /* Is a sliced VBI output device */
+#define V4L2_CAP_RDS_CAPTURE            0x00000100  /* RDS data capture */
+#define V4L2_CAP_VIDEO_OUTPUT_OVERLAY   0x00000200  /* Can do video output overlay */
+
+#define V4L2_CAP_TUNER                  0x00010000  /* has a tuner */
+#define V4L2_CAP_AUDIO                  0x00020000  /* has audio support */
+#define V4L2_CAP_RADIO                  0x00040000  /* is a radio device */
+
+#define V4L2_CAP_READWRITE              0x01000000  /* read/write systemcalls */
+#define V4L2_CAP_ASYNCIO                0x02000000  /* async I/O */
+#define V4L2_CAP_STREAMING              0x04000000  /* streaming I/O ioctls */
+
+/*
+ *      V I D E O   I M A G E   F O R M A T
+ */
+struct <A
+HREF="c2030.htm#V4L2-PIX-FORMAT"
+>v4l2_pix_format</A
+>
+{
+        __u32                   width;
+        __u32                   height;
+        __u32                   pixelformat;
+        enum <A
+HREF="x6386.htm#V4L2-FIELD"
+>v4l2_field</A
+>         field;
+        __u32                   bytesperline;   /* for padding, zero if unused */
+        __u32                   sizeimage;
+        enum <A
+HREF="x2123.htm#V4L2-COLORSPACE"
+>v4l2_colorspace</A
+>    colorspace;
+        __u32                   priv;           /* private data, depends on pixelformat */
+};
+
+/*      Pixel format         FOURCC                        depth  Description  */
+#define <A
+HREF="r2492.htm#V4L2-PIX-FMT-RGB332"
+>V4L2_PIX_FMT_RGB332</A
+>  v4l2_fourcc('R','G','B','1') /*  8  RGB-3-3-2     */
+#define <A
+HREF="r2492.htm#V4L2-PIX-FMT-RGB444"
+>V4L2_PIX_FMT_RGB444</A
+>  v4l2_fourcc('R','4','4','4') /* 16  xxxxrrrr ggggbbbb */
+#define <A
+HREF="r2492.htm#V4L2-PIX-FMT-RGB555"
+>V4L2_PIX_FMT_RGB555</A
+>  v4l2_fourcc('R','G','B','O') /* 16  RGB-5-5-5     */
+#define <A
+HREF="r2492.htm#V4L2-PIX-FMT-RGB565"
+>V4L2_PIX_FMT_RGB565</A
+>  v4l2_fourcc('R','G','B','P') /* 16  RGB-5-6-5     */
+#define <A
+HREF="r2492.htm#V4L2-PIX-FMT-RGB555X"
+>V4L2_PIX_FMT_RGB555X</A
+> v4l2_fourcc('R','G','B','Q') /* 16  RGB-5-5-5 BE  */
+#define <A
+HREF="r2492.htm#V4L2-PIX-FMT-RGB565X"
+>V4L2_PIX_FMT_RGB565X</A
+> v4l2_fourcc('R','G','B','R') /* 16  RGB-5-6-5 BE  */
+#define <A
+HREF="r2492.htm#V4L2-PIX-FMT-BGR24"
+>V4L2_PIX_FMT_BGR24</A
+>   v4l2_fourcc('B','G','R','3') /* 24  BGR-8-8-8     */
+#define <A
+HREF="r2492.htm#V4L2-PIX-FMT-RGB24"
+>V4L2_PIX_FMT_RGB24</A
+>   v4l2_fourcc('R','G','B','3') /* 24  RGB-8-8-8     */
+#define <A
+HREF="r2492.htm#V4L2-PIX-FMT-BGR32"
+>V4L2_PIX_FMT_BGR32</A
+>   v4l2_fourcc('B','G','R','4') /* 32  BGR-8-8-8-8   */
+#define <A
+HREF="r2492.htm#V4L2-PIX-FMT-RGB32"
+>V4L2_PIX_FMT_RGB32</A
+>   v4l2_fourcc('R','G','B','4') /* 32  RGB-8-8-8-8   */
+#define <A
+HREF="r4185.htm"
+>V4L2_PIX_FMT_GREY</A
+>    v4l2_fourcc('G','R','E','Y') /*  8  Greyscale     */
+#define <A
+HREF="r4246.htm"
+>V4L2_PIX_FMT_Y16</A
+>     v4l2_fourcc('Y','1','6',' ') /* 16  Greyscale     */
+#define <A
+HREF="x2428.htm#V4L2-PIX-FMT-PAL8"
+>V4L2_PIX_FMT_PAL8</A
+>    v4l2_fourcc('P','A','L','8') /*  8  8-bit palette */
+#define <A
+HREF="r5016.htm#V4L2-PIX-FMT-YVU410"
+>V4L2_PIX_FMT_YVU410</A
+>  v4l2_fourcc('Y','V','U','9') /*  9  YVU 4:1:0     */
+#define <A
+HREF="r4850.htm#V4L2-PIX-FMT-YVU420"
+>V4L2_PIX_FMT_YVU420</A
+>  v4l2_fourcc('Y','V','1','2') /* 12  YVU 4:2:0     */
+#define <A
+HREF="r4339.htm"
+>V4L2_PIX_FMT_YUYV</A
+>    v4l2_fourcc('Y','U','Y','V') /* 16  YUV 4:2:2     */
+#define <A
+HREF="r4484.htm"
+>V4L2_PIX_FMT_UYVY</A
+>    v4l2_fourcc('U','Y','V','Y') /* 16  YUV 4:2:2     */
+#define <A
+HREF="r5154.htm"
+>V4L2_PIX_FMT_YUV422P</A
+> v4l2_fourcc('4','2','2','P') /* 16  YVU422 planar */
+#define <A
+HREF="r5319.htm"
+>V4L2_PIX_FMT_YUV411P</A
+> v4l2_fourcc('4','1','1','P') /* 16  YVU411 planar */
+#define <A
+HREF="r4629.htm"
+>V4L2_PIX_FMT_Y41P</A
+>    v4l2_fourcc('Y','4','1','P') /* 12  YUV 4:1:1     */
+#define <A
+HREF="r3896.htm#V4L2-PIX-FMT-YUV444"
+>V4L2_PIX_FMT_YUV444</A
+>  v4l2_fourcc('Y','4','4','4') /* 16  xxxxyyyy uuuuvvvv */
+#define <A
+HREF="r3896.htm#V4L2-PIX-FMT-YUV555"
+>V4L2_PIX_FMT_YUV555</A
+>  v4l2_fourcc('Y','U','V','O') /* 16  YUV-5-5-5     */
+#define <A
+HREF="r3896.htm#V4L2-PIX-FMT-YUV565"
+>V4L2_PIX_FMT_YUV565</A
+>  v4l2_fourcc('Y','U','V','P') /* 16  YUV-5-6-5     */
+#define <A
+HREF="r3896.htm#V4L2-PIX-FMT-YUV32"
+>V4L2_PIX_FMT_YUV32</A
+>   v4l2_fourcc('Y','U','V','4') /* 32  YUV-8-8-8-8   */
+
+/* two planes -- one Y, one Cr + Cb interleaved  */
+#define <A
+HREF="r5470.htm#V4L2-PIX-FMT-NV12"
+>V4L2_PIX_FMT_NV12</A
+>    v4l2_fourcc('N','V','1','2') /* 12  Y/CbCr 4:2:0  */
+#define <A
+HREF="r5470.htm#V4L2-PIX-FMT-NV21"
+>V4L2_PIX_FMT_NV21</A
+>    v4l2_fourcc('N','V','2','1') /* 12  Y/CrCb 4:2:0  */
+
+/*  The following formats are not defined in the V4L2 specification */
+#define <A
+HREF="r5016.htm#V4L2-PIX-FMT-YUV410"
+>V4L2_PIX_FMT_YUV410</A
+>  v4l2_fourcc('Y','U','V','9') /*  9  YUV 4:1:0     */
+#define <A
+HREF="r4850.htm#V4L2-PIX-FMT-YUV420"
+>V4L2_PIX_FMT_YUV420</A
+>  v4l2_fourcc('Y','U','1','2') /* 12  YUV 4:2:0     */
+#define <A
+HREF="x5665.htm#V4L2-PIX-FMT-YYUV"
+>V4L2_PIX_FMT_YYUV</A
+>    v4l2_fourcc('Y','Y','U','V') /* 16  YUV 4:2:2     */
+#define <A
+HREF="x5665.htm#V4L2-PIX-FMT-HI240"
+>V4L2_PIX_FMT_HI240</A
+>   v4l2_fourcc('H','I','2','4') /*  8  8-bit color   */
+#define <A
+HREF="x5665.htm#V4L2-PIX-FMT-HM12"
+>V4L2_PIX_FMT_HM12</A
+>    v4l2_fourcc('H','M','1','2') /*  8  YUV 4:2:0 16x16 macroblocks */
+
+/* see http://www.siliconimaging.com/RGB%20Bayer.htm */
+#define <A
+HREF="r3735.htm"
+>V4L2_PIX_FMT_SBGGR8</A
+>  v4l2_fourcc('B','A','8','1') /*  8  BGBG.. GRGR.. */
+#define <A
+HREF="r3796.htm"
+>V4L2_PIX_FMT_SBGGR16</A
+> v4l2_fourcc('B','Y','R','2') /* 16  BGBG.. GRGR.. */
+
+/* compressed formats */
+#define <A
+HREF="x5665.htm#V4L2-PIX-FMT-MJPEG"
+>V4L2_PIX_FMT_MJPEG</A
+>    v4l2_fourcc('M','J','P','G') /* Motion-JPEG   */
+#define <A
+HREF="x5634.htm#V4L2-PIX-FMT-JPEG"
+>V4L2_PIX_FMT_JPEG</A
+>     v4l2_fourcc('J','P','E','G') /* JFIF JPEG     */
+#define <A
+HREF="x5665.htm#V4L2-PIX-FMT-DV"
+>V4L2_PIX_FMT_DV</A
+>       v4l2_fourcc('d','v','s','d') /* 1394          */
+#define <A
+HREF="x5634.htm#V4L2-PIX-FMT-MPEG"
+>V4L2_PIX_FMT_MPEG</A
+>     v4l2_fourcc('M','P','E','G') /* MPEG-1/2/4    */
+
+/*  Vendor-specific formats   */
+#define <A
+HREF="x5665.htm#V4L2-PIX-FMT-WNVA"
+>V4L2_PIX_FMT_WNVA</A
+>     v4l2_fourcc('W','N','V','A') /* Winnov hw compress */
+#define <A
+HREF="x5665.htm#V4L2-PIX-FMT-SN9C10X"
+>V4L2_PIX_FMT_SN9C10X</A
+>  v4l2_fourcc('S','9','1','0') /* SN9C10x compression */
+#define <A
+HREF="x5665.htm#V4L2-PIX-FMT-PWC1"
+>V4L2_PIX_FMT_PWC1</A
+>     v4l2_fourcc('P','W','C','1') /* pwc older webcam */
+#define <A
+HREF="x5665.htm#V4L2-PIX-FMT-PWC2"
+>V4L2_PIX_FMT_PWC2</A
+>     v4l2_fourcc('P','W','C','2') /* pwc newer webcam */
+#define <A
+HREF="x5665.htm#V4L2-PIX-FMT-ET61X251"
+>V4L2_PIX_FMT_ET61X251</A
+> v4l2_fourcc('E','6','2','5') /* ET61X251 compression */
+
+/*
+ *      F O R M A T   E N U M E R A T I O N
+ */
+struct <A
+HREF="r8367.htm#V4L2-FMTDESC"
+>v4l2_fmtdesc</A
+>
+{
+        __u32               index;             /* Format number      */
+        enum <A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+>  type;              /* buffer type        */
+        __u32               flags;
+        __u8                description[32];   /* Description string */
+        __u32               pixelformat;       /* Format fourcc      */
+        __u32               reserved[4];
+};
+
+#define V4L2_FMT_FLAG_COMPRESSED 0x0001
+
+#if 1 /*KEEP*/
+        /* Experimental Frame Size and frame rate enumeration */
+/*
+ *      F R A M E   S I Z E   E N U M E R A T I O N
+ */
+enum <A
+HREF="r8494.htm#V4L2-FRMSIZETYPES"
+>v4l2_frmsizetypes</A
+>
+{
+        V4L2_FRMSIZE_TYPE_DISCRETE      = 1,
+        V4L2_FRMSIZE_TYPE_CONTINUOUS    = 2,
+        V4L2_FRMSIZE_TYPE_STEPWISE      = 3,
+};
+
+struct <A
+HREF="r8494.htm#V4L2-FRMSIZE-DISCRETE"
+>v4l2_frmsize_discrete</A
+>
+{
+        __u32                   width;          /* Frame width [pixel] */
+        __u32                   height;         /* Frame height [pixel] */
+};
+
+struct <A
+HREF="r8494.htm#V4L2-FRMSIZE-STEPWISE"
+>v4l2_frmsize_stepwise</A
+>
+{
+        __u32                   min_width;      /* Minimum frame width [pixel] */
+        __u32                   max_width;      /* Maximum frame width [pixel] */
+        __u32                   step_width;     /* Frame width step size [pixel] */
+        __u32                   min_height;     /* Minimum frame height [pixel] */
+        __u32                   max_height;     /* Maximum frame height [pixel] */
+        __u32                   step_height;    /* Frame height step size [pixel] */
+};
+
+struct <A
+HREF="r8494.htm#V4L2-FRMSIZEENUM"
+>v4l2_frmsizeenum</A
+>
+{
+        __u32                   index;          /* Frame size number */
+        __u32                   pixel_format;   /* Pixel format */
+        __u32                   type;           /* Frame size type the device supports. */
+
+        union {                                 /* Frame size */
+                struct <A
+HREF="r8494.htm#V4L2-FRMSIZE-DISCRETE"
+>v4l2_frmsize_discrete</A
+>    discrete;
+                struct <A
+HREF="r8494.htm#V4L2-FRMSIZE-STEPWISE"
+>v4l2_frmsize_stepwise</A
+>    stepwise;
+        };
+
+        __u32   reserved[2];                    /* Reserved space for future use */
+};
+
+/*
+ *      F R A M E   R A T E   E N U M E R A T I O N
+ */
+enum <A
+HREF="r8724.htm#V4L2-FRMIVALTYPES"
+>v4l2_frmivaltypes</A
+>
+{
+        V4L2_FRMIVAL_TYPE_DISCRETE      = 1,
+        V4L2_FRMIVAL_TYPE_CONTINUOUS    = 2,
+        V4L2_FRMIVAL_TYPE_STEPWISE      = 3,
+};
+
+struct <A
+HREF="r8724.htm#V4L2-FRMIVAL-STEPWISE"
+>v4l2_frmival_stepwise</A
+>
+{
+        struct <A
+HREF="r9288.htm#V4L2-FRACT"
+>v4l2_fract</A
+>       min;            /* Minimum frame interval [s] */
+        struct <A
+HREF="r9288.htm#V4L2-FRACT"
+>v4l2_fract</A
+>       max;            /* Maximum frame interval [s] */
+        struct <A
+HREF="r9288.htm#V4L2-FRACT"
+>v4l2_fract</A
+>       step;           /* Frame interval step size [s] */
+};
+
+struct <A
+HREF="r8724.htm#V4L2-FRMIVALENUM"
+>v4l2_frmivalenum</A
+>
+{
+        __u32                   index;          /* Frame format index */
+        __u32                   pixel_format;   /* Pixel format */
+        __u32                   width;          /* Frame width */
+        __u32                   height;         /* Frame height */
+        __u32                   type;           /* Frame interval type the device supports. */
+
+        union {                                 /* Frame interval */
+                struct <A
+HREF="r9288.htm#V4L2-FRACT"
+>v4l2_fract</A
+>               discrete;
+                struct <A
+HREF="r8724.htm#V4L2-FRMIVAL-STEPWISE"
+>v4l2_frmival_stepwise</A
+>    stepwise;
+        };
+
+        __u32   reserved[2];                    /* Reserved space for future use */
+};
+#endif
+
+/*
+ *      T I M E C O D E
+ */
+struct <A
+HREF="x5953.htm#V4L2-TIMECODE"
+>v4l2_timecode</A
+>
+{
+        __u32   type;
+        __u32   flags;
+        __u8    frames;
+        __u8    seconds;
+        __u8    minutes;
+        __u8    hours;
+        __u8    userbits[4];
+};
+
+/*  Type  */
+#define V4L2_TC_TYPE_24FPS              1
+#define V4L2_TC_TYPE_25FPS              2
+#define V4L2_TC_TYPE_30FPS              3
+#define V4L2_TC_TYPE_50FPS              4
+#define V4L2_TC_TYPE_60FPS              5
+
+/*  Flags  */
+#define V4L2_TC_FLAG_DROPFRAME          0x0001 /* "drop-frame" mode */
+#define V4L2_TC_FLAG_COLORFRAME         0x0002
+#define V4L2_TC_USERBITS_field          0x000C
+#define V4L2_TC_USERBITS_USERDEFINED    0x0000
+#define V4L2_TC_USERBITS_8BITCHARS      0x0008
+/* The above is based on SMPTE timecodes */
+
+struct <A
+HREF="r11285.htm#V4L2-JPEGCOMPRESSION"
+>v4l2_jpegcompression</A
+>
+{
+        int quality;
+
+        int  APPn;              /* Number of APP segment to be written,
+                                 * must be 0..15 */
+        int  APP_len;           /* Length of data in JPEG APPn segment */
+        char APP_data[60];      /* Data in the JPEG APPn segment. */
+
+        int  COM_len;           /* Length of data in JPEG COM segment */
+        char COM_data[60];      /* Data in JPEG COM segment */
+
+        __u32 jpeg_markers;     /* Which markers should go into the JPEG
+                                 * output. Unless you exactly know what
+                                 * you do, leave them untouched.
+                                 * Inluding less markers will make the
+                                 * resulting code smaller, but there will
+                                 * be fewer aplications which can read it.
+                                 * The presence of the APP and COM marker
+                                 * is influenced by APP_len and COM_len
+                                 * ONLY, not by this property! */
+
+#define V4L2_JPEG_MARKER_DHT (1&lt;&lt;3)    /* Define Huffman Tables */
+#define V4L2_JPEG_MARKER_DQT (1&lt;&lt;4)    /* Define Quantization Tables */
+#define V4L2_JPEG_MARKER_DRI (1&lt;&lt;5)    /* Define Restart Interval */
+#define V4L2_JPEG_MARKER_COM (1&lt;&lt;6)    /* Comment segment */
+#define V4L2_JPEG_MARKER_APP (1&lt;&lt;7)    /* App segment, driver will
+                                        * allways use APP0 */
+};
+
+/*
+ *      M E M O R Y - M A P P I N G   B U F F E R S
+ */
+struct <A
+HREF="r13696.htm#V4L2-REQUESTBUFFERS"
+>v4l2_requestbuffers</A
+>
+{
+        __u32                   count;
+        enum <A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+>      type;
+        enum <A
+HREF="x5953.htm#V4L2-MEMORY"
+>v4l2_memory</A
+>        memory;
+        __u32                   reserved[2];
+};
+
+struct <A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+>
+{
+        __u32                   index;
+        enum <A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+>      type;
+        __u32                   bytesused;
+        __u32                   flags;
+        enum <A
+HREF="x6386.htm#V4L2-FIELD"
+>v4l2_field</A
+>         field;
+        struct timeval          timestamp;
+        struct <A
+HREF="x5953.htm#V4L2-TIMECODE"
+>v4l2_timecode</A
+>    timecode;
+        __u32                   sequence;
+
+        /* memory location */
+        enum <A
+HREF="x5953.htm#V4L2-MEMORY"
+>v4l2_memory</A
+>        memory;
+        union {
+                __u32           offset;
+                unsigned long   userptr;
+        } m;
+        __u32                   length;
+        __u32                   input;
+        __u32                   reserved;
+};
+
+/*  Flags for 'flags' field */
+#define V4L2_BUF_FLAG_MAPPED    0x0001  /* Buffer is mapped (flag) */
+#define V4L2_BUF_FLAG_QUEUED    0x0002  /* Buffer is queued for processing */
+#define V4L2_BUF_FLAG_DONE      0x0004  /* Buffer is ready */
+#define V4L2_BUF_FLAG_KEYFRAME  0x0008  /* Image is a keyframe (I-frame) */
+#define V4L2_BUF_FLAG_PFRAME    0x0010  /* Image is a P-frame */
+#define V4L2_BUF_FLAG_BFRAME    0x0020  /* Image is a B-frame */
+#define V4L2_BUF_FLAG_TIMECODE  0x0100  /* timecode field is valid */
+#define V4L2_BUF_FLAG_INPUT     0x0200  /* input field is valid */
+
+/*
+ *      O V E R L A Y   P R E V I E W
+ */
+struct <A
+HREF="r10595.htm#V4L2-FRAMEBUFFER"
+>v4l2_framebuffer</A
+>
+{
+        __u32                   capability;
+        __u32                   flags;
+/* FIXME: in theory we should pass something like PCI device + memory
+ * region + offset instead of some physical address */
+        void*                   base;
+        struct <A
+HREF="c2030.htm#V4L2-PIX-FORMAT"
+>v4l2_pix_format</A
+>  fmt;
+};
+/*  Flags for the 'capability' field. Read only */
+#define V4L2_FBUF_CAP_EXTERNOVERLAY     0x0001
+#define V4L2_FBUF_CAP_CHROMAKEY         0x0002
+#define V4L2_FBUF_CAP_LIST_CLIPPING     0x0004
+#define V4L2_FBUF_CAP_BITMAP_CLIPPING   0x0008
+#define V4L2_FBUF_CAP_LOCAL_ALPHA       0x0010
+#define V4L2_FBUF_CAP_GLOBAL_ALPHA      0x0020
+#define V4L2_FBUF_CAP_LOCAL_INV_ALPHA   0x0040
+/*  Flags for the 'flags' field. */
+#define V4L2_FBUF_FLAG_PRIMARY          0x0001
+#define V4L2_FBUF_FLAG_OVERLAY          0x0002
+#define V4L2_FBUF_FLAG_CHROMAKEY        0x0004
+#define V4L2_FBUF_FLAG_LOCAL_ALPHA      0x0008
+#define V4L2_FBUF_FLAG_GLOBAL_ALPHA     0x0010
+#define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA  0x0020
+
+struct <A
+HREF="x6570.htm#V4L2-CLIP"
+>v4l2_clip</A
+>
+{
+        struct <A
+HREF="x6570.htm#V4L2-RECT"
+>v4l2_rect</A
+>        c;
+        struct <A
+HREF="x6570.htm#V4L2-CLIP"
+>v4l2_clip</A
+>        __user *next;
+};
+
+struct <A
+HREF="x6570.htm#V4L2-WINDOW"
+>v4l2_window</A
+>
+{
+        struct <A
+HREF="x6570.htm#V4L2-RECT"
+>v4l2_rect</A
+>        w;
+        enum <A
+HREF="x6386.htm#V4L2-FIELD"
+>v4l2_field</A
+>         field;
+        __u32                   chromakey;
+        struct <A
+HREF="x6570.htm#V4L2-CLIP"
+>v4l2_clip</A
+>        __user *clips;
+        __u32                   clipcount;
+        void                    __user *bitmap;
+        __u8                    global_alpha;
+};
+
+/*
+ *      C A P T U R E   P A R A M E T E R S
+ */
+struct <A
+HREF="r11680.htm#V4L2-CAPTUREPARM"
+>v4l2_captureparm</A
+>
+{
+        __u32              capability;    /*  Supported modes */
+        __u32              capturemode;   /*  Current mode */
+        struct <A
+HREF="r9288.htm#V4L2-FRACT"
+>v4l2_fract</A
+>  timeperframe;  /*  Time per frame in .1us units */
+        __u32              extendedmode;  /*  Driver-specific extensions */
+        __u32              readbuffers;   /*  # of buffers for read */
+        __u32              reserved[4];
+};
+
+/*  Flags for 'capability' and 'capturemode' fields */
+#define V4L2_MODE_HIGHQUALITY   0x0001  /*  High quality imaging mode */
+#define V4L2_CAP_TIMEPERFRAME   0x1000  /*  timeperframe field is supported */
+
+struct <A
+HREF="r11680.htm#V4L2-OUTPUTPARM"
+>v4l2_outputparm</A
+>
+{
+        __u32              capability;   /*  Supported modes */
+        __u32              outputmode;   /*  Current mode */
+        struct <A
+HREF="r9288.htm#V4L2-FRACT"
+>v4l2_fract</A
+>  timeperframe; /*  Time per frame in seconds */
+        __u32              extendedmode; /*  Driver-specific extensions */
+        __u32              writebuffers; /*  # of buffers for write */
+        __u32              reserved[4];
+};
+
+/*
+ *      I N P U T   I M A G E   C R O P P I N G
+ */
+struct <A
+HREF="r7771.htm#V4L2-CROPCAP"
+>v4l2_cropcap</A
+> {
+        enum <A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+>      type;
+        struct <A
+HREF="x6570.htm#V4L2-RECT"
+>v4l2_rect</A
+>        bounds;
+        struct <A
+HREF="x6570.htm#V4L2-RECT"
+>v4l2_rect</A
+>        defrect;
+        struct <A
+HREF="r9288.htm#V4L2-FRACT"
+>v4l2_fract</A
+>       pixelaspect;
+};
+
+struct <A
+HREF="r9994.htm#V4L2-CROP"
+>v4l2_crop</A
+> {
+        enum <A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+>      type;
+        struct <A
+HREF="x6570.htm#V4L2-RECT"
+>v4l2_rect</A
+>        c;
+};
+
+/*
+ *      A N A L O G   V I D E O   S T A N D A R D
+ */
+
+typedef __u64 v4l2_std_id;
+
+/* one bit for each */
+#define V4L2_STD_PAL_B          ((v4l2_std_id)0x00000001)
+#define V4L2_STD_PAL_B1         ((v4l2_std_id)0x00000002)
+#define V4L2_STD_PAL_G          ((v4l2_std_id)0x00000004)
+#define V4L2_STD_PAL_H          ((v4l2_std_id)0x00000008)
+#define V4L2_STD_PAL_I          ((v4l2_std_id)0x00000010)
+#define V4L2_STD_PAL_D          ((v4l2_std_id)0x00000020)
+#define V4L2_STD_PAL_D1         ((v4l2_std_id)0x00000040)
+#define V4L2_STD_PAL_K          ((v4l2_std_id)0x00000080)
+
+#define V4L2_STD_PAL_M          ((v4l2_std_id)0x00000100)
+#define V4L2_STD_PAL_N          ((v4l2_std_id)0x00000200)
+#define V4L2_STD_PAL_Nc         ((v4l2_std_id)0x00000400)
+#define V4L2_STD_PAL_60         ((v4l2_std_id)0x00000800)
+
+#define V4L2_STD_NTSC_M         ((v4l2_std_id)0x00001000)
+#define V4L2_STD_NTSC_M_JP      ((v4l2_std_id)0x00002000)
+#define V4L2_STD_NTSC_443       ((v4l2_std_id)0x00004000)
+#define V4L2_STD_NTSC_M_KR      ((v4l2_std_id)0x00008000)
+
+#define V4L2_STD_SECAM_B        ((v4l2_std_id)0x00010000)
+#define V4L2_STD_SECAM_D        ((v4l2_std_id)0x00020000)
+#define V4L2_STD_SECAM_G        ((v4l2_std_id)0x00040000)
+#define V4L2_STD_SECAM_H        ((v4l2_std_id)0x00080000)
+#define V4L2_STD_SECAM_K        ((v4l2_std_id)0x00100000)
+#define V4L2_STD_SECAM_K1       ((v4l2_std_id)0x00200000)
+#define V4L2_STD_SECAM_L        ((v4l2_std_id)0x00400000)
+#define V4L2_STD_SECAM_LC       ((v4l2_std_id)0x00800000)
+
+/* ATSC/HDTV */
+#define V4L2_STD_ATSC_8_VSB     ((v4l2_std_id)0x01000000)
+#define V4L2_STD_ATSC_16_VSB    ((v4l2_std_id)0x02000000)
+
+/* FIXME:
+   Although std_id is 64 bits, there is an issue on PPC32 architecture that
+   makes switch(__u64) to break. So, there's a hack on v4l2-common.c rounding
+   this value to 32 bits.
+   As, currently, the max value is for V4L2_STD_ATSC_16_VSB (30 bits wide),
+   it should work fine. However, if needed to add more than two standards,
+   v4l2-common.c should be fixed.
+ */
+
+/* some merged standards */
+#define V4L2_STD_MN     (V4L2_STD_PAL_M|V4L2_STD_PAL_N|V4L2_STD_PAL_Nc|V4L2_STD_NTSC)
+#define V4L2_STD_B      (V4L2_STD_PAL_B|V4L2_STD_PAL_B1|V4L2_STD_SECAM_B)
+#define V4L2_STD_GH     (V4L2_STD_PAL_G|V4L2_STD_PAL_H|V4L2_STD_SECAM_G|V4L2_STD_SECAM_H)
+#define V4L2_STD_DK     (V4L2_STD_PAL_DK|V4L2_STD_SECAM_DK)
+
+/* some common needed stuff */
+#define V4L2_STD_PAL_BG         (V4L2_STD_PAL_B         |\
+                                 V4L2_STD_PAL_B1        |\
+                                 V4L2_STD_PAL_G)
+#define V4L2_STD_PAL_DK         (V4L2_STD_PAL_D         |\
+                                 V4L2_STD_PAL_D1        |\
+                                 V4L2_STD_PAL_K)
+#define V4L2_STD_PAL            (V4L2_STD_PAL_BG        |\
+                                 V4L2_STD_PAL_DK        |\
+                                 V4L2_STD_PAL_H         |\
+                                 V4L2_STD_PAL_I)
+#define V4L2_STD_NTSC           (V4L2_STD_NTSC_M        |\
+                                 V4L2_STD_NTSC_M_JP     |\
+                                 V4L2_STD_NTSC_M_KR)
+#define V4L2_STD_SECAM_DK       (V4L2_STD_SECAM_D       |\
+                                 V4L2_STD_SECAM_K       |\
+                                 V4L2_STD_SECAM_K1)
+#define V4L2_STD_SECAM          (V4L2_STD_SECAM_B       |\
+                                 V4L2_STD_SECAM_G       |\
+                                 V4L2_STD_SECAM_H       |\
+                                 V4L2_STD_SECAM_DK      |\
+                                 V4L2_STD_SECAM_L       |\
+                                 V4L2_STD_SECAM_LC)
+
+#define V4L2_STD_525_60         (V4L2_STD_PAL_M         |\
+                                 V4L2_STD_PAL_60        |\
+                                 V4L2_STD_NTSC          |\
+                                 V4L2_STD_NTSC_443)
+#define V4L2_STD_625_50         (V4L2_STD_PAL           |\
+                                 V4L2_STD_PAL_N         |\
+                                 V4L2_STD_PAL_Nc        |\
+                                 V4L2_STD_SECAM)
+#define V4L2_STD_ATSC           (V4L2_STD_ATSC_8_VSB    |\
+                                 V4L2_STD_ATSC_16_VSB)
+
+#define V4L2_STD_UNKNOWN        0
+#define V4L2_STD_ALL            (V4L2_STD_525_60        |\
+                                 V4L2_STD_625_50)
+
+struct <A
+HREF="r9288.htm#V4L2-STANDARD"
+>v4l2_standard</A
+>
+{
+        __u32                index;
+        v4l2_std_id          id;
+        __u8                 name[24];
+        struct <A
+HREF="r9288.htm#V4L2-FRACT"
+>v4l2_fract</A
+>    frameperiod; /* Frames, not fields */
+        __u32                framelines;
+        __u32                reserved[4];
+};
+
+/*
+ *      V I D E O   I N P U T S
+ */
+struct <A
+HREF="r8936.htm#V4L2-INPUT"
+>v4l2_input</A
+>
+{
+        __u32        index;             /*  Which input */
+        __u8         name[32];          /*  Label */
+        __u32        type;              /*  Type of input */
+        __u32        audioset;          /*  Associated audios (bitfield) */
+        __u32        tuner;             /*  Associated tuner */
+        v4l2_std_id  std;
+        __u32        status;
+        __u32        reserved[4];
+};
+
+/*  Values for the 'type' field */
+#define V4L2_INPUT_TYPE_TUNER           1
+#define V4L2_INPUT_TYPE_CAMERA          2
+
+/* field 'status' - general */
+#define V4L2_IN_ST_NO_POWER    0x00000001  /* Attached device is off */
+#define V4L2_IN_ST_NO_SIGNAL   0x00000002
+#define V4L2_IN_ST_NO_COLOR    0x00000004
+
+/* field 'status' - analog */
+#define V4L2_IN_ST_NO_H_LOCK   0x00000100  /* No horizontal sync lock */
+#define V4L2_IN_ST_COLOR_KILL  0x00000200  /* Color killer is active */
+
+/* field 'status' - digital */
+#define V4L2_IN_ST_NO_SYNC     0x00010000  /* No synchronization lock */
+#define V4L2_IN_ST_NO_EQU      0x00020000  /* No equalizer lock */
+#define V4L2_IN_ST_NO_CARRIER  0x00040000  /* Carrier recovery failed */
+
+/* field 'status' - VCR and set-top box */
+#define V4L2_IN_ST_MACROVISION 0x01000000  /* Macrovision detected */
+#define V4L2_IN_ST_NO_ACCESS   0x02000000  /* Conditional access denied */
+#define V4L2_IN_ST_VTR         0x04000000  /* VTR time constant */
+
+/*
+ *      V I D E O   O U T P U T S
+ */
+struct <A
+HREF="r9149.htm#V4L2-OUTPUT"
+>v4l2_output</A
+>
+{
+        __u32        index;             /*  Which output */
+        __u8         name[32];          /*  Label */
+        __u32        type;              /*  Type of output */
+        __u32        audioset;          /*  Associated audios (bitfield) */
+        __u32        modulator;         /*  Associated modulator */
+        v4l2_std_id  std;
+        __u32        reserved[4];
+};
+/*  Values for the 'type' field */
+#define V4L2_OUTPUT_TYPE_MODULATOR              1
+#define V4L2_OUTPUT_TYPE_ANALOG                 2
+#define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY       3
+
+/*
+ *      C O N T R O L S
+ */
+struct <A
+HREF="r10104.htm#V4L2-CONTROL"
+>v4l2_control</A
+>
+{
+        __u32                id;
+        __s32                value;
+};
+
+struct <A
+HREF="r10386.htm#V4L2-EXT-CONTROL"
+>v4l2_ext_control</A
+>
+{
+        __u32 id;
+        __u32 reserved2[2];
+        union {
+                __s32 value;
+                __s64 value64;
+                void *reserved;
+        };
+} __attribute__ ((packed));
+
+struct <A
+HREF="r10386.htm#V4L2-EXT-CONTROLS"
+>v4l2_ext_controls</A
+>
+{
+        __u32 ctrl_class;
+        __u32 count;
+        __u32 error_idx;
+        __u32 reserved[2];
+        struct <A
+HREF="r10386.htm#V4L2-EXT-CONTROL"
+>v4l2_ext_control</A
+> *controls;
+};
+
+/*  Values for ctrl_class field */
+#define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */
+#define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */
+#define V4L2_CTRL_CLASS_CAMERA 0x009a0000       /* Camera class controls */
+
+#define V4L2_CTRL_ID_MASK         (0x0fffffff)
+#define V4L2_CTRL_ID2CLASS(id)    ((id) &amp; 0x0fff0000UL)
+#define V4L2_CTRL_DRIVER_PRIV(id) (((id) &amp; 0xffff) &gt;= 0x1000)
+
+/*  Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
+struct <A
+HREF="r13317.htm#V4L2-QUERYCTRL"
+>v4l2_queryctrl</A
+>
+{
+        __u32                id;
+        enum <A
+HREF="r13317.htm#V4L2-CTRL-TYPE"
+>v4l2_ctrl_type</A
+>  type;
+        __u8                 name[32];  /* Whatever */
+        __s32                minimum;   /* Note signedness */
+        __s32                maximum;
+        __s32                step;
+        __s32                default_value;
+        __u32                flags;
+        __u32                reserved[2];
+};
+
+/*  Used in the VIDIOC_QUERYMENU ioctl for querying menu items */
+struct <A
+HREF="r13317.htm#V4L2-QUERYMENU"
+>v4l2_querymenu</A
+>
+{
+        __u32           id;
+        __u32           index;
+        __u8            name[32];       /* Whatever */
+        __u32           reserved;
+};
+
+/*  Control flags  */
+#define V4L2_CTRL_FLAG_DISABLED         0x0001
+#define V4L2_CTRL_FLAG_GRABBED          0x0002
+#define V4L2_CTRL_FLAG_READ_ONLY        0x0004
+#define V4L2_CTRL_FLAG_UPDATE           0x0008
+#define V4L2_CTRL_FLAG_INACTIVE         0x0010
+#define V4L2_CTRL_FLAG_SLIDER           0x0020
+
+/*  Query flag, to be ORed with the control ID */
+#define V4L2_CTRL_FLAG_NEXT_CTRL        0x80000000
+
+/*  User-class control IDs defined by V4L2 */
+#define V4L2_CID_BASE                   (V4L2_CTRL_CLASS_USER | 0x900)
+#define V4L2_CID_USER_BASE              V4L2_CID_BASE
+/*  IDs reserved for driver specific controls */
+#define V4L2_CID_PRIVATE_BASE           0x08000000
+
+#define V4L2_CID_USER_CLASS             (V4L2_CTRL_CLASS_USER | 1)
+#define V4L2_CID_BRIGHTNESS             (V4L2_CID_BASE+0)
+#define V4L2_CID_CONTRAST               (V4L2_CID_BASE+1)
+#define V4L2_CID_SATURATION             (V4L2_CID_BASE+2)
+#define V4L2_CID_HUE                    (V4L2_CID_BASE+3)
+#define V4L2_CID_AUDIO_VOLUME           (V4L2_CID_BASE+5)
+#define V4L2_CID_AUDIO_BALANCE          (V4L2_CID_BASE+6)
+#define V4L2_CID_AUDIO_BASS             (V4L2_CID_BASE+7)
+#define V4L2_CID_AUDIO_TREBLE           (V4L2_CID_BASE+8)
+#define V4L2_CID_AUDIO_MUTE             (V4L2_CID_BASE+9)
+#define V4L2_CID_AUDIO_LOUDNESS         (V4L2_CID_BASE+10)
+#define V4L2_CID_BLACK_LEVEL            (V4L2_CID_BASE+11) /* Deprecated */
+#define V4L2_CID_AUTO_WHITE_BALANCE     (V4L2_CID_BASE+12)
+#define V4L2_CID_DO_WHITE_BALANCE       (V4L2_CID_BASE+13)
+#define V4L2_CID_RED_BALANCE            (V4L2_CID_BASE+14)
+#define V4L2_CID_BLUE_BALANCE           (V4L2_CID_BASE+15)
+#define V4L2_CID_GAMMA                  (V4L2_CID_BASE+16)
+#define V4L2_CID_WHITENESS              (V4L2_CID_GAMMA) /* Deprecated */
+#define V4L2_CID_EXPOSURE               (V4L2_CID_BASE+17)
+#define V4L2_CID_AUTOGAIN               (V4L2_CID_BASE+18)
+#define V4L2_CID_GAIN                   (V4L2_CID_BASE+19)
+#define V4L2_CID_HFLIP                  (V4L2_CID_BASE+20)
+#define V4L2_CID_VFLIP                  (V4L2_CID_BASE+21)
+
+/* Deprecated, use V4L2_CID_PAN_RESET and V4L2_CID_TILT_RESET */
+#define V4L2_CID_HCENTER_DEPRECATED     (V4L2_CID_BASE+22)
+#define V4L2_CID_VCENTER_DEPRECATED     (V4L2_CID_BASE+23)
+
+#define V4L2_CID_POWER_LINE_FREQUENCY   (V4L2_CID_BASE+24)
+enum&nbsp;v4l2_power_line_frequency {
+        V4L2_CID_POWER_LINE_FREQUENCY_DISABLED  = 0,
+        V4L2_CID_POWER_LINE_FREQUENCY_50HZ      = 1,
+        V4L2_CID_POWER_LINE_FREQUENCY_60HZ      = 2,
+};
+#define V4L2_CID_HUE_AUTO                       (V4L2_CID_BASE+25)
+#define V4L2_CID_WHITE_BALANCE_TEMPERATURE      (V4L2_CID_BASE+26)
+#define V4L2_CID_SHARPNESS                      (V4L2_CID_BASE+27)
+#define V4L2_CID_BACKLIGHT_COMPENSATION         (V4L2_CID_BASE+28)
+#define V4L2_CID_LASTP1                         (V4L2_CID_BASE+29) /* last CID + 1 */
+
+/*  MPEG-class control IDs defined by V4L2 */
+#define V4L2_CID_MPEG_BASE                      (V4L2_CTRL_CLASS_MPEG | 0x900)
+#define V4L2_CID_MPEG_CLASS                     (V4L2_CTRL_CLASS_MPEG | 1)
+
+/*  MPEG streams */
+#define V4L2_CID_MPEG_STREAM_TYPE               (V4L2_CID_MPEG_BASE+0)
+enum&nbsp;v4l2_mpeg_stream_type {
+        V4L2_MPEG_STREAM_TYPE_MPEG2_PS   = 0, /* MPEG-2 program stream */
+        V4L2_MPEG_STREAM_TYPE_MPEG2_TS   = 1, /* MPEG-2 transport stream */
+        V4L2_MPEG_STREAM_TYPE_MPEG1_SS   = 2, /* MPEG-1 system stream */
+        V4L2_MPEG_STREAM_TYPE_MPEG2_DVD  = 3, /* MPEG-2 DVD-compatible stream */
+        V4L2_MPEG_STREAM_TYPE_MPEG1_VCD  = 4, /* MPEG-1 VCD-compatible stream */
+        V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD = 5, /* MPEG-2 SVCD-compatible stream */
+};
+#define V4L2_CID_MPEG_STREAM_PID_PMT            (V4L2_CID_MPEG_BASE+1)
+#define V4L2_CID_MPEG_STREAM_PID_AUDIO          (V4L2_CID_MPEG_BASE+2)
+#define V4L2_CID_MPEG_STREAM_PID_VIDEO          (V4L2_CID_MPEG_BASE+3)
+#define V4L2_CID_MPEG_STREAM_PID_PCR            (V4L2_CID_MPEG_BASE+4)
+#define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO       (V4L2_CID_MPEG_BASE+5)
+#define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO       (V4L2_CID_MPEG_BASE+6)
+#define V4L2_CID_MPEG_STREAM_VBI_FMT            (V4L2_CID_MPEG_BASE+7)
+enum&nbsp;v4l2_mpeg_stream_vbi_fmt {
+        V4L2_MPEG_STREAM_VBI_FMT_NONE = 0,  /* No VBI in the MPEG stream */
+        V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1,  /* VBI in private packets, IVTV format */
+};
+
+/*  MPEG audio */
+#define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ       (V4L2_CID_MPEG_BASE+100)
+enum&nbsp;v4l2_mpeg_audio_sampling_freq {
+        V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0,
+        V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000 = 1,
+        V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000 = 2,
+};
+#define V4L2_CID_MPEG_AUDIO_ENCODING            (V4L2_CID_MPEG_BASE+101)
+enum&nbsp;v4l2_mpeg_audio_encoding {
+        V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0,
+        V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1,
+        V4L2_MPEG_AUDIO_ENCODING_LAYER_3 = 2,
+};
+#define V4L2_CID_MPEG_AUDIO_L1_BITRATE          (V4L2_CID_MPEG_BASE+102)
+enum&nbsp;v4l2_mpeg_audio_l1_bitrate {
+        V4L2_MPEG_AUDIO_L1_BITRATE_32K  = 0,
+        V4L2_MPEG_AUDIO_L1_BITRATE_64K  = 1,
+        V4L2_MPEG_AUDIO_L1_BITRATE_96K  = 2,
+        V4L2_MPEG_AUDIO_L1_BITRATE_128K = 3,
+        V4L2_MPEG_AUDIO_L1_BITRATE_160K = 4,
+        V4L2_MPEG_AUDIO_L1_BITRATE_192K = 5,
+        V4L2_MPEG_AUDIO_L1_BITRATE_224K = 6,
+        V4L2_MPEG_AUDIO_L1_BITRATE_256K = 7,
+        V4L2_MPEG_AUDIO_L1_BITRATE_288K = 8,
+        V4L2_MPEG_AUDIO_L1_BITRATE_320K = 9,
+        V4L2_MPEG_AUDIO_L1_BITRATE_352K = 10,
+        V4L2_MPEG_AUDIO_L1_BITRATE_384K = 11,
+        V4L2_MPEG_AUDIO_L1_BITRATE_416K = 12,
+        V4L2_MPEG_AUDIO_L1_BITRATE_448K = 13,
+};
+#define V4L2_CID_MPEG_AUDIO_L2_BITRATE          (V4L2_CID_MPEG_BASE+103)
+enum&nbsp;v4l2_mpeg_audio_l2_bitrate {
+        V4L2_MPEG_AUDIO_L2_BITRATE_32K  = 0,
+        V4L2_MPEG_AUDIO_L2_BITRATE_48K  = 1,
+        V4L2_MPEG_AUDIO_L2_BITRATE_56K  = 2,
+        V4L2_MPEG_AUDIO_L2_BITRATE_64K  = 3,
+        V4L2_MPEG_AUDIO_L2_BITRATE_80K  = 4,
+        V4L2_MPEG_AUDIO_L2_BITRATE_96K  = 5,
+        V4L2_MPEG_AUDIO_L2_BITRATE_112K = 6,
+        V4L2_MPEG_AUDIO_L2_BITRATE_128K = 7,
+        V4L2_MPEG_AUDIO_L2_BITRATE_160K = 8,
+        V4L2_MPEG_AUDIO_L2_BITRATE_192K = 9,
+        V4L2_MPEG_AUDIO_L2_BITRATE_224K = 10,
+        V4L2_MPEG_AUDIO_L2_BITRATE_256K = 11,
+        V4L2_MPEG_AUDIO_L2_BITRATE_320K = 12,
+        V4L2_MPEG_AUDIO_L2_BITRATE_384K = 13,
+};
+#define V4L2_CID_MPEG_AUDIO_L3_BITRATE          (V4L2_CID_MPEG_BASE+104)
+enum&nbsp;v4l2_mpeg_audio_l3_bitrate {
+        V4L2_MPEG_AUDIO_L3_BITRATE_32K  = 0,
+        V4L2_MPEG_AUDIO_L3_BITRATE_40K  = 1,
+        V4L2_MPEG_AUDIO_L3_BITRATE_48K  = 2,
+        V4L2_MPEG_AUDIO_L3_BITRATE_56K  = 3,
+        V4L2_MPEG_AUDIO_L3_BITRATE_64K  = 4,
+        V4L2_MPEG_AUDIO_L3_BITRATE_80K  = 5,
+        V4L2_MPEG_AUDIO_L3_BITRATE_96K  = 6,
+        V4L2_MPEG_AUDIO_L3_BITRATE_112K = 7,
+        V4L2_MPEG_AUDIO_L3_BITRATE_128K = 8,
+        V4L2_MPEG_AUDIO_L3_BITRATE_160K = 9,
+        V4L2_MPEG_AUDIO_L3_BITRATE_192K = 10,
+        V4L2_MPEG_AUDIO_L3_BITRATE_224K = 11,
+        V4L2_MPEG_AUDIO_L3_BITRATE_256K = 12,
+        V4L2_MPEG_AUDIO_L3_BITRATE_320K = 13,
+};
+#define V4L2_CID_MPEG_AUDIO_MODE                (V4L2_CID_MPEG_BASE+105)
+enum&nbsp;v4l2_mpeg_audio_mode {
+        V4L2_MPEG_AUDIO_MODE_STEREO       = 0,
+        V4L2_MPEG_AUDIO_MODE_JOINT_STEREO = 1,
+        V4L2_MPEG_AUDIO_MODE_DUAL         = 2,
+        V4L2_MPEG_AUDIO_MODE_MONO         = 3,
+};
+#define V4L2_CID_MPEG_AUDIO_MODE_EXTENSION      (V4L2_CID_MPEG_BASE+106)
+enum&nbsp;&nbsp;v4l2_mpeg_audio_mode_extension {
+        V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4  = 0,
+        V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8  = 1,
+        V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12 = 2,
+        V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16 = 3,
+};
+#define V4L2_CID_MPEG_AUDIO_EMPHASIS            (V4L2_CID_MPEG_BASE+107)
+enum&nbsp;v4l2_mpeg_audio_emphasis {
+        V4L2_MPEG_AUDIO_EMPHASIS_NONE         = 0,
+        V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS = 1,
+        V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17    = 2,
+};
+#define V4L2_CID_MPEG_AUDIO_CRC                 (V4L2_CID_MPEG_BASE+108)
+enum&nbsp;v4l2_mpeg_audio_crc {
+        V4L2_MPEG_AUDIO_CRC_NONE  = 0,
+        V4L2_MPEG_AUDIO_CRC_CRC16 = 1,
+};
+#define V4L2_CID_MPEG_AUDIO_MUTE                (V4L2_CID_MPEG_BASE+109)
+
+/*  MPEG video */
+#define V4L2_CID_MPEG_VIDEO_ENCODING            (V4L2_CID_MPEG_BASE+200)
+enum&nbsp;v4l2_mpeg_video_encoding {
+        V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0,
+        V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1,
+};
+#define V4L2_CID_MPEG_VIDEO_ASPECT              (V4L2_CID_MPEG_BASE+201)
+enum&nbsp;v4l2_mpeg_video_aspect {
+        V4L2_MPEG_VIDEO_ASPECT_1x1     = 0,
+        V4L2_MPEG_VIDEO_ASPECT_4x3     = 1,
+        V4L2_MPEG_VIDEO_ASPECT_16x9    = 2,
+        V4L2_MPEG_VIDEO_ASPECT_221x100 = 3,
+};
+#define V4L2_CID_MPEG_VIDEO_B_FRAMES            (V4L2_CID_MPEG_BASE+202)
+#define V4L2_CID_MPEG_VIDEO_GOP_SIZE            (V4L2_CID_MPEG_BASE+203)
+#define V4L2_CID_MPEG_VIDEO_GOP_CLOSURE         (V4L2_CID_MPEG_BASE+204)
+#define V4L2_CID_MPEG_VIDEO_PULLDOWN            (V4L2_CID_MPEG_BASE+205)
+#define V4L2_CID_MPEG_VIDEO_BITRATE_MODE        (V4L2_CID_MPEG_BASE+206)
+enum&nbsp;v4l2_mpeg_video_bitrate_mode {
+        V4L2_MPEG_VIDEO_BITRATE_MODE_VBR = 0,
+        V4L2_MPEG_VIDEO_BITRATE_MODE_CBR = 1,
+};
+#define V4L2_CID_MPEG_VIDEO_BITRATE             (V4L2_CID_MPEG_BASE+207)
+#define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK        (V4L2_CID_MPEG_BASE+208)
+#define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209)
+#define V4L2_CID_MPEG_VIDEO_MUTE                (V4L2_CID_MPEG_BASE+210)
+#define V4L2_CID_MPEG_VIDEO_MUTE_YUV            (V4L2_CID_MPEG_BASE+211)
+
+/*  MPEG-class control IDs specific to the CX2584x driver as defined by V4L2 */
+#define V4L2_CID_MPEG_CX2341X_BASE                              (V4L2_CTRL_CLASS_MPEG | 0x1000)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE         (V4L2_CID_MPEG_CX2341X_BASE+0)
+enum&nbsp;v4l2_mpeg_cx2341x_video_spatial_filter_mode {
+        V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL = 0,
+        V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO   = 1,
+};
+#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER              (V4L2_CID_MPEG_CX2341X_BASE+1)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE    (V4L2_CID_MPEG_CX2341X_BASE+2)
+enum&nbsp;v4l2_mpeg_cx2341x_video_luma_spatial_filter_type {
+        V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF                  = 0,
+        V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR               = 1,
+        V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT              = 2,
+        V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE      = 3,
+        V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE = 4,
+};
+#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE  (V4L2_CID_MPEG_CX2341X_BASE+3)
+enum&nbsp;v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type {
+        V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF    = 0,
+        V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
+};
+#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE        (V4L2_CID_MPEG_CX2341X_BASE+4)
+enum&nbsp;v4l2_mpeg_cx2341x_video_temporal_filter_mode {
+        V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL = 0,
+        V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO   = 1,
+};
+#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER             (V4L2_CID_MPEG_CX2341X_BASE+5)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE          (V4L2_CID_MPEG_CX2341X_BASE+6)
+enum&nbsp;v4l2_mpeg_cx2341x_video_median_filter_type {
+        V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF      = 0,
+        V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR      = 1,
+        V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT     = 2,
+        V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT = 3,
+        V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG     = 4,
+};
+#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM   (V4L2_CID_MPEG_CX2341X_BASE+7)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP      (V4L2_CID_MPEG_CX2341X_BASE+8)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+9)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP    (V4L2_CID_MPEG_CX2341X_BASE+10)
+#define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS         (V4L2_CID_MPEG_CX2341X_BASE+11)
+
+/*  Camera class control IDs */
+#define V4L2_CID_CAMERA_CLASS_BASE      (V4L2_CTRL_CLASS_CAMERA | 0x900)
+#define V4L2_CID_CAMERA_CLASS           (V4L2_CTRL_CLASS_CAMERA | 1)
+
+#define V4L2_CID_EXPOSURE_AUTO                  (V4L2_CID_CAMERA_CLASS_BASE+1)
+enum&nbsp;v4l2_exposure_auto_type {
+        V4L2_EXPOSURE_AUTO = 0,
+        V4L2_EXPOSURE_MANUAL = 1,
+        V4L2_EXPOSURE_SHUTTER_PRIORITY = 2,
+        V4L2_EXPOSURE_APERTURE_PRIORITY = 3
+};
+#define V4L2_CID_EXPOSURE_ABSOLUTE              (V4L2_CID_CAMERA_CLASS_BASE+2)
+#define V4L2_CID_EXPOSURE_AUTO_PRIORITY         (V4L2_CID_CAMERA_CLASS_BASE+3)
+
+#define V4L2_CID_PAN_RELATIVE                   (V4L2_CID_CAMERA_CLASS_BASE+4)
+#define V4L2_CID_TILT_RELATIVE                  (V4L2_CID_CAMERA_CLASS_BASE+5)
+#define V4L2_CID_PAN_RESET                      (V4L2_CID_CAMERA_CLASS_BASE+6)
+#define V4L2_CID_TILT_RESET                     (V4L2_CID_CAMERA_CLASS_BASE+7)
+
+#define V4L2_CID_PAN_ABSOLUTE                   (V4L2_CID_CAMERA_CLASS_BASE+8)
+#define V4L2_CID_TILT_ABSOLUTE                  (V4L2_CID_CAMERA_CLASS_BASE+9)
+
+#define V4L2_CID_FOCUS_ABSOLUTE                 (V4L2_CID_CAMERA_CLASS_BASE+10)
+#define V4L2_CID_FOCUS_RELATIVE                 (V4L2_CID_CAMERA_CLASS_BASE+11)
+#define V4L2_CID_FOCUS_AUTO                     (V4L2_CID_CAMERA_CLASS_BASE+12)
+
+/*
+ *      T U N I N G
+ */
+struct <A
+HREF="r12342.htm#V4L2-TUNER"
+>v4l2_tuner</A
+>
+{
+        __u32                   index;
+        __u8                    name[32];
+        enum <A
+HREF="r12342.htm#V4L2-TUNER-TYPE"
+>v4l2_tuner_type</A
+>    type;
+        __u32                   capability;
+        __u32                   rangelow;
+        __u32                   rangehigh;
+        __u32                   rxsubchans;
+        __u32                   audmode;
+        __s32                   signal;
+        __s32                   afc;
+        __u32                   reserved[4];
+};
+
+struct <A
+HREF="r11430.htm#V4L2-MODULATOR"
+>v4l2_modulator</A
+>
+{
+        __u32                   index;
+        __u8                    name[32];
+        __u32                   capability;
+        __u32                   rangelow;
+        __u32                   rangehigh;
+        __u32                   txsubchans;
+        __u32                   reserved[4];
+};
+
+/*  Flags for the 'capability' field */
+#define V4L2_TUNER_CAP_LOW              0x0001
+#define V4L2_TUNER_CAP_NORM             0x0002
+#define V4L2_TUNER_CAP_STEREO           0x0010
+#define V4L2_TUNER_CAP_LANG2            0x0020
+#define V4L2_TUNER_CAP_SAP              0x0020
+#define V4L2_TUNER_CAP_LANG1            0x0040
+
+/*  Flags for the 'rxsubchans' field */
+#define V4L2_TUNER_SUB_MONO             0x0001
+#define V4L2_TUNER_SUB_STEREO           0x0002
+#define V4L2_TUNER_SUB_LANG2            0x0004
+#define V4L2_TUNER_SUB_SAP              0x0004
+#define V4L2_TUNER_SUB_LANG1            0x0008
+
+/*  Values for the 'audmode' field */
+#define V4L2_TUNER_MODE_MONO            0x0000
+#define V4L2_TUNER_MODE_STEREO          0x0001
+#define V4L2_TUNER_MODE_LANG2           0x0002
+#define V4L2_TUNER_MODE_SAP             0x0002
+#define V4L2_TUNER_MODE_LANG1           0x0003
+#define V4L2_TUNER_MODE_LANG1_LANG2     0x0004
+
+struct <A
+HREF="r11094.htm#V4L2-FREQUENCY"
+>v4l2_frequency</A
+>
+{
+        __u32                 tuner;
+        enum <A
+HREF="r12342.htm#V4L2-TUNER-TYPE"
+>v4l2_tuner_type</A
+>  type;
+        __u32                 frequency;
+        __u32                 reserved[8];
+};
+
+/*
+ *      A U D I O
+ */
+struct <A
+HREF="r9539.htm#V4L2-AUDIO"
+>v4l2_audio</A
+>
+{
+        __u32   index;
+        __u8    name[32];
+        __u32   capability;
+        __u32   mode;
+        __u32   reserved[2];
+};
+
+/*  Flags for the 'capability' field */
+#define V4L2_AUDCAP_STEREO              0x00001
+#define V4L2_AUDCAP_AVL                 0x00002
+
+/*  Flags for the 'mode' field */
+#define V4L2_AUDMODE_AVL                0x00001
+
+struct <A
+HREF="r9688.htm#V4L2-AUDIOOUT"
+>v4l2_audioout</A
+>
+{
+        __u32   index;
+        __u8    name[32];
+        __u32   capability;
+        __u32   mode;
+        __u32   reserved[2];
+};
+
+/*
+ *      M P E G   S E R V I C E S
+ *
+ *      NOTE: EXPERIMENTAL API
+ */
+#if 1 /*KEEP*/
+#define V4L2_ENC_IDX_FRAME_I    (0)
+#define V4L2_ENC_IDX_FRAME_P    (1)
+#define V4L2_ENC_IDX_FRAME_B    (2)
+#define V4L2_ENC_IDX_FRAME_MASK (0xf)
+
+struct <A
+HREF="r10211.htm#V4L2-ENC-IDX-ENTRY"
+>v4l2_enc_idx_entry</A
+> {
+        __u64 offset;
+        __u64 pts;
+        __u32 length;
+        __u32 flags;
+        __u32 reserved[2];
+};
+
+#define V4L2_ENC_IDX_ENTRIES (64)
+struct <A
+HREF="r10211.htm#V4L2-ENC-IDX"
+>v4l2_enc_idx</A
+> {
+        __u32 entries;
+        __u32 entries_cap;
+        __u32 reserved[4];
+        struct <A
+HREF="r10211.htm#V4L2-ENC-IDX-ENTRY"
+>v4l2_enc_idx_entry</A
+> entry[V4L2_ENC_IDX_ENTRIES];
+};
+
+
+#define V4L2_ENC_CMD_START      (0)
+#define V4L2_ENC_CMD_STOP       (1)
+#define V4L2_ENC_CMD_PAUSE      (2)
+#define V4L2_ENC_CMD_RESUME     (3)
+
+/* Flags for V4L2_ENC_CMD_STOP */
+#define V4L2_ENC_CMD_STOP_AT_GOP_END    (1 &lt;&lt; 0)
+
+struct <A
+HREF="r8087.htm#V4L2-ENCODER-CMD"
+>v4l2_encoder_cmd</A
+> {
+        __u32 cmd;
+        __u32 flags;
+        union {
+                struct {
+                        __u32 data[8];
+                } raw;
+        };
+};
+
+#endif
+
+
+/*
+ *      D A T A   S E R V I C E S   ( V B I )
+ *
+ *      Data services API by Michael Schimek
+ */
+
+/* Raw VBI */
+struct <A
+HREF="x7013.htm#V4L2-VBI-FORMAT"
+>v4l2_vbi_format</A
+>
+{
+        __u32   sampling_rate;          /* in 1 Hz */
+        __u32   offset;
+        __u32   samples_per_line;
+        __u32   sample_format;          /* V4L2_PIX_FMT_* */
+        __s32   start[2];
+        __u32   count[2];
+        __u32   flags;                  /* V4L2_VBI_* */
+        __u32   reserved[2];            /* must be zero */
+};
+
+/*  VBI flags  */
+#define V4L2_VBI_UNSYNC         (1&lt;&lt; 0)
+#define V4L2_VBI_INTERLACED     (1&lt;&lt; 1)
+
+/* Sliced VBI
+ *
+ *    This implements is a proposal V4L2 API to allow SLICED VBI
+ * required for some hardware encoders. It should change without
+ * notice in the definitive implementation.
+ */
+
+struct <A
+HREF="x7236.htm#V4L2-SLICED-VBI-FORMAT"
+>v4l2_sliced_vbi_format</A
+>
+{
+        __u16   service_set;
+        /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
+           service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
+                                 (equals frame lines 313-336 for 625 line video
+                                  standards, 263-286 for 525 line standards) */
+        __u16   service_lines[2][24];
+        __u32   io_size;
+        __u32   reserved[2];            /* must be zero */
+};
+
+/* Teletext World System Teletext
+   (WST), defined on ITU-R BT.653-2 */
+#define V4L2_SLICED_TELETEXT_B          (0x0001)
+/* Video Program System, defined on ETS 300 231*/
+#define V4L2_SLICED_VPS                 (0x0400)
+/* Closed Caption, defined on EIA-608 */
+#define V4L2_SLICED_CAPTION_525         (0x1000)
+/* Wide Screen System, defined on ITU-R BT1119.1 */
+#define V4L2_SLICED_WSS_625             (0x4000)
+
+#define V4L2_SLICED_VBI_525             (V4L2_SLICED_CAPTION_525)
+#define V4L2_SLICED_VBI_625             (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625)
+
+struct <A
+HREF="r12051.htm#V4L2-SLICED-VBI-CAP"
+>v4l2_sliced_vbi_cap</A
+>
+{
+        __u16   service_set;
+        /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
+           service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
+                                 (equals frame lines 313-336 for 625 line video
+                                  standards, 263-286 for 525 line standards) */
+        __u16   service_lines[2][24];
+        enum <A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+> type;
+        __u32   reserved[3];    /* must be 0 */
+};
+
+struct <A
+HREF="x7236.htm#V4L2-SLICED-VBI-DATA"
+>v4l2_sliced_vbi_data</A
+>
+{
+        __u32   id;
+        __u32   field;          /* 0: first field, 1: second field */
+        __u32   line;           /* 1-23 */
+        __u32   reserved;       /* must be 0 */
+        __u8    data[48];
+};
+
+/*
+ *      A G G R E G A T E   S T R U C T U R E S
+ */
+
+/*      Stream data format
+ */
+struct <A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+>
+{
+        enum <A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+> type;
+        union
+        {
+                struct <A
+HREF="c2030.htm#V4L2-PIX-FORMAT"
+>v4l2_pix_format</A
+>          pix;     // V4L2_BUF_TYPE_VIDEO_CAPTURE
+                struct <A
+HREF="x6570.htm#V4L2-WINDOW"
+>v4l2_window</A
+>              win;     // V4L2_BUF_TYPE_VIDEO_OVERLAY
+                struct <A
+HREF="x7013.htm#V4L2-VBI-FORMAT"
+>v4l2_vbi_format</A
+>          vbi;     // V4L2_BUF_TYPE_VBI_CAPTURE
+                struct <A
+HREF="x7236.htm#V4L2-SLICED-VBI-FORMAT"
+>v4l2_sliced_vbi_format</A
+>   sliced;  // V4L2_BUF_TYPE_SLICED_VBI_CAPTURE
+                __u8    raw_data[200];                   // user-defined
+        } fmt;
+};
+
+
+/*      Stream type-dependent parameters
+ */
+struct <A
+HREF="r11680.htm#V4L2-STREAMPARM"
+>v4l2_streamparm</A
+>
+{
+        enum <A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+> type;
+        union
+        {
+                struct <A
+HREF="r11680.htm#V4L2-CAPTUREPARM"
+>v4l2_captureparm</A
+> capture;
+                struct <A
+HREF="r11680.htm#V4L2-OUTPUTPARM"
+>v4l2_outputparm</A
+>  output;
+                __u8    raw_data[200];  /* user-defined */
+        } parm;
+};
+
+/*
+ *      A D V A N C E D   D E B U G G I N G
+ *
+ *      NOTE: EXPERIMENTAL API
+ */
+
+/* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */
+
+#define V4L2_CHIP_MATCH_HOST       0  /* Match against chip ID on host (0 for the host) */
+#define V4L2_CHIP_MATCH_I2C_DRIVER 1  /* Match against I2C driver ID */
+#define V4L2_CHIP_MATCH_I2C_ADDR   2  /* Match against I2C 7-bit address */
+
+struct <A
+HREF="r7900.htm#V4L2-REGISTER"
+>v4l2_register</A
+> {
+        __u32 match_type; /* Match type */
+        __u32 match_chip; /* Match this chip, meaning determined by match_type */
+        __u64 reg;
+        __u64 val;
+};
+
+/* VIDIOC_G_CHIP_IDENT */
+struct <A
+HREF="r9804.htm#V4L2-CHIP-IDENT"
+>v4l2_chip_ident</A
+> {
+        __u32 match_type;  /* Match type */
+        __u32 match_chip;  /* Match this chip, meaning determined by match_type */
+        __u32 ident;       /* chip identifier as specified in &lt;media/v4l2-chip-ident.h&gt; */
+        __u32 revision;    /* chip revision, chip specific */
+};
+
+/*
+ *      I O C T L   C O D E S   F O R   V I D E O   D E V I C E S
+ *
+ */
+#define VIDIOC_QUERYCAP         _IOR  ('V',  0, struct <A
+HREF="r13105.htm#V4L2-CAPABILITY"
+>v4l2_capability</A
+>)
+#define VIDIOC_RESERVED         _IO   ('V',  1)
+#define VIDIOC_ENUM_FMT         _IOWR ('V',  2, struct <A
+HREF="r8367.htm#V4L2-FMTDESC"
+>v4l2_fmtdesc</A
+>)
+#define VIDIOC_G_FMT            _IOWR ('V',  4, struct <A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+>)
+#define VIDIOC_S_FMT            _IOWR ('V',  5, struct <A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+>)
+#define VIDIOC_REQBUFS          _IOWR ('V',  8, struct <A
+HREF="r13696.htm#V4L2-REQUESTBUFFERS"
+>v4l2_requestbuffers</A
+>)
+#define VIDIOC_QUERYBUF         _IOWR ('V',  9, struct <A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+>)
+#define VIDIOC_G_FBUF           _IOR  ('V', 10, struct <A
+HREF="r10595.htm#V4L2-FRAMEBUFFER"
+>v4l2_framebuffer</A
+>)
+#define VIDIOC_S_FBUF           _IOW  ('V', 11, struct <A
+HREF="r10595.htm#V4L2-FRAMEBUFFER"
+>v4l2_framebuffer</A
+>)
+#define VIDIOC_OVERLAY          _IOW  ('V', 14, int)
+#define VIDIOC_QBUF             _IOWR ('V', 15, struct <A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+>)
+#define VIDIOC_DQBUF            _IOWR ('V', 17, struct <A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+>)
+#define VIDIOC_STREAMON         _IOW  ('V', 18, int)
+#define VIDIOC_STREAMOFF        _IOW  ('V', 19, int)
+#define VIDIOC_G_PARM           _IOWR ('V', 21, struct <A
+HREF="r11680.htm#V4L2-STREAMPARM"
+>v4l2_streamparm</A
+>)
+#define VIDIOC_S_PARM           _IOWR ('V', 22, struct <A
+HREF="r11680.htm#V4L2-STREAMPARM"
+>v4l2_streamparm</A
+>)
+#define VIDIOC_G_STD            _IOR  ('V', 23, v4l2_std_id)
+#define VIDIOC_S_STD            _IOW  ('V', 24, v4l2_std_id)
+#define VIDIOC_ENUMSTD          _IOWR ('V', 25, struct <A
+HREF="r9288.htm#V4L2-STANDARD"
+>v4l2_standard</A
+>)
+#define VIDIOC_ENUMINPUT        _IOWR ('V', 26, struct <A
+HREF="r8936.htm#V4L2-INPUT"
+>v4l2_input</A
+>)
+#define VIDIOC_G_CTRL           _IOWR ('V', 27, struct <A
+HREF="r10104.htm#V4L2-CONTROL"
+>v4l2_control</A
+>)
+#define VIDIOC_S_CTRL           _IOWR ('V', 28, struct <A
+HREF="r10104.htm#V4L2-CONTROL"
+>v4l2_control</A
+>)
+#define VIDIOC_G_TUNER          _IOWR ('V', 29, struct <A
+HREF="r12342.htm#V4L2-TUNER"
+>v4l2_tuner</A
+>)
+#define VIDIOC_S_TUNER          _IOW  ('V', 30, struct <A
+HREF="r12342.htm#V4L2-TUNER"
+>v4l2_tuner</A
+>)
+#define VIDIOC_G_AUDIO          _IOR  ('V', 33, struct <A
+HREF="r9539.htm#V4L2-AUDIO"
+>v4l2_audio</A
+>)
+#define VIDIOC_S_AUDIO          _IOW  ('V', 34, struct <A
+HREF="r9539.htm#V4L2-AUDIO"
+>v4l2_audio</A
+>)
+#define VIDIOC_QUERYCTRL        _IOWR ('V', 36, struct <A
+HREF="r13317.htm#V4L2-QUERYCTRL"
+>v4l2_queryctrl</A
+>)
+#define VIDIOC_QUERYMENU        _IOWR ('V', 37, struct <A
+HREF="r13317.htm#V4L2-QUERYMENU"
+>v4l2_querymenu</A
+>)
+#define VIDIOC_G_INPUT          _IOR  ('V', 38, int)
+#define VIDIOC_S_INPUT          _IOWR ('V', 39, int)
+#define VIDIOC_G_OUTPUT         _IOR  ('V', 46, int)
+#define VIDIOC_S_OUTPUT         _IOWR ('V', 47, int)
+#define VIDIOC_ENUMOUTPUT       _IOWR ('V', 48, struct <A
+HREF="r9149.htm#V4L2-OUTPUT"
+>v4l2_output</A
+>)
+#define VIDIOC_G_AUDOUT         _IOR  ('V', 49, struct <A
+HREF="r9688.htm#V4L2-AUDIOOUT"
+>v4l2_audioout</A
+>)
+#define VIDIOC_S_AUDOUT         _IOW  ('V', 50, struct <A
+HREF="r9688.htm#V4L2-AUDIOOUT"
+>v4l2_audioout</A
+>)
+#define VIDIOC_G_MODULATOR      _IOWR ('V', 54, struct <A
+HREF="r11430.htm#V4L2-MODULATOR"
+>v4l2_modulator</A
+>)
+#define VIDIOC_S_MODULATOR      _IOW  ('V', 55, struct <A
+HREF="r11430.htm#V4L2-MODULATOR"
+>v4l2_modulator</A
+>)
+#define VIDIOC_G_FREQUENCY      _IOWR ('V', 56, struct <A
+HREF="r11094.htm#V4L2-FREQUENCY"
+>v4l2_frequency</A
+>)
+#define VIDIOC_S_FREQUENCY      _IOW  ('V', 57, struct <A
+HREF="r11094.htm#V4L2-FREQUENCY"
+>v4l2_frequency</A
+>)
+#define VIDIOC_CROPCAP          _IOWR ('V', 58, struct <A
+HREF="r7771.htm#V4L2-CROPCAP"
+>v4l2_cropcap</A
+>)
+#define VIDIOC_G_CROP           _IOWR ('V', 59, struct <A
+HREF="r9994.htm#V4L2-CROP"
+>v4l2_crop</A
+>)
+#define VIDIOC_S_CROP           _IOW  ('V', 60, struct <A
+HREF="r9994.htm#V4L2-CROP"
+>v4l2_crop</A
+>)
+#define VIDIOC_G_JPEGCOMP       _IOR  ('V', 61, struct <A
+HREF="r11285.htm#V4L2-JPEGCOMPRESSION"
+>v4l2_jpegcompression</A
+>)
+#define VIDIOC_S_JPEGCOMP       _IOW  ('V', 62, struct <A
+HREF="r11285.htm#V4L2-JPEGCOMPRESSION"
+>v4l2_jpegcompression</A
+>)
+#define VIDIOC_QUERYSTD         _IOR  ('V', 63, v4l2_std_id)
+#define VIDIOC_TRY_FMT          _IOWR ('V', 64, struct <A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+>)
+#define VIDIOC_ENUMAUDIO        _IOWR ('V', 65, struct <A
+HREF="r9539.htm#V4L2-AUDIO"
+>v4l2_audio</A
+>)
+#define VIDIOC_ENUMAUDOUT       _IOWR ('V', 66, struct <A
+HREF="r9688.htm#V4L2-AUDIOOUT"
+>v4l2_audioout</A
+>)
+#define VIDIOC_G_PRIORITY       _IOR  ('V', 67, enum <A
+HREF="r11946.htm#V4L2-PRIORITY"
+>v4l2_priority</A
+>)
+#define VIDIOC_S_PRIORITY       _IOW  ('V', 68, enum <A
+HREF="r11946.htm#V4L2-PRIORITY"
+>v4l2_priority</A
+>)
+#define VIDIOC_G_SLICED_VBI_CAP _IOWR ('V', 69, struct <A
+HREF="r12051.htm#V4L2-SLICED-VBI-CAP"
+>v4l2_sliced_vbi_cap</A
+>)
+#define VIDIOC_LOG_STATUS       _IO   ('V', 70)
+#define VIDIOC_G_EXT_CTRLS      _IOWR ('V', 71, struct <A
+HREF="r10386.htm#V4L2-EXT-CONTROLS"
+>v4l2_ext_controls</A
+>)
+#define VIDIOC_S_EXT_CTRLS      _IOWR ('V', 72, struct <A
+HREF="r10386.htm#V4L2-EXT-CONTROLS"
+>v4l2_ext_controls</A
+>)
+#define VIDIOC_TRY_EXT_CTRLS    _IOWR ('V', 73, struct <A
+HREF="r10386.htm#V4L2-EXT-CONTROLS"
+>v4l2_ext_controls</A
+>)
+#if 1 /*KEEP*/
+#define VIDIOC_ENUM_FRAMESIZES  _IOWR ('V', 74, struct <A
+HREF="r8494.htm#V4L2-FRMSIZEENUM"
+>v4l2_frmsizeenum</A
+>)
+#define VIDIOC_ENUM_FRAMEINTERVALS      _IOWR ('V', 75, struct <A
+HREF="r8724.htm#V4L2-FRMIVALENUM"
+>v4l2_frmivalenum</A
+>)
+#define VIDIOC_G_ENC_INDEX      _IOR  ('V', 76, struct <A
+HREF="r10211.htm#V4L2-ENC-IDX"
+>v4l2_enc_idx</A
+>)
+#define VIDIOC_ENCODER_CMD      _IOWR ('V', 77, struct <A
+HREF="r8087.htm#V4L2-ENCODER-CMD"
+>v4l2_encoder_cmd</A
+>)
+#define VIDIOC_TRY_ENCODER_CMD  _IOWR ('V', 78, struct <A
+HREF="r8087.htm#V4L2-ENCODER-CMD"
+>v4l2_encoder_cmd</A
+>)
+
+/* Experimental, only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */
+#define VIDIOC_DBG_S_REGISTER   _IOW  ('V', 79, struct <A
+HREF="r7900.htm#V4L2-REGISTER"
+>v4l2_register</A
+>)
+#define VIDIOC_DBG_G_REGISTER   _IOWR ('V', 80, struct <A
+HREF="r7900.htm#V4L2-REGISTER"
+>v4l2_register</A
+>)
+
+#define VIDIOC_G_CHIP_IDENT     _IOWR ('V', 81, struct <A
+HREF="r9804.htm#V4L2-CHIP-IDENT"
+>v4l2_chip_ident</A
+>)
+#endif
+
+#ifdef __OLD_VIDIOC_
+/* for compatibility, will go away some day */
+#define VIDIOC_OVERLAY_OLD      _IOWR ('V', 14, int)
+#define VIDIOC_S_PARM_OLD       _IOW  ('V', 22, struct <A
+HREF="r11680.htm#V4L2-STREAMPARM"
+>v4l2_streamparm</A
+>)
+#define VIDIOC_S_CTRL_OLD       _IOW  ('V', 28, struct <A
+HREF="r10104.htm#V4L2-CONTROL"
+>v4l2_control</A
+>)
+#define VIDIOC_G_AUDIO_OLD      _IOWR ('V', 33, struct <A
+HREF="r9539.htm#V4L2-AUDIO"
+>v4l2_audio</A
+>)
+#define VIDIOC_G_AUDOUT_OLD     _IOWR ('V', 49, struct <A
+HREF="r9688.htm#V4L2-AUDIOOUT"
+>v4l2_audioout</A
+>)
+#define VIDIOC_CROPCAP_OLD      _IOR  ('V', 58, struct <A
+HREF="r7771.htm#V4L2-CROPCAP"
+>v4l2_cropcap</A
+>)
+#endif
+
+#define BASE_VIDIOC_PRIVATE     192             /* 192-255 are private */
+
+#endif /* __LINUX_VIDEODEV2_H */
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */</PRE
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x16497.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="a16706.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Obsolete API Elements</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Video Capture Example</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/a16706.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/a16706.htm
new file mode 100644
index 0000000..e3316bd
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/a16706.htm
@@ -0,0 +1,849 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Video Capture Example</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="PREVIOUS"
+TITLE="Video For Linux Two Header File"
+HREF="a16506.htm"><LINK
+REL="NEXT"
+TITLE="GNU Free Documentation License"
+HREF="a16721.htm"></HEAD
+><BODY
+CLASS="APPENDIX"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="a16506.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="a16721.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="APPENDIX"
+><H1
+><A
+NAME="CAPTURE-EXAMPLE"
+></A
+>Appendix B. Video Capture Example</H1
+><PRE
+CLASS="PROGRAMLISTING"
+>/*
+ *  V4L2 video capture example
+ *
+ *  This program can be used and distributed without restrictions.
+ */
+
+#include &lt;stdio.h&gt;
+#include &lt;stdlib.h&gt;
+#include &lt;string.h&gt;
+#include &lt;assert.h&gt;
+
+#include &lt;getopt.h&gt;             /* getopt_long() */
+
+#include &lt;fcntl.h&gt;              /* low-level i/o */
+#include &lt;unistd.h&gt;
+#include &lt;errno.h&gt;
+#include &lt;malloc.h&gt;
+#include &lt;sys/stat.h&gt;
+#include &lt;sys/types.h&gt;
+#include &lt;sys/time.h&gt;
+#include &lt;sys/mman.h&gt;
+#include &lt;sys/ioctl.h&gt;
+
+#include &lt;asm/types.h&gt;          /* for videodev2.h */
+
+#include &lt;linux/videodev2.h&gt;
+
+#define CLEAR(x) memset (&amp;(x), 0, sizeof (x))
+
+typedef enum {
+        IO_METHOD_READ,
+        IO_METHOD_MMAP,
+        IO_METHOD_USERPTR,
+} io_method;
+
+struct buffer {
+        void *                  start;
+        size_t                  length;
+};
+
+static char *           dev_name        = NULL;
+static io_method        io              = IO_METHOD_MMAP;
+static int              fd              = -1;
+struct buffer *         buffers         = NULL;
+static unsigned int     n_buffers       = 0;
+
+static void
+errno_exit                      (const char *           s)
+{
+        fprintf (stderr, "%s error %d, %s\n",
+                 s, errno, strerror (errno));
+
+        exit (EXIT_FAILURE);
+}
+
+static int
+xioctl                          (int                    fd,
+                                 int                    request,
+                                 void *                 arg)
+{
+        int r;
+
+        do r = ioctl (fd, request, arg);
+        while (-1 == r &amp;&amp; EINTR == errno);
+
+        return r;
+}
+
+static void
+process_image                   (const void *           p)
+{
+        fputc ('.', stdout);
+        fflush (stdout);
+}
+
+static int
+read_frame                      (void)
+{
+        struct <A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+> buf;
+        unsigned int i;
+
+        switch (io) {
+        case IO_METHOD_READ:
+                if (-1 == read (fd, buffers[0].start, buffers[0].length)) {
+                        switch (errno) {
+                        case EAGAIN:
+                                return 0;
+
+                        case EIO:
+                                /* Could ignore EIO, see spec. */
+
+                                /* fall through */
+
+                        default:
+                                errno_exit ("read");
+                        }
+                }
+
+                process_image (buffers[0].start);
+
+                break;
+
+        case IO_METHOD_MMAP:
+                CLEAR (buf);
+
+                buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+                buf.memory = V4L2_MEMORY_MMAP;
+
+                if (-1 == xioctl (fd, VIDIOC_DQBUF, &amp;buf)) {
+                        switch (errno) {
+                        case EAGAIN:
+                                return 0;
+
+                        case EIO:
+                                /* Could ignore EIO, see spec. */
+
+                                /* fall through */
+
+                        default:
+                                errno_exit ("VIDIOC_DQBUF");
+                        }
+                }
+
+                assert (buf.index &lt; n_buffers);
+
+                process_image (buffers[buf.index].start);
+
+                if (-1 == xioctl (fd, VIDIOC_QBUF, &amp;buf))
+                        errno_exit ("VIDIOC_QBUF");
+
+                break;
+
+        case IO_METHOD_USERPTR:
+                CLEAR (buf);
+
+                buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+                buf.memory = V4L2_MEMORY_USERPTR;
+
+                if (-1 == xioctl (fd, VIDIOC_DQBUF, &amp;buf)) {
+                        switch (errno) {
+                        case EAGAIN:
+                                return 0;
+
+                        case EIO:
+                                /* Could ignore EIO, see spec. */
+
+                                /* fall through */
+
+                        default:
+                                errno_exit ("VIDIOC_DQBUF");
+                        }
+                }
+
+                for (i = 0; i &lt; n_buffers; ++i)
+                        if (buf.m.userptr == (unsigned long) buffers[i].start
+                            &amp;&amp; buf.length == buffers[i].length)
+                                break;
+
+                assert (i &lt; n_buffers);
+
+                process_image ((void *) buf.m.userptr);
+
+                if (-1 == xioctl (fd, VIDIOC_QBUF, &amp;buf))
+                        errno_exit ("VIDIOC_QBUF");
+
+                break;
+        }
+
+        return 1;
+}
+
+static void
+mainloop                        (void)
+{
+        unsigned int count;
+
+        count = 100;
+
+        while (count-- &gt; 0) {
+                for (;;) {
+                        fd_set fds;
+                        struct timeval tv;
+                        int r;
+
+                        FD_ZERO (&amp;fds);
+                        FD_SET (fd, &amp;fds);
+
+                        /* Timeout. */
+                        tv.tv_sec = 2;
+                        tv.tv_usec = 0;
+
+                        r = select (fd + 1, &amp;fds, NULL, NULL, &amp;tv);
+
+                        if (-1 == r) {
+                                if (EINTR == errno)
+                                        continue;
+
+                                errno_exit ("select");
+                        }
+
+                        if (0 == r) {
+                                fprintf (stderr, "select timeout\n");
+                                exit (EXIT_FAILURE);
+                        }
+
+                        if (read_frame ())
+                                break;
+        
+                        /* EAGAIN - continue select loop. */
+                }
+        }
+}
+
+static void
+stop_capturing                  (void)
+{
+        enum <A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+> type;
+
+        switch (io) {
+        case IO_METHOD_READ:
+                /* Nothing to do. */
+                break;
+
+        case IO_METHOD_MMAP:
+        case IO_METHOD_USERPTR:
+                type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+
+                if (-1 == xioctl (fd, VIDIOC_STREAMOFF, &amp;type))
+                        errno_exit ("VIDIOC_STREAMOFF");
+
+                break;
+        }
+}
+
+static void
+start_capturing                 (void)
+{
+        unsigned int i;
+        enum <A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+> type;
+
+        switch (io) {
+        case IO_METHOD_READ:
+                /* Nothing to do. */
+                break;
+
+        case IO_METHOD_MMAP:
+                for (i = 0; i &lt; n_buffers; ++i) {
+                        struct <A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+> buf;
+
+                        CLEAR (buf);
+
+                        buf.type        = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+                        buf.memory      = V4L2_MEMORY_MMAP;
+                        buf.index       = i;
+
+                        if (-1 == xioctl (fd, VIDIOC_QBUF, &amp;buf))
+                                errno_exit ("VIDIOC_QBUF");
+                }
+                
+                type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+
+                if (-1 == xioctl (fd, VIDIOC_STREAMON, &amp;type))
+                        errno_exit ("VIDIOC_STREAMON");
+
+                break;
+
+        case IO_METHOD_USERPTR:
+                for (i = 0; i &lt; n_buffers; ++i) {
+                        struct <A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+> buf;
+
+                        CLEAR (buf);
+
+                        buf.type        = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+                        buf.memory      = V4L2_MEMORY_USERPTR;
+                        buf.index       = i;
+                        buf.m.userptr   = (unsigned long) buffers[i].start;
+                        buf.length      = buffers[i].length;
+
+                        if (-1 == xioctl (fd, VIDIOC_QBUF, &amp;buf))
+                                errno_exit ("VIDIOC_QBUF");
+                }
+
+                type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+
+                if (-1 == xioctl (fd, VIDIOC_STREAMON, &amp;type))
+                        errno_exit ("VIDIOC_STREAMON");
+
+                break;
+        }
+}
+
+static void
+uninit_device                   (void)
+{
+        unsigned int i;
+
+        switch (io) {
+        case IO_METHOD_READ:
+                free (buffers[0].start);
+                break;
+
+        case IO_METHOD_MMAP:
+                for (i = 0; i &lt; n_buffers; ++i)
+                        if (-1 == munmap (buffers[i].start, buffers[i].length))
+                                errno_exit ("munmap");
+                break;
+
+        case IO_METHOD_USERPTR:
+                for (i = 0; i &lt; n_buffers; ++i)
+                        free (buffers[i].start);
+                break;
+        }
+
+        free (buffers);
+}
+
+static void
+init_read                       (unsigned int           buffer_size)
+{
+        buffers = calloc (1, sizeof (*buffers));
+
+        if (!buffers) {
+                fprintf (stderr, "Out of memory\n");
+                exit (EXIT_FAILURE);
+        }
+
+        buffers[0].length = buffer_size;
+        buffers[0].start = malloc (buffer_size);
+
+        if (!buffers[0].start) {
+                fprintf (stderr, "Out of memory\n");
+                exit (EXIT_FAILURE);
+        }
+}
+
+static void
+init_mmap                       (void)
+{
+        struct <A
+HREF="r13696.htm#V4L2-REQUESTBUFFERS"
+>v4l2_requestbuffers</A
+> req;
+
+        CLEAR (req);
+
+        req.count               = 4;
+        req.type                = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+        req.memory              = V4L2_MEMORY_MMAP;
+
+        if (-1 == xioctl (fd, VIDIOC_REQBUFS, &amp;req)) {
+                if (EINVAL == errno) {
+                        fprintf (stderr, "%s does not support "
+                                 "memory mapping\n", dev_name);
+                        exit (EXIT_FAILURE);
+                } else {
+                        errno_exit ("VIDIOC_REQBUFS");
+                }
+        }
+
+        if (req.count &lt; 2) {
+                fprintf (stderr, "Insufficient buffer memory on %s\n",
+                         dev_name);
+                exit (EXIT_FAILURE);
+        }
+
+        buffers = calloc (req.count, sizeof (*buffers));
+
+        if (!buffers) {
+                fprintf (stderr, "Out of memory\n");
+                exit (EXIT_FAILURE);
+        }
+
+        for (n_buffers = 0; n_buffers &lt; req.count; ++n_buffers) {
+                struct <A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+> buf;
+
+                CLEAR (buf);
+
+                buf.type        = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+                buf.memory      = V4L2_MEMORY_MMAP;
+                buf.index       = n_buffers;
+
+                if (-1 == xioctl (fd, VIDIOC_QUERYBUF, &amp;buf))
+                        errno_exit ("VIDIOC_QUERYBUF");
+
+                buffers[n_buffers].length = buf.length;
+                buffers[n_buffers].start =
+                        mmap (NULL /* start anywhere */,
+                              buf.length,
+                              PROT_READ | PROT_WRITE /* required */,
+                              MAP_SHARED /* recommended */,
+                              fd, buf.m.offset);
+
+                if (MAP_FAILED == buffers[n_buffers].start)
+                        errno_exit ("mmap");
+        }
+}
+
+static void
+init_userp                      (unsigned int           buffer_size)
+{
+        struct <A
+HREF="r13696.htm#V4L2-REQUESTBUFFERS"
+>v4l2_requestbuffers</A
+> req;
+        unsigned int page_size;
+
+        page_size = getpagesize ();
+        buffer_size = (buffer_size + page_size - 1) &amp; ~(page_size - 1);
+
+        CLEAR (req);
+
+        req.count               = 4;
+        req.type                = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+        req.memory              = V4L2_MEMORY_USERPTR;
+
+        if (-1 == xioctl (fd, VIDIOC_REQBUFS, &amp;req)) {
+                if (EINVAL == errno) {
+                        fprintf (stderr, "%s does not support "
+                                 "user pointer i/o\n", dev_name);
+                        exit (EXIT_FAILURE);
+                } else {
+                        errno_exit ("VIDIOC_REQBUFS");
+                }
+        }
+
+        buffers = calloc (4, sizeof (*buffers));
+
+        if (!buffers) {
+                fprintf (stderr, "Out of memory\n");
+                exit (EXIT_FAILURE);
+        }
+
+        for (n_buffers = 0; n_buffers &lt; 4; ++n_buffers) {
+                buffers[n_buffers].length = buffer_size;
+                buffers[n_buffers].start = memalign (/* boundary */ page_size,
+                                                     buffer_size);
+
+                if (!buffers[n_buffers].start) {
+                        fprintf (stderr, "Out of memory\n");
+                        exit (EXIT_FAILURE);
+                }
+        }
+}
+
+static void
+init_device                     (void)
+{
+        struct <A
+HREF="r13105.htm#V4L2-CAPABILITY"
+>v4l2_capability</A
+> cap;
+        struct <A
+HREF="r7771.htm#V4L2-CROPCAP"
+>v4l2_cropcap</A
+> cropcap;
+        struct <A
+HREF="r9994.htm#V4L2-CROP"
+>v4l2_crop</A
+> crop;
+        struct <A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+> fmt;
+        unsigned int min;
+
+        if (-1 == xioctl (fd, VIDIOC_QUERYCAP, &amp;cap)) {
+                if (EINVAL == errno) {
+                        fprintf (stderr, "%s is no V4L2 device\n",
+                                 dev_name);
+                        exit (EXIT_FAILURE);
+                } else {
+                        errno_exit ("VIDIOC_QUERYCAP");
+                }
+        }
+
+        if (!(cap.capabilities &amp; V4L2_CAP_VIDEO_CAPTURE)) {
+                fprintf (stderr, "%s is no video capture device\n",
+                         dev_name);
+                exit (EXIT_FAILURE);
+        }
+
+        switch (io) {
+        case IO_METHOD_READ:
+                if (!(cap.capabilities &amp; V4L2_CAP_READWRITE)) {
+                        fprintf (stderr, "%s does not support read i/o\n",
+                                 dev_name);
+                        exit (EXIT_FAILURE);
+                }
+
+                break;
+
+        case IO_METHOD_MMAP:
+        case IO_METHOD_USERPTR:
+                if (!(cap.capabilities &amp; V4L2_CAP_STREAMING)) {
+                        fprintf (stderr, "%s does not support streaming i/o\n",
+                                 dev_name);
+                        exit (EXIT_FAILURE);
+                }
+
+                break;
+        }
+
+
+        /* Select video input, video standard and tune here. */
+
+
+        CLEAR (cropcap);
+
+        cropcap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+
+        if (0 == xioctl (fd, VIDIOC_CROPCAP, &amp;cropcap)) {
+                crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+                crop.c = cropcap.defrect; /* reset to default */
+
+                if (-1 == xioctl (fd, VIDIOC_S_CROP, &amp;crop)) {
+                        switch (errno) {
+                        case EINVAL:
+                                /* Cropping not supported. */
+                                break;
+                        default:
+                                /* Errors ignored. */
+                                break;
+                        }
+                }
+        } else {        
+                /* Errors ignored. */
+        }
+
+
+        CLEAR (fmt);
+
+        fmt.type                = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+        fmt.fmt.pix.width       = 640; 
+        fmt.fmt.pix.height      = 480;
+        fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;
+        fmt.fmt.pix.field       = V4L2_FIELD_INTERLACED;
+
+        if (-1 == xioctl (fd, VIDIOC_S_FMT, &amp;fmt))
+                errno_exit ("VIDIOC_S_FMT");
+
+        /* Note VIDIOC_S_FMT may change width and height. */
+
+        /* Buggy driver paranoia. */
+        min = fmt.fmt.pix.width * 2;
+        if (fmt.fmt.pix.bytesperline &lt; min)
+                fmt.fmt.pix.bytesperline = min;
+        min = fmt.fmt.pix.bytesperline * fmt.fmt.pix.height;
+        if (fmt.fmt.pix.sizeimage &lt; min)
+                fmt.fmt.pix.sizeimage = min;
+
+        switch (io) {
+        case IO_METHOD_READ:
+                init_read (fmt.fmt.pix.sizeimage);
+                break;
+
+        case IO_METHOD_MMAP:
+                init_mmap ();
+                break;
+
+        case IO_METHOD_USERPTR:
+                init_userp (fmt.fmt.pix.sizeimage);
+                break;
+        }
+}
+
+static void
+close_device                    (void)
+{
+        if (-1 == close (fd))
+                errno_exit ("close");
+
+        fd = -1;
+}
+
+static void
+open_device                     (void)
+{
+        struct stat st; 
+
+        if (-1 == stat (dev_name, &amp;st)) {
+                fprintf (stderr, "Cannot identify '%s': %d, %s\n",
+                         dev_name, errno, strerror (errno));
+                exit (EXIT_FAILURE);
+        }
+
+        if (!S_ISCHR (st.st_mode)) {
+                fprintf (stderr, "%s is no device\n", dev_name);
+                exit (EXIT_FAILURE);
+        }
+
+        fd = open (dev_name, O_RDWR /* required */ | O_NONBLOCK, 0);
+
+        if (-1 == fd) {
+                fprintf (stderr, "Cannot open '%s': %d, %s\n",
+                         dev_name, errno, strerror (errno));
+                exit (EXIT_FAILURE);
+        }
+}
+
+static void
+usage                           (FILE *                 fp,
+                                 int                    argc,
+                                 char **                argv)
+{
+        fprintf (fp,
+                 "Usage: %s [options]\n\n"
+                 "Options:\n"
+                 "-d | --device name   Video device name [/dev/video]\n"
+                 "-h | --help          Print this message\n"
+                 "-m | --mmap          Use memory mapped buffers\n"
+                 "-r | --read          Use read() calls\n"
+                 "-u | --userp         Use application allocated buffers\n"
+                 "",
+                 argv[0]);
+}
+
+static const char short_options [] = "d:hmru";
+
+static const struct option
+long_options [] = {
+        { "device",     required_argument,      NULL,           'd' },
+        { "help",       no_argument,            NULL,           'h' },
+        { "mmap",       no_argument,            NULL,           'm' },
+        { "read",       no_argument,            NULL,           'r' },
+        { "userp",      no_argument,            NULL,           'u' },
+        { 0, 0, 0, 0 }
+};
+
+int
+main                            (int                    argc,
+                                 char **                argv)
+{
+        dev_name = "/dev/video";
+
+        for (;;) {
+                int index;
+                int c;
+                
+                c = getopt_long (argc, argv,
+                                 short_options, long_options,
+                                 &amp;index);
+
+                if (-1 == c)
+                        break;
+
+                switch (c) {
+                case 0: /* getopt_long() flag */
+                        break;
+
+                case 'd':
+                        dev_name = optarg;
+                        break;
+
+                case 'h':
+                        usage (stdout, argc, argv);
+                        exit (EXIT_SUCCESS);
+
+                case 'm':
+                        io = IO_METHOD_MMAP;
+                        break;
+
+                case 'r':
+                        io = IO_METHOD_READ;
+                        break;
+
+                case 'u':
+                        io = IO_METHOD_USERPTR;
+                        break;
+
+                default:
+                        usage (stderr, argc, argv);
+                        exit (EXIT_FAILURE);
+                }
+        }
+
+        open_device ();
+
+        init_device ();
+
+        start_capturing ();
+
+        mainloop ();
+
+        stop_capturing ();
+
+        uninit_device ();
+
+        close_device ();
+
+        exit (EXIT_SUCCESS);
+
+        return 0;
+}</PRE
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="a16506.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="a16721.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Video For Linux Two Header File</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>GNU Free Documentation License</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/a16721.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/a16721.htm
new file mode 100644
index 0000000..0b33503
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/a16721.htm
@@ -0,0 +1,246 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>GNU Free Documentation License</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="PREVIOUS"
+TITLE="Video Capture Example"
+HREF="a16706.htm"><LINK
+REL="NEXT"
+TITLE="1. APPLICABILITY AND DEFINITIONS"
+HREF="x16743.htm"></HEAD
+><BODY
+CLASS="APPENDIX"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="a16706.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x16743.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="APPENDIX"
+><H1
+><A
+NAME="FDL"
+></A
+>Appendix C. GNU Free Documentation License</H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+>C.1. <A
+HREF="a16721.htm#FDL-PREAMBLE"
+>0. PREAMBLE</A
+></DT
+><DT
+>C.2. <A
+HREF="x16743.htm"
+>1. APPLICABILITY AND DEFINITIONS</A
+></DT
+><DT
+>C.3. <A
+HREF="x16769.htm"
+>2. VERBATIM COPYING</A
+></DT
+><DT
+>C.4. <A
+HREF="x16775.htm"
+>3. COPYING IN QUANTITY</A
+></DT
+><DT
+>C.5. <A
+HREF="x16788.htm"
+>4. MODIFICATIONS</A
+></DT
+><DT
+>C.6. <A
+HREF="x16896.htm"
+>5. COMBINING DOCUMENTS</A
+></DT
+><DT
+>C.7. <A
+HREF="x16910.htm"
+>6. COLLECTIONS OF DOCUMENTS</A
+></DT
+><DT
+>C.8. <A
+HREF="x16915.htm"
+>7. AGGREGATION WITH INDEPENDENT WORKS</A
+></DT
+><DT
+>C.9. <A
+HREF="x16923.htm"
+>8. TRANSLATION</A
+></DT
+><DT
+>C.10. <A
+HREF="x16929.htm"
+>9. TERMINATION</A
+></DT
+><DT
+>C.11. <A
+HREF="x16933.htm"
+>10. FUTURE REVISIONS OF THIS LICENSE</A
+></DT
+><DT
+>C.12. <A
+HREF="x16941.htm"
+>Addendum</A
+></DT
+></DL
+></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="FDL-PREAMBLE"
+>C.1. 0. PREAMBLE</A
+></H1
+><P
+>      The purpose of this License is to make a manual, textbook, or
+      other written document <SPAN
+CLASS="QUOTE"
+>"free"</SPAN
+> in the sense of
+      freedom: to assure everyone the effective freedom to copy and
+      redistribute it, with or without modifying it, either
+      commercially or noncommercially. Secondarily, this License
+      preserves for the author and publisher a way to get credit for
+      their work, while not being considered responsible for
+      modifications made by others.
+    </P
+><P
+>      This License is a kind of <SPAN
+CLASS="QUOTE"
+>"copyleft"</SPAN
+>, which means
+      that derivative works of the document must themselves be free in
+      the same sense. It complements the GNU General Public License,
+      which is a copyleft license designed for free software.
+    </P
+><P
+>      We have designed this License in order to use it for manuals for
+      free software, because free software needs free documentation: a
+      free program should come with manuals providing the same
+      freedoms that the software does. But this License is not limited
+      to software manuals; it can be used for any textual work,
+      regardless of subject matter or whether it is published as a
+      printed book. We recommend this License principally for works
+      whose purpose is instruction or reference.
+    </P
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="a16706.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x16743.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Video Capture Example</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>1. APPLICABILITY AND DEFINITIONS</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/b17127.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/b17127.htm
new file mode 100644
index 0000000..00c9d5a
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/b17127.htm
@@ -0,0 +1,493 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>References</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="PREVIOUS"
+TITLE="List of Types"
+HREF="i16960.htm"></HEAD
+><BODY
+CLASS="BIBLIOGRAPHY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="i16960.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+>&nbsp;</TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><A
+NAME="AEN17127"
+></A
+><H1
+><A
+NAME="AEN17127"
+></A
+>References</H1
+><DIV
+CLASS="BIBLIOENTRY"
+><A
+NAME="EIA608"
+></A
+><P
+>[EIA&nbsp;608-B]&nbsp;Electronic Industries Alliance (<A
+HREF="http://www.eia.org"
+TARGET="_top"
+>http://www.eia.org</A
+>), <I
+>EIA 608-B "Recommended Practice for Line 21 Data
+Service"</I
+>.</P
+><DIV
+CLASS="BIBLIOENTRYBLOCK"
+STYLE="margin-left: 0.5in"
+></DIV
+></DIV
+><DIV
+CLASS="BIBLIOENTRY"
+><A
+NAME="EN300294"
+></A
+><P
+>[EN&nbsp;300&nbsp;294]&nbsp;European Telecommunication Standards Institute
+(<A
+HREF="http://www.etsi.org"
+TARGET="_top"
+>http://www.etsi.org</A
+>), <I
+>EN 300 294 "625-line television Wide Screen Signalling
+(WSS)"</I
+>.</P
+><DIV
+CLASS="BIBLIOENTRYBLOCK"
+STYLE="margin-left: 0.5in"
+></DIV
+></DIV
+><DIV
+CLASS="BIBLIOENTRY"
+><A
+NAME="ETS300231"
+></A
+><P
+>[ETS&nbsp;300&nbsp;231]&nbsp;European Telecommunication Standards Institute
+(<A
+HREF="http://www.etsi.org"
+TARGET="_top"
+>http://www.etsi.org</A
+>), <I
+>ETS 300 231 "Specification of the domestic video
+Programme Delivery Control system (PDC)"</I
+>.</P
+><DIV
+CLASS="BIBLIOENTRYBLOCK"
+STYLE="margin-left: 0.5in"
+></DIV
+></DIV
+><DIV
+CLASS="BIBLIOENTRY"
+><A
+NAME="ETS300706"
+></A
+><P
+>[ETS&nbsp;300&nbsp;706]&nbsp;European Telecommunication Standards Institute
+(<A
+HREF="http://www.etsi.org"
+TARGET="_top"
+>http://www.etsi.org</A
+>), <I
+>ETS 300 706 "Enhanced Teletext specification"</I
+>.</P
+><DIV
+CLASS="BIBLIOENTRYBLOCK"
+STYLE="margin-left: 0.5in"
+></DIV
+></DIV
+><DIV
+CLASS="BIBLIOENTRY"
+><A
+NAME="MPEG2PART1"
+></A
+><P
+>[ISO&nbsp;13818-1]&nbsp;International Telecommunication Union (<A
+HREF="http://www.itu.ch"
+TARGET="_top"
+>http://www.itu.ch</A
+>), International
+Organisation for Standardisation (<A
+HREF="http://www.iso.ch"
+TARGET="_top"
+>http://www.iso.ch</A
+>), <I
+>ITU-T Rec. H.222.0 | ISO/IEC 13818-1 "Information
+technology &mdash; Generic coding of moving pictures and associated
+audio information: Systems"</I
+>.</P
+><DIV
+CLASS="BIBLIOENTRYBLOCK"
+STYLE="margin-left: 0.5in"
+></DIV
+></DIV
+><DIV
+CLASS="BIBLIOENTRY"
+><A
+NAME="MPEG2PART2"
+></A
+><P
+>[ISO&nbsp;13818-2]&nbsp;International Telecommunication Union (<A
+HREF="http://www.itu.ch"
+TARGET="_top"
+>http://www.itu.ch</A
+>), International
+Organisation for Standardisation (<A
+HREF="http://www.iso.ch"
+TARGET="_top"
+>http://www.iso.ch</A
+>), <I
+>ITU-T Rec. H.262 | ISO/IEC 13818-2 "Information
+technology &mdash; Generic coding of moving pictures and associated
+audio information: Video"</I
+>.</P
+><DIV
+CLASS="BIBLIOENTRYBLOCK"
+STYLE="margin-left: 0.5in"
+></DIV
+></DIV
+><DIV
+CLASS="BIBLIOENTRY"
+><A
+NAME="ITU470"
+></A
+><P
+>[ITU&nbsp;BT.470]&nbsp;International Telecommunication Union (<A
+HREF="http://www.itu.ch"
+TARGET="_top"
+>http://www.itu.ch</A
+>), <I
+>ITU-R Recommendation BT.470-6 "Conventional Television
+Systems"</I
+>.</P
+><DIV
+CLASS="BIBLIOENTRYBLOCK"
+STYLE="margin-left: 0.5in"
+></DIV
+></DIV
+><DIV
+CLASS="BIBLIOENTRY"
+><A
+NAME="ITU601"
+></A
+><P
+>[ITU&nbsp;BT.601]&nbsp;International Telecommunication Union (<A
+HREF="http://www.itu.ch"
+TARGET="_top"
+>http://www.itu.ch</A
+>), <I
+>ITU-R Recommendation BT.601-5 "Studio Encoding Parameters
+of Digital Television for Standard 4:3 and Wide-Screen 16:9 Aspect
+Ratios"</I
+>.</P
+><DIV
+CLASS="BIBLIOENTRYBLOCK"
+STYLE="margin-left: 0.5in"
+></DIV
+></DIV
+><DIV
+CLASS="BIBLIOENTRY"
+><A
+NAME="ITU653"
+></A
+><P
+>[ITU&nbsp;BT.653]&nbsp;International Telecommunication Union (<A
+HREF="http://www.itu.ch"
+TARGET="_top"
+>http://www.itu.ch</A
+>), <I
+>ITU-R Recommendation BT.653-3 "Teletext systems"</I
+>.</P
+><DIV
+CLASS="BIBLIOENTRYBLOCK"
+STYLE="margin-left: 0.5in"
+></DIV
+></DIV
+><DIV
+CLASS="BIBLIOENTRY"
+><A
+NAME="ITU709"
+></A
+><P
+>[ITU&nbsp;BT.709]&nbsp;International Telecommunication Union (<A
+HREF="http://www.itu.ch"
+TARGET="_top"
+>http://www.itu.ch</A
+>), <I
+>ITU-R Recommendation BT.709-5 "Parameter values for the
+HDTV standards for production and international programme
+exchange"</I
+>.</P
+><DIV
+CLASS="BIBLIOENTRYBLOCK"
+STYLE="margin-left: 0.5in"
+></DIV
+></DIV
+><DIV
+CLASS="BIBLIOENTRY"
+><A
+NAME="ITU1119"
+></A
+><P
+>[ITU&nbsp;BT.1119]&nbsp;International Telecommunication Union (<A
+HREF="http://www.itu.ch"
+TARGET="_top"
+>http://www.itu.ch</A
+>), <I
+>ITU-R Recommendation BT.1119 "625-line
+television Wide Screen Signalling (WSS)"</I
+>.</P
+><DIV
+CLASS="BIBLIOENTRYBLOCK"
+STYLE="margin-left: 0.5in"
+></DIV
+></DIV
+><DIV
+CLASS="BIBLIOENTRY"
+><A
+NAME="JFIF"
+></A
+><P
+>[JFIF]&nbsp;Independent JPEG Group (<A
+HREF="http://www.ijg.org"
+TARGET="_top"
+>http://www.ijg.org</A
+>), <I
+>JPEG File Interchange Format</I
+><I
+>: </I
+><I
+>Version 1.02</I
+>.</P
+><DIV
+CLASS="BIBLIOENTRYBLOCK"
+STYLE="margin-left: 0.5in"
+></DIV
+></DIV
+><DIV
+CLASS="BIBLIOENTRY"
+><A
+NAME="SMPTE12M"
+></A
+><P
+>[SMPTE&nbsp;12M]&nbsp;Society of Motion Picture and Television Engineers
+(<A
+HREF="http://www.smpte.org"
+TARGET="_top"
+>http://www.smpte.org</A
+>), <I
+>SMPTE 12M-1999 "Television, Audio and Film - Time and
+Control Code"</I
+>.</P
+><DIV
+CLASS="BIBLIOENTRYBLOCK"
+STYLE="margin-left: 0.5in"
+></DIV
+></DIV
+><DIV
+CLASS="BIBLIOENTRY"
+><A
+NAME="SMPTE170M"
+></A
+><P
+>[SMPTE&nbsp;170M]&nbsp;Society of Motion Picture and Television Engineers
+(<A
+HREF="http://www.smpte.org"
+TARGET="_top"
+>http://www.smpte.org</A
+>), <I
+>SMPTE 170M-1999 "Television - Composite Analog Video
+Signal - NTSC for Studio Applications"</I
+>.</P
+><DIV
+CLASS="BIBLIOENTRYBLOCK"
+STYLE="margin-left: 0.5in"
+></DIV
+></DIV
+><DIV
+CLASS="BIBLIOENTRY"
+><A
+NAME="SMPTE240M"
+></A
+><P
+>[SMPTE&nbsp;240M]&nbsp;Society of Motion Picture and Television Engineers
+(<A
+HREF="http://www.smpte.org"
+TARGET="_top"
+>http://www.smpte.org</A
+>), <I
+>SMPTE 240M-1999 "Television - Signal Parameters -
+1125-Line High-Definition Production"</I
+>.</P
+><DIV
+CLASS="BIBLIOENTRYBLOCK"
+STYLE="margin-left: 0.5in"
+></DIV
+></DIV
+><DIV
+CLASS="BIBLIOENTRY"
+><A
+NAME="V4L"
+></A
+><P
+>[V4L]&nbsp;<SPAN
+CLASS="AUTHOR"
+>Alan Cox</SPAN
+>, <I
+>Video4Linux API Specification</I
+>.</P
+><DIV
+CLASS="BIBLIOENTRYBLOCK"
+STYLE="margin-left: 0.5in"
+><DIV
+CLASS="ABSTRACT"
+><P
+>This file is part of the Linux kernel sources under
+<TT
+CLASS="FILENAME"
+>Documentation/video4linux</TT
+>.</P
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="BIBLIOENTRY"
+><A
+NAME="V4LPROG"
+></A
+><P
+>[V4LPROG]&nbsp;<SPAN
+CLASS="AUTHOR"
+>Alan Cox</SPAN
+>, <I
+>Video4Linux Programming (a.k.a. The Video4Linux
+Book)</I
+>, 2000.</P
+><DIV
+CLASS="BIBLIOENTRYBLOCK"
+STYLE="margin-left: 0.5in"
+><DIV
+CLASS="ABSTRACT"
+><P
+>About V4L <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>driver</I
+></SPAN
+> programming. This
+book is part of the Linux kernel DocBook documentation, for example at
+<A
+HREF="http://kernelnewbies.org/documents/"
+TARGET="_top"
+>http://kernelnewbies.org/documents/</A
+>. SGML sources are included
+in the kernel sources.</P
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="i16960.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>List of Types</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>&nbsp;</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/book1.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/book1.htm
new file mode 100644
index 0000000..e828771
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/book1.htm
@@ -0,0 +1,1650 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Video for Linux Two API Specification</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="NEXT"
+TITLE="Introduction"
+HREF="f163.htm"></HEAD
+><BODY
+CLASS="BOOK"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="BOOK"
+><A
+NAME="V4L2SPEC"
+></A
+><DIV
+CLASS="TITLEPAGE"
+><H1
+CLASS="TITLE"
+><A
+NAME="AEN2"
+>Video for Linux Two API Specification</A
+></H1
+><H2
+CLASS="SUBTITLE"
+>Revision 0.24</H2
+><H3
+CLASS="AUTHOR"
+><A
+NAME="AEN6"
+></A
+>Michael H Schimek</H3
+><DIV
+CLASS="AFFILIATION"
+><DIV
+CLASS="ADDRESS"
+><P
+CLASS="ADDRESS"
+>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<CODE
+CLASS="EMAIL"
+>&#60;<A
+HREF="mailto:mschimek@gmx.at"
+>mschimek@gmx.at</A
+>&#62;</CODE
+><br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</P
+></DIV
+></DIV
+><H3
+CLASS="AUTHOR"
+><A
+NAME="AEN13"
+></A
+>Bill Dirks</H3
+><H3
+CLASS="AUTHOR"
+><A
+NAME="AEN17"
+></A
+>Hans Verkuil</H3
+><H3
+CLASS="AUTHOR"
+><A
+NAME="AEN21"
+></A
+>Martin Rubli</H3
+><P
+CLASS="COPYRIGHT"
+>Copyright &copy; 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin
+Rubli</P
+><DIV
+CLASS="LEGALNOTICE"
+><P
+></P
+><A
+NAME="AEN37"
+></A
+><P
+>This document is copyrighted &copy; 1999-2008 by Bill
+Dirks, Michael H. Schimek, Hans Verkuil and Martin Rubli.</P
+><P
+>Permission is granted to copy, distribute and/or modify
+this document under the terms of the GNU Free Documentation License,
+Version 1.1 or any later version published by the Free Software
+Foundation; with no Invariant Sections, with no Front-Cover Texts, and
+with no Back-Cover Texts. A copy of the license is included in the
+appendix entitled "GNU Free Documentation License".</P
+><P
+>Programming examples can be used and distributed without
+restrictions.</P
+><P
+></P
+></DIV
+><HR></DIV
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+><A
+HREF="f163.htm"
+>Introduction</A
+></DT
+><DT
+>1. <A
+HREF="c174.htm"
+>Common API Elements</A
+></DT
+><DD
+><DL
+><DT
+>1.1. <A
+HREF="c174.htm#OPEN"
+>Opening and Closing Devices</A
+></DT
+><DD
+><DL
+><DT
+>1.1.1. <A
+HREF="c174.htm#AEN194"
+>Device Naming</A
+></DT
+><DT
+>1.1.2. <A
+HREF="c174.htm#RELATED"
+>Related Devices</A
+></DT
+><DT
+>1.1.3. <A
+HREF="c174.htm#AEN249"
+>Multiple Opens</A
+></DT
+><DT
+>1.1.4. <A
+HREF="c174.htm#AEN270"
+>Shared Data Streams</A
+></DT
+><DT
+>1.1.5. <A
+HREF="c174.htm#AEN273"
+>Functions</A
+></DT
+></DL
+></DD
+><DT
+>1.2. <A
+HREF="x282.htm"
+>Querying Capabilities</A
+></DT
+><DT
+>1.3. <A
+HREF="x294.htm"
+>Application Priority</A
+></DT
+><DT
+>1.4. <A
+HREF="x309.htm"
+>Video Inputs and Outputs</A
+></DT
+><DT
+>1.5. <A
+HREF="x341.htm"
+>Audio Inputs and Outputs</A
+></DT
+><DT
+>1.6. <A
+HREF="x394.htm"
+>Tuners and Modulators</A
+></DT
+><DD
+><DL
+><DT
+>1.6.1. <A
+HREF="x394.htm#AEN396"
+>Tuners</A
+></DT
+><DT
+>1.6.2. <A
+HREF="x394.htm#AEN418"
+>Modulators</A
+></DT
+><DT
+>1.6.3. <A
+HREF="x394.htm#AEN437"
+>Radio Frequency</A
+></DT
+><DT
+>1.6.4. <A
+HREF="x394.htm#AEN445"
+>Satellite Receivers</A
+></DT
+></DL
+></DD
+><DT
+>1.7. <A
+HREF="x448.htm"
+>Video Standards</A
+></DT
+><DT
+>1.8. <A
+HREF="x542.htm"
+>User Controls</A
+></DT
+><DT
+>1.9. <A
+HREF="x802.htm"
+>Extended Controls</A
+></DT
+><DD
+><DL
+><DT
+>1.9.1. <A
+HREF="x802.htm#AEN804"
+>Introduction</A
+></DT
+><DT
+>1.9.2. <A
+HREF="x802.htm#AEN809"
+>The Extended Control API</A
+></DT
+><DT
+>1.9.3. <A
+HREF="x802.htm#AEN840"
+>Enumerating Extended Controls</A
+></DT
+><DT
+>1.9.4. <A
+HREF="x802.htm#AEN867"
+>Creating Control Panels</A
+></DT
+><DT
+>1.9.5. <A
+HREF="x802.htm#MPEG-CONTROLS"
+>MPEG Control Reference</A
+></DT
+><DT
+>1.9.6. <A
+HREF="x802.htm#CAMERA-CONTROLS"
+>Camera Control Reference</A
+></DT
+></DL
+></DD
+><DT
+>1.10. <A
+HREF="x1859.htm"
+>Data Formats</A
+></DT
+><DD
+><DL
+><DT
+>1.10.1. <A
+HREF="x1859.htm#AEN1861"
+>Data Format Negotiation</A
+></DT
+><DT
+>1.10.2. <A
+HREF="x1859.htm#AEN1894"
+>Image Format Enumeration</A
+></DT
+></DL
+></DD
+><DT
+>1.11. <A
+HREF="x1904.htm"
+>Image Cropping, Insertion and Scaling</A
+></DT
+><DD
+><DL
+><DT
+>1.11.1. <A
+HREF="x1904.htm#AEN1926"
+>Cropping Structures</A
+></DT
+><DT
+>1.11.2. <A
+HREF="x1904.htm#AEN1954"
+>Scaling Adjustments</A
+></DT
+><DT
+>1.11.3. <A
+HREF="x1904.htm#AEN1969"
+>Examples</A
+></DT
+></DL
+></DD
+><DT
+>1.12. <A
+HREF="x2009.htm"
+>Streaming Parameters</A
+></DT
+></DL
+></DD
+><DT
+>2. <A
+HREF="c2030.htm"
+>Image Formats</A
+></DT
+><DD
+><DL
+><DT
+>2.1. <A
+HREF="c2030.htm#AEN2113"
+>Standard Image Formats</A
+></DT
+><DT
+>2.2. <A
+HREF="x2123.htm"
+>Colorspaces</A
+></DT
+><DT
+>2.3. <A
+HREF="x2428.htm"
+>Indexed Format</A
+></DT
+><DT
+>2.4. <A
+HREF="x2490.htm"
+>RGB Formats</A
+></DT
+><DD
+><DL
+><DT
+><A
+HREF="r2492.htm"
+>Packed RGB formats</A
+>&nbsp;--&nbsp;Packed RGB formats</DT
+><DT
+><A
+HREF="r3735.htm"
+>V4L2_PIX_FMT_SBGGR8 ('BA81')</A
+>&nbsp;--&nbsp;Bayer RGB format</DT
+><DT
+><A
+HREF="r3796.htm"
+>V4L2_PIX_FMT_SBGGR16 ('BA82')</A
+>&nbsp;--&nbsp;Bayer RGB format</DT
+></DL
+></DD
+><DT
+>2.5. <A
+HREF="x3891.htm"
+>YUV Formats</A
+></DT
+><DD
+><DL
+><DT
+><A
+HREF="r3896.htm"
+>Packed YUV formats</A
+>&nbsp;--&nbsp;Packed YUV formats</DT
+><DT
+><A
+HREF="r4185.htm"
+>V4L2_PIX_FMT_GREY ('GREY')</A
+>&nbsp;--&nbsp;Grey-scale image</DT
+><DT
+><A
+HREF="r4246.htm"
+>V4L2_PIX_FMT_Y16 ('Y16 ')</A
+>&nbsp;--&nbsp;Grey-scale image</DT
+><DT
+><A
+HREF="r4339.htm"
+>V4L2_PIX_FMT_YUYV ('YUYV')</A
+>&nbsp;--&nbsp;Packed format with &frac12; horizontal chroma
+resolution, also known as YUV 4:2:2</DT
+><DT
+><A
+HREF="r4484.htm"
+>V4L2_PIX_FMT_UYVY ('UYVY')</A
+>&nbsp;--&nbsp;Variation of
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUYV</CODE
+> with different order of samples
+in memory</DT
+><DT
+><A
+HREF="r4629.htm"
+>V4L2_PIX_FMT_Y41P ('Y41P')</A
+>&nbsp;--&nbsp;Format with &frac14; horizontal chroma
+resolution, also known as YUV 4:1:1</DT
+><DT
+><A
+HREF="r4850.htm"
+>V4L2_PIX_FMT_YVU420 ('YV12'), V4L2_PIX_FMT_YUV420 ('YU12')</A
+>&nbsp;--&nbsp;Planar formats with &frac12; horizontal and
+vertical chroma resolution, also known as YUV 4:2:0</DT
+><DT
+><A
+HREF="r5016.htm"
+>V4L2_PIX_FMT_YVU410 ('YVU9'), V4L2_PIX_FMT_YUV410 ('YUV9')</A
+>&nbsp;--&nbsp;Planar formats with &frac14; horizontal and
+vertical chroma resolution, also known as YUV 4:1:0</DT
+><DT
+><A
+HREF="r5154.htm"
+>V4L2_PIX_FMT_YUV422P ('422P')</A
+>&nbsp;--&nbsp;Format with &frac12; horizontal chroma resolution,
+also known as YUV 4:2:2. Planar layout as opposed to
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUYV</CODE
+></DT
+><DT
+><A
+HREF="r5319.htm"
+>V4L2_PIX_FMT_YUV411P ('411P')</A
+>&nbsp;--&nbsp;Format with &frac14; horizontal chroma resolution,
+also known as YUV 4:1:1. Planar layout as opposed to
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_Y41P</CODE
+></DT
+><DT
+><A
+HREF="r5470.htm"
+>V4L2_PIX_FMT_NV12 ('NV12'), V4L2_PIX_FMT_NV21 ('NV21')</A
+>&nbsp;--&nbsp;Formats with &frac12; horizontal and vertical
+chroma resolution, also known as YUV 4:2:0. One luminance and one
+chrominance plane with alternating chroma samples as opposed to
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YVU420</CODE
+></DT
+></DL
+></DD
+><DT
+>2.6. <A
+HREF="x5634.htm"
+>Compressed Formats</A
+></DT
+><DT
+>2.7. <A
+HREF="x5665.htm"
+>Reserved Format Identifiers</A
+></DT
+></DL
+></DD
+><DT
+>3. <A
+HREF="c5742.htm"
+>Input/Output</A
+></DT
+><DD
+><DL
+><DT
+>3.1. <A
+HREF="c5742.htm#RW"
+>Read/Write</A
+></DT
+><DT
+>3.2. <A
+HREF="x5791.htm"
+>Streaming I/O (Memory Mapping)</A
+></DT
+><DT
+>3.3. <A
+HREF="x5884.htm"
+>Streaming I/O (User Pointers)</A
+></DT
+><DT
+>3.4. <A
+HREF="x5950.htm"
+>Asynchronous I/O</A
+></DT
+><DT
+>3.5. <A
+HREF="x5953.htm"
+>Buffers</A
+></DT
+><DD
+><DL
+><DT
+>3.5.1. <A
+HREF="x5953.htm#AEN6266"
+>Timecodes</A
+></DT
+></DL
+></DD
+><DT
+>3.6. <A
+HREF="x6386.htm"
+>Field Order</A
+></DT
+></DL
+></DD
+><DT
+>4. <A
+HREF="c6488.htm"
+>Interfaces</A
+></DT
+><DD
+><DL
+><DT
+>4.1. <A
+HREF="c6488.htm#CAPTURE"
+>Video Capture Interface</A
+></DT
+><DD
+><DL
+><DT
+>4.1.1. <A
+HREF="c6488.htm#AEN6498"
+>Querying Capabilities</A
+></DT
+><DT
+>4.1.2. <A
+HREF="c6488.htm#AEN6510"
+>Supplemental Functions</A
+></DT
+><DT
+>4.1.3. <A
+HREF="c6488.htm#AEN6520"
+>Image Format Negotiation</A
+></DT
+><DT
+>4.1.4. <A
+HREF="c6488.htm#AEN6563"
+>Reading Images</A
+></DT
+></DL
+></DD
+><DT
+>4.2. <A
+HREF="x6570.htm"
+>Video Overlay Interface</A
+></DT
+><DD
+><DL
+><DT
+>4.2.1. <A
+HREF="x6570.htm#AEN6587"
+>Querying Capabilities</A
+></DT
+><DT
+>4.2.2. <A
+HREF="x6570.htm#AEN6595"
+>Supplemental Functions</A
+></DT
+><DT
+>4.2.3. <A
+HREF="x6570.htm#AEN6605"
+>Setup</A
+></DT
+><DT
+>4.2.4. <A
+HREF="x6570.htm#AEN6635"
+>Overlay Window</A
+></DT
+><DT
+>4.2.5. <A
+HREF="x6570.htm#AEN6826"
+>Enabling Overlay</A
+></DT
+></DL
+></DD
+><DT
+>4.3. <A
+HREF="x6831.htm"
+>Video Output Interface</A
+></DT
+><DD
+><DL
+><DT
+>4.3.1. <A
+HREF="x6831.htm#AEN6839"
+>Querying Capabilities</A
+></DT
+><DT
+>4.3.2. <A
+HREF="x6831.htm#AEN6849"
+>Supplemental Functions</A
+></DT
+><DT
+>4.3.3. <A
+HREF="x6831.htm#AEN6859"
+>Image Format Negotiation</A
+></DT
+><DT
+>4.3.4. <A
+HREF="x6831.htm#AEN6902"
+>Writing Images</A
+></DT
+></DL
+></DD
+><DT
+>4.4. <A
+HREF="x6909.htm"
+>Video Output Overlay Interface</A
+></DT
+><DD
+><DL
+><DT
+>4.4.1. <A
+HREF="x6909.htm#AEN6923"
+>Querying Capabilities</A
+></DT
+><DT
+>4.4.2. <A
+HREF="x6909.htm#AEN6932"
+>Framebuffer</A
+></DT
+><DT
+>4.4.3. <A
+HREF="x6909.htm#AEN6953"
+>Overlay Window and Scaling</A
+></DT
+><DT
+>4.4.4. <A
+HREF="x6909.htm#AEN6987"
+>Enabling Overlay</A
+></DT
+></DL
+></DD
+><DT
+>4.5. <A
+HREF="x6991.htm"
+>Codec Interface</A
+></DT
+><DT
+>4.6. <A
+HREF="x7002.htm"
+>Effect Devices Interface</A
+></DT
+><DT
+>4.7. <A
+HREF="x7013.htm"
+>Raw VBI Data Interface</A
+></DT
+><DD
+><DL
+><DT
+>4.7.1. <A
+HREF="x7013.htm#AEN7029"
+>Querying Capabilities</A
+></DT
+><DT
+>4.7.2. <A
+HREF="x7013.htm#AEN7038"
+>Supplemental Functions</A
+></DT
+><DT
+>4.7.3. <A
+HREF="x7013.htm#AEN7045"
+>Raw VBI Format Negotiation</A
+></DT
+><DT
+>4.7.4. <A
+HREF="x7013.htm#AEN7218"
+>Reading and writing VBI images</A
+></DT
+></DL
+></DD
+><DT
+>4.8. <A
+HREF="x7236.htm"
+>Sliced VBI Data Interface</A
+></DT
+><DD
+><DL
+><DT
+>4.8.1. <A
+HREF="x7236.htm#AEN7248"
+>Querying Capabilities</A
+></DT
+><DT
+>4.8.2. <A
+HREF="x7236.htm#AEN7258"
+>Supplemental Functions</A
+></DT
+><DT
+>4.8.3. <A
+HREF="x7236.htm#AEN7265"
+>Sliced VBI Format Negotiation</A
+></DT
+><DT
+>4.8.4. <A
+HREF="x7236.htm#AEN7483"
+>Reading and writing sliced VBI data</A
+></DT
+></DL
+></DD
+><DT
+>4.9. <A
+HREF="x7561.htm"
+>Teletext Interface</A
+></DT
+><DT
+>4.10. <A
+HREF="x7578.htm"
+>Radio Interface</A
+></DT
+><DD
+><DL
+><DT
+>4.10.1. <A
+HREF="x7578.htm#AEN7585"
+>Querying Capabilities</A
+></DT
+><DT
+>4.10.2. <A
+HREF="x7578.htm#AEN7594"
+>Supplemental Functions</A
+></DT
+><DT
+>4.10.3. <A
+HREF="x7578.htm#AEN7600"
+>Programming</A
+></DT
+></DL
+></DD
+><DT
+>4.11. <A
+HREF="x7607.htm"
+>RDS Interface</A
+></DT
+></DL
+></DD
+><DT
+>I. <A
+HREF="r7624.htm"
+>Function Reference</A
+></DT
+><DD
+><DL
+><DT
+><A
+HREF="r7626.htm"
+>V4L2 close()</A
+>&nbsp;--&nbsp;Close a V4L2 device</DT
+><DT
+><A
+HREF="r7667.htm"
+>V4L2 ioctl()</A
+>&nbsp;--&nbsp;Program a V4L2 device</DT
+><DT
+><A
+HREF="r7771.htm"
+>ioctl VIDIOC_CROPCAP</A
+>&nbsp;--&nbsp;Information about the video cropping and scaling abilities</DT
+><DT
+><A
+HREF="r7900.htm"
+>ioctl VIDIOC_DBG_G_REGISTER, VIDIOC_DBG_S_REGISTER</A
+>&nbsp;--&nbsp;Read or write hardware registers</DT
+><DT
+><A
+HREF="r8087.htm"
+>ioctl VIDIOC_ENCODER_CMD, VIDIOC_TRY_ENCODER_CMD</A
+>&nbsp;--&nbsp;Execute an encoder command</DT
+><DT
+><A
+HREF="r8242.htm"
+>ioctl VIDIOC_ENUMAUDIO</A
+>&nbsp;--&nbsp;Enumerate audio inputs</DT
+><DT
+><A
+HREF="r8304.htm"
+>ioctl VIDIOC_ENUMAUDOUT</A
+>&nbsp;--&nbsp;Enumerate audio outputs</DT
+><DT
+><A
+HREF="r8367.htm"
+>ioctl VIDIOC_ENUM_FMT</A
+>&nbsp;--&nbsp;Enumerate image formats</DT
+><DT
+><A
+HREF="r8494.htm"
+>ioctl VIDIOC_ENUM_FRAMESIZES</A
+>&nbsp;--&nbsp;Enumerate frame sizes</DT
+><DT
+><A
+HREF="r8724.htm"
+>ioctl VIDIOC_ENUM_FRAMEINTERVALS</A
+>&nbsp;--&nbsp;Enumerate frame intervals</DT
+><DT
+><A
+HREF="r8936.htm"
+>ioctl VIDIOC_ENUMINPUT</A
+>&nbsp;--&nbsp;Enumerate video inputs</DT
+><DT
+><A
+HREF="r9149.htm"
+>ioctl VIDIOC_ENUMOUTPUT</A
+>&nbsp;--&nbsp;Enumerate video outputs</DT
+><DT
+><A
+HREF="r9288.htm"
+>ioctl VIDIOC_ENUMSTD</A
+>&nbsp;--&nbsp;Enumerate supported video standards</DT
+><DT
+><A
+HREF="r9539.htm"
+>ioctl VIDIOC_G_AUDIO, VIDIOC_S_AUDIO</A
+>&nbsp;--&nbsp;Query or select the current audio input and its
+attributes</DT
+><DT
+><A
+HREF="r9688.htm"
+>ioctl VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT</A
+>&nbsp;--&nbsp;Query or select the current audio output</DT
+><DT
+><A
+HREF="r9804.htm"
+>ioctl VIDIOC_G_CHIP_IDENT</A
+>&nbsp;--&nbsp;Identify the chips on a TV card</DT
+><DT
+><A
+HREF="r9994.htm"
+>ioctl VIDIOC_G_CROP, VIDIOC_S_CROP</A
+>&nbsp;--&nbsp;Get or set the current cropping rectangle</DT
+><DT
+><A
+HREF="r10104.htm"
+>ioctl VIDIOC_G_CTRL, VIDIOC_S_CTRL</A
+>&nbsp;--&nbsp;Get or set the value of a control</DT
+><DT
+><A
+HREF="r10211.htm"
+>ioctl VIDIOC_G_ENC_INDEX</A
+>&nbsp;--&nbsp;Get meta data about a compressed video stream</DT
+><DT
+><A
+HREF="r10386.htm"
+>ioctl VIDIOC_G_EXT_CTRLS, VIDIOC_S_EXT_CTRLS,
+VIDIOC_TRY_EXT_CTRLS</A
+>&nbsp;--&nbsp;Get or set the value of several controls, try control
+values</DT
+><DT
+><A
+HREF="r10595.htm"
+>ioctl VIDIOC_G_FBUF, VIDIOC_S_FBUF</A
+>&nbsp;--&nbsp;Get or set frame buffer overlay parameters</DT
+><DT
+><A
+HREF="r10944.htm"
+>ioctl VIDIOC_G_FMT, VIDIOC_S_FMT,
+VIDIOC_TRY_FMT</A
+>&nbsp;--&nbsp;Get or set the data format, try a format</DT
+><DT
+><A
+HREF="r11094.htm"
+>ioctl VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY</A
+>&nbsp;--&nbsp;Get or set tuner or modulator radio
+frequency</DT
+><DT
+><A
+HREF="r11217.htm"
+>ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT</A
+>&nbsp;--&nbsp;Query or select the current video input</DT
+><DT
+><A
+HREF="r11285.htm"
+>ioctl VIDIOC_G_JPEGCOMP, VIDIOC_S_JPEGCOMP</A
+>&nbsp;--&nbsp;</DT
+><DT
+><A
+HREF="r11430.htm"
+>ioctl VIDIOC_G_MODULATOR, VIDIOC_S_MODULATOR</A
+>&nbsp;--&nbsp;Get or set modulator attributes</DT
+><DT
+><A
+HREF="r11612.htm"
+>ioctl VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT</A
+>&nbsp;--&nbsp;Query or select the current video output</DT
+><DT
+><A
+HREF="r11680.htm"
+>ioctl VIDIOC_G_PARM, VIDIOC_S_PARM</A
+>&nbsp;--&nbsp;Get or set streaming parameters</DT
+><DT
+><A
+HREF="r11946.htm"
+>ioctl VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY</A
+>&nbsp;--&nbsp;Query or request the access priority associated with a
+file descriptor</DT
+><DT
+><A
+HREF="r12051.htm"
+>ioctl VIDIOC_G_SLICED_VBI_CAP</A
+>&nbsp;--&nbsp;Query sliced VBI capabilities</DT
+><DT
+><A
+HREF="r12265.htm"
+>ioctl VIDIOC_G_STD, VIDIOC_S_STD</A
+>&nbsp;--&nbsp;Query or select the video standard of the current input</DT
+><DT
+><A
+HREF="r12342.htm"
+>ioctl VIDIOC_G_TUNER, VIDIOC_S_TUNER</A
+>&nbsp;--&nbsp;Get or set tuner attributes</DT
+><DT
+><A
+HREF="r12784.htm"
+>ioctl VIDIOC_LOG_STATUS</A
+>&nbsp;--&nbsp;Log driver status information</DT
+><DT
+><A
+HREF="r12816.htm"
+>ioctl VIDIOC_OVERLAY</A
+>&nbsp;--&nbsp;Start or stop video overlay</DT
+><DT
+><A
+HREF="r12878.htm"
+>ioctl VIDIOC_QBUF, VIDIOC_DQBUF</A
+>&nbsp;--&nbsp;Exchange a buffer with the driver</DT
+><DT
+><A
+HREF="r13022.htm"
+>ioctl VIDIOC_QUERYBUF</A
+>&nbsp;--&nbsp;Query the status of a buffer</DT
+><DT
+><A
+HREF="r13105.htm"
+>ioctl VIDIOC_QUERYCAP</A
+>&nbsp;--&nbsp;Query device capabilities</DT
+><DT
+><A
+HREF="r13317.htm"
+>ioctl VIDIOC_QUERYCTRL, VIDIOC_QUERYMENU</A
+>&nbsp;--&nbsp;Enumerate controls and menu control items</DT
+><DT
+><A
+HREF="r13641.htm"
+>ioctl VIDIOC_QUERYSTD</A
+>&nbsp;--&nbsp;Sense the video standard received by the current
+input</DT
+><DT
+><A
+HREF="r13696.htm"
+>ioctl VIDIOC_REQBUFS</A
+>&nbsp;--&nbsp;Initiate Memory Mapping or User Pointer I/O</DT
+><DT
+><A
+HREF="r13817.htm"
+>ioctl VIDIOC_STREAMON, VIDIOC_STREAMOFF</A
+>&nbsp;--&nbsp;Start or stop streaming I/O</DT
+><DT
+><A
+HREF="r13889.htm"
+>V4L2 mmap()</A
+>&nbsp;--&nbsp;Map device memory into application address space</DT
+><DT
+><A
+HREF="r14037.htm"
+>V4L2 munmap()</A
+>&nbsp;--&nbsp;Unmap device memory</DT
+><DT
+><A
+HREF="r14090.htm"
+>V4L2 open()</A
+>&nbsp;--&nbsp;Open a V4L2 device</DT
+><DT
+><A
+HREF="r14169.htm"
+>V4L2 poll()</A
+>&nbsp;--&nbsp;Wait for some event on a file descriptor</DT
+><DT
+><A
+HREF="r14264.htm"
+>V4L2 read()</A
+>&nbsp;--&nbsp;Read from a V4L2 device</DT
+><DT
+><A
+HREF="r14390.htm"
+>V4L2 select()</A
+>&nbsp;--&nbsp;Synchronous I/O multiplexing</DT
+><DT
+><A
+HREF="r14496.htm"
+>V4L2 write()</A
+>&nbsp;--&nbsp;Write to a V4L2 device</DT
+></DL
+></DD
+><DT
+>5. <A
+HREF="c14592.htm"
+>V4L2 Driver Programming</A
+></DT
+><DT
+>6. <A
+HREF="c14595.htm"
+>Changes</A
+></DT
+><DD
+><DL
+><DT
+>6.1. <A
+HREF="c14595.htm#DIFF-V4L"
+>Differences between V4L and V4L2</A
+></DT
+><DD
+><DL
+><DT
+>6.1.1. <A
+HREF="c14595.htm#AEN14602"
+>Opening and Closing Devices</A
+></DT
+><DT
+>6.1.2. <A
+HREF="c14595.htm#AEN14665"
+>Querying Capabilities</A
+></DT
+><DT
+>6.1.3. <A
+HREF="c14595.htm#AEN14821"
+>Video Sources</A
+></DT
+><DT
+>6.1.4. <A
+HREF="c14595.htm#AEN14877"
+>Tuning</A
+></DT
+><DT
+>6.1.5. <A
+HREF="c14595.htm#V4L-IMAGE-PROPERTIES"
+>Image Properties</A
+></DT
+><DT
+>6.1.6. <A
+HREF="c14595.htm#AEN15120"
+>Audio</A
+></DT
+><DT
+>6.1.7. <A
+HREF="c14595.htm#AEN15205"
+>Frame Buffer Overlay</A
+></DT
+><DT
+>6.1.8. <A
+HREF="c14595.htm#AEN15269"
+>Cropping</A
+></DT
+><DT
+>6.1.9. <A
+HREF="c14595.htm#AEN15302"
+>Reading Images, Memory Mapping</A
+></DT
+><DT
+>6.1.10. <A
+HREF="c14595.htm#AEN15385"
+>Reading Raw VBI Data</A
+></DT
+><DT
+>6.1.11. <A
+HREF="c14595.htm#AEN15438"
+>Miscellaneous</A
+></DT
+></DL
+></DD
+><DT
+>6.2. <A
+HREF="x15446.htm"
+>Changes of the V4L2 API</A
+></DT
+><DD
+><DL
+><DT
+>6.2.1. <A
+HREF="x15446.htm#AEN15449"
+>Early Versions</A
+></DT
+><DT
+>6.2.2. <A
+HREF="x15446.htm#AEN15499"
+>V4L2 Version 0.16 1999-01-31</A
+></DT
+><DT
+>6.2.3. <A
+HREF="x15446.htm#AEN15502"
+>V4L2 Version 0.18 1999-03-16</A
+></DT
+><DT
+>6.2.4. <A
+HREF="x15446.htm#AEN15505"
+>V4L2 Version 0.19 1999-06-05</A
+></DT
+><DT
+>6.2.5. <A
+HREF="x15446.htm#AEN15514"
+>V4L2 Version 0.20 (1999-09-10)</A
+></DT
+><DT
+>6.2.6. <A
+HREF="x15446.htm#AEN15575"
+>V4L2 Version 0.20 incremental changes</A
+></DT
+><DT
+>6.2.7. <A
+HREF="x15446.htm#AEN15628"
+>V4L2 Version 0.20 2000-11-23</A
+></DT
+><DT
+>6.2.8. <A
+HREF="x15446.htm#AEN15657"
+>V4L2 Version 0.20 2002-07-25</A
+></DT
+><DT
+>6.2.9. <A
+HREF="x15446.htm#AEN15660"
+>V4L2 in Linux 2.5.46, 2002-10</A
+></DT
+><DT
+>6.2.10. <A
+HREF="x15446.htm#AEN16046"
+>V4L2 2003-06-19</A
+></DT
+><DT
+>6.2.11. <A
+HREF="x15446.htm#AEN16089"
+>V4L2 2003-11-05</A
+></DT
+><DT
+>6.2.12. <A
+HREF="x15446.htm#AEN16131"
+>V4L2 in Linux 2.6.6, 2004-05-09</A
+></DT
+><DT
+>6.2.13. <A
+HREF="x15446.htm#AEN16139"
+>V4L2 in Linux 2.6.8</A
+></DT
+><DT
+>6.2.14. <A
+HREF="x15446.htm#AEN16149"
+>V4L2 spec erratum 2004-08-01</A
+></DT
+><DT
+>6.2.15. <A
+HREF="x15446.htm#AEN16170"
+>V4L2 in Linux 2.6.14</A
+></DT
+><DT
+>6.2.16. <A
+HREF="x15446.htm#AEN16176"
+>V4L2 in Linux 2.6.15</A
+></DT
+><DT
+>6.2.17. <A
+HREF="x15446.htm#AEN16203"
+>V4L2 spec erratum 2005-11-27</A
+></DT
+><DT
+>6.2.18. <A
+HREF="x15446.htm#AEN16212"
+>V4L2 spec erratum 2006-01-10</A
+></DT
+><DT
+>6.2.19. <A
+HREF="x15446.htm#AEN16223"
+>V4L2 spec erratum 2006-02-03</A
+></DT
+><DT
+>6.2.20. <A
+HREF="x15446.htm#AEN16231"
+>V4L2 spec erratum 2006-02-04</A
+></DT
+><DT
+>6.2.21. <A
+HREF="x15446.htm#AEN16241"
+>V4L2 in Linux 2.6.17</A
+></DT
+><DT
+>6.2.22. <A
+HREF="x15446.htm#AEN16261"
+>V4L2 spec erratum 2006-09-23 (Draft 0.15)</A
+></DT
+><DT
+>6.2.23. <A
+HREF="x15446.htm#AEN16297"
+>V4L2 in Linux 2.6.18</A
+></DT
+><DT
+>6.2.24. <A
+HREF="x15446.htm#AEN16319"
+>V4L2 in Linux 2.6.19</A
+></DT
+><DT
+>6.2.25. <A
+HREF="x15446.htm#AEN16338"
+>V4L2 spec erratum 2006-10-12 (Draft 0.17)</A
+></DT
+><DT
+>6.2.26. <A
+HREF="x15446.htm#AEN16345"
+>V4L2 in Linux 2.6.21</A
+></DT
+><DT
+>6.2.27. <A
+HREF="x15446.htm#AEN16351"
+>V4L2 in Linux 2.6.22</A
+></DT
+><DT
+>6.2.28. <A
+HREF="x15446.htm#AEN16378"
+>V4L2 in Linux 2.6.24</A
+></DT
+><DT
+>6.2.29. <A
+HREF="x15446.htm#AEN16388"
+>V4L2 in Linux 2.6.25</A
+></DT
+></DL
+></DD
+><DT
+>6.3. <A
+HREF="x16430.htm"
+>Relation of V4L2 to other Linux multimedia APIs</A
+></DT
+><DD
+><DL
+><DT
+>6.3.1. <A
+HREF="x16430.htm#XVIDEO"
+>X Video Extension</A
+></DT
+><DT
+>6.3.2. <A
+HREF="x16430.htm#AEN16446"
+>Digital Video</A
+></DT
+><DT
+>6.3.3. <A
+HREF="x16430.htm#AEN16450"
+>Audio Interfaces</A
+></DT
+></DL
+></DD
+><DT
+>6.4. <A
+HREF="x16453.htm"
+>Experimental API Elements</A
+></DT
+><DT
+>6.5. <A
+HREF="x16497.htm"
+>Obsolete API Elements</A
+></DT
+></DL
+></DD
+><DT
+>A. <A
+HREF="a16506.htm"
+>Video For Linux Two Header File</A
+></DT
+><DT
+>B. <A
+HREF="a16706.htm"
+>Video Capture Example</A
+></DT
+><DT
+>C. <A
+HREF="a16721.htm"
+>GNU Free Documentation License</A
+></DT
+><DD
+><DL
+><DT
+>C.1. <A
+HREF="a16721.htm#FDL-PREAMBLE"
+>0. PREAMBLE</A
+></DT
+><DT
+>C.2. <A
+HREF="x16743.htm"
+>1. APPLICABILITY AND DEFINITIONS</A
+></DT
+><DT
+>C.3. <A
+HREF="x16769.htm"
+>2. VERBATIM COPYING</A
+></DT
+><DT
+>C.4. <A
+HREF="x16775.htm"
+>3. COPYING IN QUANTITY</A
+></DT
+><DT
+>C.5. <A
+HREF="x16788.htm"
+>4. MODIFICATIONS</A
+></DT
+><DT
+>C.6. <A
+HREF="x16896.htm"
+>5. COMBINING DOCUMENTS</A
+></DT
+><DT
+>C.7. <A
+HREF="x16910.htm"
+>6. COLLECTIONS OF DOCUMENTS</A
+></DT
+><DT
+>C.8. <A
+HREF="x16915.htm"
+>7. AGGREGATION WITH INDEPENDENT WORKS</A
+></DT
+><DT
+>C.9. <A
+HREF="x16923.htm"
+>8. TRANSLATION</A
+></DT
+><DT
+>C.10. <A
+HREF="x16929.htm"
+>9. TERMINATION</A
+></DT
+><DT
+>C.11. <A
+HREF="x16933.htm"
+>10. FUTURE REVISIONS OF THIS LICENSE</A
+></DT
+><DT
+>C.12. <A
+HREF="x16941.htm"
+>Addendum</A
+></DT
+></DL
+></DD
+><DT
+><A
+HREF="i16960.htm"
+>List of Types</A
+></DT
+><DT
+><A
+HREF="b17127.htm"
+>References</A
+></DT
+></DL
+></DIV
+><DIV
+CLASS="LOT"
+><DL
+CLASS="LOT"
+><DT
+><B
+>List of Figures</B
+></DT
+><DT
+>1-1. <A
+HREF="x1904.htm#CROP-SCALE"
+>Image Cropping, Insertion and Scaling</A
+></DT
+><DT
+>3-1. <A
+HREF="x6386.htm#FIELDSEQ-TB"
+>Field Order, Top Field First Transmitted</A
+></DT
+><DT
+>3-2. <A
+HREF="x6386.htm#FIELDSEQ-BT"
+>Field Order, Bottom Field First Transmitted</A
+></DT
+><DT
+>4-1. <A
+HREF="x7013.htm#VBI-HSYNC"
+>Line synchronization</A
+></DT
+><DT
+>4-2. <A
+HREF="x7013.htm#VBI-525"
+>ITU-R 525 line numbering (M/NTSC and M/PAL)</A
+></DT
+><DT
+>4-3. <A
+HREF="x7013.htm#VBI-625"
+>ITU-R 625 line numbering</A
+></DT
+></DL
+></DIV
+><DIV
+CLASS="LOT"
+><DL
+CLASS="LOT"
+><DT
+><B
+>List of Examples</B
+></DT
+><DT
+>1-1. <A
+HREF="x309.htm#AEN328"
+>Information about the current video input</A
+></DT
+><DT
+>1-2. <A
+HREF="x309.htm#AEN336"
+>Switching to the first video input</A
+></DT
+><DT
+>1-3. <A
+HREF="x341.htm#AEN382"
+>Information about the current audio input</A
+></DT
+><DT
+>1-4. <A
+HREF="x341.htm#AEN388"
+>Switching to the first audio input</A
+></DT
+><DT
+>1-5. <A
+HREF="x448.htm#AEN510"
+>Information about the current video standard</A
+></DT
+><DT
+>1-6. <A
+HREF="x448.htm#AEN519"
+>Listing the video standards supported by the current
+input</A
+></DT
+><DT
+>1-7. <A
+HREF="x448.htm#AEN530"
+>Selecting a new video standard</A
+></DT
+><DT
+>1-8. <A
+HREF="x542.htm#AEN778"
+>Enumerating all controls</A
+></DT
+><DT
+>1-9. <A
+HREF="x542.htm#AEN789"
+>Changing controls</A
+></DT
+><DT
+>1-10. <A
+HREF="x1904.htm#AEN1972"
+>Resetting the cropping parameters</A
+></DT
+><DT
+>1-11. <A
+HREF="x1904.htm#AEN1983"
+>Simple downscaling</A
+></DT
+><DT
+>1-12. <A
+HREF="x1904.htm#AEN1991"
+>Selecting an output area</A
+></DT
+><DT
+>1-13. <A
+HREF="x1904.htm#AEN1996"
+>Current scaling factor and pixel aspect</A
+></DT
+><DT
+>2-1. <A
+HREF="x2123.htm#AEN2217"
+>ITU-R Rec. BT.601 color conversion</A
+></DT
+><DT
+>2-1. <A
+HREF="r2492.htm#AEN3061"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_BGR24</CODE
+> 4 &times; 4 pixel
+image</A
+></DT
+><DT
+>2-1. <A
+HREF="r3735.htm#AEN3746"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_SBGGR8</CODE
+> 4 &times; 4
+pixel image</A
+></DT
+><DT
+>2-1. <A
+HREF="r3796.htm#AEN3809"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_SBGGR16</CODE
+> 4 &times; 4
+pixel image</A
+></DT
+><DT
+>2-1. <A
+HREF="r4185.htm#AEN4196"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_GREY</CODE
+> 4 &times; 4
+pixel image</A
+></DT
+><DT
+>2-1. <A
+HREF="r4246.htm#AEN4257"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_Y16</CODE
+> 4 &times; 4
+pixel image</A
+></DT
+><DT
+>2-1. <A
+HREF="r4339.htm#AEN4351"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUYV</CODE
+> 4 &times; 4
+pixel image</A
+></DT
+><DT
+>2-1. <A
+HREF="r4484.htm#AEN4496"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_UYVY</CODE
+> 4 &times; 4
+pixel image</A
+></DT
+><DT
+>2-1. <A
+HREF="r4629.htm#AEN4645"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_Y41P</CODE
+> 8 &times; 4
+pixel image</A
+></DT
+><DT
+>2-1. <A
+HREF="r4850.htm#AEN4871"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YVU420</CODE
+> 4 &times; 4
+pixel image</A
+></DT
+><DT
+>2-1. <A
+HREF="r5016.htm#AEN5032"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YVU410</CODE
+> 4 &times; 4
+pixel image</A
+></DT
+><DT
+>2-1. <A
+HREF="r5154.htm#AEN5170"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUV422P</CODE
+> 4 &times; 4
+pixel image</A
+></DT
+><DT
+>2-1. <A
+HREF="r5319.htm#AEN5337"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUV411P</CODE
+> 4 &times; 4
+pixel image</A
+></DT
+><DT
+>2-1. <A
+HREF="r5470.htm#AEN5493"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_NV12</CODE
+> 4 &times; 4
+pixel image</A
+></DT
+><DT
+>3-1. <A
+HREF="x5791.htm#AEN5823"
+>Mapping buffers</A
+></DT
+><DT
+>3-2. <A
+HREF="x5884.htm#AEN5899"
+>Initiating streaming I/O with user pointers</A
+></DT
+><DT
+>4-1. <A
+HREF="x6909.htm#AEN6949"
+>Finding a framebuffer device for OSD</A
+></DT
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="f163.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Introduction</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/c14592.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/c14592.htm
new file mode 100644
index 0000000..39cf456
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/c14592.htm
@@ -0,0 +1,138 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>V4L2 Driver Programming</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="PREVIOUS"
+TITLE="V4L2 write()"
+HREF="r14496.htm"><LINK
+REL="NEXT"
+TITLE="Changes"
+HREF="c14595.htm"></HEAD
+><BODY
+CLASS="CHAPTER"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r14496.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="c14595.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="CHAPTER"
+><H1
+><A
+NAME="DRIVER"
+></A
+>Chapter 5. V4L2 Driver Programming</H1
+><P
+>to do</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r14496.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="c14595.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>V4L2 write()</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Changes</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/c14595.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/c14595.htm
new file mode 100644
index 0000000..e9eb9b7
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/c14595.htm
@@ -0,0 +1,2903 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Changes</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="PREVIOUS"
+TITLE="V4L2 Driver Programming"
+HREF="c14592.htm"><LINK
+REL="NEXT"
+TITLE="Changes of the V4L2 API"
+HREF="x15446.htm"></HEAD
+><BODY
+CLASS="CHAPTER"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="c14592.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x15446.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="CHAPTER"
+><H1
+><A
+NAME="COMPAT"
+></A
+>Chapter 6. Changes</H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+>6.1. <A
+HREF="c14595.htm#DIFF-V4L"
+>Differences between V4L and V4L2</A
+></DT
+><DT
+>6.2. <A
+HREF="x15446.htm"
+>Changes of the V4L2 API</A
+></DT
+><DT
+>6.3. <A
+HREF="x16430.htm"
+>Relation of V4L2 to other Linux multimedia APIs</A
+></DT
+><DT
+>6.4. <A
+HREF="x16453.htm"
+>Experimental API Elements</A
+></DT
+><DT
+>6.5. <A
+HREF="x16497.htm"
+>Obsolete API Elements</A
+></DT
+></DL
+></DIV
+><P
+>The following chapters document the evolution of the V4L2 API,
+errata or extensions. They are also intended to help application and
+driver writers to port or update their code.</P
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="DIFF-V4L"
+>6.1. Differences between V4L and V4L2</A
+></H1
+><P
+>The Video For Linux API was first introduced in Linux 2.1 to
+unify and replace various TV and radio device related interfaces,
+developed independently by driver writers in prior years. Starting
+with Linux 2.5 the much improved V4L2 API replaces the V4L API,
+although existing drivers will continue to support V4L applications in
+the future, either directly or through the V4L2 compatibility layer in
+the <TT
+CLASS="FILENAME"
+>videodev</TT
+> kernel module translating ioctls on
+the fly. For a transition period not all drivers will support the V4L2
+API.</P
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN14602"
+>6.1.1. Opening and Closing Devices</A
+></H2
+><P
+>For compatibility reasons the character device file names
+recommended for V4L2 video capture, overlay, radio, teletext and raw
+vbi capture devices did not change from those used by V4L. They are
+listed in <A
+HREF="c6488.htm"
+>Chapter 4</A
+> and below in <A
+HREF="c14595.htm#V4L-DEV"
+>Table 6-1</A
+>.</P
+><P
+>The V4L <TT
+CLASS="FILENAME"
+>videodev</TT
+> module automatically
+assigns minor numbers to drivers in load order, depending on the
+registered device type. We recommend that V4L2 drivers by default
+register devices with the same numbers, but the system administrator
+can assign arbitrary minor numbers using driver module options. The
+major device number remains 81.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L-DEV"
+></A
+><P
+><B
+>Table 6-1. V4L Device Types, Names and Numbers</B
+></P
+><TABLE
+BORDER="1"
+CLASS="CALSTABLE"
+><COL><COL><COL><THEAD
+><TR
+><TH
+>Device Type</TH
+><TH
+>File Name</TH
+><TH
+>Minor Numbers</TH
+></TR
+></THEAD
+><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>Video capture and overlay</TD
+><TD
+><P
+><TT
+CLASS="FILENAME"
+>/dev/video</TT
+> and
+<TT
+CLASS="FILENAME"
+>/dev/bttv0</TT
+><SUP
+>a</SUP
+>,
+<TT
+CLASS="FILENAME"
+>/dev/video0</TT
+> to
+<TT
+CLASS="FILENAME"
+>/dev/video63</TT
+></P
+></TD
+><TD
+>0-63</TD
+></TR
+><TR
+><TD
+>Radio receiver</TD
+><TD
+><P
+><TT
+CLASS="FILENAME"
+>/dev/radio</TT
+><SUP
+>b</SUP
+>, <TT
+CLASS="FILENAME"
+>/dev/radio0</TT
+> to
+<TT
+CLASS="FILENAME"
+>/dev/radio63</TT
+></P
+></TD
+><TD
+>64-127</TD
+></TR
+><TR
+><TD
+>Teletext decoder</TD
+><TD
+><P
+><TT
+CLASS="FILENAME"
+>/dev/vtx</TT
+>,
+<TT
+CLASS="FILENAME"
+>/dev/vtx0</TT
+> to
+<TT
+CLASS="FILENAME"
+>/dev/vtx31</TT
+></P
+></TD
+><TD
+>192-223</TD
+></TR
+><TR
+><TD
+>Raw VBI capture</TD
+><TD
+><P
+><TT
+CLASS="FILENAME"
+>/dev/vbi</TT
+>,
+<TT
+CLASS="FILENAME"
+>/dev/vbi0</TT
+> to
+<TT
+CLASS="FILENAME"
+>/dev/vbi31</TT
+></P
+></TD
+><TD
+>224-255</TD
+></TR
+></TBODY
+><TR
+><TD
+COLSPAN="3"
+>Notes:<BR><A
+NAME="FTN.AEN14624"
+>a. </A
+>According to
+Documentation/devices.txt these should be symbolic links to
+<TT
+CLASS="FILENAME"
+>/dev/video0</TT
+>. Note the original bttv interface is
+not compatible with V4L or V4L2.<BR><A
+NAME="FTN.AEN14635"
+>b. </A
+>According to
+<TT
+CLASS="FILENAME"
+>Documentation/devices.txt</TT
+> a symbolic link to
+<TT
+CLASS="FILENAME"
+>/dev/radio0</TT
+>.<BR></TD
+></TR
+></TABLE
+></DIV
+><P
+>V4L prohibits (or used to prohibit) multiple opens of a
+device file. V4L2 drivers <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>may</I
+></SPAN
+> support multiple
+opens, see <A
+HREF="c174.htm#OPEN"
+>Section 1.1</A
+> for details and consequences.</P
+><P
+>V4L drivers respond to V4L2 ioctls with an <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code. The
+compatibility layer in the V4L2 <TT
+CLASS="FILENAME"
+>videodev</TT
+> module
+can translate V4L ioctl requests to their V4L2 counterpart, however a
+V4L2 driver usually needs more preparation to become fully V4L
+compatible. This is covered in more detail in <A
+HREF="c14592.htm"
+>Chapter 5</A
+>.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN14665"
+>6.1.2. Querying Capabilities</A
+></H2
+><P
+>The V4L <CODE
+CLASS="CONSTANT"
+>VIDIOCGCAP</CODE
+> ioctl is
+equivalent to V4L2's <A
+HREF="r13105.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCAP</CODE
+></A
+>.</P
+><P
+>The <CODE
+CLASS="STRUCTFIELD"
+>name</CODE
+> field in struct
+<CODE
+CLASS="STRUCTNAME"
+>video_capability</CODE
+> became
+<CODE
+CLASS="STRUCTFIELD"
+>card</CODE
+> in struct&nbsp;<A
+HREF="r13105.htm#V4L2-CAPABILITY"
+>v4l2_capability</A
+>,
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> was replaced by
+<CODE
+CLASS="STRUCTFIELD"
+>capabilities</CODE
+>. Note V4L2 does not
+distinguish between device types like this, better think of basic
+video input, video output and radio devices supporting a set of
+related functions like video capturing, video overlay and VBI
+capturing. See <A
+HREF="c174.htm#OPEN"
+>Section 1.1</A
+> for an
+introduction.<DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN14679"
+></A
+><TABLE
+BORDER="1"
+CLASS="CALSTABLE"
+><COL><COL><COL><THEAD
+><TR
+><TH
+>struct
+<CODE
+CLASS="STRUCTNAME"
+>video_capability</CODE
+>
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+></TH
+><TH
+>struct&nbsp;<A
+HREF="r13105.htm#V4L2-CAPABILITY"
+>v4l2_capability</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>capabilities</CODE
+> flags</TH
+><TH
+>Purpose</TH
+></TR
+></THEAD
+><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VID_TYPE_CAPTURE</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CAP_VIDEO_CAPTURE</CODE
+></TD
+><TD
+>The <A
+HREF="c6488.htm#CAPTURE"
+>video
+capture</A
+> interface is supported.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VID_TYPE_TUNER</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CAP_TUNER</CODE
+></TD
+><TD
+>The device has a <A
+HREF="x394.htm"
+>tuner or
+modulator</A
+>.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VID_TYPE_TELETEXT</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CAP_VBI_CAPTURE</CODE
+></TD
+><TD
+>The <A
+HREF="x7013.htm"
+>raw VBI
+capture</A
+> interface is supported.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VID_TYPE_OVERLAY</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CAP_VIDEO_OVERLAY</CODE
+></TD
+><TD
+>The <A
+HREF="x6570.htm"
+>video
+overlay</A
+> interface is supported.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VID_TYPE_CHROMAKEY</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_CAP_CHROMAKEY</CODE
+> in
+field <CODE
+CLASS="STRUCTFIELD"
+>capability</CODE
+> of
+struct&nbsp;<A
+HREF="r10595.htm#V4L2-FRAMEBUFFER"
+>v4l2_framebuffer</A
+></TD
+><TD
+>Whether chromakey overlay is supported. For
+more information on overlay see
+<A
+HREF="x6570.htm"
+>Section 4.2</A
+>.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VID_TYPE_CLIPPING</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_CAP_LIST_CLIPPING</CODE
+> 
+and <CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_CAP_BITMAP_CLIPPING</CODE
+> in field
+<CODE
+CLASS="STRUCTFIELD"
+>capability</CODE
+> of struct&nbsp;<A
+HREF="r10595.htm#V4L2-FRAMEBUFFER"
+>v4l2_framebuffer</A
+></TD
+><TD
+>Whether clipping the overlaid image is
+supported, see <A
+HREF="x6570.htm"
+>Section 4.2</A
+>.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VID_TYPE_FRAMERAM</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_CAP_EXTERNOVERLAY</CODE
+> 
+<SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>not set</I
+></SPAN
+> in field
+<CODE
+CLASS="STRUCTFIELD"
+>capability</CODE
+> of struct&nbsp;<A
+HREF="r10595.htm#V4L2-FRAMEBUFFER"
+>v4l2_framebuffer</A
+></TD
+><TD
+>Whether overlay overwrites frame buffer memory,
+see <A
+HREF="x6570.htm"
+>Section 4.2</A
+>.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VID_TYPE_SCALES</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>-</CODE
+></TD
+><TD
+>This flag indicates if the hardware can scale
+images. The V4L2 API implies the scale factor by setting the cropping
+dimensions and image size with the <A
+HREF="r9994.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_CROP</CODE
+></A
+> and <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+>
+ioctl, respectively. The driver returns the closest sizes possible.
+For more information on cropping and scaling see <A
+HREF="x1904.htm"
+>Section 1.11</A
+>.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VID_TYPE_MONOCHROME</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>-</CODE
+></TD
+><TD
+>Applications can enumerate the supported image
+formats with the <A
+HREF="r8367.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUM_FMT</CODE
+></A
+> ioctl to determine if the device
+supports grey scale capturing only. For more information on image
+formats see <A
+HREF="c2030.htm"
+>Chapter 2</A
+>.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VID_TYPE_SUBCAPTURE</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>-</CODE
+></TD
+><TD
+>Applications can call the <A
+HREF="r9994.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_CROP</CODE
+></A
+> ioctl
+to determine if the device supports capturing a subsection of the full
+picture ("cropping" in V4L2). If not, the ioctl returns the <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code.
+For more information on cropping and scaling see <A
+HREF="x1904.htm"
+>Section 1.11</A
+>.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VID_TYPE_MPEG_DECODER</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>-</CODE
+></TD
+><TD
+>Applications can enumerate the supported image
+formats with the <A
+HREF="r8367.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUM_FMT</CODE
+></A
+> ioctl to determine if the device
+supports MPEG streams.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VID_TYPE_MPEG_ENCODER</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>-</CODE
+></TD
+><TD
+>See above.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VID_TYPE_MJPEG_DECODER</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>-</CODE
+></TD
+><TD
+>See above.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VID_TYPE_MJPEG_ENCODER</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>-</CODE
+></TD
+><TD
+>See above.</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></P
+><P
+>The <CODE
+CLASS="STRUCTFIELD"
+>audios</CODE
+> field was replaced
+by <CODE
+CLASS="STRUCTFIELD"
+>capabilities</CODE
+> flag
+<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_AUDIO</CODE
+>, indicating
+<SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>if</I
+></SPAN
+> the device has any audio inputs or outputs. To
+determine their number applications can enumerate audio inputs with
+the <A
+HREF="r9539.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_AUDIO</CODE
+></A
+> ioctl. The audio ioctls are described in <A
+HREF="x341.htm"
+>Section 1.5</A
+>.</P
+><P
+>The <CODE
+CLASS="STRUCTFIELD"
+>maxwidth</CODE
+>,
+<CODE
+CLASS="STRUCTFIELD"
+>maxheight</CODE
+>,
+<CODE
+CLASS="STRUCTFIELD"
+>minwidth</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>minheight</CODE
+> fields were removed. Calling the
+<A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> or <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_TRY_FMT</CODE
+></A
+> ioctl with the desired dimensions
+returns the closest size possible, taking into account the current
+video standard, cropping and scaling limitations.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN14821"
+>6.1.3. Video Sources</A
+></H2
+><P
+>V4L provides the <CODE
+CLASS="CONSTANT"
+>VIDIOCGCHAN</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOCSCHAN</CODE
+> ioctl using struct
+<CODE
+CLASS="STRUCTNAME"
+>video_channel</CODE
+> to enumerate
+the video inputs of a V4L device. The equivalent V4L2 ioctls
+are <A
+HREF="r8936.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMINPUT</CODE
+></A
+>, <A
+HREF="r11217.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_INPUT</CODE
+></A
+> and <A
+HREF="r11217.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_INPUT</CODE
+></A
+>
+using struct&nbsp;<A
+HREF="r8936.htm#V4L2-INPUT"
+>v4l2_input</A
+> as discussed in <A
+HREF="x309.htm"
+>Section 1.4</A
+>.</P
+><P
+>The <CODE
+CLASS="STRUCTFIELD"
+>channel</CODE
+> field counting
+inputs was renamed to <CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+>, the video
+input types were renamed as follows: <DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN14838"
+></A
+><TABLE
+BORDER="1"
+CLASS="CALSTABLE"
+><COL><COL><THEAD
+><TR
+><TH
+>struct <CODE
+CLASS="STRUCTNAME"
+>video_channel</CODE
+>
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+></TH
+><TH
+>struct&nbsp;<A
+HREF="r8936.htm#V4L2-INPUT"
+>v4l2_input</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+></TH
+></TR
+></THEAD
+><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VIDEO_TYPE_TV</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_INPUT_TYPE_TUNER</CODE
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VIDEO_TYPE_CAMERA</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_INPUT_TYPE_CAMERA</CODE
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></P
+><P
+>Unlike the <CODE
+CLASS="STRUCTFIELD"
+>tuners</CODE
+> field
+expressing the number of tuners of this input, V4L2 assumes each video
+input is connected to at most one tuner. However a tuner can have more
+than one input, i.&nbsp;e. RF connectors, and a device can have multiple
+tuners. The index number of the tuner associated with the input, if
+any, is stored in field <CODE
+CLASS="STRUCTFIELD"
+>tuner</CODE
+> of
+struct&nbsp;<A
+HREF="r8936.htm#V4L2-INPUT"
+>v4l2_input</A
+>. Enumeration of tuners is discussed in <A
+HREF="x394.htm"
+>Section 1.6</A
+>.</P
+><P
+>The redundant <CODE
+CLASS="CONSTANT"
+>VIDEO_VC_TUNER</CODE
+> flag was
+dropped. Video inputs associated with a tuner are of type
+<CODE
+CLASS="CONSTANT"
+>V4L2_INPUT_TYPE_TUNER</CODE
+>. The
+<CODE
+CLASS="CONSTANT"
+>VIDEO_VC_AUDIO</CODE
+> flag was replaced by the
+<CODE
+CLASS="STRUCTFIELD"
+>audioset</CODE
+> field. V4L2 considers devices with
+up to 32 audio inputs. Each set bit in the
+<CODE
+CLASS="STRUCTFIELD"
+>audioset</CODE
+> field represents one audio input
+this video input combines with. For information about audio inputs and
+how to switch between them see <A
+HREF="x341.htm"
+>Section 1.5</A
+>.</P
+><P
+>The <CODE
+CLASS="STRUCTFIELD"
+>norm</CODE
+> field describing the
+supported video standards was replaced by
+<CODE
+CLASS="STRUCTFIELD"
+>std</CODE
+>. The V4L specification mentions a flag
+<CODE
+CLASS="CONSTANT"
+>VIDEO_VC_NORM</CODE
+> indicating whether the standard can
+be changed. This flag was a later addition together with the
+<CODE
+CLASS="STRUCTFIELD"
+>norm</CODE
+> field and has been removed in the
+meantime. V4L2 has a similar, albeit more comprehensive approach
+to video standards, see <A
+HREF="x448.htm"
+>Section 1.7</A
+> for more
+information.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN14877"
+>6.1.4. Tuning</A
+></H2
+><P
+>The V4L <CODE
+CLASS="CONSTANT"
+>VIDIOCGTUNER</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOCSTUNER</CODE
+> ioctl and struct
+<CODE
+CLASS="STRUCTNAME"
+>video_tuner</CODE
+> can be used to enumerate the
+tuners of a V4L TV or radio device. The equivalent V4L2 ioctls are
+<A
+HREF="r12342.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_TUNER</CODE
+></A
+> and <A
+HREF="r12342.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_TUNER</CODE
+></A
+> using struct&nbsp;<A
+HREF="r12342.htm#V4L2-TUNER"
+>v4l2_tuner</A
+>. Tuners are
+covered in <A
+HREF="x394.htm"
+>Section 1.6</A
+>.</P
+><P
+>The <CODE
+CLASS="STRUCTFIELD"
+>tuner</CODE
+> field counting tuners
+was renamed to <CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+>. The fields
+<CODE
+CLASS="STRUCTFIELD"
+>name</CODE
+>, <CODE
+CLASS="STRUCTFIELD"
+>rangelow</CODE
+>
+and <CODE
+CLASS="STRUCTFIELD"
+>rangehigh</CODE
+> remained unchanged.</P
+><P
+>The <CODE
+CLASS="CONSTANT"
+>VIDEO_TUNER_PAL</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>VIDEO_TUNER_NTSC</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDEO_TUNER_SECAM</CODE
+> flags indicating the supported
+video standards were dropped. This information is now contained in the
+associated struct&nbsp;<A
+HREF="r8936.htm#V4L2-INPUT"
+>v4l2_input</A
+>. No replacement exists for the
+<CODE
+CLASS="CONSTANT"
+>VIDEO_TUNER_NORM</CODE
+> flag indicating whether the
+video standard can be switched. The <CODE
+CLASS="STRUCTFIELD"
+>mode</CODE
+>
+field to select a different video standard was replaced by a whole new
+set of ioctls and structures described in <A
+HREF="x448.htm"
+>Section 1.7</A
+>.
+Due to its ubiquity it should be mentioned the BTTV driver supports
+several standards in addition to the regular
+<CODE
+CLASS="CONSTANT"
+>VIDEO_MODE_PAL</CODE
+> (0),
+<CODE
+CLASS="CONSTANT"
+>VIDEO_MODE_NTSC</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>VIDEO_MODE_SECAM</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDEO_MODE_AUTO</CODE
+> (3). Namely N/PAL Argentina,
+M/PAL, N/PAL, and NTSC Japan with numbers 3-6 (sic).</P
+><P
+>The <CODE
+CLASS="CONSTANT"
+>VIDEO_TUNER_STEREO_ON</CODE
+> flag
+indicating stereo reception became
+<CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_STEREO</CODE
+> in field
+<CODE
+CLASS="STRUCTFIELD"
+>rxsubchans</CODE
+>. This field also permits the
+detection of monaural and bilingual audio, see the definition of
+struct&nbsp;<A
+HREF="r12342.htm#V4L2-TUNER"
+>v4l2_tuner</A
+> for details. Presently no replacement exists for the
+<CODE
+CLASS="CONSTANT"
+>VIDEO_TUNER_RDS_ON</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDEO_TUNER_MBS_ON</CODE
+> flags.</P
+><P
+> The <CODE
+CLASS="CONSTANT"
+>VIDEO_TUNER_LOW</CODE
+> flag was renamed
+to <CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_CAP_LOW</CODE
+> in the struct&nbsp;<A
+HREF="r12342.htm#V4L2-TUNER"
+>v4l2_tuner</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>capability</CODE
+> field.</P
+><P
+>The <CODE
+CLASS="CONSTANT"
+>VIDIOCGFREQ</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOCSFREQ</CODE
+> ioctl to change the tuner frequency
+where renamed to <A
+HREF="r11094.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FREQUENCY</CODE
+></A
+> and  <A
+HREF="r11094.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FREQUENCY</CODE
+></A
+>. They
+take a pointer to a struct&nbsp;<A
+HREF="r11094.htm#V4L2-FREQUENCY"
+>v4l2_frequency</A
+> instead of an unsigned long
+integer.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="V4L-IMAGE-PROPERTIES"
+>6.1.5. Image Properties</A
+></H2
+><P
+>V4L2 has no equivalent of the
+<CODE
+CLASS="CONSTANT"
+>VIDIOCGPICT</CODE
+> and <CODE
+CLASS="CONSTANT"
+>VIDIOCSPICT</CODE
+>
+ioctl and struct <CODE
+CLASS="STRUCTNAME"
+>video_picture</CODE
+>. The following
+fields where replaced by V4L2 controls accessible with the
+<A
+HREF="r13317.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCTRL</CODE
+></A
+>, <A
+HREF="r10104.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_CTRL</CODE
+></A
+> and <A
+HREF="r10104.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_CTRL</CODE
+></A
+> ioctls:<DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN14939"
+></A
+><TABLE
+BORDER="1"
+CLASS="CALSTABLE"
+><COL><COL><THEAD
+><TR
+><TH
+>struct <CODE
+CLASS="STRUCTNAME"
+>video_picture</CODE
+></TH
+><TH
+>V4L2 Control ID</TH
+></TR
+></THEAD
+><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>brightness</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_BRIGHTNESS</CODE
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>hue</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_HUE</CODE
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>colour</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_SATURATION</CODE
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>contrast</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_CONTRAST</CODE
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>whiteness</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_WHITENESS</CODE
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></P
+><P
+>The V4L picture controls are assumed to range from 0 to
+65535 with no particular reset value. The V4L2 API permits arbitrary
+limits and defaults which can be queried with the <A
+HREF="r13317.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCTRL</CODE
+></A
+>
+ioctl. For general information about controls see <A
+HREF="x542.htm"
+>Section 1.8</A
+>.</P
+><P
+>The <CODE
+CLASS="STRUCTFIELD"
+>depth</CODE
+> (average number of
+bits per pixel) of a video image is implied by the selected image
+format. V4L2 does not explicitely provide such information assuming
+applications recognizing the format are aware of the image depth and
+others need not know. The <CODE
+CLASS="STRUCTFIELD"
+>palette</CODE
+> field
+moved into the struct&nbsp;<A
+HREF="c2030.htm#V4L2-PIX-FORMAT"
+>v4l2_pix_format</A
+>:<DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN14980"
+></A
+><TABLE
+BORDER="1"
+CLASS="CALSTABLE"
+><COL><COL><THEAD
+><TR
+><TH
+>struct <CODE
+CLASS="STRUCTNAME"
+>video_picture</CODE
+>
+<CODE
+CLASS="STRUCTFIELD"
+>palette</CODE
+></TH
+><TH
+>struct&nbsp;<A
+HREF="c2030.htm#V4L2-PIX-FORMAT"
+>v4l2_pix_format</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>pixfmt</CODE
+></TH
+></TR
+></THEAD
+><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VIDEO_PALETTE_GREY</CODE
+></TD
+><TD
+><P
+><A
+HREF="r4185.htm"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_GREY</CODE
+></A
+></P
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VIDEO_PALETTE_HI240</CODE
+></TD
+><TD
+><P
+><A
+HREF="x5665.htm"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_HI240</CODE
+></A
+><SUP
+>a</SUP
+></P
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VIDEO_PALETTE_RGB565</CODE
+></TD
+><TD
+><P
+><A
+HREF="x2490.htm"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_RGB565</CODE
+></A
+></P
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VIDEO_PALETTE_RGB555</CODE
+></TD
+><TD
+><P
+><A
+HREF="x2490.htm"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_RGB555</CODE
+></A
+></P
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VIDEO_PALETTE_RGB24</CODE
+></TD
+><TD
+><P
+><A
+HREF="x2490.htm"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_BGR24</CODE
+></A
+></P
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VIDEO_PALETTE_RGB32</CODE
+></TD
+><TD
+><P
+><A
+HREF="x2490.htm"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_BGR32</CODE
+></A
+><SUP
+>b</SUP
+></P
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VIDEO_PALETTE_YUV422</CODE
+></TD
+><TD
+><P
+><A
+HREF="r4339.htm"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUYV</CODE
+></A
+></P
+></TD
+></TR
+><TR
+><TD
+><P
+><CODE
+CLASS="CONSTANT"
+>VIDEO_PALETTE_YUYV</CODE
+><SUP
+>c</SUP
+></P
+></TD
+><TD
+><P
+><A
+HREF="r4339.htm"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUYV</CODE
+></A
+></P
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VIDEO_PALETTE_UYVY</CODE
+></TD
+><TD
+><P
+><A
+HREF="r4484.htm"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_UYVY</CODE
+></A
+></P
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VIDEO_PALETTE_YUV420</CODE
+></TD
+><TD
+>None</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VIDEO_PALETTE_YUV411</CODE
+></TD
+><TD
+><P
+><A
+HREF="r4629.htm"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_Y41P</CODE
+></A
+><SUP
+>d</SUP
+></P
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VIDEO_PALETTE_RAW</CODE
+></TD
+><TD
+><P
+>None<SUP
+>e</SUP
+></P
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VIDEO_PALETTE_YUV422P</CODE
+></TD
+><TD
+><P
+><A
+HREF="r5154.htm"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUV422P</CODE
+></A
+></P
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VIDEO_PALETTE_YUV411P</CODE
+></TD
+><TD
+><P
+><A
+HREF="r5319.htm"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUV411P</CODE
+></A
+><SUP
+>f</SUP
+></P
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VIDEO_PALETTE_YUV420P</CODE
+></TD
+><TD
+><P
+><A
+HREF="r4850.htm#V4L2-PIX-FMT-YVU420"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YVU420</CODE
+></A
+></P
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>VIDEO_PALETTE_YUV410P</CODE
+></TD
+><TD
+><P
+><A
+HREF="r5016.htm#V4L2-PIX-FMT-YVU410"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YVU410</CODE
+></A
+></P
+></TD
+></TR
+></TBODY
+><TR
+><TD
+COLSPAN="2"
+>Notes:<BR><A
+NAME="FTN.AEN15005"
+>a. </A
+>This is a custom format used by the BTTV
+driver, not one of the V4L2 standard formats.<BR><A
+NAME="FTN.AEN15035"
+>b. </A
+>Presumably all V4L RGB formats are
+little-endian, although some drivers might interpret them according to machine endianess. V4L2 defines little-endian, big-endian and red/blue
+swapped variants. For details see <A
+HREF="x2490.htm"
+>Section 2.4</A
+>.<BR><A
+NAME="FTN.AEN15049"
+>c. </A
+><CODE
+CLASS="CONSTANT"
+>VIDEO_PALETTE_YUV422</CODE
+>
+and <CODE
+CLASS="CONSTANT"
+>VIDEO_PALETTE_YUYV</CODE
+> are the same formats. Some
+V4L drivers respond to one, some to the other.<BR><A
+NAME="FTN.AEN15075"
+>d. </A
+>Not to be confused with
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUV411P</CODE
+>, which is a planar
+format.<BR><A
+NAME="FTN.AEN15083"
+>e. </A
+>V4L explains this
+as: "RAW capture (BT848)"<BR><A
+NAME="FTN.AEN15099"
+>f. </A
+>Not to be confused with
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_Y41P</CODE
+>, which is a packed
+format.<BR></TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></P
+><P
+>V4L2 image formats are defined in <A
+HREF="c2030.htm"
+>Chapter 2</A
+>. The image format can be selected with the
+<A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctl.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN15120"
+>6.1.6. Audio</A
+></H2
+><P
+>The <CODE
+CLASS="CONSTANT"
+>VIDIOCGAUDIO</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOCSAUDIO</CODE
+> ioctl and struct
+<CODE
+CLASS="STRUCTNAME"
+>video_audio</CODE
+> are used to enumerate the
+audio inputs of a V4L device. The equivalent V4L2 ioctls are
+<A
+HREF="r9539.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_AUDIO</CODE
+></A
+> and <A
+HREF="r9539.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_AUDIO</CODE
+></A
+> using struct&nbsp;<A
+HREF="r9539.htm#V4L2-AUDIO"
+>v4l2_audio</A
+> as
+discussed in <A
+HREF="x341.htm"
+>Section 1.5</A
+>.</P
+><P
+>The <CODE
+CLASS="STRUCTFIELD"
+>audio</CODE
+> "channel number"
+field counting audio inputs was renamed to
+<CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+>.</P
+><P
+>On <CODE
+CLASS="CONSTANT"
+>VIDIOCSAUDIO</CODE
+> the
+<CODE
+CLASS="STRUCTFIELD"
+>mode</CODE
+> field selects <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>one</I
+></SPAN
+>
+of the <CODE
+CLASS="CONSTANT"
+>VIDEO_SOUND_MONO</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>VIDEO_SOUND_STEREO</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>VIDEO_SOUND_LANG1</CODE
+> or
+<CODE
+CLASS="CONSTANT"
+>VIDEO_SOUND_LANG2</CODE
+> audio demodulation modes. When
+the current audio standard is BTSC
+<CODE
+CLASS="CONSTANT"
+>VIDEO_SOUND_LANG2</CODE
+> refers to SAP and
+<CODE
+CLASS="CONSTANT"
+>VIDEO_SOUND_LANG1</CODE
+> is meaningless. Also
+undocumented in the V4L specification, there is no way to query the
+selected mode. On <CODE
+CLASS="CONSTANT"
+>VIDIOCGAUDIO</CODE
+> the driver returns
+the <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>actually received</I
+></SPAN
+> audio programmes in this
+field. In the V4L2 API this information is stored in the struct&nbsp;<A
+HREF="r12342.htm#V4L2-TUNER"
+>v4l2_tuner</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>rxsubchans</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>audmode</CODE
+> fields, respectively. See <A
+HREF="x394.htm"
+>Section 1.6</A
+> for more information on tuners. Related to audio
+modes struct&nbsp;<A
+HREF="r9539.htm#V4L2-AUDIO"
+>v4l2_audio</A
+> also reports if this is a mono or stereo
+input, regardless if the source is a tuner.</P
+><P
+>The following fields where replaced by V4L2 controls
+accessible with the <A
+HREF="r13317.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCTRL</CODE
+></A
+>, <A
+HREF="r10104.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_CTRL</CODE
+></A
+> and
+<A
+HREF="r10104.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_CTRL</CODE
+></A
+> ioctls:<DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN15159"
+></A
+><TABLE
+BORDER="1"
+CLASS="CALSTABLE"
+><COL><COL><THEAD
+><TR
+><TH
+>struct
+<CODE
+CLASS="STRUCTNAME"
+>video_audio</CODE
+></TH
+><TH
+>V4L2 Control ID</TH
+></TR
+></THEAD
+><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>volume</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_AUDIO_VOLUME</CODE
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>bass</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_AUDIO_BASS</CODE
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>treble</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_AUDIO_TREBLE</CODE
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>balance</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_AUDIO_BALANCE</CODE
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></P
+><P
+>To determine which of these controls are supported by a
+driver V4L provides the <CODE
+CLASS="STRUCTFIELD"
+>flags</CODE
+>
+<CODE
+CLASS="CONSTANT"
+>VIDEO_AUDIO_VOLUME</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>VIDEO_AUDIO_BASS</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>VIDEO_AUDIO_TREBLE</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDEO_AUDIO_BALANCE</CODE
+>. In the V4L2 API the
+<A
+HREF="r13317.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCTRL</CODE
+></A
+> ioctl reports if the respective control is
+supported. Accordingly the <CODE
+CLASS="CONSTANT"
+>VIDEO_AUDIO_MUTABLE</CODE
+>
+and <CODE
+CLASS="CONSTANT"
+>VIDEO_AUDIO_MUTE</CODE
+> flags where replaced by the
+boolean <CODE
+CLASS="CONSTANT"
+>V4L2_CID_AUDIO_MUTE</CODE
+> control.</P
+><P
+>All V4L2 controls have a <CODE
+CLASS="STRUCTFIELD"
+>step</CODE
+>
+attribute replacing the struct <CODE
+CLASS="STRUCTNAME"
+>video_audio</CODE
+>
+<CODE
+CLASS="STRUCTFIELD"
+>step</CODE
+> field. The V4L audio controls are
+assumed to range from 0 to 65535 with no particular reset value. The
+V4L2 API permits arbitrary limits and defaults which can be queried
+with the <A
+HREF="r13317.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCTRL</CODE
+></A
+> ioctl. For general information about
+controls see <A
+HREF="x542.htm"
+>Section 1.8</A
+>.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN15205"
+>6.1.7. Frame Buffer Overlay</A
+></H2
+><P
+>The V4L2 ioctls equivalent to
+<CODE
+CLASS="CONSTANT"
+>VIDIOCGFBUF</CODE
+> and <CODE
+CLASS="CONSTANT"
+>VIDIOCSFBUF</CODE
+>
+are <A
+HREF="r10595.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FBUF</CODE
+></A
+> and <A
+HREF="r10595.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FBUF</CODE
+></A
+>. The
+<CODE
+CLASS="STRUCTFIELD"
+>base</CODE
+> field of struct
+<CODE
+CLASS="STRUCTNAME"
+>video_buffer</CODE
+> remained unchanged, except V4L2
+defines a flag to indicate non-destructive overlays instead of a
+<CODE
+CLASS="CONSTANT"
+>NULL</CODE
+> pointer. All other fields moved into the
+struct&nbsp;<A
+HREF="c2030.htm#V4L2-PIX-FORMAT"
+>v4l2_pix_format</A
+> <CODE
+CLASS="STRUCTFIELD"
+>fmt</CODE
+> substructure of
+struct&nbsp;<A
+HREF="r10595.htm#V4L2-FRAMEBUFFER"
+>v4l2_framebuffer</A
+>. The <CODE
+CLASS="STRUCTFIELD"
+>depth</CODE
+> field was
+replaced by <CODE
+CLASS="STRUCTFIELD"
+>pixelformat</CODE
+>. See <A
+HREF="x2490.htm"
+>Section 2.4</A
+> for a list of RGB formats and their
+respective color depths.</P
+><P
+>Instead of the special ioctls
+<CODE
+CLASS="CONSTANT"
+>VIDIOCGWIN</CODE
+> and <CODE
+CLASS="CONSTANT"
+>VIDIOCSWIN</CODE
+>
+V4L2 uses the general-purpose data format negotiation ioctls
+<A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+></A
+> and <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+>. They take a pointer to a
+struct&nbsp;<A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+> as argument. Here the <CODE
+CLASS="STRUCTFIELD"
+>win</CODE
+>
+member of the <CODE
+CLASS="STRUCTFIELD"
+>fmt</CODE
+> union is used, a
+struct&nbsp;<A
+HREF="x6570.htm#V4L2-WINDOW"
+>v4l2_window</A
+>.</P
+><P
+>The <CODE
+CLASS="STRUCTFIELD"
+>x</CODE
+>,
+<CODE
+CLASS="STRUCTFIELD"
+>y</CODE
+>, <CODE
+CLASS="STRUCTFIELD"
+>width</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>height</CODE
+> fields of struct
+<CODE
+CLASS="STRUCTNAME"
+>video_window</CODE
+> moved into struct&nbsp;<A
+HREF="x6570.htm#V4L2-RECT"
+>v4l2_rect</A
+>
+substructure <CODE
+CLASS="STRUCTFIELD"
+>w</CODE
+> of struct
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_window</CODE
+>. The
+<CODE
+CLASS="STRUCTFIELD"
+>chromakey</CODE
+>,
+<CODE
+CLASS="STRUCTFIELD"
+>clips</CODE
+>, and
+<CODE
+CLASS="STRUCTFIELD"
+>clipcount</CODE
+> fields remained unchanged. Struct
+<CODE
+CLASS="STRUCTNAME"
+>video_clip</CODE
+> was renamed to struct&nbsp;<A
+HREF="x6570.htm#V4L2-CLIP"
+>v4l2_clip</A
+>, also
+containing a struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_rect</CODE
+>, but the
+semantics are still the same.</P
+><P
+>The <CODE
+CLASS="CONSTANT"
+>VIDEO_WINDOW_INTERLACE</CODE
+> flag was
+dropped. Instead applications must set the
+<CODE
+CLASS="STRUCTFIELD"
+>field</CODE
+> field to
+<CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_ANY</CODE
+> or
+<CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_INTERLACED</CODE
+>. The
+<CODE
+CLASS="CONSTANT"
+>VIDEO_WINDOW_CHROMAKEY</CODE
+> flag moved into
+struct&nbsp;<A
+HREF="r10595.htm#V4L2-FRAMEBUFFER"
+>v4l2_framebuffer</A
+>, under the new name
+<CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_FLAG_CHROMAKEY</CODE
+>.</P
+><P
+>In V4L, storing a bitmap pointer in
+<CODE
+CLASS="STRUCTFIELD"
+>clips</CODE
+> and setting
+<CODE
+CLASS="STRUCTFIELD"
+>clipcount</CODE
+> to
+<CODE
+CLASS="CONSTANT"
+>VIDEO_CLIP_BITMAP</CODE
+> (-1) requests bitmap
+clipping, using a fixed size bitmap of 1024 &times; 625 bits. Struct
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_window</CODE
+> has a separate
+<CODE
+CLASS="STRUCTFIELD"
+>bitmap</CODE
+> pointer field for this purpose and
+the bitmap size is determined by <CODE
+CLASS="STRUCTFIELD"
+>w.width</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>w.height</CODE
+>.</P
+><P
+>The <CODE
+CLASS="CONSTANT"
+>VIDIOCCAPTURE</CODE
+> ioctl to enable or
+disable overlay was renamed to <A
+HREF="r12816.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_OVERLAY</CODE
+></A
+>.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN15269"
+>6.1.8. Cropping</A
+></H2
+><P
+>To capture only a subsection of the full picture V4L
+defines the <CODE
+CLASS="CONSTANT"
+>VIDIOCGCAPTURE</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOCSCAPTURE</CODE
+> ioctls using struct
+<CODE
+CLASS="STRUCTNAME"
+>video_capture</CODE
+>. The equivalent V4L2 ioctls are
+<A
+HREF="r9994.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_CROP</CODE
+></A
+> and <A
+HREF="r9994.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_CROP</CODE
+></A
+> using struct&nbsp;<A
+HREF="r9994.htm#V4L2-CROP"
+>v4l2_crop</A
+>, and the related
+<A
+HREF="r7771.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_CROPCAP</CODE
+></A
+> ioctl. This is a rather complex matter, see
+<A
+HREF="x1904.htm"
+>Section 1.11</A
+> for details.</P
+><P
+>The <CODE
+CLASS="STRUCTFIELD"
+>x</CODE
+>,
+<CODE
+CLASS="STRUCTFIELD"
+>y</CODE
+>, <CODE
+CLASS="STRUCTFIELD"
+>width</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>height</CODE
+> fields moved into struct&nbsp;<A
+HREF="x6570.htm#V4L2-RECT"
+>v4l2_rect</A
+>
+substructure <CODE
+CLASS="STRUCTFIELD"
+>c</CODE
+> of struct
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_crop</CODE
+>. The
+<CODE
+CLASS="STRUCTFIELD"
+>decimation</CODE
+> field was dropped. In the V4L2
+API the scaling factor is implied by the size of the cropping
+rectangle and the size of the captured or overlaid image.</P
+><P
+>The <CODE
+CLASS="CONSTANT"
+>VIDEO_CAPTURE_ODD</CODE
+>
+and <CODE
+CLASS="CONSTANT"
+>VIDEO_CAPTURE_EVEN</CODE
+> flags to capture only the
+odd or even field, respectively, were replaced by
+<CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_TOP</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_BOTTOM</CODE
+> in the field named
+<CODE
+CLASS="STRUCTFIELD"
+>field</CODE
+> of struct&nbsp;<A
+HREF="c2030.htm#V4L2-PIX-FORMAT"
+>v4l2_pix_format</A
+> and
+struct&nbsp;<A
+HREF="x6570.htm#V4L2-WINDOW"
+>v4l2_window</A
+>. These structures are used to select a capture or
+overlay format with the <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctl.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN15302"
+>6.1.9. Reading Images, Memory Mapping</A
+></H2
+><DIV
+CLASS="SECTION"
+><H3
+CLASS="SECTION"
+><A
+NAME="AEN15304"
+>6.1.9.1. Capturing using the read method</A
+></H3
+><P
+>There is no essential difference between reading images
+from a V4L or V4L2 device using the <A
+HREF="r14264.htm"
+><CODE
+CLASS="FUNCTION"
+>read()</CODE
+></A
+> function, however V4L2
+drivers are not required to support this I/O method. Applications can
+determine if the function is available with the <A
+HREF="r13105.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCAP</CODE
+></A
+>
+ioctl. All V4L2 devices exchanging data with applications must support
+the <A
+HREF="r14390.htm"
+><CODE
+CLASS="FUNCTION"
+>select()</CODE
+></A
+> and <A
+HREF="r14169.htm"
+><CODE
+CLASS="FUNCTION"
+>poll()</CODE
+></A
+> functions.</P
+><P
+>To select an image format and size, V4L provides the
+<CODE
+CLASS="CONSTANT"
+>VIDIOCSPICT</CODE
+> and <CODE
+CLASS="CONSTANT"
+>VIDIOCSWIN</CODE
+>
+ioctls. V4L2 uses the general-purpose data format negotiation ioctls
+<A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+></A
+> and <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+>. They take a pointer to a
+struct&nbsp;<A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+> as argument, here the struct&nbsp;<A
+HREF="c2030.htm#V4L2-PIX-FORMAT"
+>v4l2_pix_format</A
+> named
+<CODE
+CLASS="STRUCTFIELD"
+>pix</CODE
+> of its <CODE
+CLASS="STRUCTFIELD"
+>fmt</CODE
+>
+union is used.</P
+><P
+>For more information about the V4L2 read interface see
+<A
+HREF="c5742.htm#RW"
+>Section 3.1</A
+>.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H3
+CLASS="SECTION"
+><A
+NAME="AEN15328"
+>6.1.9.2. Capturing using memory mapping</A
+></H3
+><P
+>Applications can read from V4L devices by mapping
+buffers in device memory, or more often just buffers allocated in
+DMA-able system memory, into their address space. This avoids the data
+copying overhead of the read method. V4L2 supports memory mapping as
+well, with a few differences.</P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN15331"
+></A
+><TABLE
+BORDER="1"
+CLASS="CALSTABLE"
+><COL><COL><THEAD
+><TR
+><TH
+>V4L</TH
+><TH
+>V4L2</TH
+></TR
+></THEAD
+><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>The image format must be selected before
+buffers are allocated, with the <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctl. When no format
+is selected the driver may use the last, possibly by another
+application requested format.</TD
+></TR
+><TR
+><TD
+><P
+>Applications cannot change the number of
+buffers. The it is built into the driver, unless it has a module
+option to change the number when the driver module is
+loaded.</P
+></TD
+><TD
+><P
+>The <A
+HREF="r13696.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_REQBUFS</CODE
+></A
+> ioctl allocates the
+desired number of buffers, this is a required step in the initialization
+sequence.</P
+></TD
+></TR
+><TR
+><TD
+><P
+>Drivers map all buffers as one contiguous
+range of memory. The <CODE
+CLASS="CONSTANT"
+>VIDIOCGMBUF</CODE
+> ioctl is
+available to query the number of buffers, the offset of each buffer
+from the start of the virtual file, and the overall amount of memory
+used, which can be used as arguments for the <A
+HREF="r13889.htm"
+><CODE
+CLASS="FUNCTION"
+>mmap()</CODE
+></A
+>
+function.</P
+></TD
+><TD
+><P
+>Buffers are individually mapped. The
+offset and size of each buffer can be determined with the
+<A
+HREF="r13022.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYBUF</CODE
+></A
+> ioctl.</P
+></TD
+></TR
+><TR
+><TD
+><P
+>The <CODE
+CLASS="CONSTANT"
+>VIDIOCMCAPTURE</CODE
+>
+ioctl prepares a buffer for capturing. It also determines the image
+format for this buffer. The ioctl returns immediately, eventually with
+an <SPAN
+CLASS="ERRORCODE"
+>EAGAIN</SPAN
+> error code if no video signal had been detected. When the driver
+supports more than one buffer applications can call the ioctl multiple
+times and thus have multiple outstanding capture
+requests.</P
+><P
+>The <CODE
+CLASS="CONSTANT"
+>VIDIOCSYNC</CODE
+> ioctl
+suspends execution until a particular buffer has been
+filled.</P
+></TD
+><TD
+><P
+>Drivers maintain an incoming and outgoing
+queue. <A
+HREF="r12878.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QBUF</CODE
+></A
+> enqueues any empty buffer into the incoming
+queue. Filled buffers are dequeued from the outgoing queue with the
+<A
+HREF="r12878.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_DQBUF</CODE
+></A
+> ioctl. To wait until filled buffers become available this
+function, <A
+HREF="r14390.htm"
+><CODE
+CLASS="FUNCTION"
+>select()</CODE
+></A
+> or <A
+HREF="r14169.htm"
+><CODE
+CLASS="FUNCTION"
+>poll()</CODE
+></A
+> can be used. The
+<A
+HREF="r13817.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMON</CODE
+></A
+> ioctl must be called once after enqueuing one or
+more buffers to start capturing. Its counterpart
+<A
+HREF="r13817.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMOFF</CODE
+></A
+> stops capturing and dequeues all buffers from both
+queues. Applications can query the signal status, if known, with the 
+<A
+HREF="r8936.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMINPUT</CODE
+></A
+> ioctl.</P
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+><P
+>For a more in-depth discussion of memory mapping and
+examples, see <A
+HREF="x5791.htm"
+>Section 3.2</A
+>.</P
+></DIV
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN15385"
+>6.1.10. Reading Raw VBI Data</A
+></H2
+><P
+>Originally the V4L API did not specify a raw VBI capture
+interface, only the device file <TT
+CLASS="FILENAME"
+>/dev/vbi</TT
+> was
+reserved for this purpose. The only driver supporting this interface
+was the BTTV driver, de-facto defining the V4L VBI interface. Reading
+from the device yields a raw VBI image with the following
+parameters:<DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN15389"
+></A
+><TABLE
+BORDER="1"
+CLASS="CALSTABLE"
+><COL><COL><THEAD
+><TR
+><TH
+>struct&nbsp;<A
+HREF="x7013.htm#V4L2-VBI-FORMAT"
+>v4l2_vbi_format</A
+></TH
+><TH
+>V4L, BTTV driver</TH
+></TR
+></THEAD
+><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>sampling_rate</TD
+><TD
+>28636363&nbsp;Hz NTSC (or any other 525-line
+standard); 35468950&nbsp;Hz PAL and SECAM (625-line standards)</TD
+></TR
+><TR
+><TD
+>offset</TD
+><TD
+>?</TD
+></TR
+><TR
+><TD
+>samples_per_line</TD
+><TD
+>2048</TD
+></TR
+><TR
+><TD
+>sample_format</TD
+><TD
+>V4L2_PIX_FMT_GREY. The last four bytes (a
+machine endianess integer) contain a frame counter.</TD
+></TR
+><TR
+><TD
+>start[]</TD
+><TD
+>10, 273 NTSC; 22, 335 PAL and SECAM</TD
+></TR
+><TR
+><TD
+>count[]</TD
+><TD
+><P
+>16, 16<SUP
+>a</SUP
+></P
+></TD
+></TR
+><TR
+><TD
+>flags</TD
+><TD
+>0</TD
+></TR
+></TBODY
+><TR
+><TD
+COLSPAN="2"
+>Notes:<BR><A
+NAME="FTN.AEN15416"
+>a. </A
+>Old driver
+versions used different values, eventually the custom
+<CODE
+CLASS="CONSTANT"
+>BTTV_VBISIZE</CODE
+> ioctl was added to query the
+correct values.<BR></TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></P
+><P
+>Undocumented in the V4L specification, in Linux 2.3 the
+<CODE
+CLASS="CONSTANT"
+>VIDIOCGVBIFMT</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOCSVBIFMT</CODE
+> ioctls using struct
+<CODE
+CLASS="STRUCTNAME"
+>vbi_format</CODE
+> were added to determine the VBI
+image parameters. These ioctls are only partially compatible with the
+V4L2 VBI interface specified in <A
+HREF="x7013.htm"
+>Section 4.7</A
+>.</P
+><P
+>An <CODE
+CLASS="STRUCTFIELD"
+>offset</CODE
+> field does not
+exist, <CODE
+CLASS="STRUCTFIELD"
+>sample_format</CODE
+> is supposed to be
+<CODE
+CLASS="CONSTANT"
+>VIDEO_PALETTE_RAW</CODE
+>, equivalent to 
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_GREY</CODE
+>. The remaining fields are
+probably equivalent to struct&nbsp;<A
+HREF="x7013.htm#V4L2-VBI-FORMAT"
+>v4l2_vbi_format</A
+>.</P
+><P
+>Apparently only the Zoran (ZR 36120) driver implements
+these ioctls. The semantics differ from those specified for V4L2 in two
+ways. The parameters are reset on <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOCSVBIFMT</CODE
+> always returns an <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code if the
+parameters are invalid.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN15438"
+>6.1.11. Miscellaneous</A
+></H2
+><P
+>V4L2 has no equivalent of the
+<CODE
+CLASS="CONSTANT"
+>VIDIOCGUNIT</CODE
+> ioctl. Applications can find the VBI
+device associated with a video capture device (or vice versa) by
+reopening the device and requesting VBI data. For details see
+<A
+HREF="c174.htm#OPEN"
+>Section 1.1</A
+>.</P
+><P
+>No replacement exists for <CODE
+CLASS="CONSTANT"
+>VIDIOCKEY</CODE
+>,
+and the V4L functions for microcode programming. A new interface for
+MPEG compression and playback devices is documented in <A
+HREF="x802.htm"
+>Section 1.9</A
+>.</P
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="c14592.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x15446.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>V4L2 Driver Programming</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Changes of the V4L2 API</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/c174.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/c174.htm
new file mode 100644
index 0000000..28c94ca
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/c174.htm
@@ -0,0 +1,776 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Common API Elements</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="PREVIOUS"
+TITLE="Introduction"
+HREF="f163.htm"><LINK
+REL="NEXT"
+TITLE="Querying Capabilities"
+HREF="x282.htm"></HEAD
+><BODY
+CLASS="CHAPTER"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="f163.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x282.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="CHAPTER"
+><H1
+><A
+NAME="COMMON"
+></A
+>Chapter 1. Common API Elements</H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+>1.1. <A
+HREF="c174.htm#OPEN"
+>Opening and Closing Devices</A
+></DT
+><DT
+>1.2. <A
+HREF="x282.htm"
+>Querying Capabilities</A
+></DT
+><DT
+>1.3. <A
+HREF="x294.htm"
+>Application Priority</A
+></DT
+><DT
+>1.4. <A
+HREF="x309.htm"
+>Video Inputs and Outputs</A
+></DT
+><DT
+>1.5. <A
+HREF="x341.htm"
+>Audio Inputs and Outputs</A
+></DT
+><DT
+>1.6. <A
+HREF="x394.htm"
+>Tuners and Modulators</A
+></DT
+><DT
+>1.7. <A
+HREF="x448.htm"
+>Video Standards</A
+></DT
+><DT
+>1.8. <A
+HREF="x542.htm"
+>User Controls</A
+></DT
+><DT
+>1.9. <A
+HREF="x802.htm"
+>Extended Controls</A
+></DT
+><DT
+>1.10. <A
+HREF="x1859.htm"
+>Data Formats</A
+></DT
+><DT
+>1.11. <A
+HREF="x1904.htm"
+>Image Cropping, Insertion and Scaling</A
+></DT
+><DT
+>1.12. <A
+HREF="x2009.htm"
+>Streaming Parameters</A
+></DT
+></DL
+></DIV
+><P
+>Programming a V4L2 device consists of these
+steps:</P
+><P
+></P
+><UL
+><LI
+><P
+>Opening the device</P
+></LI
+><LI
+><P
+>Changing device properties, selecting a video and audio
+input, video standard, picture brightness a.&nbsp;o.</P
+></LI
+><LI
+><P
+>Negotiating a data format</P
+></LI
+><LI
+><P
+>Negotiating an input/output method</P
+></LI
+><LI
+><P
+>The actual input/output loop</P
+></LI
+><LI
+><P
+>Closing the device</P
+></LI
+></UL
+><P
+>In practice most steps are optional and can be executed out of
+order. It depends on the V4L2 device type, you can read about the
+details in <A
+HREF="c6488.htm"
+>Chapter 4</A
+>. In this chapter we will discuss
+the basic concepts applicable to all devices.</P
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="OPEN"
+>1.1. Opening and Closing Devices</A
+></H1
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN194"
+>1.1.1. Device Naming</A
+></H2
+><P
+>V4L2 drivers are implemented as kernel modules, loaded
+manually by the system administrator or automatically when a device is
+first opened. The driver modules plug into the "videodev" kernel
+module. It provides helper functions and a common application
+interface specified in this document.</P
+><P
+>Each driver thus loaded registers one or more device nodes
+with major number 81 and a minor number between 0 and 255. Assigning
+minor numbers to V4L2 devices is entirely up to the system administrator,
+this is primarily intended to solve conflicts between devices.<A
+NAME="AEN198"
+HREF="c174.htm#FTN.AEN198"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+> The module options to select minor numbers are named
+after the device special file with a "_nr" suffix. For example "video_nr"
+for <TT
+CLASS="FILENAME"
+>/dev/video</TT
+> video capture devices. The number is
+an offset to the base minor number associated with the device type.
+<A
+NAME="AEN201"
+HREF="c174.htm#FTN.AEN201"
+><SPAN
+CLASS="footnote"
+>[2]</SPAN
+></A
+> When the driver supports multiple devices of the same
+type more than one minor number can be assigned, separated by commas:
+<DIV
+CLASS="INFORMALEXAMPLE"
+><P
+></P
+><A
+NAME="AEN203"
+></A
+><PRE
+CLASS="SCREEN"
+>&gt; insmod mydriver.o video_nr=0,1 radio_nr=0,1</PRE
+><P
+></P
+></DIV
+></P
+><P
+>In <TT
+CLASS="FILENAME"
+>/etc/modules.conf</TT
+> this may be
+written as: <DIV
+CLASS="INFORMALEXAMPLE"
+><P
+></P
+><A
+NAME="AEN207"
+></A
+><PRE
+CLASS="SCREEN"
+>alias char-major-81-0 mydriver
+alias char-major-81-1 mydriver
+alias char-major-81-64 mydriver              <A
+NAME="ALIAS"
+><IMG
+SRC="../images/callouts/1.gif"
+HSPACE="0"
+VSPACE="0"
+BORDER="0"
+ALT="(1)"></A
+>
+options mydriver video_nr=0,1 radio_nr=0,1   <A
+NAME="OPTIONS"
+><IMG
+SRC="../images/callouts/2.gif"
+HSPACE="0"
+VSPACE="0"
+BORDER="0"
+ALT="(2)"></A
+>
+          </PRE
+><DIV
+CLASS="CALLOUTLIST"
+><DL
+COMPACT="COMPACT"
+><DT
+><A
+HREF="c174.htm#ALIAS"
+><IMG
+SRC="../images/callouts/1.gif"
+HSPACE="0"
+VSPACE="0"
+BORDER="0"
+ALT="(1)"></A
+></DT
+><DD
+>When an application attempts to open a device
+special file with major number 81 and minor number 0, 1, or 64, load
+"mydriver" (and the "videodev" module it depends upon).</DD
+><DT
+><A
+HREF="c174.htm#OPTIONS"
+><IMG
+SRC="../images/callouts/2.gif"
+HSPACE="0"
+VSPACE="0"
+BORDER="0"
+ALT="(2)"></A
+></DT
+><DD
+>Register the first two video capture devices with
+minor number 0 and 1 (base number is 0), the first two radio device
+with minor number 64 and 65 (base 64).</DD
+></DL
+></DIV
+><P
+></P
+></DIV
+> When no minor number is given as module
+option the driver supplies a default. <A
+HREF="c6488.htm"
+>Chapter 4</A
+>
+recommends the base minor numbers to be used for the various device
+types. Obviously minor numbers must be unique. When the number is
+already in use the <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>offending device</I
+></SPAN
+> will not be
+registered. </P
+><P
+>By convention system administrators create various
+character device special files with these major and minor numbers in
+the <TT
+CLASS="FILENAME"
+>/dev</TT
+> directory. The names recomended for the
+different V4L2 device types are listed in <A
+HREF="c6488.htm"
+>Chapter 4</A
+>.</P
+><P
+>The creation of character special files (with
+<SPAN
+CLASS="APPLICATION"
+>mknod</SPAN
+>) is a privileged operation and
+devices cannot be opened by major and minor number. That means
+applications cannot <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>reliable</I
+></SPAN
+> scan for loaded or
+installed drivers. The user must enter a device name, or the
+application can try the conventional device names.</P
+><P
+>Under the device filesystem (devfs) the minor number
+options are ignored. V4L2 drivers (or by proxy the "videodev" module)
+automatically create the required device files in the
+<TT
+CLASS="FILENAME"
+>/dev/v4l</TT
+> directory using the conventional device
+names above.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="RELATED"
+>1.1.2. Related Devices</A
+></H2
+><P
+>Devices can support several related functions. For example
+video capturing, video overlay and VBI capturing are related because
+these functions share, amongst other, the same video input and tuner
+frequency. V4L and earlier versions of V4L2 used the same device name
+and minor number for video capturing and overlay, but different ones
+for VBI. Experience showed this approach has several problems<A
+NAME="AEN229"
+HREF="c174.htm#FTN.AEN229"
+><SPAN
+CLASS="footnote"
+>[3]</SPAN
+></A
+>, and to make things worse the V4L videodev module
+used to prohibit multiple opens of a device.</P
+><P
+>As a remedy the present version of the V4L2 API relaxed the
+concept of device types with specific names and minor numbers. For
+compatibility with old applications drivers must still register different
+minor numbers to assign a default function to the device. But if related
+functions are supported by the driver they must be available under all
+registered minor numbers. The desired function can be selected after
+opening the device as described in <A
+HREF="c6488.htm"
+>Chapter 4</A
+>.</P
+><P
+>Imagine a driver supporting video capturing, video
+overlay, raw VBI capturing, and FM radio reception. It registers three
+devices with minor number 0, 64 and 224 (this numbering scheme is
+inherited from the V4L API). Regardless if
+<TT
+CLASS="FILENAME"
+>/dev/video</TT
+> (81, 0) or
+<TT
+CLASS="FILENAME"
+>/dev/vbi</TT
+> (81, 224) is opened the application can
+select any one of the video capturing, overlay or VBI capturing
+functions. Without programming (e.&nbsp;g. reading from the device
+with <SPAN
+CLASS="APPLICATION"
+>dd</SPAN
+> or <SPAN
+CLASS="APPLICATION"
+>cat</SPAN
+>)
+<TT
+CLASS="FILENAME"
+>/dev/video</TT
+> captures video images, while
+<TT
+CLASS="FILENAME"
+>/dev/vbi</TT
+> captures raw VBI data.
+<TT
+CLASS="FILENAME"
+>/dev/radio</TT
+> (81, 64) is invariable a radio device,
+unrelated to the video functions. Being unrelated does not imply the
+devices can be used at the same time, however. The <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>
+function may very well return an <SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+> error code.</P
+><P
+>Besides video input or output the hardware may also
+support audio sampling or playback. If so, these functions are
+implemented as OSS or ALSA PCM devices and eventually OSS or ALSA
+audio mixer. The V4L2 API makes no provisions yet to find these
+related devices. If you have an idea please write to the Video4Linux
+mailing list: <A
+HREF="https://listman.redhat.com/mailman/listinfo/video4linux-list"
+TARGET="_top"
+>https://listman.redhat.com/mailman/listinfo/video4linux-list</A
+>.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN249"
+>1.1.3. Multiple Opens</A
+></H2
+><P
+>In general, V4L2 devices can be opened more than once.
+When this is supported by the driver, users can for example start a
+"panel" application to change controls like brightness or audio
+volume, while another application captures video and audio. In other words, panel
+applications are comparable to an OSS or ALSA audio mixer application.
+When a device supports multiple functions like capturing and overlay
+<SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>simultaneously</I
+></SPAN
+>, multiple opens allow concurrent
+use of the device by forked processes or specialized applications.</P
+><P
+>Multiple opens are optional, although drivers should
+permit at least concurrent accesses without data exchange, i.&nbsp;e. panel
+applications. This implies <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+> can return an <SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+> error code when the
+device is already in use, as well as <A
+HREF="r7667.htm"
+><CODE
+CLASS="FUNCTION"
+>ioctl()</CODE
+></A
+> functions initiating
+data exchange (namely the <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctl), and the <A
+HREF="r14264.htm"
+><CODE
+CLASS="FUNCTION"
+>read()</CODE
+></A
+>
+and <A
+HREF="r14496.htm"
+><CODE
+CLASS="FUNCTION"
+>write()</CODE
+></A
+> functions.</P
+><P
+>Mere opening a V4L2 device does not grant exclusive
+access.<A
+NAME="AEN266"
+HREF="c174.htm#FTN.AEN266"
+><SPAN
+CLASS="footnote"
+>[4]</SPAN
+></A
+> Initiating data exchange however assigns the right
+to read or write the requested type of data, and to change related
+properties, to this file descriptor. Applications can request
+additional access privileges using the priority mechanism described in
+<A
+HREF="x294.htm"
+>Section 1.3</A
+>.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN270"
+>1.1.4. Shared Data Streams</A
+></H2
+><P
+>V4L2 drivers should not support multiple applications
+reading or writing the same data stream on a device by copying
+buffers, time multiplexing or similar means. This is better handled by
+a proxy application in user space. When the driver supports stream
+sharing anyway it must be implemented transparently. The V4L2 API does
+not specify how conflicts are solved. </P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN273"
+>1.1.5. Functions</A
+></H2
+><P
+>To open and close V4L2 devices applications use the
+<A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+> and <A
+HREF="r7626.htm"
+><CODE
+CLASS="FUNCTION"
+>close()</CODE
+></A
+> function, respectively. Devices are
+programmed using the <A
+HREF="r7667.htm"
+><CODE
+CLASS="FUNCTION"
+>ioctl()</CODE
+></A
+> function as explained in the
+following sections.</P
+></DIV
+></DIV
+></DIV
+><H3
+CLASS="FOOTNOTES"
+>Notes</H3
+><TABLE
+BORDER="0"
+CLASS="FOOTNOTES"
+WIDTH="100%"
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="5%"
+><A
+NAME="FTN.AEN198"
+HREF="c174.htm#AEN198"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="95%"
+><P
+>Access permissions are associated with character
+device special files, hence we must ensure device numbers cannot
+change with the module load order. To this end minor numbers are no
+longer automatically assigned by the "videodev" module as in V4L but
+requested by the driver. The defaults will suffice for most people
+unless two drivers compete for the same minor numbers.</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="5%"
+><A
+NAME="FTN.AEN201"
+HREF="c174.htm#AEN201"
+><SPAN
+CLASS="footnote"
+>[2]</SPAN
+></A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="95%"
+><P
+>In earlier versions of the V4L2 API the module options
+where named after the device special file with a "unit_" prefix, expressing
+the minor number itself, not an offset. Rationale for this change is unknown.
+Lastly the naming and semantics are just a convention among driver writers,
+the point to note is that minor numbers are not supposed to be hardcoded
+into drivers.</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="5%"
+><A
+NAME="FTN.AEN229"
+HREF="c174.htm#AEN229"
+><SPAN
+CLASS="footnote"
+>[3]</SPAN
+></A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="95%"
+><P
+>Given a device file name one cannot reliable find
+related devices. For once names are arbitrary and in a system with
+multiple devices, where only some support VBI capturing, a
+<TT
+CLASS="FILENAME"
+>/dev/video2</TT
+> is not necessarily related to
+<TT
+CLASS="FILENAME"
+>/dev/vbi2</TT
+>. The V4L
+<CODE
+CLASS="CONSTANT"
+>VIDIOCGUNIT</CODE
+> ioctl would require a search for a
+device file with a particular major and minor number.</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="5%"
+><A
+NAME="FTN.AEN266"
+HREF="c174.htm#AEN266"
+><SPAN
+CLASS="footnote"
+>[4]</SPAN
+></A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="95%"
+><P
+>Drivers could recognize the
+<CODE
+CLASS="CONSTANT"
+>O_EXCL</CODE
+> open flag. Presently this is not required,
+so applications cannot know if it really works.</P
+></TD
+></TR
+></TABLE
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="f163.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x282.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Introduction</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Querying Capabilities</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/c2030.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/c2030.htm
new file mode 100644
index 0000000..9d34dd3
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/c2030.htm
@@ -0,0 +1,488 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Image Formats</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="PREVIOUS"
+TITLE="Streaming Parameters"
+HREF="x2009.htm"><LINK
+REL="NEXT"
+TITLE="Colorspaces"
+HREF="x2123.htm"></HEAD
+><BODY
+CLASS="CHAPTER"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x2009.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x2123.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="CHAPTER"
+><H1
+><A
+NAME="PIXFMT"
+></A
+>Chapter 2. Image Formats</H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+>2.1. <A
+HREF="c2030.htm#AEN2113"
+>Standard Image Formats</A
+></DT
+><DT
+>2.2. <A
+HREF="x2123.htm"
+>Colorspaces</A
+></DT
+><DT
+>2.3. <A
+HREF="x2428.htm"
+>Indexed Format</A
+></DT
+><DT
+>2.4. <A
+HREF="x2490.htm"
+>RGB Formats</A
+></DT
+><DT
+>2.5. <A
+HREF="x3891.htm"
+>YUV Formats</A
+></DT
+><DT
+>2.6. <A
+HREF="x5634.htm"
+>Compressed Formats</A
+></DT
+><DT
+>2.7. <A
+HREF="x5665.htm"
+>Reserved Format Identifiers</A
+></DT
+></DL
+></DIV
+><P
+>The V4L2 API was primarily designed for devices exchanging
+image data with applications. The
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_pix_format</CODE
+> structure defines the format
+and layout of an image in memory. Image formats are negotiated with
+the <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctl. (The explanations here focus on video
+capturing and output, for overlay frame buffer formats see also
+<A
+HREF="r10595.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FBUF</CODE
+></A
+>.)</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-PIX-FORMAT"
+></A
+><P
+><B
+>Table 2-1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_pix_format</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>width</CODE
+></TD
+><TD
+>Image width in pixels.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>height</CODE
+></TD
+><TD
+>Image height in pixels.</TD
+></TR
+><TR
+><TD
+COLSPAN="3"
+>Applications set these fields to
+request an image size, drivers return the closest possible values. In
+case of planar formats the <CODE
+CLASS="STRUCTFIELD"
+>width</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>height</CODE
+> applies to the largest plane. To
+avoid ambiguities drivers must return values rounded up to a multiple
+of the scale factor of any smaller planes. For example when the image
+format is YUV 4:2:0, <CODE
+CLASS="STRUCTFIELD"
+>width</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>height</CODE
+> must be multiples of two.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>pixelformat</CODE
+></TD
+><TD
+>The pixel format or type of compression, set by the
+application. This is a little endian <A
+HREF="r8367.htm#V4L2-FOURCC"
+>four character code</A
+>. V4L2 defines
+standard RGB formats in <A
+HREF="r2492.htm#RGB-FORMATS"
+>Table 2-1</A
+>, YUV formats in <A
+HREF="x3891.htm"
+>Section 2.5</A
+>, and reserved codes in <A
+HREF="x5665.htm#RESERVED-FORMATS"
+>Table 2-8</A
+></TD
+></TR
+><TR
+><TD
+>enum&nbsp;<A
+HREF="x6386.htm#V4L2-FIELD"
+>v4l2_field</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>field</CODE
+></TD
+><TD
+>Video images are typically interlaced. Applications
+can request to capture or output only the top or bottom field, or both
+fields interlaced or sequentially stored in one buffer or alternating
+in separate buffers. Drivers return the actual field order selected.
+For details see <A
+HREF="x6386.htm"
+>Section 3.6</A
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>bytesperline</CODE
+></TD
+><TD
+>Distance in bytes between the leftmost pixels in two
+adjacent lines.</TD
+></TR
+><TR
+><TD
+COLSPAN="3"
+><P
+>Both applications and drivers
+can set this field to request padding bytes at the end of each line.
+Drivers however may ignore the value requested by the application,
+returning <CODE
+CLASS="STRUCTFIELD"
+>width</CODE
+> times bytes per pixel or a
+larger value required by the hardware. That implies applications can
+just set this field to zero to get a reasonable
+default.</P
+><P
+>Video hardware may access padding bytes,
+therefore they must reside in accessible memory. Consider cases where
+padding bytes after the last line of an image cross a system page
+boundary. Input devices may write padding bytes, the value is
+undefined. Output devices ignore the contents of padding
+bytes.</P
+><P
+>When the image format is planar the
+<CODE
+CLASS="STRUCTFIELD"
+>bytesperline</CODE
+> value applies to the largest
+plane and is divided by the same factor as the
+<CODE
+CLASS="STRUCTFIELD"
+>width</CODE
+> field for any smaller planes. For
+example the Cb and Cr planes of a YUV 4:2:0 image have half as many
+padding bytes following each line as the Y plane. To avoid ambiguities
+drivers must return a <CODE
+CLASS="STRUCTFIELD"
+>bytesperline</CODE
+> value
+rounded up to a multiple of the scale factor.</P
+></TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>sizeimage</CODE
+></TD
+><TD
+>Size in bytes of the buffer to hold a complete image,
+set by the driver. Usually this is
+<CODE
+CLASS="STRUCTFIELD"
+>bytesperline</CODE
+> times
+<CODE
+CLASS="STRUCTFIELD"
+>height</CODE
+>. When the image consists of variable
+length compressed data this is the maximum number of bytes required to
+hold an image.</TD
+></TR
+><TR
+><TD
+>enum&nbsp;<A
+HREF="x2123.htm#V4L2-COLORSPACE"
+>v4l2_colorspace</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>colorspace</CODE
+></TD
+><TD
+>This information supplements the
+<CODE
+CLASS="STRUCTFIELD"
+>pixelformat</CODE
+> and must be set by the driver,
+see <A
+HREF="x2123.htm"
+>Section 2.2</A
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>priv</CODE
+></TD
+><TD
+>Reserved for custom (driver defined) additional
+information about formats. When not used drivers and applications must
+set this field to zero.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="AEN2113"
+>2.1. Standard Image Formats</A
+></H1
+><P
+>In order to exchange images between drivers and
+applications, it is necessary to have standard image data formats
+which both sides will interpret the same way. V4L2 includes several
+such formats, and this section is intended to be an unambiguous
+specification of the standard image data formats in V4L2.</P
+><P
+>V4L2 drivers are not limited to these formats, however.
+Driver-specific formats are possible. In that case the application may
+depend on a codec to convert images to one of the standard formats
+when needed. But the data can still be stored and retrieved in the
+proprietary format. For example, a device may support a proprietary
+compressed format. Applications can still capture and save the data in
+the compressed format, saving much disk space, and later use a codec
+to convert the images to the X Windows screen format when the video is
+to be displayed.</P
+><P
+>Even so, ultimately, some standard formats are needed, so
+the V4L2 specification would not be complete without well-defined
+standard formats.</P
+><P
+>The V4L2 standard formats are mainly uncompressed formats. The
+pixels are always arranged in memory from left to right, and from top
+to bottom. The first byte of data in the image buffer is always for
+the leftmost pixel of the topmost row. Following that is the pixel
+immediately to its right, and so on until the end of the top row of
+pixels. Following the rightmost pixel of the row there may be zero or
+more bytes of padding to guarantee that each row of pixel data has a
+certain alignment. Following the pad bytes, if any, is data for the
+leftmost pixel of the second row from the top, and so on. The last row
+has just as many pad bytes after it as the other rows.</P
+><P
+>In V4L2 each format has an identifier which looks like
+<CODE
+CLASS="CONSTANT"
+>PIX_FMT_XXX</CODE
+>, defined in the <A
+HREF="a16506.htm"
+>videodev.h</A
+> header file. These identifiers
+represent <A
+HREF="r8367.htm#V4L2-FOURCC"
+>four character codes</A
+>
+which are also listed below, however they are not the same as those
+used in the Windows world.</P
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x2009.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x2123.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Streaming Parameters</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Colorspaces</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/c5742.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/c5742.htm
new file mode 100644
index 0000000..ddd2869
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/c5742.htm
@@ -0,0 +1,414 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Input/Output</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="PREVIOUS"
+TITLE="Reserved Format Identifiers"
+HREF="x5665.htm"><LINK
+REL="NEXT"
+TITLE="Streaming I/O (Memory Mapping)"
+HREF="x5791.htm"></HEAD
+><BODY
+CLASS="CHAPTER"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x5665.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x5791.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="CHAPTER"
+><H1
+><A
+NAME="IO"
+></A
+>Chapter 3. Input/Output</H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+>3.1. <A
+HREF="c5742.htm#RW"
+>Read/Write</A
+></DT
+><DT
+>3.2. <A
+HREF="x5791.htm"
+>Streaming I/O (Memory Mapping)</A
+></DT
+><DT
+>3.3. <A
+HREF="x5884.htm"
+>Streaming I/O (User Pointers)</A
+></DT
+><DT
+>3.4. <A
+HREF="x5950.htm"
+>Asynchronous I/O</A
+></DT
+><DT
+>3.5. <A
+HREF="x5953.htm"
+>Buffers</A
+></DT
+><DT
+>3.6. <A
+HREF="x6386.htm"
+>Field Order</A
+></DT
+></DL
+></DIV
+><P
+>The V4L2 API defines several different methods to read from or
+write to a device. All drivers exchanging data with applications must
+support at least one of them.</P
+><P
+>The classic I/O method using the <CODE
+CLASS="FUNCTION"
+>read()</CODE
+>
+and <CODE
+CLASS="FUNCTION"
+>write()</CODE
+> function is automatically selected
+after opening a V4L2 device. When the driver does not support this
+method attempts to read or write will fail at any time.</P
+><P
+>Other methods must be negotiated. To select the streaming I/O
+method with memory mapped or user buffers applications call the
+<A
+HREF="r13696.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_REQBUFS</CODE
+></A
+> ioctl. The asynchronous I/O method is not defined
+yet.</P
+><P
+>Video overlay can be considered another I/O method, although
+the application does not directly receive the image data. It is
+selected by initiating video overlay with the <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctl.
+For more information see <A
+HREF="x6570.htm"
+>Section 4.2</A
+>.</P
+><P
+>Generally exactly one I/O method, including overlay, is
+associated with each file descriptor. The only exceptions are
+applications not exchanging data with a driver ("panel applications",
+see <A
+HREF="c174.htm#OPEN"
+>Section 1.1</A
+>) and drivers permitting simultaneous video capturing
+and overlay using the same file descriptor, for compatibility with V4L
+and earlier versions of V4L2.</P
+><P
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_REQBUFS</CODE
+> would permit this to some degree,
+but for simplicity drivers need not support switching the I/O method
+(after first switching away from read/write) other than by closing
+and reopening the device.</P
+><P
+>The following sections describe the various I/O methods in
+more detail.</P
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="RW"
+>3.1. Read/Write</A
+></H1
+><P
+>Input and output devices support the
+<CODE
+CLASS="FUNCTION"
+>read()</CODE
+> and <CODE
+CLASS="FUNCTION"
+>write()</CODE
+> function,
+respectively, when the <CODE
+CLASS="CONSTANT"
+>V4L2_CAP_READWRITE</CODE
+> flag in
+the <CODE
+CLASS="STRUCTFIELD"
+>capabilities</CODE
+> field of struct&nbsp;<A
+HREF="r13105.htm#V4L2-CAPABILITY"
+>v4l2_capability</A
+>
+returned by the <A
+HREF="r13105.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCAP</CODE
+></A
+> ioctl is set.</P
+><P
+>Drivers may need the CPU to copy the data, but they may also
+support DMA to or from user memory, so this I/O method is not
+necessarily less efficient than other methods merely exchanging buffer
+pointers. It is considered inferior though because no meta-information
+like frame counters or timestamps are passed. This information is
+necessary to recognize frame dropping and to synchronize with other
+data streams. However this is also the simplest I/O method, requiring
+little or no setup to exchange data. It permits command line stunts
+like this (the <SPAN
+CLASS="APPLICATION"
+>vidctrl</SPAN
+> tool is
+fictitious):</P
+><DIV
+CLASS="INFORMALEXAMPLE"
+><P
+></P
+><A
+NAME="AEN5773"
+></A
+><PRE
+CLASS="SCREEN"
+>&gt; vidctrl /dev/video --input=0 --format=YUYV --size=352x288
+&gt; dd if=/dev/video of=myimage.422 bs=202752 count=1</PRE
+><P
+></P
+></DIV
+><P
+>To read from the device applications use the
+<A
+HREF="r14264.htm"
+><CODE
+CLASS="FUNCTION"
+>read()</CODE
+></A
+> function, to write the <A
+HREF="r14496.htm"
+><CODE
+CLASS="FUNCTION"
+>write()</CODE
+></A
+> function.
+Drivers must implement one I/O method if they
+exchange data with applications, but it need not be this.<A
+NAME="AEN5780"
+HREF="c5742.htm#FTN.AEN5780"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+> When reading or writing is supported, the driver
+must also support the <A
+HREF="r14390.htm"
+><CODE
+CLASS="FUNCTION"
+>select()</CODE
+></A
+> and <A
+HREF="r14169.htm"
+><CODE
+CLASS="FUNCTION"
+>poll()</CODE
+></A
+>
+function.<A
+NAME="AEN5786"
+HREF="c5742.htm#FTN.AEN5786"
+><SPAN
+CLASS="footnote"
+>[2]</SPAN
+></A
+></P
+></DIV
+></DIV
+><H3
+CLASS="FOOTNOTES"
+>Notes</H3
+><TABLE
+BORDER="0"
+CLASS="FOOTNOTES"
+WIDTH="100%"
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="5%"
+><A
+NAME="FTN.AEN5780"
+HREF="c5742.htm#AEN5780"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="95%"
+><P
+>It would be desirable if applications could depend on
+drivers supporting all I/O interfaces, but as much as the complex
+memory mapping I/O can be inadequate for some devices we have no
+reason to require this interface, which is most useful for simple
+applications capturing still images.</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="5%"
+><A
+NAME="FTN.AEN5786"
+HREF="c5742.htm#AEN5786"
+><SPAN
+CLASS="footnote"
+>[2]</SPAN
+></A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="95%"
+><P
+>At the driver level <CODE
+CLASS="FUNCTION"
+>select()</CODE
+> and
+<CODE
+CLASS="FUNCTION"
+>poll()</CODE
+> are the same, and
+<CODE
+CLASS="FUNCTION"
+>select()</CODE
+> is too important to be optional.</P
+></TD
+></TR
+></TABLE
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x5665.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x5791.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Reserved Format Identifiers</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Streaming I/O (Memory Mapping)</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/c6488.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/c6488.htm
new file mode 100644
index 0000000..479b83c
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/c6488.htm
@@ -0,0 +1,501 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Interfaces</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="PREVIOUS"
+TITLE="Field Order"
+HREF="x6386.htm"><LINK
+REL="NEXT"
+TITLE="Video Overlay Interface"
+HREF="x6570.htm"></HEAD
+><BODY
+CLASS="CHAPTER"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x6386.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x6570.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="CHAPTER"
+><H1
+><A
+NAME="DEVICES"
+></A
+>Chapter 4. Interfaces</H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+>4.1. <A
+HREF="c6488.htm#CAPTURE"
+>Video Capture Interface</A
+></DT
+><DT
+>4.2. <A
+HREF="x6570.htm"
+>Video Overlay Interface</A
+></DT
+><DT
+>4.3. <A
+HREF="x6831.htm"
+>Video Output Interface</A
+></DT
+><DT
+>4.4. <A
+HREF="x6909.htm"
+>Video Output Overlay Interface</A
+></DT
+><DT
+>4.5. <A
+HREF="x6991.htm"
+>Codec Interface</A
+></DT
+><DT
+>4.6. <A
+HREF="x7002.htm"
+>Effect Devices Interface</A
+></DT
+><DT
+>4.7. <A
+HREF="x7013.htm"
+>Raw VBI Data Interface</A
+></DT
+><DT
+>4.8. <A
+HREF="x7236.htm"
+>Sliced VBI Data Interface</A
+></DT
+><DT
+>4.9. <A
+HREF="x7561.htm"
+>Teletext Interface</A
+></DT
+><DT
+>4.10. <A
+HREF="x7578.htm"
+>Radio Interface</A
+></DT
+><DT
+>4.11. <A
+HREF="x7607.htm"
+>RDS Interface</A
+></DT
+></DL
+></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="CAPTURE"
+>4.1. Video Capture Interface</A
+></H1
+><P
+>Video capture devices sample an analog video signal and store
+the digitized images in memory. Today nearly all devices can capture
+at full 25 or 30 frames/second. With this interface applications can
+control the capture process and move images from the driver into user
+space.</P
+><P
+>Conventionally V4L2 video capture devices are accessed through
+character device special files named <TT
+CLASS="FILENAME"
+>/dev/video</TT
+>
+and <TT
+CLASS="FILENAME"
+>/dev/video0</TT
+> to
+<TT
+CLASS="FILENAME"
+>/dev/video63</TT
+> with major number 81 and minor
+numbers 0 to 63. <TT
+CLASS="FILENAME"
+>/dev/video</TT
+> is typically a
+symbolic link to the preferred video device. Note the same device
+files are used for video output devices.</P
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN6498"
+>4.1.1. Querying Capabilities</A
+></H2
+><P
+>Devices supporting the video capture interface set the
+<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_VIDEO_CAPTURE</CODE
+> flag in the
+<CODE
+CLASS="STRUCTFIELD"
+>capabilities</CODE
+> field of struct&nbsp;<A
+HREF="r13105.htm#V4L2-CAPABILITY"
+>v4l2_capability</A
+>
+returned by the <A
+HREF="r13105.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCAP</CODE
+></A
+> ioctl. As secondary device functions
+they may also support the <A
+HREF="x6570.htm"
+>video overlay</A
+>
+(<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_VIDEO_OVERLAY</CODE
+>) and the <A
+HREF="x7013.htm"
+>raw VBI capture</A
+>
+(<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_VBI_CAPTURE</CODE
+>) interface. At least one of
+the read/write or streaming I/O methods must be supported. Tuners and
+audio inputs are optional.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN6510"
+>4.1.2. Supplemental Functions</A
+></H2
+><P
+>Video capture devices shall support <A
+HREF="x341.htm"
+>audio input</A
+>, <A
+HREF="x394.htm"
+>tuner</A
+>, <A
+HREF="x542.htm"
+>controls</A
+>,
+<A
+HREF="x1904.htm"
+>cropping and scaling</A
+> and <A
+HREF="x2009.htm"
+>streaming parameter</A
+> ioctls as needed.
+The <A
+HREF="x309.htm"
+>video input</A
+> and <A
+HREF="x448.htm"
+>video standard</A
+> ioctls must be supported by
+all video capture devices.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN6520"
+>4.1.3. Image Format Negotiation</A
+></H2
+><P
+>The result of a capture operation is determined by
+cropping and image format parameters. The former select an area of the
+video picture to capture, the latter how images are stored in memory,
+i.&nbsp;e. in RGB or YUV format, the number of bits per pixel or width and
+height. Together they also define how images are scaled in the
+process.</P
+><P
+>As usual these parameters are <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>not</I
+></SPAN
+> reset
+at <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+> time to permit Unix tool chains, programming a device
+and then reading from it as if it was a plain file. Well written V4L2
+applications ensure they really get what they want, including cropping
+and scaling.</P
+><P
+>Cropping initialization at minimum requires to reset the
+parameters to defaults. An example is given in <A
+HREF="x1904.htm"
+>Section 1.11</A
+>.</P
+><P
+>To query the current image format applications set the
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field of a struct&nbsp;<A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+> to
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_CAPTURE</CODE
+> and call the
+<A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+></A
+> ioctl with a pointer to this structure. Drivers fill
+the struct&nbsp;<A
+HREF="c2030.htm#V4L2-PIX-FORMAT"
+>v4l2_pix_format</A
+> <CODE
+CLASS="STRUCTFIELD"
+>pix</CODE
+> member of the
+<CODE
+CLASS="STRUCTFIELD"
+>fmt</CODE
+> union.</P
+><P
+>To request different parameters applications set the
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field of a struct&nbsp;<A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+> as above and
+initialize all fields of the struct&nbsp;<A
+HREF="c2030.htm#V4L2-PIX-FORMAT"
+>v4l2_pix_format</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>vbi</CODE
+> member of the
+<CODE
+CLASS="STRUCTFIELD"
+>fmt</CODE
+> union, or better just modify the
+results of <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+>, and call the
+<A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctl with a pointer to this structure. Drivers may
+adjust the parameters and finally return the actual parameters as
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+> does.</P
+><P
+>Like <CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+> the
+<A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_TRY_FMT</CODE
+></A
+> ioctl can be used to learn about hardware limitations
+without disabling I/O or possibly time consuming hardware
+preparations.</P
+><P
+>The contents of struct&nbsp;<A
+HREF="c2030.htm#V4L2-PIX-FORMAT"
+>v4l2_pix_format</A
+> are discussed in <A
+HREF="c2030.htm"
+>Chapter 2</A
+>. See also the specification of the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+>, <CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+>
+and <CODE
+CLASS="CONSTANT"
+>VIDIOC_TRY_FMT</CODE
+> ioctls for details. Video
+capture devices must implement both the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+> ioctl, even if
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+> ignores all requests and always
+returns default parameters as <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+> does.
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_TRY_FMT</CODE
+> is optional.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN6563"
+>4.1.4. Reading Images</A
+></H2
+><P
+>A video capture device may support the <A
+HREF="c5742.htm#RW"
+>read() function</A
+> and/or streaming (<A
+HREF="x5791.htm"
+>memory mapping</A
+> or <A
+HREF="x5884.htm"
+>user pointer</A
+>) I/O. See <A
+HREF="c5742.htm"
+>Chapter 3</A
+> for details.</P
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x6386.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x6570.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Field Order</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Video Overlay Interface</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/capture-example.html b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/capture-example.html
new file mode 100644
index 0000000..e3316bd
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/capture-example.html
@@ -0,0 +1,849 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Video Capture Example</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="PREVIOUS"
+TITLE="Video For Linux Two Header File"
+HREF="a16506.htm"><LINK
+REL="NEXT"
+TITLE="GNU Free Documentation License"
+HREF="a16721.htm"></HEAD
+><BODY
+CLASS="APPENDIX"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="a16506.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="a16721.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="APPENDIX"
+><H1
+><A
+NAME="CAPTURE-EXAMPLE"
+></A
+>Appendix B. Video Capture Example</H1
+><PRE
+CLASS="PROGRAMLISTING"
+>/*
+ *  V4L2 video capture example
+ *
+ *  This program can be used and distributed without restrictions.
+ */
+
+#include &lt;stdio.h&gt;
+#include &lt;stdlib.h&gt;
+#include &lt;string.h&gt;
+#include &lt;assert.h&gt;
+
+#include &lt;getopt.h&gt;             /* getopt_long() */
+
+#include &lt;fcntl.h&gt;              /* low-level i/o */
+#include &lt;unistd.h&gt;
+#include &lt;errno.h&gt;
+#include &lt;malloc.h&gt;
+#include &lt;sys/stat.h&gt;
+#include &lt;sys/types.h&gt;
+#include &lt;sys/time.h&gt;
+#include &lt;sys/mman.h&gt;
+#include &lt;sys/ioctl.h&gt;
+
+#include &lt;asm/types.h&gt;          /* for videodev2.h */
+
+#include &lt;linux/videodev2.h&gt;
+
+#define CLEAR(x) memset (&amp;(x), 0, sizeof (x))
+
+typedef enum {
+        IO_METHOD_READ,
+        IO_METHOD_MMAP,
+        IO_METHOD_USERPTR,
+} io_method;
+
+struct buffer {
+        void *                  start;
+        size_t                  length;
+};
+
+static char *           dev_name        = NULL;
+static io_method        io              = IO_METHOD_MMAP;
+static int              fd              = -1;
+struct buffer *         buffers         = NULL;
+static unsigned int     n_buffers       = 0;
+
+static void
+errno_exit                      (const char *           s)
+{
+        fprintf (stderr, "%s error %d, %s\n",
+                 s, errno, strerror (errno));
+
+        exit (EXIT_FAILURE);
+}
+
+static int
+xioctl                          (int                    fd,
+                                 int                    request,
+                                 void *                 arg)
+{
+        int r;
+
+        do r = ioctl (fd, request, arg);
+        while (-1 == r &amp;&amp; EINTR == errno);
+
+        return r;
+}
+
+static void
+process_image                   (const void *           p)
+{
+        fputc ('.', stdout);
+        fflush (stdout);
+}
+
+static int
+read_frame                      (void)
+{
+        struct <A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+> buf;
+        unsigned int i;
+
+        switch (io) {
+        case IO_METHOD_READ:
+                if (-1 == read (fd, buffers[0].start, buffers[0].length)) {
+                        switch (errno) {
+                        case EAGAIN:
+                                return 0;
+
+                        case EIO:
+                                /* Could ignore EIO, see spec. */
+
+                                /* fall through */
+
+                        default:
+                                errno_exit ("read");
+                        }
+                }
+
+                process_image (buffers[0].start);
+
+                break;
+
+        case IO_METHOD_MMAP:
+                CLEAR (buf);
+
+                buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+                buf.memory = V4L2_MEMORY_MMAP;
+
+                if (-1 == xioctl (fd, VIDIOC_DQBUF, &amp;buf)) {
+                        switch (errno) {
+                        case EAGAIN:
+                                return 0;
+
+                        case EIO:
+                                /* Could ignore EIO, see spec. */
+
+                                /* fall through */
+
+                        default:
+                                errno_exit ("VIDIOC_DQBUF");
+                        }
+                }
+
+                assert (buf.index &lt; n_buffers);
+
+                process_image (buffers[buf.index].start);
+
+                if (-1 == xioctl (fd, VIDIOC_QBUF, &amp;buf))
+                        errno_exit ("VIDIOC_QBUF");
+
+                break;
+
+        case IO_METHOD_USERPTR:
+                CLEAR (buf);
+
+                buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+                buf.memory = V4L2_MEMORY_USERPTR;
+
+                if (-1 == xioctl (fd, VIDIOC_DQBUF, &amp;buf)) {
+                        switch (errno) {
+                        case EAGAIN:
+                                return 0;
+
+                        case EIO:
+                                /* Could ignore EIO, see spec. */
+
+                                /* fall through */
+
+                        default:
+                                errno_exit ("VIDIOC_DQBUF");
+                        }
+                }
+
+                for (i = 0; i &lt; n_buffers; ++i)
+                        if (buf.m.userptr == (unsigned long) buffers[i].start
+                            &amp;&amp; buf.length == buffers[i].length)
+                                break;
+
+                assert (i &lt; n_buffers);
+
+                process_image ((void *) buf.m.userptr);
+
+                if (-1 == xioctl (fd, VIDIOC_QBUF, &amp;buf))
+                        errno_exit ("VIDIOC_QBUF");
+
+                break;
+        }
+
+        return 1;
+}
+
+static void
+mainloop                        (void)
+{
+        unsigned int count;
+
+        count = 100;
+
+        while (count-- &gt; 0) {
+                for (;;) {
+                        fd_set fds;
+                        struct timeval tv;
+                        int r;
+
+                        FD_ZERO (&amp;fds);
+                        FD_SET (fd, &amp;fds);
+
+                        /* Timeout. */
+                        tv.tv_sec = 2;
+                        tv.tv_usec = 0;
+
+                        r = select (fd + 1, &amp;fds, NULL, NULL, &amp;tv);
+
+                        if (-1 == r) {
+                                if (EINTR == errno)
+                                        continue;
+
+                                errno_exit ("select");
+                        }
+
+                        if (0 == r) {
+                                fprintf (stderr, "select timeout\n");
+                                exit (EXIT_FAILURE);
+                        }
+
+                        if (read_frame ())
+                                break;
+        
+                        /* EAGAIN - continue select loop. */
+                }
+        }
+}
+
+static void
+stop_capturing                  (void)
+{
+        enum <A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+> type;
+
+        switch (io) {
+        case IO_METHOD_READ:
+                /* Nothing to do. */
+                break;
+
+        case IO_METHOD_MMAP:
+        case IO_METHOD_USERPTR:
+                type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+
+                if (-1 == xioctl (fd, VIDIOC_STREAMOFF, &amp;type))
+                        errno_exit ("VIDIOC_STREAMOFF");
+
+                break;
+        }
+}
+
+static void
+start_capturing                 (void)
+{
+        unsigned int i;
+        enum <A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+> type;
+
+        switch (io) {
+        case IO_METHOD_READ:
+                /* Nothing to do. */
+                break;
+
+        case IO_METHOD_MMAP:
+                for (i = 0; i &lt; n_buffers; ++i) {
+                        struct <A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+> buf;
+
+                        CLEAR (buf);
+
+                        buf.type        = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+                        buf.memory      = V4L2_MEMORY_MMAP;
+                        buf.index       = i;
+
+                        if (-1 == xioctl (fd, VIDIOC_QBUF, &amp;buf))
+                                errno_exit ("VIDIOC_QBUF");
+                }
+                
+                type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+
+                if (-1 == xioctl (fd, VIDIOC_STREAMON, &amp;type))
+                        errno_exit ("VIDIOC_STREAMON");
+
+                break;
+
+        case IO_METHOD_USERPTR:
+                for (i = 0; i &lt; n_buffers; ++i) {
+                        struct <A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+> buf;
+
+                        CLEAR (buf);
+
+                        buf.type        = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+                        buf.memory      = V4L2_MEMORY_USERPTR;
+                        buf.index       = i;
+                        buf.m.userptr   = (unsigned long) buffers[i].start;
+                        buf.length      = buffers[i].length;
+
+                        if (-1 == xioctl (fd, VIDIOC_QBUF, &amp;buf))
+                                errno_exit ("VIDIOC_QBUF");
+                }
+
+                type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+
+                if (-1 == xioctl (fd, VIDIOC_STREAMON, &amp;type))
+                        errno_exit ("VIDIOC_STREAMON");
+
+                break;
+        }
+}
+
+static void
+uninit_device                   (void)
+{
+        unsigned int i;
+
+        switch (io) {
+        case IO_METHOD_READ:
+                free (buffers[0].start);
+                break;
+
+        case IO_METHOD_MMAP:
+                for (i = 0; i &lt; n_buffers; ++i)
+                        if (-1 == munmap (buffers[i].start, buffers[i].length))
+                                errno_exit ("munmap");
+                break;
+
+        case IO_METHOD_USERPTR:
+                for (i = 0; i &lt; n_buffers; ++i)
+                        free (buffers[i].start);
+                break;
+        }
+
+        free (buffers);
+}
+
+static void
+init_read                       (unsigned int           buffer_size)
+{
+        buffers = calloc (1, sizeof (*buffers));
+
+        if (!buffers) {
+                fprintf (stderr, "Out of memory\n");
+                exit (EXIT_FAILURE);
+        }
+
+        buffers[0].length = buffer_size;
+        buffers[0].start = malloc (buffer_size);
+
+        if (!buffers[0].start) {
+                fprintf (stderr, "Out of memory\n");
+                exit (EXIT_FAILURE);
+        }
+}
+
+static void
+init_mmap                       (void)
+{
+        struct <A
+HREF="r13696.htm#V4L2-REQUESTBUFFERS"
+>v4l2_requestbuffers</A
+> req;
+
+        CLEAR (req);
+
+        req.count               = 4;
+        req.type                = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+        req.memory              = V4L2_MEMORY_MMAP;
+
+        if (-1 == xioctl (fd, VIDIOC_REQBUFS, &amp;req)) {
+                if (EINVAL == errno) {
+                        fprintf (stderr, "%s does not support "
+                                 "memory mapping\n", dev_name);
+                        exit (EXIT_FAILURE);
+                } else {
+                        errno_exit ("VIDIOC_REQBUFS");
+                }
+        }
+
+        if (req.count &lt; 2) {
+                fprintf (stderr, "Insufficient buffer memory on %s\n",
+                         dev_name);
+                exit (EXIT_FAILURE);
+        }
+
+        buffers = calloc (req.count, sizeof (*buffers));
+
+        if (!buffers) {
+                fprintf (stderr, "Out of memory\n");
+                exit (EXIT_FAILURE);
+        }
+
+        for (n_buffers = 0; n_buffers &lt; req.count; ++n_buffers) {
+                struct <A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+> buf;
+
+                CLEAR (buf);
+
+                buf.type        = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+                buf.memory      = V4L2_MEMORY_MMAP;
+                buf.index       = n_buffers;
+
+                if (-1 == xioctl (fd, VIDIOC_QUERYBUF, &amp;buf))
+                        errno_exit ("VIDIOC_QUERYBUF");
+
+                buffers[n_buffers].length = buf.length;
+                buffers[n_buffers].start =
+                        mmap (NULL /* start anywhere */,
+                              buf.length,
+                              PROT_READ | PROT_WRITE /* required */,
+                              MAP_SHARED /* recommended */,
+                              fd, buf.m.offset);
+
+                if (MAP_FAILED == buffers[n_buffers].start)
+                        errno_exit ("mmap");
+        }
+}
+
+static void
+init_userp                      (unsigned int           buffer_size)
+{
+        struct <A
+HREF="r13696.htm#V4L2-REQUESTBUFFERS"
+>v4l2_requestbuffers</A
+> req;
+        unsigned int page_size;
+
+        page_size = getpagesize ();
+        buffer_size = (buffer_size + page_size - 1) &amp; ~(page_size - 1);
+
+        CLEAR (req);
+
+        req.count               = 4;
+        req.type                = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+        req.memory              = V4L2_MEMORY_USERPTR;
+
+        if (-1 == xioctl (fd, VIDIOC_REQBUFS, &amp;req)) {
+                if (EINVAL == errno) {
+                        fprintf (stderr, "%s does not support "
+                                 "user pointer i/o\n", dev_name);
+                        exit (EXIT_FAILURE);
+                } else {
+                        errno_exit ("VIDIOC_REQBUFS");
+                }
+        }
+
+        buffers = calloc (4, sizeof (*buffers));
+
+        if (!buffers) {
+                fprintf (stderr, "Out of memory\n");
+                exit (EXIT_FAILURE);
+        }
+
+        for (n_buffers = 0; n_buffers &lt; 4; ++n_buffers) {
+                buffers[n_buffers].length = buffer_size;
+                buffers[n_buffers].start = memalign (/* boundary */ page_size,
+                                                     buffer_size);
+
+                if (!buffers[n_buffers].start) {
+                        fprintf (stderr, "Out of memory\n");
+                        exit (EXIT_FAILURE);
+                }
+        }
+}
+
+static void
+init_device                     (void)
+{
+        struct <A
+HREF="r13105.htm#V4L2-CAPABILITY"
+>v4l2_capability</A
+> cap;
+        struct <A
+HREF="r7771.htm#V4L2-CROPCAP"
+>v4l2_cropcap</A
+> cropcap;
+        struct <A
+HREF="r9994.htm#V4L2-CROP"
+>v4l2_crop</A
+> crop;
+        struct <A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+> fmt;
+        unsigned int min;
+
+        if (-1 == xioctl (fd, VIDIOC_QUERYCAP, &amp;cap)) {
+                if (EINVAL == errno) {
+                        fprintf (stderr, "%s is no V4L2 device\n",
+                                 dev_name);
+                        exit (EXIT_FAILURE);
+                } else {
+                        errno_exit ("VIDIOC_QUERYCAP");
+                }
+        }
+
+        if (!(cap.capabilities &amp; V4L2_CAP_VIDEO_CAPTURE)) {
+                fprintf (stderr, "%s is no video capture device\n",
+                         dev_name);
+                exit (EXIT_FAILURE);
+        }
+
+        switch (io) {
+        case IO_METHOD_READ:
+                if (!(cap.capabilities &amp; V4L2_CAP_READWRITE)) {
+                        fprintf (stderr, "%s does not support read i/o\n",
+                                 dev_name);
+                        exit (EXIT_FAILURE);
+                }
+
+                break;
+
+        case IO_METHOD_MMAP:
+        case IO_METHOD_USERPTR:
+                if (!(cap.capabilities &amp; V4L2_CAP_STREAMING)) {
+                        fprintf (stderr, "%s does not support streaming i/o\n",
+                                 dev_name);
+                        exit (EXIT_FAILURE);
+                }
+
+                break;
+        }
+
+
+        /* Select video input, video standard and tune here. */
+
+
+        CLEAR (cropcap);
+
+        cropcap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+
+        if (0 == xioctl (fd, VIDIOC_CROPCAP, &amp;cropcap)) {
+                crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+                crop.c = cropcap.defrect; /* reset to default */
+
+                if (-1 == xioctl (fd, VIDIOC_S_CROP, &amp;crop)) {
+                        switch (errno) {
+                        case EINVAL:
+                                /* Cropping not supported. */
+                                break;
+                        default:
+                                /* Errors ignored. */
+                                break;
+                        }
+                }
+        } else {        
+                /* Errors ignored. */
+        }
+
+
+        CLEAR (fmt);
+
+        fmt.type                = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+        fmt.fmt.pix.width       = 640; 
+        fmt.fmt.pix.height      = 480;
+        fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;
+        fmt.fmt.pix.field       = V4L2_FIELD_INTERLACED;
+
+        if (-1 == xioctl (fd, VIDIOC_S_FMT, &amp;fmt))
+                errno_exit ("VIDIOC_S_FMT");
+
+        /* Note VIDIOC_S_FMT may change width and height. */
+
+        /* Buggy driver paranoia. */
+        min = fmt.fmt.pix.width * 2;
+        if (fmt.fmt.pix.bytesperline &lt; min)
+                fmt.fmt.pix.bytesperline = min;
+        min = fmt.fmt.pix.bytesperline * fmt.fmt.pix.height;
+        if (fmt.fmt.pix.sizeimage &lt; min)
+                fmt.fmt.pix.sizeimage = min;
+
+        switch (io) {
+        case IO_METHOD_READ:
+                init_read (fmt.fmt.pix.sizeimage);
+                break;
+
+        case IO_METHOD_MMAP:
+                init_mmap ();
+                break;
+
+        case IO_METHOD_USERPTR:
+                init_userp (fmt.fmt.pix.sizeimage);
+                break;
+        }
+}
+
+static void
+close_device                    (void)
+{
+        if (-1 == close (fd))
+                errno_exit ("close");
+
+        fd = -1;
+}
+
+static void
+open_device                     (void)
+{
+        struct stat st; 
+
+        if (-1 == stat (dev_name, &amp;st)) {
+                fprintf (stderr, "Cannot identify '%s': %d, %s\n",
+                         dev_name, errno, strerror (errno));
+                exit (EXIT_FAILURE);
+        }
+
+        if (!S_ISCHR (st.st_mode)) {
+                fprintf (stderr, "%s is no device\n", dev_name);
+                exit (EXIT_FAILURE);
+        }
+
+        fd = open (dev_name, O_RDWR /* required */ | O_NONBLOCK, 0);
+
+        if (-1 == fd) {
+                fprintf (stderr, "Cannot open '%s': %d, %s\n",
+                         dev_name, errno, strerror (errno));
+                exit (EXIT_FAILURE);
+        }
+}
+
+static void
+usage                           (FILE *                 fp,
+                                 int                    argc,
+                                 char **                argv)
+{
+        fprintf (fp,
+                 "Usage: %s [options]\n\n"
+                 "Options:\n"
+                 "-d | --device name   Video device name [/dev/video]\n"
+                 "-h | --help          Print this message\n"
+                 "-m | --mmap          Use memory mapped buffers\n"
+                 "-r | --read          Use read() calls\n"
+                 "-u | --userp         Use application allocated buffers\n"
+                 "",
+                 argv[0]);
+}
+
+static const char short_options [] = "d:hmru";
+
+static const struct option
+long_options [] = {
+        { "device",     required_argument,      NULL,           'd' },
+        { "help",       no_argument,            NULL,           'h' },
+        { "mmap",       no_argument,            NULL,           'm' },
+        { "read",       no_argument,            NULL,           'r' },
+        { "userp",      no_argument,            NULL,           'u' },
+        { 0, 0, 0, 0 }
+};
+
+int
+main                            (int                    argc,
+                                 char **                argv)
+{
+        dev_name = "/dev/video";
+
+        for (;;) {
+                int index;
+                int c;
+                
+                c = getopt_long (argc, argv,
+                                 short_options, long_options,
+                                 &amp;index);
+
+                if (-1 == c)
+                        break;
+
+                switch (c) {
+                case 0: /* getopt_long() flag */
+                        break;
+
+                case 'd':
+                        dev_name = optarg;
+                        break;
+
+                case 'h':
+                        usage (stdout, argc, argv);
+                        exit (EXIT_SUCCESS);
+
+                case 'm':
+                        io = IO_METHOD_MMAP;
+                        break;
+
+                case 'r':
+                        io = IO_METHOD_READ;
+                        break;
+
+                case 'u':
+                        io = IO_METHOD_USERPTR;
+                        break;
+
+                default:
+                        usage (stderr, argc, argv);
+                        exit (EXIT_FAILURE);
+                }
+        }
+
+        open_device ();
+
+        init_device ();
+
+        start_capturing ();
+
+        mainloop ();
+
+        stop_capturing ();
+
+        uninit_device ();
+
+        close_device ();
+
+        exit (EXIT_SUCCESS);
+
+        return 0;
+}</PRE
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="a16506.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="a16721.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Video For Linux Two Header File</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>GNU Free Documentation License</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/f163.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/f163.htm
new file mode 100644
index 0000000..84fbd55
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/f163.htm
@@ -0,0 +1,176 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Introduction</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="PREVIOUS"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="NEXT"
+TITLE="Common API Elements"
+HREF="c174.htm"></HEAD
+><BODY
+CLASS="PREFACE"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="book1.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="c174.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="PREFACE"
+><H1
+><A
+NAME="AEN163"
+></A
+>Introduction</H1
+><P
+>Video For Linux Two is the second version of the Video For
+Linux API, a kernel interface for analog radio and video capture and
+output drivers.</P
+><P
+>Early drivers used ad-hoc interfaces. These were replaced in
+Linux 2.2 by Alan Cox' V4L API, based on the interface of the bttv
+driver. In 1999 Bill Dirks started the development of V4L2 to fix some
+shortcomings of V4L and to support a wider range of devices. The API
+was revised again in 2002 prior to its inclusion in Linux 2.5/2.6, and
+work continues on improvements and additions while maintaining
+compatibility with existing drivers and applications. In 2006/2007
+efforts began on FreeBSD drivers with a V4L2 interface.</P
+><P
+>This book documents the V4L2 API. Intended audience are
+driver and application writers.</P
+><P
+>If you have questions or ideas regarding the API, please
+write to the Video4Linux mailing list: <A
+HREF="https://listman.redhat.com/mailman/listinfo/video4linux-list"
+TARGET="_top"
+>https://listman.redhat.com/mailman/listinfo/video4linux-list</A
+>. For inquiries about
+the V4L2 specification contact the maintainer <A
+HREF="mailto:mschimek@gmx.at"
+TARGET="_top"
+>mschimek@gmx.at</A
+>.</P
+><P
+>The latest version of this document and the DocBook SGML
+sources are hosted at <A
+HREF="../index.html"
+TARGET="_top"
+>http://v4l2spec.bytesex.org</A
+>,
+and <A
+HREF="http://linuxtv.org/downloads/video4linux/API/V4L2_API"
+TARGET="_top"
+>http://linuxtv.org/downloads/video4linux/API/V4L2_API</A
+>.</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="c174.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Video for Linux Two API Specification</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Common API Elements</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/i16960.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/i16960.htm
new file mode 100644
index 0000000..d234a16
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/i16960.htm
@@ -0,0 +1,413 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>List of Types</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="PREVIOUS"
+TITLE="Addendum"
+HREF="x16941.htm"><LINK
+REL="NEXT"
+TITLE="References"
+HREF="b17127.htm"></HEAD
+><BODY
+CLASS="INDEX"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x16941.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="b17127.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="INDEX"
+><H1
+><A
+NAME="AEN16960"
+></A
+>List of Types</H1
+><DL
+><DT
+><A
+HREF="r9288.htm#V4L2-STD-ID"
+>v4l2_std_id</A
+></DT
+><DT
+>enum&nbsp;<A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+></DT
+><DT
+>enum&nbsp;<A
+HREF="x2123.htm#V4L2-COLORSPACE"
+>v4l2_colorspace</A
+></DT
+><DT
+>enum&nbsp;<A
+HREF="r13317.htm#V4L2-CTRL-TYPE"
+>v4l2_ctrl_type</A
+></DT
+><DT
+>enum&nbsp;<A
+HREF="x6386.htm#V4L2-FIELD"
+>v4l2_field</A
+></DT
+><DT
+>enum&nbsp;<A
+HREF="r8724.htm#V4L2-FRMIVALTYPES"
+>v4l2_frmivaltypes</A
+></DT
+><DT
+>enum&nbsp;<A
+HREF="r8494.htm#V4L2-FRMSIZETYPES"
+>v4l2_frmsizetypes</A
+></DT
+><DT
+>enum&nbsp;<A
+HREF="x5953.htm#V4L2-MEMORY"
+>v4l2_memory</A
+></DT
+><DT
+>enum&nbsp;<A
+HREF="r11946.htm#V4L2-PRIORITY"
+>v4l2_priority</A
+></DT
+><DT
+>enum&nbsp;<A
+HREF="r12342.htm#V4L2-TUNER-TYPE"
+>v4l2_tuner_type</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r9539.htm#V4L2-AUDIO"
+>v4l2_audio</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r9688.htm#V4L2-AUDIOOUT"
+>v4l2_audioout</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r13105.htm#V4L2-CAPABILITY"
+>v4l2_capability</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r11680.htm#V4L2-CAPTUREPARM"
+>v4l2_captureparm</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r9804.htm#V4L2-CHIP-IDENT"
+>v4l2_chip_ident</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="x6570.htm#V4L2-CLIP"
+>v4l2_clip</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r10104.htm#V4L2-CONTROL"
+>v4l2_control</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r9994.htm#V4L2-CROP"
+>v4l2_crop</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r7771.htm#V4L2-CROPCAP"
+>v4l2_cropcap</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r10211.htm#V4L2-ENC-IDX"
+>v4l2_enc_idx</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r10211.htm#V4L2-ENC-IDX-ENTRY"
+>v4l2_enc_idx_entry</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r8087.htm#V4L2-ENCODER-CMD"
+>v4l2_encoder_cmd</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r10386.htm#V4L2-EXT-CONTROL"
+>v4l2_ext_control</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r10386.htm#V4L2-EXT-CONTROLS"
+>v4l2_ext_controls</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r8367.htm#V4L2-FMTDESC"
+>v4l2_fmtdesc</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r9288.htm#V4L2-FRACT"
+>v4l2_fract</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r10595.htm#V4L2-FRAMEBUFFER"
+>v4l2_framebuffer</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r11094.htm#V4L2-FREQUENCY"
+>v4l2_frequency</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r8724.htm#V4L2-FRMIVAL-STEPWISE"
+>v4l2_frmival_stepwise</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r8724.htm#V4L2-FRMIVALENUM"
+>v4l2_frmivalenum</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r8494.htm#V4L2-FRMSIZE-DISCRETE"
+>v4l2_frmsize_discrete</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r8494.htm#V4L2-FRMSIZE-STEPWISE"
+>v4l2_frmsize_stepwise</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r8494.htm#V4L2-FRMSIZEENUM"
+>v4l2_frmsizeenum</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r8936.htm#V4L2-INPUT"
+>v4l2_input</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r11285.htm#V4L2-JPEGCOMPRESSION"
+>v4l2_jpegcompression</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r11430.htm#V4L2-MODULATOR"
+>v4l2_modulator</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r9149.htm#V4L2-OUTPUT"
+>v4l2_output</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r11680.htm#V4L2-OUTPUTPARM"
+>v4l2_outputparm</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="c2030.htm#V4L2-PIX-FORMAT"
+>v4l2_pix_format</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r13317.htm#V4L2-QUERYCTRL"
+>v4l2_queryctrl</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r13317.htm#V4L2-QUERYMENU"
+>v4l2_querymenu</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="x6570.htm#V4L2-RECT"
+>v4l2_rect</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r7900.htm#V4L2-REGISTER"
+>v4l2_register</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r13696.htm#V4L2-REQUESTBUFFERS"
+>v4l2_requestbuffers</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r12051.htm#V4L2-SLICED-VBI-CAP"
+>v4l2_sliced_vbi_cap</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="x7236.htm#V4L2-SLICED-VBI-DATA"
+>v4l2_sliced_vbi_data</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="x7236.htm#V4L2-SLICED-VBI-FORMAT"
+>v4l2_sliced_vbi_format</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r9288.htm#V4L2-STANDARD"
+>v4l2_standard</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r11680.htm#V4L2-STREAMPARM"
+>v4l2_streamparm</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="x5953.htm#V4L2-TIMECODE"
+>v4l2_timecode</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="r12342.htm#V4L2-TUNER"
+>v4l2_tuner</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="x7013.htm#V4L2-VBI-FORMAT"
+>v4l2_vbi_format</A
+></DT
+><DT
+>struct&nbsp;<A
+HREF="x6570.htm#V4L2-WINDOW"
+>v4l2_window</A
+></DT
+></DL
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x16941.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="b17127.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Addendum</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>References</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/index.html b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/index.html
new file mode 100644
index 0000000..e828771
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/index.html
@@ -0,0 +1,1650 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Video for Linux Two API Specification</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="NEXT"
+TITLE="Introduction"
+HREF="f163.htm"></HEAD
+><BODY
+CLASS="BOOK"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="BOOK"
+><A
+NAME="V4L2SPEC"
+></A
+><DIV
+CLASS="TITLEPAGE"
+><H1
+CLASS="TITLE"
+><A
+NAME="AEN2"
+>Video for Linux Two API Specification</A
+></H1
+><H2
+CLASS="SUBTITLE"
+>Revision 0.24</H2
+><H3
+CLASS="AUTHOR"
+><A
+NAME="AEN6"
+></A
+>Michael H Schimek</H3
+><DIV
+CLASS="AFFILIATION"
+><DIV
+CLASS="ADDRESS"
+><P
+CLASS="ADDRESS"
+>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<CODE
+CLASS="EMAIL"
+>&#60;<A
+HREF="mailto:mschimek@gmx.at"
+>mschimek@gmx.at</A
+>&#62;</CODE
+><br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</P
+></DIV
+></DIV
+><H3
+CLASS="AUTHOR"
+><A
+NAME="AEN13"
+></A
+>Bill Dirks</H3
+><H3
+CLASS="AUTHOR"
+><A
+NAME="AEN17"
+></A
+>Hans Verkuil</H3
+><H3
+CLASS="AUTHOR"
+><A
+NAME="AEN21"
+></A
+>Martin Rubli</H3
+><P
+CLASS="COPYRIGHT"
+>Copyright &copy; 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin
+Rubli</P
+><DIV
+CLASS="LEGALNOTICE"
+><P
+></P
+><A
+NAME="AEN37"
+></A
+><P
+>This document is copyrighted &copy; 1999-2008 by Bill
+Dirks, Michael H. Schimek, Hans Verkuil and Martin Rubli.</P
+><P
+>Permission is granted to copy, distribute and/or modify
+this document under the terms of the GNU Free Documentation License,
+Version 1.1 or any later version published by the Free Software
+Foundation; with no Invariant Sections, with no Front-Cover Texts, and
+with no Back-Cover Texts. A copy of the license is included in the
+appendix entitled "GNU Free Documentation License".</P
+><P
+>Programming examples can be used and distributed without
+restrictions.</P
+><P
+></P
+></DIV
+><HR></DIV
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+><A
+HREF="f163.htm"
+>Introduction</A
+></DT
+><DT
+>1. <A
+HREF="c174.htm"
+>Common API Elements</A
+></DT
+><DD
+><DL
+><DT
+>1.1. <A
+HREF="c174.htm#OPEN"
+>Opening and Closing Devices</A
+></DT
+><DD
+><DL
+><DT
+>1.1.1. <A
+HREF="c174.htm#AEN194"
+>Device Naming</A
+></DT
+><DT
+>1.1.2. <A
+HREF="c174.htm#RELATED"
+>Related Devices</A
+></DT
+><DT
+>1.1.3. <A
+HREF="c174.htm#AEN249"
+>Multiple Opens</A
+></DT
+><DT
+>1.1.4. <A
+HREF="c174.htm#AEN270"
+>Shared Data Streams</A
+></DT
+><DT
+>1.1.5. <A
+HREF="c174.htm#AEN273"
+>Functions</A
+></DT
+></DL
+></DD
+><DT
+>1.2. <A
+HREF="x282.htm"
+>Querying Capabilities</A
+></DT
+><DT
+>1.3. <A
+HREF="x294.htm"
+>Application Priority</A
+></DT
+><DT
+>1.4. <A
+HREF="x309.htm"
+>Video Inputs and Outputs</A
+></DT
+><DT
+>1.5. <A
+HREF="x341.htm"
+>Audio Inputs and Outputs</A
+></DT
+><DT
+>1.6. <A
+HREF="x394.htm"
+>Tuners and Modulators</A
+></DT
+><DD
+><DL
+><DT
+>1.6.1. <A
+HREF="x394.htm#AEN396"
+>Tuners</A
+></DT
+><DT
+>1.6.2. <A
+HREF="x394.htm#AEN418"
+>Modulators</A
+></DT
+><DT
+>1.6.3. <A
+HREF="x394.htm#AEN437"
+>Radio Frequency</A
+></DT
+><DT
+>1.6.4. <A
+HREF="x394.htm#AEN445"
+>Satellite Receivers</A
+></DT
+></DL
+></DD
+><DT
+>1.7. <A
+HREF="x448.htm"
+>Video Standards</A
+></DT
+><DT
+>1.8. <A
+HREF="x542.htm"
+>User Controls</A
+></DT
+><DT
+>1.9. <A
+HREF="x802.htm"
+>Extended Controls</A
+></DT
+><DD
+><DL
+><DT
+>1.9.1. <A
+HREF="x802.htm#AEN804"
+>Introduction</A
+></DT
+><DT
+>1.9.2. <A
+HREF="x802.htm#AEN809"
+>The Extended Control API</A
+></DT
+><DT
+>1.9.3. <A
+HREF="x802.htm#AEN840"
+>Enumerating Extended Controls</A
+></DT
+><DT
+>1.9.4. <A
+HREF="x802.htm#AEN867"
+>Creating Control Panels</A
+></DT
+><DT
+>1.9.5. <A
+HREF="x802.htm#MPEG-CONTROLS"
+>MPEG Control Reference</A
+></DT
+><DT
+>1.9.6. <A
+HREF="x802.htm#CAMERA-CONTROLS"
+>Camera Control Reference</A
+></DT
+></DL
+></DD
+><DT
+>1.10. <A
+HREF="x1859.htm"
+>Data Formats</A
+></DT
+><DD
+><DL
+><DT
+>1.10.1. <A
+HREF="x1859.htm#AEN1861"
+>Data Format Negotiation</A
+></DT
+><DT
+>1.10.2. <A
+HREF="x1859.htm#AEN1894"
+>Image Format Enumeration</A
+></DT
+></DL
+></DD
+><DT
+>1.11. <A
+HREF="x1904.htm"
+>Image Cropping, Insertion and Scaling</A
+></DT
+><DD
+><DL
+><DT
+>1.11.1. <A
+HREF="x1904.htm#AEN1926"
+>Cropping Structures</A
+></DT
+><DT
+>1.11.2. <A
+HREF="x1904.htm#AEN1954"
+>Scaling Adjustments</A
+></DT
+><DT
+>1.11.3. <A
+HREF="x1904.htm#AEN1969"
+>Examples</A
+></DT
+></DL
+></DD
+><DT
+>1.12. <A
+HREF="x2009.htm"
+>Streaming Parameters</A
+></DT
+></DL
+></DD
+><DT
+>2. <A
+HREF="c2030.htm"
+>Image Formats</A
+></DT
+><DD
+><DL
+><DT
+>2.1. <A
+HREF="c2030.htm#AEN2113"
+>Standard Image Formats</A
+></DT
+><DT
+>2.2. <A
+HREF="x2123.htm"
+>Colorspaces</A
+></DT
+><DT
+>2.3. <A
+HREF="x2428.htm"
+>Indexed Format</A
+></DT
+><DT
+>2.4. <A
+HREF="x2490.htm"
+>RGB Formats</A
+></DT
+><DD
+><DL
+><DT
+><A
+HREF="r2492.htm"
+>Packed RGB formats</A
+>&nbsp;--&nbsp;Packed RGB formats</DT
+><DT
+><A
+HREF="r3735.htm"
+>V4L2_PIX_FMT_SBGGR8 ('BA81')</A
+>&nbsp;--&nbsp;Bayer RGB format</DT
+><DT
+><A
+HREF="r3796.htm"
+>V4L2_PIX_FMT_SBGGR16 ('BA82')</A
+>&nbsp;--&nbsp;Bayer RGB format</DT
+></DL
+></DD
+><DT
+>2.5. <A
+HREF="x3891.htm"
+>YUV Formats</A
+></DT
+><DD
+><DL
+><DT
+><A
+HREF="r3896.htm"
+>Packed YUV formats</A
+>&nbsp;--&nbsp;Packed YUV formats</DT
+><DT
+><A
+HREF="r4185.htm"
+>V4L2_PIX_FMT_GREY ('GREY')</A
+>&nbsp;--&nbsp;Grey-scale image</DT
+><DT
+><A
+HREF="r4246.htm"
+>V4L2_PIX_FMT_Y16 ('Y16 ')</A
+>&nbsp;--&nbsp;Grey-scale image</DT
+><DT
+><A
+HREF="r4339.htm"
+>V4L2_PIX_FMT_YUYV ('YUYV')</A
+>&nbsp;--&nbsp;Packed format with &frac12; horizontal chroma
+resolution, also known as YUV 4:2:2</DT
+><DT
+><A
+HREF="r4484.htm"
+>V4L2_PIX_FMT_UYVY ('UYVY')</A
+>&nbsp;--&nbsp;Variation of
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUYV</CODE
+> with different order of samples
+in memory</DT
+><DT
+><A
+HREF="r4629.htm"
+>V4L2_PIX_FMT_Y41P ('Y41P')</A
+>&nbsp;--&nbsp;Format with &frac14; horizontal chroma
+resolution, also known as YUV 4:1:1</DT
+><DT
+><A
+HREF="r4850.htm"
+>V4L2_PIX_FMT_YVU420 ('YV12'), V4L2_PIX_FMT_YUV420 ('YU12')</A
+>&nbsp;--&nbsp;Planar formats with &frac12; horizontal and
+vertical chroma resolution, also known as YUV 4:2:0</DT
+><DT
+><A
+HREF="r5016.htm"
+>V4L2_PIX_FMT_YVU410 ('YVU9'), V4L2_PIX_FMT_YUV410 ('YUV9')</A
+>&nbsp;--&nbsp;Planar formats with &frac14; horizontal and
+vertical chroma resolution, also known as YUV 4:1:0</DT
+><DT
+><A
+HREF="r5154.htm"
+>V4L2_PIX_FMT_YUV422P ('422P')</A
+>&nbsp;--&nbsp;Format with &frac12; horizontal chroma resolution,
+also known as YUV 4:2:2. Planar layout as opposed to
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUYV</CODE
+></DT
+><DT
+><A
+HREF="r5319.htm"
+>V4L2_PIX_FMT_YUV411P ('411P')</A
+>&nbsp;--&nbsp;Format with &frac14; horizontal chroma resolution,
+also known as YUV 4:1:1. Planar layout as opposed to
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_Y41P</CODE
+></DT
+><DT
+><A
+HREF="r5470.htm"
+>V4L2_PIX_FMT_NV12 ('NV12'), V4L2_PIX_FMT_NV21 ('NV21')</A
+>&nbsp;--&nbsp;Formats with &frac12; horizontal and vertical
+chroma resolution, also known as YUV 4:2:0. One luminance and one
+chrominance plane with alternating chroma samples as opposed to
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YVU420</CODE
+></DT
+></DL
+></DD
+><DT
+>2.6. <A
+HREF="x5634.htm"
+>Compressed Formats</A
+></DT
+><DT
+>2.7. <A
+HREF="x5665.htm"
+>Reserved Format Identifiers</A
+></DT
+></DL
+></DD
+><DT
+>3. <A
+HREF="c5742.htm"
+>Input/Output</A
+></DT
+><DD
+><DL
+><DT
+>3.1. <A
+HREF="c5742.htm#RW"
+>Read/Write</A
+></DT
+><DT
+>3.2. <A
+HREF="x5791.htm"
+>Streaming I/O (Memory Mapping)</A
+></DT
+><DT
+>3.3. <A
+HREF="x5884.htm"
+>Streaming I/O (User Pointers)</A
+></DT
+><DT
+>3.4. <A
+HREF="x5950.htm"
+>Asynchronous I/O</A
+></DT
+><DT
+>3.5. <A
+HREF="x5953.htm"
+>Buffers</A
+></DT
+><DD
+><DL
+><DT
+>3.5.1. <A
+HREF="x5953.htm#AEN6266"
+>Timecodes</A
+></DT
+></DL
+></DD
+><DT
+>3.6. <A
+HREF="x6386.htm"
+>Field Order</A
+></DT
+></DL
+></DD
+><DT
+>4. <A
+HREF="c6488.htm"
+>Interfaces</A
+></DT
+><DD
+><DL
+><DT
+>4.1. <A
+HREF="c6488.htm#CAPTURE"
+>Video Capture Interface</A
+></DT
+><DD
+><DL
+><DT
+>4.1.1. <A
+HREF="c6488.htm#AEN6498"
+>Querying Capabilities</A
+></DT
+><DT
+>4.1.2. <A
+HREF="c6488.htm#AEN6510"
+>Supplemental Functions</A
+></DT
+><DT
+>4.1.3. <A
+HREF="c6488.htm#AEN6520"
+>Image Format Negotiation</A
+></DT
+><DT
+>4.1.4. <A
+HREF="c6488.htm#AEN6563"
+>Reading Images</A
+></DT
+></DL
+></DD
+><DT
+>4.2. <A
+HREF="x6570.htm"
+>Video Overlay Interface</A
+></DT
+><DD
+><DL
+><DT
+>4.2.1. <A
+HREF="x6570.htm#AEN6587"
+>Querying Capabilities</A
+></DT
+><DT
+>4.2.2. <A
+HREF="x6570.htm#AEN6595"
+>Supplemental Functions</A
+></DT
+><DT
+>4.2.3. <A
+HREF="x6570.htm#AEN6605"
+>Setup</A
+></DT
+><DT
+>4.2.4. <A
+HREF="x6570.htm#AEN6635"
+>Overlay Window</A
+></DT
+><DT
+>4.2.5. <A
+HREF="x6570.htm#AEN6826"
+>Enabling Overlay</A
+></DT
+></DL
+></DD
+><DT
+>4.3. <A
+HREF="x6831.htm"
+>Video Output Interface</A
+></DT
+><DD
+><DL
+><DT
+>4.3.1. <A
+HREF="x6831.htm#AEN6839"
+>Querying Capabilities</A
+></DT
+><DT
+>4.3.2. <A
+HREF="x6831.htm#AEN6849"
+>Supplemental Functions</A
+></DT
+><DT
+>4.3.3. <A
+HREF="x6831.htm#AEN6859"
+>Image Format Negotiation</A
+></DT
+><DT
+>4.3.4. <A
+HREF="x6831.htm#AEN6902"
+>Writing Images</A
+></DT
+></DL
+></DD
+><DT
+>4.4. <A
+HREF="x6909.htm"
+>Video Output Overlay Interface</A
+></DT
+><DD
+><DL
+><DT
+>4.4.1. <A
+HREF="x6909.htm#AEN6923"
+>Querying Capabilities</A
+></DT
+><DT
+>4.4.2. <A
+HREF="x6909.htm#AEN6932"
+>Framebuffer</A
+></DT
+><DT
+>4.4.3. <A
+HREF="x6909.htm#AEN6953"
+>Overlay Window and Scaling</A
+></DT
+><DT
+>4.4.4. <A
+HREF="x6909.htm#AEN6987"
+>Enabling Overlay</A
+></DT
+></DL
+></DD
+><DT
+>4.5. <A
+HREF="x6991.htm"
+>Codec Interface</A
+></DT
+><DT
+>4.6. <A
+HREF="x7002.htm"
+>Effect Devices Interface</A
+></DT
+><DT
+>4.7. <A
+HREF="x7013.htm"
+>Raw VBI Data Interface</A
+></DT
+><DD
+><DL
+><DT
+>4.7.1. <A
+HREF="x7013.htm#AEN7029"
+>Querying Capabilities</A
+></DT
+><DT
+>4.7.2. <A
+HREF="x7013.htm#AEN7038"
+>Supplemental Functions</A
+></DT
+><DT
+>4.7.3. <A
+HREF="x7013.htm#AEN7045"
+>Raw VBI Format Negotiation</A
+></DT
+><DT
+>4.7.4. <A
+HREF="x7013.htm#AEN7218"
+>Reading and writing VBI images</A
+></DT
+></DL
+></DD
+><DT
+>4.8. <A
+HREF="x7236.htm"
+>Sliced VBI Data Interface</A
+></DT
+><DD
+><DL
+><DT
+>4.8.1. <A
+HREF="x7236.htm#AEN7248"
+>Querying Capabilities</A
+></DT
+><DT
+>4.8.2. <A
+HREF="x7236.htm#AEN7258"
+>Supplemental Functions</A
+></DT
+><DT
+>4.8.3. <A
+HREF="x7236.htm#AEN7265"
+>Sliced VBI Format Negotiation</A
+></DT
+><DT
+>4.8.4. <A
+HREF="x7236.htm#AEN7483"
+>Reading and writing sliced VBI data</A
+></DT
+></DL
+></DD
+><DT
+>4.9. <A
+HREF="x7561.htm"
+>Teletext Interface</A
+></DT
+><DT
+>4.10. <A
+HREF="x7578.htm"
+>Radio Interface</A
+></DT
+><DD
+><DL
+><DT
+>4.10.1. <A
+HREF="x7578.htm#AEN7585"
+>Querying Capabilities</A
+></DT
+><DT
+>4.10.2. <A
+HREF="x7578.htm#AEN7594"
+>Supplemental Functions</A
+></DT
+><DT
+>4.10.3. <A
+HREF="x7578.htm#AEN7600"
+>Programming</A
+></DT
+></DL
+></DD
+><DT
+>4.11. <A
+HREF="x7607.htm"
+>RDS Interface</A
+></DT
+></DL
+></DD
+><DT
+>I. <A
+HREF="r7624.htm"
+>Function Reference</A
+></DT
+><DD
+><DL
+><DT
+><A
+HREF="r7626.htm"
+>V4L2 close()</A
+>&nbsp;--&nbsp;Close a V4L2 device</DT
+><DT
+><A
+HREF="r7667.htm"
+>V4L2 ioctl()</A
+>&nbsp;--&nbsp;Program a V4L2 device</DT
+><DT
+><A
+HREF="r7771.htm"
+>ioctl VIDIOC_CROPCAP</A
+>&nbsp;--&nbsp;Information about the video cropping and scaling abilities</DT
+><DT
+><A
+HREF="r7900.htm"
+>ioctl VIDIOC_DBG_G_REGISTER, VIDIOC_DBG_S_REGISTER</A
+>&nbsp;--&nbsp;Read or write hardware registers</DT
+><DT
+><A
+HREF="r8087.htm"
+>ioctl VIDIOC_ENCODER_CMD, VIDIOC_TRY_ENCODER_CMD</A
+>&nbsp;--&nbsp;Execute an encoder command</DT
+><DT
+><A
+HREF="r8242.htm"
+>ioctl VIDIOC_ENUMAUDIO</A
+>&nbsp;--&nbsp;Enumerate audio inputs</DT
+><DT
+><A
+HREF="r8304.htm"
+>ioctl VIDIOC_ENUMAUDOUT</A
+>&nbsp;--&nbsp;Enumerate audio outputs</DT
+><DT
+><A
+HREF="r8367.htm"
+>ioctl VIDIOC_ENUM_FMT</A
+>&nbsp;--&nbsp;Enumerate image formats</DT
+><DT
+><A
+HREF="r8494.htm"
+>ioctl VIDIOC_ENUM_FRAMESIZES</A
+>&nbsp;--&nbsp;Enumerate frame sizes</DT
+><DT
+><A
+HREF="r8724.htm"
+>ioctl VIDIOC_ENUM_FRAMEINTERVALS</A
+>&nbsp;--&nbsp;Enumerate frame intervals</DT
+><DT
+><A
+HREF="r8936.htm"
+>ioctl VIDIOC_ENUMINPUT</A
+>&nbsp;--&nbsp;Enumerate video inputs</DT
+><DT
+><A
+HREF="r9149.htm"
+>ioctl VIDIOC_ENUMOUTPUT</A
+>&nbsp;--&nbsp;Enumerate video outputs</DT
+><DT
+><A
+HREF="r9288.htm"
+>ioctl VIDIOC_ENUMSTD</A
+>&nbsp;--&nbsp;Enumerate supported video standards</DT
+><DT
+><A
+HREF="r9539.htm"
+>ioctl VIDIOC_G_AUDIO, VIDIOC_S_AUDIO</A
+>&nbsp;--&nbsp;Query or select the current audio input and its
+attributes</DT
+><DT
+><A
+HREF="r9688.htm"
+>ioctl VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT</A
+>&nbsp;--&nbsp;Query or select the current audio output</DT
+><DT
+><A
+HREF="r9804.htm"
+>ioctl VIDIOC_G_CHIP_IDENT</A
+>&nbsp;--&nbsp;Identify the chips on a TV card</DT
+><DT
+><A
+HREF="r9994.htm"
+>ioctl VIDIOC_G_CROP, VIDIOC_S_CROP</A
+>&nbsp;--&nbsp;Get or set the current cropping rectangle</DT
+><DT
+><A
+HREF="r10104.htm"
+>ioctl VIDIOC_G_CTRL, VIDIOC_S_CTRL</A
+>&nbsp;--&nbsp;Get or set the value of a control</DT
+><DT
+><A
+HREF="r10211.htm"
+>ioctl VIDIOC_G_ENC_INDEX</A
+>&nbsp;--&nbsp;Get meta data about a compressed video stream</DT
+><DT
+><A
+HREF="r10386.htm"
+>ioctl VIDIOC_G_EXT_CTRLS, VIDIOC_S_EXT_CTRLS,
+VIDIOC_TRY_EXT_CTRLS</A
+>&nbsp;--&nbsp;Get or set the value of several controls, try control
+values</DT
+><DT
+><A
+HREF="r10595.htm"
+>ioctl VIDIOC_G_FBUF, VIDIOC_S_FBUF</A
+>&nbsp;--&nbsp;Get or set frame buffer overlay parameters</DT
+><DT
+><A
+HREF="r10944.htm"
+>ioctl VIDIOC_G_FMT, VIDIOC_S_FMT,
+VIDIOC_TRY_FMT</A
+>&nbsp;--&nbsp;Get or set the data format, try a format</DT
+><DT
+><A
+HREF="r11094.htm"
+>ioctl VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY</A
+>&nbsp;--&nbsp;Get or set tuner or modulator radio
+frequency</DT
+><DT
+><A
+HREF="r11217.htm"
+>ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT</A
+>&nbsp;--&nbsp;Query or select the current video input</DT
+><DT
+><A
+HREF="r11285.htm"
+>ioctl VIDIOC_G_JPEGCOMP, VIDIOC_S_JPEGCOMP</A
+>&nbsp;--&nbsp;</DT
+><DT
+><A
+HREF="r11430.htm"
+>ioctl VIDIOC_G_MODULATOR, VIDIOC_S_MODULATOR</A
+>&nbsp;--&nbsp;Get or set modulator attributes</DT
+><DT
+><A
+HREF="r11612.htm"
+>ioctl VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT</A
+>&nbsp;--&nbsp;Query or select the current video output</DT
+><DT
+><A
+HREF="r11680.htm"
+>ioctl VIDIOC_G_PARM, VIDIOC_S_PARM</A
+>&nbsp;--&nbsp;Get or set streaming parameters</DT
+><DT
+><A
+HREF="r11946.htm"
+>ioctl VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY</A
+>&nbsp;--&nbsp;Query or request the access priority associated with a
+file descriptor</DT
+><DT
+><A
+HREF="r12051.htm"
+>ioctl VIDIOC_G_SLICED_VBI_CAP</A
+>&nbsp;--&nbsp;Query sliced VBI capabilities</DT
+><DT
+><A
+HREF="r12265.htm"
+>ioctl VIDIOC_G_STD, VIDIOC_S_STD</A
+>&nbsp;--&nbsp;Query or select the video standard of the current input</DT
+><DT
+><A
+HREF="r12342.htm"
+>ioctl VIDIOC_G_TUNER, VIDIOC_S_TUNER</A
+>&nbsp;--&nbsp;Get or set tuner attributes</DT
+><DT
+><A
+HREF="r12784.htm"
+>ioctl VIDIOC_LOG_STATUS</A
+>&nbsp;--&nbsp;Log driver status information</DT
+><DT
+><A
+HREF="r12816.htm"
+>ioctl VIDIOC_OVERLAY</A
+>&nbsp;--&nbsp;Start or stop video overlay</DT
+><DT
+><A
+HREF="r12878.htm"
+>ioctl VIDIOC_QBUF, VIDIOC_DQBUF</A
+>&nbsp;--&nbsp;Exchange a buffer with the driver</DT
+><DT
+><A
+HREF="r13022.htm"
+>ioctl VIDIOC_QUERYBUF</A
+>&nbsp;--&nbsp;Query the status of a buffer</DT
+><DT
+><A
+HREF="r13105.htm"
+>ioctl VIDIOC_QUERYCAP</A
+>&nbsp;--&nbsp;Query device capabilities</DT
+><DT
+><A
+HREF="r13317.htm"
+>ioctl VIDIOC_QUERYCTRL, VIDIOC_QUERYMENU</A
+>&nbsp;--&nbsp;Enumerate controls and menu control items</DT
+><DT
+><A
+HREF="r13641.htm"
+>ioctl VIDIOC_QUERYSTD</A
+>&nbsp;--&nbsp;Sense the video standard received by the current
+input</DT
+><DT
+><A
+HREF="r13696.htm"
+>ioctl VIDIOC_REQBUFS</A
+>&nbsp;--&nbsp;Initiate Memory Mapping or User Pointer I/O</DT
+><DT
+><A
+HREF="r13817.htm"
+>ioctl VIDIOC_STREAMON, VIDIOC_STREAMOFF</A
+>&nbsp;--&nbsp;Start or stop streaming I/O</DT
+><DT
+><A
+HREF="r13889.htm"
+>V4L2 mmap()</A
+>&nbsp;--&nbsp;Map device memory into application address space</DT
+><DT
+><A
+HREF="r14037.htm"
+>V4L2 munmap()</A
+>&nbsp;--&nbsp;Unmap device memory</DT
+><DT
+><A
+HREF="r14090.htm"
+>V4L2 open()</A
+>&nbsp;--&nbsp;Open a V4L2 device</DT
+><DT
+><A
+HREF="r14169.htm"
+>V4L2 poll()</A
+>&nbsp;--&nbsp;Wait for some event on a file descriptor</DT
+><DT
+><A
+HREF="r14264.htm"
+>V4L2 read()</A
+>&nbsp;--&nbsp;Read from a V4L2 device</DT
+><DT
+><A
+HREF="r14390.htm"
+>V4L2 select()</A
+>&nbsp;--&nbsp;Synchronous I/O multiplexing</DT
+><DT
+><A
+HREF="r14496.htm"
+>V4L2 write()</A
+>&nbsp;--&nbsp;Write to a V4L2 device</DT
+></DL
+></DD
+><DT
+>5. <A
+HREF="c14592.htm"
+>V4L2 Driver Programming</A
+></DT
+><DT
+>6. <A
+HREF="c14595.htm"
+>Changes</A
+></DT
+><DD
+><DL
+><DT
+>6.1. <A
+HREF="c14595.htm#DIFF-V4L"
+>Differences between V4L and V4L2</A
+></DT
+><DD
+><DL
+><DT
+>6.1.1. <A
+HREF="c14595.htm#AEN14602"
+>Opening and Closing Devices</A
+></DT
+><DT
+>6.1.2. <A
+HREF="c14595.htm#AEN14665"
+>Querying Capabilities</A
+></DT
+><DT
+>6.1.3. <A
+HREF="c14595.htm#AEN14821"
+>Video Sources</A
+></DT
+><DT
+>6.1.4. <A
+HREF="c14595.htm#AEN14877"
+>Tuning</A
+></DT
+><DT
+>6.1.5. <A
+HREF="c14595.htm#V4L-IMAGE-PROPERTIES"
+>Image Properties</A
+></DT
+><DT
+>6.1.6. <A
+HREF="c14595.htm#AEN15120"
+>Audio</A
+></DT
+><DT
+>6.1.7. <A
+HREF="c14595.htm#AEN15205"
+>Frame Buffer Overlay</A
+></DT
+><DT
+>6.1.8. <A
+HREF="c14595.htm#AEN15269"
+>Cropping</A
+></DT
+><DT
+>6.1.9. <A
+HREF="c14595.htm#AEN15302"
+>Reading Images, Memory Mapping</A
+></DT
+><DT
+>6.1.10. <A
+HREF="c14595.htm#AEN15385"
+>Reading Raw VBI Data</A
+></DT
+><DT
+>6.1.11. <A
+HREF="c14595.htm#AEN15438"
+>Miscellaneous</A
+></DT
+></DL
+></DD
+><DT
+>6.2. <A
+HREF="x15446.htm"
+>Changes of the V4L2 API</A
+></DT
+><DD
+><DL
+><DT
+>6.2.1. <A
+HREF="x15446.htm#AEN15449"
+>Early Versions</A
+></DT
+><DT
+>6.2.2. <A
+HREF="x15446.htm#AEN15499"
+>V4L2 Version 0.16 1999-01-31</A
+></DT
+><DT
+>6.2.3. <A
+HREF="x15446.htm#AEN15502"
+>V4L2 Version 0.18 1999-03-16</A
+></DT
+><DT
+>6.2.4. <A
+HREF="x15446.htm#AEN15505"
+>V4L2 Version 0.19 1999-06-05</A
+></DT
+><DT
+>6.2.5. <A
+HREF="x15446.htm#AEN15514"
+>V4L2 Version 0.20 (1999-09-10)</A
+></DT
+><DT
+>6.2.6. <A
+HREF="x15446.htm#AEN15575"
+>V4L2 Version 0.20 incremental changes</A
+></DT
+><DT
+>6.2.7. <A
+HREF="x15446.htm#AEN15628"
+>V4L2 Version 0.20 2000-11-23</A
+></DT
+><DT
+>6.2.8. <A
+HREF="x15446.htm#AEN15657"
+>V4L2 Version 0.20 2002-07-25</A
+></DT
+><DT
+>6.2.9. <A
+HREF="x15446.htm#AEN15660"
+>V4L2 in Linux 2.5.46, 2002-10</A
+></DT
+><DT
+>6.2.10. <A
+HREF="x15446.htm#AEN16046"
+>V4L2 2003-06-19</A
+></DT
+><DT
+>6.2.11. <A
+HREF="x15446.htm#AEN16089"
+>V4L2 2003-11-05</A
+></DT
+><DT
+>6.2.12. <A
+HREF="x15446.htm#AEN16131"
+>V4L2 in Linux 2.6.6, 2004-05-09</A
+></DT
+><DT
+>6.2.13. <A
+HREF="x15446.htm#AEN16139"
+>V4L2 in Linux 2.6.8</A
+></DT
+><DT
+>6.2.14. <A
+HREF="x15446.htm#AEN16149"
+>V4L2 spec erratum 2004-08-01</A
+></DT
+><DT
+>6.2.15. <A
+HREF="x15446.htm#AEN16170"
+>V4L2 in Linux 2.6.14</A
+></DT
+><DT
+>6.2.16. <A
+HREF="x15446.htm#AEN16176"
+>V4L2 in Linux 2.6.15</A
+></DT
+><DT
+>6.2.17. <A
+HREF="x15446.htm#AEN16203"
+>V4L2 spec erratum 2005-11-27</A
+></DT
+><DT
+>6.2.18. <A
+HREF="x15446.htm#AEN16212"
+>V4L2 spec erratum 2006-01-10</A
+></DT
+><DT
+>6.2.19. <A
+HREF="x15446.htm#AEN16223"
+>V4L2 spec erratum 2006-02-03</A
+></DT
+><DT
+>6.2.20. <A
+HREF="x15446.htm#AEN16231"
+>V4L2 spec erratum 2006-02-04</A
+></DT
+><DT
+>6.2.21. <A
+HREF="x15446.htm#AEN16241"
+>V4L2 in Linux 2.6.17</A
+></DT
+><DT
+>6.2.22. <A
+HREF="x15446.htm#AEN16261"
+>V4L2 spec erratum 2006-09-23 (Draft 0.15)</A
+></DT
+><DT
+>6.2.23. <A
+HREF="x15446.htm#AEN16297"
+>V4L2 in Linux 2.6.18</A
+></DT
+><DT
+>6.2.24. <A
+HREF="x15446.htm#AEN16319"
+>V4L2 in Linux 2.6.19</A
+></DT
+><DT
+>6.2.25. <A
+HREF="x15446.htm#AEN16338"
+>V4L2 spec erratum 2006-10-12 (Draft 0.17)</A
+></DT
+><DT
+>6.2.26. <A
+HREF="x15446.htm#AEN16345"
+>V4L2 in Linux 2.6.21</A
+></DT
+><DT
+>6.2.27. <A
+HREF="x15446.htm#AEN16351"
+>V4L2 in Linux 2.6.22</A
+></DT
+><DT
+>6.2.28. <A
+HREF="x15446.htm#AEN16378"
+>V4L2 in Linux 2.6.24</A
+></DT
+><DT
+>6.2.29. <A
+HREF="x15446.htm#AEN16388"
+>V4L2 in Linux 2.6.25</A
+></DT
+></DL
+></DD
+><DT
+>6.3. <A
+HREF="x16430.htm"
+>Relation of V4L2 to other Linux multimedia APIs</A
+></DT
+><DD
+><DL
+><DT
+>6.3.1. <A
+HREF="x16430.htm#XVIDEO"
+>X Video Extension</A
+></DT
+><DT
+>6.3.2. <A
+HREF="x16430.htm#AEN16446"
+>Digital Video</A
+></DT
+><DT
+>6.3.3. <A
+HREF="x16430.htm#AEN16450"
+>Audio Interfaces</A
+></DT
+></DL
+></DD
+><DT
+>6.4. <A
+HREF="x16453.htm"
+>Experimental API Elements</A
+></DT
+><DT
+>6.5. <A
+HREF="x16497.htm"
+>Obsolete API Elements</A
+></DT
+></DL
+></DD
+><DT
+>A. <A
+HREF="a16506.htm"
+>Video For Linux Two Header File</A
+></DT
+><DT
+>B. <A
+HREF="a16706.htm"
+>Video Capture Example</A
+></DT
+><DT
+>C. <A
+HREF="a16721.htm"
+>GNU Free Documentation License</A
+></DT
+><DD
+><DL
+><DT
+>C.1. <A
+HREF="a16721.htm#FDL-PREAMBLE"
+>0. PREAMBLE</A
+></DT
+><DT
+>C.2. <A
+HREF="x16743.htm"
+>1. APPLICABILITY AND DEFINITIONS</A
+></DT
+><DT
+>C.3. <A
+HREF="x16769.htm"
+>2. VERBATIM COPYING</A
+></DT
+><DT
+>C.4. <A
+HREF="x16775.htm"
+>3. COPYING IN QUANTITY</A
+></DT
+><DT
+>C.5. <A
+HREF="x16788.htm"
+>4. MODIFICATIONS</A
+></DT
+><DT
+>C.6. <A
+HREF="x16896.htm"
+>5. COMBINING DOCUMENTS</A
+></DT
+><DT
+>C.7. <A
+HREF="x16910.htm"
+>6. COLLECTIONS OF DOCUMENTS</A
+></DT
+><DT
+>C.8. <A
+HREF="x16915.htm"
+>7. AGGREGATION WITH INDEPENDENT WORKS</A
+></DT
+><DT
+>C.9. <A
+HREF="x16923.htm"
+>8. TRANSLATION</A
+></DT
+><DT
+>C.10. <A
+HREF="x16929.htm"
+>9. TERMINATION</A
+></DT
+><DT
+>C.11. <A
+HREF="x16933.htm"
+>10. FUTURE REVISIONS OF THIS LICENSE</A
+></DT
+><DT
+>C.12. <A
+HREF="x16941.htm"
+>Addendum</A
+></DT
+></DL
+></DD
+><DT
+><A
+HREF="i16960.htm"
+>List of Types</A
+></DT
+><DT
+><A
+HREF="b17127.htm"
+>References</A
+></DT
+></DL
+></DIV
+><DIV
+CLASS="LOT"
+><DL
+CLASS="LOT"
+><DT
+><B
+>List of Figures</B
+></DT
+><DT
+>1-1. <A
+HREF="x1904.htm#CROP-SCALE"
+>Image Cropping, Insertion and Scaling</A
+></DT
+><DT
+>3-1. <A
+HREF="x6386.htm#FIELDSEQ-TB"
+>Field Order, Top Field First Transmitted</A
+></DT
+><DT
+>3-2. <A
+HREF="x6386.htm#FIELDSEQ-BT"
+>Field Order, Bottom Field First Transmitted</A
+></DT
+><DT
+>4-1. <A
+HREF="x7013.htm#VBI-HSYNC"
+>Line synchronization</A
+></DT
+><DT
+>4-2. <A
+HREF="x7013.htm#VBI-525"
+>ITU-R 525 line numbering (M/NTSC and M/PAL)</A
+></DT
+><DT
+>4-3. <A
+HREF="x7013.htm#VBI-625"
+>ITU-R 625 line numbering</A
+></DT
+></DL
+></DIV
+><DIV
+CLASS="LOT"
+><DL
+CLASS="LOT"
+><DT
+><B
+>List of Examples</B
+></DT
+><DT
+>1-1. <A
+HREF="x309.htm#AEN328"
+>Information about the current video input</A
+></DT
+><DT
+>1-2. <A
+HREF="x309.htm#AEN336"
+>Switching to the first video input</A
+></DT
+><DT
+>1-3. <A
+HREF="x341.htm#AEN382"
+>Information about the current audio input</A
+></DT
+><DT
+>1-4. <A
+HREF="x341.htm#AEN388"
+>Switching to the first audio input</A
+></DT
+><DT
+>1-5. <A
+HREF="x448.htm#AEN510"
+>Information about the current video standard</A
+></DT
+><DT
+>1-6. <A
+HREF="x448.htm#AEN519"
+>Listing the video standards supported by the current
+input</A
+></DT
+><DT
+>1-7. <A
+HREF="x448.htm#AEN530"
+>Selecting a new video standard</A
+></DT
+><DT
+>1-8. <A
+HREF="x542.htm#AEN778"
+>Enumerating all controls</A
+></DT
+><DT
+>1-9. <A
+HREF="x542.htm#AEN789"
+>Changing controls</A
+></DT
+><DT
+>1-10. <A
+HREF="x1904.htm#AEN1972"
+>Resetting the cropping parameters</A
+></DT
+><DT
+>1-11. <A
+HREF="x1904.htm#AEN1983"
+>Simple downscaling</A
+></DT
+><DT
+>1-12. <A
+HREF="x1904.htm#AEN1991"
+>Selecting an output area</A
+></DT
+><DT
+>1-13. <A
+HREF="x1904.htm#AEN1996"
+>Current scaling factor and pixel aspect</A
+></DT
+><DT
+>2-1. <A
+HREF="x2123.htm#AEN2217"
+>ITU-R Rec. BT.601 color conversion</A
+></DT
+><DT
+>2-1. <A
+HREF="r2492.htm#AEN3061"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_BGR24</CODE
+> 4 &times; 4 pixel
+image</A
+></DT
+><DT
+>2-1. <A
+HREF="r3735.htm#AEN3746"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_SBGGR8</CODE
+> 4 &times; 4
+pixel image</A
+></DT
+><DT
+>2-1. <A
+HREF="r3796.htm#AEN3809"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_SBGGR16</CODE
+> 4 &times; 4
+pixel image</A
+></DT
+><DT
+>2-1. <A
+HREF="r4185.htm#AEN4196"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_GREY</CODE
+> 4 &times; 4
+pixel image</A
+></DT
+><DT
+>2-1. <A
+HREF="r4246.htm#AEN4257"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_Y16</CODE
+> 4 &times; 4
+pixel image</A
+></DT
+><DT
+>2-1. <A
+HREF="r4339.htm#AEN4351"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUYV</CODE
+> 4 &times; 4
+pixel image</A
+></DT
+><DT
+>2-1. <A
+HREF="r4484.htm#AEN4496"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_UYVY</CODE
+> 4 &times; 4
+pixel image</A
+></DT
+><DT
+>2-1. <A
+HREF="r4629.htm#AEN4645"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_Y41P</CODE
+> 8 &times; 4
+pixel image</A
+></DT
+><DT
+>2-1. <A
+HREF="r4850.htm#AEN4871"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YVU420</CODE
+> 4 &times; 4
+pixel image</A
+></DT
+><DT
+>2-1. <A
+HREF="r5016.htm#AEN5032"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YVU410</CODE
+> 4 &times; 4
+pixel image</A
+></DT
+><DT
+>2-1. <A
+HREF="r5154.htm#AEN5170"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUV422P</CODE
+> 4 &times; 4
+pixel image</A
+></DT
+><DT
+>2-1. <A
+HREF="r5319.htm#AEN5337"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUV411P</CODE
+> 4 &times; 4
+pixel image</A
+></DT
+><DT
+>2-1. <A
+HREF="r5470.htm#AEN5493"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_NV12</CODE
+> 4 &times; 4
+pixel image</A
+></DT
+><DT
+>3-1. <A
+HREF="x5791.htm#AEN5823"
+>Mapping buffers</A
+></DT
+><DT
+>3-2. <A
+HREF="x5884.htm#AEN5899"
+>Initiating streaming I/O with user pointers</A
+></DT
+><DT
+>4-1. <A
+HREF="x6909.htm#AEN6949"
+>Finding a framebuffer device for OSD</A
+></DT
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="f163.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Introduction</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r10104.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r10104.htm
new file mode 100644
index 0000000..c03c9bc
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r10104.htm
@@ -0,0 +1,424 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_G_CTRL, VIDIOC_S_CTRL</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_G_CROP, VIDIOC_S_CROP"
+HREF="r9994.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_G_ENC_INDEX"
+HREF="r10211.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r9994.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r10211.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-G-CTRL"
+></A
+>ioctl VIDIOC_G_CTRL, VIDIOC_S_CTRL</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN10108"
+></A
+><H2
+>Name</H2
+>VIDIOC_G_CTRL, VIDIOC_S_CTRL&nbsp;--&nbsp;Get or set the value of a control</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN10112"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN10113"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_control
+*argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN10123"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_G_CTRL, VIDIOC_S_CTRL</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN10143"
+></A
+><H2
+>Description</H2
+><P
+>To get the current value of a control applications
+initialize the <CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+> field of a struct
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_control</CODE
+> and call the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_CTRL</CODE
+> ioctl with a pointer to this
+structure. To change the value of a control applications initialize
+the <CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+> and <CODE
+CLASS="STRUCTFIELD"
+>value</CODE
+>
+fields of a struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_control</CODE
+> and call the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_CTRL</CODE
+> ioctl.</P
+><P
+>When the <CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+> is invalid drivers
+return an <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code. When the <CODE
+CLASS="STRUCTFIELD"
+>value</CODE
+> is out
+of bounds drivers can choose to take the closest valid value or return
+an <SPAN
+CLASS="ERRORCODE"
+>ERANGE</SPAN
+> error code, whatever seems more appropriate. However,
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_CTRL</CODE
+> is a write-only ioctl, it does not
+return the actual new value.</P
+><P
+>These ioctls work only with user controls. For other
+control classes the <A
+HREF="r10386.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_EXT_CTRLS</CODE
+></A
+>, <A
+HREF="r10386.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_EXT_CTRLS</CODE
+></A
+> or
+<A
+HREF="r10386.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_TRY_EXT_CTRLS</CODE
+></A
+> must be used.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-CONTROL"
+></A
+><P
+><B
+>Table 1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_control</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+></TD
+><TD
+>Identifies the control, set by the
+application.</TD
+></TR
+><TR
+><TD
+>__s32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>value</CODE
+></TD
+><TD
+>New value or current value.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN10185"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The struct&nbsp;<A
+HREF="r10104.htm#V4L2-CONTROL"
+>v4l2_control</A
+> <CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+> is
+invalid.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>ERANGE</SPAN
+></DT
+><DD
+><P
+>The struct&nbsp;<A
+HREF="r10104.htm#V4L2-CONTROL"
+>v4l2_control</A
+> <CODE
+CLASS="STRUCTFIELD"
+>value</CODE
+>
+is out of bounds.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+></DT
+><DD
+><P
+>The control is temporarily not changeable, possibly
+because another applications took over control of the device function
+this control belongs to.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r9994.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r10211.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_G_CROP, VIDIOC_S_CROP</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_G_ENC_INDEX</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r10211.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r10211.htm
new file mode 100644
index 0000000..9714c98
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r10211.htm
@@ -0,0 +1,625 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_G_ENC_INDEX</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_G_CTRL, VIDIOC_S_CTRL"
+HREF="r10104.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_G_EXT_CTRLS, VIDIOC_S_EXT_CTRLS,
+VIDIOC_TRY_EXT_CTRLS"
+HREF="r10386.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r10104.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r10386.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-G-ENC-INDEX"
+></A
+>ioctl VIDIOC_G_ENC_INDEX</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN10215"
+></A
+><H2
+>Name</H2
+>VIDIOC_G_ENC_INDEX&nbsp;--&nbsp;Get meta data about a compressed video stream</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN10218"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN10219"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_enc_idx *argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN10229"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_G_ENC_INDEX</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN10249"
+></A
+><H2
+>Description</H2
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Experimental: </B
+>This is an <A
+HREF="x16453.htm"
+>experimental</A
+>
+interface and may change in the future.</P
+></BLOCKQUOTE
+></DIV
+><P
+>The <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_ENC_INDEX</CODE
+> ioctl provides
+meta data about a compressed video stream the same or another
+application currently reads from the driver, which is useful for
+random access into the stream without decoding it.</P
+><P
+>To read the data applications must call
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_ENC_INDEX</CODE
+> with a pointer to a
+struct&nbsp;<A
+HREF="r10211.htm#V4L2-ENC-IDX"
+>v4l2_enc_idx</A
+>. On success the driver fills the
+<CODE
+CLASS="STRUCTFIELD"
+>entry</CODE
+> array, stores the number of elements
+written in the <CODE
+CLASS="STRUCTFIELD"
+>entries</CODE
+> field, and
+initializes the <CODE
+CLASS="STRUCTFIELD"
+>entries_cap</CODE
+> field.</P
+><P
+>Each element of the <CODE
+CLASS="STRUCTFIELD"
+>entry</CODE
+> array
+contains meta data about one picture. A
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_ENC_INDEX</CODE
+> call reads up to
+<CODE
+CLASS="CONSTANT"
+>V4L2_ENC_IDX_ENTRIES</CODE
+> entries from a driver
+buffer, which can hold up to <CODE
+CLASS="STRUCTFIELD"
+>entries_cap</CODE
+>
+entries. This number can be lower or higher than
+<CODE
+CLASS="CONSTANT"
+>V4L2_ENC_IDX_ENTRIES</CODE
+>, but not zero. When the
+application fails to read the meta data in time the oldest entries
+will be lost. When the buffer is empty or no capturing/encoding is in
+progress, <CODE
+CLASS="STRUCTFIELD"
+>entries</CODE
+> will be zero.</P
+><P
+>Currently this ioctl is only defined for MPEG-2 program
+streams and video elementary streams.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-ENC-IDX"
+></A
+><P
+><B
+>Table 1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_enc_idx</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>entries</CODE
+></TD
+><TD
+>The number of entries the driver stored in the
+<CODE
+CLASS="STRUCTFIELD"
+>entry</CODE
+> array.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>entries_cap</CODE
+></TD
+><TD
+>The number of entries the driver can
+buffer. Must be greater than zero.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+>[4]</TD
+><TD
+COLSPAN="3"
+>Reserved for future extensions.
+Drivers must set the array to zero.</TD
+></TR
+><TR
+><TD
+>struct&nbsp;<A
+HREF="r10211.htm#V4L2-ENC-IDX-ENTRY"
+>v4l2_enc_idx_entry</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>entry</CODE
+>[<CODE
+CLASS="CONSTANT"
+>V4L2_ENC_IDX_ENTRIES</CODE
+>]</TD
+><TD
+>Meta data about a compressed video stream. Each
+element of the array corresponds to one picture, sorted in ascending
+order by their <CODE
+CLASS="STRUCTFIELD"
+>offset</CODE
+>.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-ENC-IDX-ENTRY"
+></A
+><P
+><B
+>Table 2. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_enc_idx_entry</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u64</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>offset</CODE
+></TD
+><TD
+>The offset in bytes from the beginning of the
+compressed video stream to the beginning of this picture, that is a
+<I
+CLASS="WORDASWORD"
+>PES packet header</I
+> as defined in <A
+HREF="b17127.htm#MPEG2PART1"
+><ABBR
+CLASS="ABBREV"
+>ISO&nbsp;13818-1</ABBR
+></A
+> or a <I
+CLASS="WORDASWORD"
+>picture
+header</I
+> as defined in <A
+HREF="b17127.htm#MPEG2PART2"
+><ABBR
+CLASS="ABBREV"
+>ISO&nbsp;13818-2</ABBR
+></A
+>. When
+the encoder is stopped, the driver resets the offset to zero.</TD
+></TR
+><TR
+><TD
+>__u64</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>pts</CODE
+></TD
+><TD
+>The 33 bit <I
+CLASS="WORDASWORD"
+>Presentation Time
+Stamp</I
+> of this picture as defined in <A
+HREF="b17127.htm#MPEG2PART1"
+><ABBR
+CLASS="ABBREV"
+>ISO&nbsp;13818-1</ABBR
+></A
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>length</CODE
+></TD
+><TD
+>The length of this picture in bytes.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>flags</CODE
+></TD
+><TD
+>Flags containing the coding type of this picture, see <A
+HREF="r10211.htm#ENC-IDX-FLAGS"
+>Table 3</A
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+>[2]</TD
+><TD
+>Reserved for future extensions.
+Drivers must set the array to zero.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="ENC-IDX-FLAGS"
+></A
+><P
+><B
+>Table 3. Index Entry Flags</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_ENC_IDX_FRAME_I</CODE
+></TD
+><TD
+>0x00</TD
+><TD
+>This is an Intra-coded picture.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_ENC_IDX_FRAME_P</CODE
+></TD
+><TD
+>0x01</TD
+><TD
+>This is a Predictive-coded picture.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_ENC_IDX_FRAME_B</CODE
+></TD
+><TD
+>0x02</TD
+><TD
+>This is a Bidirectionally predictive-coded
+picture.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_ENC_IDX_FRAME_MASK</CODE
+></TD
+><TD
+>0x0F</TD
+><TD
+><I
+CLASS="WORDASWORD"
+>AND</I
+> the flags field with
+this mask to obtain the picture coding type.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN10374"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The driver does not support this ioctl.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r10104.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r10386.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_G_CTRL, VIDIOC_S_CTRL</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_G_EXT_CTRLS, VIDIOC_S_EXT_CTRLS,
+VIDIOC_TRY_EXT_CTRLS</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r10386.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r10386.htm
new file mode 100644
index 0000000..ed31f8b
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r10386.htm
@@ -0,0 +1,720 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_G_EXT_CTRLS, VIDIOC_S_EXT_CTRLS,
+VIDIOC_TRY_EXT_CTRLS</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_G_ENC_INDEX"
+HREF="r10211.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_G_FBUF, VIDIOC_S_FBUF"
+HREF="r10595.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r10211.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r10595.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-G-EXT-CTRLS"
+></A
+>ioctl VIDIOC_G_EXT_CTRLS, VIDIOC_S_EXT_CTRLS,
+VIDIOC_TRY_EXT_CTRLS</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN10390"
+></A
+><H2
+>Name</H2
+>VIDIOC_G_EXT_CTRLS, VIDIOC_S_EXT_CTRLS, VIDIOC_TRY_EXT_CTRLS&nbsp;--&nbsp;Get or set the value of several controls, try control
+values</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN10395"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN10396"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_ext_controls
+*argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN10406"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_G_EXT_CTRLS, VIDIOC_S_EXT_CTRLS,
+VIDIOC_TRY_EXT_CTRLS</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN10426"
+></A
+><H2
+>Description</H2
+><P
+>These ioctls allow the caller to get or set multiple
+controls atomically. Control IDs are grouped into control classes (see
+<A
+HREF="r10386.htm#CTRL-CLASS"
+>Table 3</A
+>) and all controls in the control array
+must belong to the same control class.</P
+><P
+>Applications must always fill in the
+<CODE
+CLASS="STRUCTFIELD"
+>count</CODE
+>,
+<CODE
+CLASS="STRUCTFIELD"
+>ctrl_class</CODE
+>,
+<CODE
+CLASS="STRUCTFIELD"
+>controls</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+> fields of struct&nbsp;<A
+HREF="r10386.htm#V4L2-EXT-CONTROLS"
+>v4l2_ext_controls</A
+>, and
+initialize the struct&nbsp;<A
+HREF="r10386.htm#V4L2-EXT-CONTROL"
+>v4l2_ext_control</A
+> array pointed to by the
+<CODE
+CLASS="STRUCTFIELD"
+>controls</CODE
+> fields.</P
+><P
+>To get the current value of a set of controls applications
+initialize the <CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+> field of each
+struct&nbsp;<A
+HREF="r10386.htm#V4L2-EXT-CONTROL"
+>v4l2_ext_control</A
+> and call the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_EXT_CTRLS</CODE
+> ioctl.</P
+><P
+>To change the value of a set of controls applications
+initialize the <CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>value</CODE
+> fields of a struct&nbsp;<A
+HREF="r10386.htm#V4L2-EXT-CONTROL"
+>v4l2_ext_control</A
+> and
+call the <CODE
+CLASS="CONSTANT"
+>VIDIOC_S_EXT_CTRLS</CODE
+> ioctl. The controls
+will only be set if <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>all</I
+></SPAN
+> control values are
+valid.</P
+><P
+>To check if the a set of controls have correct values
+applications initialize the <CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>value</CODE
+> fields of a struct&nbsp;<A
+HREF="r10386.htm#V4L2-EXT-CONTROL"
+>v4l2_ext_control</A
+> and
+call the <CODE
+CLASS="CONSTANT"
+>VIDIOC_TRY_EXT_CTRLS</CODE
+> ioctl. It is up to
+the driver whether wrong values are automatically adjusted to a valid
+value or if an error is returned.</P
+><P
+>When the <CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+> or
+<CODE
+CLASS="STRUCTFIELD"
+>ctrl_class</CODE
+> is invalid drivers return an
+<SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code. When the value is out of bounds drivers can choose to take
+the closest valid value or return an <SPAN
+CLASS="ERRORCODE"
+>ERANGE</SPAN
+> error code, whatever seems more
+appropriate. In the first case the new value is set in
+struct&nbsp;<A
+HREF="r10386.htm#V4L2-EXT-CONTROL"
+>v4l2_ext_control</A
+>.</P
+><P
+>The driver will only set/get these controls if all control
+values are correct. This prevents the situation where only some of the
+controls were set/get. Only low-level errors (e.&nbsp;g. a failed i2c
+command) can still cause this situation.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-EXT-CONTROL"
+></A
+><P
+><B
+>Table 1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_ext_control</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="20%"
+TITLE="C1"><COL
+WIDTH="20%"
+TITLE="C2"><COL
+WIDTH="20%"
+TITLE="C3"><COL
+WIDTH="40%"
+TITLE="C4"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>Identifies the control, set by the
+application.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reserved2</CODE
+>[2]</TD
+><TD
+>&nbsp;</TD
+><TD
+>Reserved for future extensions. Drivers and
+applications must set the array to zero.</TD
+></TR
+><TR
+><TD
+>union</TD
+><TD
+>(anonymous)</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>__s32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>value</CODE
+></TD
+><TD
+>New value or current value.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>__s64</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>value64</CODE
+></TD
+><TD
+>New value or current value.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>void *</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+></TD
+><TD
+>Reserved for future pointer-type controls. Currently unused.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-EXT-CONTROLS"
+></A
+><P
+><B
+>Table 2. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_ext_controls</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>ctrl_class</CODE
+></TD
+><TD
+>The control class to which all controls belong, see
+<A
+HREF="r10386.htm#CTRL-CLASS"
+>Table 3</A
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>count</CODE
+></TD
+><TD
+>The number of controls in the controls array. May
+also be zero.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>error_idx</CODE
+></TD
+><TD
+>Set by the driver in case of an error. It is the
+index of the control causing the error or equal to 'count' when the
+error is not associated with a particular control. Undefined when the
+ioctl returns 0 (success).</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+>[2]</TD
+><TD
+>Reserved for future extensions. Drivers and
+applications must set the array to zero.</TD
+></TR
+><TR
+><TD
+>struct&nbsp;<A
+HREF="r10386.htm#V4L2-EXT-CONTROL"
+>v4l2_ext_control</A
+> *</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>controls</CODE
+></TD
+><TD
+>Pointer to an array of
+<CODE
+CLASS="STRUCTFIELD"
+>count</CODE
+> v4l2_ext_control structures. Ignored
+if <CODE
+CLASS="STRUCTFIELD"
+>count</CODE
+> equals zero.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="CTRL-CLASS"
+></A
+><P
+><B
+>Table 3. Control classes</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_CLASS_USER</CODE
+></TD
+><TD
+>0x980000</TD
+><TD
+>The class containing user controls. These controls
+are described in <A
+HREF="x542.htm"
+>Section 1.8</A
+>. All controls that can be set
+using the <A
+HREF="r10104.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_CTRL</CODE
+></A
+> and <A
+HREF="r10104.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_CTRL</CODE
+></A
+> ioctl belong to this
+class.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_CLASS_MPEG</CODE
+></TD
+><TD
+>0x990000</TD
+><TD
+>The class containing MPEG compression controls.
+These controls are described in section <A
+HREF="x802.htm#MPEG-CONTROLS"
+>Section 1.9.5</A
+>.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN10565"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The struct&nbsp;<A
+HREF="r10386.htm#V4L2-EXT-CONTROL"
+>v4l2_ext_control</A
+> <CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+>
+is invalid or the struct&nbsp;<A
+HREF="r10386.htm#V4L2-EXT-CONTROLS"
+>v4l2_ext_controls</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>ctrl_class</CODE
+> is invalid. This error code is
+also returned by the <CODE
+CLASS="CONSTANT"
+>VIDIOC_S_EXT_CTRLS</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_TRY_EXT_CTRLS</CODE
+> ioctls if two or more
+control values are in conflict.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>ERANGE</SPAN
+></DT
+><DD
+><P
+>The struct&nbsp;<A
+HREF="r10386.htm#V4L2-EXT-CONTROL"
+>v4l2_ext_control</A
+> <CODE
+CLASS="STRUCTFIELD"
+>value</CODE
+>
+is out of bounds.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+></DT
+><DD
+><P
+>The control is temporarily not changeable, possibly
+because another applications took over control of the device function
+this control belongs to.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r10211.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r10595.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_G_ENC_INDEX</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_G_FBUF, VIDIOC_S_FBUF</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r10595.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r10595.htm
new file mode 100644
index 0000000..afda003
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r10595.htm
@@ -0,0 +1,1154 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_G_FBUF, VIDIOC_S_FBUF</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_G_EXT_CTRLS, VIDIOC_S_EXT_CTRLS,
+VIDIOC_TRY_EXT_CTRLS"
+HREF="r10386.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_G_FMT, VIDIOC_S_FMT,
+VIDIOC_TRY_FMT"
+HREF="r10944.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r10386.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r10944.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-G-FBUF"
+></A
+>ioctl VIDIOC_G_FBUF, VIDIOC_S_FBUF</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN10599"
+></A
+><H2
+>Name</H2
+>VIDIOC_G_FBUF, VIDIOC_S_FBUF&nbsp;--&nbsp;Get or set frame buffer overlay parameters</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN10603"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN10604"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_framebuffer *argp);</CODE
+></P
+><P
+></P
+></DIV
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN10614"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, const struct v4l2_framebuffer *argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN10624"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_G_FBUF, VIDIOC_S_FBUF</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN10644"
+></A
+><H2
+>Description</H2
+><P
+>Applications can use the <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FBUF</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FBUF</CODE
+> ioctl to get and set the
+framebuffer parameters for a <A
+HREF="x6570.htm"
+>Video
+Overlay</A
+> or <A
+HREF="x6909.htm"
+>Video Output Overlay</A
+>
+(OSD). The type of overlay is implied by the device type (capture or
+output device) and can be determined with the <A
+HREF="r13105.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCAP</CODE
+></A
+> ioctl.
+One <TT
+CLASS="FILENAME"
+>/dev/videoN</TT
+> device must not support both
+kinds of overlay.</P
+><P
+>The V4L2 API distinguishes destructive and non-destructive
+overlays. A destructive overlay copies captured video images into the
+video memory of a graphics card. A non-destructive overlay blends
+video images into a VGA signal or graphics into a video signal.
+<I
+CLASS="WORDASWORD"
+>Video Output Overlays</I
+> are always
+non-destructive.</P
+><P
+>To get the current parameters applications call the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FBUF</CODE
+> ioctl with a pointer to a
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_framebuffer</CODE
+> structure. The driver fills
+all fields of the structure or returns an <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code when overlays are
+not supported.</P
+><P
+>To set the parameters for a <I
+CLASS="WORDASWORD"
+>Video Output
+Overlay</I
+>, applications must initialize the
+<CODE
+CLASS="STRUCTFIELD"
+>flags</CODE
+> field of a struct
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_framebuffer</CODE
+>. Since the framebuffer is
+implemented on the TV card all other parameters are determined by the
+driver. When an application calls <CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FBUF</CODE
+>
+with a pointer to this structure, the driver prepares for the overlay
+and returns the framebuffer parameters as
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FBUF</CODE
+> does, or it returns an error
+code.</P
+><P
+>To set the parameters for a <I
+CLASS="WORDASWORD"
+>non-destructive
+Video Overlay</I
+>, applications must initialize the
+<CODE
+CLASS="STRUCTFIELD"
+>flags</CODE
+> field, the
+<CODE
+CLASS="STRUCTFIELD"
+>fmt</CODE
+> substructure, and call
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FBUF</CODE
+>. Again the driver prepares for the
+overlay and returns the framebuffer parameters as
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FBUF</CODE
+> does, or it returns an error
+code.</P
+><P
+>For a <I
+CLASS="WORDASWORD"
+>destructive Video Overlay</I
+>
+applications must additionally provide a
+<CODE
+CLASS="STRUCTFIELD"
+>base</CODE
+> address. Setting up a DMA to a
+random memory location can jeopardize the system security, its
+stability or even damage the hardware, therefore only the superuser
+can set the parameters for a destructive video overlay.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-FRAMEBUFFER"
+></A
+><P
+><B
+>Table 1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_framebuffer</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="20%"
+TITLE="C1"><COL
+WIDTH="20%"
+TITLE="C2"><COL
+WIDTH="20%"
+TITLE="C3"><COL
+WIDTH="40%"
+TITLE="C4"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>capability</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>Overlay capability flags set by the driver, see
+<A
+HREF="r10595.htm#FRAMEBUFFER-CAP"
+>Table 2</A
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>flags</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>Overlay control flags set by application and
+driver, see <A
+HREF="r10595.htm#FRAMEBUFFER-FLAGS"
+>Table 3</A
+></TD
+></TR
+><TR
+><TD
+>void *</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>base</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+><P
+>Physical base address of the framebuffer,
+that is the address of the pixel in the top left corner of the
+framebuffer.<SUP
+>a</SUP
+></P
+><P
+>This field is irrelevant to
+<I
+CLASS="WORDASWORD"
+>non-destructive Video Overlays</I
+>. For
+<I
+CLASS="WORDASWORD"
+>destructive Video Overlays</I
+> applications must
+provide a base address. The driver may accept only base addresses
+which are a multiple of two, four or eight bytes. For
+<I
+CLASS="WORDASWORD"
+>Video Output Overlays</I
+> the driver must return
+a valid base address, so applications can find the corresponding Linux
+framebuffer device (see <A
+HREF="x6909.htm"
+>Section 4.4</A
+>).</P
+></TD
+></TR
+><TR
+><TD
+>struct&nbsp;<A
+HREF="c2030.htm#V4L2-PIX-FORMAT"
+>v4l2_pix_format</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>fmt</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>Layout of the frame buffer. The
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_pix_format</CODE
+> structure is defined in <A
+HREF="c2030.htm"
+>Chapter 2</A
+>, for clarification the fields and acceptable values
+            are listed below:</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>width</CODE
+></TD
+><TD
+>Width of the frame buffer in pixels.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>height</CODE
+></TD
+><TD
+>Height of the frame buffer in pixels.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>pixelformat</CODE
+></TD
+><TD
+><P
+>The pixel format of the
+framebuffer.</P
+><P
+>For <I
+CLASS="WORDASWORD"
+>non-destructive Video
+Overlays</I
+> this field only defines a format for the
+struct&nbsp;<A
+HREF="x6570.htm#V4L2-WINDOW"
+>v4l2_window</A
+> <CODE
+CLASS="STRUCTFIELD"
+>chromakey</CODE
+>
+field.</P
+><P
+>For <I
+CLASS="WORDASWORD"
+>destructive Video
+Overlays</I
+> applications must initialize this field. For
+<I
+CLASS="WORDASWORD"
+>Video Output Overlays</I
+> the driver must return
+a valid format.</P
+><P
+>Usually this is an RGB format (for example
+<A
+HREF="r2492.htm#V4L2-PIX-FMT-RGB565"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_RGB565</CODE
+></A
+>) 
+but YUV formats (only packed YUV formats when chroma keying is used,
+not including <CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUYV</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_UYVY</CODE
+>) and the
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_PAL8</CODE
+> format are also permitted. The
+behavior of the driver when an application requests a compressed
+format is undefined. See <A
+HREF="c2030.htm"
+>Chapter 2</A
+> for information on
+pixel formats.</P
+></TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>enum&nbsp;<A
+HREF="x6386.htm#V4L2-FIELD"
+>v4l2_field</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>field</CODE
+></TD
+><TD
+>Drivers and applications shall ignore this field.
+If applicable, the field order is selected with the <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+>
+ioctl, using the <CODE
+CLASS="STRUCTFIELD"
+>field</CODE
+> field of
+struct&nbsp;<A
+HREF="x6570.htm#V4L2-WINDOW"
+>v4l2_window</A
+>.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>bytesperline</CODE
+></TD
+><TD
+>Distance in bytes between the leftmost pixels in
+two adjacent lines.</TD
+></TR
+><TR
+><TD
+COLSPAN="4"
+><P
+>This field is irrelevant to
+<I
+CLASS="WORDASWORD"
+>non-destructive Video
+Overlays</I
+>.</P
+><P
+>For <I
+CLASS="WORDASWORD"
+>destructive Video
+Overlays</I
+> both applications and drivers can set this field
+to request padding bytes at the end of each line. Drivers however may
+ignore the requested value, returning <CODE
+CLASS="STRUCTFIELD"
+>width</CODE
+>
+times bytes-per-pixel or a larger value required by the hardware. That
+implies applications can just set this field to zero to get a
+reasonable default.</P
+><P
+>For <I
+CLASS="WORDASWORD"
+>Video Output
+Overlays</I
+> the driver must return a valid
+value.</P
+><P
+>Video hardware may access padding bytes, therefore
+they must reside in accessible memory. Consider for example the case
+where padding bytes after the last line of an image cross a system
+page boundary. Capture devices may write padding bytes, the value is
+undefined. Output devices ignore the contents of padding
+bytes.</P
+><P
+>When the image format is planar the
+<CODE
+CLASS="STRUCTFIELD"
+>bytesperline</CODE
+> value applies to the largest
+plane and is divided by the same factor as the
+<CODE
+CLASS="STRUCTFIELD"
+>width</CODE
+> field for any smaller planes. For
+example the Cb and Cr planes of a YUV 4:2:0 image have half as many
+padding bytes following each line as the Y plane. To avoid ambiguities
+drivers must return a <CODE
+CLASS="STRUCTFIELD"
+>bytesperline</CODE
+> value
+rounded up to a multiple of the scale factor.</P
+></TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>sizeimage</CODE
+></TD
+><TD
+><P
+>This field is irrelevant to
+<I
+CLASS="WORDASWORD"
+>non-destructive Video Overlays</I
+>. For
+<I
+CLASS="WORDASWORD"
+>destructive Video Overlays</I
+> applications must
+initialize this field. For <I
+CLASS="WORDASWORD"
+>Video Output
+Overlays</I
+> the driver must return a valid
+format.</P
+><P
+>Together with <CODE
+CLASS="STRUCTFIELD"
+>base</CODE
+> it
+defines the framebuffer memory accessible by the
+driver.</P
+></TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>enum&nbsp;<A
+HREF="x2123.htm#V4L2-COLORSPACE"
+>v4l2_colorspace</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>colorspace</CODE
+></TD
+><TD
+>This information supplements the
+<CODE
+CLASS="STRUCTFIELD"
+>pixelformat</CODE
+> and must be set by the driver,
+see <A
+HREF="x2123.htm"
+>Section 2.2</A
+>.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>priv</CODE
+></TD
+><TD
+>Reserved for additional information about custom
+(driver defined) formats. When not used drivers and applications must
+set this field to zero.</TD
+></TR
+></TBODY
+><TR
+><TD
+COLSPAN="4"
+>Notes:<BR><A
+NAME="FTN.AEN10706"
+>a. </A
+>A physical base address may not suit all
+platforms. GK notes in theory we should pass something like PCI device
++ memory region + offset instead. If you encounter problems please
+discuss on the Video4Linux mailing list:
+<A
+HREF="https://listman.redhat.com/mailman/listinfo/video4linux-list"
+TARGET="_top"
+>https://listman.redhat.com/mailman/listinfo/video4linux-list</A
+>.<BR></TD
+></TR
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="FRAMEBUFFER-CAP"
+></A
+><P
+><B
+>Table 2. Frame Buffer Capability Flags</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_CAP_EXTERNOVERLAY</CODE
+></TD
+><TD
+>0x0001</TD
+><TD
+>The device is capable of non-destructive overlays.
+When the driver clears this flag, only destructive overlays are
+supported. There are no drivers yet which support both destructive and
+non-destructive overlays.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_CAP_CHROMAKEY</CODE
+></TD
+><TD
+>0x0002</TD
+><TD
+>The device supports clipping by chroma-keying the
+images. That is, image pixels replace pixels in the VGA or video
+signal only where the latter assume a certain color. Chroma-keying
+makes no sense for destructive overlays.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_CAP_LIST_CLIPPING</CODE
+></TD
+><TD
+>0x0004</TD
+><TD
+>The device supports clipping using a list of clip
+rectangles.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_CAP_BITMAP_CLIPPING</CODE
+></TD
+><TD
+>0x0008</TD
+><TD
+>The device supports clipping using a bit mask.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_CAP_LOCAL_ALPHA</CODE
+></TD
+><TD
+>0x0010</TD
+><TD
+>The device supports clipping/blending using the
+alpha channel of the framebuffer or VGA signal. Alpha blending makes
+no sense for destructive overlays.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_CAP_GLOBAL_ALPHA</CODE
+></TD
+><TD
+>0x0020</TD
+><TD
+>The device supports alpha blending using a global
+alpha value. Alpha blending makes no sense for destructive overlays.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_CAP_LOCAL_INV_ALPHA</CODE
+></TD
+><TD
+>0x0040</TD
+><TD
+>The device supports clipping/blending using the
+inverted alpha channel of the framebuffer or VGA signal. Alpha
+blending makes no sense for destructive overlays.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="FRAMEBUFFER-FLAGS"
+></A
+><P
+><B
+>Table 3. Frame Buffer Flags</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_FLAG_PRIMARY</CODE
+></TD
+><TD
+>0x0001</TD
+><TD
+>The framebuffer is the primary graphics surface.
+In other words, the overlay is destructive. [?]</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_FLAG_OVERLAY</CODE
+></TD
+><TD
+>0x0002</TD
+><TD
+>The frame buffer is an overlay surface the same
+size as the capture. [?]</TD
+></TR
+><TR
+><TD
+COLSPAN="3"
+>The purpose of
+<CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_FLAG_PRIMARY</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_FLAG_OVERLAY</CODE
+> was never quite clear.
+Most drivers seem to ignore these flags. For compatibility with the
+<I
+CLASS="WORDASWORD"
+>bttv</I
+> driver applications should set the
+<CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_FLAG_OVERLAY</CODE
+> flag.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_FLAG_CHROMAKEY</CODE
+></TD
+><TD
+>0x0004</TD
+><TD
+>Use chroma-keying. The chroma-key color is
+determined by the <CODE
+CLASS="STRUCTFIELD"
+>chromakey</CODE
+> field of
+struct&nbsp;<A
+HREF="x6570.htm#V4L2-WINDOW"
+>v4l2_window</A
+> and negotiated with the <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctl, see <A
+HREF="x6570.htm"
+>Section 4.2</A
+>
+and
+            <A
+HREF="x6909.htm"
+>Section 4.4</A
+>.</TD
+></TR
+><TR
+><TD
+COLSPAN="3"
+>There are no flags to enable
+clipping using a list of clip rectangles or a bitmap. These methods
+are negotiated with the <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctl, see <A
+HREF="x6570.htm"
+>Section 4.2</A
+> and <A
+HREF="x6909.htm"
+>Section 4.4</A
+>.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_FLAG_LOCAL_ALPHA</CODE
+></TD
+><TD
+>0x0008</TD
+><TD
+>Use the alpha channel of the framebuffer to clip or
+blend framebuffer pixels with video images. The blend
+function is: output = framebuffer pixel * alpha + video pixel * (1 -
+alpha). The actual alpha depth depends on the framebuffer pixel
+format.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_FLAG_GLOBAL_ALPHA</CODE
+></TD
+><TD
+>0x0010</TD
+><TD
+>Use a global alpha value to blend the framebuffer
+with video images. The blend function is: output = (framebuffer pixel
+* alpha + video pixel * (255 - alpha)) / 255. The alpha value is
+determined by the <CODE
+CLASS="STRUCTFIELD"
+>global_alpha</CODE
+> field of
+struct&nbsp;<A
+HREF="x6570.htm#V4L2-WINDOW"
+>v4l2_window</A
+> and negotiated with the <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctl, see <A
+HREF="x6570.htm"
+>Section 4.2</A
+>
+and <A
+HREF="x6909.htm"
+>Section 4.4</A
+>.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_FLAG_LOCAL_INV_ALPHA</CODE
+></TD
+><TD
+>0x0020</TD
+><TD
+>Like
+<CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_FLAG_LOCAL_ALPHA</CODE
+>, use the alpha channel
+of the framebuffer to clip or blend framebuffer pixels with video
+images, but with an inverted alpha value. The blend function is:
+output = framebuffer pixel * (1 - alpha) + video pixel * alpha. The
+actual alpha depth depends on the framebuffer pixel format.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN10920"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EPERM</SPAN
+></DT
+><DD
+><P
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FBUF</CODE
+> can only be called
+by a privileged user to negotiate the parameters for a destructive
+overlay.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+></DT
+><DD
+><P
+>The framebuffer parameters cannot be changed at this
+time because overlay is already enabled, or capturing is enabled
+and the hardware cannot capture and overlay simultaneously.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The ioctl is not supported or the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FBUF</CODE
+> parameters are unsuitable.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r10386.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r10944.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_G_EXT_CTRLS, VIDIOC_S_EXT_CTRLS,
+VIDIOC_TRY_EXT_CTRLS</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_G_FMT, VIDIOC_S_FMT,
+VIDIOC_TRY_FMT</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r10944.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r10944.htm
new file mode 100644
index 0000000..0f53919
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r10944.htm
@@ -0,0 +1,575 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_G_FMT, VIDIOC_S_FMT,
+VIDIOC_TRY_FMT</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_G_FBUF, VIDIOC_S_FBUF"
+HREF="r10595.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY"
+HREF="r11094.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r10595.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r11094.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-G-FMT"
+></A
+>ioctl VIDIOC_G_FMT, VIDIOC_S_FMT,
+VIDIOC_TRY_FMT</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN10948"
+></A
+><H2
+>Name</H2
+>VIDIOC_G_FMT, VIDIOC_S_FMT, VIDIOC_TRY_FMT&nbsp;--&nbsp;Get or set the data format, try a format</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN10953"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN10954"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_format
+*argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN10964"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_G_FMT, VIDIOC_S_FMT, VIDIOC_TRY_FMT</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN10984"
+></A
+><H2
+>Description</H2
+><P
+>These ioctls are used to negotiate the format of data
+(typically image format) exchanged between driver and
+application.</P
+><P
+>To query the current parameters applications set the
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field of a struct
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_format</CODE
+> to the respective buffer (stream)
+type. For example video capture devices use
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_CAPTURE</CODE
+>. When the application
+calls the <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+> ioctl with a pointer to
+this structure the driver fills the respective member of the
+<CODE
+CLASS="STRUCTFIELD"
+>fmt</CODE
+> union. In case of video capture devices
+that is the struct&nbsp;<A
+HREF="c2030.htm#V4L2-PIX-FORMAT"
+>v4l2_pix_format</A
+> <CODE
+CLASS="STRUCTFIELD"
+>pix</CODE
+> member.
+When the requested buffer type is not supported drivers return an
+<SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code.</P
+><P
+>To change the current format parameters applications
+initialize the <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field and all
+fields of the respective <CODE
+CLASS="STRUCTFIELD"
+>fmt</CODE
+>
+union member. For details see the documentation of the various devices
+types in <A
+HREF="c6488.htm"
+>Chapter 4</A
+>. Good practice is to query the
+current parameters first, and to
+modify only those parameters not suitable for the application. When
+the application calls the <CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+> ioctl
+with a pointer to a <CODE
+CLASS="STRUCTNAME"
+>v4l2_format</CODE
+> structure
+the driver checks
+and adjusts the parameters against hardware abilities. Drivers
+should not return an error code unless the input is ambiguous, this is
+a mechanism to fathom device capabilities and to approach parameters
+acceptable for both the application and driver. On success the driver
+may program the hardware, allocate resources and generally prepare for
+data exchange.
+Finally the <CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+> ioctl returns the
+current format parameters as <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+> does.
+Very simple, inflexible devices may even ignore all input and always
+return the default parameters. However all V4L2 devices exchanging
+data with the application must implement the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+> ioctl. When the requested buffer
+type is not supported drivers return an <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code on a
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+> attempt. When I/O is already in
+progress or the resource is not available for other reasons drivers
+return the <SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+> error code.</P
+><P
+>The <CODE
+CLASS="CONSTANT"
+>VIDIOC_TRY_FMT</CODE
+> ioctl is equivalent
+to <CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+> with one exception: it does not
+change driver state. It can also be called at any time, never
+returning <SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+>. This function is provided to
+negotiate parameters, to learn about hardware limitations, without
+disabling I/O or possibly time consuming hardware preparations.
+Although strongly recommended drivers are not required to implement
+this ioctl.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-FORMAT"
+></A
+><P
+><B
+>Table 1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_format</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="25%"
+TITLE="C3"><COL
+WIDTH="25%"
+TITLE="C4"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>enum&nbsp;<A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>Type of the data stream, see <A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>Table 3-2</A
+>.</TD
+></TR
+><TR
+><TD
+>union</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>fmt</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>struct&nbsp;<A
+HREF="c2030.htm#V4L2-PIX-FORMAT"
+>v4l2_pix_format</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>pix</CODE
+></TD
+><TD
+>Definition of an image format, see <A
+HREF="c2030.htm"
+>Chapter 2</A
+>, used by video capture and output
+devices.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>struct&nbsp;<A
+HREF="x6570.htm#V4L2-WINDOW"
+>v4l2_window</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>win</CODE
+></TD
+><TD
+>Definition of an overlaid image, see <A
+HREF="x6570.htm"
+>Section 4.2</A
+>, used by video overlay devices.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>struct&nbsp;<A
+HREF="x7013.htm#V4L2-VBI-FORMAT"
+>v4l2_vbi_format</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>vbi</CODE
+></TD
+><TD
+>Raw VBI capture or output parameters. This is
+discussed in more detail in <A
+HREF="x7013.htm"
+>Section 4.7</A
+>. Used by raw VBI
+capture and output devices.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>struct&nbsp;<A
+HREF="x7236.htm#V4L2-SLICED-VBI-FORMAT"
+>v4l2_sliced_vbi_format</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>sliced</CODE
+></TD
+><TD
+>Sliced VBI capture or output parameters. See
+<A
+HREF="x7236.htm"
+>Section 4.8</A
+> for details. Used by sliced VBI
+capture and output devices.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>__u8</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>raw_data</CODE
+>[200]</TD
+><TD
+>Place holder for future extensions and custom
+(driver defined) formats with <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+>
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_PRIVATE</CODE
+> and higher.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN11074"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+></DT
+><DD
+><P
+>The data format cannot be changed at this
+time, for example because I/O is already in progress.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The struct&nbsp;<A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+> <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+>
+field is invalid, the requested buffer type not supported, or
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_TRY_FMT</CODE
+> was called and is not
+supported with this buffer type.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r10595.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r11094.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_G_FBUF, VIDIOC_S_FBUF</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r11094.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r11094.htm
new file mode 100644
index 0000000..9068f63
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r11094.htm
@@ -0,0 +1,477 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_G_FMT, VIDIOC_S_FMT,
+VIDIOC_TRY_FMT"
+HREF="r10944.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT"
+HREF="r11217.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r10944.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r11217.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-G-FREQUENCY"
+></A
+>ioctl VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN11098"
+></A
+><H2
+>Name</H2
+>VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY&nbsp;--&nbsp;Get or set tuner or modulator radio
+frequency</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN11102"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN11103"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_frequency
+*argp);</CODE
+></P
+><P
+></P
+></DIV
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN11113"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, const struct v4l2_frequency
+*argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN11123"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN11143"
+></A
+><H2
+>Description</H2
+><P
+>To get the current tuner or modulator radio frequency
+applications set the <CODE
+CLASS="STRUCTFIELD"
+>tuner</CODE
+> field of a
+struct&nbsp;<A
+HREF="r11094.htm#V4L2-FREQUENCY"
+>v4l2_frequency</A
+> to the respective tuner or modulator number (only
+input devices have tuners, only output devices have modulators), zero
+out the <CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+> array and
+call the <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FREQUENCY</CODE
+> ioctl with a pointer
+to this structure. The driver stores the current frequency in the
+<CODE
+CLASS="STRUCTFIELD"
+>frequency</CODE
+> field.</P
+><P
+>To change the current tuner or modulator radio frequency
+applications initialize the <CODE
+CLASS="STRUCTFIELD"
+>tuner</CODE
+>,
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>frequency</CODE
+> fields, and the
+<CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+> array of a struct&nbsp;<A
+HREF="r11094.htm#V4L2-FREQUENCY"
+>v4l2_frequency</A
+> and
+call the <CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FREQUENCY</CODE
+> ioctl with a pointer
+to this structure. When the requested frequency is not possible the
+driver assumes the closest possible value. However
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FREQUENCY</CODE
+> is a write-only ioctl, it does
+not return the actual new frequency.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-FREQUENCY"
+></A
+><P
+><B
+>Table 1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_frequency</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>tuner</CODE
+></TD
+><TD
+>The tuner or modulator index number. This is the
+same value as in the struct&nbsp;<A
+HREF="r8936.htm#V4L2-INPUT"
+>v4l2_input</A
+> <CODE
+CLASS="STRUCTFIELD"
+>tuner</CODE
+>
+field and the struct&nbsp;<A
+HREF="r12342.htm#V4L2-TUNER"
+>v4l2_tuner</A
+> <CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+> field, or
+the struct&nbsp;<A
+HREF="r9149.htm#V4L2-OUTPUT"
+>v4l2_output</A
+> <CODE
+CLASS="STRUCTFIELD"
+>modulator</CODE
+> field and the
+struct&nbsp;<A
+HREF="r11430.htm#V4L2-MODULATOR"
+>v4l2_modulator</A
+> <CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+> field.</TD
+></TR
+><TR
+><TD
+>enum&nbsp;<A
+HREF="r12342.htm#V4L2-TUNER-TYPE"
+>v4l2_tuner_type</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+></TD
+><TD
+>The tuner type. This is the same value as in the
+struct&nbsp;<A
+HREF="r12342.htm#V4L2-TUNER"
+>v4l2_tuner</A
+> <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field. The field is not
+applicable to modulators, i.&nbsp;e. ignored by drivers.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>frequency</CODE
+></TD
+><TD
+>Tuning frequency in units of 62.5 kHz, or if the
+struct&nbsp;<A
+HREF="r12342.htm#V4L2-TUNER"
+>v4l2_tuner</A
+> or struct&nbsp;<A
+HREF="r11430.htm#V4L2-MODULATOR"
+>v4l2_modulator</A
+> <CODE
+CLASS="STRUCTFIELD"
+>capabilities</CODE
+> flag
+<CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_CAP_LOW</CODE
+> is set, in units of 62.5
+Hz.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+>[8];</TD
+><TD
+>Reserved for future extensions. Drivers and
+            applications must set the array to zero.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN11203"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The <CODE
+CLASS="STRUCTFIELD"
+>tuner</CODE
+> index is out of
+bounds or the value in the <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field is
+wrong.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r10944.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r11217.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_G_FMT, VIDIOC_S_FMT,
+VIDIOC_TRY_FMT</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r11217.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r11217.htm
new file mode 100644
index 0000000..aa4d73e
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r11217.htm
@@ -0,0 +1,315 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY"
+HREF="r11094.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_G_JPEGCOMP, VIDIOC_S_JPEGCOMP"
+HREF="r11285.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r11094.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r11285.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-G-INPUT"
+></A
+>ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN11221"
+></A
+><H2
+>Name</H2
+>VIDIOC_G_INPUT, VIDIOC_S_INPUT&nbsp;--&nbsp;Query or select the current video input</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN11225"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN11226"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, int *argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN11236"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_G_INPUT, VIDIOC_S_INPUT</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN11256"
+></A
+><H2
+>Description</H2
+><P
+>To query the current video input applications call the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_INPUT</CODE
+> ioctl with a pointer to an integer
+where the driver stores the number of the input, as in the
+struct&nbsp;<A
+HREF="r8936.htm#V4L2-INPUT"
+>v4l2_input</A
+> <CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+> field. This ioctl will
+fail only when there are no video inputs, returning
+<SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+>.</P
+><P
+>To select a video input applications store the number of the
+desired input in an integer and call the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_INPUT</CODE
+> ioctl with a pointer to this
+integer. Side effects are possible. For example inputs may support
+different video standards, so the driver may implicitly switch the
+current standard. It is good practice to select an input before
+querying or negotiating any other parameters.</P
+><P
+>Information about video inputs is available using the
+<A
+HREF="r8936.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMINPUT</CODE
+></A
+> ioctl.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN11268"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The number of the video input is out of bounds, or
+there are no video inputs at all and this ioctl is not
+supported.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+></DT
+><DD
+><P
+>I/O is in progress, the input cannot be
+switched.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r11094.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r11285.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_G_JPEGCOMP, VIDIOC_S_JPEGCOMP</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r11285.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r11285.htm
new file mode 100644
index 0000000..39c0351
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r11285.htm
@@ -0,0 +1,485 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_G_JPEGCOMP, VIDIOC_S_JPEGCOMP</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT"
+HREF="r11217.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_G_MODULATOR, VIDIOC_S_MODULATOR"
+HREF="r11430.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r11217.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r11430.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-G-JPEGCOMP"
+></A
+>ioctl VIDIOC_G_JPEGCOMP, VIDIOC_S_JPEGCOMP</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN11289"
+></A
+><H2
+>Name</H2
+>VIDIOC_G_JPEGCOMP, VIDIOC_S_JPEGCOMP&nbsp;--&nbsp;</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN11293"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN11294"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, v4l2_jpegcompression *argp);</CODE
+></P
+><P
+></P
+></DIV
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN11304"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, const v4l2_jpegcompression *argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN11314"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_G_JPEGCOMP, VIDIOC_S_JPEGCOMP</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN11334"
+></A
+><H2
+>Description</H2
+><P
+>[to do]</P
+><P
+>Ronald Bultje elaborates:</P
+><P
+>APP is some application-specific information. The
+application can set it itself, and it'll be stored in the JPEG-encoded
+fields (eg; interlacing information for in an AVI or so). COM is the
+same, but it's comments, like 'encoded by me' or so.</P
+><P
+>jpeg_markers describes whether the huffman tables,
+quantization tables and the restart interval information (all
+JPEG-specific stuff) should be stored in the JPEG-encoded fields.
+These define how the JPEG field is encoded. If you omit them,
+applications assume you've used standard encoding. You usually do want
+to add them.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-JPEGCOMPRESSION"
+></A
+><P
+><B
+>Table 1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_jpegcompression</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>int</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>quality</CODE
+></TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>int</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>APPn</CODE
+></TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>int</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>APP_len</CODE
+></TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>char</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>APP_data</CODE
+>[60]</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>int</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>COM_len</CODE
+></TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>char</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>COM_data</CODE
+>[60]</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>jpeg_markers</CODE
+></TD
+><TD
+>See <A
+HREF="r11285.htm#JPEG-MARKERS"
+>Table 2</A
+>.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="JPEG-MARKERS"
+></A
+><P
+><B
+>Table 2. JPEG Markers Flags</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_JPEG_MARKER_DHT</CODE
+></TD
+><TD
+>(1&lt;&lt;3)</TD
+><TD
+>Define Huffman Tables</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_JPEG_MARKER_DQT</CODE
+></TD
+><TD
+>(1&lt;&lt;4)</TD
+><TD
+>Define Quantization Tables</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_JPEG_MARKER_DRI</CODE
+></TD
+><TD
+>(1&lt;&lt;5)</TD
+><TD
+>Define Restart Interval</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_JPEG_MARKER_COM</CODE
+></TD
+><TD
+>(1&lt;&lt;6)</TD
+><TD
+>Comment segment</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_JPEG_MARKER_APP</CODE
+></TD
+><TD
+>(1&lt;&lt;7)</TD
+><TD
+>App segment, driver will always use APP0</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN11418"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>This ioctl is not supported.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r11217.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r11430.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_G_MODULATOR, VIDIOC_S_MODULATOR</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r11430.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r11430.htm
new file mode 100644
index 0000000..5968bd7
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r11430.htm
@@ -0,0 +1,665 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_G_MODULATOR, VIDIOC_S_MODULATOR</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_G_JPEGCOMP, VIDIOC_S_JPEGCOMP"
+HREF="r11285.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT"
+HREF="r11612.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r11285.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r11612.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-G-MODULATOR"
+></A
+>ioctl VIDIOC_G_MODULATOR, VIDIOC_S_MODULATOR</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN11434"
+></A
+><H2
+>Name</H2
+>VIDIOC_G_MODULATOR, VIDIOC_S_MODULATOR&nbsp;--&nbsp;Get or set modulator attributes</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN11438"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN11439"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_modulator
+*argp);</CODE
+></P
+><P
+></P
+></DIV
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN11449"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, const struct v4l2_modulator
+*argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN11459"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_G_MODULATOR, VIDIOC_S_MODULATOR</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN11479"
+></A
+><H2
+>Description</H2
+><P
+>To query the attributes of a modulator applications initialize
+the <CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+> field and zero out the
+<CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+> array of a struct&nbsp;<A
+HREF="r11430.htm#V4L2-MODULATOR"
+>v4l2_modulator</A
+> and
+call the <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_MODULATOR</CODE
+> ioctl with a pointer
+to this structure. Drivers fill the rest of the structure or return an
+<SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code when the index is out of bounds. To enumerate all modulators
+applications shall begin at index zero, incrementing by one until the
+driver returns <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+>.</P
+><P
+>Modulators have two writable properties, an audio
+modulation set and the radio frequency. To change the modulated audio
+subprograms, applications initialize the <CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+> and <CODE
+CLASS="STRUCTFIELD"
+>txsubchans</CODE
+> fields and the
+<CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+> array and call the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_MODULATOR</CODE
+> ioctl. Drivers may choose a
+different audio modulation if the request cannot be satisfied. However
+this is a write-only ioctl, it does not return the actual audio
+modulation selected.</P
+><P
+>To change the radio frequency the <A
+HREF="r11094.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FREQUENCY</CODE
+></A
+> ioctl
+is available.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-MODULATOR"
+></A
+><P
+><B
+>Table 1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_modulator</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+></TD
+><TD
+>Identifies the modulator, set by the
+application.</TD
+></TR
+><TR
+><TD
+>__u8</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>name</CODE
+>[32]</TD
+><TD
+>Name of the modulator, a NUL-terminated ASCII
+string. This information is intended for the user.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>capability</CODE
+></TD
+><TD
+>Modulator capability flags. No flags are defined
+for this field, the tuner flags in struct&nbsp;<A
+HREF="r12342.htm#V4L2-TUNER"
+>v4l2_tuner</A
+>
+are used accordingly. The audio flags indicate the ability
+to encode audio subprograms. They will <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>not</I
+></SPAN
+>
+change for example with the current video standard.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>rangelow</CODE
+></TD
+><TD
+>The lowest tunable frequency in units of 62.5
+KHz, or if the <CODE
+CLASS="STRUCTFIELD"
+>capability</CODE
+> flag
+<CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_CAP_LOW</CODE
+> is set, in units of 62.5
+Hz.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>rangehigh</CODE
+></TD
+><TD
+>The highest tunable frequency in units of 62.5
+KHz, or if the <CODE
+CLASS="STRUCTFIELD"
+>capability</CODE
+> flag
+<CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_CAP_LOW</CODE
+> is set, in units of 62.5
+Hz.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>txsubchans</CODE
+></TD
+><TD
+>With this field applications can determine how
+audio sub-carriers shall be modulated. It contains a set of flags as
+defined in <A
+HREF="r11430.htm#MODULATOR-TXSUBCHANS"
+>Table 2</A
+>. Note the tuner
+<CODE
+CLASS="STRUCTFIELD"
+>rxsubchans</CODE
+> flags are reused, but the
+semantics are different. Video output devices are assumed to have an
+analog or PCM audio input with 1-3 channels. The
+<CODE
+CLASS="STRUCTFIELD"
+>txsubchans</CODE
+> flags select one or more
+channels for modulation, together with some audio subprogram
+indicator, for example a stereo pilot tone.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+>[4]</TD
+><TD
+>Reserved for future extensions. Drivers and
+applications must set the array to zero.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="MODULATOR-TXSUBCHANS"
+></A
+><P
+><B
+>Table 2. Modulator Audio Transmission Flags</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_MONO</CODE
+></TD
+><TD
+>0x0001</TD
+><TD
+>Modulate channel 1 as mono audio, when the input
+has more channels, a down-mix of channel 1 and 2. This flag does not
+combine with <CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_STEREO</CODE
+> or
+<CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_LANG1</CODE
+>.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_STEREO</CODE
+></TD
+><TD
+>0x0002</TD
+><TD
+>Modulate channel 1 and 2 as left and right
+channel of a stereo audio signal. When the input has only one channel
+or two channels and <CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_SAP</CODE
+> is also
+set, channel 1 is encoded as left and right channel. This flag does
+not combine with <CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_MONO </CODE
+> or
+<CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_LANG1</CODE
+>. When the driver does not
+support stereo audio it shall fall back to mono.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_LANG1</CODE
+></TD
+><TD
+>0x0008</TD
+><TD
+>Modulate channel 1 and 2 as primary and secondary
+language of a bilingual audio signal. When the input has only one
+channel it is used for both languages. It is not possible to encode
+the primary or secondary language only. This flag does not combine
+with <CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_MONO </CODE
+> or
+<CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_STEREO</CODE
+>. If the hardware does not
+support the respective audio matrix, or the current video standard
+does not permit bilingual audio the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_MODULATOR</CODE
+> ioctl shall return an <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code
+and the driver shall fall back to mono or stereo mode.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_LANG2</CODE
+></TD
+><TD
+>0x0004</TD
+><TD
+>Same effect as
+<CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_LANG1</CODE
+>.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_SAP</CODE
+></TD
+><TD
+>0x0004</TD
+><TD
+>When combined with <CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_MONO</CODE
+> the first channel is encoded as mono audio, the last
+channel as Second Audio Program. When the input has only one channel
+it is used for both audio tracks. When the input has three channels
+the mono track is a down-mix of channel 1 and 2. When combined with
+<CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_STEREO </CODE
+> channel 1 and 2 are
+encoded as left and right stereo audio, channel 3 as Second Audio
+Program. When the input has only two channels, the first is encoded as
+left and right channel and the second as SAP. When the input has only
+one channel it is used for all audio tracks. It is not possible to
+encode a Second Audio Program only. This flag must combine with
+<CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_MONO</CODE
+> or
+<CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_STEREO</CODE
+>. If the hardware does not
+support the respective audio matrix, or the current video standard
+does not permit SAP the <CODE
+CLASS="CONSTANT"
+> VIDIOC_S_MODULATOR</CODE
+> ioctl
+shall return an <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code and driver shall fall back to mono or stereo
+mode.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN11598"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The struct&nbsp;<A
+HREF="r11430.htm#V4L2-MODULATOR"
+>v4l2_modulator</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+> is out of bounds.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r11285.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r11612.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_G_JPEGCOMP, VIDIOC_S_JPEGCOMP</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r11612.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r11612.htm
new file mode 100644
index 0000000..0d407dd
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r11612.htm
@@ -0,0 +1,315 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_G_MODULATOR, VIDIOC_S_MODULATOR"
+HREF="r11430.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_G_PARM, VIDIOC_S_PARM"
+HREF="r11680.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r11430.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r11680.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-G-OUTPUT"
+></A
+>ioctl VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN11616"
+></A
+><H2
+>Name</H2
+>VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT&nbsp;--&nbsp;Query or select the current video output</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN11620"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN11621"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, int *argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN11631"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN11651"
+></A
+><H2
+>Description</H2
+><P
+>To query the current video output applications call the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_OUTPUT</CODE
+> ioctl with a pointer to an integer
+where the driver stores the number of the output, as in the
+struct&nbsp;<A
+HREF="r9149.htm#V4L2-OUTPUT"
+>v4l2_output</A
+> <CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+> field. This ioctl
+will fail only when there are no video outputs, returning the
+<SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code.</P
+><P
+>To select a video output applications store the number of the
+desired output in an integer and call the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_OUTPUT</CODE
+> ioctl with a pointer to this integer.
+Side effects are possible. For example outputs may support different
+video standards, so the driver may implicitly switch the current
+standard. It is good practice to select an output before querying or
+negotiating any other parameters.</P
+><P
+>Information about video outputs is available using the
+<A
+HREF="r9149.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMOUTPUT</CODE
+></A
+> ioctl.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN11663"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The number of the video output is out of bounds, or
+there are no video outputs at all and this ioctl is not
+supported.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+></DT
+><DD
+><P
+>I/O is in progress, the output cannot be
+switched.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r11430.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r11680.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_G_MODULATOR, VIDIOC_S_MODULATOR</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_G_PARM, VIDIOC_S_PARM</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r11680.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r11680.htm
new file mode 100644
index 0000000..87a12cc
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r11680.htm
@@ -0,0 +1,881 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_G_PARM, VIDIOC_S_PARM</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT"
+HREF="r11612.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY"
+HREF="r11946.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r11612.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r11946.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-G-PARM"
+></A
+>ioctl VIDIOC_G_PARM, VIDIOC_S_PARM</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN11684"
+></A
+><H2
+>Name</H2
+>VIDIOC_G_PARM, VIDIOC_S_PARM&nbsp;--&nbsp;Get or set streaming parameters</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN11688"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN11689"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, v4l2_streamparm *argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN11699"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_G_PARM, VIDIOC_S_PARM</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN11719"
+></A
+><H2
+>Description</H2
+><P
+>The current video standard determines a nominal number of
+frames per second. If less than this number of frames is to be
+captured or output, applications can request frame skipping or
+duplicating on the driver side. This is especially useful when using
+the <CODE
+CLASS="FUNCTION"
+>read()</CODE
+> or <CODE
+CLASS="FUNCTION"
+>write()</CODE
+>, which
+are not augmented by timestamps or sequence counters, and to avoid
+unneccessary data copying.</P
+><P
+>Further these ioctls can be used to determine the number of
+buffers used internally by a driver in read/write mode. For
+implications see the section discussing the <A
+HREF="r14264.htm"
+><CODE
+CLASS="FUNCTION"
+>read()</CODE
+></A
+>
+function.</P
+><P
+>To get and set the streaming parameters applications call
+the <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_PARM</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_PARM</CODE
+> ioctl, respectively. They take a
+pointer to a struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_streamparm</CODE
+> which
+contains a union holding separate parameters for input and output
+devices.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-STREAMPARM"
+></A
+><P
+><B
+>Table 1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_streamparm</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="20%"
+TITLE="C1"><COL
+WIDTH="20%"
+TITLE="C2"><COL
+WIDTH="20%"
+TITLE="C3"><COL
+WIDTH="40%"
+TITLE="C4"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>enum&nbsp;<A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>The buffer (stream) type, same as struct&nbsp;<A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+>, set by the application.</TD
+></TR
+><TR
+><TD
+>union</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>parm</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>struct&nbsp;<A
+HREF="r11680.htm#V4L2-CAPTUREPARM"
+>v4l2_captureparm</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>capture</CODE
+></TD
+><TD
+>Parameters for capture devices, used when
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> is
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_CAPTURE</CODE
+>.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>struct&nbsp;<A
+HREF="r11680.htm#V4L2-OUTPUTPARM"
+>v4l2_outputparm</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>output</CODE
+></TD
+><TD
+>Parameters for output devices, used when
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> is
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_OUTPUT</CODE
+>.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>__u8</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>raw_data</CODE
+>[200]</TD
+><TD
+>A place holder for future extensions and custom
+(driver defined) buffer types <CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_PRIVATE</CODE
+> and
+higher.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-CAPTUREPARM"
+></A
+><P
+><B
+>Table 2. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_captureparm</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>capability</CODE
+></TD
+><TD
+>See <A
+HREF="r11680.htm#PARM-CAPS"
+>Table 4</A
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>capturemode</CODE
+></TD
+><TD
+>Set by drivers and applications, see <A
+HREF="r11680.htm#PARM-FLAGS"
+>Table 5</A
+>.</TD
+></TR
+><TR
+><TD
+>struct&nbsp;<A
+HREF="r9288.htm#V4L2-FRACT"
+>v4l2_fract</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>timeperframe</CODE
+></TD
+><TD
+><P
+>This is is the desired period between
+successive frames captured by the driver, in seconds. The
+field is intended to skip frames on the driver side, saving I/O
+bandwidth.</P
+><P
+>Applications store here the desired frame
+period, drivers return the actual frame period, which must be greater
+or equal to the nominal frame period determined by the current video
+standard (struct&nbsp;<A
+HREF="r9288.htm#V4L2-STANDARD"
+>v4l2_standard</A
+> <CODE
+CLASS="STRUCTFIELD"
+>frameperiod</CODE
+>
+field). Changing the video standard (also implicitly by switching the
+video input) may reset this parameter to the nominal frame period. To
+reset manually applications can just set this field to
+zero.</P
+><P
+>Drivers support this function only when they set the
+<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_TIMEPERFRAME</CODE
+> flag in the
+<CODE
+CLASS="STRUCTFIELD"
+>capability</CODE
+> field.</P
+></TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>extendedmode</CODE
+></TD
+><TD
+>Custom (driver specific) streaming parameters. When
+unused, applications and drivers must set this field to zero.
+Applications using this field should check the driver name and
+version, see <A
+HREF="x282.htm"
+>Section 1.2</A
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>readbuffers</CODE
+></TD
+><TD
+>Applications set this field to the desired number
+of buffers used internally by the driver in <A
+HREF="r14264.htm"
+><CODE
+CLASS="FUNCTION"
+>read()</CODE
+></A
+> mode. Drivers
+return the actual number of buffers. When an application requests zero
+buffers, drivers should just return the current setting rather than
+the minimum or an error code. For details see <A
+HREF="c5742.htm#RW"
+>Section 3.1</A
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+>[4]</TD
+><TD
+>Reserved for future extensions. Drivers and
+applications must set the array to zero.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-OUTPUTPARM"
+></A
+><P
+><B
+>Table 3. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_outputparm</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>capability</CODE
+></TD
+><TD
+>See <A
+HREF="r11680.htm#PARM-CAPS"
+>Table 4</A
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>outputmode</CODE
+></TD
+><TD
+>Set by drivers and applications, see <A
+HREF="r11680.htm#PARM-FLAGS"
+>Table 5</A
+>.</TD
+></TR
+><TR
+><TD
+>struct&nbsp;<A
+HREF="r9288.htm#V4L2-FRACT"
+>v4l2_fract</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>timeperframe</CODE
+></TD
+><TD
+>This is is the desired period between
+successive frames output by the driver, in seconds.</TD
+></TR
+><TR
+><TD
+COLSPAN="3"
+><P
+>The field is intended to
+repeat frames on the driver side in <A
+HREF="r14496.htm"
+><CODE
+CLASS="FUNCTION"
+>write()</CODE
+></A
+> mode (in streaming
+mode timestamps can be used to throttle the output), saving I/O
+bandwidth.</P
+><P
+>Applications store here the desired frame
+period, drivers return the actual frame period, which must be greater
+or equal to the nominal frame period determined by the current video
+standard (struct&nbsp;<A
+HREF="r9288.htm#V4L2-STANDARD"
+>v4l2_standard</A
+> <CODE
+CLASS="STRUCTFIELD"
+>frameperiod</CODE
+>
+field). Changing the video standard (also implicitly by switching the
+video output) may reset this parameter to the nominal frame period. To
+reset manually applications can just set this field to
+zero.</P
+><P
+>Drivers support this function only when they set the
+<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_TIMEPERFRAME</CODE
+> flag in the
+<CODE
+CLASS="STRUCTFIELD"
+>capability</CODE
+> field.</P
+></TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>extendedmode</CODE
+></TD
+><TD
+>Custom (driver specific) streaming parameters. When
+unused, applications and drivers must set this field to zero.
+Applications using this field should check the driver name and
+version, see <A
+HREF="x282.htm"
+>Section 1.2</A
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>writebuffers</CODE
+></TD
+><TD
+>Applications set this field to the desired number
+of buffers used internally by the driver in
+<CODE
+CLASS="FUNCTION"
+>write()</CODE
+> mode. Drivers return the actual number of
+buffers. When an application requests zero buffers, drivers should
+just return the current setting rather than the minimum or an error
+code. For details see <A
+HREF="c5742.htm#RW"
+>Section 3.1</A
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+>[4]</TD
+><TD
+>Reserved for future extensions. Drivers and
+applications must set the array to zero.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="PARM-CAPS"
+></A
+><P
+><B
+>Table 4. Streaming Parameters Capabilites</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CAP_TIMEPERFRAME</CODE
+></TD
+><TD
+>0x1000</TD
+><TD
+>The frame skipping/repeating controlled by the
+<CODE
+CLASS="STRUCTFIELD"
+>timeperframe</CODE
+> field is supported.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="PARM-FLAGS"
+></A
+><P
+><B
+>Table 5. Capture Parameters Flags</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MODE_HIGHQUALITY</CODE
+></TD
+><TD
+>0x0001</TD
+><TD
+><P
+>High quality imaging mode. High quality mode
+is intended for still imaging applications. The idea is to get the
+best possible image quality that the hardware can deliver. It is not
+defined how the driver writer may achieve that; it will depend on the
+hardware and the ingenuity of the driver writer. High quality mode is
+a different mode from the the regular motion video capture modes. In
+high quality mode:<P
+></P
+><UL
+><LI
+><P
+>The driver may be able to capture higher
+resolutions than for motion capture.</P
+></LI
+><LI
+><P
+>The driver may support fewer pixel formats
+than motion capture (eg; true color).</P
+></LI
+><LI
+><P
+>The driver may capture and arithmetically
+combine multiple successive fields or frames to remove color edge
+artifacts and reduce the noise in the video data.</P
+></LI
+><LI
+><P
+>The driver may capture images in slices like
+a scanner in order to handle larger format images than would otherwise
+be possible. </P
+></LI
+><LI
+><P
+>An image capture operation may be
+significantly slower than motion capture. </P
+></LI
+><LI
+><P
+>Moving objects in the image might have
+excessive motion blur. </P
+></LI
+><LI
+><P
+>Capture might only work through the
+<CODE
+CLASS="FUNCTION"
+>read()</CODE
+> call.</P
+></LI
+></UL
+></P
+></TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN11934"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>This ioctl is not supported.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r11612.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r11946.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r11946.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r11946.htm
new file mode 100644
index 0000000..ead3b87
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r11946.htm
@@ -0,0 +1,399 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_G_PARM, VIDIOC_S_PARM"
+HREF="r11680.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_G_SLICED_VBI_CAP"
+HREF="r12051.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r11680.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r12051.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-G-PRIORITY"
+></A
+>ioctl VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN11950"
+></A
+><H2
+>Name</H2
+>VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY&nbsp;--&nbsp;Query or request the access priority associated with a
+file descriptor</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN11954"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN11955"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, enum v4l2_priority *argp);</CODE
+></P
+><P
+></P
+></DIV
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN11965"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, const enum v4l2_priority *argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN11975"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+>Pointer to an enum v4l2_priority type.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN11995"
+></A
+><H2
+>Description</H2
+><P
+>To query the current access priority
+applications call the <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_PRIORITY</CODE
+> ioctl
+with a pointer to an enum v4l2_priority variable where the driver stores
+the current priority.</P
+><P
+>To request an access priority applications store the
+desired priority in an enum v4l2_priority variable and call
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_PRIORITY</CODE
+> ioctl with a pointer to this
+variable.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-PRIORITY"
+></A
+><P
+><B
+>Table 1. enum v4l2_priority</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PRIORITY_UNSET</CODE
+></TD
+><TD
+>0</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PRIORITY_BACKGROUND</CODE
+></TD
+><TD
+>1</TD
+><TD
+>Lowest priority, usually applications running in
+background, for example monitoring VBI transmissions. A proxy
+application running in user space will be necessary if multiple
+applications want to read from a device at this priority.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PRIORITY_INTERACTIVE</CODE
+></TD
+><TD
+>2</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PRIORITY_DEFAULT</CODE
+></TD
+><TD
+>2</TD
+><TD
+>Medium priority, usually applications started and
+interactively controlled by the user. For example TV viewers, Teletext
+browsers, or just "panel" applications to change the channel or video
+controls. This is the default priority unless an application requests
+another.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PRIORITY_RECORD</CODE
+></TD
+><TD
+>3</TD
+><TD
+>Highest priority. Only one file descriptor can have
+this priority, it blocks any other fd from changing device properties.
+Usually applications which must not be interrupted, like video
+recording.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN12034"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The requested priority value is invalid, or the
+driver does not support access priorities.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+></DT
+><DD
+><P
+>Another application already requested higher
+priority.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r11680.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r12051.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_G_PARM, VIDIOC_S_PARM</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_G_SLICED_VBI_CAP</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r12051.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r12051.htm
new file mode 100644
index 0000000..b93f75c
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r12051.htm
@@ -0,0 +1,735 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_G_SLICED_VBI_CAP</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY"
+HREF="r11946.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_G_STD, VIDIOC_S_STD"
+HREF="r12265.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r11946.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r12265.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-G-SLICED-VBI-CAP"
+></A
+>ioctl VIDIOC_G_SLICED_VBI_CAP</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN12055"
+></A
+><H2
+>Name</H2
+>VIDIOC_G_SLICED_VBI_CAP&nbsp;--&nbsp;Query sliced VBI capabilities</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN12058"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN12059"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_sliced_vbi_cap *argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN12069"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_G_SLICED_VBI_CAP</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN12089"
+></A
+><H2
+>Description</H2
+><P
+>To find out which data services are supported by a sliced
+VBI capture or output device, applications initialize the
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field of a struct&nbsp;<A
+HREF="r12051.htm#V4L2-SLICED-VBI-CAP"
+>v4l2_sliced_vbi_cap</A
+>,
+clear the <CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+> array and
+call the <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_SLICED_VBI_CAP</CODE
+> ioctl. The
+driver fills in the remaining fields or returns an <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code if the
+sliced VBI API is unsupported or <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+>
+is invalid.</P
+><P
+>Note the <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field was added,
+and the ioctl changed from read-only to write-read, in Linux 2.6.19.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-SLICED-VBI-CAP"
+></A
+><P
+><B
+>Table 1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_sliced_vbi_cap</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="17%"
+TITLE="C3"><COL
+WIDTH="17%"
+TITLE="C4"><COL
+WIDTH="17%"
+TITLE="C5"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u16</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>service_set</CODE
+></TD
+><TD
+COLSPAN="3"
+>A set of all data services
+supported by the driver. Equal to the union of all elements of the
+<CODE
+CLASS="STRUCTFIELD"
+>service_lines </CODE
+> array.</TD
+></TR
+><TR
+><TD
+>__u16</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>service_lines</CODE
+>[2][24]</TD
+><TD
+COLSPAN="3"
+>Each element of this array
+contains a set of data services the hardware can look for or insert
+into a particular scan line. Data services are defined in <A
+HREF="r12051.htm#VBI-SERVICES"
+>Table 2</A
+>. Array indices map to ITU-R
+line numbers (see also <A
+HREF="x7013.htm#VBI-525"
+>Figure 4-2</A
+> and <A
+HREF="x7013.htm#VBI-625"
+>Figure 4-3</A
+>) as follows:</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>Element</TD
+><TD
+>525 line systems</TD
+><TD
+>625 line systems</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>service_lines</CODE
+>[0][1]</TD
+><TD
+ALIGN="CENTER"
+>1</TD
+><TD
+ALIGN="CENTER"
+>1</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>service_lines</CODE
+>[0][23]</TD
+><TD
+ALIGN="CENTER"
+>23</TD
+><TD
+ALIGN="CENTER"
+>23</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>service_lines</CODE
+>[1][1]</TD
+><TD
+ALIGN="CENTER"
+>264</TD
+><TD
+ALIGN="CENTER"
+>314</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>service_lines</CODE
+>[1][23]</TD
+><TD
+ALIGN="CENTER"
+>286</TD
+><TD
+ALIGN="CENTER"
+>336</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>The number of VBI lines the
+hardware can capture or output per frame, or the number of services it
+can identify on a given line may be limited. For example on PAL line
+16 the hardware may be able to look for a VPS or Teletext signal, but
+not both at the same time. Applications can learn about these limits
+using the <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctl as described in <A
+HREF="x7236.htm"
+>Section 4.8</A
+>.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Drivers must set
+<CODE
+CLASS="STRUCTFIELD"
+>service_lines</CODE
+>[0][0] and
+<CODE
+CLASS="STRUCTFIELD"
+>service_lines</CODE
+>[1][0] to zero.</TD
+></TR
+><TR
+><TD
+>enum&nbsp;<A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+></TD
+><TD
+>Type of the data stream, see <A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>Table 3-2</A
+>. Should be
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_SLICED_VBI_CAPTURE</CODE
+> or
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_SLICED_VBI_OUTPUT</CODE
+>.</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+>[3]</TD
+><TD
+COLSPAN="3"
+>This array is reserved for future
+extensions. Applications and drivers must set it to zero.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="VBI-SERVICES"
+></A
+><P
+><B
+>Table 2. Sliced VBI services</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="12%"
+TITLE="C3"><COL
+WIDTH="25%"
+TITLE="C4"><COL
+WIDTH="25%"
+TITLE="C5"><THEAD
+><TR
+><TH
+>Symbol</TH
+><TH
+>Value</TH
+><TH
+>Reference</TH
+><TH
+>Lines, usually</TH
+><TH
+>Payload</TH
+></TR
+></THEAD
+><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_SLICED_TELETEXT_B</CODE
+> (Teletext
+System B)</TD
+><TD
+>0x0001</TD
+><TD
+><A
+HREF="b17127.htm#ETS300706"
+><ABBR
+CLASS="ABBREV"
+>ETS&nbsp;300&nbsp;706</ABBR
+></A
+>, <A
+HREF="b17127.htm#ITU653"
+><ABBR
+CLASS="ABBREV"
+>ITU&nbsp;BT.653</ABBR
+></A
+></TD
+><TD
+>PAL/SECAM line 7-22, 320-335 (second field 7-22)</TD
+><TD
+>Last 42 of the 45 byte Teletext packet, that is
+without clock run-in and framing code, lsb first transmitted.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_SLICED_VPS</CODE
+></TD
+><TD
+>0x0400</TD
+><TD
+><A
+HREF="b17127.htm#ETS300231"
+><ABBR
+CLASS="ABBREV"
+>ETS&nbsp;300&nbsp;231</ABBR
+></A
+></TD
+><TD
+>PAL line 16</TD
+><TD
+>Byte number 3 to 15 according to Figure 9 of
+ETS&nbsp;300&nbsp;231, lsb first transmitted.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_SLICED_CAPTION_525</CODE
+></TD
+><TD
+>0x1000</TD
+><TD
+><A
+HREF="b17127.htm#EIA608"
+><ABBR
+CLASS="ABBREV"
+>EIA&nbsp;608-B</ABBR
+></A
+></TD
+><TD
+>NTSC line 21, 284 (second field 21)</TD
+><TD
+>Two bytes in transmission order, including parity
+bit, lsb first transmitted.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_SLICED_WSS_625</CODE
+></TD
+><TD
+>0x4000</TD
+><TD
+><A
+HREF="b17127.htm#EN300294"
+><ABBR
+CLASS="ABBREV"
+>EN&nbsp;300&nbsp;294</ABBR
+></A
+>, <A
+HREF="b17127.htm#ITU1119"
+><ABBR
+CLASS="ABBREV"
+>ITU&nbsp;BT.1119</ABBR
+></A
+></TD
+><TD
+>PAL/SECAM line 23</TD
+><TD
+><PRE
+CLASS="SCREEN"
+>Byte        0                 1
+     msb         lsb  msb           lsb
+Bit  7 6 5 4 3 2 1 0  x x 13 12 11 10 9</PRE
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_SLICED_VBI_525</CODE
+></TD
+><TD
+>0x1000</TD
+><TD
+COLSPAN="3"
+>Set of services applicable to 525
+line systems.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_SLICED_VBI_625</CODE
+></TD
+><TD
+>0x4401</TD
+><TD
+COLSPAN="3"
+>Set of services applicable to 625
+line systems.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN12252"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The device does not support sliced VBI capturing or
+output, or the value in the <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field is
+wrong.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r11946.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r12265.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_G_STD, VIDIOC_S_STD</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r12265.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r12265.htm
new file mode 100644
index 0000000..a57ee72
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r12265.htm
@@ -0,0 +1,335 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_G_STD, VIDIOC_S_STD</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_G_SLICED_VBI_CAP"
+HREF="r12051.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_G_TUNER, VIDIOC_S_TUNER"
+HREF="r12342.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r12051.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r12342.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-G-STD"
+></A
+>ioctl VIDIOC_G_STD, VIDIOC_S_STD</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN12269"
+></A
+><H2
+>Name</H2
+>VIDIOC_G_STD, VIDIOC_S_STD&nbsp;--&nbsp;Query or select the video standard of the current input</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN12273"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN12274"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, v4l2_std_id
+*argp);</CODE
+></P
+><P
+></P
+></DIV
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN12284"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, const v4l2_std_id
+*argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN12294"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_G_STD, VIDIOC_S_STD</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN12314"
+></A
+><H2
+>Description</H2
+><P
+>To query and select the current video standard applications
+use the <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_STD</CODE
+> and <CODE
+CLASS="CONSTANT"
+>VIDIOC_S_STD</CODE
+> ioctls which take a pointer to a
+<A
+HREF="r9288.htm#V4L2-STD-ID"
+>v4l2_std_id</A
+> type as argument. <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_STD</CODE
+> can
+return a single flag or a set of flags as in struct&nbsp;<A
+HREF="r9288.htm#V4L2-STANDARD"
+>v4l2_standard</A
+> field
+<CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+>. The flags must be unambiguous such
+that they appear in only one enumerated <CODE
+CLASS="STRUCTNAME"
+>v4l2_standard</CODE
+> structure.</P
+><P
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_STD</CODE
+> accepts one or more
+flags, being a write-only ioctl it does not return the actual new standard as
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_STD</CODE
+> does. When no flags are given or
+the current input does not support the requested standard the driver
+returns an <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code. When the standard set is ambiguous drivers may
+return <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> or choose any of the requested
+standards.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN12329"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>This ioctl is not supported, or the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_STD</CODE
+> parameter was unsuitable.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r12051.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r12342.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_G_SLICED_VBI_CAP</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_G_TUNER, VIDIOC_S_TUNER</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r12342.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r12342.htm
new file mode 100644
index 0000000..c4aea41
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r12342.htm
@@ -0,0 +1,1368 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_G_TUNER, VIDIOC_S_TUNER</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_G_STD, VIDIOC_S_STD"
+HREF="r12265.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_LOG_STATUS"
+HREF="r12784.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r12265.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r12784.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-G-TUNER"
+></A
+>ioctl VIDIOC_G_TUNER, VIDIOC_S_TUNER</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN12346"
+></A
+><H2
+>Name</H2
+>VIDIOC_G_TUNER, VIDIOC_S_TUNER&nbsp;--&nbsp;Get or set tuner attributes</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN12350"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN12351"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_tuner
+*argp);</CODE
+></P
+><P
+></P
+></DIV
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN12361"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, const struct v4l2_tuner
+*argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN12371"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_G_TUNER, VIDIOC_S_TUNER</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN12391"
+></A
+><H2
+>Description</H2
+><P
+>To query the attributes of a tuner applications initialize the
+<CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+> field and zero out the
+<CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+> array of a struct&nbsp;<A
+HREF="r12342.htm#V4L2-TUNER"
+>v4l2_tuner</A
+> and call the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_TUNER</CODE
+> ioctl with a pointer to this
+structure. Drivers fill the rest of the structure or return an
+<SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code when the index is out of bounds. To enumerate all tuners
+applications shall begin at index zero, incrementing by one until the
+driver returns <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+>.</P
+><P
+>Tuners have two writable properties, the audio mode and
+the radio frequency. To change the audio mode, applications initialize
+the <CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+>,
+<CODE
+CLASS="STRUCTFIELD"
+>audmode</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+> fields and call the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_TUNER</CODE
+> ioctl. This will
+<SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>not</I
+></SPAN
+> change the current tuner, which is determined
+by the current video input. Drivers may choose a different audio mode
+if the requested mode is invalid or unsupported. Since this is a
+write-only ioctl, it does not return the actually
+selected audio mode.</P
+><P
+>To change the radio frequency the <A
+HREF="r11094.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FREQUENCY</CODE
+></A
+> ioctl
+is available.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-TUNER"
+></A
+><P
+><B
+>Table 1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_tuner</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="25%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+></TD
+><TD
+COLSPAN="2"
+>Identifies the tuner, set by the
+application.</TD
+></TR
+><TR
+><TD
+>__u8</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>name</CODE
+>[32]</TD
+><TD
+COLSPAN="2"
+><P
+>Name of the tuner, a
+NUL-terminated ASCII string. This information is intended for the
+user.</P
+></TD
+></TR
+><TR
+><TD
+>enum&nbsp;<A
+HREF="r12342.htm#V4L2-TUNER-TYPE"
+>v4l2_tuner_type</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+></TD
+><TD
+COLSPAN="2"
+>Type of the tuner, see <A
+HREF="r12342.htm#V4L2-TUNER-TYPE"
+>Table 2</A
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>capability</CODE
+></TD
+><TD
+COLSPAN="2"
+><P
+>Tuner capability flags, see
+<A
+HREF="r12342.htm#TUNER-CAPABILITY"
+>Table 3</A
+>. Audio flags indicate the ability
+to decode audio subprograms. They will <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>not</I
+></SPAN
+>
+change, for example with the current video standard.</P
+><P
+>When
+the structure refers to a radio tuner only the
+<CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_CAP_LOW</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_CAP_STEREO</CODE
+> flags can be
+set.</P
+></TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>rangelow</CODE
+></TD
+><TD
+COLSPAN="2"
+>The lowest tunable frequency in
+units of 62.5 kHz, or if the <CODE
+CLASS="STRUCTFIELD"
+>capability</CODE
+>
+flag <CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_CAP_LOW</CODE
+> is set, in units of 62.5
+Hz.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>rangehigh</CODE
+></TD
+><TD
+COLSPAN="2"
+>The highest tunable frequency in
+units of 62.5 kHz, or if the <CODE
+CLASS="STRUCTFIELD"
+>capability</CODE
+>
+flag <CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_CAP_LOW</CODE
+> is set, in units of 62.5
+Hz.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>rxsubchans</CODE
+></TD
+><TD
+COLSPAN="2"
+><P
+>Some tuners or audio
+decoders can determine the received audio subprograms by analyzing
+audio carriers, pilot tones or other indicators. To pass this
+information drivers set flags defined in <A
+HREF="r12342.htm#TUNER-RXSUBCHANS"
+>Table 4</A
+> in this field. For
+example:</P
+></TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_MONO</CODE
+></TD
+><TD
+>receiving mono audio</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>STEREO | SAP</CODE
+></TD
+><TD
+>receiving stereo audio and a secondary audio
+program</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>MONO | STEREO</CODE
+></TD
+><TD
+>receiving mono or stereo audio, the hardware cannot
+distinguish</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>LANG1 | LANG2</CODE
+></TD
+><TD
+>receiving bilingual audio</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>MONO | STEREO | LANG1 | LANG2</CODE
+></TD
+><TD
+>receiving mono, stereo or bilingual
+audio</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="2"
+><P
+>When the
+<CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_CAP_STEREO</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>_LANG1</CODE
+>, <CODE
+CLASS="CONSTANT"
+>_LANG2</CODE
+> or
+<CODE
+CLASS="CONSTANT"
+>_SAP</CODE
+> flag is cleared in the
+<CODE
+CLASS="STRUCTFIELD"
+>capability</CODE
+> field, the corresponding
+<CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_</CODE
+> flag must not be set
+here.</P
+><P
+>This field is valid only if this is the tuner of the
+current video input, or when the structure refers to a radio
+tuner.</P
+></TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>audmode</CODE
+></TD
+><TD
+COLSPAN="2"
+><P
+>The selected audio mode, see
+<A
+HREF="r12342.htm#TUNER-AUDMODE"
+>Table 5</A
+> for valid values. The audio mode does
+not affect audio subprogram detection, and like a <A
+HREF="x542.htm"
+>control</A
+> it does not automatically change
+unless the requested mode is invalid or unsupported. See <A
+HREF="r12342.htm#TUNER-MATRIX"
+>Table 6</A
+> for possible results when
+the selected and received audio programs do not
+match.</P
+><P
+>Currently this is the only field of struct
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_tuner</CODE
+> applications can
+change.</P
+></TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>signal</CODE
+></TD
+><TD
+COLSPAN="2"
+>The signal strength if known, ranging
+from 0 to 65535. Higher values indicate a better signal.</TD
+></TR
+><TR
+><TD
+>__s32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>afc</CODE
+></TD
+><TD
+COLSPAN="2"
+>Automatic frequency control: When the
+<CODE
+CLASS="STRUCTFIELD"
+>afc</CODE
+> value is negative, the frequency is too
+low, when positive too high.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+>[4]</TD
+><TD
+COLSPAN="2"
+>Reserved for future extensions. Drivers and
+applications must set the array to zero.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-TUNER-TYPE"
+></A
+><P
+><B
+>Table 2. enum v4l2_tuner_type</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_RADIO</CODE
+></TD
+><TD
+>1</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_ANALOG_TV</CODE
+></TD
+><TD
+>2</TD
+><TD
+>&nbsp;</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="TUNER-CAPABILITY"
+></A
+><P
+><B
+>Table 3. Tuner and Modulator Capability Flags</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_CAP_LOW</CODE
+></TD
+><TD
+>0x0001</TD
+><TD
+>When set, tuning frequencies are expressed in units of
+62.5&nbsp;Hz, otherwise in units of 62.5&nbsp;kHz.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_CAP_NORM</CODE
+></TD
+><TD
+>0x0002</TD
+><TD
+>This is a multi-standard tuner; the video standard
+can or must be switched. (B/G PAL tuners for example are typically not
+      considered multi-standard because the video standard is automatically
+      determined from the frequency band.) The set of supported video
+      standards is available from the struct&nbsp;<A
+HREF="r8936.htm#V4L2-INPUT"
+>v4l2_input</A
+> pointing to this tuner,
+      see the description of ioctl <A
+HREF="r8936.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMINPUT</CODE
+></A
+> for details. Only
+      <CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_ANALOG_TV</CODE
+> tuners can have this capability.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_CAP_STEREO</CODE
+></TD
+><TD
+>0x0010</TD
+><TD
+>Stereo audio reception is supported.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_CAP_LANG1</CODE
+></TD
+><TD
+>0x0040</TD
+><TD
+>Reception of the primary language of a bilingual
+audio program is supported. Bilingual audio is a feature of
+two-channel systems, transmitting the primary language monaural on the
+main audio carrier and a secondary language monaural on a second
+carrier. Only
+      <CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_ANALOG_TV</CODE
+> tuners can have this capability.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_CAP_LANG2</CODE
+></TD
+><TD
+>0x0020</TD
+><TD
+>Reception of the secondary language of a bilingual
+audio program is supported. Only
+      <CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_ANALOG_TV</CODE
+> tuners can have this capability.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_CAP_SAP</CODE
+></TD
+><TD
+>0x0020</TD
+><TD
+><P
+>Reception of a secondary audio program is
+supported. This is a feature of the BTSC system which accompanies the
+NTSC video standard. Two audio carriers are available for mono or
+stereo transmissions of a primary language, and an independent third
+carrier for a monaural secondary language. Only
+      <CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_ANALOG_TV</CODE
+> tuners can have this capability.</P
+><P
+>Note the
+<CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_CAP_LANG2</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_CAP_SAP</CODE
+> flags are synonyms.
+<CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_CAP_SAP</CODE
+> applies when the tuner
+supports the <CODE
+CLASS="CONSTANT"
+>V4L2_STD_NTSC_M</CODE
+> video
+standard.</P
+></TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="TUNER-RXSUBCHANS"
+></A
+><P
+><B
+>Table 4. Tuner Audio Reception Flags</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_MONO</CODE
+></TD
+><TD
+>0x0001</TD
+><TD
+>The tuner receives a mono audio signal.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_STEREO</CODE
+></TD
+><TD
+>0x0002</TD
+><TD
+>The tuner receives a stereo audio signal.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_LANG1</CODE
+></TD
+><TD
+>0x0008</TD
+><TD
+>The tuner receives the primary language of a
+bilingual audio signal. Drivers must clear this flag when the current
+video standard is <CODE
+CLASS="CONSTANT"
+>V4L2_STD_NTSC_M</CODE
+>.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_LANG2</CODE
+></TD
+><TD
+>0x0004</TD
+><TD
+>The tuner receives the secondary language of a
+bilingual audio signal (or a second audio program).</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_SAP</CODE
+></TD
+><TD
+>0x0004</TD
+><TD
+>The tuner receives a Second Audio Program. Note the
+<CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_LANG2</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_SAP</CODE
+> flags are synonyms. The
+<CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_SAP</CODE
+> flag applies when the
+current video standard is <CODE
+CLASS="CONSTANT"
+>V4L2_STD_NTSC_M</CODE
+>.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="TUNER-AUDMODE"
+></A
+><P
+><B
+>Table 5. Tuner Audio Modes</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_MODE_MONO</CODE
+></TD
+><TD
+>0</TD
+><TD
+>Play mono audio. When the tuner receives a stereo
+signal this a down-mix of the left and right channel. When the tuner
+receives a bilingual or SAP signal this mode selects the primary
+language.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_MODE_STEREO</CODE
+></TD
+><TD
+>1</TD
+><TD
+><P
+>Play stereo audio. When the tuner receives
+bilingual audio it may play different languages on the left and right
+channel or the primary language on both channels. behave as in mono
+mode.</P
+><P
+>Playing different languages in this mode is
+deprecated. New drivers should do this only in
+<CODE
+CLASS="CONSTANT"
+>MODE_LANG1_LANG2</CODE
+>.</P
+><P
+>When the tuner
+receives no stereo signal or does not support stereo reception the
+driver shall fall back to <CODE
+CLASS="CONSTANT"
+>MODE_MONO</CODE
+>.</P
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_MODE_LANG1</CODE
+></TD
+><TD
+>3</TD
+><TD
+>Play the primary language, mono or stereo. Only
+<CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_ANALOG_TV</CODE
+> tuners support this
+mode.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_MODE_LANG2</CODE
+></TD
+><TD
+>2</TD
+><TD
+>Play the secondary language, mono. When the tuner
+receives no bilingual audio or SAP, or their reception is not
+supported the driver shall fall back to mono or stereo mode. Only
+<CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_ANALOG_TV</CODE
+> tuners support this
+mode.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_MODE_SAP</CODE
+></TD
+><TD
+>2</TD
+><TD
+>Play the Second Audio Program. When the tuner
+receives no bilingual audio or SAP, or their reception is not
+supported the driver shall fall back to mono or stereo mode. Only
+<CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_ANALOG_TV</CODE
+> tuners support this mode.
+Note the <CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_MODE_LANG2</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_MODE_SAP</CODE
+> are synonyms.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_MODE_LANG1_LANG2</CODE
+></TD
+><TD
+>4</TD
+><TD
+>Play the primary language on the left channel, the
+secondary language on the right channel. When the tuner receives no
+bilingual audio or SAP, it shall fall back to
+<CODE
+CLASS="CONSTANT"
+>MODE_LANG1</CODE
+> or <CODE
+CLASS="CONSTANT"
+>MODE_MONO</CODE
+>.
+Only <CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_ANALOG_TV</CODE
+> tuners support this
+mode.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="TUNER-MATRIX"
+></A
+><P
+><B
+>Table 6. Tuner Audio Matrix</B
+></P
+><TABLE
+BORDER="1"
+FRAME="border"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="20%"
+ALIGN="LEFT"><COL
+WIDTH="20%"
+TITLE="C2"><COL
+WIDTH="20%"><COL
+WIDTH="20%"><COL><COL
+WIDTH="20%"
+TITLE="C6"><THEAD
+><TR
+><TH
+>&nbsp;</TH
+><TH
+COLSPAN="5"
+ALIGN="CENTER"
+>Selected
+<CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_MODE_</CODE
+></TH
+></TR
+><TR
+><TH
+>Received <CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_</CODE
+></TH
+><TH
+><CODE
+CLASS="CONSTANT"
+>MONO</CODE
+></TH
+><TH
+><CODE
+CLASS="CONSTANT"
+>STEREO</CODE
+></TH
+><TH
+><CODE
+CLASS="CONSTANT"
+>LANG1</CODE
+></TH
+><TH
+><CODE
+CLASS="CONSTANT"
+>LANG2 = SAP</CODE
+></TH
+><TH
+><CODE
+CLASS="CONSTANT"
+>LANG1_LANG2</CODE
+><A
+NAME="AEN12723"
+HREF="r12342.htm#FTN.AEN12723"
+><SPAN
+CLASS="footnote"
+>[a]</SPAN
+></A
+></TH
+></TR
+></THEAD
+><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>MONO</CODE
+></TD
+><TD
+>Mono</TD
+><TD
+>Mono/Mono</TD
+><TD
+>Mono</TD
+><TD
+>Mono</TD
+><TD
+>Mono/Mono</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>MONO | SAP</CODE
+></TD
+><TD
+>Mono</TD
+><TD
+>Mono/Mono</TD
+><TD
+>Mono</TD
+><TD
+>SAP</TD
+><TD
+>Mono/SAP (preferred) or Mono/Mono</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>STEREO</CODE
+></TD
+><TD
+>L+R</TD
+><TD
+>L/R</TD
+><TD
+>Stereo L/R (preferred) or Mono L+R</TD
+><TD
+>Stereo L/R (preferred) or Mono L+R</TD
+><TD
+>L/R (preferred) or L+R/L+R</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>STEREO | SAP</CODE
+></TD
+><TD
+>L+R</TD
+><TD
+>L/R</TD
+><TD
+>Stereo L/R (preferred) or Mono L+R</TD
+><TD
+>SAP</TD
+><TD
+>L+R/SAP (preferred) or L/R or L+R/L+R</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>LANG1 | LANG2</CODE
+></TD
+><TD
+>Language&nbsp;1</TD
+><TD
+>Lang1/Lang2 (deprecated<A
+NAME="AEN12763"
+HREF="r12342.htm#FTN.AEN12763"
+><SPAN
+CLASS="footnote"
+>[b]</SPAN
+></A
+>) or
+Lang1/Lang1</TD
+><TD
+>Language&nbsp;1</TD
+><TD
+>Language&nbsp;2</TD
+><TD
+>Lang1/Lang2 (preferred) or Lang1/Lang1</TD
+></TR
+></TBODY
+><TR
+><TD
+COLSPAN="6"
+>Notes:<BR><A
+NAME="FTN.AEN12723"
+>a. </A
+>This 
+mode has been added in Linux 2.6.17 and may not be supported by older
+drivers.<BR><A
+NAME="FTN.AEN12763"
+>b. </A
+>Playback of
+both languages in <CODE
+CLASS="CONSTANT"
+>MODE_STEREO</CODE
+> is deprecated. In
+the future drivers should produce only the primary language in this
+mode. Applications should request
+<CODE
+CLASS="CONSTANT"
+>MODE_LANG1_LANG2</CODE
+> to record both languages or a
+stereo signal.<BR></TD
+></TR
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN12770"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The struct&nbsp;<A
+HREF="r12342.htm#V4L2-TUNER"
+>v4l2_tuner</A
+> <CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+> is
+out of bounds.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r12265.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r12784.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_G_STD, VIDIOC_S_STD</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_LOG_STATUS</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r12784.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r12784.htm
new file mode 100644
index 0000000..7dad667
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r12784.htm
@@ -0,0 +1,228 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_LOG_STATUS</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_G_TUNER, VIDIOC_S_TUNER"
+HREF="r12342.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_OVERLAY"
+HREF="r12816.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r12342.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r12816.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-LOG-STATUS"
+></A
+>ioctl VIDIOC_LOG_STATUS</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN12788"
+></A
+><H2
+>Name</H2
+>VIDIOC_LOG_STATUS&nbsp;--&nbsp;Log driver status information</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN12791"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN12792"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN12800"
+></A
+><H2
+>Description</H2
+><P
+>As the video/audio devices become more complicated it
+becomes harder to debug problems. When this ioctl is called the driver
+will output the current device status to the kernel log. This is
+particular useful when dealing with problems like no sound, no video
+and incorrectly tuned channels. Also many modern devices autodetect
+video and audio standards and this ioctl will report what the device
+thinks what the standard is. Mismatches may give an indication where
+the problem is.</P
+><P
+>This ioctl is optional and not all drivers support it. It
+was introduced in Linux 2.6.15.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN12804"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The driver does not support this ioctl.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r12342.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r12816.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_G_TUNER, VIDIOC_S_TUNER</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_OVERLAY</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r12816.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r12816.htm
new file mode 100644
index 0000000..faa6f4d
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r12816.htm
@@ -0,0 +1,298 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_OVERLAY</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_LOG_STATUS"
+HREF="r12784.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_QBUF, VIDIOC_DQBUF"
+HREF="r12878.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r12784.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r12878.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-OVERLAY"
+></A
+>ioctl VIDIOC_OVERLAY</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN12820"
+></A
+><H2
+>Name</H2
+>VIDIOC_OVERLAY&nbsp;--&nbsp;Start or stop video overlay</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN12823"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN12824"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, const int *argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN12834"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_OVERLAY</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN12854"
+></A
+><H2
+>Description</H2
+><P
+>This ioctl is part of the <A
+HREF="x6570.htm"
+>video
+    overlay</A
+> I/O method. Applications call
+    <CODE
+CLASS="CONSTANT"
+>VIDIOC_OVERLAY</CODE
+> to start or stop the
+    overlay. It takes a pointer to an integer which must be set to
+    zero by the application to stop overlay, to one to start.</P
+><P
+>Drivers do not support <A
+HREF="r13817.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMON</CODE
+></A
+> or
+<A
+HREF="r13817.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMOFF</CODE
+></A
+> with <CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_OVERLAY</CODE
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN12865"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>Video overlay is not supported, or the
+parameters have not been set up. See <A
+HREF="x6570.htm"
+>Section 4.2</A
+> for the necessary steps.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r12784.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r12878.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_LOG_STATUS</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_QBUF, VIDIOC_DQBUF</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r12878.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r12878.htm
new file mode 100644
index 0000000..d9f7425
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r12878.htm
@@ -0,0 +1,577 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_QBUF, VIDIOC_DQBUF</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_OVERLAY"
+HREF="r12816.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_QUERYBUF"
+HREF="r13022.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r12816.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r13022.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-QBUF"
+></A
+>ioctl VIDIOC_QBUF, VIDIOC_DQBUF</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN12882"
+></A
+><H2
+>Name</H2
+>VIDIOC_QBUF, VIDIOC_DQBUF&nbsp;--&nbsp;Exchange a buffer with the driver</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN12886"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN12887"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_buffer *argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN12897"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_QBUF, VIDIOC_DQBUF</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN12917"
+></A
+><H2
+>Description</H2
+><P
+>Applications call the <CODE
+CLASS="CONSTANT"
+>VIDIOC_QBUF</CODE
+> ioctl
+to enqueue an empty (capturing) or filled (output) buffer in the
+driver's incoming queue. The semantics depend on the selected I/O
+method.</P
+><P
+>To enqueue a <A
+HREF="x5791.htm"
+>memory mapped</A
+>
+buffer applications set the <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field of a
+struct&nbsp;<A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+> to the same buffer type as previously struct&nbsp;<A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> and struct&nbsp;<A
+HREF="r13696.htm#V4L2-REQUESTBUFFERS"
+>v4l2_requestbuffers</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+>, the <CODE
+CLASS="STRUCTFIELD"
+>memory</CODE
+>
+field to <CODE
+CLASS="CONSTANT"
+>V4L2_MEMORY_MMAP</CODE
+> and the
+<CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+> field. Valid index numbers range from
+zero to the number of buffers allocated with <A
+HREF="r13696.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_REQBUFS</CODE
+></A
+>
+(struct&nbsp;<A
+HREF="r13696.htm#V4L2-REQUESTBUFFERS"
+>v4l2_requestbuffers</A
+> <CODE
+CLASS="STRUCTFIELD"
+>count</CODE
+>) minus one. The
+contents of the struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_buffer</CODE
+> returned
+by a <A
+HREF="r13022.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYBUF</CODE
+></A
+> ioctl will do as well. When the buffer is
+intended for output (<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> is
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_OUTPUT</CODE
+> or
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VBI_OUTPUT</CODE
+>) applications must also
+initialize the <CODE
+CLASS="STRUCTFIELD"
+>bytesused</CODE
+>,
+<CODE
+CLASS="STRUCTFIELD"
+>field</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>timestamp</CODE
+> fields. See <A
+HREF="x5953.htm"
+>Section 3.5</A
+> for details. When
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_QBUF</CODE
+> is called with a pointer to this
+structure the driver sets the
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_FLAG_MAPPED</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_FLAG_QUEUED</CODE
+> flags and clears the
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_FLAG_DONE</CODE
+> flag in the
+<CODE
+CLASS="STRUCTFIELD"
+>flags</CODE
+> field, or it returns an
+<SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code.</P
+><P
+>To enqueue a <A
+HREF="x5884.htm"
+>user pointer</A
+>
+buffer applications set the <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field of a
+struct&nbsp;<A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+> to the same buffer type as previously struct&nbsp;<A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> and struct&nbsp;<A
+HREF="r13696.htm#V4L2-REQUESTBUFFERS"
+>v4l2_requestbuffers</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+>, the <CODE
+CLASS="STRUCTFIELD"
+>memory</CODE
+>
+field to <CODE
+CLASS="CONSTANT"
+>V4L2_MEMORY_USERPTR</CODE
+> and the
+<CODE
+CLASS="STRUCTFIELD"
+>m.userptr</CODE
+> field to the address of the
+buffer and <CODE
+CLASS="STRUCTFIELD"
+>length</CODE
+> to its size. When the
+buffer is intended for output additional fields must be set as above.
+When <CODE
+CLASS="CONSTANT"
+>VIDIOC_QBUF</CODE
+> is called with a pointer to this
+structure the driver sets the <CODE
+CLASS="CONSTANT"
+>V4L2_BUF_FLAG_QUEUED</CODE
+>
+flag and clears the <CODE
+CLASS="CONSTANT"
+>V4L2_BUF_FLAG_MAPPED</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_FLAG_DONE</CODE
+> flags in the
+<CODE
+CLASS="STRUCTFIELD"
+>flags</CODE
+> field, or it returns an error code.
+This ioctl locks the memory pages of the buffer in physical memory,
+they cannot be swapped out to disk. Buffers remain locked until
+dequeued, until the <A
+HREF="r13817.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMOFF</CODE
+></A
+> or <A
+HREF="r13696.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_REQBUFS</CODE
+></A
+> ioctl are
+called, or until the device is closed.</P
+><P
+>Applications call the <CODE
+CLASS="CONSTANT"
+>VIDIOC_DQBUF</CODE
+>
+ioctl to dequeue a filled (capturing) or displayed (output) buffer
+from the driver's outgoing queue. They just set the
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> and <CODE
+CLASS="STRUCTFIELD"
+>memory</CODE
+>
+fields of a struct&nbsp;<A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+> as above, when <CODE
+CLASS="CONSTANT"
+>VIDIOC_DQBUF</CODE
+>
+is called with a pointer to this structure the driver fills the
+remaining fields or returns an error code.</P
+><P
+>By default <CODE
+CLASS="CONSTANT"
+>VIDIOC_DQBUF</CODE
+> blocks when no
+buffer is in the outgoing queue. When the
+<CODE
+CLASS="CONSTANT"
+>O_NONBLOCK</CODE
+> flag was given to the <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>
+function, <CODE
+CLASS="CONSTANT"
+>VIDIOC_DQBUF</CODE
+> returns immediately
+with an <SPAN
+CLASS="ERRORCODE"
+>EAGAIN</SPAN
+> error code when no buffer is available.</P
+><P
+>The <CODE
+CLASS="STRUCTNAME"
+>v4l2_buffer</CODE
+> structure is
+specified in <A
+HREF="x5953.htm"
+>Section 3.5</A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN12989"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EAGAIN</SPAN
+></DT
+><DD
+><P
+>Non-blocking I/O has been selected using
+<CODE
+CLASS="CONSTANT"
+>O_NONBLOCK</CODE
+> and no buffer was in the outgoing
+queue.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The buffer <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> is not
+supported, or the <CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+> is out of bounds,
+or no buffers have been allocated yet, or the
+<CODE
+CLASS="STRUCTFIELD"
+>userptr</CODE
+> or
+<CODE
+CLASS="STRUCTFIELD"
+>length</CODE
+> are invalid.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>ENOMEM</SPAN
+></DT
+><DD
+><P
+>Not enough physical or virtual memory was available to
+enqueue a user pointer buffer.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EIO</SPAN
+></DT
+><DD
+><P
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_DQBUF</CODE
+> failed due to an
+internal error. Can also indicate temporary problems like signal
+loss. Note the driver might dequeue an (empty) buffer despite
+returning an error, or even stop capturing.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r12816.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r13022.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_OVERLAY</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_QUERYBUF</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r13022.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r13022.htm
new file mode 100644
index 0000000..4a3cb0b
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r13022.htm
@@ -0,0 +1,376 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_QUERYBUF</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_QBUF, VIDIOC_DQBUF"
+HREF="r12878.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_QUERYCAP"
+HREF="r13105.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r12878.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r13105.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-QUERYBUF"
+></A
+>ioctl VIDIOC_QUERYBUF</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN13026"
+></A
+><H2
+>Name</H2
+>VIDIOC_QUERYBUF&nbsp;--&nbsp;Query the status of a buffer</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN13029"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN13030"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_buffer *argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN13040"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_QUERYBUF</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN13060"
+></A
+><H2
+>Description</H2
+><P
+>This ioctl is part of the <A
+HREF="x5791.htm"
+>memory
+mapping</A
+> I/O method. It can be used to query the status of a
+buffer at any time after buffers have been allocated with the
+<A
+HREF="r13696.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_REQBUFS</CODE
+></A
+> ioctl.</P
+><P
+>Applications set the <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field
+    of a struct&nbsp;<A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+> to the same buffer type as previously
+struct&nbsp;<A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+> <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> and struct&nbsp;<A
+HREF="r13696.htm#V4L2-REQUESTBUFFERS"
+>v4l2_requestbuffers</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+>, and the <CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+>
+    field. Valid index numbers range from zero
+to the number of buffers allocated with <A
+HREF="r13696.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_REQBUFS</CODE
+></A
+>
+    (struct&nbsp;<A
+HREF="r13696.htm#V4L2-REQUESTBUFFERS"
+>v4l2_requestbuffers</A
+> <CODE
+CLASS="STRUCTFIELD"
+>count</CODE
+>) minus one.
+After calling <CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYBUF</CODE
+> with a pointer to
+    this structure drivers return an error code or fill the rest of
+the structure.</P
+><P
+>In the <CODE
+CLASS="STRUCTFIELD"
+>flags</CODE
+> field the
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_FLAG_MAPPED</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_FLAG_QUEUED</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_FLAG_DONE</CODE
+> flags will be valid. The
+<CODE
+CLASS="STRUCTFIELD"
+>memory</CODE
+> field will be set to
+<CODE
+CLASS="CONSTANT"
+>V4L2_MEMORY_MMAP</CODE
+>, the <CODE
+CLASS="STRUCTFIELD"
+>m.offset</CODE
+>
+contains the offset of the buffer from the start of the device memory,
+the <CODE
+CLASS="STRUCTFIELD"
+>length</CODE
+> field its size. The driver may
+or may not set the remaining fields and flags, they are meaningless in
+this context.</P
+><P
+>The <CODE
+CLASS="STRUCTNAME"
+>v4l2_buffer</CODE
+> structure is
+    specified in <A
+HREF="x5953.htm"
+>Section 3.5</A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN13091"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The buffer <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> is not
+supported, or the <CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+> is out of bounds.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r12878.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r13105.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_QBUF, VIDIOC_DQBUF</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_QUERYCAP</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r13105.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r13105.htm
new file mode 100644
index 0000000..e1751c9
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r13105.htm
@@ -0,0 +1,723 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_QUERYCAP</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_QUERYBUF"
+HREF="r13022.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_QUERYCTRL, VIDIOC_QUERYMENU"
+HREF="r13317.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r13022.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r13317.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-QUERYCAP"
+></A
+>ioctl VIDIOC_QUERYCAP</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN13109"
+></A
+><H2
+>Name</H2
+>VIDIOC_QUERYCAP&nbsp;--&nbsp;Query device capabilities</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN13112"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN13113"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_capability *argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN13123"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_QUERYCAP</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN13143"
+></A
+><H2
+>Description</H2
+><P
+>All V4L2 devices support the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCAP</CODE
+> ioctl. It is used to identify
+kernel devices compatible with this specification and to obtain
+information about driver and hardware capabilities. The ioctl takes a
+pointer to a struct&nbsp;<A
+HREF="r13105.htm#V4L2-CAPABILITY"
+>v4l2_capability</A
+> which is filled by the driver. When the
+driver is not compatible with this specification the ioctl returns an
+<SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-CAPABILITY"
+></A
+><P
+><B
+>Table 1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_capability</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u8</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>driver</CODE
+>[16]</TD
+><TD
+><P
+>Name of the driver, a unique NUL-terminated
+ASCII string. For example: "bttv". Driver specific applications can
+use this information to verify the driver identity. It is also useful
+to work around known bugs, or to identify drivers in error reports.
+The driver version is stored in the <CODE
+CLASS="STRUCTFIELD"
+>version</CODE
+>
+field.</P
+><P
+>Storing strings in fixed sized arrays is bad
+practice but unavoidable here. Drivers and applications should take
+precautions to never read or write beyond the end of the array and to
+make sure the strings are properly NUL-terminated.</P
+></TD
+></TR
+><TR
+><TD
+>__u8</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>card</CODE
+>[32]</TD
+><TD
+>Name of the device, a NUL-terminated ASCII string.
+For example: "Yoyodyne TV/FM". One driver may support different brands
+or models of video hardware. This information is intended for users,
+for example in a menu of available devices. Since multiple TV cards of
+the same brand may be installed which are supported by the same
+driver, this name should be combined with the character device file
+name (e.&nbsp;g. <TT
+CLASS="FILENAME"
+>/dev/video2</TT
+>) or the
+<CODE
+CLASS="STRUCTFIELD"
+>bus_info</CODE
+> string to avoid
+ambiguities.</TD
+></TR
+><TR
+><TD
+>__u8</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>bus_info</CODE
+>[32]</TD
+><TD
+>Location of the device in the system, a
+NUL-terminated ASCII string. For example: "PCI Slot 4". This
+information is intended for users, to distinguish multiple
+identical devices. If no such information is available the field may
+simply count the devices controlled by the driver, or contain the
+empty string (<CODE
+CLASS="STRUCTFIELD"
+>bus_info</CODE
+>[0] = 0).</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>version</CODE
+></TD
+><TD
+><P
+>Version number of the driver. Together with
+the <CODE
+CLASS="STRUCTFIELD"
+>driver</CODE
+> field this identifies a
+particular driver. The version number is formatted using the
+<CODE
+CLASS="CONSTANT"
+>KERNEL_VERSION()</CODE
+> macro:</P
+></TD
+></TR
+><TR
+><TD
+COLSPAN="3"
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+>#define KERNEL_VERSION(a,b,c) (((a) &lt;&lt; 16) + ((b) &lt;&lt; 8) + (c))
+
+__u32 version = KERNEL_VERSION(0, 8, 1);
+
+printf ("Version: %u.%u.%u\n",
+        (version &gt;&gt; 16) &amp; 0xFF,
+        (version &gt;&gt; 8) &amp; 0xFF,
+         version &amp; 0xFF);</PRE
+></P
+></TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>capabilities</CODE
+></TD
+><TD
+>Device capabilities, see <A
+HREF="r13105.htm#DEVICE-CAPABILITIES"
+>Table 2</A
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+>[4]</TD
+><TD
+>Reserved for future extensions. Drivers must set
+this array to zero.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="DEVICE-CAPABILITIES"
+></A
+><P
+><B
+>Table 2. Device Capabilities Flags</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CAP_VIDEO_CAPTURE</CODE
+></TD
+><TD
+>0x00000001</TD
+><TD
+>The device supports the <A
+HREF="c6488.htm#CAPTURE"
+>Video Capture</A
+> interface.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CAP_VIDEO_OUTPUT</CODE
+></TD
+><TD
+>0x00000002</TD
+><TD
+>The device supports the <A
+HREF="x6831.htm"
+>Video Output</A
+> interface.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CAP_VIDEO_OVERLAY</CODE
+></TD
+><TD
+>0x00000004</TD
+><TD
+>The device supports the <A
+HREF="x6570.htm"
+>Video Overlay</A
+> interface. A video overlay device
+typically stores captured images directly in the video memory of a
+graphics card, with hardware clipping and scaling.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CAP_VBI_CAPTURE</CODE
+></TD
+><TD
+>0x00000010</TD
+><TD
+>The device supports the <A
+HREF="x7013.htm"
+>Raw
+VBI Capture</A
+> interface, providing Teletext and Closed Caption
+data.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CAP_VBI_OUTPUT</CODE
+></TD
+><TD
+>0x00000020</TD
+><TD
+>The device supports the <A
+HREF="x7013.htm"
+>Raw VBI Output</A
+> interface.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CAP_SLICED_VBI_CAPTURE</CODE
+></TD
+><TD
+>0x00000040</TD
+><TD
+>The device supports the <A
+HREF="x7236.htm"
+>Sliced VBI Capture</A
+> interface.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CAP_SLICED_VBI_OUTPUT</CODE
+></TD
+><TD
+>0x00000080</TD
+><TD
+>The device supports the <A
+HREF="x7236.htm"
+>Sliced VBI Output</A
+> interface.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CAP_RDS_CAPTURE</CODE
+></TD
+><TD
+>0x00000100</TD
+><TD
+>[to be defined]</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CAP_VIDEO_OUTPUT_OVERLAY</CODE
+></TD
+><TD
+>0x00000200</TD
+><TD
+>The device supports the <A
+HREF="x6909.htm"
+>Video
+Output Overlay</A
+> (OSD) interface. Unlike the <I
+CLASS="WORDASWORD"
+>Video
+Overlay</I
+> interface, this is a secondary function of video
+output devices and overlays an image onto an outgoing video signal.
+When the driver sets this flag, it must clear the
+<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_VIDEO_OVERLAY</CODE
+> flag and vice
+versa.<A
+NAME="AEN13265"
+HREF="r13105.htm#FTN.AEN13265"
+><SPAN
+CLASS="footnote"
+>[a]</SPAN
+></A
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CAP_TUNER</CODE
+></TD
+><TD
+>0x00010000</TD
+><TD
+>The device has some sort of tuner or modulator to
+receive or emit RF-modulated video signals. For more information about
+tuner and modulator programming see
+<A
+HREF="x394.htm"
+>Section 1.6</A
+>.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CAP_AUDIO</CODE
+></TD
+><TD
+>0x00020000</TD
+><TD
+>The device has audio inputs or outputs. It may or
+may not support audio recording or playback, in PCM or compressed
+formats. PCM audio support must be implemented as ALSA or OSS
+interface. For more information on audio inputs and outputs see <A
+HREF="x341.htm"
+>Section 1.5</A
+>.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CAP_RADIO</CODE
+></TD
+><TD
+>0x00040000</TD
+><TD
+>This is a radio receiver.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CAP_READWRITE</CODE
+></TD
+><TD
+>0x01000000</TD
+><TD
+>The device supports the <A
+HREF="c5742.htm#RW"
+>read()</A
+> and/or <A
+HREF="c5742.htm#RW"
+>write()</A
+>
+I/O methods.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CAP_ASYNCIO</CODE
+></TD
+><TD
+>0x02000000</TD
+><TD
+>The device supports the <A
+HREF="x5950.htm"
+>asynchronous</A
+> I/O methods.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CAP_STREAMING</CODE
+></TD
+><TD
+>0x04000000</TD
+><TD
+>The device supports the <A
+HREF="x5791.htm"
+>streaming</A
+> I/O method.</TD
+></TR
+></TBODY
+><TR
+><TD
+COLSPAN="3"
+>Notes:<BR><A
+NAME="FTN.AEN13265"
+>a. </A
+>The struct&nbsp;<A
+HREF="r10595.htm#V4L2-FRAMEBUFFER"
+>v4l2_framebuffer</A
+> lacks an
+enum&nbsp;<A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+> field, therefore the type of overlay is implied by the
+driver capabilities.<BR></TD
+></TR
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN13305"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The device is not compatible with this
+specification.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r13022.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r13317.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_QUERYBUF</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_QUERYCTRL, VIDIOC_QUERYMENU</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r13317.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r13317.htm
new file mode 100644
index 0000000..0190c69
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r13317.htm
@@ -0,0 +1,1077 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_QUERYCTRL, VIDIOC_QUERYMENU</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_QUERYCAP"
+HREF="r13105.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_QUERYSTD"
+HREF="r13641.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r13105.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r13641.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-QUERYCTRL"
+></A
+>ioctl VIDIOC_QUERYCTRL, VIDIOC_QUERYMENU</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN13321"
+></A
+><H2
+>Name</H2
+>VIDIOC_QUERYCTRL, VIDIOC_QUERYMENU&nbsp;--&nbsp;Enumerate controls and menu control items</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN13325"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN13326"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_queryctrl *argp);</CODE
+></P
+><P
+></P
+></DIV
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN13336"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_querymenu *argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN13346"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_QUERYCTRL, VIDIOC_QUERYMENU</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN13366"
+></A
+><H2
+>Description</H2
+><P
+>To query the attributes of a control applications set the
+<CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+> field of a struct&nbsp;<A
+HREF="r13317.htm#V4L2-QUERYCTRL"
+>v4l2_queryctrl</A
+> and call the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCTRL</CODE
+> ioctl with a pointer to this
+structure. The driver fills the rest of the structure or returns an
+<SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code when the <CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+> is invalid.</P
+><P
+>It is possible to enumerate controls by calling
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCTRL</CODE
+> with successive
+<CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+> values starting from
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_BASE</CODE
+> up to and exclusive
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_BASE_LASTP1</CODE
+>. Drivers may return
+<SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> if a control in this range is not
+supported. Further applications can enumerate private controls, which
+are not defined in this specification, by starting at
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_PRIVATE_BASE</CODE
+> and incrementing
+<CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+> until the driver returns
+<SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+>.</P
+><P
+>In both cases, when the driver sets the
+<CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_FLAG_DISABLED</CODE
+> flag in the
+<CODE
+CLASS="STRUCTFIELD"
+>flags</CODE
+> field this control is permanently
+disabled and should be ignored by the application.<A
+NAME="AEN13386"
+HREF="r13317.htm#FTN.AEN13386"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+></P
+><P
+>When the application ORs <CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+> with
+<CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_FLAG_NEXT_CTRL</CODE
+> the driver returns the
+next supported control, or <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> if there is
+none. Drivers which do not support this flag yet always return
+<SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+>.</P
+><P
+>Additional information is required for menu controls, the
+name of menu items. To query them applications set the
+<CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+> and <CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+>
+fields of struct&nbsp;<A
+HREF="r13317.htm#V4L2-QUERYMENU"
+>v4l2_querymenu</A
+> and call the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYMENU</CODE
+> ioctl with a pointer to this
+structure. The driver fills the rest of the structure or returns an
+<SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code when the <CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+> or
+<CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+> is invalid. Menu items are enumerated
+by calling <CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYMENU</CODE
+> with successive
+<CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+> values from struct&nbsp;<A
+HREF="r13317.htm#V4L2-QUERYCTRL"
+>v4l2_queryctrl</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>minimum</CODE
+> (0) to
+<CODE
+CLASS="STRUCTFIELD"
+>maximum</CODE
+>, inclusive.</P
+><P
+>See also the examples in <A
+HREF="x542.htm"
+>Section 1.8</A
+>.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-QUERYCTRL"
+></A
+><P
+><B
+>Table 1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_queryctrl</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+></TD
+><TD
+>Identifies the control, set by the application. See
+<A
+HREF="x542.htm#CONTROL-ID"
+>Table 1-1</A
+> for predefined IDs. When the ID is ORed
+with V4L2_CTRL_FLAG_NEXT_CTRL the driver clears the flag and returns
+the first control with a higher ID. Drivers which do not support this
+flag yet always return an <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code.</TD
+></TR
+><TR
+><TD
+>enum&nbsp;<A
+HREF="r13317.htm#V4L2-CTRL-TYPE"
+>v4l2_ctrl_type</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+></TD
+><TD
+>Type of control, see <A
+HREF="r13317.htm#V4L2-CTRL-TYPE"
+>Table 3</A
+>.</TD
+></TR
+><TR
+><TD
+>__u8</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>name</CODE
+>[32]</TD
+><TD
+>Name of the control, a NUL-terminated ASCII
+string. This information is intended for the user.</TD
+></TR
+><TR
+><TD
+>__s32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>minimum</CODE
+></TD
+><TD
+>Minimum value, inclusive. This field gives a lower
+bound for <CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_TYPE_INTEGER</CODE
+> controls. It may
+not be valid for any other type of control, including
+<CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_TYPE_INTEGER64</CODE
+> controls. Note this is a
+signed value.</TD
+></TR
+><TR
+><TD
+>__s32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>maximum</CODE
+></TD
+><TD
+>Maximum value, inclusive. This field gives an upper
+bound for <CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_TYPE_INTEGER</CODE
+> controls and the
+highest valid index for <CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_TYPE_MENU</CODE
+>
+controls. It may not be valid for any other type of control, including
+<CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_TYPE_INTEGER64</CODE
+> controls. Note this is a
+signed value.</TD
+></TR
+><TR
+><TD
+>__s32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>step</CODE
+></TD
+><TD
+><P
+>This field gives a step size for
+<CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_TYPE_INTEGER</CODE
+> controls. It may not be
+valid for any other type of control, including
+<CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_TYPE_INTEGER64</CODE
+>
+controls.</P
+><P
+>Generally drivers should not scale hardware
+control values. It may be necessary for example when the
+<CODE
+CLASS="STRUCTFIELD"
+>name</CODE
+> or <CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+> imply
+a particular unit and the hardware actually accepts only multiples of
+said unit. If so, drivers must take care values are properly rounded
+when scaling, such that errors will not accumulate on repeated
+read-write cycles.</P
+><P
+>This field gives the smallest change of
+an integer control actually affecting hardware. Often the information
+is needed when the user can change controls by keyboard or GUI
+buttons, rather than a slider. When for example a hardware register
+accepts values 0-511 and the driver reports 0-65535, step should be
+128.</P
+><P
+>Note although signed, the step value is supposed to
+be always positive.</P
+></TD
+></TR
+><TR
+><TD
+>__s32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>default_value</CODE
+></TD
+><TD
+>The default value of a
+<CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_TYPE_INTEGER</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>_BOOLEAN</CODE
+> or <CODE
+CLASS="CONSTANT"
+>_MENU</CODE
+> control.
+Not valid for other types of controls. Drivers reset controls only
+when the driver is loaded, not later, in particular not when the
+func-open; is called.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>flags</CODE
+></TD
+><TD
+>Control flags, see <A
+HREF="r13317.htm#CONTROL-FLAGS"
+>Table 4</A
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+>[2]</TD
+><TD
+>Reserved for future extensions. Drivers must set
+the array to zero.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-QUERYMENU"
+></A
+><P
+><B
+>Table 2. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_querymenu</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+></TD
+><TD
+>Identifies the control, set by the application
+from the respective struct&nbsp;<A
+HREF="r13317.htm#V4L2-QUERYCTRL"
+>v4l2_queryctrl</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+></TD
+><TD
+>Index of the menu item, starting at zero, set by
+            the application.</TD
+></TR
+><TR
+><TD
+>__u8</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>name</CODE
+>[32]</TD
+><TD
+>Name of the menu item, a NUL-terminated ASCII
+string. This information is intended for the user.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+></TD
+><TD
+>Reserved for future extensions. Drivers must set
+the array to zero.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-CTRL-TYPE"
+></A
+><P
+><B
+>Table 3. enum v4l2_ctrl_type</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="30%"><COL
+WIDTH="5%"
+ALIGN="CENTER"><COL
+WIDTH="5%"
+ALIGN="CENTER"><COL
+WIDTH="5%"
+ALIGN="CENTER"><COL
+WIDTH="55%"><THEAD
+><TR
+><TH
+>Type</TH
+><TH
+><CODE
+CLASS="STRUCTFIELD"
+>minimum</CODE
+></TH
+><TH
+><CODE
+CLASS="STRUCTFIELD"
+>step</CODE
+></TH
+><TH
+><CODE
+CLASS="STRUCTFIELD"
+>maximum</CODE
+></TH
+><TH
+>Description</TH
+></TR
+></THEAD
+><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_TYPE_INTEGER</CODE
+></TD
+><TD
+>any</TD
+><TD
+>any</TD
+><TD
+>any</TD
+><TD
+>An integer-valued control ranging from minimum to
+maximum inclusive. The step value indicates the increment between
+values which are actually different on the hardware.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_TYPE_BOOLEAN</CODE
+></TD
+><TD
+>0</TD
+><TD
+>1</TD
+><TD
+>1</TD
+><TD
+>A boolean-valued control. Zero corresponds to
+"disabled", and one means "enabled".</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_TYPE_MENU</CODE
+></TD
+><TD
+>0</TD
+><TD
+>1</TD
+><TD
+>N-1</TD
+><TD
+>The control has a menu of N choices. The names of
+the menu items can be enumerated with the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYMENU</CODE
+> ioctl.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_TYPE_BUTTON</CODE
+></TD
+><TD
+>0</TD
+><TD
+>0</TD
+><TD
+>0</TD
+><TD
+>A control which performs an action when set.
+Drivers must ignore the value passed with
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_CTRL</CODE
+> and return an <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code on a
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_CTRL</CODE
+> attempt.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_TYPE_INTEGER64</CODE
+></TD
+><TD
+>n/a</TD
+><TD
+>n/a</TD
+><TD
+>n/a</TD
+><TD
+>A 64-bit integer valued control. Minimum, maximum
+and step size cannot be queried.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_TYPE_CTRL_CLASS</CODE
+></TD
+><TD
+>n/a</TD
+><TD
+>n/a</TD
+><TD
+>n/a</TD
+><TD
+>This is not a control. When
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCTRL</CODE
+> is called with a control ID
+equal to a control class code (see <A
+HREF="r10386.htm#CTRL-CLASS"
+>Table 3</A
+>), the
+ioctl returns the name of the control class and this control type.
+Older drivers which do not support this feature return an
+<SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="CONTROL-FLAGS"
+></A
+><P
+><B
+>Table 4. Control Flags</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_FLAG_DISABLED</CODE
+></TD
+><TD
+>0x0001</TD
+><TD
+>This control is permanently disabled and should be
+ignored by the application. Any attempt to change the control will
+result in an <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_FLAG_GRABBED</CODE
+></TD
+><TD
+>0x0002</TD
+><TD
+>This control is temporarily unchangeable, for
+example because another application took over control of the
+respective resource. Such controls may be displayed specially in a
+user interface. Attempts to change the control may result in an
+<SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+> error code.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_FLAG_READ_ONLY</CODE
+></TD
+><TD
+>0x0004</TD
+><TD
+>This control is permanently readable only. Any
+attempt to change the control will result in an <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_FLAG_UPDATE</CODE
+></TD
+><TD
+>0x0008</TD
+><TD
+>A hint that changing this control may affect the
+value of other controls within the same control class. Applications
+should update their user interface accordingly.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_FLAG_INACTIVE</CODE
+></TD
+><TD
+>0x0010</TD
+><TD
+>This control is not applicable to the current
+configuration and should be displayed accordingly in a user interface.
+For example the flag may be set on a MPEG audio level 2 bitrate
+control when MPEG audio encoding level 1 was selected with another
+control.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_FLAG_SLIDER</CODE
+></TD
+><TD
+>0x0020</TD
+><TD
+>A hint that this control is best represented as a
+slider-like element in a user interface.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN13624"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The struct&nbsp;<A
+HREF="r13317.htm#V4L2-QUERYCTRL"
+>v4l2_queryctrl</A
+> <CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+>
+is invalid. The struct&nbsp;<A
+HREF="r13317.htm#V4L2-QUERYMENU"
+>v4l2_querymenu</A
+> <CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+> or
+<CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+> is invalid.</P
+></DD
+></DL
+></DIV
+></DIV
+><H2
+CLASS="FOOTNOTES"
+>Notes</H2
+><TABLE
+BORDER="0"
+CLASS="FOOTNOTES"
+WIDTH="100%"
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="5%"
+><A
+NAME="FTN.AEN13386"
+HREF="r13317.htm#AEN13386"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="95%"
+><P
+><CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_FLAG_DISABLED</CODE
+> was
+intended for two purposes: Drivers can skip predefined controls not
+supported by the hardware (although returning EINVAL would do as
+well), or disable predefined and private controls after hardware
+detection without the trouble of reordering control arrays and indices
+(EINVAL cannot be used to skip private controls because it would
+prematurely end the enumeration).</P
+></TD
+></TR
+></TABLE
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r13105.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r13641.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_QUERYCAP</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_QUERYSTD</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r13641.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r13641.htm
new file mode 100644
index 0000000..5c6b379
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r13641.htm
@@ -0,0 +1,279 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_QUERYSTD</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_QUERYCTRL, VIDIOC_QUERYMENU"
+HREF="r13317.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_REQBUFS"
+HREF="r13696.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r13317.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r13696.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-QUERYSTD"
+></A
+>ioctl VIDIOC_QUERYSTD</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN13645"
+></A
+><H2
+>Name</H2
+>VIDIOC_QUERYSTD&nbsp;--&nbsp;Sense the video standard received by the current
+input</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN13648"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN13649"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, v4l2_std_id *argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN13659"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_QUERYSTD</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN13679"
+></A
+><H2
+>Description</H2
+><P
+>The hardware may be able to detect the current video
+standard automatically. To do so, applications call <CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYSTD</CODE
+> with a pointer to a <A
+HREF="r9288.htm#V4L2-STD-ID"
+>v4l2_std_id</A
+> type. The
+driver stores here a set of candidates, this can be a single flag or a
+set of supported standards if for example the hardware can only
+distinguish between 50 and 60 Hz systems. When detection is not
+possible or fails, the set must contain all standards supported by the
+current video input or output.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN13684"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>This ioctl is not supported.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r13317.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r13696.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_QUERYCTRL, VIDIOC_QUERYMENU</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_REQBUFS</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r13696.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r13696.htm
new file mode 100644
index 0000000..e37c934
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r13696.htm
@@ -0,0 +1,516 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_REQBUFS</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_QUERYSTD"
+HREF="r13641.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_STREAMON, VIDIOC_STREAMOFF"
+HREF="r13817.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r13641.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r13817.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-REQBUFS"
+></A
+>ioctl VIDIOC_REQBUFS</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN13700"
+></A
+><H2
+>Name</H2
+>VIDIOC_REQBUFS&nbsp;--&nbsp;Initiate Memory Mapping or User Pointer I/O</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN13703"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN13704"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_requestbuffers *argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN13714"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_REQBUFS</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN13734"
+></A
+><H2
+>Description</H2
+><P
+>This ioctl is used to initiate <A
+HREF="x5791.htm"
+>memory
+mapped</A
+> or <A
+HREF="x5884.htm"
+>user pointer</A
+>
+I/O. Memory mapped buffers are located in device memory and must be
+allocated with this ioctl before they can be mapped into the
+application's address space. User buffers are allocated by
+applications themselves, and this ioctl is merely used to switch the
+driver into user pointer I/O mode.</P
+><P
+>To allocate device buffers applications initialize three
+fields of a <CODE
+CLASS="STRUCTNAME"
+>v4l2_requestbuffers</CODE
+> structure.
+They set the <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field to the respective
+stream or buffer type, the <CODE
+CLASS="STRUCTFIELD"
+>count</CODE
+> field to
+the desired number of buffers, and <CODE
+CLASS="STRUCTFIELD"
+>memory</CODE
+>
+must be set to <CODE
+CLASS="CONSTANT"
+>V4L2_MEMORY_MMAP</CODE
+>. When the ioctl
+is called with a pointer to this structure the driver attempts to
+allocate the requested number of buffers and stores the actual number
+allocated in the <CODE
+CLASS="STRUCTFIELD"
+>count</CODE
+> field. It can be
+smaller than the number requested, even zero, when the driver runs out
+of free memory. A larger number is possible when the driver requires
+more buffers to function correctly.<A
+NAME="AEN13746"
+HREF="r13696.htm#FTN.AEN13746"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+> When memory mapping I/O is not supported the ioctl
+returns an <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code.</P
+><P
+>Applications can call <CODE
+CLASS="CONSTANT"
+>VIDIOC_REQBUFS</CODE
+>
+again to change the number of buffers, however this cannot succeed
+when any buffers are still mapped. A <CODE
+CLASS="STRUCTFIELD"
+>count</CODE
+>
+value of zero frees all buffers, after aborting or finishing any DMA
+in progress, an implicit <A
+HREF="r13817.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMOFF</CODE
+></A
+>. </P
+><P
+>To negotiate user pointer I/O, applications initialize only
+the <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field and set
+<CODE
+CLASS="STRUCTFIELD"
+>memory</CODE
+> to
+<CODE
+CLASS="CONSTANT"
+>V4L2_MEMORY_USERPTR</CODE
+>. When the ioctl is called
+with a pointer to this structure the driver prepares for user pointer
+I/O, when this I/O method is not supported the ioctl returns an
+<SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-REQUESTBUFFERS"
+></A
+><P
+><B
+>Table 1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_requestbuffers</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>count</CODE
+></TD
+><TD
+>The number of buffers requested or granted. This
+field is only used when <CODE
+CLASS="STRUCTFIELD"
+>memory</CODE
+> is set to
+<CODE
+CLASS="CONSTANT"
+>V4L2_MEMORY_MMAP</CODE
+>.</TD
+></TR
+><TR
+><TD
+>enum&nbsp;<A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+></TD
+><TD
+>Type of the stream or buffers, this is the same
+as the struct&nbsp;<A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+> <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field. See <A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>Table 3-2</A
+> for valid values.</TD
+></TR
+><TR
+><TD
+>enum&nbsp;<A
+HREF="x5953.htm#V4L2-MEMORY"
+>v4l2_memory</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>memory</CODE
+></TD
+><TD
+>Applications set this field to
+<CODE
+CLASS="CONSTANT"
+>V4L2_MEMORY_MMAP</CODE
+> or
+<CODE
+CLASS="CONSTANT"
+>V4L2_MEMORY_USERPTR</CODE
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+>[2]</TD
+><TD
+>A place holder for future extensions and custom
+(driver defined) buffer types <CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_PRIVATE</CODE
+> and
+higher.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN13798"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+></DT
+><DD
+><P
+>The driver supports multiple opens and I/O is already
+in progress, or reallocation of buffers was attempted although one or
+more are still mapped.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The buffer type (<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field) or the
+requested I/O method (<CODE
+CLASS="STRUCTFIELD"
+>memory</CODE
+>) is not
+supported.</P
+></DD
+></DL
+></DIV
+></DIV
+><H2
+CLASS="FOOTNOTES"
+>Notes</H2
+><TABLE
+BORDER="0"
+CLASS="FOOTNOTES"
+WIDTH="100%"
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="5%"
+><A
+NAME="FTN.AEN13746"
+HREF="r13696.htm#AEN13746"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="95%"
+><P
+>For example video output requires at least two buffers,
+one displayed and one filled by the application.</P
+></TD
+></TR
+></TABLE
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r13641.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r13817.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_QUERYSTD</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_STREAMON, VIDIOC_STREAMOFF</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r13817.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r13817.htm
new file mode 100644
index 0000000..5e9f107
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r13817.htm
@@ -0,0 +1,339 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_STREAMON, VIDIOC_STREAMOFF</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_REQBUFS"
+HREF="r13696.htm"><LINK
+REL="NEXT"
+TITLE="V4L2 mmap()"
+HREF="r13889.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r13696.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r13889.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-STREAMON"
+></A
+>ioctl VIDIOC_STREAMON, VIDIOC_STREAMOFF</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN13821"
+></A
+><H2
+>Name</H2
+>VIDIOC_STREAMON, VIDIOC_STREAMOFF&nbsp;--&nbsp;Start or stop streaming I/O</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN13825"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN13826"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, const int *argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN13836"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_STREAMON, VIDIOC_STREAMOFF</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN13856"
+></A
+><H2
+>Description</H2
+><P
+>The <CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMON</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMOFF</CODE
+> ioctl start and stop the capture
+or output process during streaming (<A
+HREF="x5791.htm"
+>memory
+mapping</A
+> or <A
+HREF="x5884.htm"
+>user pointer</A
+>) I/O.</P
+><P
+>Specifically the capture hardware is disabled and no input
+buffers are filled (if there are any empty buffers in the incoming
+queue) until <CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMON</CODE
+> has been called.
+Accordingly the output hardware is disabled, no video signal is
+produced until <CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMON</CODE
+> has been called.
+The ioctl will succeed only when at least one output buffer is in the
+incoming queue.</P
+><P
+>The <CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMOFF</CODE
+> ioctl, apart of
+aborting or finishing any DMA in progress, unlocks any user pointer
+buffers locked in physical memory, and it removes all buffers from the
+incoming and outgoing queues. That means all images captured but not
+dequeued yet will be lost, likewise all images enqueued for output but
+not transmitted yet. I/O returns to the same state as after calling
+<A
+HREF="r13696.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_REQBUFS</CODE
+></A
+> and can be restarted accordingly.</P
+><P
+>Both ioctls take a pointer to an integer, the desired buffer or
+stream type. This is the same as struct&nbsp;<A
+HREF="r13696.htm#V4L2-REQUESTBUFFERS"
+>v4l2_requestbuffers</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+>.</P
+><P
+>Note applications can be preempted for unknown periods right
+before or after the <CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMON</CODE
+> or
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMOFF</CODE
+> calls, there is no notion of
+starting or stopping "now". Buffer timestamps can be used to
+synchronize with other events.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN13876"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>Streaming I/O is not supported, the buffer
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> is not supported, or no buffers have
+been allocated (memory mapping) or enqueued (output) yet.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r13696.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r13889.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_REQBUFS</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>V4L2 mmap()</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r13889.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r13889.htm
new file mode 100644
index 0000000..a1e271c
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r13889.htm
@@ -0,0 +1,550 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>V4L2 mmap()</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_STREAMON, VIDIOC_STREAMOFF"
+HREF="r13817.htm"><LINK
+REL="NEXT"
+TITLE="V4L2 munmap()"
+HREF="r14037.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r13817.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r14037.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="FUNC-MMAP"
+></A
+>V4L2 mmap()</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN13893"
+></A
+><H2
+>Name</H2
+>v4l2-mmap&nbsp;--&nbsp;Map device memory into application address space</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN13896"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN13897"
+></A
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include &lt;unistd.h&gt;
+#include &lt;sys/mman.h&gt;</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void *mmap</CODE
+>(void *start, size_t length, int prot, int flags, int fd, off_t offset);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN13914"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>start</CODE
+></DT
+><DD
+><P
+>Map the buffer to this address in the 
+application's address space. When the <CODE
+CLASS="CONSTANT"
+>MAP_FIXED</CODE
+>
+flag is specified, <CODE
+CLASS="PARAMETER"
+>start</CODE
+> must be a multiple of the
+pagesize and mmap will fail when the specified address
+cannot be used. Use of this option is discouraged; applications should
+just specify a <CODE
+CLASS="CONSTANT"
+>NULL</CODE
+> pointer here.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>length</CODE
+></DT
+><DD
+><P
+>Length of the memory area to map. This must be the
+same value as returned by the driver in the struct&nbsp;<A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>length</CODE
+> field.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>prot</CODE
+></DT
+><DD
+><P
+>The <CODE
+CLASS="PARAMETER"
+>prot</CODE
+> argument describes the
+desired memory protection. Regardless of the device type and the
+direction of data exchange it should be set to
+<CODE
+CLASS="CONSTANT"
+>PROT_READ</CODE
+> | <CODE
+CLASS="CONSTANT"
+>PROT_WRITE</CODE
+>,
+permitting read and write access to image buffers. Drivers should
+support at least this combination of flags. Note the Linux
+<TT
+CLASS="FILENAME"
+>video-buf</TT
+> kernel module, which is used by the
+bttv, saa7134, saa7146, cx88 and vivi driver supports only
+<CODE
+CLASS="CONSTANT"
+>PROT_READ</CODE
+> | <CODE
+CLASS="CONSTANT"
+>PROT_WRITE</CODE
+>. When
+the driver does not support the desired protection the
+<CODE
+CLASS="FUNCTION"
+>mmap()</CODE
+> function fails.</P
+><P
+>Note device memory accesses (e.&nbsp;g. the memory on a
+graphics card with video capturing hardware) may incur a performance
+penalty compared to main memory accesses, or reads may be
+significantly slower than writes or vice versa. Other I/O methods may
+be more efficient in this case.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>flags</CODE
+></DT
+><DD
+><P
+>The <CODE
+CLASS="PARAMETER"
+>flags</CODE
+> parameter
+specifies the type of the mapped object, mapping options and whether
+modifications made to the mapped copy of the page are private to the
+process or are to be shared with other references.</P
+><P
+><CODE
+CLASS="CONSTANT"
+>MAP_FIXED</CODE
+> requests that the
+driver selects no other address than the one specified. If the
+specified address cannot be used, <CODE
+CLASS="FUNCTION"
+>mmap()</CODE
+> will fail. If
+<CODE
+CLASS="CONSTANT"
+>MAP_FIXED</CODE
+> is specified,
+<CODE
+CLASS="PARAMETER"
+>start</CODE
+> must be a multiple of the pagesize. Use
+of this option is discouraged.</P
+><P
+>One of the <CODE
+CLASS="CONSTANT"
+>MAP_SHARED</CODE
+> or
+<CODE
+CLASS="CONSTANT"
+>MAP_PRIVATE</CODE
+> flags must be set.
+<CODE
+CLASS="CONSTANT"
+>MAP_SHARED</CODE
+> allows applications to share the
+mapped memory with other (e.&nbsp;g. child-) processes. Note the Linux
+<TT
+CLASS="FILENAME"
+>video-buf</TT
+> module which is used by the bttv,
+saa7134, saa7146, cx88 and vivi driver supports only
+<CODE
+CLASS="CONSTANT"
+>MAP_SHARED</CODE
+>. <CODE
+CLASS="CONSTANT"
+>MAP_PRIVATE</CODE
+>
+requests copy-on-write semantics. V4L2 applications should not set the
+<CODE
+CLASS="CONSTANT"
+>MAP_PRIVATE</CODE
+>, <CODE
+CLASS="CONSTANT"
+>MAP_DENYWRITE</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>MAP_EXECUTABLE</CODE
+> or <CODE
+CLASS="CONSTANT"
+>MAP_ANON</CODE
+>
+flag.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>offset</CODE
+></DT
+><DD
+><P
+>Offset of the buffer in device memory. This must be the
+same value as returned by the driver in the struct&nbsp;<A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>m</CODE
+> union <CODE
+CLASS="STRUCTFIELD"
+>offset</CODE
+> field.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN13982"
+></A
+><H2
+>Description</H2
+><P
+>The <CODE
+CLASS="FUNCTION"
+>mmap()</CODE
+> function asks to map
+<CODE
+CLASS="PARAMETER"
+>length</CODE
+> bytes starting at
+<CODE
+CLASS="PARAMETER"
+>offset</CODE
+> in the memory of the device specified by
+<CODE
+CLASS="PARAMETER"
+>fd</CODE
+> into the application address space,
+preferably at address <CODE
+CLASS="PARAMETER"
+>start</CODE
+>. This latter
+address is a hint only, and is usually specified as 0.</P
+><P
+>Suitable length and offset parameters are queried with the
+<A
+HREF="r13022.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYBUF</CODE
+></A
+> ioctl. Buffers must be allocated with the
+<A
+HREF="r13696.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_REQBUFS</CODE
+></A
+> ioctl before they can be queried.</P
+><P
+>To unmap buffers the <A
+HREF="r14037.htm"
+><CODE
+CLASS="FUNCTION"
+>munmap()</CODE
+></A
+> function is used.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN13998"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <CODE
+CLASS="FUNCTION"
+>mmap()</CODE
+> returns a pointer to
+the mapped buffer. On error <CODE
+CLASS="CONSTANT"
+>MAP_FAILED</CODE
+> (-1) is
+returned, and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set
+appropriately. Possible error codes are:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EBADF</SPAN
+></DT
+><DD
+><P
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+> is not a valid file
+descriptor.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EACCES</SPAN
+></DT
+><DD
+><P
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+> is
+not open for reading and writing.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The <CODE
+CLASS="PARAMETER"
+>start</CODE
+> or
+<CODE
+CLASS="PARAMETER"
+>length</CODE
+> or <CODE
+CLASS="PARAMETER"
+>offset</CODE
+> are not
+suitable. (E.&nbsp;g. they are too large, or not aligned on a
+<CODE
+CLASS="CONSTANT"
+>PAGESIZE</CODE
+> boundary.)</P
+><P
+>The <CODE
+CLASS="PARAMETER"
+>flags</CODE
+> or
+<CODE
+CLASS="PARAMETER"
+>prot</CODE
+> value is not supported.</P
+><P
+>No buffers have been allocated with the
+<A
+HREF="r13696.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_REQBUFS</CODE
+></A
+> ioctl.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>ENOMEM</SPAN
+></DT
+><DD
+><P
+>Not enough physical or virtual memory was available to
+complete the request.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r13817.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r14037.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_STREAMON, VIDIOC_STREAMOFF</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>V4L2 munmap()</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r14037.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r14037.htm
new file mode 100644
index 0000000..b43f599
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r14037.htm
@@ -0,0 +1,288 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>V4L2 munmap()</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="V4L2 mmap()"
+HREF="r13889.htm"><LINK
+REL="NEXT"
+TITLE="V4L2 open()"
+HREF="r14090.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r13889.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r14090.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="FUNC-MUNMAP"
+></A
+>V4L2 munmap()</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN14041"
+></A
+><H2
+>Name</H2
+>v4l2-munmap&nbsp;--&nbsp;Unmap device memory</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN14044"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN14045"
+></A
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include &lt;unistd.h&gt;
+#include &lt;sys/mman.h&gt;</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int munmap</CODE
+>(void *start, size_t length);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN14054"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>start</CODE
+></DT
+><DD
+><P
+>Address of the mapped buffer as returned by the
+<A
+HREF="r13889.htm"
+><CODE
+CLASS="FUNCTION"
+>mmap()</CODE
+></A
+> function.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>length</CODE
+></DT
+><DD
+><P
+>Length of the mapped buffer. This must be the same
+value as given to <CODE
+CLASS="FUNCTION"
+>mmap()</CODE
+> and returned by the
+driver in the struct&nbsp;<A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+> <CODE
+CLASS="STRUCTFIELD"
+>length</CODE
+>
+field.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN14072"
+></A
+><H2
+>Description</H2
+><P
+>Unmaps a previously with the <A
+HREF="r13889.htm"
+><CODE
+CLASS="FUNCTION"
+>mmap()</CODE
+></A
+> function mapped
+buffer and frees it, if possible. </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN14077"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <CODE
+CLASS="FUNCTION"
+>munmap()</CODE
+> returns 0, on
+failure -1 and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set
+appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The <CODE
+CLASS="PARAMETER"
+>start</CODE
+> or
+<CODE
+CLASS="PARAMETER"
+>length</CODE
+> is incorrect, or no buffers have been
+mapped yet.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r13889.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r14090.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>V4L2 mmap()</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>V4L2 open()</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r14090.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r14090.htm
new file mode 100644
index 0000000..34c2fdf
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r14090.htm
@@ -0,0 +1,345 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>V4L2 open()</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="V4L2 munmap()"
+HREF="r14037.htm"><LINK
+REL="NEXT"
+TITLE="V4L2 poll()"
+HREF="r14169.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r14037.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r14169.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="FUNC-OPEN"
+></A
+>V4L2 open()</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN14094"
+></A
+><H2
+>Name</H2
+>v4l2-open&nbsp;--&nbsp;Open a V4L2 device</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN14097"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN14098"
+></A
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include &lt;fcntl.h&gt;</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int open</CODE
+>(const char *device_name, int flags);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN14107"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>device_name</CODE
+></DT
+><DD
+><P
+>Device to be opened.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>flags</CODE
+></DT
+><DD
+><P
+>Open flags. Access mode must be
+<CODE
+CLASS="CONSTANT"
+>O_RDWR</CODE
+>. This is just a technicality, input devices
+still support only reading and output devices only writing.</P
+><P
+>When the <CODE
+CLASS="CONSTANT"
+>O_NONBLOCK</CODE
+> flag is
+given, the read() function and the <A
+HREF="r12878.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_DQBUF</CODE
+></A
+> ioctl will return
+the <SPAN
+CLASS="ERRORCODE"
+>EAGAIN</SPAN
+> error code when no data is available or no buffer is in the driver
+outgoing queue, otherwise these functions block until data becomes
+available. All V4L2 drivers exchanging data with applications must
+support the <CODE
+CLASS="CONSTANT"
+>O_NONBLOCK</CODE
+> flag.</P
+><P
+>Other flags have no effect.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN14128"
+></A
+><H2
+>Description</H2
+><P
+>To open a V4L2 device applications call
+<CODE
+CLASS="FUNCTION"
+>open()</CODE
+> with the desired device name. This
+function has no side effects; all data format parameters, current
+input or output, control values or other properties remain unchanged.
+At the first <CODE
+CLASS="FUNCTION"
+>open()</CODE
+> call after loading the driver
+they will be reset to default values, drivers are never in an
+undefined state.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN14133"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <CODE
+CLASS="FUNCTION"
+>open</CODE
+> returns the new file
+descriptor. On error -1 is returned, and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+>
+variable is set appropriately. Possible error codes are:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EACCES</SPAN
+></DT
+><DD
+><P
+>The caller has no permission to access the
+device.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+></DT
+><DD
+><P
+>The driver does not support multiple opens and the
+device is already in use.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>ENXIO</SPAN
+></DT
+><DD
+><P
+>No device corresponding to this device special file
+exists.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>ENOMEM</SPAN
+></DT
+><DD
+><P
+>Not enough kernel memory was available to complete the
+request.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EMFILE</SPAN
+></DT
+><DD
+><P
+>The  process  already  has  the  maximum number of
+files open.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>ENFILE</SPAN
+></DT
+><DD
+><P
+>The limit on the total number of files open on the
+system has been reached.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r14037.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r14169.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>V4L2 munmap()</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>V4L2 poll()</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r14169.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r14169.htm
new file mode 100644
index 0000000..744336e
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r14169.htm
@@ -0,0 +1,413 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>V4L2 poll()</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="V4L2 open()"
+HREF="r14090.htm"><LINK
+REL="NEXT"
+TITLE="V4L2 read()"
+HREF="r14264.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r14090.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r14264.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="FUNC-POLL"
+></A
+>V4L2 poll()</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN14173"
+></A
+><H2
+>Name</H2
+>v4l2-poll&nbsp;--&nbsp;Wait for some event on a file descriptor</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN14176"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN14177"
+></A
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include &lt;sys/poll.h&gt;</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int poll</CODE
+>(struct pollfd *ufds, unsigned int nfds, int timeout);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN14188"
+></A
+><H2
+>Description</H2
+><P
+>With the <CODE
+CLASS="FUNCTION"
+>poll()</CODE
+> function applications
+can suspend execution until the driver has captured data or is ready
+to accept data for output.</P
+><P
+>When streaming I/O has been negotiated this function waits
+until a buffer has been filled or displayed and can be dequeued with
+the <A
+HREF="r12878.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_DQBUF</CODE
+></A
+> ioctl. When buffers are already in the outgoing
+queue of the driver the function returns immediately.</P
+><P
+>On success <CODE
+CLASS="FUNCTION"
+>poll()</CODE
+> returns the number of
+file descriptors that have been selected (that is, file descriptors
+for which the <CODE
+CLASS="STRUCTFIELD"
+>revents</CODE
+> field of the
+respective <CODE
+CLASS="STRUCTNAME"
+>pollfd</CODE
+> structure is non-zero).
+Capture devices set the <CODE
+CLASS="CONSTANT"
+>POLLIN</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>POLLRDNORM</CODE
+> flags in the
+<CODE
+CLASS="STRUCTFIELD"
+>revents</CODE
+> field, output devices the
+<CODE
+CLASS="CONSTANT"
+>POLLOUT</CODE
+> and <CODE
+CLASS="CONSTANT"
+>POLLWRNORM</CODE
+>
+flags. When the function timed out it returns a value of zero, on
+failure it returns <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the
+<CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately. When the
+application did not call <A
+HREF="r12878.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QBUF</CODE
+></A
+> or <A
+HREF="r13817.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMON</CODE
+></A
+> yet the
+<CODE
+CLASS="FUNCTION"
+>poll()</CODE
+> function succeeds, but sets the
+<CODE
+CLASS="CONSTANT"
+>POLLERR</CODE
+> flag in the
+<CODE
+CLASS="STRUCTFIELD"
+>revents</CODE
+> field.</P
+><P
+>When use of the <CODE
+CLASS="FUNCTION"
+>read()</CODE
+> function has
+been negotiated and the driver does not capture yet, the
+<CODE
+CLASS="FUNCTION"
+>poll</CODE
+> function starts capturing. When that fails
+it returns a <CODE
+CLASS="CONSTANT"
+>POLLERR</CODE
+> as above. Otherwise it waits
+until data has been captured and can be read. When the driver captures
+continuously (as opposed to, for example, still images) the function
+may return immediately.</P
+><P
+>When use of the <CODE
+CLASS="FUNCTION"
+>write()</CODE
+> function has
+been negotiated the <CODE
+CLASS="FUNCTION"
+>poll</CODE
+> function just waits
+until the driver is ready for a non-blocking
+<CODE
+CLASS="FUNCTION"
+>write()</CODE
+> call.</P
+><P
+>All drivers implementing the <CODE
+CLASS="FUNCTION"
+>read()</CODE
+> or
+<CODE
+CLASS="FUNCTION"
+>write()</CODE
+> function or streaming I/O must also
+support the <CODE
+CLASS="FUNCTION"
+>poll()</CODE
+> function.</P
+><P
+>For more details see the
+<CODE
+CLASS="FUNCTION"
+>poll()</CODE
+> manual page.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN14227"
+></A
+><H2
+>Return Value</H2
+><P
+>On success, <CODE
+CLASS="FUNCTION"
+>poll()</CODE
+> returns the number
+structures which have non-zero <CODE
+CLASS="STRUCTFIELD"
+>revents</CODE
+>
+fields, or zero if the call timed out. On error
+<SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> is returned, and the
+<CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EBADF</SPAN
+></DT
+><DD
+><P
+>One or more of the <CODE
+CLASS="PARAMETER"
+>ufds</CODE
+> members
+specify an invalid file descriptor.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+></DT
+><DD
+><P
+>The driver does not support multiple read or write
+streams and the device is already in use.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EFAULT</SPAN
+></DT
+><DD
+><P
+><CODE
+CLASS="PARAMETER"
+>ufds</CODE
+> references an inaccessible
+memory area.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINTR</SPAN
+></DT
+><DD
+><P
+>The call was interrupted by a signal.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The <CODE
+CLASS="PARAMETER"
+>nfds</CODE
+> argument is greater
+than <CODE
+CLASS="CONSTANT"
+>OPEN_MAX</CODE
+>.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r14090.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r14264.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>V4L2 open()</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>V4L2 read()</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r14264.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r14264.htm
new file mode 100644
index 0000000..d27d760
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r14264.htm
@@ -0,0 +1,503 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>V4L2 read()</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="V4L2 poll()"
+HREF="r14169.htm"><LINK
+REL="NEXT"
+TITLE="V4L2 select()"
+HREF="r14390.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r14169.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r14390.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="FUNC-READ"
+></A
+>V4L2 read()</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN14268"
+></A
+><H2
+>Name</H2
+>v4l2-read&nbsp;--&nbsp;Read from a V4L2 device</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN14271"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN14272"
+></A
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include &lt;unistd.h&gt;</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>ssize_t read</CODE
+>(int fd, void *buf, size_t count);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN14283"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>buf</CODE
+></DT
+><DD
+><P
+></P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>count</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN14303"
+></A
+><H2
+>Description</H2
+><P
+><CODE
+CLASS="FUNCTION"
+>read()</CODE
+> attempts to read up to
+<CODE
+CLASS="PARAMETER"
+>count</CODE
+> bytes from file descriptor
+<CODE
+CLASS="PARAMETER"
+>fd</CODE
+> into the buffer starting at
+<CODE
+CLASS="PARAMETER"
+>buf</CODE
+>. The layout of the data in the buffer is
+discussed in the respective device interface section, see ##. If <CODE
+CLASS="PARAMETER"
+>count</CODE
+> is zero,
+<CODE
+CLASS="FUNCTION"
+>read()</CODE
+> returns zero and has no other results. If
+<CODE
+CLASS="PARAMETER"
+>count</CODE
+> is greater than
+<CODE
+CLASS="CONSTANT"
+>SSIZE_MAX</CODE
+>, the result is unspecified. Regardless
+of the <CODE
+CLASS="PARAMETER"
+>count</CODE
+> value each
+<CODE
+CLASS="FUNCTION"
+>read()</CODE
+> call will provide at most one frame (two
+fields) worth of data.</P
+><P
+>By default <CODE
+CLASS="FUNCTION"
+>read()</CODE
+> blocks until data
+becomes available. When the <CODE
+CLASS="CONSTANT"
+>O_NONBLOCK</CODE
+> flag was
+given to the <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+> function it
+returns immediately with an <SPAN
+CLASS="ERRORCODE"
+>EAGAIN</SPAN
+> error code when no data is available. The
+<A
+HREF="r14390.htm"
+><CODE
+CLASS="FUNCTION"
+>select()</CODE
+></A
+> or <A
+HREF="r14169.htm"
+><CODE
+CLASS="FUNCTION"
+>poll()</CODE
+></A
+> functions
+can always be used to suspend execution until data becomes available. All
+drivers supporting the <CODE
+CLASS="FUNCTION"
+>read()</CODE
+> function must also
+support <CODE
+CLASS="FUNCTION"
+>select()</CODE
+> and
+<CODE
+CLASS="FUNCTION"
+>poll()</CODE
+>.</P
+><P
+>Drivers can implement read functionality in different
+ways, using a single or multiple buffers and discarding the oldest or
+newest frames once the internal buffers are filled.</P
+><P
+><CODE
+CLASS="FUNCTION"
+>read()</CODE
+> never returns a "snapshot" of a
+buffer being filled. Using a single buffer the driver will stop
+capturing when the application starts reading the buffer until the
+read is finished. Thus only the period of the vertical blanking
+interval is available for reading, or the capture rate must fall below
+the nominal frame rate of the video standard.</P
+><P
+>The behavior of
+<CODE
+CLASS="FUNCTION"
+>read()</CODE
+> when called during the active picture
+period or the vertical blanking separating the top and bottom field
+depends on the discarding policy. A driver discarding the oldest
+frames keeps capturing into an internal buffer, continuously
+overwriting the previously, not read frame, and returns the frame
+being received at the time of the <CODE
+CLASS="FUNCTION"
+>read()</CODE
+> call as
+soon as it is complete.</P
+><P
+>A driver discarding the newest frames stops capturing until
+the next <CODE
+CLASS="FUNCTION"
+>read()</CODE
+> call. The frame being received at
+<CODE
+CLASS="FUNCTION"
+>read()</CODE
+> time is discarded, returning the following
+frame instead. Again this implies a reduction of the capture rate to
+one half or less of the nominal frame rate. An example of this model
+is the video read mode of the bttv driver, initiating a DMA to user
+memory when <CODE
+CLASS="FUNCTION"
+>read()</CODE
+> is called and returning when
+the DMA finished.</P
+><P
+>In the multiple buffer model drivers maintain a ring of
+internal buffers, automatically advancing to the next free buffer.
+This allows continuous capturing when the application can empty the
+buffers fast enough. Again, the behavior when the driver runs out of
+free buffers depends on the discarding policy.</P
+><P
+>Applications can get and set the number of buffers used
+internally by the driver with the <A
+HREF="r11680.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_PARM</CODE
+></A
+> and <A
+HREF="r11680.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_PARM</CODE
+></A
+>
+ioctls. They are optional, however. The discarding policy is not
+reported and cannot be changed. For minimum requirements see <A
+HREF="c6488.htm"
+>Chapter 4</A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN14346"
+></A
+><H2
+>Return Value</H2
+><P
+>On success, the number of bytes read is returned. It is not
+an error if this number is smaller than the number of bytes requested,
+or the amount of data required for one frame. This may happen for
+example because <CODE
+CLASS="FUNCTION"
+>read()</CODE
+> was interrupted by a
+signal. On error, -1 is returned, and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+>
+variable is set appropriately. In this case the next read will start
+at the beginning of a new frame. Possible error codes are:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EAGAIN</SPAN
+></DT
+><DD
+><P
+>Non-blocking I/O has been selected using
+O_NONBLOCK and no data was immediately available for reading.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EBADF</SPAN
+></DT
+><DD
+><P
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+> is not a valid file
+descriptor or is not open for reading, or the process already has the
+maximum number of files open.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+></DT
+><DD
+><P
+>The driver does not support multiple read streams and the
+device is already in use.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EFAULT</SPAN
+></DT
+><DD
+><P
+><CODE
+CLASS="PARAMETER"
+>buf</CODE
+> references an inaccessible
+memory area.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINTR</SPAN
+></DT
+><DD
+><P
+>The call was interrupted by a signal before any
+data was read.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EIO</SPAN
+></DT
+><DD
+><P
+>I/O error. This indicates some hardware problem or a
+failure to communicate with a remote device (USB camera etc.).</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The <CODE
+CLASS="FUNCTION"
+>read()</CODE
+> function is not
+supported by this driver, not on this device, or generally not on this
+type of device.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r14169.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r14390.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>V4L2 poll()</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>V4L2 select()</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r14390.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r14390.htm
new file mode 100644
index 0000000..4d4391f
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r14390.htm
@@ -0,0 +1,470 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>V4L2 select()</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="V4L2 read()"
+HREF="r14264.htm"><LINK
+REL="NEXT"
+TITLE="V4L2 write()"
+HREF="r14496.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r14264.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r14496.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="FUNC-SELECT"
+></A
+>V4L2 select()</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN14394"
+></A
+><H2
+>Name</H2
+>v4l2-select&nbsp;--&nbsp;Synchronous I/O multiplexing</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN14397"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN14398"
+></A
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include &lt;sys/time.h&gt;
+#include &lt;sys/types.h&gt;
+#include &lt;unistd.h&gt;</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int select</CODE
+>(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN14413"
+></A
+><H2
+>Description</H2
+><P
+>With the <CODE
+CLASS="FUNCTION"
+>select()</CODE
+> function applications
+can suspend execution until the driver has captured data or is ready
+to accept data for output.</P
+><P
+>When streaming I/O has been negotiated this function waits
+until a buffer has been filled or displayed and can be dequeued with
+the <A
+HREF="r12878.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_DQBUF</CODE
+></A
+> ioctl. When buffers are already in the outgoing
+queue of the driver the function returns immediately.</P
+><P
+>On success <CODE
+CLASS="FUNCTION"
+>select()</CODE
+> returns the total
+number of bits set in the <CODE
+CLASS="STRUCTNAME"
+>fd_set</CODE
+>s. When the
+function timed out it returns a value of zero. On failure it returns
+<SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+>
+variable is set appropriately. When the application did not call
+<A
+HREF="r12878.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QBUF</CODE
+></A
+> or <A
+HREF="r13817.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMON</CODE
+></A
+> yet the
+<CODE
+CLASS="FUNCTION"
+>select()</CODE
+> function succeeds, setting the bit of
+the file descriptor in <CODE
+CLASS="PARAMETER"
+>readfds</CODE
+> or
+<CODE
+CLASS="PARAMETER"
+>writefds</CODE
+>, but subsequent <A
+HREF="r12878.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_DQBUF</CODE
+></A
+> calls
+will fail.<A
+NAME="AEN14434"
+HREF="r14390.htm#FTN.AEN14434"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+></P
+><P
+>When use of the <CODE
+CLASS="FUNCTION"
+>read()</CODE
+> function has
+been negotiated and the driver does not capture yet, the
+<CODE
+CLASS="FUNCTION"
+>select()</CODE
+> function starts capturing. When that
+fails, <CODE
+CLASS="FUNCTION"
+>select()</CODE
+> returns successful and a
+subsequent <CODE
+CLASS="FUNCTION"
+>read()</CODE
+> call, which also attempts to
+start capturing, will return an appropriate error code. When the
+driver captures continuously (as opposed to, for example, still
+images) and data is already available the
+<CODE
+CLASS="FUNCTION"
+>select()</CODE
+> function returns immediately.</P
+><P
+>When use of the <CODE
+CLASS="FUNCTION"
+>write()</CODE
+> function has
+been negotiated the <CODE
+CLASS="FUNCTION"
+>select()</CODE
+> function just waits
+until the driver is ready for a non-blocking
+<CODE
+CLASS="FUNCTION"
+>write()</CODE
+> call.</P
+><P
+>All drivers implementing the <CODE
+CLASS="FUNCTION"
+>read()</CODE
+> or
+<CODE
+CLASS="FUNCTION"
+>write()</CODE
+> function or streaming I/O must also
+support the <CODE
+CLASS="FUNCTION"
+>select()</CODE
+> function.</P
+><P
+>For more details see the <CODE
+CLASS="FUNCTION"
+>select()</CODE
+>
+manual page.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN14457"
+></A
+><H2
+>Return Value</H2
+><P
+>On success, <CODE
+CLASS="FUNCTION"
+>select()</CODE
+> returns the number
+of descriptors contained in the three returned descriptor sets, which
+will be zero if the timeout expired. On error
+<SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> is returned, and the
+<CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately; the sets and
+<CODE
+CLASS="PARAMETER"
+>timeout</CODE
+> are undefined. Possible error codes
+are:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EBADF</SPAN
+></DT
+><DD
+><P
+>One or more of the file descriptor sets specified a
+file descriptor that is not open.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+></DT
+><DD
+><P
+>The driver does not support multiple read or write
+streams and the device is already in use.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EFAULT</SPAN
+></DT
+><DD
+><P
+>The <CODE
+CLASS="PARAMETER"
+>readfds</CODE
+>,
+<CODE
+CLASS="PARAMETER"
+>writefds</CODE
+>, <CODE
+CLASS="PARAMETER"
+>exceptfds</CODE
+> or
+<CODE
+CLASS="PARAMETER"
+>timeout</CODE
+> pointer references an inaccessible memory
+area.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINTR</SPAN
+></DT
+><DD
+><P
+>The call was interrupted by a signal.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The <CODE
+CLASS="PARAMETER"
+>nfds</CODE
+> argument is less than
+zero or greater than <CODE
+CLASS="CONSTANT"
+>FD_SETSIZE</CODE
+>.</P
+></DD
+></DL
+></DIV
+></DIV
+><H2
+CLASS="FOOTNOTES"
+>Notes</H2
+><TABLE
+BORDER="0"
+CLASS="FOOTNOTES"
+WIDTH="100%"
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="5%"
+><A
+NAME="FTN.AEN14434"
+HREF="r14390.htm#AEN14434"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="95%"
+><P
+>The Linux kernel implements
+<CODE
+CLASS="FUNCTION"
+>select()</CODE
+> like the <A
+HREF="r14169.htm"
+><CODE
+CLASS="FUNCTION"
+>poll()</CODE
+></A
+> function, but
+<CODE
+CLASS="FUNCTION"
+>select()</CODE
+> cannot return a
+<CODE
+CLASS="CONSTANT"
+>POLLERR</CODE
+>.</P
+></TD
+></TR
+></TABLE
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r14264.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r14496.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>V4L2 read()</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>V4L2 write()</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r14496.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r14496.htm
new file mode 100644
index 0000000..16d03f5
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r14496.htm
@@ -0,0 +1,378 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>V4L2 write()</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="V4L2 select()"
+HREF="r14390.htm"><LINK
+REL="NEXT"
+TITLE="V4L2 Driver Programming"
+HREF="c14592.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r14390.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="c14592.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="FUNC-WRITE"
+></A
+>V4L2 write()</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN14500"
+></A
+><H2
+>Name</H2
+>v4l2-write&nbsp;--&nbsp;Write to a V4L2 device</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN14503"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN14504"
+></A
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include &lt;unistd.h&gt;</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>ssize_t write</CODE
+>(int fd, void *buf, size_t count);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN14515"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>buf</CODE
+></DT
+><DD
+><P
+></P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>count</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN14535"
+></A
+><H2
+>Description</H2
+><P
+><CODE
+CLASS="FUNCTION"
+>write()</CODE
+> writes up to
+<CODE
+CLASS="PARAMETER"
+>count</CODE
+> bytes to the device referenced by the
+file descriptor <CODE
+CLASS="PARAMETER"
+>fd</CODE
+> from the buffer starting at
+<CODE
+CLASS="PARAMETER"
+>buf</CODE
+>. When the hardware outputs are not active
+yet, this function enables them. When <CODE
+CLASS="PARAMETER"
+>count</CODE
+> is
+zero, <CODE
+CLASS="FUNCTION"
+>write()</CODE
+> returns
+<SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> without any other effect.</P
+><P
+>When the application does not provide more data in time, the
+previous video frame, raw VBI image, sliced VPS or WSS data is
+displayed again. Sliced Teletext or Closed Caption data is not
+repeated, the driver inserts a blank line instead.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN14546"
+></A
+><H2
+>Return Value</H2
+><P
+>On success, the number of bytes written are returned. Zero
+indicates nothing was written. On error, <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+>
+is returned, and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set
+appropriately. In this case the next write will start at the beginning
+of a new frame. Possible error codes are:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EAGAIN</SPAN
+></DT
+><DD
+><P
+>Non-blocking I/O has been selected using the <A
+HREF="r14090.htm"
+><CODE
+CLASS="CONSTANT"
+>O_NONBLOCK</CODE
+></A
+> flag and no
+buffer space was available to write the data immediately.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EBADF</SPAN
+></DT
+><DD
+><P
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+> is not a valid file
+descriptor or is not open for writing.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+></DT
+><DD
+><P
+>The driver does not support multiple write streams and the
+device is already in use.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EFAULT</SPAN
+></DT
+><DD
+><P
+><CODE
+CLASS="PARAMETER"
+>buf</CODE
+> references an inaccessible
+memory area.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINTR</SPAN
+></DT
+><DD
+><P
+>The call was interrupted by a signal before any
+data was written.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EIO</SPAN
+></DT
+><DD
+><P
+>I/O error. This indicates some hardware problem.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The <CODE
+CLASS="FUNCTION"
+>write()</CODE
+> function is not
+supported by this driver, not on this device, or generally not on this
+type of device.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r14390.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="c14592.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>V4L2 select()</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>V4L2 Driver Programming</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r2492.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r2492.htm
new file mode 100644
index 0000000..62c479a
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r2492.htm
@@ -0,0 +1,3313 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Packed RGB formats</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="RGB Formats"
+HREF="x2490.htm"><LINK
+REL="PREVIOUS"
+TITLE="RGB Formats"
+HREF="x2490.htm"><LINK
+REL="NEXT"
+TITLE="V4L2_PIX_FMT_SBGGR8 ('BA81')"
+HREF="r3735.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x2490.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r3735.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="PACKED-RGB"
+></A
+>Packed RGB formats</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2496"
+></A
+><H2
+>Name</H2
+>Packed RGB formats&nbsp;--&nbsp;Packed RGB formats</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2499"
+></A
+><H2
+>Description</H2
+><P
+>These formats are designed to match the pixel formats of
+typical PC graphics frame buffers. They occupy 8, 16, 24 or 32 bits
+per pixel. These are all packed-pixel formats, meaning all the data
+for a pixel lie next to each other in memory.</P
+><P
+>When one of these formats is used, drivers shall report the
+colorspace <CODE
+CLASS="CONSTANT"
+>V4L2_COLORSPACE_SRGB</CODE
+>.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="RGB-FORMATS"
+></A
+><P
+><B
+>Table 2-1. Packed RGB Image Formats</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="3%"
+ALIGN="LEFT"
+TITLE="ID"><COL
+WIDTH="3%"
+TITLE="FOURCC"><COL
+WIDTH="3%"
+TITLE="BIT"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B07"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B06"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B05"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B04"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B03"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B02"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B01"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B00"><COL><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B17"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B16"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B15"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B14"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B13"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B12"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B11"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B10"><COL><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B27"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B26"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B25"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B24"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B23"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B22"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B21"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B20"><COL><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B37"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B36"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B35"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B34"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B33"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B32"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B31"><THEAD
+><TR
+><TH
+>Identifier</TH
+><TH
+>Code</TH
+><TH
+>&nbsp;</TH
+><TH
+COLSPAN="8"
+>Byte&nbsp;0 in memory</TH
+><TH
+>&nbsp;</TH
+><TH
+COLSPAN="8"
+>Byte&nbsp;1</TH
+><TH
+>&nbsp;</TH
+><TH
+COLSPAN="8"
+>Byte&nbsp;2</TH
+><TH
+>&nbsp;</TH
+><TH
+COLSPAN="8"
+>Byte&nbsp;3</TH
+></TR
+><TR
+><TH
+>&nbsp;</TH
+><TH
+>&nbsp;</TH
+><TH
+>Bit</TH
+><TH
+>7</TH
+><TH
+>6</TH
+><TH
+>5</TH
+><TH
+>4</TH
+><TH
+>3</TH
+><TH
+>2</TH
+><TH
+>1</TH
+><TH
+>0</TH
+><TH
+>&nbsp;</TH
+><TH
+>7</TH
+><TH
+>6</TH
+><TH
+>5</TH
+><TH
+>4</TH
+><TH
+>3</TH
+><TH
+>2</TH
+><TH
+>1</TH
+><TH
+>0</TH
+><TH
+>&nbsp;</TH
+><TH
+>7</TH
+><TH
+>6</TH
+><TH
+>5</TH
+><TH
+>4</TH
+><TH
+>3</TH
+><TH
+>2</TH
+><TH
+>1</TH
+><TH
+>0</TH
+><TH
+>&nbsp;</TH
+><TH
+>7</TH
+><TH
+>6</TH
+><TH
+>5</TH
+><TH
+>4</TH
+><TH
+>3</TH
+><TH
+>2</TH
+><TH
+>1</TH
+><TH
+>0</TH
+></TR
+></THEAD
+><TBODY
+VALIGN="TOP"
+><TR
+><A
+NAME="V4L2-PIX-FMT-RGB332"
+></A
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_RGB332</CODE
+></TD
+><TD
+>'RGB1'</TD
+><TD
+>&nbsp;</TD
+><TD
+>b<SUB
+>1</SUB
+></TD
+><TD
+>b<SUB
+>0</SUB
+></TD
+><TD
+>g<SUB
+>2</SUB
+></TD
+><TD
+>g<SUB
+>1</SUB
+></TD
+><TD
+>g<SUB
+>0</SUB
+></TD
+><TD
+>r<SUB
+>2</SUB
+></TD
+><TD
+>r<SUB
+>1</SUB
+></TD
+><TD
+>r<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><A
+NAME="V4L2-PIX-FMT-RGB444"
+></A
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_RGB444</CODE
+></TD
+><TD
+>'R444'</TD
+><TD
+>&nbsp;</TD
+><TD
+>g<SUB
+>3</SUB
+></TD
+><TD
+>g<SUB
+>2</SUB
+></TD
+><TD
+>g<SUB
+>1</SUB
+></TD
+><TD
+>g<SUB
+>0</SUB
+></TD
+><TD
+>b<SUB
+>3</SUB
+></TD
+><TD
+>b<SUB
+>2</SUB
+></TD
+><TD
+>b<SUB
+>1</SUB
+></TD
+><TD
+>b<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>a<SUB
+>3</SUB
+></TD
+><TD
+>a<SUB
+>2</SUB
+></TD
+><TD
+>a<SUB
+>1</SUB
+></TD
+><TD
+>a<SUB
+>0</SUB
+></TD
+><TD
+>r<SUB
+>3</SUB
+></TD
+><TD
+>r<SUB
+>2</SUB
+></TD
+><TD
+>r<SUB
+>1</SUB
+></TD
+><TD
+>r<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><A
+NAME="V4L2-PIX-FMT-RGB555"
+></A
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_RGB555</CODE
+></TD
+><TD
+>'RGBO'</TD
+><TD
+>&nbsp;</TD
+><TD
+>g<SUB
+>2</SUB
+></TD
+><TD
+>g<SUB
+>1</SUB
+></TD
+><TD
+>g<SUB
+>0</SUB
+></TD
+><TD
+>r<SUB
+>4</SUB
+></TD
+><TD
+>r<SUB
+>3</SUB
+></TD
+><TD
+>r<SUB
+>2</SUB
+></TD
+><TD
+>r<SUB
+>1</SUB
+></TD
+><TD
+>r<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>a</TD
+><TD
+>b<SUB
+>4</SUB
+></TD
+><TD
+>b<SUB
+>3</SUB
+></TD
+><TD
+>b<SUB
+>2</SUB
+></TD
+><TD
+>b<SUB
+>1</SUB
+></TD
+><TD
+>b<SUB
+>0</SUB
+></TD
+><TD
+>g<SUB
+>4</SUB
+></TD
+><TD
+>g<SUB
+>3</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><A
+NAME="V4L2-PIX-FMT-RGB565"
+></A
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_RGB565</CODE
+></TD
+><TD
+>'RGBP'</TD
+><TD
+>&nbsp;</TD
+><TD
+>g<SUB
+>2</SUB
+></TD
+><TD
+>g<SUB
+>1</SUB
+></TD
+><TD
+>g<SUB
+>0</SUB
+></TD
+><TD
+>r<SUB
+>4</SUB
+></TD
+><TD
+>r<SUB
+>3</SUB
+></TD
+><TD
+>r<SUB
+>2</SUB
+></TD
+><TD
+>r<SUB
+>1</SUB
+></TD
+><TD
+>r<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>b<SUB
+>4</SUB
+></TD
+><TD
+>b<SUB
+>3</SUB
+></TD
+><TD
+>b<SUB
+>2</SUB
+></TD
+><TD
+>b<SUB
+>1</SUB
+></TD
+><TD
+>b<SUB
+>0</SUB
+></TD
+><TD
+>g<SUB
+>5</SUB
+></TD
+><TD
+>g<SUB
+>4</SUB
+></TD
+><TD
+>g<SUB
+>3</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><A
+NAME="V4L2-PIX-FMT-RGB555X"
+></A
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_RGB555X</CODE
+></TD
+><TD
+>'RGBQ'</TD
+><TD
+>&nbsp;</TD
+><TD
+>a</TD
+><TD
+>b<SUB
+>4</SUB
+></TD
+><TD
+>b<SUB
+>3</SUB
+></TD
+><TD
+>b<SUB
+>2</SUB
+></TD
+><TD
+>b<SUB
+>1</SUB
+></TD
+><TD
+>b<SUB
+>0</SUB
+></TD
+><TD
+>g<SUB
+>4</SUB
+></TD
+><TD
+>g<SUB
+>3</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>g<SUB
+>2</SUB
+></TD
+><TD
+>g<SUB
+>1</SUB
+></TD
+><TD
+>g<SUB
+>0</SUB
+></TD
+><TD
+>r<SUB
+>4</SUB
+></TD
+><TD
+>r<SUB
+>3</SUB
+></TD
+><TD
+>r<SUB
+>2</SUB
+></TD
+><TD
+>r<SUB
+>1</SUB
+></TD
+><TD
+>r<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><A
+NAME="V4L2-PIX-FMT-RGB565X"
+></A
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_RGB565X</CODE
+></TD
+><TD
+>'RGBR'</TD
+><TD
+>&nbsp;</TD
+><TD
+>b<SUB
+>4</SUB
+></TD
+><TD
+>b<SUB
+>3</SUB
+></TD
+><TD
+>b<SUB
+>2</SUB
+></TD
+><TD
+>b<SUB
+>1</SUB
+></TD
+><TD
+>b<SUB
+>0</SUB
+></TD
+><TD
+>g<SUB
+>5</SUB
+></TD
+><TD
+>g<SUB
+>4</SUB
+></TD
+><TD
+>g<SUB
+>3</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>g<SUB
+>2</SUB
+></TD
+><TD
+>g<SUB
+>1</SUB
+></TD
+><TD
+>g<SUB
+>0</SUB
+></TD
+><TD
+>r<SUB
+>4</SUB
+></TD
+><TD
+>r<SUB
+>3</SUB
+></TD
+><TD
+>r<SUB
+>2</SUB
+></TD
+><TD
+>r<SUB
+>1</SUB
+></TD
+><TD
+>r<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><A
+NAME="V4L2-PIX-FMT-BGR24"
+></A
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_BGR24</CODE
+></TD
+><TD
+>'BGR3'</TD
+><TD
+>&nbsp;</TD
+><TD
+>b<SUB
+>7</SUB
+></TD
+><TD
+>b<SUB
+>6</SUB
+></TD
+><TD
+>b<SUB
+>5</SUB
+></TD
+><TD
+>b<SUB
+>4</SUB
+></TD
+><TD
+>b<SUB
+>3</SUB
+></TD
+><TD
+>b<SUB
+>2</SUB
+></TD
+><TD
+>b<SUB
+>1</SUB
+></TD
+><TD
+>b<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>g<SUB
+>7</SUB
+></TD
+><TD
+>g<SUB
+>6</SUB
+></TD
+><TD
+>g<SUB
+>5</SUB
+></TD
+><TD
+>g<SUB
+>4</SUB
+></TD
+><TD
+>g<SUB
+>3</SUB
+></TD
+><TD
+>g<SUB
+>2</SUB
+></TD
+><TD
+>g<SUB
+>1</SUB
+></TD
+><TD
+>g<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>r<SUB
+>7</SUB
+></TD
+><TD
+>r<SUB
+>6</SUB
+></TD
+><TD
+>r<SUB
+>5</SUB
+></TD
+><TD
+>r<SUB
+>4</SUB
+></TD
+><TD
+>r<SUB
+>3</SUB
+></TD
+><TD
+>r<SUB
+>2</SUB
+></TD
+><TD
+>r<SUB
+>1</SUB
+></TD
+><TD
+>r<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><A
+NAME="V4L2-PIX-FMT-RGB24"
+></A
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_RGB24</CODE
+></TD
+><TD
+>'RGB3'</TD
+><TD
+>&nbsp;</TD
+><TD
+>r<SUB
+>7</SUB
+></TD
+><TD
+>r<SUB
+>6</SUB
+></TD
+><TD
+>r<SUB
+>5</SUB
+></TD
+><TD
+>r<SUB
+>4</SUB
+></TD
+><TD
+>r<SUB
+>3</SUB
+></TD
+><TD
+>r<SUB
+>2</SUB
+></TD
+><TD
+>r<SUB
+>1</SUB
+></TD
+><TD
+>r<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>g<SUB
+>7</SUB
+></TD
+><TD
+>g<SUB
+>6</SUB
+></TD
+><TD
+>g<SUB
+>5</SUB
+></TD
+><TD
+>g<SUB
+>4</SUB
+></TD
+><TD
+>g<SUB
+>3</SUB
+></TD
+><TD
+>g<SUB
+>2</SUB
+></TD
+><TD
+>g<SUB
+>1</SUB
+></TD
+><TD
+>g<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>b<SUB
+>7</SUB
+></TD
+><TD
+>b<SUB
+>6</SUB
+></TD
+><TD
+>b<SUB
+>5</SUB
+></TD
+><TD
+>b<SUB
+>4</SUB
+></TD
+><TD
+>b<SUB
+>3</SUB
+></TD
+><TD
+>b<SUB
+>2</SUB
+></TD
+><TD
+>b<SUB
+>1</SUB
+></TD
+><TD
+>b<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><A
+NAME="V4L2-PIX-FMT-BGR32"
+></A
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_BGR32</CODE
+></TD
+><TD
+>'BGR4'</TD
+><TD
+>&nbsp;</TD
+><TD
+>b<SUB
+>7</SUB
+></TD
+><TD
+>b<SUB
+>6</SUB
+></TD
+><TD
+>b<SUB
+>5</SUB
+></TD
+><TD
+>b<SUB
+>4</SUB
+></TD
+><TD
+>b<SUB
+>3</SUB
+></TD
+><TD
+>b<SUB
+>2</SUB
+></TD
+><TD
+>b<SUB
+>1</SUB
+></TD
+><TD
+>b<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>g<SUB
+>7</SUB
+></TD
+><TD
+>g<SUB
+>6</SUB
+></TD
+><TD
+>g<SUB
+>5</SUB
+></TD
+><TD
+>g<SUB
+>4</SUB
+></TD
+><TD
+>g<SUB
+>3</SUB
+></TD
+><TD
+>g<SUB
+>2</SUB
+></TD
+><TD
+>g<SUB
+>1</SUB
+></TD
+><TD
+>g<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>r<SUB
+>7</SUB
+></TD
+><TD
+>r<SUB
+>6</SUB
+></TD
+><TD
+>r<SUB
+>5</SUB
+></TD
+><TD
+>r<SUB
+>4</SUB
+></TD
+><TD
+>r<SUB
+>3</SUB
+></TD
+><TD
+>r<SUB
+>2</SUB
+></TD
+><TD
+>r<SUB
+>1</SUB
+></TD
+><TD
+>r<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>a<SUB
+>7</SUB
+></TD
+><TD
+>a<SUB
+>6</SUB
+></TD
+><TD
+>a<SUB
+>5</SUB
+></TD
+><TD
+>a<SUB
+>4</SUB
+></TD
+><TD
+>a<SUB
+>3</SUB
+></TD
+><TD
+>a<SUB
+>2</SUB
+></TD
+><TD
+>a<SUB
+>1</SUB
+></TD
+><TD
+>a<SUB
+>0</SUB
+></TD
+></TR
+><TR
+><A
+NAME="V4L2-PIX-FMT-RGB32"
+></A
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_RGB32</CODE
+></TD
+><TD
+>'RGB4'</TD
+><TD
+>&nbsp;</TD
+><TD
+>r<SUB
+>7</SUB
+></TD
+><TD
+>r<SUB
+>6</SUB
+></TD
+><TD
+>r<SUB
+>5</SUB
+></TD
+><TD
+>r<SUB
+>4</SUB
+></TD
+><TD
+>r<SUB
+>3</SUB
+></TD
+><TD
+>r<SUB
+>2</SUB
+></TD
+><TD
+>r<SUB
+>1</SUB
+></TD
+><TD
+>r<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>g<SUB
+>7</SUB
+></TD
+><TD
+>g<SUB
+>6</SUB
+></TD
+><TD
+>g<SUB
+>5</SUB
+></TD
+><TD
+>g<SUB
+>4</SUB
+></TD
+><TD
+>g<SUB
+>3</SUB
+></TD
+><TD
+>g<SUB
+>2</SUB
+></TD
+><TD
+>g<SUB
+>1</SUB
+></TD
+><TD
+>g<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>b<SUB
+>7</SUB
+></TD
+><TD
+>b<SUB
+>6</SUB
+></TD
+><TD
+>b<SUB
+>5</SUB
+></TD
+><TD
+>b<SUB
+>4</SUB
+></TD
+><TD
+>b<SUB
+>3</SUB
+></TD
+><TD
+>b<SUB
+>2</SUB
+></TD
+><TD
+>b<SUB
+>1</SUB
+></TD
+><TD
+>b<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>a<SUB
+>7</SUB
+></TD
+><TD
+>a<SUB
+>6</SUB
+></TD
+><TD
+>a<SUB
+>5</SUB
+></TD
+><TD
+>a<SUB
+>4</SUB
+></TD
+><TD
+>a<SUB
+>3</SUB
+></TD
+><TD
+>a<SUB
+>2</SUB
+></TD
+><TD
+>a<SUB
+>1</SUB
+></TD
+><TD
+>a<SUB
+>0</SUB
+></TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><P
+>Bit 7 is the most significant bit. The value of a = alpha
+bits is undefined when reading from the driver, ignored when writing
+to the driver, except when alpha blending has been negotiated for a
+<A
+HREF="x6570.htm"
+>Video Overlay</A
+> or <A
+HREF="x6909.htm"
+>Video Output Overlay</A
+>.</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN3061"
+></A
+><P
+><B
+>Example 2-1. <CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_BGR24</CODE
+> 4 &times; 4 pixel
+image</B
+></P
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>Byte Order. </B
+>Each cell is one byte.
+              <DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN3067"
+></A
+><TABLE
+BORDER="0"
+FRAME="void"
+CLASS="CALSTABLE"
+><COL
+WIDTH="2*"
+ALIGN="LEFT"><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>start&nbsp;+&nbsp;0:</TD
+><TD
+>B<SUB
+>00</SUB
+></TD
+><TD
+>G<SUB
+>00</SUB
+></TD
+><TD
+>R<SUB
+>00</SUB
+></TD
+><TD
+>B<SUB
+>01</SUB
+></TD
+><TD
+>G<SUB
+>01</SUB
+></TD
+><TD
+>R<SUB
+>01</SUB
+></TD
+><TD
+>B<SUB
+>02</SUB
+></TD
+><TD
+>G<SUB
+>02</SUB
+></TD
+><TD
+>R<SUB
+>02</SUB
+></TD
+><TD
+>B<SUB
+>03</SUB
+></TD
+><TD
+>G<SUB
+>03</SUB
+></TD
+><TD
+>R<SUB
+>03</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;12:</TD
+><TD
+>B<SUB
+>10</SUB
+></TD
+><TD
+>G<SUB
+>10</SUB
+></TD
+><TD
+>R<SUB
+>10</SUB
+></TD
+><TD
+>B<SUB
+>11</SUB
+></TD
+><TD
+>G<SUB
+>11</SUB
+></TD
+><TD
+>R<SUB
+>11</SUB
+></TD
+><TD
+>B<SUB
+>12</SUB
+></TD
+><TD
+>G<SUB
+>12</SUB
+></TD
+><TD
+>R<SUB
+>12</SUB
+></TD
+><TD
+>B<SUB
+>13</SUB
+></TD
+><TD
+>G<SUB
+>13</SUB
+></TD
+><TD
+>R<SUB
+>13</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;24:</TD
+><TD
+>B<SUB
+>20</SUB
+></TD
+><TD
+>G<SUB
+>20</SUB
+></TD
+><TD
+>R<SUB
+>20</SUB
+></TD
+><TD
+>B<SUB
+>21</SUB
+></TD
+><TD
+>G<SUB
+>21</SUB
+></TD
+><TD
+>R<SUB
+>21</SUB
+></TD
+><TD
+>B<SUB
+>22</SUB
+></TD
+><TD
+>G<SUB
+>22</SUB
+></TD
+><TD
+>R<SUB
+>22</SUB
+></TD
+><TD
+>B<SUB
+>23</SUB
+></TD
+><TD
+>G<SUB
+>23</SUB
+></TD
+><TD
+>R<SUB
+>23</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;36:</TD
+><TD
+>B<SUB
+>30</SUB
+></TD
+><TD
+>G<SUB
+>30</SUB
+></TD
+><TD
+>R<SUB
+>30</SUB
+></TD
+><TD
+>B<SUB
+>31</SUB
+></TD
+><TD
+>G<SUB
+>31</SUB
+></TD
+><TD
+>R<SUB
+>31</SUB
+></TD
+><TD
+>B<SUB
+>32</SUB
+></TD
+><TD
+>G<SUB
+>32</SUB
+></TD
+><TD
+>R<SUB
+>32</SUB
+></TD
+><TD
+>B<SUB
+>33</SUB
+></TD
+><TD
+>G<SUB
+>33</SUB
+></TD
+><TD
+>R<SUB
+>33</SUB
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+>
+            </P
+></DIV
+></DIV
+><DIV
+CLASS="IMPORTANT"
+><BLOCKQUOTE
+CLASS="IMPORTANT"
+><P
+><B
+>Important: </B
+>Drivers may interpret these formats differently.</P
+></BLOCKQUOTE
+></DIV
+><P
+>Some RGB formats above are uncommon and were probably
+defined in error. Drivers may interpret them as in <A
+HREF="r2492.htm#RGB-FORMATS-CORRECTED"
+>Table 2-2</A
+>.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="RGB-FORMATS-CORRECTED"
+></A
+><P
+><B
+>Table 2-2. Packed RGB Image Formats (corrected)</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="3%"
+ALIGN="LEFT"
+TITLE="ID"><COL
+WIDTH="3%"
+TITLE="FOURCC"><COL
+WIDTH="3%"
+TITLE="BIT"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B07"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B06"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B05"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B04"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B03"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B02"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B01"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B00"><COL><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B17"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B16"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B15"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B14"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B13"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B12"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B11"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B10"><COL><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B27"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B26"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B25"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B24"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B23"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B22"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B21"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B20"><COL><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B37"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B36"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B35"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B34"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B33"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B32"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B31"><THEAD
+><TR
+><TH
+>Identifier</TH
+><TH
+>Code</TH
+><TH
+>&nbsp;</TH
+><TH
+COLSPAN="8"
+>Byte&nbsp;0 in memory</TH
+><TH
+>&nbsp;</TH
+><TH
+COLSPAN="8"
+>Byte&nbsp;1</TH
+><TH
+>&nbsp;</TH
+><TH
+COLSPAN="8"
+>Byte&nbsp;2</TH
+><TH
+>&nbsp;</TH
+><TH
+COLSPAN="8"
+>Byte&nbsp;3</TH
+></TR
+><TR
+><TH
+>&nbsp;</TH
+><TH
+>&nbsp;</TH
+><TH
+>Bit</TH
+><TH
+>7</TH
+><TH
+>6</TH
+><TH
+>5</TH
+><TH
+>4</TH
+><TH
+>3</TH
+><TH
+>2</TH
+><TH
+>1</TH
+><TH
+>0</TH
+><TH
+>&nbsp;</TH
+><TH
+>7</TH
+><TH
+>6</TH
+><TH
+>5</TH
+><TH
+>4</TH
+><TH
+>3</TH
+><TH
+>2</TH
+><TH
+>1</TH
+><TH
+>0</TH
+><TH
+>&nbsp;</TH
+><TH
+>7</TH
+><TH
+>6</TH
+><TH
+>5</TH
+><TH
+>4</TH
+><TH
+>3</TH
+><TH
+>2</TH
+><TH
+>1</TH
+><TH
+>0</TH
+><TH
+>&nbsp;</TH
+><TH
+>7</TH
+><TH
+>6</TH
+><TH
+>5</TH
+><TH
+>4</TH
+><TH
+>3</TH
+><TH
+>2</TH
+><TH
+>1</TH
+><TH
+>0</TH
+></TR
+></THEAD
+><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_RGB332</CODE
+></TD
+><TD
+>'RGB1'</TD
+><TD
+>&nbsp;</TD
+><TD
+>r<SUB
+>2</SUB
+></TD
+><TD
+>r<SUB
+>1</SUB
+></TD
+><TD
+>r<SUB
+>0</SUB
+></TD
+><TD
+>g<SUB
+>2</SUB
+></TD
+><TD
+>g<SUB
+>1</SUB
+></TD
+><TD
+>g<SUB
+>0</SUB
+></TD
+><TD
+>b<SUB
+>1</SUB
+></TD
+><TD
+>b<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_RGB444</CODE
+></TD
+><TD
+>'R444'</TD
+><TD
+>&nbsp;</TD
+><TD
+>g<SUB
+>3</SUB
+></TD
+><TD
+>g<SUB
+>2</SUB
+></TD
+><TD
+>g<SUB
+>1</SUB
+></TD
+><TD
+>g<SUB
+>0</SUB
+></TD
+><TD
+>b<SUB
+>3</SUB
+></TD
+><TD
+>b<SUB
+>2</SUB
+></TD
+><TD
+>b<SUB
+>1</SUB
+></TD
+><TD
+>b<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>a<SUB
+>3</SUB
+></TD
+><TD
+>a<SUB
+>2</SUB
+></TD
+><TD
+>a<SUB
+>1</SUB
+></TD
+><TD
+>a<SUB
+>0</SUB
+></TD
+><TD
+>r<SUB
+>3</SUB
+></TD
+><TD
+>r<SUB
+>2</SUB
+></TD
+><TD
+>r<SUB
+>1</SUB
+></TD
+><TD
+>r<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_RGB555</CODE
+></TD
+><TD
+>'RGBO'</TD
+><TD
+>&nbsp;</TD
+><TD
+>g<SUB
+>2</SUB
+></TD
+><TD
+>g<SUB
+>1</SUB
+></TD
+><TD
+>g<SUB
+>0</SUB
+></TD
+><TD
+>b<SUB
+>4</SUB
+></TD
+><TD
+>b<SUB
+>3</SUB
+></TD
+><TD
+>b<SUB
+>2</SUB
+></TD
+><TD
+>b<SUB
+>1</SUB
+></TD
+><TD
+>b<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>a</TD
+><TD
+>r<SUB
+>4</SUB
+></TD
+><TD
+>r<SUB
+>3</SUB
+></TD
+><TD
+>r<SUB
+>2</SUB
+></TD
+><TD
+>r<SUB
+>1</SUB
+></TD
+><TD
+>r<SUB
+>0</SUB
+></TD
+><TD
+>g<SUB
+>4</SUB
+></TD
+><TD
+>g<SUB
+>3</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_RGB565</CODE
+></TD
+><TD
+>'RGBP'</TD
+><TD
+>&nbsp;</TD
+><TD
+>g<SUB
+>2</SUB
+></TD
+><TD
+>g<SUB
+>1</SUB
+></TD
+><TD
+>g<SUB
+>0</SUB
+></TD
+><TD
+>b<SUB
+>4</SUB
+></TD
+><TD
+>b<SUB
+>3</SUB
+></TD
+><TD
+>b<SUB
+>2</SUB
+></TD
+><TD
+>b<SUB
+>1</SUB
+></TD
+><TD
+>b<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>r<SUB
+>4</SUB
+></TD
+><TD
+>r<SUB
+>3</SUB
+></TD
+><TD
+>r<SUB
+>2</SUB
+></TD
+><TD
+>r<SUB
+>1</SUB
+></TD
+><TD
+>r<SUB
+>0</SUB
+></TD
+><TD
+>g<SUB
+>5</SUB
+></TD
+><TD
+>g<SUB
+>4</SUB
+></TD
+><TD
+>g<SUB
+>3</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_RGB555X</CODE
+></TD
+><TD
+>'RGBQ'</TD
+><TD
+>&nbsp;</TD
+><TD
+>a</TD
+><TD
+>r<SUB
+>4</SUB
+></TD
+><TD
+>r<SUB
+>3</SUB
+></TD
+><TD
+>r<SUB
+>2</SUB
+></TD
+><TD
+>r<SUB
+>1</SUB
+></TD
+><TD
+>r<SUB
+>0</SUB
+></TD
+><TD
+>g<SUB
+>4</SUB
+></TD
+><TD
+>g<SUB
+>3</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>g<SUB
+>2</SUB
+></TD
+><TD
+>g<SUB
+>1</SUB
+></TD
+><TD
+>g<SUB
+>0</SUB
+></TD
+><TD
+>b<SUB
+>4</SUB
+></TD
+><TD
+>b<SUB
+>3</SUB
+></TD
+><TD
+>b<SUB
+>2</SUB
+></TD
+><TD
+>b<SUB
+>1</SUB
+></TD
+><TD
+>b<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_RGB565X</CODE
+></TD
+><TD
+>'RGBR'</TD
+><TD
+>&nbsp;</TD
+><TD
+>r<SUB
+>4</SUB
+></TD
+><TD
+>r<SUB
+>3</SUB
+></TD
+><TD
+>r<SUB
+>2</SUB
+></TD
+><TD
+>r<SUB
+>1</SUB
+></TD
+><TD
+>r<SUB
+>0</SUB
+></TD
+><TD
+>g<SUB
+>5</SUB
+></TD
+><TD
+>g<SUB
+>4</SUB
+></TD
+><TD
+>g<SUB
+>3</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>g<SUB
+>2</SUB
+></TD
+><TD
+>g<SUB
+>1</SUB
+></TD
+><TD
+>g<SUB
+>0</SUB
+></TD
+><TD
+>b<SUB
+>4</SUB
+></TD
+><TD
+>b<SUB
+>3</SUB
+></TD
+><TD
+>b<SUB
+>2</SUB
+></TD
+><TD
+>b<SUB
+>1</SUB
+></TD
+><TD
+>b<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_BGR24</CODE
+></TD
+><TD
+>'BGR3'</TD
+><TD
+>&nbsp;</TD
+><TD
+>b<SUB
+>7</SUB
+></TD
+><TD
+>b<SUB
+>6</SUB
+></TD
+><TD
+>b<SUB
+>5</SUB
+></TD
+><TD
+>b<SUB
+>4</SUB
+></TD
+><TD
+>b<SUB
+>3</SUB
+></TD
+><TD
+>b<SUB
+>2</SUB
+></TD
+><TD
+>b<SUB
+>1</SUB
+></TD
+><TD
+>b<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>g<SUB
+>7</SUB
+></TD
+><TD
+>g<SUB
+>6</SUB
+></TD
+><TD
+>g<SUB
+>5</SUB
+></TD
+><TD
+>g<SUB
+>4</SUB
+></TD
+><TD
+>g<SUB
+>3</SUB
+></TD
+><TD
+>g<SUB
+>2</SUB
+></TD
+><TD
+>g<SUB
+>1</SUB
+></TD
+><TD
+>g<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>r<SUB
+>7</SUB
+></TD
+><TD
+>r<SUB
+>6</SUB
+></TD
+><TD
+>r<SUB
+>5</SUB
+></TD
+><TD
+>r<SUB
+>4</SUB
+></TD
+><TD
+>r<SUB
+>3</SUB
+></TD
+><TD
+>r<SUB
+>2</SUB
+></TD
+><TD
+>r<SUB
+>1</SUB
+></TD
+><TD
+>r<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_RGB24</CODE
+></TD
+><TD
+>'RGB3'</TD
+><TD
+>&nbsp;</TD
+><TD
+>r<SUB
+>7</SUB
+></TD
+><TD
+>r<SUB
+>6</SUB
+></TD
+><TD
+>r<SUB
+>5</SUB
+></TD
+><TD
+>r<SUB
+>4</SUB
+></TD
+><TD
+>r<SUB
+>3</SUB
+></TD
+><TD
+>r<SUB
+>2</SUB
+></TD
+><TD
+>r<SUB
+>1</SUB
+></TD
+><TD
+>r<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>g<SUB
+>7</SUB
+></TD
+><TD
+>g<SUB
+>6</SUB
+></TD
+><TD
+>g<SUB
+>5</SUB
+></TD
+><TD
+>g<SUB
+>4</SUB
+></TD
+><TD
+>g<SUB
+>3</SUB
+></TD
+><TD
+>g<SUB
+>2</SUB
+></TD
+><TD
+>g<SUB
+>1</SUB
+></TD
+><TD
+>g<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>b<SUB
+>7</SUB
+></TD
+><TD
+>b<SUB
+>6</SUB
+></TD
+><TD
+>b<SUB
+>5</SUB
+></TD
+><TD
+>b<SUB
+>4</SUB
+></TD
+><TD
+>b<SUB
+>3</SUB
+></TD
+><TD
+>b<SUB
+>2</SUB
+></TD
+><TD
+>b<SUB
+>1</SUB
+></TD
+><TD
+>b<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_BGR32</CODE
+></TD
+><TD
+>'BGR4'</TD
+><TD
+>&nbsp;</TD
+><TD
+>b<SUB
+>7</SUB
+></TD
+><TD
+>b<SUB
+>6</SUB
+></TD
+><TD
+>b<SUB
+>5</SUB
+></TD
+><TD
+>b<SUB
+>4</SUB
+></TD
+><TD
+>b<SUB
+>3</SUB
+></TD
+><TD
+>b<SUB
+>2</SUB
+></TD
+><TD
+>b<SUB
+>1</SUB
+></TD
+><TD
+>b<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>g<SUB
+>7</SUB
+></TD
+><TD
+>g<SUB
+>6</SUB
+></TD
+><TD
+>g<SUB
+>5</SUB
+></TD
+><TD
+>g<SUB
+>4</SUB
+></TD
+><TD
+>g<SUB
+>3</SUB
+></TD
+><TD
+>g<SUB
+>2</SUB
+></TD
+><TD
+>g<SUB
+>1</SUB
+></TD
+><TD
+>g<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>r<SUB
+>7</SUB
+></TD
+><TD
+>r<SUB
+>6</SUB
+></TD
+><TD
+>r<SUB
+>5</SUB
+></TD
+><TD
+>r<SUB
+>4</SUB
+></TD
+><TD
+>r<SUB
+>3</SUB
+></TD
+><TD
+>r<SUB
+>2</SUB
+></TD
+><TD
+>r<SUB
+>1</SUB
+></TD
+><TD
+>r<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>a<SUB
+>7</SUB
+></TD
+><TD
+>a<SUB
+>6</SUB
+></TD
+><TD
+>a<SUB
+>5</SUB
+></TD
+><TD
+>a<SUB
+>4</SUB
+></TD
+><TD
+>a<SUB
+>3</SUB
+></TD
+><TD
+>a<SUB
+>2</SUB
+></TD
+><TD
+>a<SUB
+>1</SUB
+></TD
+><TD
+>a<SUB
+>0</SUB
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_RGB32</CODE
+></TD
+><TD
+>'RGB4'</TD
+><TD
+>&nbsp;</TD
+><TD
+>a<SUB
+>7</SUB
+></TD
+><TD
+>a<SUB
+>6</SUB
+></TD
+><TD
+>a<SUB
+>5</SUB
+></TD
+><TD
+>a<SUB
+>4</SUB
+></TD
+><TD
+>a<SUB
+>3</SUB
+></TD
+><TD
+>a<SUB
+>2</SUB
+></TD
+><TD
+>a<SUB
+>1</SUB
+></TD
+><TD
+>a<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>r<SUB
+>7</SUB
+></TD
+><TD
+>r<SUB
+>6</SUB
+></TD
+><TD
+>r<SUB
+>5</SUB
+></TD
+><TD
+>r<SUB
+>4</SUB
+></TD
+><TD
+>r<SUB
+>3</SUB
+></TD
+><TD
+>r<SUB
+>2</SUB
+></TD
+><TD
+>r<SUB
+>1</SUB
+></TD
+><TD
+>r<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>g<SUB
+>7</SUB
+></TD
+><TD
+>g<SUB
+>6</SUB
+></TD
+><TD
+>g<SUB
+>5</SUB
+></TD
+><TD
+>g<SUB
+>4</SUB
+></TD
+><TD
+>g<SUB
+>3</SUB
+></TD
+><TD
+>g<SUB
+>2</SUB
+></TD
+><TD
+>g<SUB
+>1</SUB
+></TD
+><TD
+>g<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>b<SUB
+>7</SUB
+></TD
+><TD
+>b<SUB
+>6</SUB
+></TD
+><TD
+>b<SUB
+>5</SUB
+></TD
+><TD
+>b<SUB
+>4</SUB
+></TD
+><TD
+>b<SUB
+>3</SUB
+></TD
+><TD
+>b<SUB
+>2</SUB
+></TD
+><TD
+>b<SUB
+>1</SUB
+></TD
+><TD
+>b<SUB
+>0</SUB
+></TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><P
+>A test utility to determine which RGB formats a driver
+actually supports is available from the LinuxTV v4l-dvb repository.
+See <A
+HREF="http://linuxtv.org/repo/"
+TARGET="_top"
+>http://linuxtv.org/repo/</A
+> for access instructions.</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x2490.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r3735.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>RGB Formats</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="x2490.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>V4L2_PIX_FMT_SBGGR8 ('BA81')</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r3735.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r3735.htm
new file mode 100644
index 0000000..1719175
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r3735.htm
@@ -0,0 +1,290 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>V4L2_PIX_FMT_SBGGR8 ('BA81')</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="RGB Formats"
+HREF="x2490.htm"><LINK
+REL="PREVIOUS"
+TITLE="Packed RGB formats"
+HREF="r2492.htm"><LINK
+REL="NEXT"
+TITLE="V4L2_PIX_FMT_SBGGR16 ('BA82')"
+HREF="r3796.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r2492.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r3796.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="V4L2-PIX-FMT-SBGGR8"
+></A
+>V4L2_PIX_FMT_SBGGR8 ('BA81')</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN3739"
+></A
+><H2
+>Name</H2
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_SBGGR8</CODE
+>&nbsp;--&nbsp;Bayer RGB format</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3743"
+></A
+><H2
+>Description</H2
+><P
+>This is commonly the native format of digital cameras,
+reflecting the arrangement of sensors on the CCD device. Only one red,
+green or blue value is given for each pixel. Missing components must
+be interpolated from neighbouring pixels. From left to right the first
+row consists of a blue and green value, the second row of a green and
+red value. This scheme repeats to the right and down for every two
+columns and rows.</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN3746"
+></A
+><P
+><B
+>Example 2-1. <CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_SBGGR8</CODE
+> 4 &times; 4
+pixel image</B
+></P
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>Byte Order. </B
+>Each cell is one byte.
+              <DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN3752"
+></A
+><TABLE
+BORDER="0"
+FRAME="void"
+CLASS="CALSTABLE"
+><COL
+WIDTH="2*"
+ALIGN="LEFT"><COL><COL><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>start&nbsp;+&nbsp;0:</TD
+><TD
+>B<SUB
+>00</SUB
+></TD
+><TD
+>G<SUB
+>01</SUB
+></TD
+><TD
+>B<SUB
+>02</SUB
+></TD
+><TD
+>G<SUB
+>03</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;4:</TD
+><TD
+>G<SUB
+>10</SUB
+></TD
+><TD
+>R<SUB
+>11</SUB
+></TD
+><TD
+>G<SUB
+>12</SUB
+></TD
+><TD
+>R<SUB
+>13</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;8:</TD
+><TD
+>B<SUB
+>20</SUB
+></TD
+><TD
+>G<SUB
+>21</SUB
+></TD
+><TD
+>B<SUB
+>22</SUB
+></TD
+><TD
+>G<SUB
+>23</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;12:</TD
+><TD
+>G<SUB
+>30</SUB
+></TD
+><TD
+>R<SUB
+>31</SUB
+></TD
+><TD
+>G<SUB
+>32</SUB
+></TD
+><TD
+>R<SUB
+>33</SUB
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+>
+            </P
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r2492.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r3796.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Packed RGB formats</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="x2490.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>V4L2_PIX_FMT_SBGGR16 ('BA82')</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r3796.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r3796.htm
new file mode 100644
index 0000000..da0940c
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r3796.htm
@@ -0,0 +1,358 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>V4L2_PIX_FMT_SBGGR16 ('BA82')</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="RGB Formats"
+HREF="x2490.htm"><LINK
+REL="PREVIOUS"
+TITLE="V4L2_PIX_FMT_SBGGR8 ('BA81')"
+HREF="r3735.htm"><LINK
+REL="NEXT"
+TITLE="YUV Formats"
+HREF="x3891.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r3735.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x3891.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="V4L2-PIX-FMT-SBGGR16"
+></A
+>V4L2_PIX_FMT_SBGGR16 ('BA82')</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN3800"
+></A
+><H2
+>Name</H2
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_SBGGR16</CODE
+>&nbsp;--&nbsp;Bayer RGB format</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3804"
+></A
+><H2
+>Description</H2
+><P
+>This format is similar to <A
+HREF="r3735.htm"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_SBGGR8</CODE
+></A
+>, except each pixel has
+a depth of 16 bits. The least significant byte is stored at lower
+memory addresses (little-endian). Note the actual sampling precision
+may be lower than 16 bits, for example 10 bits per pixel with values
+in range 0 to 1023.</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN3809"
+></A
+><P
+><B
+>Example 2-1. <CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_SBGGR16</CODE
+> 4 &times; 4
+pixel image</B
+></P
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>Byte Order. </B
+>Each cell is one byte.
+          <DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN3815"
+></A
+><TABLE
+BORDER="0"
+FRAME="void"
+CLASS="CALSTABLE"
+><COL
+WIDTH="2*"
+ALIGN="LEFT"><COL><COL><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>start&nbsp;+&nbsp;0:</TD
+><TD
+>B<SUB
+>00low</SUB
+></TD
+><TD
+>B<SUB
+>00high</SUB
+></TD
+><TD
+>G<SUB
+>01low</SUB
+></TD
+><TD
+>G<SUB
+>01high</SUB
+></TD
+><TD
+>B<SUB
+>02low</SUB
+></TD
+><TD
+>B<SUB
+>02high</SUB
+></TD
+><TD
+>G<SUB
+>03low</SUB
+></TD
+><TD
+>G<SUB
+>03high</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;8:</TD
+><TD
+>G<SUB
+>10low</SUB
+></TD
+><TD
+>G<SUB
+>10high</SUB
+></TD
+><TD
+>R<SUB
+>11low</SUB
+></TD
+><TD
+>R<SUB
+>11high</SUB
+></TD
+><TD
+>G<SUB
+>12low</SUB
+></TD
+><TD
+>G<SUB
+>12high</SUB
+></TD
+><TD
+>R<SUB
+>13low</SUB
+></TD
+><TD
+>R<SUB
+>13high</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;16:</TD
+><TD
+>B<SUB
+>20low</SUB
+></TD
+><TD
+>B<SUB
+>20high</SUB
+></TD
+><TD
+>G<SUB
+>21low</SUB
+></TD
+><TD
+>G<SUB
+>21high</SUB
+></TD
+><TD
+>B<SUB
+>22low</SUB
+></TD
+><TD
+>B<SUB
+>22high</SUB
+></TD
+><TD
+>G<SUB
+>23low</SUB
+></TD
+><TD
+>G<SUB
+>23high</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;24:</TD
+><TD
+>G<SUB
+>30low</SUB
+></TD
+><TD
+>G<SUB
+>30high</SUB
+></TD
+><TD
+>R<SUB
+>31low</SUB
+></TD
+><TD
+>R<SUB
+>31high</SUB
+></TD
+><TD
+>G<SUB
+>32low</SUB
+></TD
+><TD
+>G<SUB
+>32high</SUB
+></TD
+><TD
+>R<SUB
+>33low</SUB
+></TD
+><TD
+>R<SUB
+>33high</SUB
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+>
+        </P
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r3735.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x3891.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>V4L2_PIX_FMT_SBGGR8 ('BA81')</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="x2490.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>YUV Formats</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r3896.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r3896.htm
new file mode 100644
index 0000000..17a8b80
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r3896.htm
@@ -0,0 +1,884 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Packed YUV formats</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="YUV Formats"
+HREF="x3891.htm"><LINK
+REL="PREVIOUS"
+TITLE="YUV Formats"
+HREF="x3891.htm"><LINK
+REL="NEXT"
+TITLE="V4L2_PIX_FMT_GREY ('GREY')"
+HREF="r4185.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x3891.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r4185.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="PACKED-YUV"
+></A
+>Packed YUV formats</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN3900"
+></A
+><H2
+>Name</H2
+>Packed YUV formats&nbsp;--&nbsp;Packed YUV formats</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3903"
+></A
+><H2
+>Description</H2
+><P
+>Similar to the packed RGB formats these formats store
+the Y, Cb and Cr component of each pixel in one 16 or 32 bit
+word.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="AEN3906"
+></A
+><P
+><B
+>Table 2-1. Packed YUV Image Formats</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="3%"
+ALIGN="LEFT"
+TITLE="ID"><COL
+WIDTH="3%"
+TITLE="FOURCC"><COL
+WIDTH="3%"
+TITLE="BIT"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B07"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B06"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B05"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B04"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B03"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B02"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B01"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B00"><COL><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B17"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B16"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B15"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B14"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B13"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B12"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B11"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B10"><COL><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B27"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B26"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B25"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B24"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B23"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B22"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B21"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B20"><COL><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B37"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B36"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B35"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B34"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B33"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B32"><COL
+WIDTH="3%"
+ALIGN="CENTER"
+TITLE="B31"><THEAD
+><TR
+><TH
+>Identifier</TH
+><TH
+>Code</TH
+><TH
+>&nbsp;</TH
+><TH
+COLSPAN="8"
+>Byte&nbsp;0 in memory</TH
+><TH
+>&nbsp;</TH
+><TH
+COLSPAN="8"
+>Byte&nbsp;1</TH
+><TH
+>&nbsp;</TH
+><TH
+COLSPAN="8"
+>Byte&nbsp;2</TH
+><TH
+>&nbsp;</TH
+><TH
+COLSPAN="8"
+>Byte&nbsp;3</TH
+></TR
+><TR
+><TH
+>&nbsp;</TH
+><TH
+>&nbsp;</TH
+><TH
+>Bit</TH
+><TH
+>7</TH
+><TH
+>6</TH
+><TH
+>5</TH
+><TH
+>4</TH
+><TH
+>3</TH
+><TH
+>2</TH
+><TH
+>1</TH
+><TH
+>0</TH
+><TH
+>&nbsp;</TH
+><TH
+>7</TH
+><TH
+>6</TH
+><TH
+>5</TH
+><TH
+>4</TH
+><TH
+>3</TH
+><TH
+>2</TH
+><TH
+>1</TH
+><TH
+>0</TH
+><TH
+>&nbsp;</TH
+><TH
+>7</TH
+><TH
+>6</TH
+><TH
+>5</TH
+><TH
+>4</TH
+><TH
+>3</TH
+><TH
+>2</TH
+><TH
+>1</TH
+><TH
+>0</TH
+><TH
+>&nbsp;</TH
+><TH
+>7</TH
+><TH
+>6</TH
+><TH
+>5</TH
+><TH
+>4</TH
+><TH
+>3</TH
+><TH
+>2</TH
+><TH
+>1</TH
+><TH
+>0</TH
+></TR
+></THEAD
+><TBODY
+VALIGN="TOP"
+><TR
+><A
+NAME="V4L2-PIX-FMT-YUV444"
+></A
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUV444</CODE
+></TD
+><TD
+>'Y444'</TD
+><TD
+>&nbsp;</TD
+><TD
+>Cb<SUB
+>3</SUB
+></TD
+><TD
+>Cb<SUB
+>2</SUB
+></TD
+><TD
+>Cb<SUB
+>1</SUB
+></TD
+><TD
+>Cb<SUB
+>0</SUB
+></TD
+><TD
+>Cr<SUB
+>3</SUB
+></TD
+><TD
+>Cr<SUB
+>2</SUB
+></TD
+><TD
+>Cr<SUB
+>1</SUB
+></TD
+><TD
+>Cr<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>a<SUB
+>3</SUB
+></TD
+><TD
+>a<SUB
+>2</SUB
+></TD
+><TD
+>a<SUB
+>1</SUB
+></TD
+><TD
+>a<SUB
+>0</SUB
+></TD
+><TD
+>Y'<SUB
+>3</SUB
+></TD
+><TD
+>Y'<SUB
+>2</SUB
+></TD
+><TD
+>Y'<SUB
+>1</SUB
+></TD
+><TD
+>Y'<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><A
+NAME="V4L2-PIX-FMT-YUV555"
+></A
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUV555</CODE
+></TD
+><TD
+>'YUVO'</TD
+><TD
+>&nbsp;</TD
+><TD
+>Cb<SUB
+>2</SUB
+></TD
+><TD
+>Cb<SUB
+>1</SUB
+></TD
+><TD
+>Cb<SUB
+>0</SUB
+></TD
+><TD
+>Cr<SUB
+>4</SUB
+></TD
+><TD
+>Cr<SUB
+>3</SUB
+></TD
+><TD
+>Cr<SUB
+>2</SUB
+></TD
+><TD
+>Cr<SUB
+>1</SUB
+></TD
+><TD
+>Cr<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>a</TD
+><TD
+>Y'<SUB
+>4</SUB
+></TD
+><TD
+>Y'<SUB
+>3</SUB
+></TD
+><TD
+>Y'<SUB
+>2</SUB
+></TD
+><TD
+>Y'<SUB
+>1</SUB
+></TD
+><TD
+>Y'<SUB
+>0</SUB
+></TD
+><TD
+>Cb<SUB
+>4</SUB
+></TD
+><TD
+>Cb<SUB
+>3</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><A
+NAME="V4L2-PIX-FMT-YUV565"
+></A
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUV565</CODE
+></TD
+><TD
+>'YUVP'</TD
+><TD
+>&nbsp;</TD
+><TD
+>Cb<SUB
+>2</SUB
+></TD
+><TD
+>Cb<SUB
+>1</SUB
+></TD
+><TD
+>Cb<SUB
+>0</SUB
+></TD
+><TD
+>Cr<SUB
+>4</SUB
+></TD
+><TD
+>Cr<SUB
+>3</SUB
+></TD
+><TD
+>Cr<SUB
+>2</SUB
+></TD
+><TD
+>Cr<SUB
+>1</SUB
+></TD
+><TD
+>Cr<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>Y'<SUB
+>4</SUB
+></TD
+><TD
+>Y'<SUB
+>3</SUB
+></TD
+><TD
+>Y'<SUB
+>2</SUB
+></TD
+><TD
+>Y'<SUB
+>1</SUB
+></TD
+><TD
+>Y'<SUB
+>0</SUB
+></TD
+><TD
+>Cb<SUB
+>5</SUB
+></TD
+><TD
+>Cb<SUB
+>4</SUB
+></TD
+><TD
+>Cb<SUB
+>3</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><A
+NAME="V4L2-PIX-FMT-YUV32"
+></A
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUV32</CODE
+></TD
+><TD
+>'YUV4'</TD
+><TD
+>&nbsp;</TD
+><TD
+>a<SUB
+>7</SUB
+></TD
+><TD
+>a<SUB
+>6</SUB
+></TD
+><TD
+>a<SUB
+>5</SUB
+></TD
+><TD
+>a<SUB
+>4</SUB
+></TD
+><TD
+>a<SUB
+>3</SUB
+></TD
+><TD
+>a<SUB
+>2</SUB
+></TD
+><TD
+>a<SUB
+>1</SUB
+></TD
+><TD
+>a<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>Y'<SUB
+>7</SUB
+></TD
+><TD
+>Y'<SUB
+>6</SUB
+></TD
+><TD
+>Y'<SUB
+>5</SUB
+></TD
+><TD
+>Y'<SUB
+>4</SUB
+></TD
+><TD
+>Y'<SUB
+>3</SUB
+></TD
+><TD
+>Y'<SUB
+>2</SUB
+></TD
+><TD
+>Y'<SUB
+>1</SUB
+></TD
+><TD
+>Y'<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>Cb<SUB
+>7</SUB
+></TD
+><TD
+>Cb<SUB
+>6</SUB
+></TD
+><TD
+>Cb<SUB
+>5</SUB
+></TD
+><TD
+>Cb<SUB
+>4</SUB
+></TD
+><TD
+>Cb<SUB
+>3</SUB
+></TD
+><TD
+>Cb<SUB
+>2</SUB
+></TD
+><TD
+>Cb<SUB
+>1</SUB
+></TD
+><TD
+>Cb<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>Cr<SUB
+>7</SUB
+></TD
+><TD
+>Cr<SUB
+>6</SUB
+></TD
+><TD
+>Cr<SUB
+>5</SUB
+></TD
+><TD
+>Cr<SUB
+>4</SUB
+></TD
+><TD
+>Cr<SUB
+>3</SUB
+></TD
+><TD
+>Cr<SUB
+>2</SUB
+></TD
+><TD
+>Cr<SUB
+>1</SUB
+></TD
+><TD
+>Cr<SUB
+>0</SUB
+></TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><P
+>Bit 7 is the most significant bit. The value of a = alpha
+bits is undefined when reading from the driver, ignored when writing
+to the driver, except when alpha blending has been negotiated for a
+<A
+HREF="x6570.htm"
+>Video Overlay</A
+> or <A
+HREF="x6909.htm"
+>Video Output Overlay</A
+>.</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x3891.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r4185.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>YUV Formats</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="x3891.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>V4L2_PIX_FMT_GREY ('GREY')</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r4185.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r4185.htm
new file mode 100644
index 0000000..626aef2
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r4185.htm
@@ -0,0 +1,285 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>V4L2_PIX_FMT_GREY ('GREY')</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="YUV Formats"
+HREF="x3891.htm"><LINK
+REL="PREVIOUS"
+TITLE="Packed YUV formats"
+HREF="r3896.htm"><LINK
+REL="NEXT"
+TITLE="V4L2_PIX_FMT_Y16 ('Y16 ')"
+HREF="r4246.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r3896.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r4246.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="V4L2-PIX-FMT-GREY"
+></A
+>V4L2_PIX_FMT_GREY ('GREY')</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN4189"
+></A
+><H2
+>Name</H2
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_GREY</CODE
+>&nbsp;--&nbsp;Grey-scale image</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4193"
+></A
+><H2
+>Description</H2
+><P
+>This is a grey-scale image. It is really a degenerate
+Y'CbCr format which simply contains no Cb or Cr data.</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN4196"
+></A
+><P
+><B
+>Example 2-1. <CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_GREY</CODE
+> 4 &times; 4
+pixel image</B
+></P
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>Byte Order. </B
+>Each cell is one byte.
+                <DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN4202"
+></A
+><TABLE
+BORDER="0"
+FRAME="void"
+CLASS="CALSTABLE"
+><COL
+WIDTH="2*"
+ALIGN="LEFT"><COL><COL><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>start&nbsp;+&nbsp;0:</TD
+><TD
+>Y'<SUB
+>00</SUB
+></TD
+><TD
+>Y'<SUB
+>01</SUB
+></TD
+><TD
+>Y'<SUB
+>02</SUB
+></TD
+><TD
+>Y'<SUB
+>03</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;4:</TD
+><TD
+>Y'<SUB
+>10</SUB
+></TD
+><TD
+>Y'<SUB
+>11</SUB
+></TD
+><TD
+>Y'<SUB
+>12</SUB
+></TD
+><TD
+>Y'<SUB
+>13</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;8:</TD
+><TD
+>Y'<SUB
+>20</SUB
+></TD
+><TD
+>Y'<SUB
+>21</SUB
+></TD
+><TD
+>Y'<SUB
+>22</SUB
+></TD
+><TD
+>Y'<SUB
+>23</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;12:</TD
+><TD
+>Y'<SUB
+>30</SUB
+></TD
+><TD
+>Y'<SUB
+>31</SUB
+></TD
+><TD
+>Y'<SUB
+>32</SUB
+></TD
+><TD
+>Y'<SUB
+>33</SUB
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+>
+              </P
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r3896.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r4246.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Packed YUV formats</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="x3891.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>V4L2_PIX_FMT_Y16 ('Y16 ')</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r4246.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r4246.htm
new file mode 100644
index 0000000..76502f3
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r4246.htm
@@ -0,0 +1,352 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>V4L2_PIX_FMT_Y16 ('Y16 ')</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="YUV Formats"
+HREF="x3891.htm"><LINK
+REL="PREVIOUS"
+TITLE="V4L2_PIX_FMT_GREY ('GREY')"
+HREF="r4185.htm"><LINK
+REL="NEXT"
+TITLE="V4L2_PIX_FMT_YUYV ('YUYV')"
+HREF="r4339.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r4185.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r4339.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="V4L2-PIX-FMT-Y16"
+></A
+>V4L2_PIX_FMT_Y16 ('Y16 ')</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN4250"
+></A
+><H2
+>Name</H2
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_Y16</CODE
+>&nbsp;--&nbsp;Grey-scale image</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4254"
+></A
+><H2
+>Description</H2
+><P
+>This is a grey-scale image with a depth of 16 bits per
+pixel. The least significant byte is stored at lower memory addresses
+(little-endian). Note the actual sampling precision may be lower than
+16 bits, for example 10 bits per pixel with values in range 0 to
+1023.</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN4257"
+></A
+><P
+><B
+>Example 2-1. <CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_Y16</CODE
+> 4 &times; 4
+pixel image</B
+></P
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>Byte Order. </B
+>Each cell is one byte.
+          <DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN4263"
+></A
+><TABLE
+BORDER="0"
+FRAME="void"
+CLASS="CALSTABLE"
+><COL
+WIDTH="2*"
+ALIGN="LEFT"><COL><COL><COL><COL><COL><COL><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>start&nbsp;+&nbsp;0:</TD
+><TD
+>Y'<SUB
+>00low</SUB
+></TD
+><TD
+>Y'<SUB
+>00high</SUB
+></TD
+><TD
+>Y'<SUB
+>01low</SUB
+></TD
+><TD
+>Y'<SUB
+>01high</SUB
+></TD
+><TD
+>Y'<SUB
+>02low</SUB
+></TD
+><TD
+>Y'<SUB
+>02high</SUB
+></TD
+><TD
+>Y'<SUB
+>03low</SUB
+></TD
+><TD
+>Y'<SUB
+>03high</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;8:</TD
+><TD
+>Y'<SUB
+>10low</SUB
+></TD
+><TD
+>Y'<SUB
+>10high</SUB
+></TD
+><TD
+>Y'<SUB
+>11low</SUB
+></TD
+><TD
+>Y'<SUB
+>11high</SUB
+></TD
+><TD
+>Y'<SUB
+>12low</SUB
+></TD
+><TD
+>Y'<SUB
+>12high</SUB
+></TD
+><TD
+>Y'<SUB
+>13low</SUB
+></TD
+><TD
+>Y'<SUB
+>13high</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;16:</TD
+><TD
+>Y'<SUB
+>20low</SUB
+></TD
+><TD
+>Y'<SUB
+>20high</SUB
+></TD
+><TD
+>Y'<SUB
+>21low</SUB
+></TD
+><TD
+>Y'<SUB
+>21high</SUB
+></TD
+><TD
+>Y'<SUB
+>22low</SUB
+></TD
+><TD
+>Y'<SUB
+>22high</SUB
+></TD
+><TD
+>Y'<SUB
+>23low</SUB
+></TD
+><TD
+>Y'<SUB
+>23high</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;24:</TD
+><TD
+>Y'<SUB
+>30low</SUB
+></TD
+><TD
+>Y'<SUB
+>30high</SUB
+></TD
+><TD
+>Y'<SUB
+>31low</SUB
+></TD
+><TD
+>Y'<SUB
+>31high</SUB
+></TD
+><TD
+>Y'<SUB
+>32low</SUB
+></TD
+><TD
+>Y'<SUB
+>32high</SUB
+></TD
+><TD
+>Y'<SUB
+>33low</SUB
+></TD
+><TD
+>Y'<SUB
+>33high</SUB
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+>
+        </P
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r4185.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r4339.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>V4L2_PIX_FMT_GREY ('GREY')</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="x3891.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>V4L2_PIX_FMT_YUYV ('YUYV')</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r4339.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r4339.htm
new file mode 100644
index 0000000..4e9f69a
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r4339.htm
@@ -0,0 +1,473 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>V4L2_PIX_FMT_YUYV ('YUYV')</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="YUV Formats"
+HREF="x3891.htm"><LINK
+REL="PREVIOUS"
+TITLE="V4L2_PIX_FMT_Y16 ('Y16 ')"
+HREF="r4246.htm"><LINK
+REL="NEXT"
+TITLE="V4L2_PIX_FMT_UYVY ('UYVY')"
+HREF="r4484.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r4246.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r4484.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="V4L2-PIX-FMT-YUYV"
+></A
+>V4L2_PIX_FMT_YUYV ('YUYV')</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN4343"
+></A
+><H2
+>Name</H2
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUYV</CODE
+>&nbsp;--&nbsp;Packed format with &frac12; horizontal chroma
+resolution, also known as YUV 4:2:2</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4347"
+></A
+><H2
+>Description</H2
+><P
+>In this format each four bytes is two pixels. Each four
+bytes is two Y's, a Cb and a Cr. Each Y goes to one of the pixels, and
+the Cb and Cr belong to both pixels. As you can see, the Cr and Cb
+components have half the horizontal resolution of the Y component.
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUYV </CODE
+> is known in the Windows
+environment as YUY2.</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN4351"
+></A
+><P
+><B
+>Example 2-1. <CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUYV</CODE
+> 4 &times; 4
+pixel image</B
+></P
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>Byte Order. </B
+>Each cell is one byte.
+                <DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN4357"
+></A
+><TABLE
+BORDER="0"
+FRAME="void"
+CLASS="CALSTABLE"
+><COL
+WIDTH="2*"
+ALIGN="LEFT"><COL><COL><COL><COL><COL><COL><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>start&nbsp;+&nbsp;0:</TD
+><TD
+>Y'<SUB
+>00</SUB
+></TD
+><TD
+>Cb<SUB
+>00</SUB
+></TD
+><TD
+>Y'<SUB
+>01</SUB
+></TD
+><TD
+>Cr<SUB
+>00</SUB
+></TD
+><TD
+>Y'<SUB
+>02</SUB
+></TD
+><TD
+>Cb<SUB
+>01</SUB
+></TD
+><TD
+>Y'<SUB
+>03</SUB
+></TD
+><TD
+>Cr<SUB
+>01</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;8:</TD
+><TD
+>Y'<SUB
+>10</SUB
+></TD
+><TD
+>Cb<SUB
+>10</SUB
+></TD
+><TD
+>Y'<SUB
+>11</SUB
+></TD
+><TD
+>Cr<SUB
+>10</SUB
+></TD
+><TD
+>Y'<SUB
+>12</SUB
+></TD
+><TD
+>Cb<SUB
+>11</SUB
+></TD
+><TD
+>Y'<SUB
+>13</SUB
+></TD
+><TD
+>Cr<SUB
+>11</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;16:</TD
+><TD
+>Y'<SUB
+>20</SUB
+></TD
+><TD
+>Cb<SUB
+>20</SUB
+></TD
+><TD
+>Y'<SUB
+>21</SUB
+></TD
+><TD
+>Cr<SUB
+>20</SUB
+></TD
+><TD
+>Y'<SUB
+>22</SUB
+></TD
+><TD
+>Cb<SUB
+>21</SUB
+></TD
+><TD
+>Y'<SUB
+>23</SUB
+></TD
+><TD
+>Cr<SUB
+>21</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;24:</TD
+><TD
+>Y'<SUB
+>30</SUB
+></TD
+><TD
+>Cb<SUB
+>30</SUB
+></TD
+><TD
+>Y'<SUB
+>31</SUB
+></TD
+><TD
+>Cr<SUB
+>30</SUB
+></TD
+><TD
+>Y'<SUB
+>32</SUB
+></TD
+><TD
+>Cb<SUB
+>31</SUB
+></TD
+><TD
+>Y'<SUB
+>33</SUB
+></TD
+><TD
+>Cr<SUB
+>31</SUB
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+>
+              </P
+></DIV
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>Color Sample Location. </B
+>                <DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN4436"
+></A
+><TABLE
+BORDER="0"
+FRAME="void"
+CLASS="CALSTABLE"
+><COL><COL><COL><COL><COL><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>0</TD
+><TD
+>&nbsp;</TD
+><TD
+>1</TD
+><TD
+>&nbsp;</TD
+><TD
+>2</TD
+><TD
+>&nbsp;</TD
+><TD
+>3</TD
+></TR
+><TR
+><TD
+>0</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+></TR
+><TR
+><TD
+>1</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+></TR
+><TR
+><TD
+>2</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+></TR
+><TR
+><TD
+>3</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+>
+              </P
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r4246.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r4484.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>V4L2_PIX_FMT_Y16 ('Y16 ')</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="x3891.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>V4L2_PIX_FMT_UYVY ('UYVY')</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r4484.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r4484.htm
new file mode 100644
index 0000000..152d3ed
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r4484.htm
@@ -0,0 +1,473 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>V4L2_PIX_FMT_UYVY ('UYVY')</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="YUV Formats"
+HREF="x3891.htm"><LINK
+REL="PREVIOUS"
+TITLE="V4L2_PIX_FMT_YUYV ('YUYV')"
+HREF="r4339.htm"><LINK
+REL="NEXT"
+TITLE="V4L2_PIX_FMT_Y41P ('Y41P')"
+HREF="r4629.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r4339.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r4629.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="V4L2-PIX-FMT-UYVY"
+></A
+>V4L2_PIX_FMT_UYVY ('UYVY')</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN4488"
+></A
+><H2
+>Name</H2
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_UYVY</CODE
+>&nbsp;--&nbsp;Variation of
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUYV</CODE
+> with different order of samples
+in memory</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4493"
+></A
+><H2
+>Description</H2
+><P
+>In this format each four bytes is two pixels. Each four
+bytes is two Y's, a Cb and a Cr. Each Y goes to one of the pixels, and
+the Cb and Cr belong to both pixels. As you can see, the Cr and Cb
+components have half the horizontal resolution of the Y
+component.</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN4496"
+></A
+><P
+><B
+>Example 2-1. <CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_UYVY</CODE
+> 4 &times; 4
+pixel image</B
+></P
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>Byte Order. </B
+>Each cell is one byte.
+                <DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN4502"
+></A
+><TABLE
+BORDER="0"
+FRAME="void"
+CLASS="CALSTABLE"
+><COL
+WIDTH="2*"
+ALIGN="LEFT"><COL><COL><COL><COL><COL><COL><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>start&nbsp;+&nbsp;0:</TD
+><TD
+>Cb<SUB
+>00</SUB
+></TD
+><TD
+>Y'<SUB
+>00</SUB
+></TD
+><TD
+>Cr<SUB
+>00</SUB
+></TD
+><TD
+>Y'<SUB
+>01</SUB
+></TD
+><TD
+>Cb<SUB
+>01</SUB
+></TD
+><TD
+>Y'<SUB
+>02</SUB
+></TD
+><TD
+>Cr<SUB
+>01</SUB
+></TD
+><TD
+>Y'<SUB
+>03</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;8:</TD
+><TD
+>Cb<SUB
+>10</SUB
+></TD
+><TD
+>Y'<SUB
+>10</SUB
+></TD
+><TD
+>Cr<SUB
+>10</SUB
+></TD
+><TD
+>Y'<SUB
+>11</SUB
+></TD
+><TD
+>Cb<SUB
+>11</SUB
+></TD
+><TD
+>Y'<SUB
+>12</SUB
+></TD
+><TD
+>Cr<SUB
+>11</SUB
+></TD
+><TD
+>Y'<SUB
+>13</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;16:</TD
+><TD
+>Cb<SUB
+>20</SUB
+></TD
+><TD
+>Y'<SUB
+>20</SUB
+></TD
+><TD
+>Cr<SUB
+>20</SUB
+></TD
+><TD
+>Y'<SUB
+>21</SUB
+></TD
+><TD
+>Cb<SUB
+>21</SUB
+></TD
+><TD
+>Y'<SUB
+>22</SUB
+></TD
+><TD
+>Cr<SUB
+>21</SUB
+></TD
+><TD
+>Y'<SUB
+>23</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;24:</TD
+><TD
+>Cb<SUB
+>30</SUB
+></TD
+><TD
+>Y'<SUB
+>30</SUB
+></TD
+><TD
+>Cr<SUB
+>30</SUB
+></TD
+><TD
+>Y'<SUB
+>31</SUB
+></TD
+><TD
+>Cb<SUB
+>31</SUB
+></TD
+><TD
+>Y'<SUB
+>32</SUB
+></TD
+><TD
+>Cr<SUB
+>31</SUB
+></TD
+><TD
+>Y'<SUB
+>33</SUB
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+>
+              </P
+></DIV
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>Color Sample Location. </B
+>                <DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN4581"
+></A
+><TABLE
+BORDER="0"
+FRAME="void"
+CLASS="CALSTABLE"
+><COL><COL><COL><COL><COL><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>0</TD
+><TD
+>&nbsp;</TD
+><TD
+>1</TD
+><TD
+>&nbsp;</TD
+><TD
+>2</TD
+><TD
+>&nbsp;</TD
+><TD
+>3</TD
+></TR
+><TR
+><TD
+>0</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+></TR
+><TR
+><TD
+>1</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+></TR
+><TR
+><TD
+>2</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+></TR
+><TR
+><TD
+>3</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+>
+              </P
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r4339.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r4629.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>V4L2_PIX_FMT_YUYV ('YUYV')</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="x3891.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>V4L2_PIX_FMT_Y41P ('Y41P')</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r4629.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r4629.htm
new file mode 100644
index 0000000..57040fd
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r4629.htm
@@ -0,0 +1,634 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>V4L2_PIX_FMT_Y41P ('Y41P')</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="YUV Formats"
+HREF="x3891.htm"><LINK
+REL="PREVIOUS"
+TITLE="V4L2_PIX_FMT_UYVY ('UYVY')"
+HREF="r4484.htm"><LINK
+REL="NEXT"
+TITLE="V4L2_PIX_FMT_YVU420 ('YV12'), V4L2_PIX_FMT_YUV420 ('YU12')"
+HREF="r4850.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r4484.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r4850.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="V4L2-PIX-FMT-Y41P"
+></A
+>V4L2_PIX_FMT_Y41P ('Y41P')</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN4633"
+></A
+><H2
+>Name</H2
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_Y41P</CODE
+>&nbsp;--&nbsp;Format with &frac14; horizontal chroma
+resolution, also known as YUV 4:1:1</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4637"
+></A
+><H2
+>Description</H2
+><P
+>In this format each 12 bytes is eight pixels. In the
+twelve bytes are two CbCr pairs and eight Y's. The first CbCr pair
+goes with the first four Y's, and the second CbCr pair goes with the
+other four Y's. The Cb and Cr components have one fourth the
+horizontal resolution of the Y component.</P
+><P
+>Do not confuse this format with <A
+HREF="r5319.htm"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUV411P</CODE
+></A
+>. 
+Y41P is derived from "YUV 4:1:1 <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>packed</I
+></SPAN
+>", while
+YUV411P stands for "YUV 4:1:1 <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>planar</I
+></SPAN
+>".</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN4645"
+></A
+><P
+><B
+>Example 2-1. <CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_Y41P</CODE
+> 8 &times; 4
+pixel image</B
+></P
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>Byte Order. </B
+>Each cell is one byte.
+                <DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN4651"
+></A
+><TABLE
+BORDER="0"
+FRAME="void"
+CLASS="CALSTABLE"
+><COL
+WIDTH="2*"
+ALIGN="LEFT"><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>start&nbsp;+&nbsp;0:</TD
+><TD
+>Cb<SUB
+>00</SUB
+></TD
+><TD
+>Y'<SUB
+>00</SUB
+></TD
+><TD
+>Cr<SUB
+>00</SUB
+></TD
+><TD
+>Y'<SUB
+>01</SUB
+></TD
+><TD
+>Cb<SUB
+>01</SUB
+></TD
+><TD
+>Y'<SUB
+>02</SUB
+></TD
+><TD
+>Cr<SUB
+>01</SUB
+></TD
+><TD
+>Y'<SUB
+>03</SUB
+></TD
+><TD
+>Y'<SUB
+>04</SUB
+></TD
+><TD
+>Y'<SUB
+>05</SUB
+></TD
+><TD
+>Y'<SUB
+>06</SUB
+></TD
+><TD
+>Y'<SUB
+>07</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;12:</TD
+><TD
+>Cb<SUB
+>10</SUB
+></TD
+><TD
+>Y'<SUB
+>10</SUB
+></TD
+><TD
+>Cr<SUB
+>10</SUB
+></TD
+><TD
+>Y'<SUB
+>11</SUB
+></TD
+><TD
+>Cb<SUB
+>11</SUB
+></TD
+><TD
+>Y'<SUB
+>12</SUB
+></TD
+><TD
+>Cr<SUB
+>11</SUB
+></TD
+><TD
+>Y'<SUB
+>13</SUB
+></TD
+><TD
+>Y'<SUB
+>14</SUB
+></TD
+><TD
+>Y'<SUB
+>15</SUB
+></TD
+><TD
+>Y'<SUB
+>16</SUB
+></TD
+><TD
+>Y'<SUB
+>17</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;24:</TD
+><TD
+>Cb<SUB
+>20</SUB
+></TD
+><TD
+>Y'<SUB
+>20</SUB
+></TD
+><TD
+>Cr<SUB
+>20</SUB
+></TD
+><TD
+>Y'<SUB
+>21</SUB
+></TD
+><TD
+>Cb<SUB
+>21</SUB
+></TD
+><TD
+>Y'<SUB
+>22</SUB
+></TD
+><TD
+>Cr<SUB
+>21</SUB
+></TD
+><TD
+>Y'<SUB
+>23</SUB
+></TD
+><TD
+>Y'<SUB
+>24</SUB
+></TD
+><TD
+>Y'<SUB
+>25</SUB
+></TD
+><TD
+>Y'<SUB
+>26</SUB
+></TD
+><TD
+>Y'<SUB
+>27</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;36:</TD
+><TD
+>Cb<SUB
+>30</SUB
+></TD
+><TD
+>Y'<SUB
+>30</SUB
+></TD
+><TD
+>Cr<SUB
+>30</SUB
+></TD
+><TD
+>Y'<SUB
+>31</SUB
+></TD
+><TD
+>Cb<SUB
+>31</SUB
+></TD
+><TD
+>Y'<SUB
+>32</SUB
+></TD
+><TD
+>Cr<SUB
+>31</SUB
+></TD
+><TD
+>Y'<SUB
+>33</SUB
+></TD
+><TD
+>Y'<SUB
+>34</SUB
+></TD
+><TD
+>Y'<SUB
+>35</SUB
+></TD
+><TD
+>Y'<SUB
+>36</SUB
+></TD
+><TD
+>Y'<SUB
+>37</SUB
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></P
+></DIV
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>Color Sample Location. </B
+>                <DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN4762"
+></A
+><TABLE
+BORDER="0"
+FRAME="void"
+CLASS="CALSTABLE"
+><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>0</TD
+><TD
+>&nbsp;</TD
+><TD
+>1</TD
+><TD
+>&nbsp;</TD
+><TD
+>2</TD
+><TD
+>&nbsp;</TD
+><TD
+>3</TD
+><TD
+>&nbsp;</TD
+><TD
+>4</TD
+><TD
+>&nbsp;</TD
+><TD
+>5</TD
+><TD
+>&nbsp;</TD
+><TD
+>6</TD
+><TD
+>&nbsp;</TD
+><TD
+>7</TD
+></TR
+><TR
+><TD
+>0</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+></TR
+><TR
+><TD
+>1</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+></TR
+><TR
+><TD
+>2</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+></TR
+><TR
+><TD
+>3</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+>
+              </P
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r4484.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r4850.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>V4L2_PIX_FMT_UYVY ('UYVY')</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="x3891.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>V4L2_PIX_FMT_YVU420 ('YV12'), V4L2_PIX_FMT_YUV420 ('YU12')</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r4850.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r4850.htm
new file mode 100644
index 0000000..3f18685
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r4850.htm
@@ -0,0 +1,552 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>V4L2_PIX_FMT_YVU420 ('YV12'), V4L2_PIX_FMT_YUV420 ('YU12')</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="YUV Formats"
+HREF="x3891.htm"><LINK
+REL="PREVIOUS"
+TITLE="V4L2_PIX_FMT_Y41P ('Y41P')"
+HREF="r4629.htm"><LINK
+REL="NEXT"
+TITLE="V4L2_PIX_FMT_YVU410 ('YVU9'), V4L2_PIX_FMT_YUV410 ('YUV9')"
+HREF="r5016.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r4629.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r5016.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="AEN4850"
+></A
+>V4L2_PIX_FMT_YVU420 ('YV12'), V4L2_PIX_FMT_YUV420 ('YU12')</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN4854"
+></A
+><H2
+>Name</H2
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YVU420</CODE
+>, <CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUV420</CODE
+>&nbsp;--&nbsp;Planar formats with &frac12; horizontal and
+vertical chroma resolution, also known as YUV 4:2:0</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4860"
+></A
+><H2
+>Description</H2
+><P
+>These are planar formats, as opposed to a packed format.
+The three components are separated into three sub- images or planes.
+The Y plane is first. The Y plane has one byte per pixel. For
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YVU420</CODE
+>, the Cr plane immediately
+follows the Y plane in memory. The Cr plane is half the width and half
+the height of the Y plane (and of the image). Each Cr belongs to four
+pixels, a two-by-two square of the image. For example,
+Cr<SUB
+>0</SUB
+> belongs to Y'<SUB
+>00</SUB
+>,
+Y'<SUB
+>01</SUB
+>, Y'<SUB
+>10</SUB
+>, and
+Y'<SUB
+>11</SUB
+>. Following the Cr plane is the Cb plane,
+just like the Cr plane. <CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUV420</CODE
+> is
+the same except the Cb plane comes first, then the Cr plane.</P
+><P
+>If the Y plane has pad bytes after each row, then the Cr
+and Cb planes have half as many pad bytes after their rows. In other
+words, two Cx rows (including padding) is exactly as long as one Y row
+(including padding).</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN4871"
+></A
+><P
+><B
+>Example 2-1. <CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YVU420</CODE
+> 4 &times; 4
+pixel image</B
+></P
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>Byte Order. </B
+>Each cell is one byte.
+                <DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN4877"
+></A
+><TABLE
+BORDER="0"
+FRAME="void"
+CLASS="CALSTABLE"
+><COL
+WIDTH="2*"
+ALIGN="LEFT"><COL><COL><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>start&nbsp;+&nbsp;0:</TD
+><TD
+>Y'<SUB
+>00</SUB
+></TD
+><TD
+>Y'<SUB
+>01</SUB
+></TD
+><TD
+>Y'<SUB
+>02</SUB
+></TD
+><TD
+>Y'<SUB
+>03</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;4:</TD
+><TD
+>Y'<SUB
+>10</SUB
+></TD
+><TD
+>Y'<SUB
+>11</SUB
+></TD
+><TD
+>Y'<SUB
+>12</SUB
+></TD
+><TD
+>Y'<SUB
+>13</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;8:</TD
+><TD
+>Y'<SUB
+>20</SUB
+></TD
+><TD
+>Y'<SUB
+>21</SUB
+></TD
+><TD
+>Y'<SUB
+>22</SUB
+></TD
+><TD
+>Y'<SUB
+>23</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;12:</TD
+><TD
+>Y'<SUB
+>30</SUB
+></TD
+><TD
+>Y'<SUB
+>31</SUB
+></TD
+><TD
+>Y'<SUB
+>32</SUB
+></TD
+><TD
+>Y'<SUB
+>33</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;16:</TD
+><TD
+>Cr<SUB
+>00</SUB
+></TD
+><TD
+>Cr<SUB
+>01</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;18:</TD
+><TD
+>Cr<SUB
+>10</SUB
+></TD
+><TD
+>Cr<SUB
+>11</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;20:</TD
+><TD
+>Cb<SUB
+>00</SUB
+></TD
+><TD
+>Cb<SUB
+>01</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;22:</TD
+><TD
+>Cb<SUB
+>10</SUB
+></TD
+><TD
+>Cb<SUB
+>11</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+>
+              </P
+></DIV
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>Color Sample Location. </B
+>                <DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN4948"
+></A
+><TABLE
+BORDER="0"
+FRAME="void"
+CLASS="CALSTABLE"
+><COL><COL><COL><COL><COL><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>0</TD
+><TD
+>&nbsp;</TD
+><TD
+>1</TD
+><TD
+>&nbsp;</TD
+><TD
+>2</TD
+><TD
+>&nbsp;</TD
+><TD
+>3</TD
+></TR
+><TR
+><TD
+>0</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>C</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>C</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>1</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>2</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>C</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>C</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>3</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+>
+              </P
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r4629.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r5016.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>V4L2_PIX_FMT_Y41P ('Y41P')</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="x3891.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>V4L2_PIX_FMT_YVU410 ('YVU9'), V4L2_PIX_FMT_YUV410 ('YUV9')</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r5016.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r5016.htm
new file mode 100644
index 0000000..7aedb81
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r5016.htm
@@ -0,0 +1,502 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>V4L2_PIX_FMT_YVU410 ('YVU9'), V4L2_PIX_FMT_YUV410 ('YUV9')</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="YUV Formats"
+HREF="x3891.htm"><LINK
+REL="PREVIOUS"
+TITLE="V4L2_PIX_FMT_YVU420 ('YV12'), V4L2_PIX_FMT_YUV420 ('YU12')"
+HREF="r4850.htm"><LINK
+REL="NEXT"
+TITLE="V4L2_PIX_FMT_YUV422P ('422P')"
+HREF="r5154.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r4850.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r5154.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="AEN5016"
+></A
+>V4L2_PIX_FMT_YVU410 ('YVU9'), V4L2_PIX_FMT_YUV410 ('YUV9')</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN5020"
+></A
+><H2
+>Name</H2
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YVU410</CODE
+>, <CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUV410</CODE
+>&nbsp;--&nbsp;Planar formats with &frac14; horizontal and
+vertical chroma resolution, also known as YUV 4:1:0</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5026"
+></A
+><H2
+>Description</H2
+><P
+>These are planar formats, as opposed to a packed format.
+The three components are separated into three sub-images or planes.
+The Y plane is first. The Y plane has one byte per pixel. For
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YVU410</CODE
+>, the Cr plane immediately
+follows the Y plane in memory. The Cr plane is &frac14; the width and
+&frac14; the height of the Y plane (and of the image). Each Cr belongs
+to 16 pixels, a four-by-four square of the image. Following the Cr
+plane is the Cb plane, just like the Cr plane.
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUV410</CODE
+> is the same, except the Cb
+plane comes first, then the Cr plane.</P
+><P
+>If the Y plane has pad bytes after each row, then the Cr
+and Cb planes have &frac14; as many pad bytes after their rows. In
+other words, four Cx rows (including padding) are exactly as long as
+one Y row (including padding).</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN5032"
+></A
+><P
+><B
+>Example 2-1. <CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YVU410</CODE
+> 4 &times; 4
+pixel image</B
+></P
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>Byte Order. </B
+>Each cell is one byte.
+                <DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN5038"
+></A
+><TABLE
+BORDER="0"
+FRAME="void"
+CLASS="CALSTABLE"
+><COL
+WIDTH="2*"
+ALIGN="LEFT"><COL><COL><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>start&nbsp;+&nbsp;0:</TD
+><TD
+>Y'<SUB
+>00</SUB
+></TD
+><TD
+>Y'<SUB
+>01</SUB
+></TD
+><TD
+>Y'<SUB
+>02</SUB
+></TD
+><TD
+>Y'<SUB
+>03</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;4:</TD
+><TD
+>Y'<SUB
+>10</SUB
+></TD
+><TD
+>Y'<SUB
+>11</SUB
+></TD
+><TD
+>Y'<SUB
+>12</SUB
+></TD
+><TD
+>Y'<SUB
+>13</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;8:</TD
+><TD
+>Y'<SUB
+>20</SUB
+></TD
+><TD
+>Y'<SUB
+>21</SUB
+></TD
+><TD
+>Y'<SUB
+>22</SUB
+></TD
+><TD
+>Y'<SUB
+>23</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;12:</TD
+><TD
+>Y'<SUB
+>30</SUB
+></TD
+><TD
+>Y'<SUB
+>31</SUB
+></TD
+><TD
+>Y'<SUB
+>32</SUB
+></TD
+><TD
+>Y'<SUB
+>33</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;16:</TD
+><TD
+>Cr<SUB
+>00</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;17:</TD
+><TD
+>Cb<SUB
+>00</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+>
+              </P
+></DIV
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>Color Sample Location. </B
+>                <DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN5093"
+></A
+><TABLE
+BORDER="0"
+FRAME="void"
+CLASS="CALSTABLE"
+><COL><COL><COL><COL><COL><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>0</TD
+><TD
+>&nbsp;</TD
+><TD
+>1</TD
+><TD
+>&nbsp;</TD
+><TD
+>2</TD
+><TD
+>&nbsp;</TD
+><TD
+>3</TD
+></TR
+><TR
+><TD
+>0</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>1</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>C</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>2</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>3</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+>
+              </P
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r4850.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r5154.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>V4L2_PIX_FMT_YVU420 ('YV12'), V4L2_PIX_FMT_YUV420 ('YU12')</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="x3891.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>V4L2_PIX_FMT_YUV422P ('422P')</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r5154.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r5154.htm
new file mode 100644
index 0000000..7137942
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r5154.htm
@@ -0,0 +1,552 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>V4L2_PIX_FMT_YUV422P ('422P')</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="YUV Formats"
+HREF="x3891.htm"><LINK
+REL="PREVIOUS"
+TITLE="V4L2_PIX_FMT_YVU410 ('YVU9'), V4L2_PIX_FMT_YUV410 ('YUV9')"
+HREF="r5016.htm"><LINK
+REL="NEXT"
+TITLE="V4L2_PIX_FMT_YUV411P ('411P')"
+HREF="r5319.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r5016.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r5319.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="V4L2-PIX-FMT-YUV422P"
+></A
+>V4L2_PIX_FMT_YUV422P ('422P')</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN5158"
+></A
+><H2
+>Name</H2
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUV422P</CODE
+>&nbsp;--&nbsp;Format with &frac12; horizontal chroma resolution,
+also known as YUV 4:2:2. Planar layout as opposed to
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUYV</CODE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5163"
+></A
+><H2
+>Description</H2
+><P
+>This format is not commonly used. This is a planar
+version of the YUYV format. The three components are separated into
+three sub-images or planes. The Y plane is first. The Y plane has one
+byte per pixel. The Cb plane immediately follows the Y plane in
+memory. The Cb plane is half the width of the Y plane (and of the
+image). Each Cb belongs to two pixels. For example,
+Cb<SUB
+>0</SUB
+> belongs to Y'<SUB
+>00</SUB
+>,
+Y'<SUB
+>01</SUB
+>. Following the Cb plane is the Cr plane,
+just like the Cb plane.</P
+><P
+>If the Y plane has pad bytes after each row, then the Cr
+and Cb planes have half as many pad bytes after their rows. In other
+words, two Cx rows (including padding) is exactly as long as one Y row
+(including padding).</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN5170"
+></A
+><P
+><B
+>Example 2-1. <CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUV422P</CODE
+> 4 &times; 4
+pixel image</B
+></P
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>Byte Order. </B
+>Each cell is one byte.
+                <DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN5176"
+></A
+><TABLE
+BORDER="0"
+FRAME="void"
+CLASS="CALSTABLE"
+><COL
+WIDTH="2*"
+ALIGN="LEFT"><COL><COL><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>start&nbsp;+&nbsp;0:</TD
+><TD
+>Y'<SUB
+>00</SUB
+></TD
+><TD
+>Y'<SUB
+>01</SUB
+></TD
+><TD
+>Y'<SUB
+>02</SUB
+></TD
+><TD
+>Y'<SUB
+>03</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;4:</TD
+><TD
+>Y'<SUB
+>10</SUB
+></TD
+><TD
+>Y'<SUB
+>11</SUB
+></TD
+><TD
+>Y'<SUB
+>12</SUB
+></TD
+><TD
+>Y'<SUB
+>13</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;8:</TD
+><TD
+>Y'<SUB
+>20</SUB
+></TD
+><TD
+>Y'<SUB
+>21</SUB
+></TD
+><TD
+>Y'<SUB
+>22</SUB
+></TD
+><TD
+>Y'<SUB
+>23</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;12:</TD
+><TD
+>Y'<SUB
+>30</SUB
+></TD
+><TD
+>Y'<SUB
+>31</SUB
+></TD
+><TD
+>Y'<SUB
+>32</SUB
+></TD
+><TD
+>Y'<SUB
+>33</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;16:</TD
+><TD
+>Cb<SUB
+>00</SUB
+></TD
+><TD
+>Cb<SUB
+>01</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;18:</TD
+><TD
+>Cb<SUB
+>10</SUB
+></TD
+><TD
+>Cb<SUB
+>11</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;20:</TD
+><TD
+>Cb<SUB
+>20</SUB
+></TD
+><TD
+>Cb<SUB
+>21</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;22:</TD
+><TD
+>Cb<SUB
+>30</SUB
+></TD
+><TD
+>Cb<SUB
+>31</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;24:</TD
+><TD
+>Cr<SUB
+>00</SUB
+></TD
+><TD
+>Cr<SUB
+>01</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;26:</TD
+><TD
+>Cr<SUB
+>10</SUB
+></TD
+><TD
+>Cr<SUB
+>11</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;28:</TD
+><TD
+>Cr<SUB
+>20</SUB
+></TD
+><TD
+>Cr<SUB
+>21</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;30:</TD
+><TD
+>Cr<SUB
+>30</SUB
+></TD
+><TD
+>Cr<SUB
+>31</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+>
+              </P
+></DIV
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>Color Sample Location. </B
+>                <DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN5271"
+></A
+><TABLE
+BORDER="0"
+FRAME="void"
+CLASS="CALSTABLE"
+><COL><COL><COL><COL><COL><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>0</TD
+><TD
+>&nbsp;</TD
+><TD
+>1</TD
+><TD
+>&nbsp;</TD
+><TD
+>2</TD
+><TD
+>&nbsp;</TD
+><TD
+>3</TD
+></TR
+><TR
+><TD
+>0</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+></TR
+><TR
+><TD
+>1</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+></TR
+><TR
+><TD
+>2</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+></TR
+><TR
+><TD
+>3</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+>
+              </P
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r5016.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r5319.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>V4L2_PIX_FMT_YVU410 ('YVU9'), V4L2_PIX_FMT_YUV410 ('YUV9')</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="x3891.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>V4L2_PIX_FMT_YUV411P ('411P')</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r5319.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r5319.htm
new file mode 100644
index 0000000..e0dc270
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r5319.htm
@@ -0,0 +1,542 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>V4L2_PIX_FMT_YUV411P ('411P')</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="YUV Formats"
+HREF="x3891.htm"><LINK
+REL="PREVIOUS"
+TITLE="V4L2_PIX_FMT_YUV422P ('422P')"
+HREF="r5154.htm"><LINK
+REL="NEXT"
+TITLE="V4L2_PIX_FMT_NV12 ('NV12'), V4L2_PIX_FMT_NV21 ('NV21')"
+HREF="r5470.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r5154.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r5470.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="V4L2-PIX-FMT-YUV411P"
+></A
+>V4L2_PIX_FMT_YUV411P ('411P')</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN5323"
+></A
+><H2
+>Name</H2
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUV411P</CODE
+>&nbsp;--&nbsp;Format with &frac14; horizontal chroma resolution,
+also known as YUV 4:1:1. Planar layout as opposed to
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_Y41P</CODE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5328"
+></A
+><H2
+>Description</H2
+><P
+>This format is not commonly used. This is a planar
+format similar to the 4:2:2 planar format except with half as many
+chroma. The three components are separated into three sub-images or
+planes. The Y plane is first. The Y plane has one byte per pixel. The
+Cb plane immediately follows the Y plane in memory. The Cb plane is
+&frac14; the width of the Y plane (and of the image). Each Cb belongs
+to 4 pixels all on the same row. For example,
+Cb<SUB
+>0</SUB
+> belongs to Y'<SUB
+>00</SUB
+>,
+Y'<SUB
+>01</SUB
+>, Y'<SUB
+>02</SUB
+> and
+Y'<SUB
+>03</SUB
+>. Following the Cb plane is the Cr plane,
+just like the Cb plane.</P
+><P
+>If the Y plane has pad bytes after each row, then the Cr
+and Cb planes have &frac14; as many pad bytes after their rows. In
+other words, four C x rows (including padding) is exactly as long as
+one Y row (including padding).</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN5337"
+></A
+><P
+><B
+>Example 2-1. <CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUV411P</CODE
+> 4 &times; 4
+pixel image</B
+></P
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>Byte Order. </B
+>Each cell is one byte.
+                <DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN5343"
+></A
+><TABLE
+BORDER="0"
+FRAME="void"
+CLASS="CALSTABLE"
+><COL
+WIDTH="2*"
+ALIGN="LEFT"><COL><COL><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>start&nbsp;+&nbsp;0:</TD
+><TD
+>Y'<SUB
+>00</SUB
+></TD
+><TD
+>Y'<SUB
+>01</SUB
+></TD
+><TD
+>Y'<SUB
+>02</SUB
+></TD
+><TD
+>Y'<SUB
+>03</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;4:</TD
+><TD
+>Y'<SUB
+>10</SUB
+></TD
+><TD
+>Y'<SUB
+>11</SUB
+></TD
+><TD
+>Y'<SUB
+>12</SUB
+></TD
+><TD
+>Y'<SUB
+>13</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;8:</TD
+><TD
+>Y'<SUB
+>20</SUB
+></TD
+><TD
+>Y'<SUB
+>21</SUB
+></TD
+><TD
+>Y'<SUB
+>22</SUB
+></TD
+><TD
+>Y'<SUB
+>23</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;12:</TD
+><TD
+>Y'<SUB
+>30</SUB
+></TD
+><TD
+>Y'<SUB
+>31</SUB
+></TD
+><TD
+>Y'<SUB
+>32</SUB
+></TD
+><TD
+>Y'<SUB
+>33</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;16:</TD
+><TD
+>Cb<SUB
+>00</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;17:</TD
+><TD
+>Cb<SUB
+>10</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;18:</TD
+><TD
+>Cb<SUB
+>20</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;19:</TD
+><TD
+>Cb<SUB
+>30</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;20:</TD
+><TD
+>Cr<SUB
+>00</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;21:</TD
+><TD
+>Cr<SUB
+>10</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;22:</TD
+><TD
+>Cr<SUB
+>20</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;23:</TD
+><TD
+>Cr<SUB
+>30</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+>
+              </P
+></DIV
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>Color Sample Location. </B
+>                <DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN5422"
+></A
+><TABLE
+BORDER="0"
+FRAME="void"
+CLASS="CALSTABLE"
+><COL><COL><COL><COL><COL><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>0</TD
+><TD
+>&nbsp;</TD
+><TD
+>1</TD
+><TD
+>&nbsp;</TD
+><TD
+>2</TD
+><TD
+>&nbsp;</TD
+><TD
+>3</TD
+></TR
+><TR
+><TD
+>0</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+></TR
+><TR
+><TD
+>1</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+></TR
+><TR
+><TD
+>2</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+></TR
+><TR
+><TD
+>3</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>C</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+>
+              </P
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r5154.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r5470.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>V4L2_PIX_FMT_YUV422P ('422P')</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="x3891.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>V4L2_PIX_FMT_NV12 ('NV12'), V4L2_PIX_FMT_NV21 ('NV21')</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r5470.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r5470.htm
new file mode 100644
index 0000000..20c8900
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r5470.htm
@@ -0,0 +1,533 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>V4L2_PIX_FMT_NV12 ('NV12'), V4L2_PIX_FMT_NV21 ('NV21')</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="YUV Formats"
+HREF="x3891.htm"><LINK
+REL="PREVIOUS"
+TITLE="V4L2_PIX_FMT_YUV411P ('411P')"
+HREF="r5319.htm"><LINK
+REL="NEXT"
+TITLE="Compressed Formats"
+HREF="x5634.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r5319.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x5634.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="AEN5470"
+></A
+>V4L2_PIX_FMT_NV12 ('NV12'), V4L2_PIX_FMT_NV21 ('NV21')</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN5474"
+></A
+><H2
+>Name</H2
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_NV12</CODE
+>, <CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_NV21</CODE
+>&nbsp;--&nbsp;Formats with &frac12; horizontal and vertical
+chroma resolution, also known as YUV 4:2:0. One luminance and one
+chrominance plane with alternating chroma samples as opposed to
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YVU420</CODE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5481"
+></A
+><H2
+>Description</H2
+><P
+>These are two-plane versions of the YUV 4:2:0 format.
+The three components are separated into two sub-images or planes. The
+Y plane is first. The Y plane has one byte per pixel. For
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_NV12</CODE
+>, a combined CbCr plane
+immediately follows the Y plane in memory.  The CbCr plane is the same
+width, in bytes, as the Y plane (and of the image), but is half as
+tall in pixels. Each CbCr pair belongs to four pixels. For example,
+Cb<SUB
+>0</SUB
+>/Cr<SUB
+>0</SUB
+> belongs to
+Y'<SUB
+>00</SUB
+>, Y'<SUB
+>01</SUB
+>,
+Y'<SUB
+>10</SUB
+>, Y'<SUB
+>11</SUB
+>.
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_NV21</CODE
+> is the same except the Cb and
+Cr bytes are swapped, the CrCb plane starts with a Cr byte.</P
+><P
+>If the Y plane has pad bytes after each row, then the
+CbCr plane has as many pad bytes after its rows.</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN5493"
+></A
+><P
+><B
+>Example 2-1. <CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_NV12</CODE
+> 4 &times; 4
+pixel image</B
+></P
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>Byte Order. </B
+>Each cell is one byte.
+                <DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN5499"
+></A
+><TABLE
+BORDER="0"
+FRAME="void"
+CLASS="CALSTABLE"
+><COL
+WIDTH="2*"
+ALIGN="LEFT"><COL><COL><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>start&nbsp;+&nbsp;0:</TD
+><TD
+>Y'<SUB
+>00</SUB
+></TD
+><TD
+>Y'<SUB
+>01</SUB
+></TD
+><TD
+>Y'<SUB
+>02</SUB
+></TD
+><TD
+>Y'<SUB
+>03</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;4:</TD
+><TD
+>Y'<SUB
+>10</SUB
+></TD
+><TD
+>Y'<SUB
+>11</SUB
+></TD
+><TD
+>Y'<SUB
+>12</SUB
+></TD
+><TD
+>Y'<SUB
+>13</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;8:</TD
+><TD
+>Y'<SUB
+>20</SUB
+></TD
+><TD
+>Y'<SUB
+>21</SUB
+></TD
+><TD
+>Y'<SUB
+>22</SUB
+></TD
+><TD
+>Y'<SUB
+>23</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;12:</TD
+><TD
+>Y'<SUB
+>30</SUB
+></TD
+><TD
+>Y'<SUB
+>31</SUB
+></TD
+><TD
+>Y'<SUB
+>32</SUB
+></TD
+><TD
+>Y'<SUB
+>33</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;16:</TD
+><TD
+>Cb<SUB
+>00</SUB
+></TD
+><TD
+>Cr<SUB
+>00</SUB
+></TD
+><TD
+>Cb<SUB
+>01</SUB
+></TD
+><TD
+>Cr<SUB
+>01</SUB
+></TD
+></TR
+><TR
+><TD
+>start&nbsp;+&nbsp;20:</TD
+><TD
+>Cb<SUB
+>10</SUB
+></TD
+><TD
+>Cr<SUB
+>10</SUB
+></TD
+><TD
+>Cb<SUB
+>11</SUB
+></TD
+><TD
+>Cr<SUB
+>11</SUB
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+>
+              </P
+></DIV
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>Color Sample Location. </B
+>                <DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN5566"
+></A
+><TABLE
+BORDER="0"
+FRAME="void"
+CLASS="CALSTABLE"
+><COL><COL><COL><COL><COL><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>0</TD
+><TD
+>&nbsp;</TD
+><TD
+>1</TD
+><TD
+>&nbsp;</TD
+><TD
+>2</TD
+><TD
+>&nbsp;</TD
+><TD
+>3</TD
+></TR
+><TR
+><TD
+>0</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>C</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>C</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>1</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>2</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>C</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>C</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>3</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+><TD
+>&nbsp;</TD
+><TD
+>Y</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+>
+              </P
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r5319.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x5634.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>V4L2_PIX_FMT_YUV411P ('411P')</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="x3891.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Compressed Formats</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r7624.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r7624.htm
new file mode 100644
index 0000000..e9dfb88
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r7624.htm
@@ -0,0 +1,396 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Function Reference</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="PREVIOUS"
+TITLE="RDS Interface"
+HREF="x7607.htm"><LINK
+REL="NEXT"
+TITLE="V4L2 close()"
+HREF="r7626.htm"></HEAD
+><BODY
+CLASS="REFERENCE"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x7607.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r7626.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="REFERENCE"
+><A
+NAME="USER-FUNC"
+></A
+><DIV
+CLASS="TITLEPAGE"
+><H1
+CLASS="TITLE"
+>I. Function Reference</H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+><A
+HREF="r7626.htm"
+>V4L2 close()</A
+>&nbsp;--&nbsp;Close a V4L2 device</DT
+><DT
+><A
+HREF="r7667.htm"
+>V4L2 ioctl()</A
+>&nbsp;--&nbsp;Program a V4L2 device</DT
+><DT
+><A
+HREF="r7771.htm"
+>ioctl VIDIOC_CROPCAP</A
+>&nbsp;--&nbsp;Information about the video cropping and scaling abilities</DT
+><DT
+><A
+HREF="r7900.htm"
+>ioctl VIDIOC_DBG_G_REGISTER, VIDIOC_DBG_S_REGISTER</A
+>&nbsp;--&nbsp;Read or write hardware registers</DT
+><DT
+><A
+HREF="r8087.htm"
+>ioctl VIDIOC_ENCODER_CMD, VIDIOC_TRY_ENCODER_CMD</A
+>&nbsp;--&nbsp;Execute an encoder command</DT
+><DT
+><A
+HREF="r8242.htm"
+>ioctl VIDIOC_ENUMAUDIO</A
+>&nbsp;--&nbsp;Enumerate audio inputs</DT
+><DT
+><A
+HREF="r8304.htm"
+>ioctl VIDIOC_ENUMAUDOUT</A
+>&nbsp;--&nbsp;Enumerate audio outputs</DT
+><DT
+><A
+HREF="r8367.htm"
+>ioctl VIDIOC_ENUM_FMT</A
+>&nbsp;--&nbsp;Enumerate image formats</DT
+><DT
+><A
+HREF="r8494.htm"
+>ioctl VIDIOC_ENUM_FRAMESIZES</A
+>&nbsp;--&nbsp;Enumerate frame sizes</DT
+><DT
+><A
+HREF="r8724.htm"
+>ioctl VIDIOC_ENUM_FRAMEINTERVALS</A
+>&nbsp;--&nbsp;Enumerate frame intervals</DT
+><DT
+><A
+HREF="r8936.htm"
+>ioctl VIDIOC_ENUMINPUT</A
+>&nbsp;--&nbsp;Enumerate video inputs</DT
+><DT
+><A
+HREF="r9149.htm"
+>ioctl VIDIOC_ENUMOUTPUT</A
+>&nbsp;--&nbsp;Enumerate video outputs</DT
+><DT
+><A
+HREF="r9288.htm"
+>ioctl VIDIOC_ENUMSTD</A
+>&nbsp;--&nbsp;Enumerate supported video standards</DT
+><DT
+><A
+HREF="r9539.htm"
+>ioctl VIDIOC_G_AUDIO, VIDIOC_S_AUDIO</A
+>&nbsp;--&nbsp;Query or select the current audio input and its
+attributes</DT
+><DT
+><A
+HREF="r9688.htm"
+>ioctl VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT</A
+>&nbsp;--&nbsp;Query or select the current audio output</DT
+><DT
+><A
+HREF="r9804.htm"
+>ioctl VIDIOC_G_CHIP_IDENT</A
+>&nbsp;--&nbsp;Identify the chips on a TV card</DT
+><DT
+><A
+HREF="r9994.htm"
+>ioctl VIDIOC_G_CROP, VIDIOC_S_CROP</A
+>&nbsp;--&nbsp;Get or set the current cropping rectangle</DT
+><DT
+><A
+HREF="r10104.htm"
+>ioctl VIDIOC_G_CTRL, VIDIOC_S_CTRL</A
+>&nbsp;--&nbsp;Get or set the value of a control</DT
+><DT
+><A
+HREF="r10211.htm"
+>ioctl VIDIOC_G_ENC_INDEX</A
+>&nbsp;--&nbsp;Get meta data about a compressed video stream</DT
+><DT
+><A
+HREF="r10386.htm"
+>ioctl VIDIOC_G_EXT_CTRLS, VIDIOC_S_EXT_CTRLS,
+VIDIOC_TRY_EXT_CTRLS</A
+>&nbsp;--&nbsp;Get or set the value of several controls, try control
+values</DT
+><DT
+><A
+HREF="r10595.htm"
+>ioctl VIDIOC_G_FBUF, VIDIOC_S_FBUF</A
+>&nbsp;--&nbsp;Get or set frame buffer overlay parameters</DT
+><DT
+><A
+HREF="r10944.htm"
+>ioctl VIDIOC_G_FMT, VIDIOC_S_FMT,
+VIDIOC_TRY_FMT</A
+>&nbsp;--&nbsp;Get or set the data format, try a format</DT
+><DT
+><A
+HREF="r11094.htm"
+>ioctl VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY</A
+>&nbsp;--&nbsp;Get or set tuner or modulator radio
+frequency</DT
+><DT
+><A
+HREF="r11217.htm"
+>ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT</A
+>&nbsp;--&nbsp;Query or select the current video input</DT
+><DT
+><A
+HREF="r11285.htm"
+>ioctl VIDIOC_G_JPEGCOMP, VIDIOC_S_JPEGCOMP</A
+>&nbsp;--&nbsp;</DT
+><DT
+><A
+HREF="r11430.htm"
+>ioctl VIDIOC_G_MODULATOR, VIDIOC_S_MODULATOR</A
+>&nbsp;--&nbsp;Get or set modulator attributes</DT
+><DT
+><A
+HREF="r11612.htm"
+>ioctl VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT</A
+>&nbsp;--&nbsp;Query or select the current video output</DT
+><DT
+><A
+HREF="r11680.htm"
+>ioctl VIDIOC_G_PARM, VIDIOC_S_PARM</A
+>&nbsp;--&nbsp;Get or set streaming parameters</DT
+><DT
+><A
+HREF="r11946.htm"
+>ioctl VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY</A
+>&nbsp;--&nbsp;Query or request the access priority associated with a
+file descriptor</DT
+><DT
+><A
+HREF="r12051.htm"
+>ioctl VIDIOC_G_SLICED_VBI_CAP</A
+>&nbsp;--&nbsp;Query sliced VBI capabilities</DT
+><DT
+><A
+HREF="r12265.htm"
+>ioctl VIDIOC_G_STD, VIDIOC_S_STD</A
+>&nbsp;--&nbsp;Query or select the video standard of the current input</DT
+><DT
+><A
+HREF="r12342.htm"
+>ioctl VIDIOC_G_TUNER, VIDIOC_S_TUNER</A
+>&nbsp;--&nbsp;Get or set tuner attributes</DT
+><DT
+><A
+HREF="r12784.htm"
+>ioctl VIDIOC_LOG_STATUS</A
+>&nbsp;--&nbsp;Log driver status information</DT
+><DT
+><A
+HREF="r12816.htm"
+>ioctl VIDIOC_OVERLAY</A
+>&nbsp;--&nbsp;Start or stop video overlay</DT
+><DT
+><A
+HREF="r12878.htm"
+>ioctl VIDIOC_QBUF, VIDIOC_DQBUF</A
+>&nbsp;--&nbsp;Exchange a buffer with the driver</DT
+><DT
+><A
+HREF="r13022.htm"
+>ioctl VIDIOC_QUERYBUF</A
+>&nbsp;--&nbsp;Query the status of a buffer</DT
+><DT
+><A
+HREF="r13105.htm"
+>ioctl VIDIOC_QUERYCAP</A
+>&nbsp;--&nbsp;Query device capabilities</DT
+><DT
+><A
+HREF="r13317.htm"
+>ioctl VIDIOC_QUERYCTRL, VIDIOC_QUERYMENU</A
+>&nbsp;--&nbsp;Enumerate controls and menu control items</DT
+><DT
+><A
+HREF="r13641.htm"
+>ioctl VIDIOC_QUERYSTD</A
+>&nbsp;--&nbsp;Sense the video standard received by the current
+input</DT
+><DT
+><A
+HREF="r13696.htm"
+>ioctl VIDIOC_REQBUFS</A
+>&nbsp;--&nbsp;Initiate Memory Mapping or User Pointer I/O</DT
+><DT
+><A
+HREF="r13817.htm"
+>ioctl VIDIOC_STREAMON, VIDIOC_STREAMOFF</A
+>&nbsp;--&nbsp;Start or stop streaming I/O</DT
+><DT
+><A
+HREF="r13889.htm"
+>V4L2 mmap()</A
+>&nbsp;--&nbsp;Map device memory into application address space</DT
+><DT
+><A
+HREF="r14037.htm"
+>V4L2 munmap()</A
+>&nbsp;--&nbsp;Unmap device memory</DT
+><DT
+><A
+HREF="r14090.htm"
+>V4L2 open()</A
+>&nbsp;--&nbsp;Open a V4L2 device</DT
+><DT
+><A
+HREF="r14169.htm"
+>V4L2 poll()</A
+>&nbsp;--&nbsp;Wait for some event on a file descriptor</DT
+><DT
+><A
+HREF="r14264.htm"
+>V4L2 read()</A
+>&nbsp;--&nbsp;Read from a V4L2 device</DT
+><DT
+><A
+HREF="r14390.htm"
+>V4L2 select()</A
+>&nbsp;--&nbsp;Synchronous I/O multiplexing</DT
+><DT
+><A
+HREF="r14496.htm"
+>V4L2 write()</A
+>&nbsp;--&nbsp;Write to a V4L2 device</DT
+></DL
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x7607.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r7626.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>RDS Interface</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>V4L2 close()</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r7626.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r7626.htm
new file mode 100644
index 0000000..a9e8696
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r7626.htm
@@ -0,0 +1,261 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>V4L2 close()</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="NEXT"
+TITLE="V4L2 ioctl()"
+HREF="r7667.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r7624.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r7667.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="FUNC-CLOSE"
+></A
+>V4L2 close()</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7630"
+></A
+><H2
+>Name</H2
+>v4l2-close&nbsp;--&nbsp;Close a V4L2 device</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7633"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN7634"
+></A
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include &lt;unistd.h&gt;</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int close</CODE
+>(int fd);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7641"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7651"
+></A
+><H2
+>Description</H2
+><P
+>Closes the device. Any I/O in progress is terminated and
+resources associated with the file descriptor are freed. However data
+format parameters, current input or output, control values or other
+properties remain unchanged.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7654"
+></A
+><H2
+>Return Value</H2
+><P
+>The function returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> on
+success, <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> on failure and the
+<CODE
+CLASS="VARNAME"
+>errno</CODE
+> is set appropriately. Possible error
+codes:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EBADF</SPAN
+></DT
+><DD
+><P
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+> is not a valid open file
+descriptor.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r7667.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Function Reference</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>V4L2 ioctl()</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r7667.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r7667.htm
new file mode 100644
index 0000000..ceafe4f
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r7667.htm
@@ -0,0 +1,415 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>V4L2 ioctl()</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="V4L2 close()"
+HREF="r7626.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_CROPCAP"
+HREF="r7771.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r7626.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r7771.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="FUNC-IOCTL"
+></A
+>V4L2 ioctl()</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7671"
+></A
+><H2
+>Name</H2
+>v4l2-ioctl&nbsp;--&nbsp;Program a V4L2 device</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7674"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN7675"
+></A
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include &lt;sys/ioctl.h&gt;</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, void *argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7686"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>V4L2 ioctl request code as defined in the <A
+HREF="a16506.htm"
+>videodev.h</A
+> header file, for example
+VIDIOC_QUERYCAP.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+>Pointer to a function parameter, usually a structure.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7707"
+></A
+><H2
+>Description</H2
+><P
+>The <CODE
+CLASS="FUNCTION"
+>ioctl()</CODE
+> function is used to program
+V4L2 devices. The argument <CODE
+CLASS="PARAMETER"
+>fd</CODE
+> must be an open
+file descriptor. An ioctl <CODE
+CLASS="PARAMETER"
+>request</CODE
+> has encoded
+in it whether the argument is an input, output or read/write
+parameter, and the size of the argument <CODE
+CLASS="PARAMETER"
+>argp</CODE
+> in
+bytes. Macros and defines specifying V4L2 ioctl requests are located
+in the <A
+HREF="a16506.htm"
+>videodev.h</A
+> header file.
+Applications should use their own copy, not include the version in the
+kernel sources on the system they compile on. All V4L2 ioctl requests,
+their respective function and parameters are specified in <A
+HREF="r7624.htm"
+>Reference I, <I
+>Function Reference</I
+></A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7716"
+></A
+><H2
+>Return Value</H2
+><P
+>On success the <CODE
+CLASS="FUNCTION"
+>ioctl()</CODE
+> function returns
+<SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> and does not reset the
+<CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable. On failure
+<SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> is returned, when the ioctl takes an
+output or read/write parameter it remains unmodified, and the
+<CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately. See below for
+possible error codes. Generic errors like <SPAN
+CLASS="ERRORCODE"
+>EBADF</SPAN
+>
+or <SPAN
+CLASS="ERRORCODE"
+>EFAULT</SPAN
+> are not listed in the sections
+discussing individual ioctl requests.</P
+><P
+>Note ioctls may return undefined error codes. Since errors
+may have side effects such as a driver reset applications should
+abort on unexpected errors.</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EBADF</SPAN
+></DT
+><DD
+><P
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+> is not a valid open file
+descriptor.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+></DT
+><DD
+><P
+>The property cannot be changed right now. Typically
+this error code is returned when I/O is in progress or the driver
+supports multiple opens and another process locked the property.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EFAULT</SPAN
+></DT
+><DD
+><P
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+> references an inaccessible
+memory area.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>ENOTTY</SPAN
+></DT
+><DD
+><P
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+> is  not  associated  with  a
+character special device.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The <CODE
+CLASS="PARAMETER"
+>request</CODE
+> or the data pointed
+to by <CODE
+CLASS="PARAMETER"
+>argp</CODE
+> is not valid. This is a very common
+error code, see the individual ioctl requests listed in <A
+HREF="r7624.htm"
+>Reference I, <I
+>Function Reference</I
+></A
+> for actual causes.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>ENOMEM</SPAN
+></DT
+><DD
+><P
+>Not enough physical or virtual memory was available to
+complete the request.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>ERANGE</SPAN
+></DT
+><DD
+><P
+>The application attempted to set a control with the
+<A
+HREF="r10104.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_CTRL</CODE
+></A
+> ioctl to a value which is out of bounds.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r7626.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r7771.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>V4L2 close()</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_CROPCAP</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r7771.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r7771.htm
new file mode 100644
index 0000000..f8c7c1c
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r7771.htm
@@ -0,0 +1,503 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_CROPCAP</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="V4L2 ioctl()"
+HREF="r7667.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_DBG_G_REGISTER, VIDIOC_DBG_S_REGISTER"
+HREF="r7900.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r7667.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r7900.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-CROPCAP"
+></A
+>ioctl VIDIOC_CROPCAP</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7775"
+></A
+><H2
+>Name</H2
+>VIDIOC_CROPCAP&nbsp;--&nbsp;Information about the video cropping and scaling abilities</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7778"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN7779"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_cropcap
+*argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7789"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_CROPCAP</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7809"
+></A
+><H2
+>Description</H2
+><P
+>Applications use this function to query the cropping
+limits, the pixel aspect of images and to calculate scale factors.
+They set the <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field of a v4l2_cropcap
+structure to the respective buffer (stream) type and call the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_CROPCAP</CODE
+> ioctl with a pointer to this
+structure. Drivers fill the rest of the structure. The results are
+constant except when switching the video standard. Remember this
+switch can occur implicit when switching the video input or
+output.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-CROPCAP"
+></A
+><P
+><B
+>Table 1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_cropcap</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>enum&nbsp;<A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+></TD
+><TD
+>Type of the data stream, set by the application.
+Only these types are valid here:
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_CAPTURE</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_OUTPUT</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_OVERLAY</CODE
+>, and custom (driver
+defined) types with code <CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_PRIVATE</CODE
+>
+and higher.</TD
+></TR
+><TR
+><TD
+>struct <A
+HREF="r7771.htm#V4L2-RECT-CROP"
+>v4l2_rect</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>bounds</CODE
+></TD
+><TD
+>Defines the window within capturing or output is
+possible, this may exclude for example the horizontal and vertical
+blanking areas. The cropping rectangle cannot exceed these limits.
+Width and height are defined in pixels, the driver writer is free to
+choose origin and units of the coordinate system in the analog
+domain.</TD
+></TR
+><TR
+><TD
+>struct <A
+HREF="r7771.htm#V4L2-RECT-CROP"
+>v4l2_rect</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>defrect</CODE
+></TD
+><TD
+>Default cropping rectangle, it shall cover the
+"whole picture". Assuming pixel aspect 1/1 this could be for example a
+640&nbsp;&times;&nbsp;480 rectangle for NTSC, a
+768&nbsp;&times;&nbsp;576 rectangle for PAL and SECAM centered over
+the active picture area. The same co-ordinate system as for
+            <CODE
+CLASS="STRUCTFIELD"
+>bounds</CODE
+> is used.</TD
+></TR
+><TR
+><TD
+>struct&nbsp;<A
+HREF="r9288.htm#V4L2-FRACT"
+>v4l2_fract</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>pixelaspect</CODE
+></TD
+><TD
+><P
+>This is the pixel aspect (y / x) when no
+scaling is applied, the ratio of the actual sampling
+frequency and the frequency required to get square
+pixels.</P
+><P
+>When cropping coordinates refer to square pixels,
+the driver sets <CODE
+CLASS="STRUCTFIELD"
+>pixelaspect</CODE
+> to 1/1. Other
+common values are 54/59 for PAL and SECAM, 11/10 for NTSC sampled
+according to [<A
+HREF="b17127.htm#ITU601"
+><ABBR
+CLASS="ABBREV"
+>ITU&nbsp;BT.601</ABBR
+></A
+>].</P
+></TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-RECT-CROP"
+></A
+><P
+><B
+>Table 2. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_rect</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__s32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>left</CODE
+></TD
+><TD
+>Horizontal offset of the top, left corner of the
+rectangle, in pixels.</TD
+></TR
+><TR
+><TD
+>__s32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>top</CODE
+></TD
+><TD
+>Vertical offset of the top, left corner of the
+rectangle, in pixels.</TD
+></TR
+><TR
+><TD
+>__s32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>width</CODE
+></TD
+><TD
+>Width of the rectangle, in pixels.</TD
+></TR
+><TR
+><TD
+>__s32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>height</CODE
+></TD
+><TD
+>Height of the rectangle, in pixels. Width
+and height cannot be negative, the fields are signed for
+hysterical reasons. </TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7885"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The struct&nbsp;<A
+HREF="r7771.htm#V4L2-CROPCAP"
+>v4l2_cropcap</A
+> <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> is
+invalid or the ioctl is not supported. This is not permitted for
+video capture, output and overlay devices, which must support
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_CROPCAP</CODE
+>.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r7667.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r7900.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>V4L2 ioctl()</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_DBG_G_REGISTER, VIDIOC_DBG_S_REGISTER</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r7900.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r7900.htm
new file mode 100644
index 0000000..979c6eb
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r7900.htm
@@ -0,0 +1,677 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_DBG_G_REGISTER, VIDIOC_DBG_S_REGISTER</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_CROPCAP"
+HREF="r7771.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_ENCODER_CMD, VIDIOC_TRY_ENCODER_CMD"
+HREF="r8087.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r7771.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r8087.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-DBG-G-REGISTER"
+></A
+>ioctl VIDIOC_DBG_G_REGISTER, VIDIOC_DBG_S_REGISTER</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7904"
+></A
+><H2
+>Name</H2
+>VIDIOC_DBG_G_REGISTER, VIDIOC_DBG_S_REGISTER&nbsp;--&nbsp;Read or write hardware registers</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7908"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN7909"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_register *argp);</CODE
+></P
+><P
+></P
+></DIV
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN7919"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, const struct v4l2_register
+*argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7929"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_DBG_G_REGISTER, VIDIOC_DBG_S_REGISTER</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7949"
+></A
+><H2
+>Description</H2
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Experimental: </B
+>This is an <A
+HREF="x16453.htm"
+>experimental</A
+>
+interface and may change in the future.</P
+></BLOCKQUOTE
+></DIV
+><P
+>For driver debugging purposes these ioctls allow test
+applications to access hardware registers directly. Regular
+applications should not use them.</P
+><P
+>Since writing or even reading registers can jeopardize the
+system security, its stability and damage the hardware, both ioctls
+require superuser privileges. Additionally the Linux kernel must be
+compiled with the <CODE
+CLASS="CONSTANT"
+>CONFIG_VIDEO_ADV_DEBUG</CODE
+> option
+to enable these ioctls.</P
+><P
+>To write a register applications must initialize all fields
+of a struct&nbsp;<A
+HREF="r7900.htm#V4L2-REGISTER"
+>v4l2_register</A
+> and call
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_DBG_S_REGISTER</CODE
+> with a pointer to this
+structure. The <CODE
+CLASS="STRUCTFIELD"
+>match_type</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>match_chip</CODE
+> fields select a chip on the TV
+card, the <CODE
+CLASS="STRUCTFIELD"
+>reg</CODE
+> field specifies a register
+number and the <CODE
+CLASS="STRUCTFIELD"
+>val</CODE
+> field the value to be
+written into the register.</P
+><P
+>To read a register applications must initialize the
+<CODE
+CLASS="STRUCTFIELD"
+>match_type</CODE
+>,
+<CODE
+CLASS="STRUCTFIELD"
+>match_chip</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>reg</CODE
+> fields, and call
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_DBG_G_REGISTER</CODE
+> with a pointer to this
+structure. On success the driver stores the register value in the
+<CODE
+CLASS="STRUCTFIELD"
+>val</CODE
+> field. On failure the structure remains
+unchanged.</P
+><P
+>When <CODE
+CLASS="STRUCTFIELD"
+>match_type</CODE
+> is
+<CODE
+CLASS="CONSTANT"
+>V4L2_CHIP_MATCH_HOST</CODE
+>,
+<CODE
+CLASS="STRUCTFIELD"
+>match_chip</CODE
+> selects the nth non-I<SUP
+>2</SUP
+>C chip
+on the TV card. Drivers may also interpret
+<CODE
+CLASS="STRUCTFIELD"
+>match_chip</CODE
+> as a random ID, but we recommend
+against that. The number zero always selects the host chip, e.&nbsp;g. the
+chip connected to the PCI bus. You can find out which chips are
+present with the <A
+HREF="r9804.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_CHIP_IDENT</CODE
+></A
+> ioctl.</P
+><P
+>When <CODE
+CLASS="STRUCTFIELD"
+>match_type</CODE
+> is
+<CODE
+CLASS="CONSTANT"
+>V4L2_CHIP_MATCH_I2C_DRIVER</CODE
+>,
+<CODE
+CLASS="STRUCTFIELD"
+>match_chip</CODE
+> contains a driver ID as defined
+in the <TT
+CLASS="FILENAME"
+>linux/i2c-id.h</TT
+> header file. For instance
+<CODE
+CLASS="CONSTANT"
+>I2C_DRIVERID_SAA7127</CODE
+> will match any chip
+supported by the saa7127 driver, regardless of its I<SUP
+>2</SUP
+>C bus address.
+When multiple chips supported by the same driver are present, the
+effect of these ioctls is undefined. Again with the
+<A
+HREF="r9804.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_CHIP_IDENT</CODE
+></A
+> ioctl you can find out which I<SUP
+>2</SUP
+>C chips are
+present.</P
+><P
+>When <CODE
+CLASS="STRUCTFIELD"
+>match_type</CODE
+> is
+<CODE
+CLASS="CONSTANT"
+>V4L2_CHIP_MATCH_I2C_ADDR</CODE
+>,
+<CODE
+CLASS="STRUCTFIELD"
+>match_chip</CODE
+> selects a chip by its 7 bit I<SUP
+>2</SUP
+>C
+bus address.</P
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Success not guaranteed: </B
+>Due to a flaw in the Linux I<SUP
+>2</SUP
+>C bus driver these ioctls may
+return successfully without actually reading or writing a register. To
+catch the most likely failure we recommend a <A
+HREF="r9804.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_CHIP_IDENT</CODE
+></A
+>
+call confirming the presence of the selected I<SUP
+>2</SUP
+>C chip.</P
+></BLOCKQUOTE
+></DIV
+><P
+>These ioctls are optional, not all drivers may support them.
+However when a driver supports these ioctls it must also support
+<A
+HREF="r9804.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_CHIP_IDENT</CODE
+></A
+>. Conversely it may support
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_CHIP_IDENT</CODE
+> but not these ioctls.</P
+><P
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_DBG_G_REGISTER</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_DBG_S_REGISTER</CODE
+> were introduced in Linux
+2.6.21.</P
+><P
+>We recommended the <SPAN
+CLASS="APPLICATION"
+>v4l2-dbg</SPAN
+>
+utility over calling these ioctls directly. It is available from the
+LinuxTV v4l-dvb repository; see <A
+HREF="http://linuxtv.org/repo/"
+TARGET="_top"
+>http://linuxtv.org/repo/</A
+> for
+access instructions.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-REGISTER"
+></A
+><P
+><B
+>Table 1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_register</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="33%"
+TITLE="C1"><COL
+WIDTH="33%"
+TITLE="C2"><COL
+WIDTH="33%"
+TITLE="C4"><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>match_type</CODE
+></TD
+><TD
+>See <A
+HREF="r7900.htm#CHIP-MATCH-TYPES"
+>Table 2</A
+> for a list of
+ possible types.</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>match_chip</CODE
+></TD
+><TD
+>Match a chip by this number, interpreted according
+to the <CODE
+CLASS="STRUCTFIELD"
+>match_type</CODE
+> field.</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>__u64</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reg</CODE
+></TD
+><TD
+>A register number.</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>__u64</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>val</CODE
+></TD
+><TD
+>The value read from, or to be written into the
+register.</TD
+><TD
+>&nbsp;</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="CHIP-MATCH-TYPES"
+></A
+><P
+><B
+>Table 2. Chip Match Types</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CHIP_MATCH_HOST</CODE
+></TD
+><TD
+>0</TD
+><TD
+>Match the nth chip on the card, zero for the
+            host chip. Does not match I<SUP
+>2</SUP
+>C chips.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CHIP_MATCH_I2C_DRIVER</CODE
+></TD
+><TD
+>1</TD
+><TD
+>Match an I<SUP
+>2</SUP
+>C chip by its driver ID from the
+<TT
+CLASS="FILENAME"
+>linux/i2c-id.h</TT
+> header file.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CHIP_MATCH_I2C_ADDR</CODE
+></TD
+><TD
+>2</TD
+><TD
+>Match a chip by its 7 bit I<SUP
+>2</SUP
+>C bus address.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8068"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The driver does not support this ioctl, or the kernel
+was not compiled with the <CODE
+CLASS="CONSTANT"
+>CONFIG_VIDEO_ADV_DEBUG</CODE
+>
+option, or the <CODE
+CLASS="STRUCTFIELD"
+>match_type</CODE
+> is invalid, or the
+selected chip or register does not exist.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EPERM</SPAN
+></DT
+><DD
+><P
+>Insufficient permissions. Root privileges are required
+to execute these ioctls.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r7771.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r8087.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_CROPCAP</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_ENCODER_CMD, VIDIOC_TRY_ENCODER_CMD</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r8087.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r8087.htm
new file mode 100644
index 0000000..d53c32e
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r8087.htm
@@ -0,0 +1,569 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_ENCODER_CMD, VIDIOC_TRY_ENCODER_CMD</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_DBG_G_REGISTER, VIDIOC_DBG_S_REGISTER"
+HREF="r7900.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_ENUMAUDIO"
+HREF="r8242.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r7900.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r8242.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-ENCODER-CMD"
+></A
+>ioctl VIDIOC_ENCODER_CMD, VIDIOC_TRY_ENCODER_CMD</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN8091"
+></A
+><H2
+>Name</H2
+>VIDIOC_ENCODER_CMD, VIDIOC_TRY_ENCODER_CMD&nbsp;--&nbsp;Execute an encoder command</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN8095"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN8096"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_encoder_cmd *argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8106"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_ENCODER_CMD, VIDIOC_TRY_ENCODER_CMD</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8126"
+></A
+><H2
+>Description</H2
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Experimental: </B
+>This is an <A
+HREF="x16453.htm"
+>experimental</A
+>
+interface and may change in the future.</P
+></BLOCKQUOTE
+></DIV
+><P
+>These ioctls control an audio/video (usually MPEG-) encoder.
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_ENCODER_CMD</CODE
+> sends a command to the
+encoder, <CODE
+CLASS="CONSTANT"
+>VIDIOC_TRY_ENCODER_CMD</CODE
+> can be used to
+try a command without actually executing it.</P
+><P
+>To send a command applications must initialize all fields of a
+    struct&nbsp;<A
+HREF="r8087.htm#V4L2-ENCODER-CMD"
+>v4l2_encoder_cmd</A
+> and call
+    <CODE
+CLASS="CONSTANT"
+>VIDIOC_ENCODER_CMD</CODE
+> or
+    <CODE
+CLASS="CONSTANT"
+>VIDIOC_TRY_ENCODER_CMD</CODE
+> with a pointer to this
+    structure.</P
+><P
+>The <CODE
+CLASS="STRUCTFIELD"
+>cmd</CODE
+> field must contain the
+command code. The <CODE
+CLASS="STRUCTFIELD"
+>flags</CODE
+> field is currently
+only used by the STOP command and contains one bit: If the
+<CODE
+CLASS="CONSTANT"
+>V4L2_ENC_CMD_STOP_AT_GOP_END</CODE
+> flag is set,
+encoding will continue until the end of the current <I
+CLASS="WORDASWORD"
+>Group
+Of Pictures</I
+>, otherwise it will stop immediately.</P
+><P
+>A <CODE
+CLASS="FUNCTION"
+>read</CODE
+>() call sends a START command to
+the encoder if it has not been started yet. After a STOP command,
+<CODE
+CLASS="FUNCTION"
+>read</CODE
+>() calls will read the remaining data
+buffered by the driver. When the buffer is empty,
+<CODE
+CLASS="FUNCTION"
+>read</CODE
+>() will return zero and the next
+<CODE
+CLASS="FUNCTION"
+>read</CODE
+>() call will restart the encoder.</P
+><P
+>A <CODE
+CLASS="FUNCTION"
+>close</CODE
+>() call sends an immediate STOP
+to the encoder, and all buffered data is discarded.</P
+><P
+>These ioctls are optional, not all drivers may support
+them. They were introduced in Linux 2.6.21.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-ENCODER-CMD"
+></A
+><P
+><B
+>Table 1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_encoder_cmd</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>cmd</CODE
+></TD
+><TD
+>The encoder command, see <A
+HREF="r8087.htm#ENCODER-CMDS"
+>Table 2</A
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>flags</CODE
+></TD
+><TD
+>Flags to go with the command, see <A
+HREF="r8087.htm#ENCODER-FLAGS"
+>Table 3</A
+>. If no flags are defined for
+this command, drivers and applications must set this field to
+zero.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>data</CODE
+>[8]</TD
+><TD
+>Reserved for future extensions. Drivers and
+applications must set the array to zero.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="ENCODER-CMDS"
+></A
+><P
+><B
+>Table 2. Encoder Commands</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_ENC_CMD_START</CODE
+></TD
+><TD
+>0</TD
+><TD
+>Start the encoder. When the encoder is already
+running or paused, this command does nothing. No flags are defined for
+this command.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_ENC_CMD_STOP</CODE
+></TD
+><TD
+>1</TD
+><TD
+>Stop the encoder. When the
+<CODE
+CLASS="CONSTANT"
+>V4L2_ENC_CMD_STOP_AT_GOP_END</CODE
+> flag is set,
+encoding will continue until the end of the current <I
+CLASS="WORDASWORD"
+>Group
+Of Pictures</I
+>, otherwise encoding will stop immediately.
+When the encoder is already stopped, this command does
+nothing.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_ENC_CMD_PAUSE</CODE
+></TD
+><TD
+>2</TD
+><TD
+>Pause the encoder. When the encoder has not been
+started yet, the driver will return an <SPAN
+CLASS="ERRORCODE"
+>EPERM</SPAN
+> error code. When the encoder is
+already paused, this command does nothing. No flags are defined for
+this command.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_ENC_CMD_RESUME</CODE
+></TD
+><TD
+>3</TD
+><TD
+>Resume encoding after a PAUSE command. When the
+encoder has not been started yet, the driver will return an <SPAN
+CLASS="ERRORCODE"
+>EPERM</SPAN
+> error code.
+When the encoder is already running, this command does nothing. No
+flags are defined for this command.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="ENCODER-FLAGS"
+></A
+><P
+><B
+>Table 3. Encoder Command Flags</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_ENC_CMD_STOP_AT_GOP_END</CODE
+></TD
+><TD
+>0x0001</TD
+><TD
+>Stop encoding at the end of the current <I
+CLASS="WORDASWORD"
+>Group Of
+Pictures</I
+>, rather than immediately.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8224"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The driver does not support this ioctl, or the
+<CODE
+CLASS="STRUCTFIELD"
+>cmd</CODE
+> field is invalid.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EPERM</SPAN
+></DT
+><DD
+><P
+>The application sent a PAUSE or RESUME command when
+the encoder was not running.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r7900.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r8242.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_DBG_G_REGISTER, VIDIOC_DBG_S_REGISTER</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_ENUMAUDIO</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r8242.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r8242.htm
new file mode 100644
index 0000000..ba8cdfd
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r8242.htm
@@ -0,0 +1,302 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_ENUMAUDIO</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_ENCODER_CMD, VIDIOC_TRY_ENCODER_CMD"
+HREF="r8087.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_ENUMAUDOUT"
+HREF="r8304.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r8087.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r8304.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-ENUMAUDIO"
+></A
+>ioctl VIDIOC_ENUMAUDIO</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN8246"
+></A
+><H2
+>Name</H2
+>VIDIOC_ENUMAUDIO&nbsp;--&nbsp;Enumerate audio inputs</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN8249"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN8250"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_audio *argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8260"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_ENUMAUDIO</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8280"
+></A
+><H2
+>Description</H2
+><P
+>To query the attributes of an audio input applications
+initialize the <CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+> field and zero out the
+<CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+> array of a struct&nbsp;<A
+HREF="r9539.htm#V4L2-AUDIO"
+>v4l2_audio</A
+>
+and call the <CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMAUDIO</CODE
+> ioctl with a pointer
+to this structure. Drivers fill the rest of the structure or return an
+<SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code when the index is out of bounds. To enumerate all audio
+inputs applications shall begin at index zero, incrementing by one
+until the driver returns <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+>.</P
+><P
+>See <A
+HREF="r9539.htm"
+>ioctl VIDIOC_G_AUDIO, VIDIOC_S_AUDIO(2)</A
+> for a description of
+struct&nbsp;<A
+HREF="r9539.htm#V4L2-AUDIO"
+>v4l2_audio</A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8292"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The number of the audio input is out of bounds, or
+there are no audio inputs at all and this ioctl is not
+supported.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r8087.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r8304.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_ENCODER_CMD, VIDIOC_TRY_ENCODER_CMD</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_ENUMAUDOUT</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r8304.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r8304.htm
new file mode 100644
index 0000000..a2d5677
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r8304.htm
@@ -0,0 +1,305 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_ENUMAUDOUT</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_ENUMAUDIO"
+HREF="r8242.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_ENUM_FMT"
+HREF="r8367.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r8242.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r8367.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-ENUMAUDIOOUT"
+></A
+>ioctl VIDIOC_ENUMAUDOUT</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN8308"
+></A
+><H2
+>Name</H2
+>VIDIOC_ENUMAUDOUT&nbsp;--&nbsp;Enumerate audio outputs</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN8311"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN8312"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_audioout *argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8322"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_ENUMAUDOUT</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8342"
+></A
+><H2
+>Description</H2
+><P
+>To query the attributes of an audio output applications
+initialize the <CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+> field and zero out the
+<CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+> array of a struct&nbsp;<A
+HREF="r9688.htm#V4L2-AUDIOOUT"
+>v4l2_audioout</A
+> and
+call the <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_AUDOUT</CODE
+> ioctl with a pointer
+to this structure. Drivers fill the rest of the structure or return an
+<SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code when the index is out of bounds. To enumerate all audio
+outputs applications shall begin at index zero, incrementing by one
+until the driver returns <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+>.</P
+><P
+>Note connectors on a TV card to loop back the received audio
+signal to a sound card are not audio outputs in this sense.</P
+><P
+>See <A
+HREF="r9688.htm"
+>ioctl VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT(2)</A
+> for a description of
+struct&nbsp;<A
+HREF="r9688.htm#V4L2-AUDIOOUT"
+>v4l2_audioout</A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8355"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The number of the audio output is out of bounds, or
+there are no audio outputs at all and this ioctl is not
+supported.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r8242.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r8367.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_ENUMAUDIO</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_ENUM_FMT</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r8367.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r8367.htm
new file mode 100644
index 0000000..891dbe2
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r8367.htm
@@ -0,0 +1,483 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_ENUM_FMT</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_ENUMAUDOUT"
+HREF="r8304.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_ENUM_FRAMESIZES"
+HREF="r8494.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r8304.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r8494.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-ENUM-FMT"
+></A
+>ioctl VIDIOC_ENUM_FMT</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN8371"
+></A
+><H2
+>Name</H2
+>VIDIOC_ENUM_FMT&nbsp;--&nbsp;Enumerate image formats</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN8374"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN8375"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_fmtdesc
+*argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8385"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_ENUM_FMT</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8405"
+></A
+><H2
+>Description</H2
+><P
+>To enumerate image formats applications initialize the
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> and <CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+>
+field of struct&nbsp;<A
+HREF="r8367.htm#V4L2-FMTDESC"
+>v4l2_fmtdesc</A
+> and call the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUM_FMT</CODE
+> ioctl with a pointer to this
+structure. Drivers fill the rest of the structure or return an
+<SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code. All formats are enumerable by beginning at index zero and
+incrementing by one until <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> is
+returned.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-FMTDESC"
+></A
+><P
+><B
+>Table 1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_fmtdesc</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+></TD
+><TD
+>Number of the format in the enumeration, set by
+the application. This is in no way related to the <CODE
+CLASS="STRUCTFIELD"
+>pixelformat</CODE
+> field.</TD
+></TR
+><TR
+><TD
+>enum&nbsp;<A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+></TD
+><TD
+>Type of the data stream, set by the application.
+Only these types are valid here:
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_CAPTURE</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_OUTPUT</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_OVERLAY</CODE
+>, and custom (driver
+defined) types with code <CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_PRIVATE</CODE
+>
+and higher.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>flags</CODE
+></TD
+><TD
+>See <A
+HREF="r8367.htm#FMTDESC-FLAGS"
+>Table 2</A
+></TD
+></TR
+><TR
+><TD
+>__u8</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>description</CODE
+>[32]</TD
+><TD
+>Description of the format, a NUL-terminated ASCII
+string. This information is intended for the user, for example: "YUV
+4:2:2".</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>pixelformat</CODE
+></TD
+><TD
+>The image format identifier. This is a
+four character code as computed by the v4l2_fourcc()
+macro:</TD
+></TR
+><TR
+><TD
+COLSPAN="3"
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+>#define v4l2_fourcc(a,b,c,d) (((__u32)(a)&lt;&lt;0)|((__u32)(b)&lt;&lt;8)|((__u32)(c)&lt;&lt;16)|((__u32)(d)&lt;&lt;24))</PRE
+></P
+><P
+>Several image formats are already
+defined by this specification in <A
+HREF="c2030.htm"
+>Chapter 2</A
+>. Note these
+codes are not the same as those used in the Windows world.</P
+></TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+>[4]</TD
+><TD
+>Reserved for future extensions. Drivers must set
+the array to zero.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="FMTDESC-FLAGS"
+></A
+><P
+><B
+>Table 2. Image Format Description Flags</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FMT_FLAG_COMPRESSED</CODE
+></TD
+><TD
+>0x0001</TD
+><TD
+>This is a compressed format.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8479"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The struct&nbsp;<A
+HREF="r8367.htm#V4L2-FMTDESC"
+>v4l2_fmtdesc</A
+> <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+>
+is not supported or the <CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+> is out of
+bounds.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r8304.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r8494.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_ENUMAUDOUT</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_ENUM_FRAMESIZES</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r8494.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r8494.htm
new file mode 100644
index 0000000..ce4ca0f
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r8494.htm
@@ -0,0 +1,781 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_ENUM_FRAMESIZES</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_ENUM_FMT"
+HREF="r8367.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_ENUM_FRAMEINTERVALS"
+HREF="r8724.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r8367.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r8724.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-ENUM-FRAMESIZES"
+></A
+>ioctl VIDIOC_ENUM_FRAMESIZES</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN8498"
+></A
+><H2
+>Name</H2
+>VIDIOC_ENUM_FRAMESIZES&nbsp;--&nbsp;Enumerate frame sizes</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN8501"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN8502"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_frmsizeenum *argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8512"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_ENUM_FRAMESIZES</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+>Pointer to a struct&nbsp;<A
+HREF="r8494.htm#V4L2-FRMSIZEENUM"
+>v4l2_frmsizeenum</A
+> that contains an index
+and pixel format and receives a frame width and height.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8533"
+></A
+><H2
+>Description</H2
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Experimental: </B
+>This is an <A
+HREF="x16453.htm"
+>experimental</A
+>
+interface and may change in the future.</P
+></BLOCKQUOTE
+></DIV
+><P
+>This ioctl allows applications to enumerate all frame sizes
+(i.&nbsp;e. width and height in pixels) that the device supports for the
+given pixel format.</P
+><P
+>The supported pixel formats can be obtained by using the
+<A
+HREF="r8367.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUM_FMT</CODE
+></A
+> function.</P
+><P
+>The return value and the content of the
+<CODE
+CLASS="STRUCTFIELD"
+>v4l2_frmsizeenum.type</CODE
+> field depend on the
+type of frame sizes the device supports. Here are the semantics of the
+function for the different cases:</P
+><P
+></P
+><UL
+><LI
+><P
+><SPAN
+CLASS="bold"
+><B
+CLASS="EMPHASIS"
+>Discrete:</B
+></SPAN
+> The function
+returns success if the given index value (zero-based) is valid. The
+application should increase the index by one for each call until
+<CODE
+CLASS="CONSTANT"
+>EINVAL</CODE
+> is returned. The
+<CODE
+CLASS="STRUCTFIELD"
+>v4l2_frmsizeenum.type</CODE
+> field is set to
+<CODE
+CLASS="CONSTANT"
+>V4L2_FRMSIZE_TYPE_DISCRETE</CODE
+> by the driver. Of the
+union only the <CODE
+CLASS="STRUCTFIELD"
+>discrete</CODE
+> member is
+valid.</P
+></LI
+><LI
+><P
+><SPAN
+CLASS="bold"
+><B
+CLASS="EMPHASIS"
+>Step-wise:</B
+></SPAN
+> The function
+returns success if the given index value is zero and
+<CODE
+CLASS="CONSTANT"
+>EINVAL</CODE
+> for any other index value. The
+<CODE
+CLASS="STRUCTFIELD"
+>v4l2_frmsizeenum.type</CODE
+> field is set to
+<CODE
+CLASS="CONSTANT"
+>V4L2_FRMSIZE_TYPE_STEPWISE</CODE
+> by the driver. Of the
+union only the <CODE
+CLASS="STRUCTFIELD"
+>stepwise</CODE
+> member is
+valid.</P
+></LI
+><LI
+><P
+><SPAN
+CLASS="bold"
+><B
+CLASS="EMPHASIS"
+>Continuous:</B
+></SPAN
+> This is a
+special case of the step-wise type above. The function returns success
+if the given index value is zero and <CODE
+CLASS="CONSTANT"
+>EINVAL</CODE
+> for
+any other index value. The
+<CODE
+CLASS="STRUCTFIELD"
+>v4l2_frmsizeenum.type</CODE
+> field is set to
+<CODE
+CLASS="CONSTANT"
+>V4L2_FRMSIZE_TYPE_CONTINUOUS</CODE
+> by the driver. Of
+the union only the <CODE
+CLASS="STRUCTFIELD"
+>stepwise</CODE
+> member is valid
+and the <CODE
+CLASS="STRUCTFIELD"
+>step_width</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>step_height</CODE
+> values are set to 1.</P
+></LI
+></UL
+><P
+>When the application calls the function with index zero, it
+must check the <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field to determine the
+type of frame size enumeration the device supports. Only for the
+<CODE
+CLASS="CONSTANT"
+>V4L2_FRMSIZE_TYPE_DISCRETE</CODE
+> type does it make
+sense to increase the index value to receive more frame sizes.</P
+><P
+>Note that the order in which the frame sizes are returned
+has no special meaning. In particular does it not say anything about
+potential default format sizes.</P
+><P
+>Applications can assume that the enumeration data does not
+change without any interaction from the application itself. This means
+that the enumeration data is consistent if the application does not
+perform any other ioctl calls while it runs the frame size
+enumeration.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8574"
+></A
+><H2
+>Structs</H2
+><P
+>In the structs below, <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>IN</I
+></SPAN
+> denotes a
+value that has to be filled in by the application,
+<SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>OUT</I
+></SPAN
+> denotes values that the driver fills in. The
+application should zero out all members except for the
+<SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>IN</I
+></SPAN
+> fields.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-FRMSIZE-DISCRETE"
+></A
+><P
+><B
+>Table 1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_frmsize_discrete</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>width</CODE
+></TD
+><TD
+>Width of the frame [pixel].</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>height</CODE
+></TD
+><TD
+>Height of the frame [pixel].</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-FRMSIZE-STEPWISE"
+></A
+><P
+><B
+>Table 2. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_frmsize_stepwise</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>min_width</CODE
+></TD
+><TD
+>Minimum frame width [pixel].</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>max_width</CODE
+></TD
+><TD
+>Maximum frame width [pixel].</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>step_width</CODE
+></TD
+><TD
+>Frame width step size [pixel].</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>min_height</CODE
+></TD
+><TD
+>Minimum frame height [pixel].</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>max_height</CODE
+></TD
+><TD
+>Maximum frame height [pixel].</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>step_height</CODE
+></TD
+><TD
+>Frame height step size [pixel].</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-FRMSIZEENUM"
+></A
+><P
+><B
+>Table 3. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_frmsizeenum</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="25%"
+TITLE="C3"><COL
+WIDTH="25%"
+TITLE="C4"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>IN: Index of the given frame size in the enumeration.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>pixel_format</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>IN: Pixel format for which the frame sizes are enumerated.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>OUT: Frame size type the device supports.</TD
+></TR
+><TR
+><TD
+>union</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>OUT: Frame size with the given index.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>struct&nbsp;<A
+HREF="r8494.htm#V4L2-FRMSIZE-DISCRETE"
+>v4l2_frmsize_discrete</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>discrete</CODE
+></TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>struct&nbsp;<A
+HREF="r8494.htm#V4L2-FRMSIZE-STEPWISE"
+>v4l2_frmsize_stepwise</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>stepwise</CODE
+></TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reserved[2]</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>Reserved space for future use.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8690"
+></A
+><H2
+>Enums</H2
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-FRMSIZETYPES"
+></A
+><P
+><B
+>Table 4. enum <CODE
+CLASS="STRUCTNAME"
+>v4l2_frmsizetypes</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FRMSIZE_TYPE_DISCRETE</CODE
+></TD
+><TD
+>1</TD
+><TD
+>Discrete frame size.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FRMSIZE_TYPE_CONTINUOUS</CODE
+></TD
+><TD
+>2</TD
+><TD
+>Continuous frame size.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FRMSIZE_TYPE_STEPWISE</CODE
+></TD
+><TD
+>3</TD
+><TD
+>Step-wise defined frame size.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8716"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+>See the description section above for a list of return
+values that <CODE
+CLASS="VARNAME"
+>errno</CODE
+> can have.</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r8367.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r8724.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_ENUM_FMT</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_ENUM_FRAMEINTERVALS</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r8724.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r8724.htm
new file mode 100644
index 0000000..446383c
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r8724.htm
@@ -0,0 +1,744 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_ENUM_FRAMEINTERVALS</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_ENUM_FRAMESIZES"
+HREF="r8494.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_ENUMINPUT"
+HREF="r8936.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r8494.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r8936.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-ENUM-FRAMEINTERVALS"
+></A
+>ioctl VIDIOC_ENUM_FRAMEINTERVALS</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN8728"
+></A
+><H2
+>Name</H2
+>VIDIOC_ENUM_FRAMEINTERVALS&nbsp;--&nbsp;Enumerate frame intervals</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN8731"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN8732"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_frmivalenum *argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8742"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_ENUM_FRAMEINTERVALS</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+>Pointer to a struct&nbsp;<A
+HREF="r8724.htm#V4L2-FRMIVALENUM"
+>v4l2_frmivalenum</A
+> structure that
+contains a pixel format and size and receives a frame interval.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8763"
+></A
+><H2
+>Description</H2
+><P
+>This ioctl allows applications to enumerate all frame
+intervals that the device supports for the given pixel format and
+frame size.</P
+><P
+>The supported pixel formats and frame sizes can be obtained
+by using the <A
+HREF="r8367.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUM_FMT</CODE
+></A
+> and <A
+HREF="r8494.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUM_FRAMESIZES</CODE
+></A
+>
+functions.</P
+><P
+>The return value and the content of the
+<CODE
+CLASS="STRUCTFIELD"
+>v4l2_frmivalenum.type</CODE
+> field depend on the
+type of frame intervals the device supports. Here are the semantics of
+the function for the different cases:</P
+><P
+></P
+><UL
+><LI
+><P
+><SPAN
+CLASS="bold"
+><B
+CLASS="EMPHASIS"
+>Discrete:</B
+></SPAN
+> The function
+returns success if the given index value (zero-based) is valid. The
+application should increase the index by one for each call until
+<CODE
+CLASS="CONSTANT"
+>EINVAL</CODE
+> is returned. The `v4l2_frmivalenum.type`
+field is set to `V4L2_FRMIVAL_TYPE_DISCRETE` by the driver. Of the
+union only the `discrete` member is valid.</P
+></LI
+><LI
+><P
+><SPAN
+CLASS="bold"
+><B
+CLASS="EMPHASIS"
+>Step-wise:</B
+></SPAN
+> The function
+returns success if the given index value is zero and
+<CODE
+CLASS="CONSTANT"
+>EINVAL</CODE
+> for any other index value. The
+<CODE
+CLASS="STRUCTFIELD"
+>v4l2_frmivalenum.type</CODE
+> field is set to
+<CODE
+CLASS="CONSTANT"
+>V4L2_FRMIVAL_TYPE_STEPWISE</CODE
+> by the driver. Of the
+union only the <CODE
+CLASS="STRUCTFIELD"
+>stepwise</CODE
+> member is
+valid.</P
+></LI
+><LI
+><P
+><SPAN
+CLASS="bold"
+><B
+CLASS="EMPHASIS"
+>Continuous:</B
+></SPAN
+> This is a
+special case of the step-wise type above. The function returns success
+if the given index value is zero and <CODE
+CLASS="CONSTANT"
+>EINVAL</CODE
+> for
+any other index value. The
+<CODE
+CLASS="STRUCTFIELD"
+>v4l2_frmivalenum.type</CODE
+> field is set to
+<CODE
+CLASS="CONSTANT"
+>V4L2_FRMIVAL_TYPE_CONTINUOUS</CODE
+> by the driver. Of
+the union only the <CODE
+CLASS="STRUCTFIELD"
+>stepwise</CODE
+> member is valid
+and the <CODE
+CLASS="STRUCTFIELD"
+>step</CODE
+> value is set to 1.</P
+></LI
+></UL
+><P
+>When the application calls the function with index zero, it
+must check the <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field to determine the
+type of frame interval enumeration the device supports. Only for the
+<CODE
+CLASS="CONSTANT"
+>V4L2_FRMIVAL_TYPE_DISCRETE</CODE
+> type does it make
+sense to increase the index value to receive more frame
+intervals.</P
+><P
+>Note that the order in which the frame intervals are
+returned has no special meaning. In particular does it not say
+anything about potential default frame intervals.</P
+><P
+>Applications can assume that the enumeration data does not
+change without any interaction from the application itself. This means
+that the enumeration data is consistent if the application does not
+perform any other ioctl calls while it runs the frame interval
+enumeration.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8798"
+></A
+><H2
+>Notes</H2
+><P
+></P
+><UL
+><LI
+><P
+><SPAN
+CLASS="bold"
+><B
+CLASS="EMPHASIS"
+>Frame intervals and frame
+rates:</B
+></SPAN
+> The V4L2 API uses frame intervals instead of frame
+rates. Given the frame interval the frame rate can be computed as
+follows:<PRE
+CLASS="SCREEN"
+>frame_rate = 1 / frame_interval</PRE
+></P
+></LI
+></UL
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8805"
+></A
+><H2
+>Structs</H2
+><P
+>In the structs below, <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>IN</I
+></SPAN
+> denotes a
+value that has to be filled in by the application,
+<SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>OUT</I
+></SPAN
+> denotes values that the driver fills in. The
+application should zero out all members except for the
+<SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>IN</I
+></SPAN
+> fields.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-FRMIVAL-STEPWISE"
+></A
+><P
+><B
+>Table 1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_frmival_stepwise</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>struct&nbsp;<A
+HREF="r9288.htm#V4L2-FRACT"
+>v4l2_fract</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>min</CODE
+></TD
+><TD
+>Minimum frame interval [s].</TD
+></TR
+><TR
+><TD
+>struct&nbsp;<A
+HREF="r9288.htm#V4L2-FRACT"
+>v4l2_fract</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>max</CODE
+></TD
+><TD
+>Maximum frame interval [s].</TD
+></TR
+><TR
+><TD
+>struct&nbsp;<A
+HREF="r9288.htm#V4L2-FRACT"
+>v4l2_fract</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>step</CODE
+></TD
+><TD
+>Frame interval step size [s].</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-FRMIVALENUM"
+></A
+><P
+><B
+>Table 2. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_frmivalenum</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="25%"
+TITLE="C3"><COL
+WIDTH="25%"
+TITLE="C4"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>IN: Index of the given frame interval in the
+enumeration.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>pixel_format</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>IN: Pixel format for which the frame intervals are
+enumerated.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>width</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>IN: Frame width for which the frame intervals are
+enumerated.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>height</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>IN: Frame height for which the frame intervals are
+enumerated.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>OUT: Frame interval type the device supports.</TD
+></TR
+><TR
+><TD
+>union</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>OUT: Frame interval with the given index.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>struct&nbsp;<A
+HREF="r9288.htm#V4L2-FRACT"
+>v4l2_fract</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>discrete</CODE
+></TD
+><TD
+>Frame interval [s].</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>struct&nbsp;<A
+HREF="r8724.htm#V4L2-FRMIVAL-STEPWISE"
+>v4l2_frmival_stepwise</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>stepwise</CODE
+></TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reserved[2]</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>Reserved space for future use.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8902"
+></A
+><H2
+>Enums</H2
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-FRMIVALTYPES"
+></A
+><P
+><B
+>Table 3. enum <CODE
+CLASS="STRUCTNAME"
+>v4l2_frmivaltypes</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FRMIVAL_TYPE_DISCRETE</CODE
+></TD
+><TD
+>1</TD
+><TD
+>Discrete frame interval.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FRMIVAL_TYPE_CONTINUOUS</CODE
+></TD
+><TD
+>2</TD
+><TD
+>Continuous frame interval.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FRMIVAL_TYPE_STEPWISE</CODE
+></TD
+><TD
+>3</TD
+><TD
+>Step-wise defined frame interval.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8928"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+>See the description section above for a list of return
+values that <CODE
+CLASS="VARNAME"
+>errno</CODE
+> can have.</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r8494.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r8936.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_ENUM_FRAMESIZES</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_ENUMINPUT</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r8936.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r8936.htm
new file mode 100644
index 0000000..992336b
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r8936.htm
@@ -0,0 +1,704 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_ENUMINPUT</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_ENUM_FRAMEINTERVALS"
+HREF="r8724.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_ENUMOUTPUT"
+HREF="r9149.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r8724.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r9149.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-ENUMINPUT"
+></A
+>ioctl VIDIOC_ENUMINPUT</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN8940"
+></A
+><H2
+>Name</H2
+>VIDIOC_ENUMINPUT&nbsp;--&nbsp;Enumerate video inputs</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN8943"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN8944"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_input
+*argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8954"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_ENUMINPUT</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8974"
+></A
+><H2
+>Description</H2
+><P
+>To query the attributes of a video input applications
+initialize the <CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+> field of struct&nbsp;<A
+HREF="r8936.htm#V4L2-INPUT"
+>v4l2_input</A
+>
+and call the <CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMINPUT</CODE
+> ioctl with a
+pointer to this structure. Drivers fill the rest of the structure or
+return an <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code when the index is out of bounds. To enumerate all
+inputs applications shall begin at index zero, incrementing by one
+until the driver returns <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+>.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-INPUT"
+></A
+><P
+><B
+>Table 1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_input</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+></TD
+><TD
+>Identifies the input, set by the
+application.</TD
+></TR
+><TR
+><TD
+>__u8</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>name</CODE
+>[32]</TD
+><TD
+>Name of the video input, a NUL-terminated ASCII
+string, for example: "Vin (Composite 2)". This information is intended
+for the user, preferably the connector label on the device itself.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+></TD
+><TD
+>Type of the input, see <A
+HREF="r8936.htm#INPUT-TYPE"
+>Table 2</A
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>audioset</CODE
+></TD
+><TD
+><P
+>Drivers can enumerate up to 32 video and
+audio inputs. This field shows which audio inputs were selectable as
+audio source if this was the currently selected video input. It is a
+bit mask. The LSB corresponds to audio input 0, the MSB to input 31.
+Any number of bits can be set, or none.</P
+><P
+>When the driver
+does not enumerate audio inputs no bits must be set. Applications
+shall not interpret this as lack of audio support. Some drivers
+automatically select audio sources and do not enumerate them since
+there is no choice anyway.</P
+><P
+>For details on audio inputs and
+how to select the current input see <A
+HREF="x341.htm"
+>Section 1.5</A
+>.</P
+></TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>tuner</CODE
+></TD
+><TD
+>Capture devices can have zero or more tuners (RF
+demodulators). When the <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> is set to
+<CODE
+CLASS="CONSTANT"
+>V4L2_INPUT_TYPE_TUNER</CODE
+> this is an RF connector and
+this field identifies the tuner. It corresponds to
+struct&nbsp;<A
+HREF="r12342.htm#V4L2-TUNER"
+>v4l2_tuner</A
+> field <CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+>. For details on
+tuners see <A
+HREF="x394.htm"
+>Section 1.6</A
+>.</TD
+></TR
+><TR
+><TD
+><A
+HREF="r9288.htm#V4L2-STD-ID"
+>v4l2_std_id</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>std</CODE
+></TD
+><TD
+>Every video input supports one or more different
+video standards. This field is a set of all supported standards. For
+details on video standards and how to switch see <A
+HREF="x448.htm"
+>Section 1.7</A
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>status</CODE
+></TD
+><TD
+>This field provides status information about the
+input. See <A
+HREF="r8936.htm#INPUT-STATUS"
+>Table 3</A
+> for flags.
+<CODE
+CLASS="STRUCTFIELD"
+>status</CODE
+> is only valid when this is the
+current input.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+>[4]</TD
+><TD
+>Reserved for future extensions. Drivers must set
+the array to zero.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="INPUT-TYPE"
+></A
+><P
+><B
+>Table 2. Input Types</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_INPUT_TYPE_TUNER</CODE
+></TD
+><TD
+>1</TD
+><TD
+>This input uses a tuner (RF demodulator).</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_INPUT_TYPE_CAMERA</CODE
+></TD
+><TD
+>2</TD
+><TD
+>Analog baseband input, for example CVBS /
+Composite Video, S-Video, RGB.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="INPUT-STATUS"
+></A
+><P
+><B
+>Table 3. Input Status Flags</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="33%"
+TITLE="C1"><COL
+WIDTH="33%"
+ALIGN="CENTER"
+TITLE="C2"><COL
+WIDTH="33%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+COLSPAN="3"
+ALIGN="LEFT"
+>General</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_IN_ST_NO_POWER</CODE
+></TD
+><TD
+>0x00000001</TD
+><TD
+>Attached device is off.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_IN_ST_NO_SIGNAL</CODE
+></TD
+><TD
+>0x00000002</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_IN_ST_NO_COLOR</CODE
+></TD
+><TD
+>0x00000004</TD
+><TD
+>The hardware supports color decoding, but does not
+detect color modulation in the signal.</TD
+></TR
+><TR
+><TD
+COLSPAN="3"
+ALIGN="LEFT"
+>Analog Video</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_IN_ST_NO_H_LOCK</CODE
+></TD
+><TD
+>0x00000100</TD
+><TD
+>No horizontal sync lock.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_IN_ST_COLOR_KILL</CODE
+></TD
+><TD
+>0x00000200</TD
+><TD
+>A color killer circuit automatically disables color
+decoding when it detects no color modulation. When this flag is set
+the color killer is enabled <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>and</I
+></SPAN
+> has shut off
+color decoding.</TD
+></TR
+><TR
+><TD
+COLSPAN="3"
+ALIGN="LEFT"
+>Digital Video</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_IN_ST_NO_SYNC</CODE
+></TD
+><TD
+>0x00010000</TD
+><TD
+>No synchronization lock.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_IN_ST_NO_EQU</CODE
+></TD
+><TD
+>0x00020000</TD
+><TD
+>No equalizer lock.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_IN_ST_NO_CARRIER</CODE
+></TD
+><TD
+>0x00040000</TD
+><TD
+>Carrier recovery failed.</TD
+></TR
+><TR
+><TD
+COLSPAN="3"
+ALIGN="LEFT"
+>VCR and Set-Top Box</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_IN_ST_MACROVISION</CODE
+></TD
+><TD
+>0x01000000</TD
+><TD
+>Macrovision is an analog copy prevention system
+mangling the video signal to confuse video recorders. When this
+flag is set Macrovision has been detected.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_IN_ST_NO_ACCESS</CODE
+></TD
+><TD
+>0x02000000</TD
+><TD
+>Conditional access denied.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_IN_ST_VTR</CODE
+></TD
+><TD
+>0x04000000</TD
+><TD
+>VTR time constant. [?]</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN9135"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The struct&nbsp;<A
+HREF="r8936.htm#V4L2-INPUT"
+>v4l2_input</A
+> <CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+> is
+out of bounds.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r8724.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r9149.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_ENUM_FRAMEINTERVALS</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_ENUMOUTPUT</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r9149.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r9149.htm
new file mode 100644
index 0000000..2887b2e
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r9149.htm
@@ -0,0 +1,511 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_ENUMOUTPUT</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_ENUMINPUT"
+HREF="r8936.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_ENUMSTD"
+HREF="r9288.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r8936.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r9288.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-ENUMOUTPUT"
+></A
+>ioctl VIDIOC_ENUMOUTPUT</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN9153"
+></A
+><H2
+>Name</H2
+>VIDIOC_ENUMOUTPUT&nbsp;--&nbsp;Enumerate video outputs</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN9156"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN9157"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_output *argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN9167"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_ENUMOUTPUT</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN9187"
+></A
+><H2
+>Description</H2
+><P
+>To query the attributes of a video outputs applications
+initialize the <CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+> field of struct&nbsp;<A
+HREF="r9149.htm#V4L2-OUTPUT"
+>v4l2_output</A
+>
+and call the <CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMOUTPUT</CODE
+> ioctl with a
+pointer to this structure. Drivers fill the rest of the structure or
+return an <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code when the index is out of bounds. To enumerate all
+outputs applications shall begin at index zero, incrementing by one
+until the driver returns <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+>.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-OUTPUT"
+></A
+><P
+><B
+>Table 1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_output</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+></TD
+><TD
+>Identifies the output, set by the
+application.</TD
+></TR
+><TR
+><TD
+>__u8</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>name</CODE
+>[32]</TD
+><TD
+>Name of the video output, a NUL-terminated ASCII
+string, for example: "Vout". This information is intended for the
+user, preferably the connector label on the device itself.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+></TD
+><TD
+>Type of the output, see <A
+HREF="r9149.htm#OUTPUT-TYPE"
+>Table 2</A
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>audioset</CODE
+></TD
+><TD
+><P
+>Drivers can enumerate up to 32 video and
+audio outputs. This field shows which audio outputs were
+selectable as the current output if this was the currently selected
+video output. It is a bit mask. The LSB corresponds to audio output 0,
+the MSB to output 31. Any number of bits can be set, or
+none.</P
+><P
+>When the driver does not enumerate audio outputs no
+bits must be set. Applications shall not interpret this as lack of
+audio support. Drivers may automatically select audio outputs without
+enumerating them.</P
+><P
+>For details on audio outputs and how to
+select the current output see <A
+HREF="x341.htm"
+>Section 1.5</A
+>.</P
+></TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>modulator</CODE
+></TD
+><TD
+>Output devices can have zero or more RF modulators.
+When the <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> is
+<CODE
+CLASS="CONSTANT"
+>V4L2_OUTPUT_TYPE_MODULATOR</CODE
+> this is an RF
+connector and this field identifies the modulator. It corresponds to
+struct&nbsp;<A
+HREF="r11430.htm#V4L2-MODULATOR"
+>v4l2_modulator</A
+> field <CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+>. For details
+on modulators see <A
+HREF="x394.htm"
+>Section 1.6</A
+>.</TD
+></TR
+><TR
+><TD
+><A
+HREF="r9288.htm#V4L2-STD-ID"
+>v4l2_std_id</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>std</CODE
+></TD
+><TD
+>Every video output supports one or more different
+video standards. This field is a set of all supported standards. For
+details on video standards and how to switch see <A
+HREF="x448.htm"
+>Section 1.7</A
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+>[4]</TD
+><TD
+>Reserved for future extensions. Drivers must set
+the array to zero.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="OUTPUT-TYPE"
+></A
+><P
+><B
+>Table 2. Output Type</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_OUTPUT_TYPE_MODULATOR</CODE
+></TD
+><TD
+>1</TD
+><TD
+>This output is an analog TV modulator.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_OUTPUT_TYPE_ANALOG</CODE
+></TD
+><TD
+>2</TD
+><TD
+>Analog baseband output, for example Composite /
+CVBS, S-Video, RGB.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY</CODE
+></TD
+><TD
+>3</TD
+><TD
+>[?]</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN9274"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The struct&nbsp;<A
+HREF="r9149.htm#V4L2-OUTPUT"
+>v4l2_output</A
+> <CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+>
+is out of bounds.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r8936.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r9288.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_ENUMINPUT</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_ENUMSTD</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r9288.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r9288.htm
new file mode 100644
index 0000000..7ef83b6
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r9288.htm
@@ -0,0 +1,942 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_ENUMSTD</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_ENUMOUTPUT"
+HREF="r9149.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_G_AUDIO, VIDIOC_S_AUDIO"
+HREF="r9539.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r9149.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r9539.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-ENUMSTD"
+></A
+>ioctl VIDIOC_ENUMSTD</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN9292"
+></A
+><H2
+>Name</H2
+>VIDIOC_ENUMSTD&nbsp;--&nbsp;Enumerate supported video standards</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN9295"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN9296"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_standard *argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN9306"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_ENUMSTD</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN9326"
+></A
+><H2
+>Description</H2
+><P
+>To query the attributes of a video standard,
+especially a custom (driver defined) one, applications initialize the
+<CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+> field of struct&nbsp;<A
+HREF="r9288.htm#V4L2-STANDARD"
+>v4l2_standard</A
+> and call the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMSTD</CODE
+> ioctl with a pointer to this
+structure. Drivers fill the rest of the structure or return an
+<SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code when the index is out of bounds. To enumerate all standards
+applications shall begin  at index zero, incrementing by one until the
+driver returns <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+>. Drivers may enumerate a
+different set of standards after switching the video input or
+output.<A
+NAME="AEN9334"
+HREF="r9288.htm#FTN.AEN9334"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+></P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-STANDARD"
+></A
+><P
+><B
+>Table 1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_standard</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+></TD
+><TD
+>Number of the video standard, set by the
+application.</TD
+></TR
+><TR
+><TD
+><A
+HREF="r9288.htm#V4L2-STD-ID"
+>v4l2_std_id</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+></TD
+><TD
+>The bits in this field identify the standard as
+one of the common standards listed in <A
+HREF="r9288.htm#V4L2-STD-ID"
+>Table 3</A
+>,
+or if bits 32 to 63 are set as custom standards. Multiple bits can be
+set if the hardware does not distinguish between these standards,
+however separate indices do not indicate the opposite. The
+<CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+> must be unique. No other enumerated
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_standard</CODE
+> structure, for this input or
+output anyway, can contain the same set of bits.</TD
+></TR
+><TR
+><TD
+>__u8</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>name</CODE
+>[24]</TD
+><TD
+>Name of the standard, a NUL-terminated ASCII
+string, for example: "PAL-B/G", "NTSC Japan". This information is
+intended for the user.</TD
+></TR
+><TR
+><TD
+>struct&nbsp;<A
+HREF="r9288.htm#V4L2-FRACT"
+>v4l2_fract</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>frameperiod</CODE
+></TD
+><TD
+>The frame period (not field period) is numerator
+/ denominator. For example M/NTSC has a frame period of 1001 /
+30000 seconds.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>framelines</CODE
+></TD
+><TD
+>Total lines per frame including blanking,
+e.&nbsp;g. 625 for B/PAL.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+>[4]</TD
+><TD
+>Reserved for future extensions. Drivers must set
+the array to zero.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-FRACT"
+></A
+><P
+><B
+>Table 2. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_fract</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>numerator</CODE
+></TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>denominator</CODE
+></TD
+><TD
+>&nbsp;</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-STD-ID"
+></A
+><P
+><B
+>Table 3. typedef <CODE
+CLASS="STRUCTNAME"
+>v4l2_std_id</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u64</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>v4l2_std_id</CODE
+></TD
+><TD
+>This type is a set, each bit representing another
+video standard as listed below and in <A
+HREF="r9288.htm#VIDEO-STANDARDS"
+>Table 4</A
+>. The 32 most significant bits are reserved
+for custom (driver defined) video standards.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+>#define V4L2_STD_PAL_B          ((v4l2_std_id)0x00000001)
+#define V4L2_STD_PAL_B1         ((v4l2_std_id)0x00000002)
+#define V4L2_STD_PAL_G          ((v4l2_std_id)0x00000004)
+#define V4L2_STD_PAL_H          ((v4l2_std_id)0x00000008)
+#define V4L2_STD_PAL_I          ((v4l2_std_id)0x00000010)
+#define V4L2_STD_PAL_D          ((v4l2_std_id)0x00000020)
+#define V4L2_STD_PAL_D1         ((v4l2_std_id)0x00000040)
+#define V4L2_STD_PAL_K          ((v4l2_std_id)0x00000080)
+
+#define V4L2_STD_PAL_M          ((v4l2_std_id)0x00000100)
+#define V4L2_STD_PAL_N          ((v4l2_std_id)0x00000200)
+#define V4L2_STD_PAL_Nc         ((v4l2_std_id)0x00000400)
+#define V4L2_STD_PAL_60         ((v4l2_std_id)0x00000800)</PRE
+></P
+><P
+><CODE
+CLASS="CONSTANT"
+>V4L2_STD_PAL_60</CODE
+> is
+a hybrid standard with 525 lines, 60 Hz refresh rate, and PAL color
+modulation with a 4.43 MHz color subcarrier. Some PAL video recorders
+can play back NTSC tapes in this mode for display on a 50/60 Hz agnostic
+PAL TV.</P
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+>#define V4L2_STD_NTSC_M         ((v4l2_std_id)0x00001000)
+#define V4L2_STD_NTSC_M_JP      ((v4l2_std_id)0x00002000)
+#define V4L2_STD_NTSC_443       ((v4l2_std_id)0x00004000)</PRE
+></P
+><P
+><CODE
+CLASS="CONSTANT"
+>V4L2_STD_NTSC_443</CODE
+>
+is a hybrid standard with 525 lines, 60 Hz refresh rate, and NTSC
+color modulation with a 4.43 MHz color
+subcarrier.</P
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+>#define V4L2_STD_NTSC_M_KR      ((v4l2_std_id)0x00008000)
+
+#define V4L2_STD_SECAM_B        ((v4l2_std_id)0x00010000)
+#define V4L2_STD_SECAM_D        ((v4l2_std_id)0x00020000)
+#define V4L2_STD_SECAM_G        ((v4l2_std_id)0x00040000)
+#define V4L2_STD_SECAM_H        ((v4l2_std_id)0x00080000)
+#define V4L2_STD_SECAM_K        ((v4l2_std_id)0x00100000)
+#define V4L2_STD_SECAM_K1       ((v4l2_std_id)0x00200000)
+#define V4L2_STD_SECAM_L        ((v4l2_std_id)0x00400000)
+#define V4L2_STD_SECAM_LC       ((v4l2_std_id)0x00800000)
+
+/* ATSC/HDTV */
+#define V4L2_STD_ATSC_8_VSB     ((v4l2_std_id)0x01000000)
+#define V4L2_STD_ATSC_16_VSB    ((v4l2_std_id)0x02000000)</PRE
+></P
+><P
+><CODE
+CLASS="CONSTANT"
+>V4L2_STD_ATSC_8_VSB</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_STD_ATSC_16_VSB</CODE
+> are U.S. terrestrial digital
+TV standards. Presently the V4L2 API does not support digital TV. See
+also the Linux DVB API at <A
+HREF="http://linuxtv.org"
+TARGET="_top"
+>http://linuxtv.org</A
+>.</P
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+>#define V4L2_STD_PAL_BG         (V4L2_STD_PAL_B         |\
+                                 V4L2_STD_PAL_B1        |\
+                                 V4L2_STD_PAL_G)
+#define V4L2_STD_B              (V4L2_STD_PAL_B         |\
+                                 V4L2_STD_PAL_B1        |\
+                                 V4L2_STD_SECAM_B)
+#define V4L2_STD_GH             (V4L2_STD_PAL_G         |\
+                                 V4L2_STD_PAL_H         |\
+                                 V4L2_STD_SECAM_G       |\
+                                 V4L2_STD_SECAM_H)
+#define V4L2_STD_PAL_DK         (V4L2_STD_PAL_D         |\
+                                 V4L2_STD_PAL_D1        |\
+                                 V4L2_STD_PAL_K)
+#define V4L2_STD_PAL            (V4L2_STD_PAL_BG        |\
+                                 V4L2_STD_PAL_DK        |\
+                                 V4L2_STD_PAL_H         |\
+                                 V4L2_STD_PAL_I)
+#define V4L2_STD_NTSC           (V4L2_STD_NTSC_M        |\
+                                 V4L2_STD_NTSC_M_JP     |\
+                                 V4L2_STD_NTSC_M_KR)
+#define V4L2_STD_MN             (V4L2_STD_PAL_M         |\
+                                 V4L2_STD_PAL_N         |\
+                                 V4L2_STD_PAL_Nc        |\
+                                 V4L2_STD_NTSC)
+#define V4L2_STD_SECAM_DK       (V4L2_STD_SECAM_D       |\
+                                 V4L2_STD_SECAM_K       |\
+                                 V4L2_STD_SECAM_K1)
+#define V4L2_STD_DK             (V4L2_STD_PAL_DK        |\
+                                 V4L2_STD_SECAM_DK)
+
+#define V4L2_STD_SECAM          (V4L2_STD_SECAM_B       |\
+                                 V4L2_STD_SECAM_G       |\
+                                 V4L2_STD_SECAM_H       |\
+                                 V4L2_STD_SECAM_DK      |\
+                                 V4L2_STD_SECAM_L       |\
+                                 V4L2_STD_SECAM_LC)
+
+#define V4L2_STD_525_60         (V4L2_STD_PAL_M         |\
+                                 V4L2_STD_PAL_60        |\
+                                 V4L2_STD_NTSC          |\
+                                 V4L2_STD_NTSC_443)
+#define V4L2_STD_625_50         (V4L2_STD_PAL           |\
+                                 V4L2_STD_PAL_N         |\
+                                 V4L2_STD_PAL_Nc        |\
+                                 V4L2_STD_SECAM)
+
+#define V4L2_STD_UNKNOWN        0
+#define V4L2_STD_ALL            (V4L2_STD_525_60        |\
+                                 V4L2_STD_625_50)</PRE
+></P
+><DIV
+CLASS="TABLE"
+><A
+NAME="VIDEO-STANDARDS"
+></A
+><P
+><B
+>Table 4. Video Standards (based on [<A
+HREF="b17127.htm#ITU470"
+><ABBR
+CLASS="ABBREV"
+>ITU&nbsp;BT.470</ABBR
+></A
+>])</B
+></P
+><TABLE
+BORDER="1"
+RULES="all"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="12%"
+ALIGN="LEFT"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="12%"
+TITLE="C3"><COL
+WIDTH="12%"
+TITLE="C4"><COL
+WIDTH="12%"
+TITLE="C5"><COL><COL
+WIDTH="12%"
+TITLE="C7"><COL><COL
+WIDTH="12%"
+TITLE="C9"><COL><COL><COL
+WIDTH="12%"
+TITLE="C12"><THEAD
+><TR
+><TH
+>Characteristics</TH
+><TH
+><P
+>M/NTSC<SUP
+>a</SUP
+></P
+></TH
+><TH
+>M/PAL</TH
+><TH
+><P
+>N/PAL<SUP
+>b</SUP
+></P
+></TH
+><TH
+ALIGN="CENTER"
+>B, B1, G/PAL</TH
+><TH
+ALIGN="CENTER"
+>D, D1, K/PAL</TH
+><TH
+ALIGN="CENTER"
+>H/PAL</TH
+><TH
+ALIGN="CENTER"
+>I/PAL</TH
+><TH
+ALIGN="CENTER"
+>B, G/SECAM</TH
+><TH
+ALIGN="CENTER"
+>D, K/SECAM</TH
+><TH
+ALIGN="CENTER"
+>K1/SECAM</TH
+><TH
+ALIGN="CENTER"
+>L/SECAM</TH
+></TR
+></THEAD
+><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>Frame lines</TD
+><TD
+COLSPAN="2"
+ALIGN="CENTER"
+>525</TD
+><TD
+COLSPAN="9"
+ALIGN="CENTER"
+>625</TD
+></TR
+><TR
+><TD
+>Frame period (s)</TD
+><TD
+COLSPAN="2"
+ALIGN="CENTER"
+>1001/30000</TD
+><TD
+COLSPAN="9"
+ALIGN="CENTER"
+>1/25</TD
+></TR
+><TR
+><TD
+>Chrominance sub-carrier frequency (Hz)</TD
+><TD
+>3579545 &plusmn;&nbsp;10</TD
+><TD
+>3579611.49 &plusmn;&nbsp;10</TD
+><TD
+>4433618.75 &plusmn;&nbsp;5 (3582056.25
+&plusmn;&nbsp;5)</TD
+><TD
+COLSPAN="3"
+ALIGN="CENTER"
+>4433618.75 &plusmn;&nbsp;5</TD
+><TD
+>4433618.75 &plusmn;&nbsp;1</TD
+><TD
+COLSPAN="4"
+ALIGN="CENTER"
+>f<SUB
+>OR</SUB
+>&nbsp;=
+4406250 &plusmn;&nbsp;2000, f<SUB
+>OB</SUB
+>&nbsp;= 4250000
+&plusmn;&nbsp;2000</TD
+></TR
+><TR
+><TD
+>Nominal radio-frequency channel bandwidth
+(MHz)</TD
+><TD
+>6</TD
+><TD
+>6</TD
+><TD
+>6</TD
+><TD
+>B: 7; B1, G: 8</TD
+><TD
+>8</TD
+><TD
+>8</TD
+><TD
+>8</TD
+><TD
+>8</TD
+><TD
+>8</TD
+><TD
+>8</TD
+><TD
+>8</TD
+></TR
+><TR
+><TD
+>Sound carrier relative to vision carrier
+(MHz)</TD
+><TD
+>+&nbsp;4.5</TD
+><TD
+>+&nbsp;4.5</TD
+><TD
+>+&nbsp;4.5</TD
+><TD
+><P
+>+&nbsp;5.5 &plusmn;&nbsp;0.001
+<SUP
+>c</SUP
+> <SUP
+>d</SUP
+> <SUP
+>e</SUP
+> <SUP
+>f</SUP
+></P
+></TD
+><TD
+>+&nbsp;6.5 &plusmn;&nbsp;0.001</TD
+><TD
+>+&nbsp;5.5</TD
+><TD
+>+&nbsp;5.9996 &plusmn;&nbsp;0.0005</TD
+><TD
+>+&nbsp;5.5 &plusmn;&nbsp;0.001</TD
+><TD
+>+&nbsp;6.5 &plusmn;&nbsp;0.001</TD
+><TD
+>+&nbsp;6.5</TD
+><TD
+><P
+>+&nbsp;6.5 <SUP
+>g</SUP
+></P
+></TD
+></TR
+></TBODY
+><TR
+><TD
+COLSPAN="12"
+>Notes:<BR><A
+NAME="FTN.AEN9452"
+>a. </A
+>Japan uses a standard
+similar to M/NTSC
+(V4L2_STD_NTSC_M_JP).<BR><A
+NAME="FTN.AEN9457"
+>b. </A
+> The values in
+brackets apply to the combination N/PAL a.k.a.
+N<SUB
+>C</SUB
+> used in Argentina
+(V4L2_STD_PAL_Nc).<BR><A
+NAME="FTN.AEN9507"
+>c. </A
+>In the Federal Republic of Germany, Austria, Italy,
+the Netherlands, Slovakia and Switzerland a system of two sound
+carriers is used, the frequency of the second carrier being
+242.1875&nbsp;kHz above the frequency of the first sound carrier. For
+stereophonic sound transmissions a similar system is used in
+Australia.<BR><A
+NAME="FTN.AEN9509"
+>d. </A
+>New Zealand uses a sound
+carrier displaced 5.4996 &plusmn;&nbsp;0.0005 MHz from the vision
+carrier.<BR><A
+NAME="FTN.AEN9511"
+>e. </A
+>In Denmark, Finland, New
+Zealand, Sweden and Spain a system of two sound carriers is used. In
+Iceland, Norway and Poland the same system is being introduced. The
+second carrier is 5.85&nbsp;MHz above the vision carrier and is DQPSK
+modulated with 728&nbsp;kbit/s sound and data multiplex. (NICAM
+system)<BR><A
+NAME="FTN.AEN9513"
+>f. </A
+>In the United Kingdom, a
+system of two sound carriers is used. The second sound carrier is
+6.552&nbsp;MHz above the vision carrier and is DQPSK modulated with a
+728&nbsp;kbit/s sound and data multiplex able to carry two sound
+channels. (NICAM system)<BR><A
+NAME="FTN.AEN9523"
+>g. </A
+>In France, a
+digital carrier 5.85 MHz away from the vision carrier may be used in
+addition to the main sound carrier. It is modulated in differentially
+encoded QPSK with a 728 kbit/s sound and data multiplexer capable of
+carrying two sound channels. (NICAM
+system)<BR></TD
+></TR
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN9525"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The struct&nbsp;<A
+HREF="r9288.htm#V4L2-STANDARD"
+>v4l2_standard</A
+> <CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+>
+is out of bounds.</P
+></DD
+></DL
+></DIV
+></DIV
+><H2
+CLASS="FOOTNOTES"
+>Notes</H2
+><TABLE
+BORDER="0"
+CLASS="FOOTNOTES"
+WIDTH="100%"
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="5%"
+><A
+NAME="FTN.AEN9334"
+HREF="r9288.htm#AEN9334"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="95%"
+><P
+>The supported standards may overlap and we need an
+unambiguous set to find the current standard returned by
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_STD</CODE
+>.</P
+></TD
+></TR
+></TABLE
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r9149.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r9539.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_ENUMOUTPUT</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_G_AUDIO, VIDIOC_S_AUDIO</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r9539.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r9539.htm
new file mode 100644
index 0000000..ab7a4f9
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r9539.htm
@@ -0,0 +1,537 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_G_AUDIO, VIDIOC_S_AUDIO</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_ENUMSTD"
+HREF="r9288.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT"
+HREF="r9688.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r9288.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r9688.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-G-AUDIO"
+></A
+>ioctl VIDIOC_G_AUDIO, VIDIOC_S_AUDIO</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN9543"
+></A
+><H2
+>Name</H2
+>VIDIOC_G_AUDIO, VIDIOC_S_AUDIO&nbsp;--&nbsp;Query or select the current audio input and its
+attributes</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN9547"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN9548"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_audio *argp);</CODE
+></P
+><P
+></P
+></DIV
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN9558"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, const struct v4l2_audio *argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN9568"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_G_AUDIO, VIDIOC_S_AUDIO</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN9588"
+></A
+><H2
+>Description</H2
+><P
+>To query the current audio input applications zero out the
+<CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+> array of a struct&nbsp;<A
+HREF="r9539.htm#V4L2-AUDIO"
+>v4l2_audio</A
+>
+and call the <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_AUDIO</CODE
+> ioctl with a pointer
+to this structure. Drivers fill the rest of the structure or return an
+<SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code when the device has no audio inputs, or none which combine
+with the current video input.</P
+><P
+>Audio inputs have one writable property, the audio mode. To
+select the current audio input <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>and</I
+></SPAN
+> change the
+audio mode, applications initialize the
+<CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+> and <CODE
+CLASS="STRUCTFIELD"
+>mode</CODE
+>
+fields, and the
+<CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+> array of a
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_audio</CODE
+> structure and call the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_AUDIO</CODE
+> ioctl. Drivers may switch to a
+different audio mode if the request cannot be satisfied. However, this
+is a write-only ioctl, it does not return the actual new audio
+mode.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-AUDIO"
+></A
+><P
+><B
+>Table 1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_audio</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+></TD
+><TD
+>Identifies the audio input, set by the
+driver or application.</TD
+></TR
+><TR
+><TD
+>__u8</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>name</CODE
+>[32]</TD
+><TD
+>Name of the audio input, a NUL-terminated ASCII
+string, for example: "Line In". This information is intended for the
+user, preferably the connector label on the device itself.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>capability</CODE
+></TD
+><TD
+>Audio capability flags, see <A
+HREF="r9539.htm#AUDIO-CAPABILITY"
+>Table 2</A
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>mode</CODE
+></TD
+><TD
+>Audio mode flags set by drivers and applications (on
+            <CODE
+CLASS="CONSTANT"
+>VIDIOC_S_AUDIO</CODE
+> ioctl), see <A
+HREF="r9539.htm#AUDIO-MODE"
+>Table 3</A
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+>[2]</TD
+><TD
+>Reserved for future extensions. Drivers and
+applications must set the array to zero.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="AUDIO-CAPABILITY"
+></A
+><P
+><B
+>Table 2. Audio Capability Flags</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_AUDCAP_STEREO</CODE
+></TD
+><TD
+>0x00001</TD
+><TD
+>This is a stereo input. The flag is intended to
+automatically disable stereo recording etc. when the signal is always
+monaural. The API provides no means to detect if stereo is
+<SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>received</I
+></SPAN
+>, unless the audio input belongs to a
+tuner.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_AUDCAP_AVL</CODE
+></TD
+><TD
+>0x00002</TD
+><TD
+>Automatic Volume Level mode is supported.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="AUDIO-MODE"
+></A
+><P
+><B
+>Table 3. Audio Mode Flags</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_AUDMODE_AVL</CODE
+></TD
+><TD
+>0x00001</TD
+><TD
+>AVL mode is on.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN9671"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>No audio inputs combine with the current video input,
+or the number of the selected audio input is out of bounds or it does
+not combine, or there are no audio inputs at all and the ioctl is not
+supported.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+></DT
+><DD
+><P
+>I/O is in progress, the input cannot be
+switched.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r9288.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r9688.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_ENUMSTD</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r9688.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r9688.htm
new file mode 100644
index 0000000..fb8b54e
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r9688.htm
@@ -0,0 +1,439 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_G_AUDIO, VIDIOC_S_AUDIO"
+HREF="r9539.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_G_CHIP_IDENT"
+HREF="r9804.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r9539.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r9804.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-G-AUDIOOUT"
+></A
+>ioctl VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN9692"
+></A
+><H2
+>Name</H2
+>VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT&nbsp;--&nbsp;Query or select the current audio output</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN9696"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN9697"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_audioout *argp);</CODE
+></P
+><P
+></P
+></DIV
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN9707"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, const struct v4l2_audioout *argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN9717"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN9737"
+></A
+><H2
+>Description</H2
+><P
+>To query the current audio output applications zero out the
+<CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+> array of a struct&nbsp;<A
+HREF="r9688.htm#V4L2-AUDIOOUT"
+>v4l2_audioout</A
+> and
+call the <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_AUDOUT</CODE
+> ioctl with a pointer
+to this structure. Drivers fill the rest of the structure or return an
+<SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code when the device has no audio inputs, or none which combine
+with the current video output.</P
+><P
+>Audio outputs have no writable properties. Nevertheless, to
+select the current audio output applications can initialize the
+<CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+> field and
+<CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+> array (which in the future may
+contain writable properties) of a
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_audioout</CODE
+> structure and call the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_AUDOUT</CODE
+> ioctl. Drivers switch to the
+requested output or return the <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code when the index is out of
+bounds. This is a write-only ioctl, it does not return the current
+audio output attributes as <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_AUDOUT</CODE
+>
+does.</P
+><P
+>Note connectors on a TV card to loop back the received audio
+signal to a sound card are not audio outputs in this sense.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-AUDIOOUT"
+></A
+><P
+><B
+>Table 1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_audioout</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+></TD
+><TD
+>Identifies the audio output, set by the
+driver or application.</TD
+></TR
+><TR
+><TD
+>__u8</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>name</CODE
+>[32]</TD
+><TD
+>Name of the audio output, a NUL-terminated ASCII
+string, for example: "Line Out". This information is intended for the
+user, preferably the connector label on the device itself.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>capability</CODE
+></TD
+><TD
+>Audio capability flags, none defined yet. Drivers
+must set this field to zero.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>mode</CODE
+></TD
+><TD
+>Audio mode, none defined yet. Drivers and
+applications (on <CODE
+CLASS="CONSTANT"
+>VIDIOC_S_AUDOUT</CODE
+>) must set this
+field to zero.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+>[2]</TD
+><TD
+>Reserved for future extensions. Drivers and
+applications must set the array to zero.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN9787"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>No audio outputs combine with the current video
+output, or the number of the selected audio output is out of bounds or
+it does not combine, or there are no audio outputs at all and the
+ioctl is not supported.</P
+></DD
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+></DT
+><DD
+><P
+>I/O is in progress, the output cannot be
+switched.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r9539.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r9804.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_G_AUDIO, VIDIOC_S_AUDIO</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_G_CHIP_IDENT</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r9804.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r9804.htm
new file mode 100644
index 0000000..e548b72
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r9804.htm
@@ -0,0 +1,687 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_G_CHIP_IDENT</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT"
+HREF="r9688.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_G_CROP, VIDIOC_S_CROP"
+HREF="r9994.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r9688.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r9994.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-G-CHIP-IDENT"
+></A
+>ioctl VIDIOC_G_CHIP_IDENT</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN9808"
+></A
+><H2
+>Name</H2
+>VIDIOC_G_CHIP_IDENT&nbsp;--&nbsp;Identify the chips on a TV card</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN9811"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN9812"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_chip_ident
+*argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN9822"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_G_CHIP_IDENT</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN9842"
+></A
+><H2
+>Description</H2
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Experimental: </B
+>This is an <A
+HREF="x16453.htm"
+>experimental</A
+> interface and may change in
+the future.</P
+></BLOCKQUOTE
+></DIV
+><P
+>For driver debugging purposes this ioctl allows test
+applications to query the driver about the chips present on the TV
+card. Regular applications should not use it. When you found a chip
+specific bug, please contact the Video4Linux mailing list (<A
+HREF="https://listman.redhat.com/mailman/listinfo/video4linux-list"
+TARGET="_top"
+>https://listman.redhat.com/mailman/listinfo/video4linux-list</A
+>)
+so it can be fixed.</P
+><P
+>To query the driver applications must initialize the
+<CODE
+CLASS="STRUCTFIELD"
+>match_type</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>match_chip</CODE
+> fields of a struct&nbsp;<A
+HREF="r9804.htm#V4L2-CHIP-IDENT"
+>v4l2_chip_ident</A
+>
+and call <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_CHIP_IDENT</CODE
+> with a pointer to
+this structure. On success the driver stores information about the
+selected chip in the <CODE
+CLASS="STRUCTFIELD"
+>ident</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>revision</CODE
+> fields. On failure the structure
+remains unchanged.</P
+><P
+>When <CODE
+CLASS="STRUCTFIELD"
+>match_type</CODE
+> is
+<CODE
+CLASS="CONSTANT"
+>V4L2_CHIP_MATCH_HOST</CODE
+>,
+<CODE
+CLASS="STRUCTFIELD"
+>match_chip</CODE
+> selects the nth non-I<SUP
+>2</SUP
+>C chip
+on the TV card. You can enumerate all chips by starting at zero and
+incrementing <CODE
+CLASS="STRUCTFIELD"
+>match_chip</CODE
+> by one until
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_CHIP_IDENT</CODE
+> fails with an <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code.
+Drivers may also interpret <CODE
+CLASS="STRUCTFIELD"
+>match_chip</CODE
+> as a
+random ID, but we recommend against that. The number zero always
+selects the host chip, e.&nbsp;g. the chip connected to the PCI bus.</P
+><P
+>When <CODE
+CLASS="STRUCTFIELD"
+>match_type</CODE
+> is
+<CODE
+CLASS="CONSTANT"
+>V4L2_CHIP_MATCH_I2C_DRIVER</CODE
+>,
+<CODE
+CLASS="STRUCTFIELD"
+>match_chip</CODE
+> contains a driver ID as defined
+in the <TT
+CLASS="FILENAME"
+>linux/i2c-id.h</TT
+> header file. For instance
+<CODE
+CLASS="CONSTANT"
+>I2C_DRIVERID_SAA7127</CODE
+> will match any chip
+supported by the saa7127 driver, regardless of its I<SUP
+>2</SUP
+>C bus address.
+When multiple chips supported by the same driver are present, the
+ioctl will return <CODE
+CLASS="CONSTANT"
+>V4L2_IDENT_AMBIGUOUS</CODE
+> in the
+<CODE
+CLASS="STRUCTFIELD"
+>ident</CODE
+> field.</P
+><P
+>When <CODE
+CLASS="STRUCTFIELD"
+>match_type</CODE
+> is
+<CODE
+CLASS="CONSTANT"
+>V4L2_CHIP_MATCH_I2C_ADDR</CODE
+>,
+<CODE
+CLASS="STRUCTFIELD"
+>match_chip</CODE
+> selects a chip by its 7 bit
+I<SUP
+>2</SUP
+>C bus address.</P
+><P
+>On success, the <CODE
+CLASS="STRUCTFIELD"
+>ident</CODE
+> field will
+contain a chip ID from the Linux
+<TT
+CLASS="FILENAME"
+>media/v4l2-chip-ident.h</TT
+> header file, and the
+<CODE
+CLASS="STRUCTFIELD"
+>revision</CODE
+> field will contain a driver
+specific value, or zero if no particular revision is associated with
+this chip.</P
+><P
+>When the driver could not identify the selected chip,
+<CODE
+CLASS="STRUCTFIELD"
+>ident</CODE
+> will contain
+<CODE
+CLASS="CONSTANT"
+>V4L2_IDENT_UNKNOWN</CODE
+>. When no chip matched
+<CODE
+CLASS="STRUCTFIELD"
+>match_type</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>match_chip</CODE
+>, the ioctl will succeed but the
+<CODE
+CLASS="STRUCTFIELD"
+>ident</CODE
+> field will contain
+<CODE
+CLASS="CONSTANT"
+>V4L2_IDENT_NONE</CODE
+>. If multiple chips matched,
+<CODE
+CLASS="STRUCTFIELD"
+>ident</CODE
+> will contain
+<CODE
+CLASS="CONSTANT"
+>V4L2_IDENT_AMBIGUOUS</CODE
+>. In all these cases the
+<CODE
+CLASS="STRUCTFIELD"
+>revision</CODE
+> field remains unchanged.</P
+><P
+>This ioctl is optional, not all drivers may support it. It
+was introduced in Linux 2.6.21.</P
+><P
+>We recommended the <SPAN
+CLASS="APPLICATION"
+>v4l2-dbg</SPAN
+>
+utility over calling this ioctl directly. It is available from the
+LinuxTV v4l-dvb repository; see <A
+HREF="http://linuxtv.org/repo/"
+TARGET="_top"
+>http://linuxtv.org/repo/</A
+> for
+access instructions.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-CHIP-IDENT"
+></A
+><P
+><B
+>Table 1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_chip_ident</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>match_type</CODE
+></TD
+><TD
+>See <A
+HREF="r9804.htm#IDENT-CHIP-MATCH-TYPES"
+>Table 2</A
+> for a list of
+possible types.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>match_chip</CODE
+></TD
+><TD
+>Match a chip by this number, interpreted according
+to the <CODE
+CLASS="STRUCTFIELD"
+>match_type</CODE
+> field.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>ident</CODE
+></TD
+><TD
+>A chip identifier as defined in the Linux
+<TT
+CLASS="FILENAME"
+>media/v4l2-chip-ident.h</TT
+> header file, or one of
+the values from <A
+HREF="r9804.htm#CHIP-IDS"
+>Table 3</A
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>revision</CODE
+></TD
+><TD
+>A chip revision, chip and driver specific.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="IDENT-CHIP-MATCH-TYPES"
+></A
+><P
+><B
+>Table 2. Chip Match Types</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CHIP_MATCH_HOST</CODE
+></TD
+><TD
+>0</TD
+><TD
+>Match the nth chip on the card, zero for the
+            host chip. Does not match I<SUP
+>2</SUP
+>C chips.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CHIP_MATCH_I2C_DRIVER</CODE
+></TD
+><TD
+>1</TD
+><TD
+>Match an I<SUP
+>2</SUP
+>C chip by its driver ID from the
+<TT
+CLASS="FILENAME"
+>linux/i2c-id.h</TT
+> header file.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CHIP_MATCH_I2C_ADDR</CODE
+></TD
+><TD
+>2</TD
+><TD
+>Match a chip by its 7 bit I<SUP
+>2</SUP
+>C bus address.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="CHIP-IDS"
+></A
+><P
+><B
+>Table 3. Chip Identifiers</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_IDENT_NONE</CODE
+></TD
+><TD
+>0</TD
+><TD
+>No chip matched.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_IDENT_AMBIGUOUS</CODE
+></TD
+><TD
+>1</TD
+><TD
+>Multiple chips matched.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_IDENT_UNKNOWN</CODE
+></TD
+><TD
+>2</TD
+><TD
+>A chip is present at this address, but the driver
+could not identify it.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN9981"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>The driver does not support this ioctl, or the
+<CODE
+CLASS="STRUCTFIELD"
+>match_type</CODE
+> is invalid.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r9688.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r9994.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_G_CROP, VIDIOC_S_CROP</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r9994.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r9994.htm
new file mode 100644
index 0000000..e494928
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/r9994.htm
@@ -0,0 +1,440 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>ioctl VIDIOC_G_CROP, VIDIOC_S_CROP</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Function Reference"
+HREF="r7624.htm"><LINK
+REL="PREVIOUS"
+TITLE="ioctl VIDIOC_G_CHIP_IDENT"
+HREF="r9804.htm"><LINK
+REL="NEXT"
+TITLE="ioctl VIDIOC_G_CTRL, VIDIOC_S_CTRL"
+HREF="r10104.htm"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r9804.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r10104.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="VIDIOC-G-CROP"
+></A
+>ioctl VIDIOC_G_CROP, VIDIOC_S_CROP</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN9998"
+></A
+><H2
+>Name</H2
+>VIDIOC_G_CROP, VIDIOC_S_CROP&nbsp;--&nbsp;Get or set the current cropping rectangle</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN10002"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN10003"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, struct v4l2_crop *argp);</CODE
+></P
+><P
+></P
+></DIV
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN10013"
+></A
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int ioctl</CODE
+>(int fd, int request, const struct v4l2_crop *argp);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN10023"
+></A
+><H2
+>Arguments</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><CODE
+CLASS="PARAMETER"
+>fd</CODE
+></DT
+><DD
+><P
+>File descriptor returned by <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+>.</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>request</CODE
+></DT
+><DD
+><P
+>VIDIOC_G_CROP, VIDIOC_S_CROP</P
+></DD
+><DT
+><CODE
+CLASS="PARAMETER"
+>argp</CODE
+></DT
+><DD
+><P
+></P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN10043"
+></A
+><H2
+>Description</H2
+><P
+>To query the cropping rectangle size and position
+applications set the <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field of a
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_crop</CODE
+> structure to the respective buffer
+(stream) type and call the <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_CROP</CODE
+> ioctl
+with a pointer to this structure. The driver fills the rest of the
+structure or returns the <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code if cropping is not supported.</P
+><P
+>To change the cropping rectangle applications initialize the
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> and struct&nbsp;<A
+HREF="x6570.htm#V4L2-RECT"
+>v4l2_rect</A
+> substructure named
+<CODE
+CLASS="STRUCTFIELD"
+>c</CODE
+> of a v4l2_crop structure and call the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_CROP</CODE
+> ioctl with a pointer to this
+structure.</P
+><P
+>The driver first adjusts the requested dimensions against
+hardware limits, i.&nbsp;e. the bounds given by the capture/output window,
+and it rounds to the closest possible values of horizontal and
+vertical offset, width and height. In particular the driver must round
+the vertical offset of the cropping rectangle to frame lines modulo
+two, such that the field order cannot be confused.</P
+><P
+>Second the driver adjusts the image size (the opposite
+rectangle of the scaling process, source or target depending on the
+data direction) to the closest size possible while maintaining the
+current horizontal and vertical scaling factor.</P
+><P
+>Finally the driver programs the hardware with the actual
+cropping and image parameters. <CODE
+CLASS="CONSTANT"
+>VIDIOC_S_CROP</CODE
+> is a
+write-only ioctl, it does not return the actual parameters. To query
+them applications must call <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_CROP</CODE
+> and
+<A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+></A
+>. When the parameters are unsuitable the application may
+modify the cropping or image parameters and repeat the cycle until
+satisfactory parameters have been negotiated.</P
+><P
+>When cropping is not supported then no parameters are
+changed and <CODE
+CLASS="CONSTANT"
+>VIDIOC_S_CROP</CODE
+> returns the
+<SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-CROP"
+></A
+><P
+><B
+>Table 1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_crop</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>enum&nbsp;<A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+></TD
+><TD
+>Type of the data stream, set by the application.
+Only these types are valid here: <CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_CAPTURE</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_OUTPUT</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_OVERLAY</CODE
+>, and custom (driver
+defined) types with code <CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_PRIVATE</CODE
+>
+and higher.</TD
+></TR
+><TR
+><TD
+>struct&nbsp;<A
+HREF="x6570.htm#V4L2-RECT"
+>v4l2_rect</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>c</CODE
+></TD
+><TD
+>Cropping rectangle. The same co-ordinate system as
+for struct&nbsp;<A
+HREF="r7771.htm#V4L2-CROPCAP"
+>v4l2_cropcap</A
+> <CODE
+CLASS="STRUCTFIELD"
+>bounds</CODE
+> is used.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN10092"
+></A
+><H2
+>Return Value</H2
+><P
+>On success <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> is returned, on error <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> and the <CODE
+CLASS="VARNAME"
+>errno</CODE
+> variable is set appropriately:</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+></DT
+><DD
+><P
+>Cropping is not supported.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r9804.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r10104.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>ioctl VIDIOC_G_CHIP_IDENT</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>ioctl VIDIOC_G_CTRL, VIDIOC_S_CTRL</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x15446.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x15446.htm
new file mode 100644
index 0000000..c8e8b9c
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x15446.htm
@@ -0,0 +1,3549 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Changes of the V4L2 API</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Changes"
+HREF="c14595.htm"><LINK
+REL="PREVIOUS"
+TITLE="Changes"
+HREF="c14595.htm"><LINK
+REL="NEXT"
+TITLE="Relation of V4L2 to other Linux multimedia APIs"
+HREF="x16430.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="c14595.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 6. Changes</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x16430.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="HIST-V4L2"
+>6.2. Changes of the V4L2 API</A
+></H1
+><P
+>Soon after the V4L API was added to the kernel it was
+criticised as too inflexible. In August 1998 Bill Dirks proposed a
+number of improvements and began to work on documentation, example
+drivers and applications. With the help of other volunteers this
+eventually became the V4L2 API, not just an extension but a
+replacement for the V4L API. However it took another four years and
+two stable kernel releases until the new API was finally accepted for
+inclusion into the kernel in its present form.</P
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN15449"
+>6.2.1. Early Versions</A
+></H2
+><P
+>1998-08-20: First version.</P
+><P
+>1998-08-27: The <A
+HREF="r14390.htm"
+><CODE
+CLASS="FUNCTION"
+>select()</CODE
+></A
+> function was introduced.</P
+><P
+>1998-09-10: New video standard interface.</P
+><P
+>1998-09-18: The <CODE
+CLASS="CONSTANT"
+>VIDIOC_NONCAP</CODE
+> ioctl
+was replaced by the otherwise meaningless <CODE
+CLASS="CONSTANT"
+>O_TRUNC</CODE
+>
+<A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+> flag, and the aliases <CODE
+CLASS="CONSTANT"
+>O_NONCAP</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>O_NOIO</CODE
+> were defined. Applications can set this
+flag if they intend to access controls only, as opposed to capture
+applications which need exclusive access. The
+<CODE
+CLASS="CONSTANT"
+>VIDEO_STD_XXX</CODE
+> identifiers are now ordinals
+instead of flags, and the <CODE
+CLASS="FUNCTION"
+>video_std_construct()</CODE
+>
+helper function takes id and transmission arguments.</P
+><P
+>1998-09-28: Revamped video standard. Made video controls
+individually enumerable.</P
+><P
+>1998-10-02: The <CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+> field was
+removed from struct <CODE
+CLASS="STRUCTNAME"
+>video_standard</CODE
+> and the
+color subcarrier fields were renamed. The <A
+HREF="r13641.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYSTD</CODE
+></A
+> ioctl was
+renamed to <A
+HREF="r9288.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMSTD</CODE
+></A
+>, <A
+HREF="r11217.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_INPUT</CODE
+></A
+> to <A
+HREF="r8936.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMINPUT</CODE
+></A
+>. A
+first draft of the Codec API was released.</P
+><P
+>1998-11-08: Many minor changes. Most symbols have been
+renamed. Some material changes to struct&nbsp;<A
+HREF="r13105.htm#V4L2-CAPABILITY"
+>v4l2_capability</A
+>.</P
+><P
+>1998-11-12: The read/write directon of some ioctls was misdefined.</P
+><P
+>1998-11-14: <CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_RGB24</CODE
+>
+changed to <CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_BGR24</CODE
+>, and
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_RGB32</CODE
+> changed to
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_BGR32</CODE
+>. Audio controls are now
+accessible with the <A
+HREF="r10104.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_CTRL</CODE
+></A
+> and <A
+HREF="r10104.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_CTRL</CODE
+></A
+> ioctls under
+names starting with <CODE
+CLASS="CONSTANT"
+>V4L2_CID_AUDIO</CODE
+>. The
+<CODE
+CLASS="CONSTANT"
+>V4L2_MAJOR</CODE
+> define was removed from
+<TT
+CLASS="FILENAME"
+>videodev.h</TT
+> since it was only used once in the
+<TT
+CLASS="FILENAME"
+>videodev</TT
+> kernel module. The
+<CODE
+CLASS="CONSTANT"
+>YUV422</CODE
+> and <CODE
+CLASS="CONSTANT"
+>YUV411</CODE
+> planar
+image formats were added.</P
+><P
+>1998-11-28: A few ioctl symbols changed. Interfaces for codecs and
+video output devices were added.</P
+><P
+>1999-01-14: A raw VBI capture interface was added.</P
+><P
+>1999-01-19: The <CODE
+CLASS="CONSTANT"
+>VIDIOC_NEXTBUF</CODE
+> ioctl
+      was removed.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN15499"
+>6.2.2. V4L2 Version 0.16 1999-01-31</A
+></H2
+><P
+>1999-01-27: There is now one QBUF ioctl, VIDIOC_QWBUF and VIDIOC_QRBUF
+are gone. VIDIOC_QBUF takes a v4l2_buffer as a parameter. Added
+digital zoom (cropping) controls.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN15502"
+>6.2.3. V4L2 Version 0.18 1999-03-16</A
+></H2
+><P
+>Added a v4l to V4L2 ioctl compatibility layer to
+videodev.c. Driver writers, this changes how you implement your ioctl
+handler. See the Driver Writer's Guide. Added some more control id
+codes.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN15505"
+>6.2.4. V4L2 Version 0.19 1999-06-05</A
+></H2
+><P
+>1999-03-18: Fill in the category and catname fields of
+v4l2_queryctrl objects before passing them to the driver. Required a
+minor change to the VIDIOC_QUERYCTRL handlers in the sample
+drivers.</P
+><P
+>1999-03-31: Better compatibility for v4l memory capture
+ioctls. Requires changes to drivers to fully support new compatibility
+features, see Driver Writer's Guide and v4l2cap.c. Added new control
+IDs: V4L2_CID_HFLIP, _VFLIP. Changed V4L2_PIX_FMT_YUV422P to _YUV422P,
+and _YUV411P to _YUV411P.</P
+><P
+>1999-04-04: Added a few more control IDs.</P
+><P
+>1999-04-07: Added the button control type.</P
+><P
+>1999-05-02: Fixed a typo in videodev.h, and added the
+V4L2_CTRL_FLAG_GRAYED (later V4L2_CTRL_FLAG_GRABBED) flag.</P
+><P
+>1999-05-20: Definition of VIDIOC_G_CTRL was wrong causing
+a malfunction of this ioctl.</P
+><P
+>1999-06-05: Changed the value of
+V4L2_CID_WHITENESS.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN15514"
+>6.2.5. V4L2 Version 0.20 (1999-09-10)</A
+></H2
+><P
+>Version 0.20 introduced a number of changes which were
+<SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>not backward compatible</I
+></SPAN
+> with 0.19 and earlier
+versions. Purpose of these changes was to simplify the API, while
+making it more extensible and following common Linux driver API
+conventions.</P
+><P
+></P
+><OL
+TYPE="1"
+><LI
+><P
+>Some typos in <CODE
+CLASS="CONSTANT"
+>V4L2_FMT_FLAG</CODE
+>
+symbols were fixed. struct&nbsp;<A
+HREF="x6570.htm#V4L2-CLIP"
+>v4l2_clip</A
+> was changed for compatibility with
+v4l. (1999-08-30)</P
+></LI
+><LI
+><P
+><CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_SUB_LANG1</CODE
+> was added.
+(1999-09-05)</P
+></LI
+><LI
+><P
+>All ioctl() commands that used an integer argument now
+take a pointer to an integer. Where it makes sense, ioctls will return
+the actual new value in the integer pointed to by the argument, a
+common convention in the V4L2 API. The affected ioctls are:
+VIDIOC_PREVIEW, VIDIOC_STREAMON, VIDIOC_STREAMOFF, VIDIOC_S_FREQ,
+VIDIOC_S_INPUT, VIDIOC_S_OUTPUT, VIDIOC_S_EFFECT. For example
+<PRE
+CLASS="PROGRAMLISTING"
+>err = ioctl (fd, VIDIOC_XXX, V4L2_XXX);</PRE
+> becomes <PRE
+CLASS="PROGRAMLISTING"
+>int a = V4L2_XXX; err = ioctl(fd, VIDIOC_XXX, &amp;a);</PRE
+>
+          </P
+></LI
+><LI
+><P
+>All the different get- and set-format commands were
+swept into one <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+></A
+> and <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctl taking a union
+and a type field selecting the union member as parameter. Purpose is to
+simplify the API by eliminating several ioctls and to allow new and
+driver private data streams without adding new ioctls.</P
+><P
+>This change obsoletes the following ioctls:
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_INFMT</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_INFMT</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_OUTFMT</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_OUTFMT</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_VBIFMT</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_VBIFMT</CODE
+>. The image format structure
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_format</CODE
+> was renamed to struct&nbsp;<A
+HREF="c2030.htm#V4L2-PIX-FORMAT"
+>v4l2_pix_format</A
+>,
+while struct&nbsp;<A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+> is now the envelopping structure for all format
+negotiations.</P
+></LI
+><LI
+><P
+>Similar to the changes above, the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_PARM</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_PARM</CODE
+> ioctls were merged with
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_OUTPARM</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_OUTPARM</CODE
+>. A
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field in the new struct&nbsp;<A
+HREF="r11680.htm#V4L2-STREAMPARM"
+>v4l2_streamparm</A
+>
+selects the respective union member.</P
+><P
+>This change obsoletes the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_OUTPARM</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_OUTPARM</CODE
+> ioctls.</P
+></LI
+><LI
+><P
+>Control enumeration was simplified, and two new
+control flags were introduced and one dropped. The
+<CODE
+CLASS="STRUCTFIELD"
+>catname</CODE
+> field was replaced by a
+<CODE
+CLASS="STRUCTFIELD"
+>group</CODE
+> field.</P
+><P
+>Drivers can now flag unsupported and temporarily
+unavailable controls with <CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_FLAG_DISABLED</CODE
+>
+and <CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_FLAG_GRABBED</CODE
+> respectively. The
+<CODE
+CLASS="STRUCTFIELD"
+>group</CODE
+> name indicates a possibly narrower
+classification than the <CODE
+CLASS="STRUCTFIELD"
+>category</CODE
+>. In other
+words, there may be multiple groups within a category. Controls within
+a group would typically be drawn within a group box. Controls in
+different categories might have a greater separation, or may even
+appear in separate windows.</P
+></LI
+><LI
+><P
+>The struct&nbsp;<A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+> <CODE
+CLASS="STRUCTFIELD"
+>timestamp</CODE
+>
+was changed to a 64 bit integer, containing the sampling or output
+time of the frame in nanoseconds. Additionally timestamps will be in
+absolute system time, not starting from zero at the beginning of a
+stream. The data type name for timestamps is stamp_t, defined as a
+signed 64-bit integer. Output devices should not send a buffer out
+until the time in the timestamp field has arrived. I would like to
+follow SGI's lead, and adopt a multimedia timestamping system like
+their UST (Unadjusted System Time). See
+http://reality.sgi.com/cpirazzi_engr/lg/time/intro.html. [This link is
+no longer valid.] UST uses timestamps that are 64-bit signed integers
+(not struct timeval's) and given in nanosecond units. The UST clock
+starts at zero when the system is booted and runs continuously and
+uniformly. It takes a little over 292 years for UST to overflow. There
+is no way to set the UST clock. The regular Linux time-of-day clock
+can be changed periodically, which would cause errors if it were being
+used for timestamping a multimedia stream. A real UST style clock will
+require some support in the kernel that is not there yet. But in
+anticipation, I will change the timestamp field to a 64-bit integer,
+and I will change the v4l2_masterclock_gettime() function (used only
+by drivers) to return a 64-bit integer.</P
+></LI
+><LI
+><P
+>A <CODE
+CLASS="STRUCTFIELD"
+>sequence</CODE
+> field was added
+to struct&nbsp;<A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+>. The <CODE
+CLASS="STRUCTFIELD"
+>sequence</CODE
+> field counts
+captured frames, it is ignored by output devices. When a capture
+driver drops a frame, the sequence number of that frame is
+skipped.</P
+></LI
+></OL
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN15575"
+>6.2.6. V4L2 Version 0.20 incremental changes</A
+></H2
+><P
+>1999-12-23: In struct&nbsp;<A
+HREF="x7013.htm#V4L2-VBI-FORMAT"
+>v4l2_vbi_format</A
+> the
+<CODE
+CLASS="STRUCTFIELD"
+>reserved1</CODE
+> field became
+<CODE
+CLASS="STRUCTFIELD"
+>offset</CODE
+>. Previously drivers were required to
+clear the <CODE
+CLASS="STRUCTFIELD"
+>reserved1</CODE
+> field.</P
+><P
+>2000-01-13: The
+      <CODE
+CLASS="CONSTANT"
+>V4L2_FMT_FLAG_NOT_INTERLACED</CODE
+> flag was added.</P
+><P
+>2000-07-31: The <TT
+CLASS="FILENAME"
+>linux/poll.h</TT
+> header
+is now included by <TT
+CLASS="FILENAME"
+>videodev.h</TT
+> for compatibility
+with the original <TT
+CLASS="FILENAME"
+>videodev.h</TT
+> file.</P
+><P
+>2000-11-20: <CODE
+CLASS="CONSTANT"
+>V4L2_TYPE_VBI_OUTPUT</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_Y41P</CODE
+> were added.</P
+><P
+>2000-11-25: <CODE
+CLASS="CONSTANT"
+>V4L2_TYPE_VBI_INPUT</CODE
+> was
+added.</P
+><P
+>2000-12-04: A couple typos in symbol names were fixed.</P
+><P
+>2001-01-18: To avoid namespace conflicts the
+<CODE
+CLASS="CONSTANT"
+>fourcc</CODE
+> macro defined in the
+<TT
+CLASS="FILENAME"
+>videodev.h</TT
+> header file was renamed to
+<CODE
+CLASS="CONSTANT"
+>v4l2_fourcc</CODE
+>.</P
+><P
+>2001-01-25: A possible driver-level compatibility problem
+between the <TT
+CLASS="FILENAME"
+>videodev.h</TT
+> file in Linux 2.4.0 and
+the <TT
+CLASS="FILENAME"
+>videodev.h</TT
+> file included in the
+<TT
+CLASS="FILENAME"
+>videodevX</TT
+> patch was fixed. Users of an earlier
+version of <TT
+CLASS="FILENAME"
+>videodevX</TT
+> on Linux 2.4.0 should
+recompile their V4L and V4L2 drivers.</P
+><P
+>2001-01-26: A possible kernel-level incompatibility
+between the <TT
+CLASS="FILENAME"
+>videodev.h</TT
+> file in the
+<TT
+CLASS="FILENAME"
+>videodevX</TT
+> patch and the
+<TT
+CLASS="FILENAME"
+>videodev.h</TT
+> file in Linux 2.2.x with devfs patches
+applied was fixed.</P
+><P
+>2001-03-02: Certain V4L ioctls which pass data in both
+direction although they are defined with read-only parameter, did not
+work correctly through the backward compatibility layer.
+[Solution?]</P
+><P
+>2001-04-13: Big endian 16-bit RGB formats were added.</P
+><P
+>2001-09-17: New YUV formats and the <A
+HREF="r11094.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FREQUENCY</CODE
+></A
+> and
+<A
+HREF="r11094.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FREQUENCY</CODE
+></A
+> ioctls were added. (The old
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FREQ</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FREQ</CODE
+> ioctls did not take multiple tuners
+into account.)</P
+><P
+>2000-09-18: <CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VBI</CODE
+> was
+added. This may <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>break compatibility</I
+></SPAN
+> as the
+<A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+></A
+> and <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctls may fail now if the struct
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_fmt</CODE
+> <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+>
+field does not contain <CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VBI</CODE
+>. In the
+documentation of the struct&nbsp;<A
+HREF="x7013.htm#V4L2-VBI-FORMAT"
+>v4l2_vbi_format</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>offset</CODE
+> field the ambiguous phrase "rising
+edge" was changed to "leading edge".</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN15628"
+>6.2.7. V4L2 Version 0.20 2000-11-23</A
+></H2
+><P
+>A number of changes were made to the raw VBI
+interface.</P
+><P
+></P
+><OL
+TYPE="1"
+><LI
+><P
+>Figures clarifying the line numbering scheme were
+added to the V4L2 API specification. The
+<CODE
+CLASS="STRUCTFIELD"
+>start</CODE
+>[0] and
+<CODE
+CLASS="STRUCTFIELD"
+>start</CODE
+>[1] fields no longer count line
+numbers beginning at zero. Rationale: a) The previous definition was
+unclear. b) The <CODE
+CLASS="STRUCTFIELD"
+>start</CODE
+>[] values are ordinal
+numbers. c) There is no point in inventing a new line numbering
+scheme. We now use line number as defined by ITU-R, period.
+Compatibility: Add one to the start values. Applications depending on
+the previous semantics may not function correctly.</P
+></LI
+><LI
+><P
+>The restriction "count[0] &gt; 0 and count[1] &gt; 0"
+has been relaxed  to "(count[0] + count[1]) &gt; 0". Rationale:
+Drivers may allocate resources at scan line granularity and some data
+services are transmitted only on the first field. The comment that
+both <CODE
+CLASS="STRUCTFIELD"
+>count</CODE
+> values will usually be equal is
+misleading and pointless and has been removed. This change
+<SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>breaks compatibility</I
+></SPAN
+> with earlier versions:
+Drivers may return EINVAL, applications may not function
+correctly.</P
+></LI
+><LI
+><P
+>Drivers are again permitted to return negative
+(unknown) start values as proposed earlier. Why this feature was
+dropped is unclear. This change may <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>break
+compatibility</I
+></SPAN
+> with applications depending on the start
+values being positive. The use of <CODE
+CLASS="CONSTANT"
+>EBUSY</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>EINVAL</CODE
+> error codes with the <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctl
+was clarified. The <SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+> error code was finally documented, and the
+<CODE
+CLASS="STRUCTFIELD"
+>reserved2</CODE
+> field which was previously
+mentioned only in the <TT
+CLASS="FILENAME"
+>videodev.h</TT
+> header
+file.</P
+></LI
+><LI
+><P
+>New buffer types
+<CODE
+CLASS="CONSTANT"
+>V4L2_TYPE_VBI_INPUT</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_TYPE_VBI_OUTPUT</CODE
+> were added. The former is an
+alias for the old <CODE
+CLASS="CONSTANT"
+>V4L2_TYPE_VBI</CODE
+>, the latter was
+missing in the <TT
+CLASS="FILENAME"
+>videodev.h</TT
+> file.</P
+></LI
+></OL
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN15657"
+>6.2.8. V4L2 Version 0.20 2002-07-25</A
+></H2
+><P
+>Added sliced VBI interface proposal.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN15660"
+>6.2.9. V4L2 in Linux 2.5.46, 2002-10</A
+></H2
+><P
+>Around October-November 2002, prior to an announced
+feature freeze of Linux 2.5, the API was revised, drawing from
+experience with V4L2 0.20. This unnamed version was finally merged
+into Linux 2.5.46.</P
+><P
+></P
+><OL
+TYPE="1"
+><LI
+><P
+>As specified in <A
+HREF="c174.htm#RELATED"
+>Section 1.1.2</A
+>, drivers
+must make related device functions available under all minor device
+numbers.</P
+></LI
+><LI
+><P
+>The <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+> function requires access mode
+<CODE
+CLASS="CONSTANT"
+>O_RDWR</CODE
+> regardless of the device type. All V4L2
+drivers exchanging data with applications must support the
+<CODE
+CLASS="CONSTANT"
+>O_NONBLOCK</CODE
+> flag. The <CODE
+CLASS="CONSTANT"
+>O_NOIO</CODE
+>
+flag, a V4L2 symbol which aliased the meaningless
+<CODE
+CLASS="CONSTANT"
+>O_TRUNC</CODE
+> to indicate accesses without data
+exchange (panel applications) was dropped. Drivers must stay in "panel
+mode" until the application attempts to initiate a data exchange, see
+<A
+HREF="c174.htm#OPEN"
+>Section 1.1</A
+>.</P
+></LI
+><LI
+><P
+>The struct&nbsp;<A
+HREF="r13105.htm#V4L2-CAPABILITY"
+>v4l2_capability</A
+> changed dramatically. Note that
+also the size of the structure changed, which is encoded in the ioctl
+request code, thus older V4L2 devices will respond with an <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code to
+the new <A
+HREF="r13105.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCAP</CODE
+></A
+> ioctl.</P
+><P
+>There are new fields to identify the driver, a new (as
+of yet unspecified) device function
+<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_RDS_CAPTURE</CODE
+>, the
+<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_AUDIO</CODE
+> flag indicates if the device has
+any audio connectors, another I/O capability
+<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_ASYNCIO</CODE
+> can be flagged. In response to
+these changes the <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field became a bit
+set and was merged into the <CODE
+CLASS="STRUCTFIELD"
+>flags</CODE
+> field.
+<CODE
+CLASS="CONSTANT"
+>V4L2_FLAG_TUNER</CODE
+> was renamed to
+<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_TUNER</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_VIDEO_OVERLAY</CODE
+> replaced
+<CODE
+CLASS="CONSTANT"
+>V4L2_FLAG_PREVIEW</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_VBI_CAPTURE</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_VBI_OUTPUT</CODE
+> replaced
+<CODE
+CLASS="CONSTANT"
+>V4L2_FLAG_DATA_SERVICE</CODE
+>.
+<CODE
+CLASS="CONSTANT"
+>V4L2_FLAG_READ</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_FLAG_WRITE</CODE
+> were merged into
+<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_READWRITE</CODE
+>.</P
+><P
+>The redundant fields
+<CODE
+CLASS="STRUCTFIELD"
+>inputs</CODE
+>, <CODE
+CLASS="STRUCTFIELD"
+>outputs</CODE
+>
+and <CODE
+CLASS="STRUCTFIELD"
+>audios</CODE
+> were removed. These properties
+can be determined as described in <A
+HREF="x309.htm"
+>Section 1.4</A
+> and <A
+HREF="x341.htm"
+>Section 1.5</A
+>.</P
+><P
+>The somewhat volatile and therefore barely useful
+fields <CODE
+CLASS="STRUCTFIELD"
+>maxwidth</CODE
+>,
+<CODE
+CLASS="STRUCTFIELD"
+>maxheight</CODE
+>,
+<CODE
+CLASS="STRUCTFIELD"
+>minwidth</CODE
+>,
+<CODE
+CLASS="STRUCTFIELD"
+>minheight</CODE
+>,
+<CODE
+CLASS="STRUCTFIELD"
+>maxframerate</CODE
+> were removed. This information
+is available as described in <A
+HREF="x1859.htm"
+>Section 1.10</A
+> and
+<A
+HREF="x448.htm"
+>Section 1.7</A
+>.</P
+><P
+><CODE
+CLASS="CONSTANT"
+>V4L2_FLAG_SELECT</CODE
+> was removed. We
+believe the select() function is important enough to require support
+of it in all V4L2 drivers exchanging data with applications. The
+redundant <CODE
+CLASS="CONSTANT"
+>V4L2_FLAG_MONOCHROME</CODE
+> flag was removed,
+this information is available as described in <A
+HREF="x1859.htm"
+>Section 1.10</A
+>.</P
+></LI
+><LI
+><P
+>In struct&nbsp;<A
+HREF="r8936.htm#V4L2-INPUT"
+>v4l2_input</A
+> the
+<CODE
+CLASS="STRUCTFIELD"
+>assoc_audio</CODE
+> field and the
+<CODE
+CLASS="STRUCTFIELD"
+>capability</CODE
+> field and its only flag
+<CODE
+CLASS="CONSTANT"
+>V4L2_INPUT_CAP_AUDIO</CODE
+> was replaced by the new
+<CODE
+CLASS="STRUCTFIELD"
+>audioset</CODE
+> field. Instead of linking one
+video input to one audio input this field reports all audio inputs
+this video input combines with.</P
+><P
+>New fields are <CODE
+CLASS="STRUCTFIELD"
+>tuner</CODE
+>
+(reversing the former link from tuners to video inputs),
+<CODE
+CLASS="STRUCTFIELD"
+>std</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>status</CODE
+>.</P
+><P
+>Accordingly struct&nbsp;<A
+HREF="r9149.htm#V4L2-OUTPUT"
+>v4l2_output</A
+> lost its
+<CODE
+CLASS="STRUCTFIELD"
+>capability</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>assoc_audio</CODE
+> fields.
+<CODE
+CLASS="STRUCTFIELD"
+>audioset</CODE
+>,
+<CODE
+CLASS="STRUCTFIELD"
+>modulator</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>std</CODE
+> where added instead.</P
+></LI
+><LI
+><P
+>The struct&nbsp;<A
+HREF="r9539.htm#V4L2-AUDIO"
+>v4l2_audio</A
+> field
+<CODE
+CLASS="STRUCTFIELD"
+>audio</CODE
+> was renamed to
+<CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+>, for consistency with other
+structures. A new capability flag
+<CODE
+CLASS="CONSTANT"
+>V4L2_AUDCAP_STEREO</CODE
+> was added to indicated if the
+audio input in question supports stereo sound.
+<CODE
+CLASS="CONSTANT"
+>V4L2_AUDCAP_EFFECTS</CODE
+> and the corresponding
+<CODE
+CLASS="CONSTANT"
+>V4L2_AUDMODE</CODE
+> flags where removed. This can be
+easily implemented using controls. (However the same applies to AVL
+which is still there.)</P
+><P
+>Again for consistency the struct&nbsp;<A
+HREF="r9688.htm#V4L2-AUDIOOUT"
+>v4l2_audioout</A
+> field
+<CODE
+CLASS="STRUCTFIELD"
+>audio</CODE
+> was renamed to
+<CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+>.</P
+></LI
+><LI
+><P
+>The struct&nbsp;<A
+HREF="r12342.htm#V4L2-TUNER"
+>v4l2_tuner</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>input</CODE
+> field was replaced by an
+<CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+> field, permitting devices with
+multiple tuners. The link between video inputs and tuners is now
+reversed, inputs point to their tuner. The
+<CODE
+CLASS="STRUCTFIELD"
+>std</CODE
+> substructure became a
+simple set (more about this below) and moved into struct&nbsp;<A
+HREF="r8936.htm#V4L2-INPUT"
+>v4l2_input</A
+>. A
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field was added.</P
+><P
+>Accordingly in struct&nbsp;<A
+HREF="r11430.htm#V4L2-MODULATOR"
+>v4l2_modulator</A
+> the
+<CODE
+CLASS="STRUCTFIELD"
+>output</CODE
+> was replaced by an
+<CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+> field.</P
+><P
+>In struct&nbsp;<A
+HREF="r11094.htm#V4L2-FREQUENCY"
+>v4l2_frequency</A
+> the
+<CODE
+CLASS="STRUCTFIELD"
+>port</CODE
+> field was replaced by a
+<CODE
+CLASS="STRUCTFIELD"
+>tuner</CODE
+> field containing the respective tuner
+or modulator index number. A tuner <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+>
+field was added and the <CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+> field
+became larger for future extensions (satellite tuners in
+particular).</P
+></LI
+><LI
+><P
+>The idea of completely transparent video standards was
+dropped. Experience showed that applications must be able to work with
+video standards beyond presenting the user a menu. Instead of
+enumerating supported standards with an ioctl applications can now
+refer to standards by <A
+HREF="r9288.htm#V4L2-STD-ID"
+>v4l2_std_id</A
+> and symbols defined in the
+<TT
+CLASS="FILENAME"
+>videodev2.h</TT
+> header file. For details see <A
+HREF="x448.htm"
+>Section 1.7</A
+>. The <A
+HREF="r12265.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_STD</CODE
+></A
+> and
+<A
+HREF="r12265.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_STD</CODE
+></A
+> now take a pointer to this type as argument.
+<A
+HREF="r13641.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYSTD</CODE
+></A
+> was added to autodetect the received standard, if
+the hardware has this capability. In struct&nbsp;<A
+HREF="r9288.htm#V4L2-STANDARD"
+>v4l2_standard</A
+> an
+<CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+> field was added for <A
+HREF="r9288.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMSTD</CODE
+></A
+>.
+A <A
+HREF="r9288.htm#V4L2-STD-ID"
+>v4l2_std_id</A
+> field named <CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+> was added as
+machine readable identifier, also replacing the
+<CODE
+CLASS="STRUCTFIELD"
+>transmission</CODE
+> field. The misleading
+<CODE
+CLASS="STRUCTFIELD"
+>framerate</CODE
+> field was renamed
+to <CODE
+CLASS="STRUCTFIELD"
+>frameperiod</CODE
+>. The now obsolete
+<CODE
+CLASS="STRUCTFIELD"
+>colorstandard</CODE
+> information, originally
+needed to distguish between variations of standards, were
+removed.</P
+><P
+>Struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_enumstd</CODE
+> ceased to
+be. <A
+HREF="r9288.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMSTD</CODE
+></A
+> now takes a pointer to a struct&nbsp;<A
+HREF="r9288.htm#V4L2-STANDARD"
+>v4l2_standard</A
+>
+directly. The information which standards are supported by a
+particular video input or output moved into struct&nbsp;<A
+HREF="r8936.htm#V4L2-INPUT"
+>v4l2_input</A
+> and
+struct&nbsp;<A
+HREF="r9149.htm#V4L2-OUTPUT"
+>v4l2_output</A
+> fields named <CODE
+CLASS="STRUCTFIELD"
+>std</CODE
+>,
+respectively.</P
+></LI
+><LI
+><P
+>The struct&nbsp;<A
+HREF="r13317.htm#V4L2-QUERYCTRL"
+>v4l2_queryctrl</A
+> fields
+<CODE
+CLASS="STRUCTFIELD"
+>category</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>group</CODE
+> did not catch on and/or were not
+implemented as expected and therefore removed.</P
+></LI
+><LI
+><P
+>The <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_TRY_FMT</CODE
+></A
+> ioctl was added to negotiate data
+formats as with <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+>, but without the overhead of
+programming the hardware and regardless of I/O in progress.</P
+><P
+>In struct&nbsp;<A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+> the <CODE
+CLASS="STRUCTFIELD"
+>fmt</CODE
+>
+union was extended to contain struct&nbsp;<A
+HREF="x6570.htm#V4L2-WINDOW"
+>v4l2_window</A
+>. All image format
+negotiations are now possible with <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_TRY_FMT</CODE
+>; ioctl. The
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_WIN</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_WIN</CODE
+> ioctls to prepare for a video
+overlay were removed. The <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field
+changed to type enum&nbsp;<A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+> and the buffer type names changed as
+follows.<DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN15815"
+></A
+><TABLE
+BORDER="1"
+CLASS="CALSTABLE"
+><COL><COL><THEAD
+><TR
+><TH
+>Old defines</TH
+><TH
+>enum&nbsp;<A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+></TH
+></TR
+></THEAD
+><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_CAPTURE</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_CAPTURE</CODE
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_CODECIN</CODE
+></TD
+><TD
+>Omitted for now</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_CODECOUT</CODE
+></TD
+><TD
+>Omitted for now</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_EFFECTSIN</CODE
+></TD
+><TD
+>Omitted for now</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_EFFECTSIN2</CODE
+></TD
+><TD
+>Omitted for now</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_EFFECTSOUT</CODE
+></TD
+><TD
+>Omitted for now</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEOOUT</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_OUTPUT</CODE
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>-</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_OVERLAY</CODE
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>-</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VBI_CAPTURE</CODE
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>-</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VBI_OUTPUT</CODE
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>-</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_SLICED_VBI_CAPTURE</CODE
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>-</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_SLICED_VBI_OUTPUT</CODE
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_PRIVATE_BASE</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_PRIVATE</CODE
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></P
+></LI
+><LI
+><P
+>In struct&nbsp;<A
+HREF="r8367.htm#V4L2-FMTDESC"
+>v4l2_fmtdesc</A
+> a enum&nbsp;<A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+> field named
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> was added as in struct&nbsp;<A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+>. The
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUM_FBUFFMT</CODE
+> ioctl is no longer needed and
+was removed. These calls can be replaced by <A
+HREF="r8367.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUM_FMT</CODE
+></A
+> with
+type <CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_OVERLAY</CODE
+>.</P
+></LI
+><LI
+><P
+>In struct&nbsp;<A
+HREF="c2030.htm#V4L2-PIX-FORMAT"
+>v4l2_pix_format</A
+> the
+<CODE
+CLASS="STRUCTFIELD"
+>depth</CODE
+> field was removed, assuming
+applications which recognize the format by its four-character-code
+already know the color depth, and others do not care about it. The
+same rationale lead to the removal of the
+<CODE
+CLASS="CONSTANT"
+>V4L2_FMT_FLAG_COMPRESSED</CODE
+> flag. The
+<CODE
+CLASS="CONSTANT"
+>V4L2_FMT_FLAG_SWCONVECOMPRESSED</CODE
+> flag was removed
+because drivers are not supposed to convert images in kernel space. A
+user library of conversion functions should be provided instead. The
+<CODE
+CLASS="CONSTANT"
+>V4L2_FMT_FLAG_BYTESPERLINE</CODE
+> flag was redundant.
+Applications can set the <CODE
+CLASS="STRUCTFIELD"
+>bytesperline</CODE
+> field
+to zero to get a reasonable default. Since the remaining flags were
+replaced as well, the <CODE
+CLASS="STRUCTFIELD"
+>flags</CODE
+> field itself
+was removed.</P
+><P
+>The interlace flags were replaced by a enum&nbsp;<A
+HREF="x6386.htm#V4L2-FIELD"
+>v4l2_field</A
+>
+value in a newly added <CODE
+CLASS="STRUCTFIELD"
+>field</CODE
+>
+field.<DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN15905"
+></A
+><TABLE
+BORDER="1"
+CLASS="CALSTABLE"
+><COL><COL><THEAD
+><TR
+><TH
+>Old flag</TH
+><TH
+>enum&nbsp;<A
+HREF="x6386.htm#V4L2-FIELD"
+>v4l2_field</A
+></TH
+></TR
+></THEAD
+><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FMT_FLAG_NOT_INTERLACED</CODE
+></TD
+><TD
+>?</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FMT_FLAG_INTERLACED</CODE
+> 
+= <CODE
+CLASS="CONSTANT"
+>V4L2_FMT_FLAG_COMBINED</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_INTERLACED</CODE
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FMT_FLAG_TOPFIELD</CODE
+>
+= <CODE
+CLASS="CONSTANT"
+>V4L2_FMT_FLAG_ODDFIELD</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_TOP</CODE
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FMT_FLAG_BOTFIELD</CODE
+>
+= <CODE
+CLASS="CONSTANT"
+>V4L2_FMT_FLAG_EVENFIELD</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_BOTTOM</CODE
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>-</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_SEQ_TB</CODE
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>-</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_SEQ_BT</CODE
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>-</CODE
+></TD
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_ALTERNATE</CODE
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></P
+><P
+>The color space flags were replaced by a
+enum&nbsp;<A
+HREF="x2123.htm#V4L2-COLORSPACE"
+>v4l2_colorspace</A
+> value in a newly added
+<CODE
+CLASS="STRUCTFIELD"
+>colorspace</CODE
+> field, where one of
+<CODE
+CLASS="CONSTANT"
+>V4L2_COLORSPACE_SMPTE170M</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_COLORSPACE_BT878</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_COLORSPACE_470_SYSTEM_M</CODE
+> or
+<CODE
+CLASS="CONSTANT"
+>V4L2_COLORSPACE_470_SYSTEM_BG</CODE
+> replaces
+<CODE
+CLASS="CONSTANT"
+>V4L2_FMT_CS_601YUV</CODE
+>.</P
+></LI
+><LI
+><P
+>In struct&nbsp;<A
+HREF="r13696.htm#V4L2-REQUESTBUFFERS"
+>v4l2_requestbuffers</A
+> the
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field was properly defined as
+enum&nbsp;<A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+>. Buffer types changed as mentioned above. A new
+<CODE
+CLASS="STRUCTFIELD"
+>memory</CODE
+> field of type enum&nbsp;<A
+HREF="x5953.htm#V4L2-MEMORY"
+>v4l2_memory</A
+> was
+added to distinguish between I/O methods using buffers allocated
+by the driver or the application. See <A
+HREF="c5742.htm"
+>Chapter 3</A
+> for
+details.</P
+></LI
+><LI
+><P
+>In struct&nbsp;<A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+> the <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+>
+field was properly defined as enum&nbsp;<A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+>. Buffer types changed as
+mentioned above. A <CODE
+CLASS="STRUCTFIELD"
+>field</CODE
+> field of type
+enum&nbsp;<A
+HREF="x6386.htm#V4L2-FIELD"
+>v4l2_field</A
+> was added to indicate if a buffer contains a top or
+bottom field. The old field flags were removed. Since no unadjusted
+system time clock was added to the kernel as planned, the
+<CODE
+CLASS="STRUCTFIELD"
+>timestamp</CODE
+> field changed back from type
+stamp_t, an unsigned 64 bit integer expressing the sample time in
+nanoseconds, to struct <CODE
+CLASS="STRUCTNAME"
+>timeval</CODE
+>. With the
+addition of a second memory mapping method the
+<CODE
+CLASS="STRUCTFIELD"
+>offset</CODE
+> field moved into union
+<CODE
+CLASS="STRUCTFIELD"
+>m</CODE
+>, and a new
+<CODE
+CLASS="STRUCTFIELD"
+>memory</CODE
+> field of type enum&nbsp;<A
+HREF="x5953.htm#V4L2-MEMORY"
+>v4l2_memory</A
+> was
+added to distinguish between I/O methods. See <A
+HREF="c5742.htm"
+>Chapter 3</A
+>
+for details.</P
+><P
+>The <CODE
+CLASS="CONSTANT"
+>V4L2_BUF_REQ_CONTIG</CODE
+>
+flag was used by the V4L compatibility layer, after changes to this
+code it was no longer needed. The
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_ATTR_DEVICEMEM</CODE
+> flag would indicate if
+the buffer was indeed allocated in device memory rather than DMA-able
+system memory. It was barely useful and so was removed.</P
+></LI
+><LI
+><P
+>In struct&nbsp;<A
+HREF="r10595.htm#V4L2-FRAMEBUFFER"
+>v4l2_framebuffer</A
+> the
+<CODE
+CLASS="STRUCTFIELD"
+>base[3]</CODE
+> array anticipating double- and
+triple-buffering in off-screen video memory, however without defining
+a synchronization mechanism, was replaced by a single pointer. The
+<CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_CAP_SCALEUP</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_CAP_SCALEDOWN</CODE
+> flags were removed.
+Applications can determine this capability more accurately using the
+new cropping and scaling interface. The
+<CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_CAP_CLIPPING</CODE
+> flag was replaced by
+<CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_CAP_LIST_CLIPPING</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_CAP_BITMAP_CLIPPING</CODE
+>.</P
+></LI
+><LI
+><P
+>In struct&nbsp;<A
+HREF="x6570.htm#V4L2-CLIP"
+>v4l2_clip</A
+> the <CODE
+CLASS="STRUCTFIELD"
+>x</CODE
+>,
+<CODE
+CLASS="STRUCTFIELD"
+>y</CODE
+>, <CODE
+CLASS="STRUCTFIELD"
+>width</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>height</CODE
+> field moved into a
+<CODE
+CLASS="STRUCTFIELD"
+>c</CODE
+> substructure of type struct&nbsp;<A
+HREF="x6570.htm#V4L2-RECT"
+>v4l2_rect</A
+>. The
+<CODE
+CLASS="STRUCTFIELD"
+>x</CODE
+> and <CODE
+CLASS="STRUCTFIELD"
+>y</CODE
+> fields
+were renamed to <CODE
+CLASS="STRUCTFIELD"
+>left</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>top</CODE
+>, i.&nbsp;e. offsets to a context dependent
+origin.</P
+></LI
+><LI
+><P
+>In struct&nbsp;<A
+HREF="x6570.htm#V4L2-WINDOW"
+>v4l2_window</A
+> the <CODE
+CLASS="STRUCTFIELD"
+>x</CODE
+>,
+<CODE
+CLASS="STRUCTFIELD"
+>y</CODE
+>, <CODE
+CLASS="STRUCTFIELD"
+>width</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>height</CODE
+> field moved into a
+<CODE
+CLASS="STRUCTFIELD"
+>w</CODE
+> substructure as above. A
+<CODE
+CLASS="STRUCTFIELD"
+>field</CODE
+> field of type %v4l2-field; was added
+to distinguish between field and frame (interlaced) overlay.</P
+></LI
+><LI
+><P
+>The digital zoom interface, including struct
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_zoomcap</CODE
+>, struct
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_zoom</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_ZOOM_NONCAP</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_ZOOM_WHILESTREAMING</CODE
+> was replaced by a new
+cropping and scaling interface. The previously unused struct
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_cropcap</CODE
+> and
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_crop</CODE
+> where redefined for this purpose.
+See <A
+HREF="x1904.htm"
+>Section 1.11</A
+> for details.</P
+></LI
+><LI
+><P
+>In struct&nbsp;<A
+HREF="x7013.htm#V4L2-VBI-FORMAT"
+>v4l2_vbi_format</A
+> the
+<CODE
+CLASS="STRUCTFIELD"
+>SAMPLE_FORMAT</CODE
+> field now contains a
+four-character-code as used to identify video image formats and
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_GREY</CODE
+> replaces the
+<CODE
+CLASS="CONSTANT"
+>V4L2_VBI_SF_UBYTE</CODE
+> define. The
+<CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+> field was extended.</P
+></LI
+><LI
+><P
+>In struct&nbsp;<A
+HREF="r11680.htm#V4L2-CAPTUREPARM"
+>v4l2_captureparm</A
+> the type of the
+<CODE
+CLASS="STRUCTFIELD"
+>timeperframe</CODE
+> field changed from unsigned
+long to struct&nbsp;<A
+HREF="r9288.htm#V4L2-FRACT"
+>v4l2_fract</A
+>. This allows the accurate expression of multiples
+of the NTSC-M frame rate 30000 / 1001. A new field
+<CODE
+CLASS="STRUCTFIELD"
+>readbuffers</CODE
+> was added to control the driver
+behaviour in read I/O mode.</P
+><P
+>Similar changes were made to struct&nbsp;<A
+HREF="r11680.htm#V4L2-OUTPUTPARM"
+>v4l2_outputparm</A
+>.</P
+></LI
+><LI
+><P
+>The struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_performance</CODE
+>
+and <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_PERF</CODE
+> ioctl were dropped. Except when
+using the <A
+HREF="c5742.htm#RW"
+>read/write I/O method</A
+>, which is
+limited anyway, this information is already available to
+applications.</P
+></LI
+><LI
+><P
+>The example transformation from RGB to YCbCr color
+space in the old V4L2 documentation was inaccurate, this has been
+corrected in <A
+HREF="c2030.htm"
+>Chapter 2</A
+>.</P
+></LI
+></OL
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN16046"
+>6.2.10. V4L2 2003-06-19</A
+></H2
+><P
+></P
+><OL
+TYPE="1"
+><LI
+><P
+>A new capability flag
+<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_RADIO</CODE
+> was added for radio devices. Prior
+to this change radio devices would identify solely by having exactly one
+tuner whose type field reads <CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_RADIO</CODE
+>.</P
+></LI
+><LI
+><P
+>An optional driver access priority mechanism was
+added, see <A
+HREF="x294.htm"
+>Section 1.3</A
+> for details.</P
+></LI
+><LI
+><P
+>The audio input and output interface was found to be
+incomplete.</P
+><P
+>Previously the <A
+HREF="r9539.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_AUDIO</CODE
+></A
+>
+ioctl would enumerate the available audio inputs. An ioctl to
+determine the current audio input, if more than one combines with the
+current video input, did not exist. So
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_AUDIO</CODE
+> was renamed to
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_AUDIO_OLD</CODE
+>, this ioctl will be removed in
+the future. The <A
+HREF="r8242.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMAUDIO</CODE
+></A
+> ioctl was added to enumerate
+audio inputs, while <A
+HREF="r9539.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_AUDIO</CODE
+></A
+> now reports the current audio
+input.</P
+><P
+>The same changes were made to <A
+HREF="r9688.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_AUDOUT</CODE
+></A
+> and
+<A
+HREF="r8304.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMAUDOUT</CODE
+></A
+>.</P
+><P
+>Until further the "videodev" module will automatically
+translate between the old and new ioctls, but drivers and applications
+must be updated to successfully compile again.</P
+></LI
+><LI
+><P
+>The <A
+HREF="r12816.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_OVERLAY</CODE
+></A
+> ioctl was incorrectly defined with
+write-read parameter. It was changed to write-only, while the write-read
+version was renamed to <CODE
+CLASS="CONSTANT"
+>VIDIOC_OVERLAY_OLD</CODE
+>. The old
+ioctl will be removed in the future. Until further the "videodev"
+kernel module will automatically translate to the new version, so drivers
+must be recompiled, but not applications.</P
+></LI
+><LI
+><P
+><A
+HREF="x6570.htm"
+>Section 4.2</A
+> incorrectly stated that
+clipping rectangles define regions where the video can be seen.
+Correct is that clipping rectangles define regions where
+<SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>no</I
+></SPAN
+> video shall be displayed and so the graphics
+surface can be seen.</P
+></LI
+><LI
+><P
+>The <A
+HREF="r11680.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_PARM</CODE
+></A
+> and <A
+HREF="r10104.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_CTRL</CODE
+></A
+> ioctls were
+defined with write-only parameter, inconsistent with other ioctls
+modifying their argument. They were changed to write-read, while a
+<CODE
+CLASS="CONSTANT"
+>_OLD</CODE
+> suffix was added to the write-only versions.
+The old ioctls will be removed in the future. Drivers and
+applications assuming a constant parameter need an update.</P
+></LI
+></OL
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN16089"
+>6.2.11. V4L2 2003-11-05</A
+></H2
+><P
+></P
+><OL
+TYPE="1"
+><LI
+><P
+>In <A
+HREF="x2490.htm"
+>Section 2.4</A
+> the following pixel
+formats were incorrectly transferred from Bill Dirks' V4L2
+specification. Descriptions below refer to bytes in memory, in
+ascending address order.<DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><A
+NAME="AEN16095"
+></A
+><TABLE
+BORDER="1"
+CLASS="CALSTABLE"
+><COL><COL><COL><THEAD
+><TR
+><TH
+>Symbol</TH
+><TH
+>In this document prior to revision
+0.5</TH
+><TH
+>Corrected</TH
+></TR
+></THEAD
+><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_RGB24</CODE
+></TD
+><TD
+>B, G, R</TD
+><TD
+>R, G, B</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_BGR24</CODE
+></TD
+><TD
+>R, G, B</TD
+><TD
+>B, G, R</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_RGB32</CODE
+></TD
+><TD
+>B, G, R, X</TD
+><TD
+>R, G, B, X</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_BGR32</CODE
+></TD
+><TD
+>R, G, B, X</TD
+><TD
+>B, G, R, X</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+> The
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_BGR24</CODE
+> example was always
+correct.</P
+><P
+>In <A
+HREF="c14595.htm#V4L-IMAGE-PROPERTIES"
+>Section 6.1.5</A
+> the mapping
+of the V4L <CODE
+CLASS="CONSTANT"
+>VIDEO_PALETTE_RGB24</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDEO_PALETTE_RGB32</CODE
+> formats to V4L2 pixel formats
+was accordingly corrected.</P
+></LI
+><LI
+><P
+>Unrelated to the fixes above, drivers may still
+interpret some V4L2 RGB pixel formats differently. These issues have
+yet to be addressed, for details see <A
+HREF="x2490.htm"
+>Section 2.4</A
+>.</P
+></LI
+></OL
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN16131"
+>6.2.12. V4L2 in Linux 2.6.6, 2004-05-09</A
+></H2
+><P
+></P
+><OL
+TYPE="1"
+><LI
+><P
+>The <A
+HREF="r7771.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_CROPCAP</CODE
+></A
+> ioctl was incorrectly defined
+with read-only parameter. It is now defined as write-read ioctl, while
+the read-only version was renamed to
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_CROPCAP_OLD</CODE
+>. The old ioctl will be removed
+in the future.</P
+></LI
+></OL
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN16139"
+>6.2.13. V4L2 in Linux 2.6.8</A
+></H2
+><P
+></P
+><OL
+TYPE="1"
+><LI
+><P
+>A new field <CODE
+CLASS="STRUCTFIELD"
+>input</CODE
+> (former
+<CODE
+CLASS="STRUCTFIELD"
+>reserved[0]</CODE
+>) was added to the struct&nbsp;<A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+>
+structure. Purpose of this field is to alternate between video inputs
+(e.&nbsp;g. cameras) in step with the video capturing process. This function
+must be enabled with the new <CODE
+CLASS="CONSTANT"
+>V4L2_BUF_FLAG_INPUT</CODE
+>
+flag. The <CODE
+CLASS="STRUCTFIELD"
+>flags</CODE
+> field is no longer
+read-only.</P
+></LI
+></OL
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN16149"
+>6.2.14. V4L2 spec erratum 2004-08-01</A
+></H2
+><P
+></P
+><OL
+TYPE="1"
+><LI
+><P
+>The return value of the
+<A
+HREF="r14090.htm"
+>V4L2 open()(2)</A
+> function was incorrectly documented.</P
+></LI
+><LI
+><P
+>Audio output ioctls end in -AUDOUT, not -AUDIOOUT.</P
+></LI
+><LI
+><P
+>In the Current Audio Input example the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_AUDIO</CODE
+> ioctl took the wrong
+argument.</P
+></LI
+><LI
+><P
+>The documentation of the <A
+HREF="r12878.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QBUF</CODE
+></A
+> and
+<A
+HREF="r12878.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_DQBUF</CODE
+></A
+> ioctls did not mention the struct&nbsp;<A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>memory</CODE
+> field. It was also missing from
+examples. Also on the <CODE
+CLASS="CONSTANT"
+>VIDIOC_DQBUF</CODE
+> page the <SPAN
+CLASS="ERRORCODE"
+>EIO</SPAN
+> error code
+was not documented.</P
+></LI
+></OL
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN16170"
+>6.2.15. V4L2 in Linux 2.6.14</A
+></H2
+><P
+></P
+><OL
+TYPE="1"
+><LI
+><P
+>A new sliced VBI interface was added. It is documented
+in <A
+HREF="x7236.htm"
+>Section 4.8</A
+> and replaces the interface first
+proposed in V4L2 specification 0.8.</P
+></LI
+></OL
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN16176"
+>6.2.16. V4L2 in Linux 2.6.15</A
+></H2
+><P
+></P
+><OL
+TYPE="1"
+><LI
+><P
+>The <A
+HREF="r12784.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_LOG_STATUS</CODE
+></A
+> ioctl was added.</P
+></LI
+><LI
+><P
+>New video standards
+<CODE
+CLASS="CONSTANT"
+>V4L2_STD_NTSC_443</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_STD_SECAM_LC</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_STD_SECAM_DK</CODE
+> (a set of SECAM D, K and K1),
+and <CODE
+CLASS="CONSTANT"
+>V4L2_STD_ATSC</CODE
+> (a set of
+<CODE
+CLASS="CONSTANT"
+>V4L2_STD_ATSC_8_VSB</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_STD_ATSC_16_VSB</CODE
+>) were defined. Note the
+<CODE
+CLASS="CONSTANT"
+>V4L2_STD_525_60</CODE
+> set now includes
+<CODE
+CLASS="CONSTANT"
+>V4L2_STD_NTSC_443</CODE
+>. See also <A
+HREF="r9288.htm#V4L2-STD-ID"
+>Table 3</A
+>.</P
+></LI
+><LI
+><P
+>The <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_COMP</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_COMP</CODE
+> ioctl were renamed to
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_MPEGCOMP</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_MPEGCOMP</CODE
+> respectively. Their argument
+was replaced by a struct
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_mpeg_compression</CODE
+> pointer. (The
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_MPEGCOMP</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_MPEGCOMP</CODE
+> ioctls where removed in Linux
+2.6.25.)</P
+></LI
+></OL
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN16203"
+>6.2.17. V4L2 spec erratum 2005-11-27</A
+></H2
+><P
+>The capture example in <A
+HREF="a16706.htm"
+>Appendix B</A
+>
+called the <A
+HREF="r9994.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_CROP</CODE
+></A
+> ioctl without checking if cropping is
+supported. In the video standard selection example in
+<A
+HREF="x448.htm"
+>Section 1.7</A
+> the <A
+HREF="r12265.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_STD</CODE
+></A
+> call used the wrong
+argument type.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN16212"
+>6.2.18. V4L2 spec erratum 2006-01-10</A
+></H2
+><P
+></P
+><OL
+TYPE="1"
+><LI
+><P
+>The <CODE
+CLASS="CONSTANT"
+>V4L2_IN_ST_COLOR_KILL</CODE
+> flag in
+struct&nbsp;<A
+HREF="r8936.htm#V4L2-INPUT"
+>v4l2_input</A
+> not only indicates if the color killer is enabled, but
+also if it is active. (The color killer disables color decoding when
+it detects no color in the video signal to improve the image
+quality.)</P
+></LI
+><LI
+><P
+><A
+HREF="r11680.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_PARM</CODE
+></A
+> is a write-read ioctl, not write-only as
+stated on its reference page. The ioctl changed in 2003 as noted above.</P
+></LI
+></OL
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN16223"
+>6.2.19. V4L2 spec erratum 2006-02-03</A
+></H2
+><P
+></P
+><OL
+TYPE="1"
+><LI
+><P
+>In struct&nbsp;<A
+HREF="r11680.htm#V4L2-CAPTUREPARM"
+>v4l2_captureparm</A
+> and struct&nbsp;<A
+HREF="r11680.htm#V4L2-OUTPUTPARM"
+>v4l2_outputparm</A
+> the
+<CODE
+CLASS="STRUCTFIELD"
+>timeperframe</CODE
+> field gives the time in
+seconds, not microseconds.</P
+></LI
+></OL
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN16231"
+>6.2.20. V4L2 spec erratum 2006-02-04</A
+></H2
+><P
+></P
+><OL
+TYPE="1"
+><LI
+><P
+>The <CODE
+CLASS="STRUCTFIELD"
+>clips</CODE
+> field in
+struct&nbsp;<A
+HREF="x6570.htm#V4L2-WINDOW"
+>v4l2_window</A
+> must point to an array of struct&nbsp;<A
+HREF="x6570.htm#V4L2-CLIP"
+>v4l2_clip</A
+>, not a linked
+list, because drivers ignore the struct
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_clip</CODE
+>.<CODE
+CLASS="STRUCTFIELD"
+>next</CODE
+>
+pointer.</P
+></LI
+></OL
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN16241"
+>6.2.21. V4L2 in Linux 2.6.17</A
+></H2
+><P
+></P
+><OL
+TYPE="1"
+><LI
+><P
+>New video standard macros were added:
+<CODE
+CLASS="CONSTANT"
+>V4L2_STD_NTSC_M_KR</CODE
+> (NTSC M South Korea), and the
+sets <CODE
+CLASS="CONSTANT"
+>V4L2_STD_MN</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_STD_B</CODE
+>, <CODE
+CLASS="CONSTANT"
+>V4L2_STD_GH</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_STD_DK</CODE
+>. The
+<CODE
+CLASS="CONSTANT"
+>V4L2_STD_NTSC</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_STD_SECAM</CODE
+> sets now include
+<CODE
+CLASS="CONSTANT"
+>V4L2_STD_NTSC_M_KR</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_STD_SECAM_LC</CODE
+> respectively.</P
+></LI
+><LI
+><P
+>A new <CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_MODE_LANG1_LANG2</CODE
+>
+was defined to record both languages of a bilingual program. The
+use of <CODE
+CLASS="CONSTANT"
+>V4L2_TUNER_MODE_STEREO</CODE
+> for this purpose
+is deprecated now. See the <A
+HREF="r12342.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_TUNER</CODE
+></A
+> section for
+details.</P
+></LI
+></OL
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN16261"
+>6.2.22. V4L2 spec erratum 2006-09-23 (Draft 0.15)</A
+></H2
+><P
+></P
+><OL
+TYPE="1"
+><LI
+><P
+>In various places
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_SLICED_VBI_CAPTURE</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_SLICED_VBI_OUTPUT</CODE
+> of the sliced VBI
+interface were not mentioned along with other buffer types.</P
+></LI
+><LI
+><P
+>In <A
+HREF="r9539.htm"
+>ioctl VIDIOC_G_AUDIO, VIDIOC_S_AUDIO(2)</A
+> it was clarified
+that the struct&nbsp;<A
+HREF="r9539.htm#V4L2-AUDIO"
+>v4l2_audio</A
+> <CODE
+CLASS="STRUCTFIELD"
+>mode</CODE
+> field is a flags
+field.</P
+></LI
+><LI
+><P
+><A
+HREF="r13105.htm"
+>ioctl VIDIOC_QUERYCAP(2)</A
+> did not mention the
+sliced VBI and radio capability flags.</P
+></LI
+><LI
+><P
+>In <A
+HREF="r11094.htm"
+>ioctl VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY(2)</A
+> it was
+clarified that applications must initialize the tuner
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field of struct&nbsp;<A
+HREF="r11094.htm#V4L2-FREQUENCY"
+>v4l2_frequency</A
+> before
+calling <A
+HREF="r11094.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FREQUENCY</CODE
+></A
+>.</P
+></LI
+><LI
+><P
+>The <CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+> array
+in struct&nbsp;<A
+HREF="r13696.htm#V4L2-REQUESTBUFFERS"
+>v4l2_requestbuffers</A
+> has 2 elements, not 32.</P
+></LI
+><LI
+><P
+>In <A
+HREF="x6831.htm"
+>Section 4.3</A
+> and <A
+HREF="x7013.htm"
+>Section 4.7</A
+> the device file names
+<TT
+CLASS="FILENAME"
+>/dev/vout</TT
+> which never caught on were replaced
+by <TT
+CLASS="FILENAME"
+>/dev/video</TT
+>.</P
+></LI
+><LI
+><P
+>With Linux 2.6.15 the possible range for VBI device minor
+numbers was extended from 224-239 to 224-255. Accordingly device file names
+<TT
+CLASS="FILENAME"
+>/dev/vbi0</TT
+> to <TT
+CLASS="FILENAME"
+>/dev/vbi31</TT
+> are
+possible now.</P
+></LI
+></OL
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN16297"
+>6.2.23. V4L2 in Linux 2.6.18</A
+></H2
+><P
+></P
+><OL
+TYPE="1"
+><LI
+><P
+>New ioctls <A
+HREF="r10386.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_EXT_CTRLS</CODE
+></A
+>, <A
+HREF="r10386.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_EXT_CTRLS</CODE
+></A
+>
+and <A
+HREF="r10386.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_TRY_EXT_CTRLS</CODE
+></A
+> were added, a flag to skip unsupported
+controls with <A
+HREF="r13317.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCTRL</CODE
+></A
+>, new control types
+<CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_TYPE_INTEGER64</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_TYPE_CTRL_CLASS</CODE
+> (<A
+HREF="r13317.htm#V4L2-CTRL-TYPE"
+>Table 3</A
+>), and new control flags
+<CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_FLAG_READ_ONLY</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_FLAG_UPDATE</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_FLAG_INACTIVE</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_FLAG_SLIDER</CODE
+> (<A
+HREF="r13317.htm#CONTROL-FLAGS"
+>Table 4</A
+>). See <A
+HREF="x802.htm"
+>Section 1.9</A
+> for details.</P
+></LI
+></OL
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN16319"
+>6.2.24. V4L2 in Linux 2.6.19</A
+></H2
+><P
+></P
+><OL
+TYPE="1"
+><LI
+><P
+>In struct&nbsp;<A
+HREF="r12051.htm#V4L2-SLICED-VBI-CAP"
+>v4l2_sliced_vbi_cap</A
+> a buffer type field was added
+replacing a reserved field. Note on architectures where the size of
+enum types differs from int types the size of the structure changed.
+The <A
+HREF="r12051.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_SLICED_VBI_CAP</CODE
+></A
+> ioctl was redefined from being read-only
+to write-read. Applications must initialize the type field and clear
+the reserved fields now. These changes may <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>break the
+compatibility</I
+></SPAN
+> with older drivers and applications.</P
+></LI
+><LI
+><P
+>The ioctls <A
+HREF="r8494.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUM_FRAMESIZES</CODE
+></A
+> and
+<A
+HREF="r8724.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUM_FRAMEINTERVALS</CODE
+></A
+> were added.</P
+></LI
+><LI
+><P
+>A new pixel format <CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_RGB444</CODE
+> (<A
+HREF="r2492.htm#RGB-FORMATS"
+>Table 2-1</A
+>) was added.</P
+></LI
+></OL
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN16338"
+>6.2.25. V4L2 spec erratum 2006-10-12 (Draft 0.17)</A
+></H2
+><P
+></P
+><OL
+TYPE="1"
+><LI
+><P
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_HM12</CODE
+> (<A
+HREF="x5665.htm#RESERVED-FORMATS"
+>Table 2-8</A
+>) is a YUV 4:2:0, not 4:2:2 format.</P
+></LI
+></OL
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN16345"
+>6.2.26. V4L2 in Linux 2.6.21</A
+></H2
+><P
+></P
+><OL
+TYPE="1"
+><LI
+><P
+>The <TT
+CLASS="FILENAME"
+>videodev2.h</TT
+> header file is
+now dual licensed under GNU General Public License version two or
+later, and under a 3-clause BSD-style license.</P
+></LI
+></OL
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN16351"
+>6.2.27. V4L2 in Linux 2.6.22</A
+></H2
+><P
+></P
+><OL
+TYPE="1"
+><LI
+><P
+>Two new field orders
+          <CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_INTERLACED_TB</CODE
+> and
+          <CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_INTERLACED_BT</CODE
+> were
+          added. See <A
+HREF="x6386.htm#V4L2-FIELD"
+>Table 3-8</A
+> for details.</P
+></LI
+><LI
+><P
+>Three new clipping/blending methods with a global or
+straight or inverted local alpha value were added to the video overlay
+interface. See the description of the <A
+HREF="r10595.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FBUF</CODE
+></A
+> and
+<A
+HREF="r10595.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FBUF</CODE
+></A
+> ioctls for details.</P
+><P
+>A new <CODE
+CLASS="STRUCTFIELD"
+>global_alpha</CODE
+> field
+was added to <A
+HREF="x6570.htm#V4L2-WINDOW"
+><CODE
+CLASS="STRUCTNAME"
+>v4l2_window</CODE
+></A
+>,
+extending the structure. This may <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>break
+compatibility</I
+></SPAN
+> with applications using a struct
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_window</CODE
+> directly. However the <A
+HREF="r10944.htm"
+>VIDIOC_G/S/TRY_FMT</A
+> ioctls, which take a
+pointer to a <A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+> parent
+structure with padding bytes at the end, are not affected.</P
+></LI
+><LI
+><P
+>The format of the <CODE
+CLASS="STRUCTFIELD"
+>chromakey</CODE
+>
+field in struct&nbsp;<A
+HREF="x6570.htm#V4L2-WINDOW"
+>v4l2_window</A
+> changed from "host order RGB32" to a pixel
+value in the same format as the framebuffer. This may <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>break
+compatibility</I
+></SPAN
+> with existing applications. Drivers
+supporting the "host order RGB32" format are not known.</P
+></LI
+></OL
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN16378"
+>6.2.28. V4L2 in Linux 2.6.24</A
+></H2
+><P
+></P
+><OL
+TYPE="1"
+><LI
+><P
+>The pixel formats
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_PAL8</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUV444</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUV555</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUV565</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUV32</CODE
+> were added.</P
+></LI
+></OL
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN16388"
+>6.2.29. V4L2 in Linux 2.6.25</A
+></H2
+><P
+></P
+><OL
+TYPE="1"
+><LI
+><P
+>The pixel formats <A
+HREF="r4246.htm"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_Y16</CODE
+></A
+> and <A
+HREF="r3796.htm"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_SBGGR16</CODE
+></A
+> were added.</P
+></LI
+><LI
+><P
+>New <A
+HREF="x542.htm"
+>controls</A
+>
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_POWER_LINE_FREQUENCY</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_HUE_AUTO</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_WHITE_BALANCE_TEMPERATURE</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_SHARPNESS</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_BACKLIGHT_COMPENSATION</CODE
+> were added. The
+controls <CODE
+CLASS="CONSTANT"
+>V4L2_CID_BLACK_LEVEL</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_WHITENESS</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_HCENTER</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_VCENTER</CODE
+> were deprecated.</P
+></LI
+><LI
+><P
+>A <A
+HREF="x802.htm#CAMERA-CONTROLS"
+>Camera controls
+class</A
+> was added, with the new controls
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_EXPOSURE_AUTO</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_EXPOSURE_ABSOLUTE</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_EXPOSURE_AUTO_PRIORITY</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_PAN_RELATIVE</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_TILT_RELATIVE</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_PAN_RESET</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_TILT_RESET</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_PAN_ABSOLUTE</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_TILT_ABSOLUTE</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_FOCUS_ABSOLUTE</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_FOCUS_RELATIVE</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_FOCUS_AUTO</CODE
+>.</P
+></LI
+><LI
+><P
+>The <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_MPEGCOMP</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_MPEGCOMP</CODE
+> ioctls, which were superseded
+by the <A
+HREF="x802.htm"
+>extended controls</A
+>
+interface in Linux 2.6.18, where finally removed from the
+<TT
+CLASS="FILENAME"
+>videodev2.h</TT
+> header file.</P
+></LI
+></OL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="c14595.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x16430.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Changes</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c14595.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Relation of V4L2 to other Linux multimedia APIs</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16430.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16430.htm
new file mode 100644
index 0000000..b5bb812
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16430.htm
@@ -0,0 +1,270 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Relation of V4L2 to other Linux multimedia APIs</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Changes"
+HREF="c14595.htm"><LINK
+REL="PREVIOUS"
+TITLE="Changes of the V4L2 API"
+HREF="x15446.htm"><LINK
+REL="NEXT"
+TITLE="Experimental API Elements"
+HREF="x16453.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x15446.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 6. Changes</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x16453.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="OTHER"
+>6.3. Relation of V4L2 to other Linux multimedia APIs</A
+></H1
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="XVIDEO"
+>6.3.1. X Video Extension</A
+></H2
+><P
+>The X Video Extension (abbreviated XVideo or just Xv) is
+an extension of the X Window system, implemented for example by the
+XFree86 project. Its scope is similar to V4L2, an API to video capture
+and output devices for X clients. Xv allows applications to display
+live video in a window, send window contents to a TV output, and
+capture or output still images in XPixmaps<A
+NAME="AEN16435"
+HREF="x16430.htm#FTN.AEN16435"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+>. With their implementation XFree86 makes the
+extension available across many operating systems and
+architectures.</P
+><P
+>Because the driver is embedded into the X server Xv has a
+number of advantages over the V4L2 <A
+HREF="x6570.htm"
+>video
+overlay interface</A
+>. The driver can easily determine the overlay
+target, i.&nbsp;e. visible graphics memory or off-screen buffers for a
+destructive overlay. It can program the RAMDAC for a non-destructive
+overlay, scaling or color-keying, or the clipping functions of the
+video capture hardware, always in sync with drawing operations or
+windows moving or changing their stacking order.</P
+><P
+>To combine the advantages of Xv and V4L a special Xv
+driver exists in XFree86 and XOrg, just programming any overlay capable
+Video4Linux device it finds. To enable it
+<TT
+CLASS="FILENAME"
+>/etc/X11/XF86Config</TT
+> must contain these lines:</P
+><P
+><PRE
+CLASS="SCREEN"
+>Section "Module"
+    Load "v4l"
+EndSection</PRE
+></P
+><P
+>As of XFree86 4.2 this driver still supports only V4L
+ioctls, however it should work just fine with all V4L2 devices through
+the V4L2 backward-compatibility layer. Since V4L2 permits multiple
+opens it is possible (if supported by the V4L2 driver) to capture
+video while an X client requested video overlay. Restrictions of
+simultaneous capturing and overlay are discussed in <A
+HREF="x6570.htm"
+>Section 4.2</A
+> apply.</P
+><P
+>Only marginally related to V4L2, XFree86 extended Xv to
+support hardware YUV to RGB conversion and scaling for faster video
+playback, and added an interface to MPEG-2 decoding hardware. This API
+is useful to display images captured with V4L2 devices.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN16446"
+>6.3.2. Digital Video</A
+></H2
+><P
+>V4L2 does not support digital terrestrial, cable or
+satellite broadcast. A separate project aiming at digital receivers
+exists. You can find its homepage at <A
+HREF="http://linuxtv.org"
+TARGET="_top"
+>http://linuxtv.org</A
+>. The Linux DVB API
+has no connection to the V4L2 API except that drivers for hybrid
+hardware may support both.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN16450"
+>6.3.3. Audio Interfaces</A
+></H2
+><P
+>[to do - OSS/ALSA]</P
+></DIV
+></DIV
+><H3
+CLASS="FOOTNOTES"
+>Notes</H3
+><TABLE
+BORDER="0"
+CLASS="FOOTNOTES"
+WIDTH="100%"
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="5%"
+><A
+NAME="FTN.AEN16435"
+HREF="x16430.htm#AEN16435"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="95%"
+><P
+>This is not implemented in XFree86.</P
+></TD
+></TR
+></TABLE
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x15446.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x16453.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Changes of the V4L2 API</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c14595.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Experimental API Elements</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16453.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16453.htm
new file mode 100644
index 0000000..7376795
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16453.htm
@@ -0,0 +1,260 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Experimental API Elements</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Changes"
+HREF="c14595.htm"><LINK
+REL="PREVIOUS"
+TITLE="Relation of V4L2 to other Linux multimedia APIs"
+HREF="x16430.htm"><LINK
+REL="NEXT"
+TITLE="Obsolete API Elements"
+HREF="x16497.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x16430.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 6. Changes</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x16497.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="EXPERIMENTAL"
+>6.4. Experimental API Elements</A
+></H1
+><P
+>The following V4L2 API elements are currently experimental
+and may change in the future.</P
+><P
+></P
+><UL
+><LI
+><P
+>Video Output Overlay (OSD) Interface, <A
+HREF="x6909.htm"
+>Section 4.4</A
+>.</P
+></LI
+><LI
+><P
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY</CODE
+>,
+        enum&nbsp;<A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+>, <A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>Table 3-2</A
+>.</P
+></LI
+><LI
+><P
+><CODE
+CLASS="CONSTANT"
+>V4L2_CAP_VIDEO_OUTPUT_OVERLAY</CODE
+>,
+<A
+HREF="r13105.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCAP</CODE
+></A
+> ioctl, <A
+HREF="r13105.htm#DEVICE-CAPABILITIES"
+>Table 2</A
+>.</P
+></LI
+><LI
+><P
+><A
+HREF="r8494.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUM_FRAMESIZES</CODE
+></A
+> and
+<A
+HREF="r8724.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUM_FRAMEINTERVALS</CODE
+></A
+> ioctls.</P
+></LI
+><LI
+><P
+><A
+HREF="r10211.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_ENC_INDEX</CODE
+></A
+> ioctl.</P
+></LI
+><LI
+><P
+><A
+HREF="r8087.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENCODER_CMD</CODE
+></A
+> and <A
+HREF="r8087.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_TRY_ENCODER_CMD</CODE
+></A
+>
+ioctls.</P
+></LI
+><LI
+><P
+><A
+HREF="r7900.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_DBG_G_REGISTER</CODE
+></A
+> and <A
+HREF="r7900.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_DBG_S_REGISTER</CODE
+></A
+>
+ioctls.</P
+></LI
+><LI
+><P
+><A
+HREF="r9804.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_CHIP_IDENT</CODE
+></A
+> ioctl.</P
+></LI
+></UL
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x16430.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x16497.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Relation of V4L2 to other Linux multimedia APIs</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c14595.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Obsolete API Elements</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16497.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16497.htm
new file mode 100644
index 0000000..7716e6c
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16497.htm
@@ -0,0 +1,166 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Obsolete API Elements</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Changes"
+HREF="c14595.htm"><LINK
+REL="PREVIOUS"
+TITLE="Experimental API Elements"
+HREF="x16453.htm"><LINK
+REL="NEXT"
+TITLE="Video For Linux Two Header File"
+HREF="a16506.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x16453.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 6. Changes</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="a16506.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="OBSOLETE"
+>6.5. Obsolete API Elements</A
+></H1
+><P
+>The following V4L2 API elements were superseded by new
+interfaces and should not be implemented in new drivers.</P
+><P
+></P
+><UL
+><LI
+><P
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_MPEGCOMP</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_MPEGCOMP</CODE
+> ioctls. Use Extended Controls,
+<A
+HREF="x802.htm"
+>Section 1.9</A
+>.</P
+></LI
+></UL
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x16453.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="a16506.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Experimental API Elements</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c14595.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Video For Linux Two Header File</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16743.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16743.htm
new file mode 100644
index 0000000..66d7a55
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16743.htm
@@ -0,0 +1,267 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>1. APPLICABILITY AND DEFINITIONS</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="GNU Free Documentation License"
+HREF="a16721.htm"><LINK
+REL="PREVIOUS"
+TITLE="GNU Free Documentation License"
+HREF="a16721.htm"><LINK
+REL="NEXT"
+TITLE="2. VERBATIM COPYING"
+HREF="x16769.htm"></HEAD
+><BODY
+CLASS="SECT1"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="a16721.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Appendix C. GNU Free Documentation License</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x16769.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="FDL-SECTION1"
+>C.2. 1. APPLICABILITY AND DEFINITIONS</A
+></H1
+><P
+>      This License applies to any manual or other work that contains a
+      notice placed by the copyright holder saying it can be
+      distributed under the terms of this License. The
+      <SPAN
+CLASS="QUOTE"
+>"Document"</SPAN
+>, below, refers to any such manual or
+      work. Any member of the public is a licensee, and is addressed
+      as <SPAN
+CLASS="QUOTE"
+>"you"</SPAN
+>.
+    </P
+><P
+>      A <SPAN
+CLASS="QUOTE"
+>"Modified Version"</SPAN
+> of the Document means any work
+      containing the Document or a portion of it, either copied
+      verbatim, or with modifications and/or translated into another
+      language.
+    </P
+><P
+>      A <SPAN
+CLASS="QUOTE"
+>"Secondary Section"</SPAN
+> is a named appendix or a
+      front-matter section of the <A
+HREF="x16743.htm#FDL-DOCUMENT"
+>Document</A
+> that deals exclusively
+      with the relationship of the publishers or authors of the
+      Document to the Document's overall subject (or to related
+      matters) and contains nothing that could fall directly within
+      that overall subject. (For example, if the Document is in part a
+      textbook of mathematics, a Secondary Section may not explain any
+      mathematics.)  The relationship could be a matter of historical
+      connection with the subject or with related matters, or of
+      legal, commercial, philosophical, ethical or political position
+      regarding them.
+    </P
+><P
+>      The <SPAN
+CLASS="QUOTE"
+>"Invariant Sections"</SPAN
+> are certain <A
+HREF="x16743.htm#FDL-SECONDARY"
+> Secondary Sections</A
+> whose titles
+      are designated, as being those of Invariant Sections, in the
+      notice that says that the <A
+HREF="x16743.htm#FDL-DOCUMENT"
+>Document</A
+> is released under this
+      License.
+    </P
+><P
+>      The <SPAN
+CLASS="QUOTE"
+>"Cover Texts"</SPAN
+> are certain short passages of
+      text that are listed, as Front-Cover Texts or Back-Cover Texts,
+      in the notice that says that the <A
+HREF="x16743.htm#FDL-DOCUMENT"
+>Document</A
+> is released under this
+      License.
+    </P
+><P
+>      A <SPAN
+CLASS="QUOTE"
+>"Transparent"</SPAN
+> copy of the <A
+HREF="x16743.htm#FDL-DOCUMENT"
+> Document</A
+> means a machine-readable
+      copy, represented in a format whose specification is available
+      to the general public, whose contents can be viewed and edited
+      directly and straightforwardly with generic text editors or (for
+      images composed of pixels) generic paint programs or (for
+      drawings) some widely available drawing editor, and that is
+      suitable for input to text formatters or for automatic
+      translation to a variety of formats suitable for input to text
+      formatters. A copy made in an otherwise Transparent file format
+      whose markup has been designed to thwart or discourage
+      subsequent modification by readers is not Transparent.  A copy
+      that is not <SPAN
+CLASS="QUOTE"
+>"Transparent"</SPAN
+> is called
+      <SPAN
+CLASS="QUOTE"
+>"Opaque"</SPAN
+>.
+    </P
+><P
+>      Examples of suitable formats for Transparent copies include
+      plain ASCII without markup, Texinfo input format, LaTeX input
+      format, SGML or XML using a publicly available DTD, and
+      standard-conforming simple HTML designed for human
+      modification. Opaque formats include PostScript, PDF,
+      proprietary formats that can be read and edited only by
+      proprietary word processors, SGML or XML for which the DTD
+      and/or processing tools are not generally available, and the
+      machine-generated HTML produced by some word processors for
+      output purposes only.
+    </P
+><P
+>      The <SPAN
+CLASS="QUOTE"
+>"Title Page"</SPAN
+> means, for a printed book, the
+      title page itself, plus such following pages as are needed to
+      hold, legibly, the material this License requires to appear in
+      the title page. For works in formats which do not have any title
+      page as such, <SPAN
+CLASS="QUOTE"
+>"Title Page"</SPAN
+> means the text near the
+      most prominent appearance of the work's title, preceding the
+      beginning of the body of the text.
+    </P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="a16721.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x16769.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>GNU Free Documentation License</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="a16721.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>2. VERBATIM COPYING</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16769.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16769.htm
new file mode 100644
index 0000000..d2852bd
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16769.htm
@@ -0,0 +1,166 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>2. VERBATIM COPYING</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="GNU Free Documentation License"
+HREF="a16721.htm"><LINK
+REL="PREVIOUS"
+TITLE="1. APPLICABILITY AND DEFINITIONS"
+HREF="x16743.htm"><LINK
+REL="NEXT"
+TITLE="3. COPYING IN QUANTITY"
+HREF="x16775.htm"></HEAD
+><BODY
+CLASS="SECT1"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x16743.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Appendix C. GNU Free Documentation License</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x16775.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="FDL-SECTION2"
+>C.3. 2. VERBATIM COPYING</A
+></H1
+><P
+>      You may copy and distribute the <A
+HREF="x16743.htm#FDL-DOCUMENT"
+>Document</A
+> in any medium, either
+      commercially or noncommercially, provided that this License, the
+      copyright notices, and the license notice saying this License
+      applies to the Document are reproduced in all copies, and that
+      you add no other conditions whatsoever to those of this
+      License. You may not use technical measures to obstruct or
+      control the reading or further copying of the copies you make or
+      distribute. However, you may accept compensation in exchange for
+      copies. If you distribute a large enough number of copies you
+      must also follow the conditions in <A
+HREF="x16775.htm"
+>section 3</A
+>.
+    </P
+><P
+>      You may also lend copies, under the same conditions stated
+      above, and you may publicly display copies.
+    </P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x16743.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x16775.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>1. APPLICABILITY AND DEFINITIONS</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="a16721.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>3. COPYING IN QUANTITY</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16775.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16775.htm
new file mode 100644
index 0000000..ed7c8c0
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16775.htm
@@ -0,0 +1,208 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>3. COPYING IN QUANTITY</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="GNU Free Documentation License"
+HREF="a16721.htm"><LINK
+REL="PREVIOUS"
+TITLE="2. VERBATIM COPYING"
+HREF="x16769.htm"><LINK
+REL="NEXT"
+TITLE="4. MODIFICATIONS"
+HREF="x16788.htm"></HEAD
+><BODY
+CLASS="SECT1"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x16769.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Appendix C. GNU Free Documentation License</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x16788.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="FDL-SECTION3"
+>C.4. 3. COPYING IN QUANTITY</A
+></H1
+><P
+>      If you publish printed copies of the <A
+HREF="x16743.htm#FDL-DOCUMENT"
+>Document</A
+> numbering more than 100,
+      and the Document's license notice requires <A
+HREF="x16743.htm#FDL-COVER-TEXTS"
+>Cover Texts</A
+>, you must enclose
+      the copies in covers that carry, clearly and legibly, all these
+      Cover Texts: Front-Cover Texts on the front cover, and
+      Back-Cover Texts on the back cover. Both covers must also
+      clearly and legibly identify you as the publisher of these
+      copies. The front cover must present the full title with all
+      words of the title equally prominent and visible. You may add
+      other material on the covers in addition. Copying with changes
+      limited to the covers, as long as they preserve the title of the
+      <A
+HREF="x16743.htm#FDL-DOCUMENT"
+>Document</A
+> and satisfy these
+      conditions, can be treated as verbatim copying in other
+      respects.
+    </P
+><P
+>      If the required texts for either cover are too voluminous to fit
+      legibly, you should put the first ones listed (as many as fit
+      reasonably) on the actual cover, and continue the rest onto
+      adjacent pages.
+    </P
+><P
+>      If you publish or distribute <A
+HREF="x16743.htm#FDL-TRANSPARENT"
+>Opaque</A
+> copies of the <A
+HREF="x16743.htm#FDL-DOCUMENT"
+>Document</A
+> numbering more than 100,
+      you must either include a machine-readable <A
+HREF="x16743.htm#FDL-TRANSPARENT"
+>Transparent</A
+> copy along with
+      each Opaque copy, or state in or with each Opaque copy a
+      publicly-accessible computer-network location containing a
+      complete Transparent copy of the Document, free of added
+      material, which the general network-using public has access to
+      download anonymously at no charge using public-standard network
+      protocols. If you use the latter option, you must take
+      reasonably prudent steps, when you begin distribution of Opaque
+      copies in quantity, to ensure that this Transparent copy will
+      remain thus accessible at the stated location until at least one
+      year after the last time you distribute an Opaque copy (directly
+      or through your agents or retailers) of that edition to the
+      public.
+    </P
+><P
+>      It is requested, but not required, that you contact the authors
+      of the <A
+HREF="x16743.htm#FDL-DOCUMENT"
+>Document</A
+> well before
+      redistributing any large number of copies, to give them a chance
+      to provide you with an updated version of the Document.
+    </P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x16769.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x16788.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>2. VERBATIM COPYING</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="a16721.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>4. MODIFICATIONS</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16788.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16788.htm
new file mode 100644
index 0000000..8bd2a69
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16788.htm
@@ -0,0 +1,530 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>4. MODIFICATIONS</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="GNU Free Documentation License"
+HREF="a16721.htm"><LINK
+REL="PREVIOUS"
+TITLE="3. COPYING IN QUANTITY"
+HREF="x16775.htm"><LINK
+REL="NEXT"
+TITLE="5. COMBINING DOCUMENTS"
+HREF="x16896.htm"></HEAD
+><BODY
+CLASS="SECT1"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x16775.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Appendix C. GNU Free Documentation License</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x16896.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="FDL-SECTION4"
+>C.5. 4. MODIFICATIONS</A
+></H1
+><P
+>      You may copy and distribute a <A
+HREF="x16743.htm#FDL-MODIFIED"
+>Modified Version</A
+> of the <A
+HREF="x16743.htm#FDL-DOCUMENT"
+>Document</A
+> under the conditions of
+      sections <A
+HREF="x16769.htm"
+>2</A
+> and <A
+HREF="x16775.htm"
+>3</A
+> above, provided that you release
+      the Modified Version under precisely this License, with the
+      Modified Version filling the role of the Document, thus
+      licensing distribution and modification of the Modified Version
+      to whoever possesses a copy of it. In addition, you must do
+      these things in the Modified Version:
+    </P
+><P
+></P
+><UL
+><LI
+STYLE="list-style-type: opencircle"
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>A. </B
+>            Use in the <A
+HREF="x16743.htm#FDL-TITLE-PAGE"
+>Title
+            Page</A
+> (and on the covers, if any) a title distinct
+            from that of the <A
+HREF="x16743.htm#FDL-DOCUMENT"
+>Document</A
+>, and from those of
+            previous versions (which should, if there were any, be
+            listed in the History section of the Document). You may
+            use the same title as a previous version if the original
+            publisher of that version gives permission.
+          </P
+></DIV
+></LI
+><LI
+STYLE="list-style-type: opencircle"
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>B. </B
+>            List on the <A
+HREF="x16743.htm#FDL-TITLE-PAGE"
+>Title
+            Page</A
+>, as authors, one or more persons or entities
+            responsible for authorship of the modifications in the
+            <A
+HREF="x16743.htm#FDL-MODIFIED"
+>Modified Version</A
+>,
+            together with at least five of the principal authors of
+            the <A
+HREF="x16743.htm#FDL-DOCUMENT"
+>Document</A
+> (all of
+            its principal authors, if it has less than five).
+          </P
+></DIV
+></LI
+><LI
+STYLE="list-style-type: opencircle"
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>C. </B
+>            State on the <A
+HREF="x16743.htm#FDL-TITLE-PAGE"
+>Title
+            Page</A
+> the name of the publisher of the <A
+HREF="x16743.htm#FDL-MODIFIED"
+>Modified Version</A
+>, as the
+            publisher.
+          </P
+></DIV
+></LI
+><LI
+STYLE="list-style-type: opencircle"
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>D. </B
+>            Preserve all the copyright notices of the <A
+HREF="x16743.htm#FDL-DOCUMENT"
+>Document</A
+>.
+          </P
+></DIV
+></LI
+><LI
+STYLE="list-style-type: opencircle"
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>E. </B
+>            Add an appropriate copyright notice for your modifications
+            adjacent to the other copyright notices.
+          </P
+></DIV
+></LI
+><LI
+STYLE="list-style-type: opencircle"
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>F. </B
+>            Include, immediately after the copyright notices, a
+            license notice giving the public permission to use the
+            <A
+HREF="x16743.htm#FDL-MODIFIED"
+>Modified Version</A
+> under
+            the terms of this License, in the form shown in the
+            Addendum below.
+          </P
+></DIV
+></LI
+><LI
+STYLE="list-style-type: opencircle"
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>G. </B
+>            Preserve in that license notice the full lists of <A
+HREF="x16743.htm#FDL-INVARIANT"
+> Invariant Sections</A
+> and
+            required <A
+HREF="x16743.htm#FDL-COVER-TEXTS"
+>Cover
+            Texts</A
+> given in the <A
+HREF="x16743.htm#FDL-DOCUMENT"
+>Document's</A
+> license notice.
+          </P
+></DIV
+></LI
+><LI
+STYLE="list-style-type: opencircle"
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>H. </B
+>            Include an unaltered copy of this License.
+          </P
+></DIV
+></LI
+><LI
+STYLE="list-style-type: opencircle"
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>I. </B
+>            Preserve the section entitled <SPAN
+CLASS="QUOTE"
+>"History"</SPAN
+>, and
+            its title, and add to it an item stating at least the
+            title, year, new authors, and publisher of the <A
+HREF="x16743.htm#FDL-MODIFIED"
+>Modified Version </A
+>as given on
+            the <A
+HREF="x16743.htm#FDL-TITLE-PAGE"
+>Title Page</A
+>.  If
+            there is no section entitled <SPAN
+CLASS="QUOTE"
+>"History"</SPAN
+> in the
+            <A
+HREF="x16743.htm#FDL-DOCUMENT"
+>Document</A
+>, create one
+            stating the title, year, authors, and publisher of the
+            Document as given on its Title Page, then add an item
+            describing the Modified Version as stated in the previous
+            sentence.
+          </P
+></DIV
+></LI
+><LI
+STYLE="list-style-type: opencircle"
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>J. </B
+>            Preserve the network location, if any, given in the <A
+HREF="x16743.htm#FDL-DOCUMENT"
+>Document</A
+> for public access
+            to a <A
+HREF="x16743.htm#FDL-TRANSPARENT"
+>Transparent</A
+>
+            copy of the Document, and likewise the network locations
+            given in the Document for previous versions it was based
+            on. These may be placed in the <SPAN
+CLASS="QUOTE"
+>"History"</SPAN
+>
+            section.  You may omit a network location for a work that
+            was published at least four years before the Document
+            itself, or if the original publisher of the version it
+            refers to gives permission.
+          </P
+></DIV
+></LI
+><LI
+STYLE="list-style-type: opencircle"
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>K. </B
+>            In any section entitled <SPAN
+CLASS="QUOTE"
+>"Acknowledgements"</SPAN
+> or
+            <SPAN
+CLASS="QUOTE"
+>"Dedications"</SPAN
+>, preserve the section's title,
+            and preserve in the section all the substance and tone of
+            each of the contributor acknowledgements and/or
+            dedications given therein.
+          </P
+></DIV
+></LI
+><LI
+STYLE="list-style-type: opencircle"
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>L. </B
+>            Preserve all the <A
+HREF="x16743.htm#FDL-INVARIANT"
+>Invariant
+            Sections</A
+> of the <A
+HREF="x16743.htm#FDL-DOCUMENT"
+>Document</A
+>, unaltered in their
+            text and in their titles.  Section numbers or the
+            equivalent are not considered part of the section titles.
+          </P
+></DIV
+></LI
+><LI
+STYLE="list-style-type: opencircle"
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>M. </B
+>            Delete any section entitled
+            <SPAN
+CLASS="QUOTE"
+>"Endorsements"</SPAN
+>. Such a section may not be
+            included in the <A
+HREF="x16743.htm#FDL-MODIFIED"
+>Modified
+            Version</A
+>.
+          </P
+></DIV
+></LI
+><LI
+STYLE="list-style-type: opencircle"
+><DIV
+CLASS="FORMALPARA"
+><P
+><B
+>N. </B
+>            Do not retitle any existing section as
+            <SPAN
+CLASS="QUOTE"
+>"Endorsements"</SPAN
+> or to conflict in title with
+            any <A
+HREF="x16743.htm#FDL-INVARIANT"
+>Invariant
+            Section</A
+>.
+          </P
+></DIV
+></LI
+></UL
+><P
+>      If the <A
+HREF="x16743.htm#FDL-MODIFIED"
+>Modified Version</A
+>
+      includes new front-matter sections or appendices that qualify as
+      <A
+HREF="x16743.htm#FDL-SECONDARY"
+>Secondary Sections</A
+> and
+      contain no material copied from the Document, you may at your
+      option designate some or all of these sections as invariant. To
+      do this, add their titles to the list of <A
+HREF="x16743.htm#FDL-INVARIANT"
+>Invariant Sections</A
+> in the
+      Modified Version's license notice.  These titles must be
+      distinct from any other section titles.
+    </P
+><P
+>      You may add a section entitled <SPAN
+CLASS="QUOTE"
+>"Endorsements"</SPAN
+>,
+      provided it contains nothing but endorsements of your <A
+HREF="x16743.htm#FDL-MODIFIED"
+>Modified Version</A
+> by various
+      parties--for example, statements of peer review or that the text
+      has been approved by an organization as the authoritative
+      definition of a standard.
+    </P
+><P
+>      You may add a passage of up to five words as a <A
+HREF="x16743.htm#FDL-COVER-TEXTS"
+>Front-Cover Text</A
+>, and a passage
+      of up to 25 words as a <A
+HREF="x16743.htm#FDL-COVER-TEXTS"
+>Back-Cover Text</A
+>, to the end of
+      the list of <A
+HREF="x16743.htm#FDL-COVER-TEXTS"
+>Cover Texts</A
+>
+      in the <A
+HREF="x16743.htm#FDL-MODIFIED"
+>Modified Version</A
+>.
+      Only one passage of Front-Cover Text and one of Back-Cover Text
+      may be added by (or through arrangements made by) any one
+      entity. If the <A
+HREF="x16743.htm#FDL-DOCUMENT"
+>Document</A
+>
+      already includes a cover text for the same cover, previously
+      added by you or by arrangement made by the same entity you are
+      acting on behalf of, you may not add another; but you may
+      replace the old one, on explicit permission from the previous
+      publisher that added the old one.
+    </P
+><P
+>      The author(s) and publisher(s) of the <A
+HREF="x16743.htm#FDL-DOCUMENT"
+>Document</A
+> do not by this License
+      give permission to use their names for publicity for or to
+      assert or imply endorsement of any <A
+HREF="x16743.htm#FDL-MODIFIED"
+>Modified Version </A
+>.
+    </P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x16775.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x16896.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>3. COPYING IN QUANTITY</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="a16721.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>5. COMBINING DOCUMENTS</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16896.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16896.htm
new file mode 100644
index 0000000..25b6542
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16896.htm
@@ -0,0 +1,201 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>5. COMBINING DOCUMENTS</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="GNU Free Documentation License"
+HREF="a16721.htm"><LINK
+REL="PREVIOUS"
+TITLE="4. MODIFICATIONS"
+HREF="x16788.htm"><LINK
+REL="NEXT"
+TITLE="6. COLLECTIONS OF DOCUMENTS"
+HREF="x16910.htm"></HEAD
+><BODY
+CLASS="SECT1"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x16788.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Appendix C. GNU Free Documentation License</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x16910.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="FDL-SECTION5"
+>C.6. 5. COMBINING DOCUMENTS</A
+></H1
+><P
+>      You may combine the <A
+HREF="x16743.htm#FDL-DOCUMENT"
+>Document</A
+>
+      with other documents released under this License, under the
+      terms defined in <A
+HREF="x16788.htm"
+>section 4</A
+>
+      above for modified versions, provided that you include in the
+      combination all of the <A
+HREF="x16743.htm#FDL-INVARIANT"
+>Invariant
+      Sections</A
+> of all of the original documents, unmodified,
+      and list them all as Invariant Sections of your combined work in
+      its license notice.
+    </P
+><P
+>      The combined work need only contain one copy of this License,
+      and multiple identical <A
+HREF="x16743.htm#FDL-INVARIANT"
+>Invariant
+      Sections</A
+> may be replaced with a single copy. If there are
+      multiple Invariant Sections with the same name but different
+      contents, make the title of each such section unique by adding
+      at the end of it, in parentheses, the name of the original
+      author or publisher of that section if known, or else a unique
+      number. Make the same adjustment to the section titles in the
+      list of Invariant Sections in the license notice of the combined
+      work.
+    </P
+><P
+>      In the combination, you must combine any sections entitled
+      <SPAN
+CLASS="QUOTE"
+>"History"</SPAN
+> in the various original documents,
+      forming one section entitled <SPAN
+CLASS="QUOTE"
+>"History"</SPAN
+>; likewise
+      combine any sections entitled <SPAN
+CLASS="QUOTE"
+>"Acknowledgements"</SPAN
+>,
+      and any sections entitled <SPAN
+CLASS="QUOTE"
+>"Dedications"</SPAN
+>.  You must
+      delete all sections entitled <SPAN
+CLASS="QUOTE"
+>"Endorsements."</SPAN
+>
+    </P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x16788.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x16910.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>4. MODIFICATIONS</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="a16721.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>6. COLLECTIONS OF DOCUMENTS</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16910.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16910.htm
new file mode 100644
index 0000000..3ae1775
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16910.htm
@@ -0,0 +1,162 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>6. COLLECTIONS OF DOCUMENTS</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="GNU Free Documentation License"
+HREF="a16721.htm"><LINK
+REL="PREVIOUS"
+TITLE="5. COMBINING DOCUMENTS"
+HREF="x16896.htm"><LINK
+REL="NEXT"
+TITLE="7. AGGREGATION WITH INDEPENDENT WORKS"
+HREF="x16915.htm"></HEAD
+><BODY
+CLASS="SECT1"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x16896.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Appendix C. GNU Free Documentation License</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x16915.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="FDL-SECTION6"
+>C.7. 6. COLLECTIONS OF DOCUMENTS</A
+></H1
+><P
+>      You may make a collection consisting of the <A
+HREF="x16743.htm#FDL-DOCUMENT"
+>Document</A
+> and other documents
+      released under this License, and replace the individual copies
+      of this License in the various documents with a single copy that
+      is included in the collection, provided that you follow the
+      rules of this License for verbatim copying of each of the
+      documents in all other respects.
+    </P
+><P
+>      You may extract a single document from such a collection, and
+      dispbibute it individually under this License, provided you
+      insert a copy of this License into the extracted document, and
+      follow this License in all other respects regarding verbatim
+      copying of that document.
+    </P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x16896.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x16915.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>5. COMBINING DOCUMENTS</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="a16721.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>7. AGGREGATION WITH INDEPENDENT WORKS</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16915.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16915.htm
new file mode 100644
index 0000000..a5591c3
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16915.htm
@@ -0,0 +1,176 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>7. AGGREGATION WITH INDEPENDENT WORKS</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="GNU Free Documentation License"
+HREF="a16721.htm"><LINK
+REL="PREVIOUS"
+TITLE="6. COLLECTIONS OF DOCUMENTS"
+HREF="x16910.htm"><LINK
+REL="NEXT"
+TITLE="8. TRANSLATION"
+HREF="x16923.htm"></HEAD
+><BODY
+CLASS="SECT1"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x16910.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Appendix C. GNU Free Documentation License</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x16923.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="FDL-SECTION7"
+>C.8. 7. AGGREGATION WITH INDEPENDENT WORKS</A
+></H1
+><P
+>      A compilation of the <A
+HREF="x16743.htm#FDL-DOCUMENT"
+>Document</A
+> or its derivatives with
+      other separate and independent documents or works, in or on a
+      volume of a storage or distribution medium, does not as a whole
+      count as a <A
+HREF="x16743.htm#FDL-MODIFIED"
+>Modified Version</A
+>
+      of the Document, provided no compilation copyright is claimed
+      for the compilation.  Such a compilation is called an
+      <SPAN
+CLASS="QUOTE"
+>"aggregate"</SPAN
+>, and this License does not apply to the
+      other self-contained works thus compiled with the Document , on
+      account of their being thus compiled, if they are not themselves
+      derivative works of the Document.  If the <A
+HREF="x16743.htm#FDL-COVER-TEXTS"
+>Cover Text</A
+> requirement of <A
+HREF="x16775.htm"
+>section 3</A
+> is applicable to these
+      copies of the Document, then if the Document is less than one
+      quarter of the entire aggregate, the Document's Cover Texts may
+      be placed on covers that surround only the Document within the
+      aggregate. Otherwise they must appear on covers around the whole
+      aggregate.
+    </P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x16910.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x16923.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>6. COLLECTIONS OF DOCUMENTS</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="a16721.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>8. TRANSLATION</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16923.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16923.htm
new file mode 100644
index 0000000..841699c
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16923.htm
@@ -0,0 +1,165 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>8. TRANSLATION</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="GNU Free Documentation License"
+HREF="a16721.htm"><LINK
+REL="PREVIOUS"
+TITLE="7. AGGREGATION WITH INDEPENDENT WORKS"
+HREF="x16915.htm"><LINK
+REL="NEXT"
+TITLE="9. TERMINATION"
+HREF="x16929.htm"></HEAD
+><BODY
+CLASS="SECT1"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x16915.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Appendix C. GNU Free Documentation License</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x16929.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="FDL-SECTION8"
+>C.9. 8. TRANSLATION</A
+></H1
+><P
+>      Translation is considered a kind of modification, so you may
+      distribute translations of the <A
+HREF="x16743.htm#FDL-DOCUMENT"
+>Document</A
+> under the terms of <A
+HREF="x16788.htm"
+>section 4</A
+>. Replacing <A
+HREF="x16743.htm#FDL-INVARIANT"
+> Invariant Sections</A
+> with
+      translations requires special permission from their copyright
+      holders, but you may include translations of some or all
+      Invariant Sections in addition to the original versions of these
+      Invariant Sections. You may include a translation of this
+      License provided that you also include the original English
+      version of this License. In case of a disagreement between the
+      translation and the original English version of this License,
+      the original English version will prevail.
+    </P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x16915.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x16929.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>7. AGGREGATION WITH INDEPENDENT WORKS</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="a16721.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>9. TERMINATION</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16929.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16929.htm
new file mode 100644
index 0000000..6840f94
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16929.htm
@@ -0,0 +1,156 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>9. TERMINATION</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="GNU Free Documentation License"
+HREF="a16721.htm"><LINK
+REL="PREVIOUS"
+TITLE="8. TRANSLATION"
+HREF="x16923.htm"><LINK
+REL="NEXT"
+TITLE="10. FUTURE REVISIONS OF THIS LICENSE"
+HREF="x16933.htm"></HEAD
+><BODY
+CLASS="SECT1"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x16923.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Appendix C. GNU Free Documentation License</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x16933.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="FDL-SECTION9"
+>C.10. 9. TERMINATION</A
+></H1
+><P
+>      You may not copy, modify, sublicense, or distribute the <A
+HREF="x16743.htm#FDL-DOCUMENT"
+>Document</A
+> except as expressly
+      provided for under this License. Any other attempt to copy,
+      modify, sublicense or distribute the Document is void, and will
+      automatically terminate your rights under this License. However,
+      parties who have received copies, or rights, from you under this
+      License will not have their licenses terminated so long as such
+      parties remain in full compliance.
+    </P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x16923.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x16933.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>8. TRANSLATION</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="a16721.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>10. FUTURE REVISIONS OF THIS LICENSE</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16933.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16933.htm
new file mode 100644
index 0000000..6f6c042
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16933.htm
@@ -0,0 +1,177 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>10. FUTURE REVISIONS OF THIS LICENSE</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="GNU Free Documentation License"
+HREF="a16721.htm"><LINK
+REL="PREVIOUS"
+TITLE="9. TERMINATION"
+HREF="x16929.htm"><LINK
+REL="NEXT"
+TITLE="Addendum"
+HREF="x16941.htm"></HEAD
+><BODY
+CLASS="SECT1"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x16929.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Appendix C. GNU Free Documentation License</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x16941.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="FDL-SECTION10"
+>C.11. 10. FUTURE REVISIONS OF THIS LICENSE</A
+></H1
+><P
+>      The <A
+HREF="http://www.gnu.org/fsf/fsf.html"
+TARGET="_top"
+>Free Software
+      Foundation</A
+> may publish new, revised versions of the GNU
+      Free Documentation License from time to time. Such new versions
+      will be similar in spirit to the present version, but may differ
+      in detail to address new problems or concerns. See <A
+HREF="http://www.gnu.org/copyleft"
+TARGET="_top"
+>http://www.gnu.org/copyleft/</A
+>.
+    </P
+><P
+>      Each version of the License is given a distinguishing version
+      number. If the <A
+HREF="x16743.htm#FDL-DOCUMENT"
+>Document</A
+>
+      specifies that a particular numbered version of this License
+      <SPAN
+CLASS="QUOTE"
+>"or any later version"</SPAN
+> applies to it, you have the
+      option of following the terms and conditions either of that
+      specified version or of any later version that has been
+      published (not as a draft) by the Free Software Foundation. If
+      the Document does not specify a version number of this License,
+      you may choose any version ever published (not as a draft) by
+      the Free Software Foundation.
+    </P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x16929.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x16941.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>9. TERMINATION</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="a16721.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Addendum</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16941.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16941.htm
new file mode 100644
index 0000000..9c0f2f3
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x16941.htm
@@ -0,0 +1,217 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Addendum</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="GNU Free Documentation License"
+HREF="a16721.htm"><LINK
+REL="PREVIOUS"
+TITLE="10. FUTURE REVISIONS OF THIS LICENSE"
+HREF="x16933.htm"><LINK
+REL="NEXT"
+TITLE="List of Types"
+HREF="i16960.htm"></HEAD
+><BODY
+CLASS="SECT1"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x16933.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Appendix C. GNU Free Documentation License</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="i16960.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="FDL-USING"
+>C.12. Addendum</A
+></H1
+><P
+>      To use this License in a document you have written, include a copy of
+      the License in the document and put the following copyright and
+      license notices just after the title page:
+    </P
+><A
+NAME="AEN16944"
+></A
+><BLOCKQUOTE
+CLASS="BLOCKQUOTE"
+><P
+>        Copyright &copy; YEAR YOUR NAME.
+      </P
+><P
+>        Permission is granted to copy, distribute and/or modify this
+        document under the terms of the GNU Free Documentation
+        License, Version 1.1 or any later version published by the
+        Free Software Foundation; with the <A
+HREF="x16743.htm#FDL-INVARIANT"
+>Invariant Sections</A
+> being LIST
+        THEIR TITLES, with the <A
+HREF="x16743.htm#FDL-COVER-TEXTS"
+>Front-Cover Texts</A
+> being LIST,
+        and with the <A
+HREF="x16743.htm#FDL-COVER-TEXTS"
+>Back-Cover
+        Texts</A
+> being LIST.  A copy of the license is included in
+        the section entitled <SPAN
+CLASS="QUOTE"
+>"GNU Free Documentation
+        License"</SPAN
+>.
+      </P
+></BLOCKQUOTE
+><P
+>      If you have no <A
+HREF="x16743.htm#FDL-INVARIANT"
+>Invariant
+      Sections</A
+>, write <SPAN
+CLASS="QUOTE"
+>"with no Invariant Sections"</SPAN
+>
+      instead of saying which ones are invariant.  If you have no
+      <A
+HREF="x16743.htm#FDL-COVER-TEXTS"
+>Front-Cover Texts</A
+>, write
+      <SPAN
+CLASS="QUOTE"
+>"no Front-Cover Texts"</SPAN
+> instead of
+      <SPAN
+CLASS="QUOTE"
+>"Front-Cover Texts being LIST"</SPAN
+>; likewise for <A
+HREF="x16743.htm#FDL-COVER-TEXTS"
+>Back-Cover Texts</A
+>.
+    </P
+><P
+>      If your document contains nontrivial examples of program code,
+      we recommend releasing these examples in parallel under your
+      choice of free software license, such as the <A
+HREF="http://www.gnu.org/copyleft/gpl.html"
+TARGET="_top"
+> GNU General Public
+      License</A
+>, to permit their use in free software.
+    </P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x16933.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="i16960.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>10. FUTURE REVISIONS OF THIS LICENSE</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="a16721.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>List of Types</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x1859.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x1859.htm
new file mode 100644
index 0000000..751ff3a
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x1859.htm
@@ -0,0 +1,365 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Data Formats</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Common API Elements"
+HREF="c174.htm"><LINK
+REL="PREVIOUS"
+TITLE="Extended Controls"
+HREF="x802.htm"><LINK
+REL="NEXT"
+TITLE="Image Cropping, Insertion and Scaling"
+HREF="x1904.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x802.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 1. Common API Elements</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x1904.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="FORMAT"
+>1.10. Data Formats</A
+></H1
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN1861"
+>1.10.1. Data Format Negotiation</A
+></H2
+><P
+>Different devices exchange different kinds of data with
+applications, for example video images, raw or sliced VBI data, RDS
+datagrams. Even within one kind many different formats are possible,
+in particular an abundance of image formats. Although drivers must
+provide a default and the selection persists across closing and
+reopening a device, applications should always negotiate a data format
+before engaging in data exchange. Negotiation means the application
+asks for a particular format and the driver selects and reports the
+best the hardware can do to satisfy the request. Of course
+applications can also just query the current selection.</P
+><P
+>A single mechanism exists to negotiate all data formats
+using the aggregate struct&nbsp;<A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+> and the <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+></A
+> and
+<A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctls. Additionally the <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_TRY_FMT</CODE
+></A
+> ioctl can be
+used to examine what the hardware <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>could</I
+></SPAN
+> do,
+without actually selecting a new data format. The data formats
+supported by the V4L2 API are covered in the respective device section
+in <A
+HREF="c6488.htm"
+>Chapter 4</A
+>. For a closer look at image formats see
+<A
+HREF="c2030.htm"
+>Chapter 2</A
+>.</P
+><P
+>The <CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+> ioctl is a major
+turning-point in the initialization sequence. Prior to this point
+multiple panel applications can access the same device concurrently to
+select the current input, change controls or modify other properties.
+The first <CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+> assigns a logical stream
+(video data, VBI data etc.) exclusively to one file descriptor.</P
+><P
+>Exclusive means no other application, more precisely no
+other file descriptor, can grab this stream or change device
+properties inconsistent with the negotiated parameters. A video
+standard change for example, when the new standard uses a different
+number of scan lines, can invalidate the selected image format.
+Therefore only the file descriptor owning the stream can make
+invalidating changes. Accordingly multiple file descriptors which
+grabbed different logical streams prevent each other from interfering
+with their settings. When for example video overlay is about to start
+or already in progress, simultaneous video capturing may be restricted
+to the same cropping and image size.</P
+><P
+>When applications omit the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+> ioctl its locking side effects are
+implied by the next step, the selection of an I/O method with the
+<A
+HREF="r13696.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_REQBUFS</CODE
+></A
+> ioctl or implicit with the first <A
+HREF="r14264.htm"
+><CODE
+CLASS="FUNCTION"
+>read()</CODE
+></A
+> or
+<A
+HREF="r14496.htm"
+><CODE
+CLASS="FUNCTION"
+>write()</CODE
+></A
+> call.</P
+><P
+>Generally only one logical stream can be assigned to a
+file descriptor, the exception being drivers permitting simultaneous
+video capturing and overlay using the same file descriptor for
+compatibility with V4L and earlier versions of V4L2. Switching the
+logical stream or returning into "panel mode" is possible by closing
+and reopening the device. Drivers <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>may</I
+></SPAN
+> support a
+switch using <CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+>.</P
+><P
+>All drivers exchanging data with
+applications must support the <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+> ioctl. Implementation of the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_TRY_FMT</CODE
+> is highly recommended but
+optional.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN1894"
+>1.10.2. Image Format Enumeration</A
+></H2
+><P
+>Apart of the generic format negotiation functions
+a special ioctl to enumerate all image formats supported by video
+capture, overlay or output devices is available.<A
+NAME="AEN1897"
+HREF="x1859.htm#FTN.AEN1897"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+></P
+><P
+>The <A
+HREF="r8367.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUM_FMT</CODE
+></A
+> ioctl must be supported
+by all drivers exchanging image data with applications.</P
+><DIV
+CLASS="IMPORTANT"
+><BLOCKQUOTE
+CLASS="IMPORTANT"
+><P
+><B
+>Important: </B
+>Drivers are not supposed to convert image formats in
+kernel space. They must enumerate only formats directly supported by
+the hardware. If necessary driver writers should publish an example
+conversion routine or library for integration into applications.</P
+></BLOCKQUOTE
+></DIV
+></DIV
+></DIV
+><H3
+CLASS="FOOTNOTES"
+>Notes</H3
+><TABLE
+BORDER="0"
+CLASS="FOOTNOTES"
+WIDTH="100%"
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="5%"
+><A
+NAME="FTN.AEN1897"
+HREF="x1859.htm#AEN1897"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="95%"
+><P
+>Enumerating formats an application has no a-priori
+knowledge of (otherwise it could explicitely ask for them and need not
+enumerate) seems useless, but there are applications serving as proxy
+between drivers and the actual video applications for which this is
+useful.</P
+></TD
+></TR
+></TABLE
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x802.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x1904.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Extended Controls</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c174.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Image Cropping, Insertion and Scaling</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x1904.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x1904.htm
new file mode 100644
index 0000000..9a3af7f
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x1904.htm
@@ -0,0 +1,674 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Image Cropping, Insertion and Scaling</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Common API Elements"
+HREF="c174.htm"><LINK
+REL="PREVIOUS"
+TITLE="Data Formats"
+HREF="x1859.htm"><LINK
+REL="NEXT"
+TITLE="Streaming Parameters"
+HREF="x2009.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x1859.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 1. Common API Elements</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x2009.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="CROP"
+>1.11. Image Cropping, Insertion and Scaling</A
+></H1
+><P
+>Some video capture devices can sample a subsection of the
+picture and shrink or enlarge it to an image of arbitrary size. We
+call these abilities cropping and scaling. Some video output devices
+can scale an image up or down and insert it at an arbitrary scan line
+and horizontal offset into a video signal.</P
+><P
+>Applications can use the following API to select an area in
+the video signal, query the default area and the hardware limits.
+<SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>Despite their name, the <A
+HREF="r7771.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_CROPCAP</CODE
+></A
+>, <A
+HREF="r9994.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_CROP</CODE
+></A
+>
+and <A
+HREF="r9994.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_CROP</CODE
+></A
+> ioctls apply to input as well as output
+devices.</I
+></SPAN
+></P
+><P
+>Scaling requires a source and a target. On a video capture
+or overlay device the source is the video signal, and the cropping
+ioctls determine the area actually sampled. The target are images
+read by the application or overlaid onto the graphics screen. Their
+size (and position for an overlay) is negotiated with the
+<A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+></A
+> and <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctls.</P
+><P
+>On a video output device the source are the images passed in
+by the application, and their size is again negotiated with the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G/S_FMT</CODE
+> ioctls, or may be encoded in a
+compressed video stream. The target is the video signal, and the
+cropping ioctls determine the area where the images are
+inserted.</P
+><P
+>Source and target rectangles are defined even if the device
+does not support scaling or the <CODE
+CLASS="CONSTANT"
+>VIDIOC_G/S_CROP</CODE
+>
+ioctls. Their size (and position where applicable) will be fixed in
+this case. <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>All capture and output device must support the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_CROPCAP</CODE
+> ioctl such that applications can
+determine if scaling takes place.</I
+></SPAN
+></P
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN1926"
+>1.11.1. Cropping Structures</A
+></H2
+><DIV
+CLASS="FIGURE"
+><A
+NAME="CROP-SCALE"
+></A
+><P
+><B
+>Figure 1-1. Image Cropping, Insertion and Scaling</B
+></P
+><DIV
+CLASS="MEDIAOBJECT"
+><P
+><IMG
+SRC="crop.gif"></P
+></DIV
+></DIV
+><P
+>For capture devices the coordinates of the top left
+corner, width and height of the area which can be sampled is given by
+the <CODE
+CLASS="STRUCTFIELD"
+>bounds</CODE
+> substructure of the
+struct&nbsp;<A
+HREF="r7771.htm#V4L2-CROPCAP"
+>v4l2_cropcap</A
+> returned by the <CODE
+CLASS="CONSTANT"
+>VIDIOC_CROPCAP</CODE
+>
+ioctl. To support a wide range of hardware this specification does not
+define an origin or units. However by convention drivers should
+horizontally count unscaled samples relative to 0H (the leading edge
+of the horizontal sync pulse, see <A
+HREF="x7013.htm#VBI-HSYNC"
+>Figure 4-1</A
+>).
+Vertically ITU-R line
+numbers of the first field (<A
+HREF="x7013.htm#VBI-525"
+>Figure 4-2</A
+>, <A
+HREF="x7013.htm#VBI-625"
+>Figure 4-3</A
+>), multiplied by two if the driver can capture both
+fields.</P
+><P
+>The top left corner, width and height of the source
+rectangle, that is the area actually sampled, is given by struct&nbsp;<A
+HREF="r9994.htm#V4L2-CROP"
+>v4l2_crop</A
+>
+using the same coordinate system as struct&nbsp;<A
+HREF="r7771.htm#V4L2-CROPCAP"
+>v4l2_cropcap</A
+>. Applications can
+use the <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_CROP</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_CROP</CODE
+> ioctls to get and set this
+rectangle. It must lie completely within the capture boundaries and
+the driver may further adjust the requested size and/or position
+according to hardware limitations.</P
+><P
+>Each capture device has a default source rectangle, given
+by the <CODE
+CLASS="STRUCTFIELD"
+>defrect</CODE
+> substructure of
+struct&nbsp;<A
+HREF="r7771.htm#V4L2-CROPCAP"
+>v4l2_cropcap</A
+>. The center of this rectangle shall align with the
+center of the active picture area of the video signal, and cover what
+the driver writer considers the complete picture. Drivers shall reset
+the source rectangle to the default when the driver is first loaded,
+but not later.</P
+><P
+>For output devices these structures and ioctls are used
+accordingly, defining the <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>target</I
+></SPAN
+> rectangle where
+the images will be inserted into the video signal.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN1954"
+>1.11.2. Scaling Adjustments</A
+></H2
+><P
+>Video hardware can have various cropping, insertion and
+scaling limitations. It may only scale up or down, support only
+discrete scaling factors, or have different scaling abilities in
+horizontal and vertical direction. Also it may not support scaling at
+all. At the same time the struct&nbsp;<A
+HREF="r9994.htm#V4L2-CROP"
+>v4l2_crop</A
+> rectangle may have to be
+aligned, and both the source and target rectangles may have arbitrary
+upper and lower size limits. In particular the maximum
+<CODE
+CLASS="STRUCTFIELD"
+>width</CODE
+> and <CODE
+CLASS="STRUCTFIELD"
+>height</CODE
+>
+in struct&nbsp;<A
+HREF="r9994.htm#V4L2-CROP"
+>v4l2_crop</A
+> may be smaller than the
+struct&nbsp;<A
+HREF="r7771.htm#V4L2-CROPCAP"
+>v4l2_cropcap</A
+>.<CODE
+CLASS="STRUCTFIELD"
+>bounds</CODE
+> area. Therefore, as
+usual, drivers are expected to adjust the requested parameters and
+return the actual values selected.</P
+><P
+>Applications can change the source or the target rectangle
+first, as they may prefer a particular image size or a certain area in
+the video signal. If the driver has to adjust both to satisfy hardware
+limitations, the last requested rectangle shall take priority, and the
+driver should preferably adjust the opposite one. The <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_TRY_FMT</CODE
+></A
+>
+ioctl however shall not change the driver state and therefore only
+adjust the requested rectangle.</P
+><P
+>Suppose scaling on a video capture device is restricted to
+a factor 1:1 or 2:1 in either direction and the target image size must
+be a multiple of 16&nbsp;&times;&nbsp;16 pixels. The source cropping
+rectangle is set to defaults, which are also the upper limit in this
+example, of 640&nbsp;&times;&nbsp;400 pixels at offset 0,&nbsp;0. An
+application requests an image size of 300&nbsp;&times;&nbsp;225
+pixels, assuming video will be scaled down from the "full picture"
+accordingly. The driver sets the image size to the closest possible
+values 304&nbsp;&times;&nbsp;224, then chooses the cropping rectangle
+closest to the requested size, that is 608&nbsp;&times;&nbsp;224
+(224&nbsp;&times;&nbsp;2:1 would exceed the limit 400). The offset
+0,&nbsp;0 is still valid, thus unmodified. Given the default cropping
+rectangle reported by <CODE
+CLASS="CONSTANT"
+>VIDIOC_CROPCAP</CODE
+> the
+application can easily propose another offset to center the cropping
+rectangle.</P
+><P
+>Now the application may insist on covering an area using a
+picture aspect ratio closer to the original request, so it asks for a
+cropping rectangle of 608&nbsp;&times;&nbsp;456 pixels. The present
+scaling factors limit cropping to 640&nbsp;&times;&nbsp;384, so the
+driver returns the cropping size 608&nbsp;&times;&nbsp;384 and adjusts
+the image size to closest possible 304&nbsp;&times;&nbsp;192.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN1969"
+>1.11.3. Examples</A
+></H2
+><P
+>Source and target rectangles shall remain unchanged across
+closing and reopening a device, such that piping data into or out of a
+device will work without special preparations. More advanced
+applications should ensure the parameters are suitable before starting
+I/O.</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN1972"
+></A
+><P
+><B
+>Example 1-10. Resetting the cropping parameters</B
+></P
+><P
+>(A video capture device is assumed; change
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_CAPTURE</CODE
+> for other
+devices.)</P
+><PRE
+CLASS="PROGRAMLISTING"
+>struct&nbsp;<A
+HREF="r7771.htm#V4L2-CROPCAP"
+>v4l2_cropcap</A
+> cropcap;
+struct&nbsp;<A
+HREF="r9994.htm#V4L2-CROP"
+>v4l2_crop</A
+> crop;
+
+memset (&amp;cropcap, 0, sizeof (cropcap));
+cropcap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+
+if (-1 == ioctl (fd, <A
+HREF="r7771.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_CROPCAP</CODE
+></A
+>, &amp;cropcap)) {
+        perror ("VIDIOC_CROPCAP");
+        exit (EXIT_FAILURE);
+}
+
+memset (&amp;crop, 0, sizeof (crop));
+crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+crop.c = cropcap.defrect; 
+
+/* Ignore if cropping is not supported (EINVAL). */
+
+if (-1 == ioctl (fd, <A
+HREF="r9994.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_CROP</CODE
+></A
+>, &amp;crop)
+    &amp;&amp; errno != EINVAL) {
+        perror ("VIDIOC_S_CROP");
+        exit (EXIT_FAILURE);
+}
+      </PRE
+></DIV
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN1983"
+></A
+><P
+><B
+>Example 1-11. Simple downscaling</B
+></P
+><P
+>(A video capture device is assumed.)</P
+><PRE
+CLASS="PROGRAMLISTING"
+>struct&nbsp;<A
+HREF="r7771.htm#V4L2-CROPCAP"
+>v4l2_cropcap</A
+> cropcap;
+struct&nbsp;<A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+> format;
+
+reset_cropping_parameters ();
+
+/* Scale down to 1/4 size of full picture. */
+
+memset (&amp;format, 0, sizeof (format)); /* defaults */
+
+format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+
+format.fmt.pix.width = cropcap.defrect.width &gt;&gt; 1;
+format.fmt.pix.height = cropcap.defrect.height &gt;&gt; 1;
+format.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;
+
+if (-1 == ioctl (fd, <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+>, &amp;format)) {
+        perror ("VIDIOC_S_FORMAT");
+        exit (EXIT_FAILURE);
+}
+
+/* We could check the actual image size now, the actual scaling factor
+   or if the driver can scale at all. */
+        </PRE
+></DIV
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN1991"
+></A
+><P
+><B
+>Example 1-12. Selecting an output area</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+>struct&nbsp;<A
+HREF="r7771.htm#V4L2-CROPCAP"
+>v4l2_cropcap</A
+> cropcap;
+struct&nbsp;<A
+HREF="r9994.htm#V4L2-CROP"
+>v4l2_crop</A
+> crop;
+
+memset (&amp;cropcap, 0, sizeof (cropcap));
+cropcap.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
+
+if (-1 == ioctl (fd, VIDIOC_CROPCAP, &amp;cropcap)) {
+        perror ("VIDIOC_CROPCAP");
+        exit (EXIT_FAILURE);
+}
+
+memset (&amp;crop, 0, sizeof (crop));
+
+crop.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
+crop.c = cropcap.defrect;
+
+/* Scale the width and height to 50 % of their original size
+   and center the output. */
+
+crop.c.width /= 2;
+crop.c.height /= 2;
+crop.c.left += crop.c.width / 2;
+crop.c.top += crop.c.height / 2;
+
+/* Ignore if cropping is not supported (EINVAL). */
+
+if (-1 == ioctl (fd, VIDIOC_S_CROP, &amp;crop)
+    &#38;&#38; errno != EINVAL) {
+        perror ("VIDIOC_S_CROP");
+        exit (EXIT_FAILURE);
+}</PRE
+></DIV
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN1996"
+></A
+><P
+><B
+>Example 1-13. Current scaling factor and pixel aspect</B
+></P
+><P
+>(A video capture device is assumed.)</P
+><PRE
+CLASS="PROGRAMLISTING"
+>struct&nbsp;<A
+HREF="r7771.htm#V4L2-CROPCAP"
+>v4l2_cropcap</A
+> cropcap;
+struct&nbsp;<A
+HREF="r9994.htm#V4L2-CROP"
+>v4l2_crop</A
+> crop;
+struct&nbsp;<A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+> format;
+double hscale, vscale;
+double aspect;
+int dwidth, dheight;
+
+memset (&amp;cropcap, 0, sizeof (cropcap));
+cropcap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+
+if (-1 == ioctl (fd, <A
+HREF="r7771.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_CROPCAP</CODE
+></A
+>, &amp;cropcap)) {
+        perror ("VIDIOC_CROPCAP");
+        exit (EXIT_FAILURE);
+}
+
+memset (&amp;crop, 0, sizeof (crop));
+crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+
+if (-1 == ioctl (fd, <A
+HREF="r9994.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_CROP</CODE
+></A
+>, &amp;crop)) {
+        if (errno != EINVAL) {
+                perror ("VIDIOC_G_CROP");
+                exit (EXIT_FAILURE);
+        }
+
+        /* Cropping not supported. */
+        crop.c = cropcap.defrect;
+}
+
+memset (&amp;format, 0, sizeof (format));
+format.fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+
+if (-1 == ioctl (fd, <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+></A
+>, &amp;format)) {
+        perror ("VIDIOC_G_FMT");
+        exit (EXIT_FAILURE);
+}
+
+/* The scaling applied by the driver. */
+
+hscale = format.fmt.pix.width / (double) crop.c.width;
+vscale = format.fmt.pix.height / (double) crop.c.height;
+
+aspect = cropcap.pixelaspect.numerator /
+         (double) cropcap.pixelaspect.denominator;
+aspect = aspect * hscale / vscale;
+
+/* Devices following ITU-R BT.601 do not capture
+   square pixels. For playback on a computer monitor
+   we should scale the images to this size. */
+
+dwidth = format.fmt.pix.width / aspect;
+dheight = format.fmt.pix.height;
+        </PRE
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x1859.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x2009.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Data Formats</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c174.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Streaming Parameters</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x2009.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x2009.htm
new file mode 100644
index 0000000..66a6ebd
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x2009.htm
@@ -0,0 +1,210 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Streaming Parameters</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Common API Elements"
+HREF="c174.htm"><LINK
+REL="PREVIOUS"
+TITLE="Image Cropping, Insertion and Scaling"
+HREF="x1904.htm"><LINK
+REL="NEXT"
+TITLE="Image Formats"
+HREF="c2030.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x1904.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 1. Common API Elements</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="c2030.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="STREAMING-PAR"
+>1.12. Streaming Parameters</A
+></H1
+><P
+>Streaming parameters are intended to optimize the video
+capture process as well as I/O. Presently applications can request a
+high quality capture mode with the <A
+HREF="r11680.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_PARM</CODE
+></A
+> ioctl.</P
+><P
+>The current video standard determines a nominal number of
+frames per second. If less than this number of frames is to be
+captured or output, applications can request frame skipping or
+duplicating on the driver side. This is especially useful when using
+the <A
+HREF="r14264.htm"
+><CODE
+CLASS="FUNCTION"
+>read()</CODE
+></A
+> or <A
+HREF="r14496.htm"
+><CODE
+CLASS="FUNCTION"
+>write()</CODE
+></A
+>, which are not augmented by timestamps
+or sequence counters, and to avoid unneccessary data copying.</P
+><P
+>Finally these ioctls can be used to determine the number of
+buffers used internally by a driver in read/write mode. For
+implications see the section discussing the <A
+HREF="r14264.htm"
+><CODE
+CLASS="FUNCTION"
+>read()</CODE
+></A
+>
+function.</P
+><P
+>To get and set the streaming parameters applications call
+the <A
+HREF="r11680.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_PARM</CODE
+></A
+> and <A
+HREF="r11680.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_PARM</CODE
+></A
+> ioctl, respectively. They take
+a pointer to a struct&nbsp;<A
+HREF="r11680.htm#V4L2-STREAMPARM"
+>v4l2_streamparm</A
+>, which contains a union holding
+separate parameters for input and output devices.</P
+><P
+>These ioctls are optional, drivers need not implement
+them. If so, they return the <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code.</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x1904.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="c2030.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Image Cropping, Insertion and Scaling</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c174.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Image Formats</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x2123.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x2123.htm
new file mode 100644
index 0000000..c8e1262
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x2123.htm
@@ -0,0 +1,977 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Colorspaces</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Image Formats"
+HREF="c2030.htm"><LINK
+REL="PREVIOUS"
+TITLE="Image Formats"
+HREF="c2030.htm"><LINK
+REL="NEXT"
+TITLE="Indexed Format"
+HREF="x2428.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="c2030.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 2. Image Formats</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x2428.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="COLORSPACES"
+>2.2. Colorspaces</A
+></H1
+><P
+>[intro]</P
+><P
+>      <P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+>Gamma Correction</DT
+><DD
+><P
+>[to do]</P
+><P
+>E'<SUB
+>R</SUB
+> = f(R)</P
+><P
+>E'<SUB
+>G</SUB
+> = f(G)</P
+><P
+>E'<SUB
+>B</SUB
+> = f(B)</P
+></DD
+><DT
+>Construction of luminance and color-difference
+signals</DT
+><DD
+><P
+>[to do]</P
+><P
+>E'<SUB
+>Y</SUB
+> =
+Coeff<SUB
+>R</SUB
+> E'<SUB
+>R</SUB
+>
++ Coeff<SUB
+>G</SUB
+> E'<SUB
+>G</SUB
+>
++ Coeff<SUB
+>B</SUB
+> E'<SUB
+>B</SUB
+></P
+><P
+>(E'<SUB
+>R</SUB
+> - E'<SUB
+>Y</SUB
+>) = E'<SUB
+>R</SUB
+>
+- Coeff<SUB
+>R</SUB
+> E'<SUB
+>R</SUB
+>
+- Coeff<SUB
+>G</SUB
+> E'<SUB
+>G</SUB
+>
+- Coeff<SUB
+>B</SUB
+> E'<SUB
+>B</SUB
+></P
+><P
+>(E'<SUB
+>B</SUB
+> - E'<SUB
+>Y</SUB
+>) = E'<SUB
+>B</SUB
+>
+- Coeff<SUB
+>R</SUB
+> E'<SUB
+>R</SUB
+>
+- Coeff<SUB
+>G</SUB
+> E'<SUB
+>G</SUB
+>
+- Coeff<SUB
+>B</SUB
+> E'<SUB
+>B</SUB
+></P
+></DD
+><DT
+>Re-normalized color-difference signals</DT
+><DD
+><P
+>The color-difference signals are scaled back to unity
+range [-0.5;+0.5]:</P
+><P
+>K<SUB
+>B</SUB
+> = 0.5 / (1 - Coeff<SUB
+>B</SUB
+>)</P
+><P
+>K<SUB
+>R</SUB
+> = 0.5 / (1 - Coeff<SUB
+>R</SUB
+>)</P
+><P
+>P<SUB
+>B</SUB
+> =
+K<SUB
+>B</SUB
+> (E'<SUB
+>B</SUB
+> - E'<SUB
+>Y</SUB
+>) =
+  0.5 (Coeff<SUB
+>R</SUB
+> / Coeff<SUB
+>B</SUB
+>) E'<SUB
+>R</SUB
+>
++ 0.5 (Coeff<SUB
+>G</SUB
+> / Coeff<SUB
+>B</SUB
+>) E'<SUB
+>G</SUB
+>
++ 0.5 E'<SUB
+>B</SUB
+></P
+><P
+>P<SUB
+>R</SUB
+> =
+K<SUB
+>R</SUB
+> (E'<SUB
+>R</SUB
+> - E'<SUB
+>Y</SUB
+>) =
+  0.5 E'<SUB
+>R</SUB
+>
++ 0.5 (Coeff<SUB
+>G</SUB
+> / Coeff<SUB
+>R</SUB
+>) E'<SUB
+>G</SUB
+>
++ 0.5 (Coeff<SUB
+>B</SUB
+> / Coeff<SUB
+>R</SUB
+>) E'<SUB
+>B</SUB
+></P
+></DD
+><DT
+>Quantization</DT
+><DD
+><P
+>[to do]</P
+><P
+>Y' = (Lum. Levels - 1) &middot; E'<SUB
+>Y</SUB
+> + Lum. Offset</P
+><P
+>C<SUB
+>B</SUB
+> = (Chrom. Levels - 1)
+&middot; P<SUB
+>B</SUB
+> + Chrom. Offset</P
+><P
+>C<SUB
+>R</SUB
+> = (Chrom. Levels - 1)
+&middot; P<SUB
+>R</SUB
+> + Chrom. Offset</P
+><P
+>Rounding to the nearest integer and clamping to the range
+[0;255] finally yields the digital color components Y'CbCr
+stored in YUV images.</P
+></DD
+></DL
+></DIV
+>
+    </P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN2217"
+></A
+><P
+><B
+>Example 2-1. ITU-R Rec. BT.601 color conversion</B
+></P
+><P
+>Forward Transformation</P
+><PRE
+CLASS="PROGRAMLISTING"
+>int ER, EG, EB;         /* gamma corrected RGB input [0;255] */
+int Y1, Cb, Cr;         /* output [0;255] */
+
+double r, g, b;         /* temporaries */
+double y1, pb, pr;
+
+int
+clamp (double x)
+{
+        int r = x;      /* round to nearest */
+
+        if (r &lt; 0)         return 0;
+        else if (r &gt; 255)  return 255;
+        else               return r;
+}
+
+r = ER / 255.0;
+g = EG / 255.0;
+b = EB / 255.0;
+
+y1  =  0.299  * r + 0.587 * g + 0.114  * b;
+pb  = -0.169  * r - 0.331 * g + 0.5    * b;
+pr  =  0.5    * r - 0.419 * g - 0.081  * b;
+
+Y1 = clamp (219 * y1 + 16);
+Cb = clamp (224 * pb + 128);
+Cr = clamp (224 * pr + 128);
+
+/* or shorter */
+
+y1 = 0.299 * ER + 0.587 * EG + 0.114 * EB;
+
+Y1 = clamp ( (219 / 255.0)                    *       y1  + 16);
+Cb = clamp (((224 / 255.0) / (2 - 2 * 0.114)) * (EB - y1) + 128);
+Cr = clamp (((224 / 255.0) / (2 - 2 * 0.299)) * (ER - y1) + 128);
+      </PRE
+><P
+>Inverse Transformation</P
+><PRE
+CLASS="PROGRAMLISTING"
+>int Y1, Cb, Cr;         /* gamma pre-corrected input [0;255] */
+int ER, EG, EB;         /* output [0;255] */
+
+double r, g, b;         /* temporaries */
+double y1, pb, pr;
+
+int
+clamp (double x)
+{
+        int r = x;      /* round to nearest */
+
+        if (r &lt; 0)         return 0;
+        else if (r &gt; 255)  return 255;
+        else               return r;
+}
+
+y1 = (255 / 219.0) * (Y1 - 16);
+pb = (255 / 224.0) * (Cb - 128);
+pr = (255 / 224.0) * (Cr - 128);
+
+r = 1.0 * y1 + 0     * pb + 1.402 * pr;
+g = 1.0 * y1 - 0.344 * pb - 0.714 * pr;
+b = 1.0 * y1 + 1.772 * pb + 0     * pr;
+
+ER = clamp (r * 255); /* [ok? one should prob. limit y1,pb,pr] */
+EG = clamp (g * 255);
+EB = clamp (b * 255);
+      </PRE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-COLORSPACE"
+></A
+><P
+><B
+>Table 2-2. enum v4l2_colorspace</B
+></P
+><TABLE
+BORDER="1"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="9%"
+ALIGN="LEFT"><COL
+WIDTH="9%"
+ALIGN="CENTER"><COL
+WIDTH="9%"
+ALIGN="LEFT"><COL
+WIDTH="9%"
+TITLE="CR"><COL
+WIDTH="9%"
+TITLE="CG"><COL
+WIDTH="9%"
+TITLE="CB"><COL
+WIDTH="9%"
+TITLE="WP"><COL
+WIDTH="9%"
+TITLE="GC"><COL
+WIDTH="9%"
+TITLE="LUM"><COL
+WIDTH="9%"
+TITLE="QY"><COL
+WIDTH="9%"
+TITLE="QC"><THEAD
+><TR
+><TH
+ROWSPAN="2"
+>Identifier</TH
+><TH
+ROWSPAN="2"
+>Value</TH
+><TH
+ROWSPAN="2"
+>Description</TH
+><TH
+COLSPAN="3"
+>Chromaticities<A
+NAME="AEN2246"
+HREF="x2123.htm#FTN.AEN2246"
+><SPAN
+CLASS="footnote"
+>[a]</SPAN
+></A
+></TH
+><TH
+ROWSPAN="2"
+>White Point</TH
+><TH
+ROWSPAN="2"
+>Gamma Correction</TH
+><TH
+ROWSPAN="2"
+>Luminance E'<SUB
+>Y</SUB
+></TH
+><TH
+COLSPAN="2"
+>Quantization</TH
+></TR
+><TR
+><TH
+>Red</TH
+><TH
+>Green</TH
+><TH
+>Blue</TH
+><TH
+>Y'</TH
+><TH
+>Cb, Cr</TH
+></TR
+></THEAD
+><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_COLORSPACE_SMPTE170M</CODE
+></TD
+><TD
+>1</TD
+><TD
+>NTSC/PAL according to <A
+HREF="b17127.htm#SMPTE170M"
+><ABBR
+CLASS="ABBREV"
+>SMPTE&nbsp;170M</ABBR
+></A
+>,
+<A
+HREF="b17127.htm#ITU601"
+><ABBR
+CLASS="ABBREV"
+>ITU&nbsp;BT.601</ABBR
+></A
+></TD
+><TD
+>x&nbsp;=&nbsp;0.630, y&nbsp;=&nbsp;0.340</TD
+><TD
+>x&nbsp;=&nbsp;0.310, y&nbsp;=&nbsp;0.595</TD
+><TD
+>x&nbsp;=&nbsp;0.155, y&nbsp;=&nbsp;0.070</TD
+><TD
+>x&nbsp;=&nbsp;0.3127, y&nbsp;=&nbsp;0.3290,
+            Illuminant D<SUB
+>65</SUB
+></TD
+><TD
+>E' = 4.5&nbsp;I&nbsp;for&nbsp;I&nbsp;&le;0.018,
+1.099&nbsp;I<SUP
+>0.45</SUP
+>&nbsp;-&nbsp;0.099&nbsp;for&nbsp;0.018&nbsp;&lt;&nbsp;I</TD
+><TD
+>0.299&nbsp;E'<SUB
+>R</SUB
+>
++&nbsp;0.587&nbsp;E'<SUB
+>G</SUB
+>
++&nbsp;0.114&nbsp;E'<SUB
+>B</SUB
+></TD
+><TD
+>219&nbsp;E'<SUB
+>Y</SUB
+>&nbsp;+&nbsp;16</TD
+><TD
+>224&nbsp;P<SUB
+>B,R</SUB
+>&nbsp;+&nbsp;128</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_COLORSPACE_SMPTE240M</CODE
+></TD
+><TD
+>2</TD
+><TD
+>1125-Line (US) HDTV, see <A
+HREF="b17127.htm#SMPTE240M"
+><ABBR
+CLASS="ABBREV"
+>SMPTE&nbsp;240M</ABBR
+></A
+></TD
+><TD
+>x&nbsp;=&nbsp;0.630, y&nbsp;=&nbsp;0.340</TD
+><TD
+>x&nbsp;=&nbsp;0.310, y&nbsp;=&nbsp;0.595</TD
+><TD
+>x&nbsp;=&nbsp;0.155, y&nbsp;=&nbsp;0.070</TD
+><TD
+>x&nbsp;=&nbsp;0.3127, y&nbsp;=&nbsp;0.3290,
+            Illuminant D<SUB
+>65</SUB
+></TD
+><TD
+>E' = 4&nbsp;I&nbsp;for&nbsp;I&nbsp;&le;0.0228,
+1.1115&nbsp;I<SUP
+>0.45</SUP
+>&nbsp;-&nbsp;0.1115&nbsp;for&nbsp;0.0228&nbsp;&lt;&nbsp;I</TD
+><TD
+>0.212&nbsp;E'<SUB
+>R</SUB
+>
++&nbsp;0.701&nbsp;E'<SUB
+>G</SUB
+>
++&nbsp;0.087&nbsp;E'<SUB
+>B</SUB
+></TD
+><TD
+>219&nbsp;E'<SUB
+>Y</SUB
+>&nbsp;+&nbsp;16</TD
+><TD
+>224&nbsp;P<SUB
+>B,R</SUB
+>&nbsp;+&nbsp;128</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_COLORSPACE_REC709</CODE
+></TD
+><TD
+>3</TD
+><TD
+>HDTV and modern devices, see <A
+HREF="b17127.htm#ITU709"
+><ABBR
+CLASS="ABBREV"
+>ITU&nbsp;BT.709</ABBR
+></A
+></TD
+><TD
+>x&nbsp;=&nbsp;0.640, y&nbsp;=&nbsp;0.330</TD
+><TD
+>x&nbsp;=&nbsp;0.300, y&nbsp;=&nbsp;0.600</TD
+><TD
+>x&nbsp;=&nbsp;0.150, y&nbsp;=&nbsp;0.060</TD
+><TD
+>x&nbsp;=&nbsp;0.3127, y&nbsp;=&nbsp;0.3290,
+            Illuminant D<SUB
+>65</SUB
+></TD
+><TD
+>E' = 4.5&nbsp;I&nbsp;for&nbsp;I&nbsp;&le;0.018,
+1.099&nbsp;I<SUP
+>0.45</SUP
+>&nbsp;-&nbsp;0.099&nbsp;for&nbsp;0.018&nbsp;&lt;&nbsp;I</TD
+><TD
+>0.2125&nbsp;E'<SUB
+>R</SUB
+> 
++&nbsp;0.7154&nbsp;E'<SUB
+>G</SUB
+>
++&nbsp;0.0721&nbsp;E'<SUB
+>B</SUB
+></TD
+><TD
+>219&nbsp;E'<SUB
+>Y</SUB
+>&nbsp;+&nbsp;16</TD
+><TD
+>224&nbsp;P<SUB
+>B,R</SUB
+>&nbsp;+&nbsp;128</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_COLORSPACE_BT878</CODE
+></TD
+><TD
+>4</TD
+><TD
+>Broken Bt878 extents<A
+NAME="AEN2329"
+HREF="x2123.htm#FTN.AEN2329"
+><SPAN
+CLASS="footnote"
+>[b]</SPAN
+></A
+>, <A
+HREF="b17127.htm#ITU601"
+><ABBR
+CLASS="ABBREV"
+>ITU&nbsp;BT.601</ABBR
+></A
+></TD
+><TD
+>?</TD
+><TD
+>?</TD
+><TD
+>?</TD
+><TD
+>?</TD
+><TD
+>?</TD
+><TD
+>0.299&nbsp;E'<SUB
+>R</SUB
+>
++&nbsp;0.587&nbsp;E'<SUB
+>G</SUB
+>
++&nbsp;0.114&nbsp;E'<SUB
+>B</SUB
+></TD
+><TD
+><SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>237</I
+></SPAN
+>&nbsp;E'<SUB
+>Y</SUB
+>&nbsp;+&nbsp;16</TD
+><TD
+>224&nbsp;P<SUB
+>B,R</SUB
+>&nbsp;+&nbsp;128 (probably)</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_COLORSPACE_470_SYSTEM_M</CODE
+></TD
+><TD
+>5</TD
+><TD
+>M/NTSC<A
+NAME="AEN2352"
+HREF="x2123.htm#FTN.AEN2352"
+><SPAN
+CLASS="footnote"
+>[c]</SPAN
+></A
+> according to <A
+HREF="b17127.htm#ITU470"
+><ABBR
+CLASS="ABBREV"
+>ITU&nbsp;BT.470</ABBR
+></A
+>, <A
+HREF="b17127.htm#ITU601"
+><ABBR
+CLASS="ABBREV"
+>ITU&nbsp;BT.601</ABBR
+></A
+></TD
+><TD
+>x&nbsp;=&nbsp;0.67, y&nbsp;=&nbsp;0.33</TD
+><TD
+>x&nbsp;=&nbsp;0.21, y&nbsp;=&nbsp;0.71</TD
+><TD
+>x&nbsp;=&nbsp;0.14, y&nbsp;=&nbsp;0.08</TD
+><TD
+>x&nbsp;=&nbsp;0.310, y&nbsp;=&nbsp;0.316, Illuminant C</TD
+><TD
+>?</TD
+><TD
+>0.299&nbsp;E'<SUB
+>R</SUB
+>
++&nbsp;0.587&nbsp;E'<SUB
+>G</SUB
+>
++&nbsp;0.114&nbsp;E'<SUB
+>B</SUB
+></TD
+><TD
+>219&nbsp;E'<SUB
+>Y</SUB
+>&nbsp;+&nbsp;16</TD
+><TD
+>224&nbsp;P<SUB
+>B,R</SUB
+>&nbsp;+&nbsp;128</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_COLORSPACE_470_SYSTEM_BG</CODE
+></TD
+><TD
+>6</TD
+><TD
+>625-line PAL and SECAM systems according to <A
+HREF="b17127.htm#ITU470"
+><ABBR
+CLASS="ABBREV"
+>ITU&nbsp;BT.470</ABBR
+></A
+>, <A
+HREF="b17127.htm#ITU601"
+><ABBR
+CLASS="ABBREV"
+>ITU&nbsp;BT.601</ABBR
+></A
+></TD
+><TD
+>x&nbsp;=&nbsp;0.64, y&nbsp;=&nbsp;0.33</TD
+><TD
+>x&nbsp;=&nbsp;0.29, y&nbsp;=&nbsp;0.60</TD
+><TD
+>x&nbsp;=&nbsp;0.15, y&nbsp;=&nbsp;0.06</TD
+><TD
+>x&nbsp;=&nbsp;0.313, y&nbsp;=&nbsp;0.329,
+Illuminant D<SUB
+>65</SUB
+></TD
+><TD
+>?</TD
+><TD
+>0.299&nbsp;E'<SUB
+>R</SUB
+>
++&nbsp;0.587&nbsp;E'<SUB
+>G</SUB
+>
++&nbsp;0.114&nbsp;E'<SUB
+>B</SUB
+></TD
+><TD
+>219&nbsp;E'<SUB
+>Y</SUB
+>&nbsp;+&nbsp;16</TD
+><TD
+>224&nbsp;P<SUB
+>B,R</SUB
+>&nbsp;+&nbsp;128</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_COLORSPACE_JPEG</CODE
+></TD
+><TD
+>7</TD
+><TD
+>JPEG Y'CbCr, see <A
+HREF="b17127.htm#JFIF"
+><ABBR
+CLASS="ABBREV"
+>JFIF</ABBR
+></A
+>, <A
+HREF="b17127.htm#ITU601"
+><ABBR
+CLASS="ABBREV"
+>ITU&nbsp;BT.601</ABBR
+></A
+></TD
+><TD
+>?</TD
+><TD
+>?</TD
+><TD
+>?</TD
+><TD
+>?</TD
+><TD
+>?</TD
+><TD
+>0.299&nbsp;E'<SUB
+>R</SUB
+>
++&nbsp;0.587&nbsp;E'<SUB
+>G</SUB
+>
++&nbsp;0.114&nbsp;E'<SUB
+>B</SUB
+></TD
+><TD
+>256&nbsp;E'<SUB
+>Y</SUB
+>&nbsp;+&nbsp;16<A
+NAME="AEN2408"
+HREF="x2123.htm#FTN.AEN2408"
+><SPAN
+CLASS="footnote"
+>[d]</SPAN
+></A
+></TD
+><TD
+>256&nbsp;P<SUB
+>B,R</SUB
+>&nbsp;+&nbsp;128</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_COLORSPACE_SRGB</CODE
+></TD
+><TD
+>8</TD
+><TD
+>[?]</TD
+><TD
+>x&nbsp;=&nbsp;0.640, y&nbsp;=&nbsp;0.330</TD
+><TD
+>x&nbsp;=&nbsp;0.300, y&nbsp;=&nbsp;0.600</TD
+><TD
+>x&nbsp;=&nbsp;0.150, y&nbsp;=&nbsp;0.060</TD
+><TD
+>x&nbsp;=&nbsp;0.3127, y&nbsp;=&nbsp;0.3290,
+            Illuminant D<SUB
+>65</SUB
+></TD
+><TD
+>E' = 4.5&nbsp;I&nbsp;for&nbsp;I&nbsp;&le;0.018,
+1.099&nbsp;I<SUP
+>0.45</SUP
+>&nbsp;-&nbsp;0.099&nbsp;for&nbsp;0.018&nbsp;&lt;&nbsp;I</TD
+><TD
+COLSPAN="3"
+>n/a</TD
+></TR
+></TBODY
+><TR
+><TD
+COLSPAN="11"
+>Notes:<BR><A
+NAME="FTN.AEN2246"
+>a. </A
+>The coordinates of the color primaries are
+given in the CIE system (1931)<BR><A
+NAME="FTN.AEN2329"
+>b. </A
+>The ubiquitous Bt878 video capture chip
+quantizes E'<SUB
+>Y</SUB
+> to 238 levels, yielding a range
+of Y' = 16 &hellip; 253, unlike Rec. 601 Y' = 16 &hellip;
+235. This is not a typo in the Bt878 documentation, it has been
+implemented in silicon. The chroma extents are unclear.<BR><A
+NAME="FTN.AEN2352"
+>c. </A
+>No identifier exists for M/PAL which uses
+the chromaticities of M/NTSC, the remaining parameters are equal to B and
+G/PAL.<BR><A
+NAME="FTN.AEN2408"
+>d. </A
+>Note JFIF quantizes
+Y'P<SUB
+>B</SUB
+>P<SUB
+>R</SUB
+> in range [0;+1] and
+[-0.5;+0.5] to <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>257</I
+></SPAN
+> levels, however Y'CbCr signals
+are still clamped to [0;255].<BR></TD
+></TR
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="c2030.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x2428.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Image Formats</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c2030.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Indexed Format</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x2428.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x2428.htm
new file mode 100644
index 0000000..70a8695
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x2428.htm
@@ -0,0 +1,439 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Indexed Format</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Image Formats"
+HREF="c2030.htm"><LINK
+REL="PREVIOUS"
+TITLE="Colorspaces"
+HREF="x2123.htm"><LINK
+REL="NEXT"
+TITLE="RGB Formats"
+HREF="x2490.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x2123.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 2. Image Formats</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x2490.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="PIXFMT-INDEXED"
+>2.3. Indexed Format</A
+></H1
+><P
+>In this format each pixel is represented by an 8 bit index
+into a 256 entry ARGB palette. It is intended for <A
+HREF="x6909.htm"
+>Video Output Overlays</A
+> only. There are no ioctls to
+access the palette, this must be done with ioctls of the Linux framebuffer API.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="AEN2432"
+></A
+><P
+><B
+>Table 2-3. Indexed Image Format</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+CLASS="CALSTABLE"
+><COL
+WIDTH="1*"
+ALIGN="LEFT"
+TITLE="ID"><COL
+WIDTH="1*"
+TITLE="FOURCC"><COL
+WIDTH="1*"
+TITLE="BIT"><COL
+WIDTH="1*"
+ALIGN="CENTER"
+TITLE="B07"><COL
+WIDTH="1*"
+ALIGN="CENTER"
+TITLE="B06"><COL
+WIDTH="1*"
+ALIGN="CENTER"
+TITLE="B05"><COL
+WIDTH="1*"
+ALIGN="CENTER"
+TITLE="B04"><COL
+WIDTH="1*"
+ALIGN="CENTER"
+TITLE="B03"><COL
+WIDTH="1*"
+ALIGN="CENTER"
+TITLE="B02"><COL
+WIDTH="1*"
+ALIGN="CENTER"
+TITLE="B01"><COL
+WIDTH="1*"
+ALIGN="CENTER"
+TITLE="B00"><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><THEAD
+><TR
+><TH
+>Identifier</TH
+><TH
+>Code</TH
+><TH
+>&nbsp;</TH
+><TH
+COLSPAN="8"
+>Byte&nbsp;0</TH
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TH
+>&nbsp;</TH
+><TH
+>&nbsp;</TH
+><TH
+>Bit</TH
+><TH
+>7</TH
+><TH
+>6</TH
+><TH
+>5</TH
+><TH
+>4</TH
+><TH
+>3</TH
+><TH
+>2</TH
+><TH
+>1</TH
+><TH
+>0</TH
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+></THEAD
+><TBODY
+VALIGN="TOP"
+><TR
+><A
+NAME="V4L2-PIX-FMT-PAL8"
+></A
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_PAL8</CODE
+></TD
+><TD
+>'PAL8'</TD
+><TD
+>&nbsp;</TD
+><TD
+>i<SUB
+>7</SUB
+></TD
+><TD
+>i<SUB
+>6</SUB
+></TD
+><TD
+>i<SUB
+>5</SUB
+></TD
+><TD
+>i<SUB
+>4</SUB
+></TD
+><TD
+>i<SUB
+>3</SUB
+></TD
+><TD
+>i<SUB
+>2</SUB
+></TD
+><TD
+>i<SUB
+>1</SUB
+></TD
+><TD
+>i<SUB
+>0</SUB
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x2123.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x2490.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Colorspaces</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c2030.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>RGB Formats</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x2490.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x2490.htm
new file mode 100644
index 0000000..ac38212
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x2490.htm
@@ -0,0 +1,168 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>RGB Formats</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Image Formats"
+HREF="c2030.htm"><LINK
+REL="PREVIOUS"
+TITLE="Indexed Format"
+HREF="x2428.htm"><LINK
+REL="NEXT"
+TITLE="Packed RGB formats"
+HREF="r2492.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x2428.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 2. Image Formats</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r2492.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="PIXFMT-RGB"
+>2.4. RGB Formats</A
+></H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+><A
+HREF="r2492.htm"
+>Packed RGB formats</A
+>&nbsp;--&nbsp;Packed RGB formats</DT
+><DT
+><A
+HREF="r3735.htm"
+>V4L2_PIX_FMT_SBGGR8 ('BA81')</A
+>&nbsp;--&nbsp;Bayer RGB format</DT
+><DT
+><A
+HREF="r3796.htm"
+>V4L2_PIX_FMT_SBGGR16 ('BA82')</A
+>&nbsp;--&nbsp;Bayer RGB format</DT
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x2428.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r2492.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Indexed Format</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c2030.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Packed RGB formats</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x282.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x282.htm
new file mode 100644
index 0000000..bd91157
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x282.htm
@@ -0,0 +1,184 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Querying Capabilities</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Common API Elements"
+HREF="c174.htm"><LINK
+REL="PREVIOUS"
+TITLE="Common API Elements"
+HREF="c174.htm"><LINK
+REL="NEXT"
+TITLE="Application Priority"
+HREF="x294.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="c174.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 1. Common API Elements</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x294.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="QUERYCAP"
+>1.2. Querying Capabilities</A
+></H1
+><P
+>Because V4L2 covers a wide variety of devices not all
+aspects of the API are equally applicable to all types of devices.
+Furthermore devices of the same type have different capabilities and
+this specification permits the omission of a few complicated and less
+important parts of the API.</P
+><P
+>The <A
+HREF="r13105.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCAP</CODE
+></A
+> ioctl is available to check if the kernel
+device is compatible with this specification, and to query the <A
+HREF="c6488.htm"
+>functions</A
+> and <A
+HREF="c5742.htm"
+>I/O
+methods</A
+> supported by the device. Other features can be queried
+by calling the respective ioctl, for example <A
+HREF="r8936.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMINPUT</CODE
+></A
+>
+to learn about the number, types and names of video connectors on the
+device. Although abstraction is a major objective of this API, the
+ioctl also allows driver specific applications to reliable identify
+the driver.</P
+><P
+>All V4L2 drivers must support
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCAP</CODE
+>. Applications should always call
+this ioctl after opening the device.</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="c174.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x294.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Common API Elements</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c174.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Application Priority</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x294.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x294.htm
new file mode 100644
index 0000000..4d4ecd6
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x294.htm
@@ -0,0 +1,197 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Application Priority</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Common API Elements"
+HREF="c174.htm"><LINK
+REL="PREVIOUS"
+TITLE="Querying Capabilities"
+HREF="x282.htm"><LINK
+REL="NEXT"
+TITLE="Video Inputs and Outputs"
+HREF="x309.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x282.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 1. Common API Elements</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x309.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="APP-PRI"
+>1.3. Application Priority</A
+></H1
+><P
+>When multiple applications share a device it may be
+desirable to assign them different priorities. Contrary to the
+traditional "rm -rf /" school of thought a video recording application
+could for example block other applications from changing video
+controls or switching the current TV channel. Another objective is to
+permit low priority applications working in background, which can be
+preempted by user controlled applications and automatically regain
+control of the device at a later time.</P
+><P
+>Since these features cannot be implemented entirely in user
+space V4L2 defines the <A
+HREF="r11946.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_PRIORITY</CODE
+></A
+> and <A
+HREF="r11946.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_PRIORITY</CODE
+></A
+>
+ioctls to request and query the access priority associate with a file
+descriptor. Opening a device assigns a medium priority, compatible
+with earlier versions of V4L2 and drivers not supporting these ioctls.
+Applications requiring a different priority will usually call
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_PRIORITY</CODE
+> after verifying the device with
+the <A
+HREF="r13105.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCAP</CODE
+></A
+> ioctl.</P
+><P
+>Ioctls changing driver properties, such as <A
+HREF="r11217.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_INPUT</CODE
+></A
+>,
+return an <SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+> error code after another application obtained higher priority.
+An event mechanism to notify applications about asynchronous property
+changes has been proposed but not added yet.</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x282.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x309.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Querying Capabilities</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c174.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Video Inputs and Outputs</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x309.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x309.htm
new file mode 100644
index 0000000..a5f0547
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x309.htm
@@ -0,0 +1,278 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Video Inputs and Outputs</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Common API Elements"
+HREF="c174.htm"><LINK
+REL="PREVIOUS"
+TITLE="Application Priority"
+HREF="x294.htm"><LINK
+REL="NEXT"
+TITLE="Audio Inputs and Outputs"
+HREF="x341.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x294.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 1. Common API Elements</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x341.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="VIDEO"
+>1.4. Video Inputs and Outputs</A
+></H1
+><P
+>Video inputs and outputs are physical connectors of a
+device. These can be for example RF connectors (antenna/cable), CVBS
+a.k.a. Composite Video, S-Video or RGB connectors. Only video and VBI
+capture devices have inputs, output devices have outputs, at least one
+each. Radio devices have no video inputs or outputs.</P
+><P
+>To learn about the number and attributes of the
+available inputs and outputs applications can enumerate them with the
+<A
+HREF="r8936.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMINPUT</CODE
+></A
+> and <A
+HREF="r9149.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMOUTPUT</CODE
+></A
+> ioctl, respectively. The
+struct&nbsp;<A
+HREF="r8936.htm#V4L2-INPUT"
+>v4l2_input</A
+> returned by the <CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMINPUT</CODE
+>
+ioctl also contains signal status information applicable when the
+current video input is queried.</P
+><P
+>The <A
+HREF="r11217.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_INPUT</CODE
+></A
+> and <A
+HREF="r11612.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_OUTPUT</CODE
+></A
+> ioctl return the
+index of the current video input or output. To select a different
+input or output applications call the <A
+HREF="r11217.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_INPUT</CODE
+></A
+> and
+<A
+HREF="r11612.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_OUTPUT</CODE
+></A
+> ioctl. Drivers must implement all the input ioctls
+when the device has one or more inputs, all the output ioctls when the
+device has one or more outputs.</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN328"
+></A
+><P
+><B
+>Example 1-1. Information about the current video input</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+>struct&nbsp;<A
+HREF="r8936.htm#V4L2-INPUT"
+>v4l2_input</A
+> input;
+int index;
+
+if (-1 == ioctl (fd, <A
+HREF="r11217.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_INPUT</CODE
+></A
+>, &amp;index)) {
+        perror ("VIDIOC_G_INPUT");
+        exit (EXIT_FAILURE);
+}
+
+memset (&amp;input, 0, sizeof (input));
+input.index = index;
+
+if (-1 == ioctl (fd, <A
+HREF="r8936.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMINPUT</CODE
+></A
+>, &amp;input)) {
+        perror ("VIDIOC_ENUMINPUT");
+        exit (EXIT_FAILURE);
+}
+
+printf ("Current input: %s\n", input.name);
+      </PRE
+></DIV
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN336"
+></A
+><P
+><B
+>Example 1-2. Switching to the first video input</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+>int index;
+
+index = 0;
+
+if (-1 == ioctl (fd, <A
+HREF="r11217.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_INPUT</CODE
+></A
+>, &amp;index)) {
+        perror ("VIDIOC_S_INPUT");
+        exit (EXIT_FAILURE);
+}
+      </PRE
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x294.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x341.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Application Priority</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c174.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Audio Inputs and Outputs</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x341.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x341.htm
new file mode 100644
index 0000000..f550075
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x341.htm
@@ -0,0 +1,386 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Audio Inputs and Outputs</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Common API Elements"
+HREF="c174.htm"><LINK
+REL="PREVIOUS"
+TITLE="Video Inputs and Outputs"
+HREF="x309.htm"><LINK
+REL="NEXT"
+TITLE="Tuners and Modulators"
+HREF="x394.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x309.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 1. Common API Elements</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x394.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="AUDIO"
+>1.5. Audio Inputs and Outputs</A
+></H1
+><P
+>Audio inputs and outputs are physical connectors of a
+device. Video capture devices have inputs, output devices have
+outputs, zero or more each. Radio devices have no audio inputs or
+outputs. They have exactly one tuner which in fact
+<SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>is</I
+></SPAN
+> an audio source, but this API associates
+tuners with video inputs or outputs only, and radio devices have
+none of these.<A
+NAME="AEN345"
+HREF="x341.htm#FTN.AEN345"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+> A connector on a TV card to loop back the received
+audio signal to a sound card is not considered an audio output.</P
+><P
+>Audio and video inputs and outputs are associated. Selecting
+a video source also selects an audio source. This is most evident when
+the video and audio source is a tuner. Further audio connectors can
+combine with more than one video input or output. Assumed two
+composite video inputs and two audio inputs exist, there may be up to
+four valid combinations. The relation of video and audio connectors
+is defined in the <CODE
+CLASS="STRUCTFIELD"
+>audioset</CODE
+> field of the
+respective struct&nbsp;<A
+HREF="r8936.htm#V4L2-INPUT"
+>v4l2_input</A
+> or struct&nbsp;<A
+HREF="r9149.htm#V4L2-OUTPUT"
+>v4l2_output</A
+>, where each bit represents
+the index number, starting at zero, of one audio input or output.</P
+><P
+>To learn about the number and attributes of the
+available inputs and outputs applications can enumerate them with the
+<A
+HREF="r8242.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMAUDIO</CODE
+></A
+> and <A
+HREF="r8304.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMAUDOUT</CODE
+></A
+> ioctl, respectively. The
+struct&nbsp;<A
+HREF="r9539.htm#V4L2-AUDIO"
+>v4l2_audio</A
+> returned by the <CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMAUDIO</CODE
+> ioctl
+also contains signal status information applicable when the current
+audio input is queried.</P
+><P
+>The <A
+HREF="r9539.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_AUDIO</CODE
+></A
+> and <A
+HREF="r9688.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_AUDOUT</CODE
+></A
+> ioctl report
+the current audio input and output, respectively. Note that, unlike
+<A
+HREF="r11217.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_INPUT</CODE
+></A
+> and <A
+HREF="r11612.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_OUTPUT</CODE
+></A
+> these ioctls return a structure
+as <CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMAUDIO</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMAUDOUT</CODE
+> do, not just an index.</P
+><P
+>To select an audio input and change its properties
+applications call the <A
+HREF="r9539.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_AUDIO</CODE
+></A
+> ioctl. To select an audio
+output (which presently has no changeable properties) applications
+call the <A
+HREF="r9688.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_AUDOUT</CODE
+></A
+> ioctl.</P
+><P
+>Drivers must implement all input ioctls when the device
+has one or more inputs, all output ioctls when the device has one
+or more outputs. When the device has any audio inputs or outputs the
+driver must set the <CODE
+CLASS="CONSTANT"
+>V4L2_CAP_AUDIO</CODE
+> flag in the
+struct&nbsp;<A
+HREF="r13105.htm#V4L2-CAPABILITY"
+>v4l2_capability</A
+> returned by the <A
+HREF="r13105.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCAP</CODE
+></A
+> ioctl.</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN382"
+></A
+><P
+><B
+>Example 1-3. Information about the current audio input</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+>struct&nbsp;<A
+HREF="r9539.htm#V4L2-AUDIO"
+>v4l2_audio</A
+> audio;
+
+memset (&amp;audio, 0, sizeof (audio));
+
+if (-1 == ioctl (fd, <A
+HREF="r9539.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_AUDIO</CODE
+></A
+>, &amp;audio)) {
+        perror ("VIDIOC_G_AUDIO");
+        exit (EXIT_FAILURE);
+}
+
+printf ("Current input: %s\n", audio.name);
+      </PRE
+></DIV
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN388"
+></A
+><P
+><B
+>Example 1-4. Switching to the first audio input</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+>struct&nbsp;<A
+HREF="r9539.htm#V4L2-AUDIO"
+>v4l2_audio</A
+> audio;
+
+memset (&amp;audio, 0, sizeof (audio)); /* clear audio.mode, audio.reserved */
+
+audio.index = 0;
+
+if (-1 == ioctl (fd, <A
+HREF="r9539.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_AUDIO</CODE
+></A
+>, &amp;audio)) {
+        perror ("VIDIOC_S_AUDIO");
+        exit (EXIT_FAILURE);
+}
+      </PRE
+></DIV
+></DIV
+><H3
+CLASS="FOOTNOTES"
+>Notes</H3
+><TABLE
+BORDER="0"
+CLASS="FOOTNOTES"
+WIDTH="100%"
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="5%"
+><A
+NAME="FTN.AEN345"
+HREF="x341.htm#AEN345"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="95%"
+><P
+>Actually struct&nbsp;<A
+HREF="r9539.htm#V4L2-AUDIO"
+>v4l2_audio</A
+> ought to have a
+<CODE
+CLASS="STRUCTFIELD"
+>tuner</CODE
+> field like struct&nbsp;<A
+HREF="r8936.htm#V4L2-INPUT"
+>v4l2_input</A
+>, not only
+making the API more consistent but also permitting radio devices with
+multiple tuners.</P
+></TD
+></TR
+></TABLE
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x309.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x394.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Video Inputs and Outputs</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c174.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Tuners and Modulators</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x3891.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x3891.htm
new file mode 100644
index 0000000..c552f95
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x3891.htm
@@ -0,0 +1,257 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>YUV Formats</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Image Formats"
+HREF="c2030.htm"><LINK
+REL="PREVIOUS"
+TITLE="V4L2_PIX_FMT_SBGGR16 ('BA82')"
+HREF="r3796.htm"><LINK
+REL="NEXT"
+TITLE="Packed YUV formats"
+HREF="r3896.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r3796.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 2. Image Formats</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r3896.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="YUV-FORMATS"
+>2.5. YUV Formats</A
+></H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+><A
+HREF="r3896.htm"
+>Packed YUV formats</A
+>&nbsp;--&nbsp;Packed YUV formats</DT
+><DT
+><A
+HREF="r4185.htm"
+>V4L2_PIX_FMT_GREY ('GREY')</A
+>&nbsp;--&nbsp;Grey-scale image</DT
+><DT
+><A
+HREF="r4246.htm"
+>V4L2_PIX_FMT_Y16 ('Y16 ')</A
+>&nbsp;--&nbsp;Grey-scale image</DT
+><DT
+><A
+HREF="r4339.htm"
+>V4L2_PIX_FMT_YUYV ('YUYV')</A
+>&nbsp;--&nbsp;Packed format with &frac12; horizontal chroma
+resolution, also known as YUV 4:2:2</DT
+><DT
+><A
+HREF="r4484.htm"
+>V4L2_PIX_FMT_UYVY ('UYVY')</A
+>&nbsp;--&nbsp;Variation of
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUYV</CODE
+> with different order of samples
+in memory</DT
+><DT
+><A
+HREF="r4629.htm"
+>V4L2_PIX_FMT_Y41P ('Y41P')</A
+>&nbsp;--&nbsp;Format with &frac14; horizontal chroma
+resolution, also known as YUV 4:1:1</DT
+><DT
+><A
+HREF="r4850.htm"
+>V4L2_PIX_FMT_YVU420 ('YV12'), V4L2_PIX_FMT_YUV420 ('YU12')</A
+>&nbsp;--&nbsp;Planar formats with &frac12; horizontal and
+vertical chroma resolution, also known as YUV 4:2:0</DT
+><DT
+><A
+HREF="r5016.htm"
+>V4L2_PIX_FMT_YVU410 ('YVU9'), V4L2_PIX_FMT_YUV410 ('YUV9')</A
+>&nbsp;--&nbsp;Planar formats with &frac14; horizontal and
+vertical chroma resolution, also known as YUV 4:1:0</DT
+><DT
+><A
+HREF="r5154.htm"
+>V4L2_PIX_FMT_YUV422P ('422P')</A
+>&nbsp;--&nbsp;Format with &frac12; horizontal chroma resolution,
+also known as YUV 4:2:2. Planar layout as opposed to
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YUYV</CODE
+></DT
+><DT
+><A
+HREF="r5319.htm"
+>V4L2_PIX_FMT_YUV411P ('411P')</A
+>&nbsp;--&nbsp;Format with &frac14; horizontal chroma resolution,
+also known as YUV 4:1:1. Planar layout as opposed to
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_Y41P</CODE
+></DT
+><DT
+><A
+HREF="r5470.htm"
+>V4L2_PIX_FMT_NV12 ('NV12'), V4L2_PIX_FMT_NV21 ('NV21')</A
+>&nbsp;--&nbsp;Formats with &frac12; horizontal and vertical
+chroma resolution, also known as YUV 4:2:0. One luminance and one
+chrominance plane with alternating chroma samples as opposed to
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YVU420</CODE
+></DT
+></DL
+></DIV
+><P
+>YUV is the format native to TV broadcast and composite video
+signals. It separates the brightness information (Y) from the color
+information (U and V or Cb and Cr). The color information consists of
+red and blue <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>color difference</I
+></SPAN
+> signals, this way
+the green component can be reconstructed by subtracting from the
+brightness component. See <A
+HREF="x2123.htm"
+>Section 2.2</A
+> for conversion
+examples. YUV was chosen because early television would only transmit
+brightness information. To add color in a way compatible with existing
+receivers a new signal carrier was added to transmit the color
+difference signals. Secondary in the YUV format the U and V components
+usually have lower resolution than the Y component. This is an analog
+video compression technique taking advantage of a property of the
+human visual system, being more sensitive to brightness
+information.</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r3796.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r3896.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>V4L2_PIX_FMT_SBGGR16 ('BA82')</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c2030.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Packed YUV formats</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x394.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x394.htm
new file mode 100644
index 0000000..ecaf017
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x394.htm
@@ -0,0 +1,346 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Tuners and Modulators</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Common API Elements"
+HREF="c174.htm"><LINK
+REL="PREVIOUS"
+TITLE="Audio Inputs and Outputs"
+HREF="x341.htm"><LINK
+REL="NEXT"
+TITLE="Video Standards"
+HREF="x448.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x341.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 1. Common API Elements</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x448.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="TUNER"
+>1.6. Tuners and Modulators</A
+></H1
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN396"
+>1.6.1. Tuners</A
+></H2
+><P
+>Video input devices can have one or more tuners
+demodulating a RF signal. Each tuner is associated with one or more
+video inputs, depending on the number of RF connectors on the tuner.
+The <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field of the respective
+struct&nbsp;<A
+HREF="r8936.htm#V4L2-INPUT"
+>v4l2_input</A
+> returned by the <A
+HREF="r8936.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMINPUT</CODE
+></A
+> ioctl is set to
+<CODE
+CLASS="CONSTANT"
+>V4L2_INPUT_TYPE_TUNER</CODE
+> and its
+<CODE
+CLASS="STRUCTFIELD"
+>tuner</CODE
+> field contains the index number of
+the tuner.</P
+><P
+>Radio devices have exactly one tuner with index zero, no
+video inputs.</P
+><P
+>To query and change tuner properties applications use the
+<A
+HREF="r12342.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_TUNER</CODE
+></A
+> and <A
+HREF="r12342.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_TUNER</CODE
+></A
+> ioctl, respectively. The
+struct&nbsp;<A
+HREF="r12342.htm#V4L2-TUNER"
+>v4l2_tuner</A
+> returned by <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_TUNER</CODE
+> also
+contains signal status information applicable when the tuner of the
+current video input, or a radio tuner is queried. Note that
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_TUNER</CODE
+> does not switch the current tuner,
+when there is more than one at all. The tuner is solely determined by
+the current video input. Drivers must support both ioctls and set the
+<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_TUNER</CODE
+> flag in the struct&nbsp;<A
+HREF="r13105.htm#V4L2-CAPABILITY"
+>v4l2_capability</A
+>
+returned by the <A
+HREF="r13105.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCAP</CODE
+></A
+> ioctl when the device has one or
+more tuners.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN418"
+>1.6.2. Modulators</A
+></H2
+><P
+>Video output devices can have one or more modulators, uh,
+modulating a video signal for radiation or connection to the antenna
+input of a TV set or video recorder. Each modulator is associated with
+one or more video outputs, depending on the number of RF connectors on
+the modulator. The <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field of the
+respective struct&nbsp;<A
+HREF="r9149.htm#V4L2-OUTPUT"
+>v4l2_output</A
+> returned by the <A
+HREF="r9149.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMOUTPUT</CODE
+></A
+> ioctl is
+set to <CODE
+CLASS="CONSTANT"
+>V4L2_OUTPUT_TYPE_MODULATOR</CODE
+> and its
+<CODE
+CLASS="STRUCTFIELD"
+>modulator</CODE
+> field contains the index number
+of the modulator. This specification does not define radio output
+devices.</P
+><P
+>To query and change modulator properties applications use
+the <A
+HREF="r11430.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_MODULATOR</CODE
+></A
+> and <A
+HREF="r11430.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_MODULATOR</CODE
+></A
+> ioctl. Note that
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_MODULATOR</CODE
+> does not switch the current
+modulator, when there is more than one at all. The modulator is solely
+determined by the current video output. Drivers must support both
+ioctls and set the <CODE
+CLASS="CONSTANT"
+>V4L2_CAP_TUNER</CODE
+> (sic) flag in
+the struct&nbsp;<A
+HREF="r13105.htm#V4L2-CAPABILITY"
+>v4l2_capability</A
+> returned by the <A
+HREF="r13105.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCAP</CODE
+></A
+> ioctl when the
+device has one or more modulators.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN437"
+>1.6.3. Radio Frequency</A
+></H2
+><P
+>To get and set the tuner or modulator radio frequency
+applications use the <A
+HREF="r11094.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FREQUENCY</CODE
+></A
+> and <A
+HREF="r11094.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FREQUENCY</CODE
+></A
+>
+ioctl which both take a pointer to a struct&nbsp;<A
+HREF="r11094.htm#V4L2-FREQUENCY"
+>v4l2_frequency</A
+>. These ioctls
+are used for TV and radio devices alike. Drivers must support both
+ioctls when the tuner or modulator ioctls are supported, or
+when the device is a radio device.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN445"
+>1.6.4. Satellite Receivers</A
+></H2
+><P
+>To be discussed. See also 
+proposals by Peter Schlaf, video4linux-list@redhat.com on 23 Oct 2002,
+subject: "Re: [V4L] Re: v4l2 api".</P
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x341.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x448.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Audio Inputs and Outputs</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c174.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Video Standards</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x448.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x448.htm
new file mode 100644
index 0000000..d04a4d7
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x448.htm
@@ -0,0 +1,658 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Video Standards</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Common API Elements"
+HREF="c174.htm"><LINK
+REL="PREVIOUS"
+TITLE="Tuners and Modulators"
+HREF="x394.htm"><LINK
+REL="NEXT"
+TITLE="User Controls"
+HREF="x542.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x394.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 1. Common API Elements</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x542.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="STANDARD"
+>1.7. Video Standards</A
+></H1
+><P
+>Video devices typically support one or more different video
+standards or variations of standards. Each video input and output may
+support another set of standards. This set is reported by the
+<CODE
+CLASS="STRUCTFIELD"
+>std</CODE
+> field of struct&nbsp;<A
+HREF="r8936.htm#V4L2-INPUT"
+>v4l2_input</A
+> and
+struct&nbsp;<A
+HREF="r9149.htm#V4L2-OUTPUT"
+>v4l2_output</A
+> returned by the <A
+HREF="r8936.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMINPUT</CODE
+></A
+> and
+<A
+HREF="r9149.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMOUTPUT</CODE
+></A
+> ioctl, respectively.</P
+><P
+>V4L2 defines one bit for each analog video standard
+currently in use worldwide, and sets aside bits for driver defined
+standards, e.&nbsp;g. hybrid standards to watch NTSC video tapes on PAL TVs
+and vice versa. Applications can use the predefined bits to select a
+particular standard, although presenting the user a menu of supported
+standards is preferred. To enumerate and query the attributes of the
+supported standards applications use the <A
+HREF="r9288.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMSTD</CODE
+></A
+> ioctl.</P
+><P
+>Many of the defined standards are actually just variations
+of a few major standards. The hardware may in fact not distinguish
+between them, or do so internal and switch automatically. Therefore
+enumerated standards also contain sets of one or more standard
+bits.</P
+><P
+>Assume a hypothetic tuner capable of demodulating B/PAL,
+G/PAL and I/PAL signals. The first enumerated standard is a set of B
+and G/PAL, switched automatically depending on the selected radio
+frequency in UHF or VHF band. Enumeration gives a "PAL-B/G" or "PAL-I"
+choice. Similar a Composite input may collapse standards, enumerating
+"PAL-B/G/H/I", "NTSC-M" and "SECAM-D/K".<A
+NAME="AEN463"
+HREF="x448.htm#FTN.AEN463"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+></P
+><P
+>To query and select the standard used by the current video
+input or output applications call the <A
+HREF="r12265.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_STD</CODE
+></A
+> and
+<A
+HREF="r12265.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_STD</CODE
+></A
+> ioctl, respectively. The <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>received</I
+></SPAN
+>
+standard can be sensed with the <A
+HREF="r13641.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYSTD</CODE
+></A
+> ioctl. Note parameter of all these ioctls is a pointer to a <A
+HREF="r9288.htm#V4L2-STD-ID"
+>v4l2_std_id</A
+> type (a standard set), <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>not</I
+></SPAN
+> an index into the standard enumeration.<A
+NAME="AEN475"
+HREF="x448.htm#FTN.AEN475"
+><SPAN
+CLASS="footnote"
+>[2]</SPAN
+></A
+> Drivers must implement all video standard ioctls
+when the device has one or more video inputs or outputs.</P
+><P
+>Special rules apply to USB cameras where the notion of video
+standards makes little sense. More generally any capture device,
+output devices accordingly, which is <P
+></P
+><UL
+><LI
+><P
+>incapable of capturing fields or frames at the nominal
+rate of the video standard, or</P
+></LI
+><LI
+><P
+>where <A
+HREF="x5953.htm"
+>timestamps</A
+> refer
+to the instant the field or frame was received by the driver, not the
+capture time, or</P
+></LI
+><LI
+><P
+>where <A
+HREF="x5953.htm"
+>sequence numbers</A
+>
+refer to the frames received by the driver, not the captured
+frames.</P
+></LI
+></UL
+> Here the driver shall set the
+<CODE
+CLASS="STRUCTFIELD"
+>std</CODE
+> field of struct&nbsp;<A
+HREF="r8936.htm#V4L2-INPUT"
+>v4l2_input</A
+> and struct&nbsp;<A
+HREF="r9149.htm#V4L2-OUTPUT"
+>v4l2_output</A
+>
+to zero, the <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_STD</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_STD</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYSTD</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMSTD</CODE
+> ioctls shall return the
+<SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code.<A
+NAME="AEN507"
+HREF="x448.htm#FTN.AEN507"
+><SPAN
+CLASS="footnote"
+>[3]</SPAN
+></A
+></P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN510"
+></A
+><P
+><B
+>Example 1-5. Information about the current video standard</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+><A
+HREF="r9288.htm#V4L2-STD-ID"
+>v4l2_std_id</A
+> std_id;
+struct&nbsp;<A
+HREF="r9288.htm#V4L2-STANDARD"
+>v4l2_standard</A
+> standard;
+
+if (-1 == ioctl (fd, <A
+HREF="r12265.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_STD</CODE
+></A
+>, &amp;std_id)) {
+        /* Note when VIDIOC_ENUMSTD always returns EINVAL this
+           is no video device or it falls under the USB exception,
+           and VIDIOC_G_STD returning EINVAL is no error. */
+
+        perror ("VIDIOC_G_STD");
+        exit (EXIT_FAILURE);
+}
+
+memset (&amp;standard, 0, sizeof (standard));
+standard.index = 0;
+
+while (0 == ioctl (fd, <A
+HREF="r9288.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMSTD</CODE
+></A
+>, &amp;standard)) {
+        if (standard.id &amp; std_id) {
+               printf ("Current video standard: %s\n", standard.name);
+               exit (EXIT_SUCCESS);
+        }
+
+        standard.index++;
+}
+
+/* EINVAL indicates the end of the enumeration, which cannot be
+   empty unless this device falls under the USB exception. */
+
+if (errno == EINVAL || standard.index == 0) {
+        perror ("VIDIOC_ENUMSTD");
+        exit (EXIT_FAILURE);
+}
+      </PRE
+></DIV
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN519"
+></A
+><P
+><B
+>Example 1-6. Listing the video standards supported by the current
+input</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+>struct&nbsp;<A
+HREF="r8936.htm#V4L2-INPUT"
+>v4l2_input</A
+> input;
+struct&nbsp;<A
+HREF="r9288.htm#V4L2-STANDARD"
+>v4l2_standard</A
+> standard;
+
+memset (&amp;input, 0, sizeof (input));
+
+if (-1 == ioctl (fd, <A
+HREF="r11217.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_INPUT</CODE
+></A
+>, &amp;input.index)) {
+        perror ("VIDIOC_G_INPUT");
+        exit (EXIT_FAILURE);
+}
+
+if (-1 == ioctl (fd, <A
+HREF="r8936.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMINPUT</CODE
+></A
+>, &amp;input)) {
+        perror ("VIDIOC_ENUM_INPUT");
+        exit (EXIT_FAILURE);
+}
+
+printf ("Current input %s supports:\n", input.name);
+
+memset (&amp;standard, 0, sizeof (standard));
+standard.index = 0;
+
+while (0 == ioctl (fd, <A
+HREF="r9288.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMSTD</CODE
+></A
+>, &amp;standard)) {
+        if (standard.id &amp; input.std)
+                printf ("%s\n", standard.name);
+
+        standard.index++;
+}
+
+/* EINVAL indicates the end of the enumeration, which cannot be
+   empty unless this device falls under the USB exception. */
+
+if (errno != EINVAL || standard.index == 0) {
+        perror ("VIDIOC_ENUMSTD");
+        exit (EXIT_FAILURE);
+}
+      </PRE
+></DIV
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN530"
+></A
+><P
+><B
+>Example 1-7. Selecting a new video standard</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+>struct&nbsp;<A
+HREF="r8936.htm#V4L2-INPUT"
+>v4l2_input</A
+> input;
+<A
+HREF="r9288.htm#V4L2-STD-ID"
+>v4l2_std_id</A
+> std_id;
+
+memset (&amp;input, 0, sizeof (input));
+
+if (-1 == ioctl (fd, <A
+HREF="r11217.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_INPUT</CODE
+></A
+>, &amp;input.index)) {
+        perror ("VIDIOC_G_INPUT");
+        exit (EXIT_FAILURE);
+}
+
+if (-1 == ioctl (fd, <A
+HREF="r8936.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_ENUMINPUT</CODE
+></A
+>, &amp;input)) {
+        perror ("VIDIOC_ENUM_INPUT");
+        exit (EXIT_FAILURE);
+}
+
+if (0 == (input.std &amp; V4L2_STD_PAL_BG)) {
+        fprintf (stderr, "Oops. B/G PAL is not supported.\n");
+        exit (EXIT_FAILURE);
+}
+
+/* Note this is also supposed to work when only B
+   <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>or</I
+></SPAN
+> G/PAL is supported. */
+
+std_id = V4L2_STD_PAL_BG;
+
+if (-1 == ioctl (fd, <A
+HREF="r12265.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_STD</CODE
+></A
+>, &amp;std_id)) {
+        perror ("VIDIOC_S_STD");
+        exit (EXIT_FAILURE);
+}
+      </PRE
+></DIV
+></DIV
+><H3
+CLASS="FOOTNOTES"
+>Notes</H3
+><TABLE
+BORDER="0"
+CLASS="FOOTNOTES"
+WIDTH="100%"
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="5%"
+><A
+NAME="FTN.AEN463"
+HREF="x448.htm#AEN463"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="95%"
+><P
+>Some users are already confused by technical terms PAL,
+NTSC and SECAM. There is no point asking them to distinguish between
+B, G, D, or K when the software or hardware can do that
+automatically.</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="5%"
+><A
+NAME="FTN.AEN475"
+HREF="x448.htm#AEN475"
+><SPAN
+CLASS="footnote"
+>[2]</SPAN
+></A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="95%"
+><P
+>An alternative to the current scheme is to use pointers
+to indices as arguments of <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_STD</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_STD</CODE
+>, the struct&nbsp;<A
+HREF="r8936.htm#V4L2-INPUT"
+>v4l2_input</A
+> and
+struct&nbsp;<A
+HREF="r9149.htm#V4L2-OUTPUT"
+>v4l2_output</A
+> <CODE
+CLASS="STRUCTFIELD"
+>std</CODE
+> field would be a set of
+indices like <CODE
+CLASS="STRUCTFIELD"
+>audioset</CODE
+>.</P
+><P
+>Indices are consistent with the rest of the API
+and identify the standard unambiguously. In the present scheme of
+things an enumerated standard is looked up by <A
+HREF="r9288.htm#V4L2-STD-ID"
+>v4l2_std_id</A
+>. Now the
+standards supported by the inputs of a device can overlap. Just
+assume the tuner and composite input in the example above both
+exist on a device. An enumeration of "PAL-B/G", "PAL-H/I" suggests
+a choice which does not exist. We cannot merge or omit sets, because
+applications would be unable to find the standards reported by
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_STD</CODE
+>. That leaves separate enumerations
+for each input. Also selecting a standard by <A
+HREF="r9288.htm#V4L2-STD-ID"
+>v4l2_std_id</A
+> can be
+ambiguous. Advantage of this method is that applications need not
+identify the standard indirectly, after enumerating.</P
+><P
+>So in
+summary, the lookup itself is unavoidable. The difference is only
+whether the lookup is necessary to find an enumerated standard or to
+switch to a standard by <A
+HREF="r9288.htm#V4L2-STD-ID"
+>v4l2_std_id</A
+>.</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="5%"
+><A
+NAME="FTN.AEN507"
+HREF="x448.htm#AEN507"
+><SPAN
+CLASS="footnote"
+>[3]</SPAN
+></A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="95%"
+><P
+>See <A
+HREF="x5953.htm"
+>Section 3.5</A
+> for a rationale. Probably
+even USB cameras follow some well known video standard. It might have
+been better to explicitly indicate elsewhere if a device cannot live
+up to normal expectations, instead of this exception.</P
+></TD
+></TR
+></TABLE
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x394.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x542.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Tuners and Modulators</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c174.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>User Controls</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x542.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x542.htm
new file mode 100644
index 0000000..ea8e6ae
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x542.htm
@@ -0,0 +1,1043 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>User Controls</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Common API Elements"
+HREF="c174.htm"><LINK
+REL="PREVIOUS"
+TITLE="Video Standards"
+HREF="x448.htm"><LINK
+REL="NEXT"
+TITLE="Extended Controls"
+HREF="x802.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x448.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 1. Common API Elements</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x802.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="CONTROL"
+>1.8. User Controls</A
+></H1
+><P
+>Devices typically have a number of user-settable controls
+such as brightness, saturation and so on, which would be presented to
+the user on a graphical user interface. But, different devices
+will have different controls available, and furthermore, the range of
+possible values, and the default value will vary from device to
+device. The control ioctls provide the information and a mechanism to
+create a nice user interface for these controls that will work
+correctly with any device.</P
+><P
+>All controls are accessed using an ID value. V4L2 defines
+several IDs for specific purposes. Drivers can also implement their
+own custom controls using <CODE
+CLASS="CONSTANT"
+>V4L2_CID_PRIVATE_BASE</CODE
+>
+and higher values. The pre-defined control IDs have the prefix
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_</CODE
+>, and are listed in <A
+HREF="x542.htm#CONTROL-ID"
+>Table 1-1</A
+>. The ID is used when querying the attributes of
+a control, and when getting or setting the current value.</P
+><P
+>Generally applications should present controls to the user
+without assumptions about their purpose. Each control comes with a
+name string the user is supposed to understand. When the purpose is
+non-intuitive the driver writer should provide a user manual, a user
+interface plug-in or a driver specific panel application. Predefined
+IDs were introduced to change a few controls programmatically, for
+example to mute a device during a channel switch.</P
+><P
+>Drivers may enumerate different controls after switching
+the current video input or output, tuner or modulator, or audio input
+or output. Different in the sense of other bounds, another default and
+current value, step size or other menu items. A control with a certain
+<SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>custom</I
+></SPAN
+> ID can also change name and
+type.<A
+NAME="AEN552"
+HREF="x542.htm#FTN.AEN552"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+> Control values are stored globally, they do not
+change when switching except to stay within the reported bounds. They
+also do not change e.&nbsp;g. when the device is opened or closed, when the
+tuner radio frequency is changed or generally never without
+application request. Since V4L2 specifies no event mechanism, panel
+applications intended to cooperate with other panel applications (be
+they built into a larger application, as a TV viewer) may need to
+regularly poll control values to update their user
+interface.<A
+NAME="AEN555"
+HREF="x542.htm#FTN.AEN555"
+><SPAN
+CLASS="footnote"
+>[2]</SPAN
+></A
+></P
+><DIV
+CLASS="TABLE"
+><A
+NAME="CONTROL-ID"
+></A
+><P
+><B
+>Table 1-1. Control IDs</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><THEAD
+><TR
+><TH
+>ID</TH
+><TH
+>Type</TH
+><TH
+>Description</TH
+></TR
+></THEAD
+><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_BASE</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>First predefined ID, equal to
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_BRIGHTNESS</CODE
+>.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_USER_BASE</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>Synonym of <CODE
+CLASS="CONSTANT"
+>V4L2_CID_BASE</CODE
+>.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_BRIGHTNESS</CODE
+></TD
+><TD
+>integer</TD
+><TD
+>Picture brightness, or more precisely, the black
+level.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_CONTRAST</CODE
+></TD
+><TD
+>integer</TD
+><TD
+>Picture contrast or luma gain.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_SATURATION</CODE
+></TD
+><TD
+>integer</TD
+><TD
+>Picture color saturation or chroma gain.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_HUE</CODE
+></TD
+><TD
+>integer</TD
+><TD
+>Hue or color balance.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_AUDIO_VOLUME</CODE
+></TD
+><TD
+>integer</TD
+><TD
+>Overall audio volume. Note some drivers also
+provide an OSS or ALSA mixer interface.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_AUDIO_BALANCE</CODE
+></TD
+><TD
+>integer</TD
+><TD
+>Audio stereo balance. Minimum corresponds to all
+the way left, maximum to right.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_AUDIO_BASS</CODE
+></TD
+><TD
+>integer</TD
+><TD
+>Audio bass adjustment.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_AUDIO_TREBLE</CODE
+></TD
+><TD
+>integer</TD
+><TD
+>Audio treble adjustment.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_AUDIO_MUTE</CODE
+></TD
+><TD
+>boolean</TD
+><TD
+>Mute audio, i.&nbsp;e. set the volume to zero, however
+without affecting <CODE
+CLASS="CONSTANT"
+>V4L2_CID_AUDIO_VOLUME</CODE
+>. Like
+ALSA drivers, V4L2 drivers must mute at load time to avoid excessive
+noise. Actually the entire device should be reset to a low power
+consumption state.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_AUDIO_LOUDNESS</CODE
+></TD
+><TD
+>boolean</TD
+><TD
+>Loudness mode (bass boost).</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_BLACK_LEVEL</CODE
+></TD
+><TD
+>integer</TD
+><TD
+>Another name for brightness (not a synonym of
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_BRIGHTNESS</CODE
+>). This control is deprecated
+and should not be used in new drivers and applications.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_AUTO_WHITE_BALANCE</CODE
+></TD
+><TD
+>boolean</TD
+><TD
+>Automatic white balance (cameras).</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_DO_WHITE_BALANCE</CODE
+></TD
+><TD
+>button</TD
+><TD
+>This is an action control. When set (the value is
+ignored), the device will do a white balance and then hold the current
+setting. Contrast this with the boolean
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_AUTO_WHITE_BALANCE</CODE
+>, which, when
+activated, keeps adjusting the white balance.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_RED_BALANCE</CODE
+></TD
+><TD
+>integer</TD
+><TD
+>Red chroma balance.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_BLUE_BALANCE</CODE
+></TD
+><TD
+>integer</TD
+><TD
+>Blue chroma balance.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_GAMMA</CODE
+></TD
+><TD
+>integer</TD
+><TD
+>Gamma adjust.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_WHITENESS</CODE
+></TD
+><TD
+>integer</TD
+><TD
+>Whiteness for grey-scale devices. This is a synonym
+for <CODE
+CLASS="CONSTANT"
+>V4L2_CID_GAMMA</CODE
+>. This control is deprecated
+and should not be used in new drivers and applications.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_EXPOSURE</CODE
+></TD
+><TD
+>integer</TD
+><TD
+>Exposure (cameras). [Unit?]</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_AUTOGAIN</CODE
+></TD
+><TD
+>boolean</TD
+><TD
+>Automatic gain/exposure control.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_GAIN</CODE
+></TD
+><TD
+>integer</TD
+><TD
+>Gain control.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_HFLIP</CODE
+></TD
+><TD
+>boolean</TD
+><TD
+>Mirror the picture horizontally.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_VFLIP</CODE
+></TD
+><TD
+>boolean</TD
+><TD
+>Mirror the picture vertically.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_HCENTER_DEPRECATED</CODE
+> (formerly <CODE
+CLASS="CONSTANT"
+>V4L2_CID_HCENTER</CODE
+>)</TD
+><TD
+>integer</TD
+><TD
+>Horizontal image centering. This control is
+deprecated. New drivers and applications should use the <A
+HREF="x802.htm#CAMERA-CONTROLS"
+>Camera class controls</A
+>
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_PAN_ABSOLUTE</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_PAN_RELATIVE</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_PAN_RESET</CODE
+> instead.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_VCENTER_DEPRECATED</CODE
+>
+            (formerly <CODE
+CLASS="CONSTANT"
+>V4L2_CID_VCENTER</CODE
+>)</TD
+><TD
+>integer</TD
+><TD
+>Vertical image centering. Centering is intended to
+<SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>physically</I
+></SPAN
+> adjust cameras. For image cropping see
+<A
+HREF="x1904.htm"
+>Section 1.11</A
+>, for clipping <A
+HREF="x6570.htm"
+>Section 4.2</A
+>. This
+control is deprecated. New drivers and applications should use the
+<A
+HREF="x802.htm#CAMERA-CONTROLS"
+>Camera class controls</A
+>
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_TILT_ABSOLUTE</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_TILT_RELATIVE</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_TILT_RESET</CODE
+> instead.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_POWER_LINE_FREQUENCY</CODE
+></TD
+><TD
+>integer</TD
+><TD
+>Enables a power line frequency filter to avoid
+flicker. Possible values are:
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_POWER_LINE_FREQUENCY_DISABLED</CODE
+> (0),
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_POWER_LINE_FREQUENCY_50HZ</CODE
+> (1) and
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_POWER_LINE_FREQUENCY_60HZ</CODE
+> (2).</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_HUE_AUTO</CODE
+></TD
+><TD
+>boolean</TD
+><TD
+>Enables automatic hue control by the device. The
+effect of setting <CODE
+CLASS="CONSTANT"
+>V4L2_CID_HUE</CODE
+> while automatic
+hue control is enabled is undefined, drivers should ignore such
+request.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_WHITE_BALANCE_TEMPERATURE</CODE
+></TD
+><TD
+>integer</TD
+><TD
+>This control specifies the white balance settings
+as a color temperature in Kelvin. A driver should have a minimum of
+2800 (incandescent) to 6500 (daylight). For more information about
+color temperature see <A
+HREF="http://en.wikipedia.org/wiki/Color_temperature"
+TARGET="_top"
+>Wikipedia</A
+>.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_SHARPNESS</CODE
+></TD
+><TD
+>integer</TD
+><TD
+>Adjusts the sharpness filters in a camera. The
+minimum value disables the filters, higher values give a sharper
+picture.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_BACKLIGHT_COMPENSATION</CODE
+></TD
+><TD
+>integer</TD
+><TD
+>Adjusts the backlight compensation in a camera. The
+minimum value disables backlight compensation.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_LASTP1</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>End of the predefined control IDs (currently
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_BACKLIGHT_COMPENSATION</CODE
+> + 1).</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_PRIVATE_BASE</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>ID of the first custom (driver specific) control.
+Applications depending on particular custom controls should check the
+driver name and version, see <A
+HREF="x282.htm"
+>Section 1.2</A
+>.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><P
+>Applications can enumerate the available controls with the
+<A
+HREF="r13317.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCTRL</CODE
+></A
+> and <A
+HREF="r13317.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYMENU</CODE
+></A
+> ioctls, get and set a
+control value with the <A
+HREF="r10104.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_CTRL</CODE
+></A
+> and <A
+HREF="r10104.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_CTRL</CODE
+></A
+> ioctls.
+Drivers must implement <CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCTRL</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_CTRL</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_CTRL</CODE
+> when the device has one or more
+controls, <CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYMENU</CODE
+> when it has one or
+more menu type controls.</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN778"
+></A
+><P
+><B
+>Example 1-8. Enumerating all controls</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+>struct&nbsp;<A
+HREF="r13317.htm#V4L2-QUERYCTRL"
+>v4l2_queryctrl</A
+> queryctrl;
+struct&nbsp;<A
+HREF="r13317.htm#V4L2-QUERYMENU"
+>v4l2_querymenu</A
+> querymenu;
+
+static void
+enumerate_menu (void)
+{
+        printf ("  Menu items:\n");
+
+        memset (&amp;querymenu, 0, sizeof (querymenu));
+        querymenu.id = queryctrl.id;
+
+        for (querymenu.index = queryctrl.minimum;
+             querymenu.index &lt;= queryctrl.maximum;
+              querymenu.index++) {
+                if (0 == ioctl (fd, <A
+HREF="r13317.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYMENU</CODE
+></A
+>, &amp;querymenu)) {
+                        printf ("  %s\n", querymenu.name);
+                } else {
+                        perror ("VIDIOC_QUERYMENU");
+                        exit (EXIT_FAILURE);
+                }
+        }
+}
+
+memset (&amp;queryctrl, 0, sizeof (queryctrl));
+
+for (queryctrl.id = V4L2_CID_BASE;
+     queryctrl.id &lt; V4L2_CID_LASTP1;
+     queryctrl.id++) {
+        if (0 == ioctl (fd, <A
+HREF="r13317.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCTRL</CODE
+></A
+>, &amp;queryctrl)) {
+                if (queryctrl.flags &amp; V4L2_CTRL_FLAG_DISABLED)
+                        continue;
+
+                printf ("Control %s\n", queryctrl.name);
+
+                if (queryctrl.type == V4L2_CTRL_TYPE_MENU)
+                        enumerate_menu ();
+        } else {
+                if (errno == EINVAL)
+                        continue;
+
+                perror ("VIDIOC_QUERYCTRL");
+                exit (EXIT_FAILURE);
+        }
+}
+
+for (queryctrl.id = V4L2_CID_PRIVATE_BASE;;
+     queryctrl.id++) {
+        if (0 == ioctl (fd, <A
+HREF="r13317.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCTRL</CODE
+></A
+>, &amp;queryctrl)) {
+                if (queryctrl.flags &amp; V4L2_CTRL_FLAG_DISABLED)
+                        continue;
+
+                printf ("Control %s\n", queryctrl.name);
+
+                if (queryctrl.type == V4L2_CTRL_TYPE_MENU)
+                        enumerate_menu ();
+        } else {
+                if (errno == EINVAL)
+                        break;
+
+                perror ("VIDIOC_QUERYCTRL");
+                exit (EXIT_FAILURE);
+        }
+}</PRE
+></DIV
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN789"
+></A
+><P
+><B
+>Example 1-9. Changing controls</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+>struct&nbsp;<A
+HREF="r13317.htm#V4L2-QUERYCTRL"
+>v4l2_queryctrl</A
+> queryctrl;
+struct&nbsp;<A
+HREF="r10104.htm#V4L2-CONTROL"
+>v4l2_control</A
+> control;
+
+memset (&amp;queryctrl, 0, sizeof (queryctrl));
+queryctrl.id = V4L2_CID_BRIGHTNESS;
+
+if (-1 == ioctl (fd, <A
+HREF="r13317.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCTRL</CODE
+></A
+>, &amp;queryctrl)) {
+        if (errno != EINVAL) {
+                perror ("VIDIOC_QUERYCTRL");
+                exit (EXIT_FAILURE);
+        } else {
+                printf ("V4L2_CID_BRIGHTNESS is not supported\n");
+        }
+} else if (queryctrl.flags &amp; V4L2_CTRL_FLAG_DISABLED) {
+        printf ("V4L2_CID_BRIGHTNESS is not supported\n");
+} else {
+        memset (&amp;control, 0, sizeof (control));
+        control.id = V4L2_CID_BRIGHTNESS;
+        control.value = queryctrl.default_value;
+
+        if (-1 == ioctl (fd, <A
+HREF="r10104.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_CTRL</CODE
+></A
+>, &amp;control)) {
+                perror ("VIDIOC_S_CTRL");
+                exit (EXIT_FAILURE);
+        }
+}
+
+memset (&amp;control, 0, sizeof (control));
+control.id = V4L2_CID_CONTRAST;
+
+if (0 == ioctl (fd, <A
+HREF="r10104.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_CTRL</CODE
+></A
+>, &amp;control)) {
+        control.value += 1;
+
+        /* The driver may clamp the value or return ERANGE, ignored here */
+
+        if (-1 == ioctl (fd, <A
+HREF="r10104.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_CTRL</CODE
+></A
+>, &amp;control)
+            &amp;&amp; errno != ERANGE) {
+                perror ("VIDIOC_S_CTRL");
+                exit (EXIT_FAILURE);
+        }
+/* Ignore if V4L2_CID_CONTRAST is unsupported */
+} else if (errno != EINVAL) {
+        perror ("VIDIOC_G_CTRL");
+        exit (EXIT_FAILURE);
+}
+
+control.id = V4L2_CID_AUDIO_MUTE;
+control.value = TRUE; /* silence */
+
+/* Errors ignored */
+ioctl (fd, VIDIOC_S_CTRL, &amp;control);</PRE
+></DIV
+></DIV
+><H3
+CLASS="FOOTNOTES"
+>Notes</H3
+><TABLE
+BORDER="0"
+CLASS="FOOTNOTES"
+WIDTH="100%"
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="5%"
+><A
+NAME="FTN.AEN552"
+HREF="x542.htm#AEN552"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="95%"
+><P
+>It will be more convenient for applications if drivers
+make use of the <CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_FLAG_DISABLED</CODE
+> flag, but
+that was never required.</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="5%"
+><A
+NAME="FTN.AEN555"
+HREF="x542.htm#AEN555"
+><SPAN
+CLASS="footnote"
+>[2]</SPAN
+></A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="95%"
+><P
+>Applications could call an ioctl to request events.
+After another process called <A
+HREF="r10104.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_CTRL</CODE
+></A
+> or another ioctl changing
+shared properties the <A
+HREF="r14390.htm"
+><CODE
+CLASS="FUNCTION"
+>select()</CODE
+></A
+> function would indicate
+readability until any ioctl (querying the properties) is
+called.</P
+></TD
+></TR
+></TABLE
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x448.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x802.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Video Standards</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c174.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Extended Controls</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x5634.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x5634.htm
new file mode 100644
index 0000000..f48822c
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x5634.htm
@@ -0,0 +1,228 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Compressed Formats</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Image Formats"
+HREF="c2030.htm"><LINK
+REL="PREVIOUS"
+TITLE="V4L2_PIX_FMT_NV12 ('NV12'), V4L2_PIX_FMT_NV21 ('NV21')"
+HREF="r5470.htm"><LINK
+REL="NEXT"
+TITLE="Reserved Format Identifiers"
+HREF="x5665.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="r5470.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 2. Image Formats</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x5665.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="AEN5634"
+>2.6. Compressed Formats</A
+></H1
+><DIV
+CLASS="TABLE"
+><A
+NAME="COMPRESSED-FORMATS"
+></A
+><P
+><B
+>Table 2-7. Compressed Image Formats</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><THEAD
+><TR
+><TH
+>Identifier</TH
+><TH
+>Code</TH
+><TH
+>Details</TH
+></TR
+></THEAD
+><TBODY
+VALIGN="TOP"
+><TR
+><A
+NAME="V4L2-PIX-FMT-JPEG"
+></A
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_JPEG</CODE
+></TD
+><TD
+>'JPEG'</TD
+><TD
+>TBD. See also <A
+HREF="r11285.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_JPEGCOMP</CODE
+></A
+>,
+            <A
+HREF="r11285.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_JPEGCOMP</CODE
+></A
+>.</TD
+></TR
+><TR
+><A
+NAME="V4L2-PIX-FMT-MPEG"
+></A
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_MPEG</CODE
+></TD
+><TD
+>'MPEG'</TD
+><TD
+>MPEG stream. The actual format is determined by
+extended control <CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_STREAM_TYPE</CODE
+>, see
+<A
+HREF="x802.htm#MPEG-CONTROL-ID"
+>Table 1-2</A
+>.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="r5470.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x5665.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>V4L2_PIX_FMT_NV12 ('NV12'), V4L2_PIX_FMT_NV21 ('NV21')</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c2030.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Reserved Format Identifiers</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x5665.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x5665.htm
new file mode 100644
index 0000000..1995b02
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x5665.htm
@@ -0,0 +1,369 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Reserved Format Identifiers</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Image Formats"
+HREF="c2030.htm"><LINK
+REL="PREVIOUS"
+TITLE="Compressed Formats"
+HREF="x5634.htm"><LINK
+REL="NEXT"
+TITLE="Input/Output"
+HREF="c5742.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x5634.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 2. Image Formats</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="c5742.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="PIXFMT-RESERVED"
+>2.7. Reserved Format Identifiers</A
+></H1
+><P
+>These formats are not defined by this specification, they
+are just listed for reference and to avoid naming conflicts. If you
+want to register your own format, send an e-mail to the V4L mailing
+list <A
+HREF="https://listman.redhat.com/mailman/listinfo/video4linux-list"
+TARGET="_top"
+>https://listman.redhat.com/mailman/listinfo/video4linux-list</A
+> for inclusion in the <TT
+CLASS="FILENAME"
+>videodev.h</TT
+>
+file. If you want to share your format with other developers add a
+link to your documentation and send a copy to the maintainer of this
+document, Michael Schimek <CODE
+CLASS="EMAIL"
+>&#60;<A
+HREF="mailto:mschimek@gmx.at"
+>mschimek@gmx.at</A
+>&#62;</CODE
+>, for
+inclusion in this section. If you think your format should be listed
+in a standard format section please make a proposal on the V4L mailing
+list.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="RESERVED-FORMATS"
+></A
+><P
+><B
+>Table 2-8. Reserved Image Formats</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><THEAD
+><TR
+><TH
+>Identifier</TH
+><TH
+>Code</TH
+><TH
+>Details</TH
+></TR
+></THEAD
+><TBODY
+VALIGN="TOP"
+><TR
+><A
+NAME="V4L2-PIX-FMT-DV"
+></A
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_DV</CODE
+></TD
+><TD
+>'dvsd'</TD
+><TD
+>unknown</TD
+></TR
+><TR
+><A
+NAME="V4L2-PIX-FMT-ET61X251"
+></A
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_ET61X251</CODE
+></TD
+><TD
+>'E625'</TD
+><TD
+>Compressed format of the ET61X251 driver.</TD
+></TR
+><TR
+><A
+NAME="V4L2-PIX-FMT-HI240"
+></A
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_HI240</CODE
+></TD
+><TD
+>'HI24'</TD
+><TD
+><P
+>8 bit RGB format used by the BTTV driver,
+<A
+HREF="http://bytesex.org/bttv/"
+TARGET="_top"
+>http://bytesex.org/bttv/</A
+></P
+></TD
+></TR
+><TR
+><A
+NAME="V4L2-PIX-FMT-HM12"
+></A
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_HM12</CODE
+></TD
+><TD
+>'HM12'</TD
+><TD
+><P
+>YUV 4:2:0 format used by the
+IVTV driver, <A
+HREF="http://www.ivtvdriver.org/"
+TARGET="_top"
+>http://www.ivtvdriver.org/</A
+></P
+><P
+>The format is documented in the
+kernel sources in the file <TT
+CLASS="FILENAME"
+>Documentation/video4linux/cx2341x/README.hm12</TT
+></P
+></TD
+></TR
+><TR
+><A
+NAME="V4L2-PIX-FMT-MJPEG"
+></A
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_MJPEG</CODE
+></TD
+><TD
+>'MJPG'</TD
+><TD
+>Compressed format used by the Zoran driver</TD
+></TR
+><TR
+><A
+NAME="V4L2-PIX-FMT-PWC1"
+></A
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_PWC1</CODE
+></TD
+><TD
+>'PWC1'</TD
+><TD
+>Compressed format of the PWC driver.</TD
+></TR
+><TR
+><A
+NAME="V4L2-PIX-FMT-PWC2"
+></A
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_PWC2</CODE
+></TD
+><TD
+>'PWC2'</TD
+><TD
+>Compressed format of the PWC driver.</TD
+></TR
+><TR
+><A
+NAME="V4L2-PIX-FMT-SN9C10X"
+></A
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_SN9C10X</CODE
+></TD
+><TD
+>'S910'</TD
+><TD
+>Compressed format of the SN9C102 driver.</TD
+></TR
+><TR
+><A
+NAME="V4L2-PIX-FMT-WNVA"
+></A
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_WNVA</CODE
+></TD
+><TD
+>'WNVA'</TD
+><TD
+><P
+>Used by the Winnov Videum driver, <A
+HREF="http://www.thedirks.org/winnov/"
+TARGET="_top"
+>http://www.thedirks.org/winnov/</A
+></P
+></TD
+></TR
+><TR
+><A
+NAME="V4L2-PIX-FMT-YYUV"
+></A
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_YYUV</CODE
+></TD
+><TD
+>'YYUV'</TD
+><TD
+>unknown</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x5634.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="c5742.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Compressed Formats</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c2030.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Input/Output</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x5791.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x5791.htm
new file mode 100644
index 0000000..b4e2a79
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x5791.htm
@@ -0,0 +1,642 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Streaming I/O (Memory Mapping)</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Input/Output"
+HREF="c5742.htm"><LINK
+REL="PREVIOUS"
+TITLE="Input/Output"
+HREF="c5742.htm"><LINK
+REL="NEXT"
+TITLE="Streaming I/O (User Pointers)"
+HREF="x5884.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="c5742.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 3. Input/Output</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x5884.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="MMAP"
+>3.2. Streaming I/O (Memory Mapping)</A
+></H1
+><P
+>Input and output devices support this I/O method when the
+<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_STREAMING</CODE
+> flag in the
+<CODE
+CLASS="STRUCTFIELD"
+>capabilities</CODE
+> field of struct&nbsp;<A
+HREF="r13105.htm#V4L2-CAPABILITY"
+>v4l2_capability</A
+>
+returned by the <A
+HREF="r13105.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCAP</CODE
+></A
+> ioctl is set. There are two
+streaming methods, to determine if the memory mapping flavor is
+supported applications must call the <A
+HREF="r13696.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_REQBUFS</CODE
+></A
+> ioctl.</P
+><P
+>Streaming is an I/O method where only pointers to buffers
+are exchanged between application and driver, the data itself is not
+copied. Memory mapping is primarily intended to map buffers in device
+memory into the application's address space. Device memory can be for
+example the video memory on a graphics card with a video capture
+add-on. However, being the most efficient I/O method available for a
+long time, many other drivers support streaming as well, allocating
+buffers in DMA-able main memory.</P
+><P
+>A driver can support many sets of buffers. Each set is
+identified by a unique buffer type value. The sets are independent and
+each set can hold a different type of data. To access different sets
+at the same time different file descriptors must be used.<A
+NAME="AEN5803"
+HREF="x5791.htm#FTN.AEN5803"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+></P
+><P
+>To allocate device buffers applications call the
+<A
+HREF="r13696.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_REQBUFS</CODE
+></A
+> ioctl with the desired number of buffers and buffer
+type, for example <CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_CAPTURE</CODE
+>.
+This ioctl can also be used to change the number of buffers or to free
+the allocated memory, provided none of the buffers are still
+mapped.</P
+><P
+>Before applications can access the buffers they must map
+them into their address space with the <A
+HREF="r13889.htm"
+><CODE
+CLASS="FUNCTION"
+>mmap()</CODE
+></A
+> function. The
+location of the buffers in device memory can be determined with the
+<A
+HREF="r13022.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYBUF</CODE
+></A
+> ioctl. The <CODE
+CLASS="STRUCTFIELD"
+>m.offset</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>length</CODE
+> returned in a struct&nbsp;<A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+> are
+passed as sixth and second parameter to the
+<CODE
+CLASS="FUNCTION"
+>mmap()</CODE
+> function. The offset and length values
+must not be modified. Remember the buffers are allocated in physical
+memory, as opposed to virtual memory which can be swapped out to disk.
+Applications should free the buffers as soon as possible with the
+<A
+HREF="r14037.htm"
+><CODE
+CLASS="FUNCTION"
+>munmap()</CODE
+></A
+> function.</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN5823"
+></A
+><P
+><B
+>Example 3-1. Mapping buffers</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+>struct&nbsp;<A
+HREF="r13696.htm#V4L2-REQUESTBUFFERS"
+>v4l2_requestbuffers</A
+> reqbuf;
+struct {
+        void *start;
+        size_t length;
+} *buffers;
+unsigned int i;
+
+memset (&amp;reqbuf, 0, sizeof (reqbuf));
+reqbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+reqbuf.memory = V4L2_MEMORY_MMAP;
+reqbuf.count = 20;
+
+if (-1 == ioctl (fd, <A
+HREF="r13696.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_REQBUFS</CODE
+></A
+>, &amp;reqbuf)) {
+        if (errno == EINVAL)
+                printf ("Video capturing or mmap-streaming is not supported\n");
+        else
+                perror ("VIDIOC_REQBUFS");
+
+        exit (EXIT_FAILURE);
+}
+
+/* We want at least five buffers. */
+
+if (reqbuf.count &lt; 5) {
+        /* You may need to free the buffers here. */
+        printf ("Not enough buffer memory\n");
+        exit (EXIT_FAILURE);
+}
+
+buffers = calloc (reqbuf.count, sizeof (*buffers));
+assert (buffers != NULL);
+
+for (i = 0; i &lt; reqbuf.count; i++) {
+        struct&nbsp;<A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+> buffer;
+
+        memset (&amp;buffer, 0, sizeof (buffer));
+        buffer.type = reqbuf.type;
+	buffer.memory = V4L2_MEMORY_MMAP;
+        buffer.index = i;
+
+        if (-1 == ioctl (fd, <A
+HREF="r13022.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYBUF</CODE
+></A
+>, &amp;buffer)) {
+                perror ("VIDIOC_QUERYBUF");
+                exit (EXIT_FAILURE);
+        }
+
+        buffers[i].length = buffer.length; /* remember for munmap() */
+
+        buffers[i].start = mmap (NULL, buffer.length,
+                                 PROT_READ | PROT_WRITE, /* recommended */
+                                 MAP_SHARED,             /* recommended */
+                                 fd, buffer.m.offset);
+
+        if (MAP_FAILED == buffers[i].start) {
+                /* If you do not exit here you should unmap() and free()
+                   the buffers mapped so far. */
+                perror ("mmap");
+                exit (EXIT_FAILURE);
+        }
+}
+
+/* Cleanup. */
+
+for (i = 0; i &lt; reqbuf.count; i++)
+        munmap (buffers[i].start, buffers[i].length);
+      </PRE
+></DIV
+><P
+>Conceptually streaming drivers maintain two buffer queues, an incoming
+and an outgoing queue. They separate the synchronous capture or output
+operation locked to a video clock from the application which is
+subject to random disk or network delays and preemption by
+other processes, thereby reducing the probability of data loss.
+The queues are organized as FIFOs, buffers will be
+output in the order enqueued in the incoming FIFO, and were
+captured in the order dequeued from the outgoing FIFO.</P
+><P
+>The driver may require a minimum number of buffers enqueued
+at all times to function, apart of this no limit exists on the number
+of buffers applications can enqueue in advance, or dequeue and
+process. They can also enqueue in a different order than buffers have
+been dequeued, and the driver can <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>fill</I
+></SPAN
+> enqueued
+<SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>empty</I
+></SPAN
+> buffers in any order. <A
+NAME="AEN5836"
+HREF="x5791.htm#FTN.AEN5836"
+><SPAN
+CLASS="footnote"
+>[2]</SPAN
+></A
+> The index number of a buffer (struct&nbsp;<A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+>) plays no role here, it only
+identifies the buffer.</P
+><P
+>Initially all mapped buffers are in dequeued state,
+inaccessible by the driver. For capturing applications it is customary
+to first enqueue all mapped buffers, then to start capturing and enter
+the read loop. Here the application waits until a filled buffer can be
+dequeued, and re-enqueues the buffer when the data is no longer
+needed. Output applications fill and enqueue buffers, when enough
+buffers are stacked up the output is started with
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMON</CODE
+>. In the write loop, when
+the application runs out of free buffers, it must wait until an empty
+buffer can be dequeued and reused.</P
+><P
+>To enqueue and dequeue a buffer applications use the
+<A
+HREF="r12878.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QBUF</CODE
+></A
+> and <A
+HREF="r12878.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_DQBUF</CODE
+></A
+> ioctl. The status of a buffer being
+mapped, enqueued, full or empty can be determined at any time using the
+<A
+HREF="r13022.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYBUF</CODE
+></A
+> ioctl. Two methods exist to suspend execution of the
+application until one or more buffers can be dequeued. By default
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_DQBUF</CODE
+> blocks when no buffer is in the
+outgoing queue. When the <CODE
+CLASS="CONSTANT"
+>O_NONBLOCK</CODE
+> flag was
+given to the <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+> function, <CODE
+CLASS="CONSTANT"
+>VIDIOC_DQBUF</CODE
+>
+returns immediately with an <SPAN
+CLASS="ERRORCODE"
+>EAGAIN</SPAN
+> error code when no buffer is available. The
+<A
+HREF="r14390.htm"
+><CODE
+CLASS="FUNCTION"
+>select()</CODE
+></A
+> or <A
+HREF="r14169.htm"
+><CODE
+CLASS="FUNCTION"
+>poll()</CODE
+></A
+> function are always available.</P
+><P
+>To start and stop capturing or output applications call the
+<A
+HREF="r13817.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMON</CODE
+></A
+> and <A
+HREF="r13817.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMOFF</CODE
+></A
+> ioctl. Note
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMOFF</CODE
+> removes all buffers from both
+queues as a side effect. Since there is no notion of doing anything
+"now" on a multitasking system, if an application needs to synchronize
+with another event it should examine the struct&nbsp;<A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>timestamp</CODE
+> of captured buffers, or set the
+field before enqueuing buffers for output.</P
+><P
+>Drivers implementing memory mapping I/O must
+support the <CODE
+CLASS="CONSTANT"
+>VIDIOC_REQBUFS</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYBUF</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_QBUF</CODE
+>, <CODE
+CLASS="CONSTANT"
+>VIDIOC_DQBUF</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMON</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMOFF</CODE
+> ioctl, the
+<CODE
+CLASS="FUNCTION"
+>mmap()</CODE
+>, <CODE
+CLASS="FUNCTION"
+>munmap()</CODE
+>,
+<CODE
+CLASS="FUNCTION"
+>select()</CODE
+> and <CODE
+CLASS="FUNCTION"
+>poll()</CODE
+>
+function.<A
+NAME="AEN5878"
+HREF="x5791.htm#FTN.AEN5878"
+><SPAN
+CLASS="footnote"
+>[3]</SPAN
+></A
+></P
+><P
+>[capture example]</P
+></DIV
+><H3
+CLASS="FOOTNOTES"
+>Notes</H3
+><TABLE
+BORDER="0"
+CLASS="FOOTNOTES"
+WIDTH="100%"
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="5%"
+><A
+NAME="FTN.AEN5803"
+HREF="x5791.htm#AEN5803"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="95%"
+><P
+>One could use one file descriptor and set the buffer
+type field accordingly when calling <A
+HREF="r12878.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QBUF</CODE
+></A
+> etc., but it makes
+the <CODE
+CLASS="FUNCTION"
+>select()</CODE
+> function ambiguous. We also like the
+clean approach of one file descriptor per logical stream. Video
+overlay for example is also a logical stream, although the CPU is not
+needed for continuous operation.</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="5%"
+><A
+NAME="FTN.AEN5836"
+HREF="x5791.htm#AEN5836"
+><SPAN
+CLASS="footnote"
+>[2]</SPAN
+></A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="95%"
+><P
+>Random enqueue order permits applications processing
+images out of order (such as video codecs) to return buffers earlier,
+reducing the probability of data loss. Random fill order allows
+drivers to reuse buffers on a LIFO-basis, taking advantage of caches
+holding scatter-gather lists and the like.</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="5%"
+><A
+NAME="FTN.AEN5878"
+HREF="x5791.htm#AEN5878"
+><SPAN
+CLASS="footnote"
+>[3]</SPAN
+></A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="95%"
+><P
+>At the driver level <CODE
+CLASS="FUNCTION"
+>select()</CODE
+> and
+<CODE
+CLASS="FUNCTION"
+>poll()</CODE
+> are the same, and
+<CODE
+CLASS="FUNCTION"
+>select()</CODE
+> is too important to be optional. The
+rest should be evident.</P
+></TD
+></TR
+></TABLE
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="c5742.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x5884.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Input/Output</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c5742.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Streaming I/O (User Pointers)</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x5884.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x5884.htm
new file mode 100644
index 0000000..d384330
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x5884.htm
@@ -0,0 +1,467 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Streaming I/O (User Pointers)</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Input/Output"
+HREF="c5742.htm"><LINK
+REL="PREVIOUS"
+TITLE="Streaming I/O (Memory Mapping)"
+HREF="x5791.htm"><LINK
+REL="NEXT"
+TITLE="Asynchronous I/O"
+HREF="x5950.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x5791.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 3. Input/Output</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x5950.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="USERP"
+>3.3. Streaming I/O (User Pointers)</A
+></H1
+><P
+>Input and output devices support this I/O method when the
+<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_STREAMING</CODE
+> flag in the
+<CODE
+CLASS="STRUCTFIELD"
+>capabilities</CODE
+> field of struct&nbsp;<A
+HREF="r13105.htm#V4L2-CAPABILITY"
+>v4l2_capability</A
+>
+returned by the <A
+HREF="r13105.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCAP</CODE
+></A
+> ioctl is set. If the particular user
+pointer method (not only memory mapping) is supported must be
+determined by calling the <A
+HREF="r13696.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_REQBUFS</CODE
+></A
+> ioctl.</P
+><P
+>This I/O method combines advantages of the read/write and
+memory mapping methods. Buffers are allocated by the application
+itself, and can reside for example in virtual or shared memory. Only
+pointers to data are exchanged, these pointers and meta-information
+are passed in struct&nbsp;<A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+>. The driver must be switched
+into user pointer I/O mode by calling the <A
+HREF="r13696.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_REQBUFS</CODE
+></A
+> with the
+desired buffer type. No buffers are allocated beforehands,
+consequently they are not indexed and cannot be queried like mapped
+buffers with the <CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYBUF</CODE
+> ioctl.</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN5899"
+></A
+><P
+><B
+>Example 3-2. Initiating streaming I/O with user pointers</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+>struct&nbsp;<A
+HREF="r13696.htm#V4L2-REQUESTBUFFERS"
+>v4l2_requestbuffers</A
+> reqbuf;
+
+memset (&amp;reqbuf, 0, sizeof (reqbuf));
+reqbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+reqbuf.memory = V4L2_MEMORY_USERPTR;
+
+if (ioctl (fd, <A
+HREF="r13696.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_REQBUFS</CODE
+></A
+>, &amp;reqbuf) == -1) {
+        if (errno == EINVAL)
+                printf ("Video capturing or user pointer streaming is not supported\n");
+        else
+                perror ("VIDIOC_REQBUFS");
+
+        exit (EXIT_FAILURE);
+}
+      </PRE
+></DIV
+><P
+>Buffer addresses and sizes are passed on the fly with the
+<A
+HREF="r12878.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QBUF</CODE
+></A
+> ioctl. Although buffers are commonly cycled,
+applications can pass different addresses and sizes at each
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_QBUF</CODE
+> call. If required by the hardware the
+driver swaps memory pages within physical memory to create a
+continuous area of memory. This happens transparently to the
+application in the virtual memory subsystem of the kernel. When buffer
+pages have been swapped out to disk they are brought back and finally
+locked in physical memory for DMA.<A
+NAME="AEN5909"
+HREF="x5884.htm#FTN.AEN5909"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+></P
+><P
+>Filled or displayed buffers are dequeued with the
+<A
+HREF="r12878.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_DQBUF</CODE
+></A
+> ioctl. The driver can unlock the memory pages at any
+time between the completion of the DMA and this ioctl. The memory is
+also unlocked when <A
+HREF="r13817.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMOFF</CODE
+></A
+> is called, <A
+HREF="r13696.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_REQBUFS</CODE
+></A
+>, or
+when the device is closed. Applications must take care not to free
+buffers without dequeuing. For once, the buffers remain locked until
+further, wasting physical memory. Second the driver will not be
+notified when the memory is returned to the application's free list
+and subsequently reused for other purposes, possibly completing the
+requested DMA and overwriting valuable data.</P
+><P
+>For capturing applications it is customary to enqueue a
+number of empty buffers, to start capturing and enter the read loop.
+Here the application waits until a filled buffer can be dequeued, and
+re-enqueues the buffer when the data is no longer needed. Output
+applications fill and enqueue buffers, when enough buffers are stacked
+up output is started. In the write loop, when the application
+runs out of free buffers it must wait until an empty buffer can be
+dequeued and reused. Two methods exist to suspend execution of the
+application until one or more buffers can be dequeued. By default
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_DQBUF</CODE
+> blocks when no buffer is in the
+outgoing queue. When the <CODE
+CLASS="CONSTANT"
+>O_NONBLOCK</CODE
+> flag was
+given to the <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+> function, <CODE
+CLASS="CONSTANT"
+>VIDIOC_DQBUF</CODE
+>
+returns immediately with an <SPAN
+CLASS="ERRORCODE"
+>EAGAIN</SPAN
+> error code when no buffer is available. The
+<A
+HREF="r14390.htm"
+><CODE
+CLASS="FUNCTION"
+>select()</CODE
+></A
+> or <A
+HREF="r14169.htm"
+><CODE
+CLASS="FUNCTION"
+>poll()</CODE
+></A
+> function are always available.</P
+><P
+>To start and stop capturing or output applications call the
+<A
+HREF="r13817.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMON</CODE
+></A
+> and <A
+HREF="r13817.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMOFF</CODE
+></A
+> ioctl. Note
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMOFF</CODE
+> removes all buffers from both
+queues and unlocks all buffers as a side effect. Since there is no
+notion of doing anything "now" on a multitasking system, if an
+application needs to synchronize with another event it should examine
+the struct&nbsp;<A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+> <CODE
+CLASS="STRUCTFIELD"
+>timestamp</CODE
+> of captured
+buffers, or set the field before enqueuing buffers for output.</P
+><P
+>Drivers implementing user pointer I/O must
+support the <CODE
+CLASS="CONSTANT"
+>VIDIOC_REQBUFS</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_QBUF</CODE
+>, <CODE
+CLASS="CONSTANT"
+>VIDIOC_DQBUF</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMON</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMOFF</CODE
+> ioctl, the
+<CODE
+CLASS="FUNCTION"
+>select()</CODE
+> and <CODE
+CLASS="FUNCTION"
+>poll()</CODE
+> function.<A
+NAME="AEN5945"
+HREF="x5884.htm#FTN.AEN5945"
+><SPAN
+CLASS="footnote"
+>[2]</SPAN
+></A
+></P
+></DIV
+><H3
+CLASS="FOOTNOTES"
+>Notes</H3
+><TABLE
+BORDER="0"
+CLASS="FOOTNOTES"
+WIDTH="100%"
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="5%"
+><A
+NAME="FTN.AEN5909"
+HREF="x5884.htm#AEN5909"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="95%"
+><P
+>We expect that frequently used buffers are typically not
+swapped out. Anyway, the process of swapping, locking or generating
+scatter-gather lists may be time consuming. The delay can be masked by
+the depth of the incoming buffer queue, and perhaps by maintaining
+caches assuming a buffer will be soon enqueued again. On the other
+hand, to optimize memory usage drivers can limit the number of buffers
+locked in advance and recycle the most recently used buffers first. Of
+course, the pages of empty buffers in the incoming queue need not be
+saved to disk. Output buffers must be saved on the incoming and
+outgoing queue because an application may share them with other
+processes.</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="5%"
+><A
+NAME="FTN.AEN5945"
+HREF="x5884.htm#AEN5945"
+><SPAN
+CLASS="footnote"
+>[2]</SPAN
+></A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="95%"
+><P
+>At the driver level <CODE
+CLASS="FUNCTION"
+>select()</CODE
+> and
+<CODE
+CLASS="FUNCTION"
+>poll()</CODE
+> are the same, and
+<CODE
+CLASS="FUNCTION"
+>select()</CODE
+> is too important to be optional. The
+rest should be evident.</P
+></TD
+></TR
+></TABLE
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x5791.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x5950.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Streaming I/O (Memory Mapping)</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c5742.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Asynchronous I/O</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x5950.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x5950.htm
new file mode 100644
index 0000000..0844117
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x5950.htm
@@ -0,0 +1,146 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Asynchronous I/O</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Input/Output"
+HREF="c5742.htm"><LINK
+REL="PREVIOUS"
+TITLE="Streaming I/O (User Pointers)"
+HREF="x5884.htm"><LINK
+REL="NEXT"
+TITLE="Buffers"
+HREF="x5953.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x5884.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 3. Input/Output</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x5953.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="ASYNC"
+>3.4. Asynchronous I/O</A
+></H1
+><P
+>This method is not defined yet.</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x5884.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x5953.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Streaming I/O (User Pointers)</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c5742.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Buffers</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x5953.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x5953.htm
new file mode 100644
index 0000000..d00bbc9
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x5953.htm
@@ -0,0 +1,1380 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Buffers</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Input/Output"
+HREF="c5742.htm"><LINK
+REL="PREVIOUS"
+TITLE="Asynchronous I/O"
+HREF="x5950.htm"><LINK
+REL="NEXT"
+TITLE="Field Order"
+HREF="x6386.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x5950.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 3. Input/Output</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x6386.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="BUFFER"
+>3.5. Buffers</A
+></H1
+><P
+>A buffer contains data exchanged by application and
+driver using one of the Streaming I/O methods. Only pointers to
+buffers are exchanged, the data itself is not copied. These pointers,
+together with meta-information like timestamps or field parity, are
+stored in a struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_buffer</CODE
+>, argument to
+the <A
+HREF="r13022.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYBUF</CODE
+></A
+>, <A
+HREF="r12878.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QBUF</CODE
+></A
+> and <A
+HREF="r12878.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_DQBUF</CODE
+></A
+> ioctl.</P
+><P
+>Nominally timestamps refer to the first data byte transmitted.
+In practice however the wide range of hardware covered by the V4L2 API
+limits timestamp accuracy. Often an interrupt routine will
+sample the system clock shortly after the field or frame was stored
+completely in memory. So applications must expect a constant
+difference up to one field or frame period plus a small (few scan
+lines) random error. The delay and error can be much
+larger due to compression or transmission over an external bus when
+the frames are not properly stamped by the sender. This is frequently
+the case with USB cameras. Here timestamps refer to the instant the
+field or frame was received by the driver, not the capture time. These
+devices identify by not enumerating any video standards, see <A
+HREF="x448.htm"
+>Section 1.7</A
+>.</P
+><P
+>Similar limitations apply to output timestamps. Typically
+the video hardware locks to a clock controlling the video timing, the
+horizontal and vertical synchronization pulses. At some point in the
+line sequence, possibly the vertical blanking, an interrupt routine
+samples the system clock, compares against the timestamp and programs
+the hardware to repeat the previous field or frame, or to display the
+buffer contents.</P
+><P
+>Apart of limitations of the video device and natural
+inaccuracies of all clocks, it should be noted system time itself is
+not perfectly stable. It can be affected by power saving cycles,
+warped to insert leap seconds, or even turned back or forth by the
+system administrator affecting long term measurements. <A
+NAME="AEN5967"
+HREF="x5953.htm#FTN.AEN5967"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+></P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-BUFFER"
+></A
+><P
+><B
+>Table 3-1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_buffer</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="20%"
+TITLE="C1"><COL
+WIDTH="20%"
+TITLE="C2"><COL
+WIDTH="20%"
+TITLE="C3"><COL
+WIDTH="40%"
+TITLE="C4"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>Number of the buffer, set by the application. This
+field is only used for <A
+HREF="x5791.htm"
+>memory mapping</A
+> I/O
+and can range from zero to the number of buffers allocated
+with the <A
+HREF="r13696.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_REQBUFS</CODE
+></A
+> ioctl (struct&nbsp;<A
+HREF="r13696.htm#V4L2-REQUESTBUFFERS"
+>v4l2_requestbuffers</A
+> <CODE
+CLASS="STRUCTFIELD"
+>count</CODE
+>) minus one.</TD
+></TR
+><TR
+><TD
+>enum&nbsp;<A
+HREF="x5953.htm#V4L2-BUF-TYPE"
+>v4l2_buf_type</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>Type of the buffer, same as struct&nbsp;<A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> or struct&nbsp;<A
+HREF="r13696.htm#V4L2-REQUESTBUFFERS"
+>v4l2_requestbuffers</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+>, set by the application.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>bytesused</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>The number of bytes occupied by the data in the
+buffer. It depends on the negotiated data format and may change with
+each buffer for compressed variable size data like JPEG images.
+Drivers must set this field when <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+>
+refers to an input stream, applications when an output stream.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>flags</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>Flags set by the application or driver, see <A
+HREF="x5953.htm#BUFFER-FLAGS"
+>Table 3-3</A
+>.</TD
+></TR
+><TR
+><TD
+>enum&nbsp;<A
+HREF="x6386.htm#V4L2-FIELD"
+>v4l2_field</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>field</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>Indicates the field order of the image in the
+buffer, see <A
+HREF="x6386.htm#V4L2-FIELD"
+>Table 3-8</A
+>. This field is not used when
+the buffer contains VBI data. Drivers must set it when
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> refers to an input stream,
+applications when an output stream.</TD
+></TR
+><TR
+><TD
+>struct timeval</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>timestamp</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+><P
+>For input streams this is the
+system time (as returned by the <CODE
+CLASS="FUNCTION"
+>gettimeofday()</CODE
+>
+function) when the first data byte was captured. For output streams
+the data will not be displayed before this time, secondary to the
+nominal frame rate determined by the current video standard in
+enqueued order. Applications can for example zero this field to
+display frames as soon as possible. The driver stores the time at
+which the first data byte was actually sent out in the
+<CODE
+CLASS="STRUCTFIELD"
+>timestamp</CODE
+> field. This permits
+applications to monitor the drift between the video and system
+clock.</P
+></TD
+></TR
+><TR
+><TD
+>struct&nbsp;<A
+HREF="x5953.htm#V4L2-TIMECODE"
+>v4l2_timecode</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>timecode</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>When <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> is
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_CAPTURE</CODE
+> and the
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_FLAG_TIMECODE</CODE
+> flag is set in
+<CODE
+CLASS="STRUCTFIELD"
+>flags</CODE
+>, this structure contains a frame
+timecode. In <A
+HREF="x6386.htm#V4L2-FIELD"
+>V4L2_FIELD_ALTERNATE</A
+>
+mode the top and bottom field contain the same timecode.
+Timecodes are intended to help video editing and are typically recorded on
+video tapes, but also embedded in compressed formats like MPEG. This
+field is independent of the <CODE
+CLASS="STRUCTFIELD"
+>timestamp</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>sequence</CODE
+> fields.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>sequence</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>Set by the driver, counting the frames in the
+sequence.</TD
+></TR
+><TR
+><TD
+COLSPAN="4"
+><P
+>In <A
+HREF="x6386.htm#V4L2-FIELD"
+>V4L2_FIELD_ALTERNATE</A
+> mode the top and
+bottom field have the same sequence number. The count starts at zero
+and includes dropped or repeated frames. A dropped frame was received
+by an input device but could not be stored due to lack of free buffer
+space. A repeated frame was displayed again by an output device
+because the application did not pass new data in
+time.</P
+><P
+>Note this may count the frames received
+e.g. over USB, without taking into account the frames dropped by the
+remote hardware due to limited compression throughput or bus
+bandwidth. These devices identify by not enumerating any video
+standards, see <A
+HREF="x448.htm"
+>Section 1.7</A
+>.</P
+></TD
+></TR
+><TR
+><TD
+>enum&nbsp;<A
+HREF="x5953.htm#V4L2-MEMORY"
+>v4l2_memory</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>memory</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>This field must be set by applications and/or drivers
+in accordance with the selected I/O method.</TD
+></TR
+><TR
+><TD
+>union</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>m</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>offset</CODE
+></TD
+><TD
+>When <CODE
+CLASS="STRUCTFIELD"
+>memory</CODE
+> is
+<CODE
+CLASS="CONSTANT"
+>V4L2_MEMORY_MMAP</CODE
+> this is the offset of the buffer
+from the start of the device memory. The value is returned by the
+driver and apart of serving as parameter to the <A
+HREF="r13889.htm"
+><CODE
+CLASS="FUNCTION"
+>mmap()</CODE
+></A
+> function
+not useful for applications. See <A
+HREF="x5791.htm"
+>Section 3.2</A
+> for details.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>unsigned long</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>userptr</CODE
+></TD
+><TD
+>When <CODE
+CLASS="STRUCTFIELD"
+>memory</CODE
+> is
+<CODE
+CLASS="CONSTANT"
+>V4L2_MEMORY_USERPTR</CODE
+> this is a pointer to the
+buffer (casted to unsigned long type) in virtual memory, set by the
+application. See <A
+HREF="x5884.htm"
+>Section 3.3</A
+> for details.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>length</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>Size of the buffer (not the payload) in bytes.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>input</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>Some video capture drivers support rapid and
+synchronous video input changes, a function useful for example in
+video surveillance applications. For this purpose applications set the
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_FLAG_INPUT</CODE
+> flag, and this field to the
+number of a video input as in struct&nbsp;<A
+HREF="r8936.htm#V4L2-INPUT"
+>v4l2_input</A
+> field
+<CODE
+CLASS="STRUCTFIELD"
+>index</CODE
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+></TD
+><TD
+>&nbsp;</TD
+><TD
+>A place holder for future extensions and custom
+(driver defined) buffer types
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_PRIVATE</CODE
+> and higher.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-BUF-TYPE"
+></A
+><P
+><B
+>Table 3-2. enum v4l2_buf_type</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_CAPTURE</CODE
+></TD
+><TD
+>1</TD
+><TD
+>Buffer of a video capture stream, see <A
+HREF="c6488.htm#CAPTURE"
+>Section 4.1</A
+>.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_OUTPUT</CODE
+></TD
+><TD
+>2</TD
+><TD
+>Buffer of a video output stream, see <A
+HREF="x6831.htm"
+>Section 4.3</A
+>.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_OVERLAY</CODE
+></TD
+><TD
+>3</TD
+><TD
+>Buffer for video overlay, see <A
+HREF="x6570.htm"
+>Section 4.2</A
+>.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VBI_CAPTURE</CODE
+></TD
+><TD
+>4</TD
+><TD
+>Buffer of a raw VBI capture stream, see <A
+HREF="x7013.htm"
+>Section 4.7</A
+>.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VBI_OUTPUT</CODE
+></TD
+><TD
+>5</TD
+><TD
+>Buffer of a raw VBI output stream, see <A
+HREF="x7013.htm"
+>Section 4.7</A
+>.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_SLICED_VBI_CAPTURE</CODE
+></TD
+><TD
+>6</TD
+><TD
+>Buffer of a sliced VBI capture stream, see <A
+HREF="x7236.htm"
+>Section 4.8</A
+>.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_SLICED_VBI_OUTPUT</CODE
+></TD
+><TD
+>7</TD
+><TD
+>Buffer of a sliced VBI output stream, see <A
+HREF="x7236.htm"
+>Section 4.8</A
+>.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY</CODE
+></TD
+><TD
+>8</TD
+><TD
+>Buffer for video output overlay (OSD), see <A
+HREF="x6909.htm"
+>Section 4.4</A
+>. Status: <A
+HREF="x16453.htm"
+>Experimental</A
+>.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_PRIVATE</CODE
+></TD
+><TD
+>0x80</TD
+><TD
+>This and higher values are reserved for custom
+(driver defined) buffer types.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="BUFFER-FLAGS"
+></A
+><P
+><B
+>Table 3-3. Buffer Flags</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_FLAG_MAPPED</CODE
+></TD
+><TD
+>0x0001</TD
+><TD
+>The buffer resides in device memory and has been mapped
+into the application's address space, see <A
+HREF="x5791.htm"
+>Section 3.2</A
+> for details.
+Drivers set or clear this flag when the
+<A
+HREF="r13022.htm"
+>VIDIOC_QUERYBUF</A
+>, <A
+HREF="r12878.htm"
+>VIDIOC_QBUF</A
+> or <A
+HREF="r12878.htm"
+>VIDIOC_DQBUF</A
+> ioctl is called. Set by the driver.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_FLAG_QUEUED</CODE
+></TD
+><TD
+>0x0002</TD
+><TD
+>Internally drivers maintain two buffer queues, an
+incoming and outgoing queue. When this flag is set, the buffer is
+currently on the incoming queue. It automatically moves to the
+outgoing queue after the buffer has been filled (capture devices) or
+displayed (output devices). Drivers set or clear this flag when the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYBUF</CODE
+> ioctl is called. After
+(successful) calling the <CODE
+CLASS="CONSTANT"
+>VIDIOC_QBUF </CODE
+>ioctl it is
+always set and after <CODE
+CLASS="CONSTANT"
+>VIDIOC_DQBUF</CODE
+> always
+cleared.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_FLAG_DONE</CODE
+></TD
+><TD
+>0x0004</TD
+><TD
+>When this flag is set, the buffer is currently on
+the outgoing queue, ready to be dequeued from the driver. Drivers set
+or clear this flag when the <CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYBUF</CODE
+> ioctl
+is called. After calling the <CODE
+CLASS="CONSTANT"
+>VIDIOC_QBUF</CODE
+> or
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_DQBUF</CODE
+> it is always cleared. Of course a
+buffer cannot be on both queues at the same time, the
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_FLAG_QUEUED</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_FLAG_DONE</CODE
+> flag are mutually exclusive.
+They can be both cleared however, then the buffer is in "dequeued"
+state, in the application domain to say so.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_FLAG_KEYFRAME</CODE
+></TD
+><TD
+>0x0008</TD
+><TD
+>Drivers set or clear this flag when calling the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_DQBUF</CODE
+> ioctl. It may be set by video
+capture devices when the buffer contains a compressed image which is a
+key frame (or field), i.&nbsp;e. can be decompressed on its own.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_FLAG_PFRAME</CODE
+></TD
+><TD
+>0x0010</TD
+><TD
+>Similar to <CODE
+CLASS="CONSTANT"
+>V4L2_BUF_FLAG_KEYFRAME</CODE
+>
+this flags predicted frames or fields which contain only differences to a
+previous key frame.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_FLAG_BFRAME</CODE
+></TD
+><TD
+>0x0020</TD
+><TD
+>Similar to <CODE
+CLASS="CONSTANT"
+>V4L2_BUF_FLAG_PFRAME</CODE
+>
+        this is a bidirectional predicted frame or field. [ooc tbd]</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_FLAG_TIMECODE</CODE
+></TD
+><TD
+>0x0100</TD
+><TD
+>The <CODE
+CLASS="STRUCTFIELD"
+>timecode</CODE
+> field is valid.
+Drivers set or clear this flag when the <CODE
+CLASS="CONSTANT"
+>VIDIOC_DQBUF</CODE
+>
+ioctl is called.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_BUF_FLAG_INPUT</CODE
+></TD
+><TD
+>0x0200</TD
+><TD
+>The <CODE
+CLASS="STRUCTFIELD"
+>input</CODE
+> field is valid.
+Applications set or clear this flag before calling the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_QBUF</CODE
+> ioctl.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-MEMORY"
+></A
+><P
+><B
+>Table 3-4. enum v4l2_memory</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MEMORY_MMAP</CODE
+></TD
+><TD
+>1</TD
+><TD
+>The buffer is used for <A
+HREF="x5791.htm"
+>memory
+mapping</A
+> I/O.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MEMORY_USERPTR</CODE
+></TD
+><TD
+>2</TD
+><TD
+>The buffer is used for <A
+HREF="x5884.htm"
+>user
+pointer</A
+> I/O.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MEMORY_OVERLAY</CODE
+></TD
+><TD
+>3</TD
+><TD
+>[to do]</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN6266"
+>3.5.1. Timecodes</A
+></H2
+><P
+>The <CODE
+CLASS="STRUCTNAME"
+>v4l2_timecode</CODE
+> structure is
+designed to hold a <A
+HREF="b17127.htm#SMPTE12M"
+><ABBR
+CLASS="ABBREV"
+>SMPTE&nbsp;12M</ABBR
+></A
+> or similar timecode.
+(struct <CODE
+CLASS="STRUCTNAME"
+>timeval</CODE
+> timestamps are stored in
+struct&nbsp;<A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+> field <CODE
+CLASS="STRUCTFIELD"
+>timestamp</CODE
+>.)</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-TIMECODE"
+></A
+><P
+><B
+>Table 3-5. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_timecode</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+></TD
+><TD
+>Frame rate the timecodes are based on, see <A
+HREF="x5953.htm#TIMECODE-TYPE"
+>Table 3-6</A
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>flags</CODE
+></TD
+><TD
+>Timecode flags, see <A
+HREF="x5953.htm#TIMECODE-FLAGS"
+>Table 3-7</A
+>.</TD
+></TR
+><TR
+><TD
+>__u8</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>frames</CODE
+></TD
+><TD
+>Frame count, 0 ... 23/24/29/49/59, depending on the
+            type of timecode.</TD
+></TR
+><TR
+><TD
+>__u8</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>seconds</CODE
+></TD
+><TD
+>Seconds count, 0 ... 59. This is a binary, not BCD number.</TD
+></TR
+><TR
+><TD
+>__u8</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>minutes</CODE
+></TD
+><TD
+>Minutes count, 0 ... 59. This is a binary, not BCD number.</TD
+></TR
+><TR
+><TD
+>__u8</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>hours</CODE
+></TD
+><TD
+>Hours count, 0 ... 29. This is a binary, not BCD number.</TD
+></TR
+><TR
+><TD
+>__u8</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>userbits</CODE
+>[4]</TD
+><TD
+>The "user group" bits from the timecode.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="TIMECODE-TYPE"
+></A
+><P
+><B
+>Table 3-6. Timecode Types</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TC_TYPE_24FPS</CODE
+></TD
+><TD
+>1</TD
+><TD
+>24 frames per second, i.&nbsp;e. film.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TC_TYPE_25FPS</CODE
+></TD
+><TD
+>2</TD
+><TD
+>25 frames per second, i.&nbsp;e. PAL or SECAM video.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TC_TYPE_30FPS</CODE
+></TD
+><TD
+>3</TD
+><TD
+>30 frames per second, i.&nbsp;e. NTSC video.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TC_TYPE_50FPS</CODE
+></TD
+><TD
+>4</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TC_TYPE_60FPS</CODE
+></TD
+><TD
+>5</TD
+><TD
+>&nbsp;</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="TIMECODE-FLAGS"
+></A
+><P
+><B
+>Table 3-7. Timecode Flags</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TC_FLAG_DROPFRAME</CODE
+></TD
+><TD
+>0x0001</TD
+><TD
+>Indicates "drop frame" semantics for counting frames
+in 29.97 fps material. When set, frame numbers 0 and 1 at the start of
+each minute, except minutes 0, 10, 20, 30, 40, 50 are omitted from the
+count.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TC_FLAG_COLORFRAME</CODE
+></TD
+><TD
+>0x0002</TD
+><TD
+>The "color frame" flag.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TC_USERBITS_field</CODE
+></TD
+><TD
+>0x000C</TD
+><TD
+>Field mask for the "binary group flags".</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TC_USERBITS_USERDEFINED</CODE
+></TD
+><TD
+>0x0000</TD
+><TD
+>Unspecified format.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_TC_USERBITS_8BITCHARS</CODE
+></TD
+><TD
+>0x0008</TD
+><TD
+>8-bit ISO characters.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+></DIV
+><H3
+CLASS="FOOTNOTES"
+>Notes</H3
+><TABLE
+BORDER="0"
+CLASS="FOOTNOTES"
+WIDTH="100%"
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="5%"
+><A
+NAME="FTN.AEN5967"
+HREF="x5953.htm#AEN5967"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="95%"
+><P
+>Since no other Linux multimedia
+API supports unadjusted time it would be foolish to introduce here. We
+must use a universally supported clock to synchronize different media,
+hence time of day.</P
+></TD
+></TR
+></TABLE
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x5950.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x6386.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Asynchronous I/O</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c5742.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Field Order</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x6386.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x6386.htm
new file mode 100644
index 0000000..7dd8107
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x6386.htm
@@ -0,0 +1,467 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Field Order</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Input/Output"
+HREF="c5742.htm"><LINK
+REL="PREVIOUS"
+TITLE="Buffers"
+HREF="x5953.htm"><LINK
+REL="NEXT"
+TITLE="Interfaces"
+HREF="c6488.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x5953.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 3. Input/Output</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="c6488.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="FIELD-ORDER"
+>3.6. Field Order</A
+></H1
+><P
+>We have to distinguish between progressive and interlaced
+video. Progressive video transmits all lines of a video image
+sequentially. Interlaced video divides an image into two fields,
+containing only the odd and even lines of the image, respectively.
+Alternating the so called odd and even field are transmitted, and due
+to a small delay between fields a cathode ray TV displays the lines
+interleaved, yielding the original frame. This curious technique was
+invented because at refresh rates similar to film the image would
+fade out too quickly. Transmitting fields reduces the flicker without
+the necessity of doubling the frame rate and with it the bandwidth
+required for each channel.</P
+><P
+>It is important to understand a video camera does not expose
+one frame at a time, merely transmitting the frames separated into
+fields. The fields are in fact captured at two different instances in
+time. An object on screen may well move between one field and the
+next. For applications analysing motion it is of paramount importance
+to recognize which field of a frame is older, the <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>temporal
+order</I
+></SPAN
+>.</P
+><P
+>When the driver provides or accepts images field by field
+rather than interleaved, it is also important applications understand
+how the fields combine to frames. We distinguish between top and
+bottom fields, the <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>spatial order</I
+></SPAN
+>: The first line
+of the top field is the first line of an interlaced frame, the first
+line of the bottom field is the second line of that frame.</P
+><P
+>However because fields were captured one after the other,
+arguing whether a frame commences with the top or bottom field is
+pointless. Any two successive top and bottom, or bottom and top fields
+yield a valid frame. Only when the source was progressive to begin
+with, e.&nbsp;g. when transferring film to video, two fields may come from
+the same frame, creating a natural order.</P
+><P
+>Counter to intuition the top field is not necessarily the
+older field. Whether the older field contains the top or bottom lines
+is a convention determined by the video standard. Hence the
+distinction between temporal and spatial order of fields. The diagrams
+below should make this clearer.</P
+><P
+>All video capture and output devices must report the current
+field order. Some drivers may permit the selection of a different
+order, to this end applications initialize the
+<CODE
+CLASS="STRUCTFIELD"
+>field</CODE
+> field of struct&nbsp;<A
+HREF="c2030.htm#V4L2-PIX-FORMAT"
+>v4l2_pix_format</A
+> before
+calling the <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctl. If this is not desired it should
+have the value <CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_ANY</CODE
+> (0).</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-FIELD"
+></A
+><P
+><B
+>Table 3-8. enum v4l2_field</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_ANY</CODE
+></TD
+><TD
+>0</TD
+><TD
+>Applications request this field order when any
+one of the <CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_NONE</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_TOP</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_BOTTOM</CODE
+>, or
+<CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_INTERLACED</CODE
+> formats is acceptable.
+Drivers choose depending on hardware capabilities or e.&nbsp;g. the
+requested image size, and return the actual field order. struct&nbsp;<A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>field</CODE
+> can never be
+<CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_ANY</CODE
+>.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_NONE</CODE
+></TD
+><TD
+>1</TD
+><TD
+>Images are in progressive format, not interlaced.
+The driver may also indicate this order when it cannot distinguish
+between <CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_TOP</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_BOTTOM</CODE
+>.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_TOP</CODE
+></TD
+><TD
+>2</TD
+><TD
+>Images consist of the top field only.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_BOTTOM</CODE
+></TD
+><TD
+>3</TD
+><TD
+>Images consist of the bottom field only.
+Applications may wish to prevent a device from capturing interlaced
+images because they will have "comb" or "feathering" artefacts around
+moving objects.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_INTERLACED</CODE
+></TD
+><TD
+>4</TD
+><TD
+>Images contain both fields, interleaved line by
+line. The temporal order of the fields (whether the top or bottom
+field is first transmitted) depends on the current video standard.
+M/NTSC transmits the bottom field first, all other standards the top
+field first.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_SEQ_TB</CODE
+></TD
+><TD
+>5</TD
+><TD
+>Images contain both fields, the top field lines
+are stored first in memory, immediately followed by the bottom field
+lines. Fields are always stored in temporal order, the older one first
+in memory. Image sizes refer to the frame, not fields.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_SEQ_BT</CODE
+></TD
+><TD
+>6</TD
+><TD
+>Images contain both fields, the bottom field
+lines are stored first in memory, immediately followed by the top
+field lines. Fields are always stored in temporal order, the older one
+first in memory. Image sizes refer to the frame, not fields.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_ALTERNATE</CODE
+></TD
+><TD
+>7</TD
+><TD
+>The two fields of a frame are passed in separate
+buffers, in temporal order, i.&nbsp;e. the older one first. To indicate the field
+parity (whether the current field is a top or bottom field) the driver
+or application, depending on data direction, must set struct&nbsp;<A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>field</CODE
+> to
+<CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_TOP</CODE
+> or
+<CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_BOTTOM</CODE
+>. Any two successive fields pair
+to build a frame. If fields are successive, without any dropped fields
+between them (fields can drop individually), can be determined from
+the struct&nbsp;<A
+HREF="x5953.htm#V4L2-BUFFER"
+>v4l2_buffer</A
+> <CODE
+CLASS="STRUCTFIELD"
+>sequence</CODE
+> field. Image
+sizes refer to the frame, not fields. This format cannot be selected
+when using the read/write I/O method.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_INTERLACED_TB</CODE
+></TD
+><TD
+>8</TD
+><TD
+>Images contain both fields, interleaved line by
+line, top field first. The top field is transmitted first.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_INTERLACED_BT</CODE
+></TD
+><TD
+>9</TD
+><TD
+>Images contain both fields, interleaved line by
+line, top field first. The bottom field is transmitted first.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="FIGURE"
+><A
+NAME="FIELDSEQ-TB"
+></A
+><P
+><B
+>Figure 3-1. Field Order, Top Field First Transmitted</B
+></P
+><DIV
+CLASS="MEDIAOBJECT"
+><P
+><IMG
+SRC="fieldseq_tb.gif"></P
+></DIV
+></DIV
+><DIV
+CLASS="FIGURE"
+><A
+NAME="FIELDSEQ-BT"
+></A
+><P
+><B
+>Figure 3-2. Field Order, Bottom Field First Transmitted</B
+></P
+><DIV
+CLASS="MEDIAOBJECT"
+><P
+><IMG
+SRC="fieldseq_bt.gif"></P
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x5953.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="c6488.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Buffers</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c5742.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Interfaces</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x6570.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x6570.htm
new file mode 100644
index 0000000..bc4c6ef
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x6570.htm
@@ -0,0 +1,1107 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Video Overlay Interface</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Interfaces"
+HREF="c6488.htm"><LINK
+REL="PREVIOUS"
+TITLE="Interfaces"
+HREF="c6488.htm"><LINK
+REL="NEXT"
+TITLE="Video Output Interface"
+HREF="x6831.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="c6488.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 4. Interfaces</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x6831.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="OVERLAY"
+>4.2. Video Overlay Interface</A
+></H1
+><FONT
+COLOR="RED"
+>Also known as Framebuffer Overlay or Previewing</FONT
+><P
+>Video overlay devices have the ability to genlock (TV-)video
+into the (VGA-)video signal of a graphics card, or to store captured
+images directly in video memory of a graphics card, typically with
+clipping. This can be considerable more efficient than capturing
+images and displaying them by other means. In the old days when only
+nuclear power plants needed cooling towers this used to be the only
+way to put live video into a window.</P
+><P
+>Video overlay devices are accessed through the same character
+special files as <A
+HREF="c6488.htm#CAPTURE"
+>video capture</A
+> devices.
+Note the default function of a <TT
+CLASS="FILENAME"
+>/dev/video</TT
+> device
+is video capturing. The overlay function is only available after
+calling the <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctl.</P
+><P
+>The driver may support simultaneous overlay and capturing
+using the read/write and streaming I/O methods. If so, operation at
+the nominal frame rate of the video standard is not guaranteed. Frames
+may be directed away from overlay to capture, or one field may be used
+for overlay and the other for capture if the capture parameters permit
+this.</P
+><P
+>Applications should use different file descriptors for
+capturing and overlay. This must be supported by all drivers capable
+of simultaneous capturing and overlay. Optionally these drivers may
+also permit capturing and overlay with a single file descriptor for
+compatibility with V4L and earlier versions of V4L2.<A
+NAME="AEN6581"
+HREF="x6570.htm#FTN.AEN6581"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+></P
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN6587"
+>4.2.1. Querying Capabilities</A
+></H2
+><P
+>Devices supporting the video overlay interface set the
+<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_VIDEO_OVERLAY</CODE
+> flag in the
+<CODE
+CLASS="STRUCTFIELD"
+>capabilities</CODE
+> field of struct&nbsp;<A
+HREF="r13105.htm#V4L2-CAPABILITY"
+>v4l2_capability</A
+>
+returned by the <A
+HREF="r13105.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCAP</CODE
+></A
+> ioctl. The overlay I/O method specified
+below must be supported. Tuners and audio inputs are optional.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN6595"
+>4.2.2. Supplemental Functions</A
+></H2
+><P
+>Video overlay devices shall support <A
+HREF="x341.htm"
+>audio input</A
+>, <A
+HREF="x394.htm"
+>tuner</A
+>, <A
+HREF="x542.htm"
+>controls</A
+>,
+<A
+HREF="x1904.htm"
+>cropping and scaling</A
+> and <A
+HREF="x2009.htm"
+>streaming parameter</A
+> ioctls as needed.
+The <A
+HREF="x309.htm"
+>video input</A
+> and <A
+HREF="x448.htm"
+>video standard</A
+> ioctls must be supported by
+all video overlay devices.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN6605"
+>4.2.3. Setup</A
+></H2
+><P
+>Before overlay can commence applications must program the
+driver with frame buffer parameters, namely the address and size of
+the frame buffer and the image format, for example RGB 5:6:5. The
+<A
+HREF="r10595.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FBUF</CODE
+></A
+> and <A
+HREF="r10595.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FBUF</CODE
+></A
+> ioctls are available to get
+and set these parameters, respectively. The
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FBUF</CODE
+> ioctl is privileged because it
+allows to set up DMA into physical memory, bypassing the memory
+protection mechanisms of the kernel. Only the superuser can change the
+frame buffer address and size. Users are not supposed to run TV
+applications as root or with SUID bit set. A small helper application
+with suitable privileges should query the graphics system and program
+the V4L2 driver at the appropriate time.</P
+><P
+>Some devices add the video overlay to the output signal
+of the graphics card. In this case the frame buffer is not modified by
+the video device, and the frame buffer address and pixel format are
+not needed by the driver. The <CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FBUF</CODE
+> ioctl
+is not privileged. An application can check for this type of device by
+calling the <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FBUF</CODE
+> ioctl.</P
+><P
+>A driver may support any (or none) of five clipping/blending
+methods:<P
+></P
+><OL
+TYPE="1"
+><LI
+><P
+>Chroma-keying displays the overlaid image only where
+pixels in the primary graphics surface assume a certain color.</P
+></LI
+><LI
+><P
+>A bitmap can be specified where each bit corresponds
+to a pixel in the overlaid image. When the bit is set, the
+corresponding video pixel is displayed, otherwise a pixel of the
+graphics surface.</P
+></LI
+><LI
+><P
+>A list of clipping rectangles can be specified. In
+these regions <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>no</I
+></SPAN
+> video is displayed, so the
+graphics surface can be seen here.</P
+></LI
+><LI
+><P
+>The framebuffer has an alpha channel that can be used
+to clip or blend the framebuffer with the video.</P
+></LI
+><LI
+><P
+>A global alpha value can be specified to blend the
+framebuffer contents with video images.</P
+></LI
+></OL
+></P
+><P
+>When simultaneous capturing and overlay is supported and
+the hardware prohibits different image and frame buffer formats, the
+format requested first takes precedence. The attempt to capture
+(<A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+>) or overlay (<A
+HREF="r10595.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FBUF</CODE
+></A
+>) may fail with an
+<SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+> error code or return accordingly modified parameters..</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN6635"
+>4.2.4. Overlay Window</A
+></H2
+><P
+>The overlaid image is determined by cropping and overlay
+window parameters. The former select an area of the video picture to
+capture, the latter how images are overlaid and clipped. Cropping
+initialization at minimum requires to reset the parameters to
+defaults. An example is given in <A
+HREF="x1904.htm"
+>Section 1.11</A
+>.</P
+><P
+>The overlay window is described by a struct&nbsp;<A
+HREF="x6570.htm#V4L2-WINDOW"
+>v4l2_window</A
+>. It
+defines the size of the image, its position over the graphics surface
+and the clipping to be applied. To get the current parameters
+applications set the <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field of a
+struct&nbsp;<A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+> to <CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_OVERLAY</CODE
+> and
+call the <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+></A
+> ioctl. The driver fills the
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_window</CODE
+> substructure named
+<CODE
+CLASS="STRUCTFIELD"
+>win</CODE
+>. It is not possible to retrieve a
+previously programmed clipping list or bitmap.</P
+><P
+>To program the overlay window applications set the
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field of a struct&nbsp;<A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+> to
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_OVERLAY</CODE
+>, initialize the
+<CODE
+CLASS="STRUCTFIELD"
+>win</CODE
+> substructure and call the
+<A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctl. The driver adjusts the parameters against
+hardware limits and returns the actual parameters as
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+> does. Like
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+>, the <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_TRY_FMT</CODE
+></A
+> ioctl can be
+used to learn about driver capabilities without actually changing
+driver state. Unlike <CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+> this also works
+after the overlay has been enabled.</P
+><P
+>The scaling factor of the overlaid image is implied by the
+width and height given in struct&nbsp;<A
+HREF="x6570.htm#V4L2-WINDOW"
+>v4l2_window</A
+> and the size of the cropping
+rectangle. For more information see <A
+HREF="x1904.htm"
+>Section 1.11</A
+>.</P
+><P
+>When simultaneous capturing and overlay is supported and
+the hardware prohibits different image and window sizes, the size
+requested first takes precedence. The attempt to capture or overlay as
+well (<A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+>) may fail with an <SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+> error code or return accordingly
+modified parameters.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-WINDOW"
+></A
+><P
+><B
+>Table 4-1. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_window</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>struct&nbsp;<A
+HREF="x6570.htm#V4L2-RECT"
+>v4l2_rect</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>w</CODE
+></TD
+><TD
+>Size and position of the window relative to the
+top, left corner of the frame buffer defined with <A
+HREF="r10595.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FBUF</CODE
+></A
+>. The
+window can extend the frame buffer width and height, the
+<CODE
+CLASS="STRUCTFIELD"
+>x</CODE
+> and <CODE
+CLASS="STRUCTFIELD"
+>y</CODE
+>
+coordinates can be negative, and it can lie completely outside the
+frame buffer. The driver clips the window accordingly, or if that is
+not possible, modifies its size and/or position.</TD
+></TR
+><TR
+><TD
+>enum&nbsp;<A
+HREF="x6386.htm#V4L2-FIELD"
+>v4l2_field</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>field</CODE
+></TD
+><TD
+>Applications set this field to determine which
+video field shall be overlaid, typically one of
+<CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_ANY</CODE
+> (0),
+<CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_TOP</CODE
+>,
+<CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_BOTTOM</CODE
+> or
+<CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_INTERLACED</CODE
+>. Drivers may have to choose
+a different field order and return the actual setting here.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>chromakey</CODE
+></TD
+><TD
+>When chroma-keying has been negotiated with
+<A
+HREF="r10595.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FBUF</CODE
+></A
+> applications set this field to the desired pixel value
+for the chroma key. The format is the same as the pixel format of the
+framebuffer (struct&nbsp;<A
+HREF="r10595.htm#V4L2-FRAMEBUFFER"
+>v4l2_framebuffer</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>fmt.pixelformat</CODE
+> field), with bytes in host
+order. E.&nbsp;g. for <A
+HREF="r2492.htm#V4L2-PIX-FMT-BGR32"
+><CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_BGR24</CODE
+></A
+> 
+the value should be 0xRRGGBB on a little endian, 0xBBGGRR on a big
+endian host.</TD
+></TR
+><TR
+><TD
+>struct&nbsp;<A
+HREF="x6570.htm#V4L2-CLIP"
+>v4l2_clip</A
+> *</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>clips</CODE
+></TD
+><TD
+>When chroma-keying has <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>not</I
+></SPAN
+>
+been negotiated and <A
+HREF="r10595.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FBUF</CODE
+></A
+> indicated this capability,
+applications can set this field to point to an array of
+clipping rectangles.</TD
+></TR
+><TR
+><TD
+COLSPAN="3"
+>Like the window coordinates
+<CODE
+CLASS="STRUCTFIELD"
+>w</CODE
+>, clipping rectangles are defined relative
+to the top, left corner of the frame buffer. However clipping
+rectangles must not extend the frame buffer width and height, and they
+must not overlap. If possible applications should merge adjacent
+rectangles. Whether this must create x-y or y-x bands, or the order of
+rectangles, is not defined. When clip lists are not supported the
+driver ignores this field. Its contents after calling <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+>
+are undefined.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>clipcount</CODE
+></TD
+><TD
+>When the application set the
+<CODE
+CLASS="STRUCTFIELD"
+>clips</CODE
+> field, this field must contain the
+number of clipping rectangles in the list. When clip lists are not
+supported the driver ignores this field, its contents after calling
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+> are undefined. When clip lists are
+supported but no clipping is desired this field must be set to
+zero.</TD
+></TR
+><TR
+><TD
+>void *</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>bitmap</CODE
+></TD
+><TD
+>When chroma-keying has
+<SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>not</I
+></SPAN
+> been negotiated and <A
+HREF="r10595.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FBUF</CODE
+></A
+> indicated
+this capability, applications can set this field to point to a
+clipping bit mask.</TD
+></TR
+><TR
+><TD
+COLSPAN="3"
+><P
+>It must be of the same size
+as the window, <CODE
+CLASS="STRUCTFIELD"
+>w.width</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>w.height</CODE
+>. Each bit corresponds to a pixel
+in the overlaid image, which is displayed only when the bit is
+<SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>set</I
+></SPAN
+>. Pixel coordinates translate to bits like:
+<PRE
+CLASS="PROGRAMLISTING"
+>((__u8 *) <CODE
+CLASS="STRUCTFIELD"
+>bitmap</CODE
+>)[<CODE
+CLASS="STRUCTFIELD"
+>w.width</CODE
+> * y + x / 8] &amp; (1 &lt;&lt; (x &amp; 7))</PRE
+></P
+><P
+>where <CODE
+CLASS="STRUCTFIELD"
+>0</CODE
+> &le; x &lt;
+<CODE
+CLASS="STRUCTFIELD"
+>w.width</CODE
+> and <CODE
+CLASS="STRUCTFIELD"
+>0</CODE
+> &le;
+y &lt;<CODE
+CLASS="STRUCTFIELD"
+>w.height</CODE
+>.<SUP
+>a</SUP
+></P
+><P
+>When a clipping
+bit mask is not supported the driver ignores this field, its contents
+after calling <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> are undefined. When a bit mask is supported
+but no clipping is desired this field must be set to
+<CODE
+CLASS="CONSTANT"
+>NULL</CODE
+>.</P
+><P
+>Applications need not create a
+clip list or bit mask. When they pass both, or despite negotiating
+chroma-keying, the results are undefined. Regardless of the chosen
+method, the clipping abilities of the hardware may be limited in
+quantity or quality. The results when these limits are exceeded are
+undefined.<SUP
+>b</SUP
+></P
+></TD
+></TR
+><TR
+><TD
+>__u8</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>global_alpha</CODE
+></TD
+><TD
+><P
+>The global alpha value used to blend the
+framebuffer with video images, if global alpha blending has been
+negotiated (<CODE
+CLASS="CONSTANT"
+>V4L2_FBUF_FLAG_GLOBAL_ALPHA</CODE
+>, see
+<A
+HREF="r10595.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FBUF</CODE
+></A
+>, <A
+HREF="r10595.htm#FRAMEBUFFER-FLAGS"
+>Table 3</A
+>).</P
+><P
+>Note
+this field was added in Linux 2.6.23, extending the structure. However
+the <A
+HREF="r10944.htm"
+>VIDIOC_G/S/TRY_FMT</A
+> ioctls,
+which take a pointer to a <A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+> parent structure with padding
+bytes at the end, are not affected.</P
+></TD
+></TR
+></TBODY
+><TR
+><TD
+COLSPAN="3"
+>Notes:<BR><A
+NAME="FTN.AEN6750"
+>a. </A
+>Should we require
+              <CODE
+CLASS="STRUCTFIELD"
+>w.width</CODE
+> to be a multiple of
+              eight?<BR><A
+NAME="FTN.AEN6758"
+>b. </A
+>When the image is written into frame buffer
+memory it will be undesirable if the driver clips out less pixels
+than expected, because the application and graphics system are not
+aware these regions need to be refreshed. The driver should clip out
+more pixels or not write the image at all.<BR></TD
+></TR
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-CLIP"
+></A
+><P
+><B
+>Table 4-2. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_clip</CODE
+><A
+NAME="AEN6776"
+HREF="x6570.htm#FTN.AEN6776"
+><SPAN
+CLASS="footnote"
+>[2]</SPAN
+></A
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>struct&nbsp;<A
+HREF="x6570.htm#V4L2-RECT"
+>v4l2_rect</A
+></TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>c</CODE
+></TD
+><TD
+>Coordinates of the clipping rectangle, relative to
+the top, left corner of the frame buffer. Only window pixels
+<SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>outside</I
+></SPAN
+> all clipping rectangles are
+displayed.</TD
+></TR
+><TR
+><TD
+>struct&nbsp;<A
+HREF="x6570.htm#V4L2-CLIP"
+>v4l2_clip</A
+> *</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>next</CODE
+></TD
+><TD
+>Pointer to the next clipping rectangle, NULL when
+this is the last rectangle. Drivers ignore this field, it cannot be
+used to pass a linked list of clipping rectangles.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-RECT"
+></A
+><P
+><B
+>Table 4-3. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_rect</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__s32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>left</CODE
+></TD
+><TD
+>Horizontal offset of the top, left corner of the
+rectangle, in pixels.</TD
+></TR
+><TR
+><TD
+>__s32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>top</CODE
+></TD
+><TD
+>Vertical offset of the top, left corner of the
+rectangle, in pixels. Offsets increase to the right and down.</TD
+></TR
+><TR
+><TD
+>__s32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>width</CODE
+></TD
+><TD
+>Width of the rectangle, in pixels.</TD
+></TR
+><TR
+><TD
+>__s32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>height</CODE
+></TD
+><TD
+>Height of the rectangle, in pixels. Width and
+height cannot be negative, the fields are signed for hysterical
+reasons. </TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN6826"
+>4.2.5. Enabling Overlay</A
+></H2
+><P
+>To start or stop the frame buffer overlay applications call
+the <A
+HREF="r12816.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_OVERLAY</CODE
+></A
+> ioctl.</P
+></DIV
+></DIV
+><H3
+CLASS="FOOTNOTES"
+>Notes</H3
+><TABLE
+BORDER="0"
+CLASS="FOOTNOTES"
+WIDTH="100%"
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="5%"
+><A
+NAME="FTN.AEN6581"
+HREF="x6570.htm#AEN6581"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="95%"
+><P
+>A common application of two file descriptors is the
+XFree86 <A
+HREF="x16430.htm#XVIDEO"
+>Xv/V4L</A
+> interface driver and
+a V4L2 application. While the X server controls video overlay, the
+application can take advantage of memory mapping and DMA.</P
+><P
+>In the opinion of the designers of this API, no driver
+writer taking the efforts to support simultaneous capturing and
+overlay will restrict this ability by requiring a single file
+descriptor, as in V4L and earlier versions of V4L2. Making this
+optional means applications depending on two file descriptors need
+backup routines to be compatible with all drivers, which is
+considerable more work than using two fds in applications which do
+not. Also two fd's fit the general concept of one file descriptor for
+each logical stream. Hence as a complexity trade-off drivers
+<SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>must</I
+></SPAN
+> support two file descriptors and
+<SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>may</I
+></SPAN
+> support single fd operation.</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="5%"
+><A
+NAME="FTN.AEN6776"
+HREF="x6570.htm#AEN6776"
+><SPAN
+CLASS="footnote"
+>[2]</SPAN
+></A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="95%"
+><P
+>The X Window system defines "regions" which are
+vectors of struct BoxRec { short x1, y1, x2, y2; } with width = x2 -
+x1 and height = y2 - y1, so one cannot pass X11 clip lists
+directly.</P
+></TD
+></TR
+></TABLE
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="c6488.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x6831.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Interfaces</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c6488.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Video Output Interface</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x6831.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x6831.htm
new file mode 100644
index 0000000..1b44125
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x6831.htm
@@ -0,0 +1,427 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Video Output Interface</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Interfaces"
+HREF="c6488.htm"><LINK
+REL="PREVIOUS"
+TITLE="Video Overlay Interface"
+HREF="x6570.htm"><LINK
+REL="NEXT"
+TITLE="Video Output Overlay Interface"
+HREF="x6909.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x6570.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 4. Interfaces</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x6909.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="OUTPUT"
+>4.3. Video Output Interface</A
+></H1
+><P
+>Video output devices encode stills or image sequences as
+analog video signal. With this interface applications can
+control the encoding process and move images from user space to
+the driver.</P
+><P
+>Conventionally V4L2 video output devices are accessed through
+character device special files named <TT
+CLASS="FILENAME"
+>/dev/video</TT
+>
+and <TT
+CLASS="FILENAME"
+>/dev/video0</TT
+> to
+<TT
+CLASS="FILENAME"
+>/dev/video63</TT
+> with major number 81 and minor
+numbers 0 to 63. <TT
+CLASS="FILENAME"
+>/dev/video</TT
+> is typically a
+symbolic link to the preferred video device. Note the same device
+files are used for video capture devices.</P
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN6839"
+>4.3.1. Querying Capabilities</A
+></H2
+><P
+>Devices supporting the video output interface set the
+<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_VIDEO_OUTPUT</CODE
+> flag in the
+<CODE
+CLASS="STRUCTFIELD"
+>capabilities</CODE
+> field of struct&nbsp;<A
+HREF="r13105.htm#V4L2-CAPABILITY"
+>v4l2_capability</A
+>
+returned by the <A
+HREF="r13105.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCAP</CODE
+></A
+> ioctl. As secondary device functions
+they may also support the <A
+HREF="x7013.htm"
+>raw VBI
+output</A
+> (<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_VBI_OUTPUT</CODE
+>) interface. At
+least one of the read/write or streaming I/O methods must be
+supported. Modulators and audio outputs are optional.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN6849"
+>4.3.2. Supplemental Functions</A
+></H2
+><P
+>Video output devices shall support <A
+HREF="x341.htm"
+>audio output</A
+>, <A
+HREF="x394.htm"
+>modulator</A
+>, <A
+HREF="x542.htm"
+>controls</A
+>,
+<A
+HREF="x1904.htm"
+>cropping and scaling</A
+> and <A
+HREF="x2009.htm"
+>streaming parameter</A
+> ioctls as needed.
+The <A
+HREF="x309.htm"
+>video output</A
+> and <A
+HREF="x448.htm"
+>video standard</A
+> ioctls must be supported by
+all video output devices.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN6859"
+>4.3.3. Image Format Negotiation</A
+></H2
+><P
+>The output is determined by cropping and image format
+parameters. The former select an area of the video picture where the
+image will appear, the latter how images are stored in memory, i.&nbsp;e. in
+RGB or YUV format, the number of bits per pixel or width and height.
+Together they also define how images are scaled in the process.</P
+><P
+>As usual these parameters are <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>not</I
+></SPAN
+> reset
+at <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+> time to permit Unix tool chains, programming a device
+and then writing to it as if it was a plain file. Well written V4L2
+applications ensure they really get what they want, including cropping
+and scaling.</P
+><P
+>Cropping initialization at minimum requires to reset the
+parameters to defaults. An example is given in <A
+HREF="x1904.htm"
+>Section 1.11</A
+>.</P
+><P
+>To query the current image format applications set the
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field of a struct&nbsp;<A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+> to
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_OUTPUT</CODE
+> and call the
+<A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+></A
+> ioctl with a pointer to this structure. Drivers fill
+the struct&nbsp;<A
+HREF="c2030.htm#V4L2-PIX-FORMAT"
+>v4l2_pix_format</A
+> <CODE
+CLASS="STRUCTFIELD"
+>pix</CODE
+> member of the
+<CODE
+CLASS="STRUCTFIELD"
+>fmt</CODE
+> union.</P
+><P
+>To request different parameters applications set the
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field of a struct&nbsp;<A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+> as above and
+initialize all fields of the struct&nbsp;<A
+HREF="c2030.htm#V4L2-PIX-FORMAT"
+>v4l2_pix_format</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>vbi</CODE
+> member of the
+<CODE
+CLASS="STRUCTFIELD"
+>fmt</CODE
+> union, or better just modify the
+results of <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+>, and call the
+<A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctl with a pointer to this structure. Drivers may
+adjust the parameters and finally return the actual parameters as
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+> does.</P
+><P
+>Like <CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+> the
+<A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_TRY_FMT</CODE
+></A
+> ioctl can be used to learn about hardware limitations
+without disabling I/O or possibly time consuming hardware
+preparations.</P
+><P
+>The contents of struct&nbsp;<A
+HREF="c2030.htm#V4L2-PIX-FORMAT"
+>v4l2_pix_format</A
+> are discussed in <A
+HREF="c2030.htm"
+>Chapter 2</A
+>. See also the specification of the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+>, <CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+>
+and <CODE
+CLASS="CONSTANT"
+>VIDIOC_TRY_FMT</CODE
+> ioctls for details. Video
+output devices must implement both the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+> ioctl, even if
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+> ignores all requests and always
+returns default parameters as <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+> does.
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_TRY_FMT</CODE
+> is optional.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN6902"
+>4.3.4. Writing Images</A
+></H2
+><P
+>A video output device may support the <A
+HREF="c5742.htm#RW"
+>write() function</A
+> and/or streaming (<A
+HREF="x5791.htm"
+>memory mapping</A
+> or <A
+HREF="x5884.htm"
+>user pointer</A
+>) I/O. See <A
+HREF="c5742.htm"
+>Chapter 3</A
+> for details.</P
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x6570.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x6909.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Video Overlay Interface</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c6488.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Video Output Overlay Interface</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x6909.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x6909.htm
new file mode 100644
index 0000000..1a54791
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x6909.htm
@@ -0,0 +1,494 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Video Output Overlay Interface</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Interfaces"
+HREF="c6488.htm"><LINK
+REL="PREVIOUS"
+TITLE="Video Output Interface"
+HREF="x6831.htm"><LINK
+REL="NEXT"
+TITLE="Codec Interface"
+HREF="x6991.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x6831.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 4. Interfaces</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x6991.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="OSD"
+>4.4. Video Output Overlay Interface</A
+></H1
+><FONT
+COLOR="RED"
+>Also known as On-Screen Display (OSD)</FONT
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Experimental: </B
+>This is an <A
+HREF="x16453.htm"
+>experimental</A
+>
+interface and may change in the future.</P
+></BLOCKQUOTE
+></DIV
+><P
+>Some video output devices can overlay a framebuffer image onto
+the outgoing video signal. Applications can set up such an overlay
+using this interface, which borrows structures and ioctls of the <A
+HREF="x6570.htm"
+>Video Overlay</A
+> interface.</P
+><P
+>The OSD function is accessible through the same character
+special file as the <A
+HREF="c6488.htm#CAPTURE"
+>Video Output</A
+> function.
+Note the default function of such a <TT
+CLASS="FILENAME"
+>/dev/video</TT
+> device
+is video capturing or output. The OSD function is only available after
+calling the <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctl.</P
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN6923"
+>4.4.1. Querying Capabilities</A
+></H2
+><P
+>Devices supporting the <I
+CLASS="WORDASWORD"
+>Video Output
+Overlay</I
+> interface set the
+<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_VIDEO_OUTPUT_OVERLAY</CODE
+> flag in the
+<CODE
+CLASS="STRUCTFIELD"
+>capabilities</CODE
+> field of struct&nbsp;<A
+HREF="r13105.htm#V4L2-CAPABILITY"
+>v4l2_capability</A
+>
+returned by the <A
+HREF="r13105.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCAP</CODE
+></A
+> ioctl.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN6932"
+>4.4.2. Framebuffer</A
+></H2
+><P
+>Contrary to the <I
+CLASS="WORDASWORD"
+>Video Overlay</I
+>
+interface the framebuffer is normally implemented on the TV card and
+not the graphics card. On Linux it is accessible as a framebuffer
+device (<TT
+CLASS="FILENAME"
+>/dev/fbN</TT
+>). Given a V4L2 device,
+applications can find the corresponding framebuffer device by calling
+the <A
+HREF="r10595.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FBUF</CODE
+></A
+> ioctl. It returns, amongst other information, the
+physical address of the framebuffer in the
+<CODE
+CLASS="STRUCTFIELD"
+>base</CODE
+> field of struct&nbsp;<A
+HREF="r10595.htm#V4L2-FRAMEBUFFER"
+>v4l2_framebuffer</A
+>. The
+framebuffer device ioctl <CODE
+CLASS="CONSTANT"
+>FBIOGET_FSCREENINFO</CODE
+>
+returns the same address in the <CODE
+CLASS="STRUCTFIELD"
+>smem_start</CODE
+>
+field of struct <CODE
+CLASS="STRUCTNAME"
+>fb_fix_screeninfo</CODE
+>. The
+<CODE
+CLASS="CONSTANT"
+>FBIOGET_FSCREENINFO</CODE
+> ioctl and struct
+<CODE
+CLASS="STRUCTNAME"
+>fb_fix_screeninfo</CODE
+> are defined in the
+<TT
+CLASS="FILENAME"
+>linux/fb.h</TT
+> header file.</P
+><P
+>The width and height of the framebuffer depends on the
+current video standard. A V4L2 driver may reject attempts to change
+the video standard (or any other ioctl which would imply a framebuffer
+size change) with an <SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+> error code until all applications closed the
+framebuffer device.</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN6949"
+></A
+><P
+><B
+>Example 4-1. Finding a framebuffer device for OSD</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+>#include &lt;linux/fb.h&gt;
+
+struct&nbsp;<A
+HREF="r10595.htm#V4L2-FRAMEBUFFER"
+>v4l2_framebuffer</A
+> fbuf;
+unsigned int i;
+int fb_fd;
+
+if (-1 == ioctl (fd, VIDIOC_G_FBUF, &amp;fbuf)) {
+        perror ("VIDIOC_G_FBUF");
+        exit (EXIT_FAILURE);
+}
+
+for (i = 0; i &#60; 30; ++i) {
+        char dev_name[16];
+        struct fb_fix_screeninfo si;
+
+        snprintf (dev_name, sizeof (dev_name), "/dev/fb%u", i);
+
+        fb_fd = open (dev_name, O_RDWR);
+        if (-1 == fb_fd) {
+                switch (errno) {
+                case ENOENT: /* no such file */
+                case ENXIO:  /* no driver */
+                        continue;
+
+                default:
+                        perror ("open");
+                        exit (EXIT_FAILURE);
+                }
+        }
+
+        if (0 == ioctl (fb_fd, FBIOGET_FSCREENINFO, &amp;si)) {
+                if (si.smem_start == (unsigned long) fbuf.base)
+                        break;
+        } else {
+                /* Apparently not a framebuffer device. */
+        }
+
+        close (fb_fd);
+        fb_fd = -1;
+}
+
+/* fb_fd is the file descriptor of the framebuffer device
+   for the video output overlay, or -1 if no device was found. */</PRE
+></DIV
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN6953"
+>4.4.3. Overlay Window and Scaling</A
+></H2
+><P
+>The overlay is controlled by source and target rectangles.
+The source rectangle selects a subsection of the framebuffer image to
+be overlaid, the target rectangle an area in the outgoing video signal
+where the image will appear. Drivers may or may not support scaling,
+and arbitrary sizes and positions of these rectangles. Further drivers
+may support any (or none) of the clipping/blending methods defined for
+the <A
+HREF="x6570.htm"
+>Video Overlay</A
+> interface.</P
+><P
+>A struct&nbsp;<A
+HREF="x6570.htm#V4L2-WINDOW"
+>v4l2_window</A
+> defines the size of the source rectangle,
+its position in the framebuffer and the clipping/blending method to be
+used for the overlay. To get the current parameters applications set
+the <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field of a struct&nbsp;<A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+> to
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY</CODE
+> and call the
+<A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+></A
+> ioctl. The driver fills the
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_window</CODE
+> substructure named
+<CODE
+CLASS="STRUCTFIELD"
+>win</CODE
+>. It is not possible to retrieve a
+previously programmed clipping list or bitmap.</P
+><P
+>To program the source rectangle applications set the
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field of a struct&nbsp;<A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+> to
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY</CODE
+>, initialize
+the <CODE
+CLASS="STRUCTFIELD"
+>win</CODE
+> substructure and call the
+<A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctl. The driver adjusts the parameters against
+hardware limits and returns the actual parameters as
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+> does. Like
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+>, the <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_TRY_FMT</CODE
+></A
+> ioctl can be
+used to learn about driver capabilities without actually changing
+driver state. Unlike <CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+> this also works
+after the overlay has been enabled.</P
+><P
+>A struct&nbsp;<A
+HREF="r9994.htm#V4L2-CROP"
+>v4l2_crop</A
+> defines the size and position of the target
+rectangle. The scaling factor of the overlay is implied by the width
+and height given in struct&nbsp;<A
+HREF="x6570.htm#V4L2-WINDOW"
+>v4l2_window</A
+> and struct&nbsp;<A
+HREF="r9994.htm#V4L2-CROP"
+>v4l2_crop</A
+>. The cropping API
+applies to <I
+CLASS="WORDASWORD"
+>Video Output</I
+> and <I
+CLASS="WORDASWORD"
+>Video
+Output Overlay</I
+> devices in the same way as to
+<I
+CLASS="WORDASWORD"
+>Video Capture</I
+> and <I
+CLASS="WORDASWORD"
+>Video
+Overlay</I
+> devices, merely reversing the direction of the
+data flow. For more information see <A
+HREF="x1904.htm"
+>Section 1.11</A
+>.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN6987"
+>4.4.4. Enabling Overlay</A
+></H2
+><P
+>There is no V4L2 ioctl to enable or disable the overlay,
+however the framebuffer interface of the driver may support the
+<CODE
+CLASS="CONSTANT"
+>FBIOBLANK</CODE
+> ioctl.</P
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x6831.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x6991.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Video Output Interface</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c6488.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Codec Interface</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x6991.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x6991.htm
new file mode 100644
index 0000000..e92a33c
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x6991.htm
@@ -0,0 +1,177 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Codec Interface</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Interfaces"
+HREF="c6488.htm"><LINK
+REL="PREVIOUS"
+TITLE="Video Output Overlay Interface"
+HREF="x6909.htm"><LINK
+REL="NEXT"
+TITLE="Effect Devices Interface"
+HREF="x7002.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x6909.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 4. Interfaces</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x7002.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="CODEC"
+>4.5. Codec Interface</A
+></H1
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Suspended: </B
+>This interface has been be suspended from the V4L2 API
+implemented in Linux 2.6 until we have more experience with codec
+device interfaces.</P
+></BLOCKQUOTE
+></DIV
+><P
+>A V4L2 codec can compress, decompress, transform, or otherwise
+convert video data from one format into another format, in memory.
+Applications send data to be converted to the driver through a
+<A
+HREF="r14496.htm"
+><CODE
+CLASS="FUNCTION"
+>write()</CODE
+></A
+> call, and receive the converted data through a
+<A
+HREF="r14264.htm"
+><CODE
+CLASS="FUNCTION"
+>read()</CODE
+></A
+> call. For efficiency a driver may also support streaming
+I/O.</P
+><P
+>[to do]</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x6909.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x7002.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Video Output Overlay Interface</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c6488.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Effect Devices Interface</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x7002.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x7002.htm
new file mode 100644
index 0000000..3d6ebd9
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x7002.htm
@@ -0,0 +1,176 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Effect Devices Interface</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Interfaces"
+HREF="c6488.htm"><LINK
+REL="PREVIOUS"
+TITLE="Codec Interface"
+HREF="x6991.htm"><LINK
+REL="NEXT"
+TITLE="Raw VBI Data Interface"
+HREF="x7013.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x6991.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 4. Interfaces</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x7013.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="EFFECT"
+>4.6. Effect Devices Interface</A
+></H1
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Suspended: </B
+>This interface has been be suspended from the V4L2 API
+implemented in Linux 2.6 until we have more experience with effect
+device interfaces.</P
+></BLOCKQUOTE
+></DIV
+><P
+>A V4L2 video effect device can do image effects, filtering, or
+combine two or more images or image streams. For example video
+transitions or wipes. Applications send data to be processed and
+receive the result data either with <A
+HREF="r14264.htm"
+><CODE
+CLASS="FUNCTION"
+>read()</CODE
+></A
+> and <A
+HREF="r14496.htm"
+><CODE
+CLASS="FUNCTION"
+>write()</CODE
+></A
+>
+functions, or through the streaming I/O mechanism.</P
+><P
+>[to do]</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x6991.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x7013.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Codec Interface</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c6488.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Raw VBI Data Interface</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x7013.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x7013.htm
new file mode 100644
index 0000000..60bf19d
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x7013.htm
@@ -0,0 +1,916 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Raw VBI Data Interface</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Interfaces"
+HREF="c6488.htm"><LINK
+REL="PREVIOUS"
+TITLE="Effect Devices Interface"
+HREF="x7002.htm"><LINK
+REL="NEXT"
+TITLE="Sliced VBI Data Interface"
+HREF="x7236.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x7002.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 4. Interfaces</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x7236.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="RAW-VBI"
+>4.7. Raw VBI Data Interface</A
+></H1
+><P
+>VBI is an abbreviation of Vertical Blanking Interval, a gap
+in the sequence of lines of an analog video signal. During VBI
+no picture information is transmitted, allowing some time while the
+electron beam of a cathode ray tube TV returns to the top of the
+screen. Using an oscilloscope you will find here the vertical
+synchronization pulses and short data packages ASK
+modulated<A
+NAME="AEN7016"
+HREF="x7013.htm#FTN.AEN7016"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+>
+onto the video signal. These are transmissions of services such as
+Teletext or Closed Caption.</P
+><P
+>Subject of this interface type is raw VBI data, as sampled off
+a video signal, or to be added to a signal for output.
+The data format is similar to uncompressed video images, a number of
+lines times a number of samples per line, we call this a VBI image.</P
+><P
+>Conventionally V4L2 VBI devices are accessed through character
+device special files named <TT
+CLASS="FILENAME"
+>/dev/vbi</TT
+> and
+<TT
+CLASS="FILENAME"
+>/dev/vbi0</TT
+> to <TT
+CLASS="FILENAME"
+>/dev/vbi31</TT
+> with
+major number 81 and minor numbers 224 to 255.
+<TT
+CLASS="FILENAME"
+>/dev/vbi</TT
+> is typically a symbolic link to the
+preferred VBI device. This convention applies to both input and output
+devices.</P
+><P
+>To address the problems of finding related video and VBI
+devices VBI capturing and output is also available as device function
+under <TT
+CLASS="FILENAME"
+>/dev/video</TT
+>. To capture or output raw VBI
+data with these devices applications must call the <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+>
+ioctl. Accessed as <TT
+CLASS="FILENAME"
+>/dev/vbi</TT
+>, raw VBI capturing
+or output is the default device function.</P
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN7029"
+>4.7.1. Querying Capabilities</A
+></H2
+><P
+>Devices supporting the raw VBI capturing or output API set
+the <CODE
+CLASS="CONSTANT"
+>V4L2_CAP_VBI_CAPTURE</CODE
+> or
+<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_VBI_OUTPUT</CODE
+> flags, respectively, in the
+<CODE
+CLASS="STRUCTFIELD"
+>capabilities</CODE
+> field of struct&nbsp;<A
+HREF="r13105.htm#V4L2-CAPABILITY"
+>v4l2_capability</A
+>
+returned by the <A
+HREF="r13105.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCAP</CODE
+></A
+> ioctl. At least one of the
+read/write, streaming or asynchronous I/O methods must be
+supported. VBI devices may or may not have a tuner or modulator.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN7038"
+>4.7.2. Supplemental Functions</A
+></H2
+><P
+>VBI devices shall support <A
+HREF="x309.htm"
+>video
+input or output</A
+>, <A
+HREF="x394.htm"
+>tuner or
+modulator</A
+>, and <A
+HREF="x542.htm"
+>controls</A
+> ioctls
+as needed. The <A
+HREF="x448.htm"
+>video standard</A
+> ioctls provide
+information vital to program a VBI device, therefore must be
+supported.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN7045"
+>4.7.3. Raw VBI Format Negotiation</A
+></H2
+><P
+>Raw VBI sampling abilities can vary, in particular the
+sampling frequency. To properly interpret the data V4L2 specifies an
+ioctl to query the sampling parameters. Moreover, to allow for some
+flexibility applications can also suggest different parameters.</P
+><P
+>As usual these parameters are <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>not</I
+></SPAN
+>
+reset at <A
+HREF="r14090.htm"
+><CODE
+CLASS="FUNCTION"
+>open()</CODE
+></A
+> time to permit Unix tool chains, programming a
+device and then reading from it as if it was a plain file. Well
+written V4L2 applications should always ensure they really get what
+they want, requesting reasonable parameters and then checking if the
+actual parameters are suitable.</P
+><P
+>To query the current raw VBI capture parameters
+applications set the <CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field of a
+struct&nbsp;<A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+> to <CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VBI_CAPTURE</CODE
+> or
+<CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_VBI_OUTPUT</CODE
+>, and call the
+<A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+></A
+> ioctl with a pointer to this structure. Drivers fill
+the struct&nbsp;<A
+HREF="x7013.htm#V4L2-VBI-FORMAT"
+>v4l2_vbi_format</A
+> <CODE
+CLASS="STRUCTFIELD"
+>vbi</CODE
+> member of the
+<CODE
+CLASS="STRUCTFIELD"
+>fmt</CODE
+> union.</P
+><P
+>To request different parameters applications set the
+<CODE
+CLASS="STRUCTFIELD"
+>type</CODE
+> field of a struct&nbsp;<A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+> as above and
+initialize all fields of the struct&nbsp;<A
+HREF="x7013.htm#V4L2-VBI-FORMAT"
+>v4l2_vbi_format</A
+>
+<CODE
+CLASS="STRUCTFIELD"
+>vbi</CODE
+> member of the
+<CODE
+CLASS="STRUCTFIELD"
+>fmt</CODE
+> union, or better just modify the
+results of <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+>, and call the
+<A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctl with a pointer to this structure. Drivers return
+an <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code only when the given parameters are ambiguous, otherwise
+they modify the parameters according to the hardware capabilites and
+return the actual parameters. When the driver allocates resources at
+this point, it may return an <SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+> error code to indicate the returned
+parameters are valid but the required resources are currently not
+available. That may happen for instance when the video and VBI areas
+to capture would overlap, or when the driver supports multiple opens
+and another process already requested VBI capturing or output. Anyway,
+applications must expect other resource allocation points which may
+return <SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+>, at the <A
+HREF="r13817.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMON</CODE
+></A
+> ioctl
+and the first read(), write() and select() call.</P
+><P
+>VBI devices must implement both the
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+> ioctl, even if
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+> ignores all requests and always
+returns default parameters as <CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+> does.
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_TRY_FMT</CODE
+> is optional.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-VBI-FORMAT"
+></A
+><P
+><B
+>Table 4-4. struct <CODE
+CLASS="STRUCTNAME"
+>v4l2_vbi_format</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>sampling_rate</CODE
+></TD
+><TD
+>Samples per second, i.&nbsp;e. unit 1 Hz.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>offset</CODE
+></TD
+><TD
+><P
+>Horizontal offset of the VBI image,
+relative to the leading edge of the line synchronization pulse and
+counted in samples: The first sample in the VBI image will be located
+<CODE
+CLASS="STRUCTFIELD"
+>offset</CODE
+> /
+<CODE
+CLASS="STRUCTFIELD"
+>sampling_rate</CODE
+> seconds following the leading
+edge. See also <A
+HREF="x7013.htm#VBI-HSYNC"
+>Figure 4-1</A
+>.</P
+></TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>samples_per_line</CODE
+></TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>sample_format</CODE
+></TD
+><TD
+><P
+>Defines the sample format as in <A
+HREF="c2030.htm"
+>Chapter 2</A
+>, a four-character-code.<SUP
+>a</SUP
+> Usually this is
+<CODE
+CLASS="CONSTANT"
+>V4L2_PIX_FMT_GREY</CODE
+>, i.&nbsp;e. each sample
+consists of 8 bits with lower values oriented towards the black level.
+Do not assume any other correlation of values with the signal level.
+For example, the MSB does not necessarily indicate if the signal is
+'high' or 'low' because 128 may not be the mean value of the
+signal. Drivers shall not convert the sample format by software.</P
+></TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>start</CODE
+>[2]</TD
+><TD
+>This is the scanning system line number
+associated with the first line of the VBI image, of the first and the
+second field respectively. See <A
+HREF="x7013.htm#VBI-525"
+>Figure 4-2</A
+> and
+<A
+HREF="x7013.htm#VBI-625"
+>Figure 4-3</A
+> for valid values. VBI input drivers can
+return start values 0 if the hardware cannot reliable identify
+scanning lines, VBI acquisition may not require this
+information.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>count</CODE
+>[2]</TD
+><TD
+>The number of lines in the first and second
+field image, respectively.</TD
+></TR
+><TR
+><TD
+COLSPAN="3"
+><P
+>Drivers should be as
+flexibility as possible. For example, it may be possible to extend or
+move the VBI capture window down to the picture area, implementing a
+'full field mode' to capture data service transmissions embedded in
+the picture.</P
+><P
+>An application can set the first or second
+<CODE
+CLASS="STRUCTFIELD"
+>count</CODE
+> value to zero if no data is required
+from the respective field; <CODE
+CLASS="STRUCTFIELD"
+>count</CODE
+>[1] if the
+scanning system is progressive, i.&nbsp;e. not interlaced. The
+corresponding start value shall be ignored by the application and
+driver. Anyway, drivers may not support single field capturing and
+return both count values non-zero.</P
+><P
+>Both
+<CODE
+CLASS="STRUCTFIELD"
+>count</CODE
+> values set to zero, or line numbers
+outside the bounds depicted in <A
+HREF="x7013.htm#VBI-525"
+>Figure 4-2</A
+> and <A
+HREF="x7013.htm#VBI-625"
+>Figure 4-3</A
+>, or a field image covering
+lines of two fields, are invalid and shall not be returned by the
+driver.</P
+><P
+>To initialize the <CODE
+CLASS="STRUCTFIELD"
+>start</CODE
+>
+and <CODE
+CLASS="STRUCTFIELD"
+>count</CODE
+> fields, applications must first
+determine the current video standard selection. The <A
+HREF="r9288.htm#V4L2-STD-ID"
+>v4l2_std_id</A
+> or
+the <CODE
+CLASS="STRUCTFIELD"
+>framelines</CODE
+> field of struct&nbsp;<A
+HREF="r9288.htm#V4L2-STANDARD"
+>v4l2_standard</A
+> can
+be evaluated for this purpose.</P
+></TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>flags</CODE
+></TD
+><TD
+>See <A
+HREF="x7013.htm#VBIFMT-FLAGS"
+>Table 4-5</A
+> below. Currently
+only drivers set flags, applications must set this field to
+zero.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+>[2]</TD
+><TD
+>This array is reserved for future extensions.
+Drivers and applications must set it to zero.</TD
+></TR
+></TBODY
+><TR
+><TD
+COLSPAN="3"
+>Notes:<BR><A
+NAME="FTN.AEN7117"
+>a. </A
+>A few devices may be unable to
+sample VBI data at all but can extend the video capture window to the
+VBI region.<BR></TD
+></TR
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="VBIFMT-FLAGS"
+></A
+><P
+><B
+>Table 4-5. Raw VBI Format Flags</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_VBI_UNSYNC</CODE
+></TD
+><TD
+>0x0001</TD
+><TD
+><P
+>This flag indicates hardware which does not
+properly distinguish between fields. Normally the VBI image stores the
+first field (lower scanning line numbers) first in memory. This may be
+a top or bottom field depending on the video standard. When this flag
+is set the first or second field may be stored first, however the
+fields are still in correct temporal order with the older field first
+in memory.<SUP
+>a</SUP
+></P
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_VBI_INTERLACED</CODE
+></TD
+><TD
+>0x0002</TD
+><TD
+>By default the two field images will be passed
+sequentially; all lines of the first field followed by all lines of
+the second field (compare <A
+HREF="x6386.htm"
+>Section 3.6</A
+>
+<CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_SEQ_TB</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_SEQ_BT</CODE
+>, whether the top or bottom
+field is first in memory depends on the video standard). When this
+flag is set, the two fields are interlaced (cf.
+<CODE
+CLASS="CONSTANT"
+>V4L2_FIELD_INTERLACED</CODE
+>). The first line of the
+first field followed by the first line of the second field, then the
+two second lines, and so on. Such a layout may be necessary when the
+hardware has been programmed to capture or output interlaced video
+images and is unable to separate the fields for VBI capturing at
+the same time. For simplicity setting this flag implies that both
+<CODE
+CLASS="STRUCTFIELD"
+>count</CODE
+> values are equal and non-zero.</TD
+></TR
+></TBODY
+><TR
+><TD
+COLSPAN="3"
+>Notes:<BR><A
+NAME="FTN.AEN7173"
+>a. </A
+>Most VBI services transmit on both fields, but
+some have different semantics depending on the field number. These
+cannot be reliable decoded or encoded when
+<CODE
+CLASS="CONSTANT"
+>V4L2_VBI_UNSYNC</CODE
+> is set.<BR></TD
+></TR
+></TABLE
+></DIV
+><DIV
+CLASS="FIGURE"
+><A
+NAME="VBI-HSYNC"
+></A
+><P
+><B
+>Figure 4-1. Line synchronization</B
+></P
+><DIV
+CLASS="MEDIAOBJECT"
+><P
+><IMG
+SRC="vbi_hsync.gif"></P
+></DIV
+></DIV
+><DIV
+CLASS="FIGURE"
+><A
+NAME="VBI-525"
+></A
+><P
+><B
+>Figure 4-2. ITU-R 525 line numbering (M/NTSC and M/PAL)</B
+></P
+><DIV
+CLASS="MEDIAOBJECT"
+><P
+><IMG
+SRC="vbi_525.gif"><DIV
+CLASS="CAPTION"
+><P
+>(1) For the purpose of this specification field 2
+starts in line 264 and not 263.5 because half line capturing is not
+supported.</P
+></DIV
+></P
+></DIV
+></DIV
+><DIV
+CLASS="FIGURE"
+><A
+NAME="VBI-625"
+></A
+><P
+><B
+>Figure 4-3. ITU-R 625 line numbering</B
+></P
+><DIV
+CLASS="MEDIAOBJECT"
+><P
+><IMG
+SRC="vbi_625.gif"><DIV
+CLASS="CAPTION"
+><P
+>(1) For the purpose of this specification field 2
+starts in line 314 and not 313.5 because half line capturing is not
+supported.</P
+></DIV
+></P
+></DIV
+></DIV
+><P
+>Remember the VBI image format depends on the selected
+video standard, therefore the application must choose a new standard or
+query the current standard first. Attempts to read or write data ahead
+of format negotiation, or after switching the video standard which may
+invalidate the negotiated VBI parameters, should be refused by the
+driver. A format change during active I/O is not permitted.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN7218"
+>4.7.4. Reading and writing VBI images</A
+></H2
+><P
+>To assure synchronization with the field number and easier
+implementation, the smallest unit of data passed at a time is one
+frame, consisting of two fields of VBI images immediately following in
+memory.</P
+><P
+>The total size of a frame computes as follows:</P
+><PRE
+CLASS="PROGRAMLISTING"
+>(<CODE
+CLASS="STRUCTFIELD"
+>count</CODE
+>[0] + <CODE
+CLASS="STRUCTFIELD"
+>count</CODE
+>[1]) *
+<CODE
+CLASS="STRUCTFIELD"
+>samples_per_line</CODE
+> * sample size in bytes</PRE
+><P
+>The sample size is most likely always one byte,
+applications must check the <CODE
+CLASS="STRUCTFIELD"
+>sample_format</CODE
+>
+field though, to function properly with other drivers.</P
+><P
+>A VBI device may support <A
+HREF="c5742.htm#RW"
+>read/write</A
+> and/or streaming (<A
+HREF="x5791.htm"
+>memory mapping</A
+> or <A
+HREF="x5884.htm"
+>user pointer</A
+>) I/O. The latter bears the
+possibility of synchronizing video and
+VBI data by using buffer timestamps.</P
+><P
+>Remember the <A
+HREF="r13817.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMON</CODE
+></A
+> ioctl and the first read(),
+write() and select() call can be resource allocation points returning
+an <SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+> error code if the required hardware resources are temporarily
+unavailable, for example the device is already in use by another
+process.</P
+></DIV
+></DIV
+><H3
+CLASS="FOOTNOTES"
+>Notes</H3
+><TABLE
+BORDER="0"
+CLASS="FOOTNOTES"
+WIDTH="100%"
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="5%"
+><A
+NAME="FTN.AEN7016"
+HREF="x7013.htm#AEN7016"
+><SPAN
+CLASS="footnote"
+>[1]</SPAN
+></A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+WIDTH="95%"
+><P
+>ASK: Amplitude-Shift Keying. A high signal
+level represents a '1' bit, a low level a '0' bit.</P
+></TD
+></TR
+></TABLE
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x7002.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x7236.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Effect Devices Interface</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c6488.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Sliced VBI Data Interface</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x7236.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x7236.htm
new file mode 100644
index 0000000..ec6f244
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x7236.htm
@@ -0,0 +1,1196 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Sliced VBI Data Interface</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Interfaces"
+HREF="c6488.htm"><LINK
+REL="PREVIOUS"
+TITLE="Raw VBI Data Interface"
+HREF="x7013.htm"><LINK
+REL="NEXT"
+TITLE="Teletext Interface"
+HREF="x7561.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x7013.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 4. Interfaces</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x7561.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="SLICED"
+>4.8. Sliced VBI Data Interface</A
+></H1
+><P
+>VBI stands for Vertical Blanking Interval, a gap in the
+sequence of lines of an analog video signal. During VBI no picture
+information is transmitted, allowing some time while the electron beam
+of a cathode ray tube TV returns to the top of the screen.</P
+><P
+>Sliced VBI devices use hardware to demodulate data transmitted
+in the VBI. V4L2 drivers shall <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>not</I
+></SPAN
+> do this by
+software, see also the <A
+HREF="x7013.htm"
+>raw VBI
+interface</A
+>. The data is passed as short packets of fixed size,
+covering one scan line each. The number of packets per video frame is
+variable.</P
+><P
+>Sliced VBI capture and output devices are accessed through the
+same character special files as raw VBI devices. When a driver
+supports both interfaces, the default function of a
+<TT
+CLASS="FILENAME"
+>/dev/vbi</TT
+> device is <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>raw</I
+></SPAN
+> VBI
+capturing or output, and the sliced VBI function is only available
+after calling the <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctl as defined below. Likewise a
+<TT
+CLASS="FILENAME"
+>/dev/video</TT
+> device may support the sliced VBI API,
+however the default function here is video capturing or output.
+Different file descriptors must be used to pass raw and sliced VBI
+data simultaneously, if this is supported by the driver.</P
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN7248"
+>4.8.1. Querying Capabilities</A
+></H2
+><P
+>Devices supporting the sliced VBI capturing or output API
+set the <CODE
+CLASS="CONSTANT"
+>V4L2_CAP_SLICED_VBI_CAPTURE</CODE
+> or
+<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_SLICED_VBI_OUTPUT</CODE
+> flag respectively, in
+the <CODE
+CLASS="STRUCTFIELD"
+>capabilities</CODE
+> field of struct&nbsp;<A
+HREF="r13105.htm#V4L2-CAPABILITY"
+>v4l2_capability</A
+>
+returned by the <A
+HREF="r13105.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCAP</CODE
+></A
+> ioctl. At least one of the
+read/write, streaming or asynchronous <A
+HREF="c5742.htm"
+>I/O
+methods</A
+> must be supported. Sliced VBI devices may have a tuner
+or modulator.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN7258"
+>4.8.2. Supplemental Functions</A
+></H2
+><P
+>Sliced VBI devices shall support <A
+HREF="x309.htm"
+>video
+input or output</A
+> and <A
+HREF="x394.htm"
+>tuner or
+modulator</A
+> ioctls if they have these capabilities, and they may
+support <A
+HREF="x542.htm"
+>control</A
+> ioctls. The <A
+HREF="x448.htm"
+>video standard</A
+> ioctls provide information
+vital to program a sliced VBI device, therefore must be
+supported.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN7265"
+>4.8.3. Sliced VBI Format Negotiation</A
+></H2
+><P
+>To find out which data services are supported by the
+hardware applications can call the <A
+HREF="r12051.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_SLICED_VBI_CAP</CODE
+></A
+> ioctl.
+All drivers implementing the sliced VBI interface must support this
+ioctl. The results may differ from those of the <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctl
+when the number of VBI lines the hardware can capture or output per
+frame, or the number of services it can identify on a given line are
+limited. For example on PAL line 16 the hardware may be able to look
+for a VPS or Teletext signal, but not both at the same time.</P
+><P
+>To determine the currently selected services applications
+set the <CODE
+CLASS="STRUCTFIELD"
+>type </CODE
+> field of struct&nbsp;<A
+HREF="r10944.htm#V4L2-FORMAT"
+>v4l2_format</A
+> to
+<CODE
+CLASS="CONSTANT"
+> V4L2_BUF_TYPE_SLICED_VBI_CAPTURE</CODE
+> or <CODE
+CLASS="CONSTANT"
+>V4L2_BUF_TYPE_SLICED_VBI_OUTPUT</CODE
+>, and the <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+></A
+>
+ioctl fills the <CODE
+CLASS="STRUCTFIELD"
+>fmt.sliced</CODE
+> member, a
+struct&nbsp;<A
+HREF="x7236.htm#V4L2-SLICED-VBI-FORMAT"
+>v4l2_sliced_vbi_format</A
+>.</P
+><P
+>Applications can request different parameters by
+initializing or modifying the <CODE
+CLASS="STRUCTFIELD"
+>fmt.sliced</CODE
+>
+member and calling the <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctl with a pointer to the
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_format</CODE
+> structure.</P
+><P
+>The sliced VBI API is more complicated than the raw VBI API
+because the hardware must be told which VBI service to expect on each
+scan line. Not all services may be supported by the hardware on all
+lines (this is especially true for VBI output where Teletext is often
+unsupported and other services can only be inserted in one specific
+line). In many cases, however, it is sufficient to just set the
+<CODE
+CLASS="STRUCTFIELD"
+>service_set</CODE
+> field to the required services
+and let the driver fill the <CODE
+CLASS="STRUCTFIELD"
+>service_lines</CODE
+>
+array according to hardware capabilities. Only if more precise control
+is needed should the programmer set the
+<CODE
+CLASS="STRUCTFIELD"
+>service_lines</CODE
+> array explicitly.</P
+><P
+>The <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctl returns an <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code only when the
+given parameters are ambiguous, otherwise it modifies the parameters
+according to hardware capabilities. When the driver allocates
+resources at this point, it may return an <SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+> error code if the required
+resources are temporarily unavailable. Other resource allocation
+points which may return <SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+> can be the
+<A
+HREF="r13817.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMON</CODE
+></A
+> ioctl and the first <A
+HREF="r14264.htm"
+><CODE
+CLASS="FUNCTION"
+>read()</CODE
+></A
+>, <A
+HREF="r14496.htm"
+><CODE
+CLASS="FUNCTION"
+>write()</CODE
+></A
+> and
+<A
+HREF="r14390.htm"
+><CODE
+CLASS="FUNCTION"
+>select()</CODE
+></A
+> call.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-SLICED-VBI-FORMAT"
+></A
+><P
+><B
+>Table 4-6. struct
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_sliced_vbi_format</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="25%"
+TITLE="C2"><COL
+WIDTH="17%"
+TITLE="C3"><COL
+WIDTH="17%"
+TITLE="C4"><COL
+WIDTH="17%"
+TITLE="C5"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>service_set</CODE
+></TD
+><TD
+COLSPAN="3"
+><P
+>If
+<CODE
+CLASS="STRUCTFIELD"
+>service_set</CODE
+> is non-zero when passed with
+<A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> or <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_TRY_FMT</CODE
+></A
+>, the
+<CODE
+CLASS="STRUCTFIELD"
+>service_lines</CODE
+> array will be filled by the
+driver according to the services specified in this field. For example,
+if <CODE
+CLASS="STRUCTFIELD"
+>service_set</CODE
+> is initialized with
+<CODE
+CLASS="CONSTANT"
+>V4L2_SLICED_TELETEXT_B | V4L2_SLICED_WSS_625</CODE
+>, a
+driver for the cx25840 video decoder sets lines 7-22 of both
+fields<SUP
+>a</SUP
+> to <CODE
+CLASS="CONSTANT"
+>V4L2_SLICED_TELETEXT_B</CODE
+>
+and line 23 of the first field to
+<CODE
+CLASS="CONSTANT"
+>V4L2_SLICED_WSS_625</CODE
+>. If
+<CODE
+CLASS="STRUCTFIELD"
+>service_set</CODE
+> is set to zero, then the values
+of <CODE
+CLASS="STRUCTFIELD"
+>service_lines</CODE
+> will be used instead.</P
+><P
+>On return the driver sets this field to the union of all
+elements of the returned <CODE
+CLASS="STRUCTFIELD"
+>service_lines</CODE
+>
+array. It may contain less services than requested, perhaps just one,
+if the hardware cannot handle more services simultaneously. It may be
+empty (zero) if none of the requested services are supported by the
+hardware.</P
+></TD
+></TR
+><TR
+><TD
+>__u16</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>service_lines</CODE
+>[2][24]</TD
+><TD
+COLSPAN="3"
+><P
+>Applications initialize this
+array with sets of data services the driver shall look for or insert
+on the respective scan line. Subject to hardware capabilities drivers
+return the requested set, a subset, which may be just a single
+service, or an empty set. When the hardware cannot handle multiple
+services on the same line the driver shall choose one. No assumptions
+can be made on which service the driver chooses.</P
+><P
+>Data
+services are defined in <A
+HREF="x7236.htm#VBI-SERVICES2"
+>Table 4-7</A
+>. Array indices
+map to ITU-R line numbers (see also <A
+HREF="x7013.htm#VBI-525"
+>Figure 4-2</A
+> and <A
+HREF="x7013.htm#VBI-625"
+>Figure 4-3</A
+>) as follows: </P
+></TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>Element</TD
+><TD
+>525 line systems</TD
+><TD
+>625 line systems</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>service_lines</CODE
+>[0][1]</TD
+><TD
+ALIGN="CENTER"
+>1</TD
+><TD
+ALIGN="CENTER"
+>1</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>service_lines</CODE
+>[0][23]</TD
+><TD
+ALIGN="CENTER"
+>23</TD
+><TD
+ALIGN="CENTER"
+>23</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>service_lines</CODE
+>[1][1]</TD
+><TD
+ALIGN="CENTER"
+>264</TD
+><TD
+ALIGN="CENTER"
+>314</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>service_lines</CODE
+>[1][23]</TD
+><TD
+ALIGN="CENTER"
+>286</TD
+><TD
+ALIGN="CENTER"
+>336</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Drivers must set
+<CODE
+CLASS="STRUCTFIELD"
+>service_lines</CODE
+>[0][0] and
+<CODE
+CLASS="STRUCTFIELD"
+>service_lines</CODE
+>[1][0] to zero.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>io_size</CODE
+></TD
+><TD
+COLSPAN="3"
+>Maximum number of bytes passed by
+one <A
+HREF="r14264.htm"
+><CODE
+CLASS="FUNCTION"
+>read()</CODE
+></A
+> or <A
+HREF="r14496.htm"
+><CODE
+CLASS="FUNCTION"
+>write()</CODE
+></A
+> call, and the buffer size in bytes for
+the <A
+HREF="r12878.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QBUF</CODE
+></A
+> and <A
+HREF="r12878.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_DQBUF</CODE
+></A
+> ioctl. Drivers set this field to
+the size of struct&nbsp;<A
+HREF="x7236.htm#V4L2-SLICED-VBI-DATA"
+>v4l2_sliced_vbi_data</A
+> times the number of non-zero
+elements in the returned <CODE
+CLASS="STRUCTFIELD"
+>service_lines</CODE
+>
+array (that is the number of lines potentially carrying data).</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+>[2]</TD
+><TD
+COLSPAN="3"
+>This array is reserved for future
+extensions. Applications and drivers must set it to zero.</TD
+></TR
+></TBODY
+><TR
+><TD
+COLSPAN="5"
+>Notes:<BR><A
+NAME="FTN.AEN7329"
+>a. </A
+>According to <A
+HREF="b17127.htm#ETS300706"
+>ETS&nbsp;300&nbsp;706</A
+> lines 6-22 of the
+first field and lines 5-22 of the second field may carry Teletext
+data.<BR></TD
+></TR
+></TABLE
+></DIV
+><DIV
+CLASS="TABLE"
+><A
+NAME="VBI-SERVICES2"
+></A
+><P
+><B
+>Table 4-7. Sliced VBI services</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="25%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="12%"
+TITLE="C3"><COL
+WIDTH="25%"
+TITLE="C4"><COL
+WIDTH="25%"
+TITLE="C5"><THEAD
+><TR
+><TH
+>Symbol</TH
+><TH
+>Value</TH
+><TH
+>Reference</TH
+><TH
+>Lines, usually</TH
+><TH
+>Payload</TH
+></TR
+></THEAD
+><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_SLICED_TELETEXT_B</CODE
+>
+(Teletext System B)</TD
+><TD
+>0x0001</TD
+><TD
+><A
+HREF="b17127.htm#ETS300706"
+><ABBR
+CLASS="ABBREV"
+>ETS&nbsp;300&nbsp;706</ABBR
+></A
+>, <A
+HREF="b17127.htm#ITU653"
+><ABBR
+CLASS="ABBREV"
+>ITU&nbsp;BT.653</ABBR
+></A
+></TD
+><TD
+>PAL/SECAM line 7-22, 320-335 (second field 7-22)</TD
+><TD
+>Last 42 of the 45 byte Teletext packet, that is
+without clock run-in and framing code, lsb first transmitted.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_SLICED_VPS</CODE
+></TD
+><TD
+>0x0400</TD
+><TD
+><A
+HREF="b17127.htm#ETS300231"
+><ABBR
+CLASS="ABBREV"
+>ETS&nbsp;300&nbsp;231</ABBR
+></A
+></TD
+><TD
+>PAL line 16</TD
+><TD
+>Byte number 3 to 15 according to Figure 9 of
+ETS&nbsp;300&nbsp;231, lsb first transmitted.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_SLICED_CAPTION_525</CODE
+></TD
+><TD
+>0x1000</TD
+><TD
+><A
+HREF="b17127.htm#EIA608"
+><ABBR
+CLASS="ABBREV"
+>EIA&nbsp;608-B</ABBR
+></A
+></TD
+><TD
+>NTSC line 21, 284 (second field 21)</TD
+><TD
+>Two bytes in transmission order, including parity
+bit, lsb first transmitted.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_SLICED_WSS_625</CODE
+></TD
+><TD
+>0x4000</TD
+><TD
+><A
+HREF="b17127.htm#ITU1119"
+><ABBR
+CLASS="ABBREV"
+>ITU&nbsp;BT.1119</ABBR
+></A
+>, <A
+HREF="b17127.htm#EN300294"
+><ABBR
+CLASS="ABBREV"
+>EN&nbsp;300&nbsp;294</ABBR
+></A
+></TD
+><TD
+>PAL/SECAM line 23</TD
+><TD
+><PRE
+CLASS="SCREEN"
+>Byte         0                 1
+      msb         lsb  msb           lsb
+ Bit  7 6 5 4 3 2 1 0  x x 13 12 11 10 9</PRE
+></TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_SLICED_VBI_525</CODE
+></TD
+><TD
+>0x1000</TD
+><TD
+COLSPAN="3"
+>Set of services applicable to 525
+line systems.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_SLICED_VBI_625</CODE
+></TD
+><TD
+>0x4401</TD
+><TD
+COLSPAN="3"
+>Set of services applicable to 625
+line systems.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><P
+>Drivers may return an <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code when applications attempt to
+read or write data without prior format negotiation, after switching
+the video standard (which may invalidate the negotiated VBI
+parameters) and after switching the video input (which may change the
+video standard as a side effect). The <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctl may return
+an <SPAN
+CLASS="ERRORCODE"
+>EBUSY</SPAN
+> error code when applications attempt to change the format while i/o is
+in progress (between a <A
+HREF="r13817.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMON</CODE
+></A
+> and <A
+HREF="r13817.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_STREAMOFF</CODE
+></A
+> call,
+and after the first <A
+HREF="r14264.htm"
+><CODE
+CLASS="FUNCTION"
+>read()</CODE
+></A
+> or <A
+HREF="r14496.htm"
+><CODE
+CLASS="FUNCTION"
+>write()</CODE
+></A
+> call).</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN7483"
+>4.8.4. Reading and writing sliced VBI data</A
+></H2
+><P
+>A single <A
+HREF="r14264.htm"
+><CODE
+CLASS="FUNCTION"
+>read()</CODE
+></A
+> or <A
+HREF="r14496.htm"
+><CODE
+CLASS="FUNCTION"
+>write()</CODE
+></A
+> call must pass all data
+belonging to one video frame. That is an array of
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_sliced_vbi_data</CODE
+> structures with one or
+more elements and a total size not exceeding
+<CODE
+CLASS="STRUCTFIELD"
+>io_size</CODE
+> bytes. Likewise in streaming I/O
+mode one buffer of <CODE
+CLASS="STRUCTFIELD"
+>io_size</CODE
+> bytes must
+contain data of one video frame. The <CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+> of
+unused <CODE
+CLASS="STRUCTNAME"
+>v4l2_sliced_vbi_data</CODE
+> elements must be
+zero.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="V4L2-SLICED-VBI-DATA"
+></A
+><P
+><B
+>Table 4-8. struct
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_sliced_vbi_data</CODE
+></B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="38%"
+TITLE="C1"><COL
+WIDTH="12%"
+TITLE="C2"><COL
+WIDTH="50%"
+TITLE="C3"><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+></TD
+><TD
+>A flag from <A
+HREF="r12051.htm#VBI-SERVICES"
+>Table 2</A
+>
+identifying the type of data in this packet. Only a single bit must be
+set. When the <CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+> of a captured packet is
+zero, the packet is empty and the contents of other fields are
+undefined. Applications shall ignore empty packets. When the
+<CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+> of a packet for output is zero the
+contents of the <CODE
+CLASS="STRUCTFIELD"
+>data</CODE
+> field are undefined
+and the driver must no longer insert data on the requested
+<CODE
+CLASS="STRUCTFIELD"
+>field</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>line</CODE
+>.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>field</CODE
+></TD
+><TD
+>The video field number this data has been captured
+from, or shall be inserted at. <CODE
+CLASS="CONSTANT"
+>0</CODE
+> for the first
+field, <CODE
+CLASS="CONSTANT"
+>1</CODE
+> for the second field.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>line</CODE
+></TD
+><TD
+>The field (as opposed to frame) line number this
+data has been captured from, or shall be inserted at. See <A
+HREF="x7013.htm#VBI-525"
+>Figure 4-2</A
+> and <A
+HREF="x7013.htm#VBI-625"
+>Figure 4-3</A
+> for valid
+values. Sliced VBI capture devices can set the line number of all
+packets to <CODE
+CLASS="CONSTANT"
+>0</CODE
+> if the hardware cannot reliably
+identify scan lines. The field number must always be valid.</TD
+></TR
+><TR
+><TD
+>__u32</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>reserved</CODE
+></TD
+><TD
+>This field is reserved for future extensions.
+Applications and drivers must set it to zero.</TD
+></TR
+><TR
+><TD
+>__u8</TD
+><TD
+><CODE
+CLASS="STRUCTFIELD"
+>data</CODE
+>[48]</TD
+><TD
+>The packet payload. See <A
+HREF="r12051.htm#VBI-SERVICES"
+>Table 2</A
+> for the contents and number of
+bytes passed for each data type. The contents of padding bytes at the
+end of this array are undefined, drivers and applications shall ignore
+them.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+><P
+>Packets are always passed in ascending line number order,
+without duplicate line numbers. The <A
+HREF="r14496.htm"
+><CODE
+CLASS="FUNCTION"
+>write()</CODE
+></A
+> function and the
+<A
+HREF="r12878.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QBUF</CODE
+></A
+> ioctl must return an <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code when applications violate
+this rule. They must also return an <SPAN
+CLASS="ERRORCODE"
+>EINVAL</SPAN
+> error code when applications pass an
+incorrect field or line number, or a combination of
+<CODE
+CLASS="STRUCTFIELD"
+>field</CODE
+>, <CODE
+CLASS="STRUCTFIELD"
+>line</CODE
+> and
+<CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+> which has not been negotiated with the
+<A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_FMT</CODE
+></A
+> or <A
+HREF="r10944.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_FMT</CODE
+></A
+> ioctl. When the line numbers are
+unknown the driver must pass the packets in transmitted order. The
+driver can insert empty packets with <CODE
+CLASS="STRUCTFIELD"
+>id</CODE
+> set
+to zero anywhere in the packet array.</P
+><P
+>To assure synchronization and to distinguish from frame
+dropping, when a captured frame does not carry any of the requested
+data services drivers must pass one or more empty packets. When an
+application fails to pass VBI data in time for output, the driver
+must output the last VPS and WSS packet again, and disable the output
+of Closed Caption and Teletext data, or output data which is ignored
+by Closed Caption and Teletext decoders.</P
+><P
+>A sliced VBI device may support <A
+HREF="c5742.htm#RW"
+>read/write</A
+> and/or streaming (<A
+HREF="x5791.htm"
+>memory mapping</A
+> and/or <A
+HREF="x5884.htm"
+>user
+pointer</A
+>) I/O. The latter bears the possibility of synchronizing
+video and VBI data by using buffer timestamps.</P
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x7013.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x7561.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Raw VBI Data Interface</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c6488.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Teletext Interface</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x7561.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x7561.htm
new file mode 100644
index 0000000..e7fe390
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x7561.htm
@@ -0,0 +1,214 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Teletext Interface</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Interfaces"
+HREF="c6488.htm"><LINK
+REL="PREVIOUS"
+TITLE="Sliced VBI Data Interface"
+HREF="x7236.htm"><LINK
+REL="NEXT"
+TITLE="Radio Interface"
+HREF="x7578.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x7236.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 4. Interfaces</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x7578.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="TTX"
+>4.9. Teletext Interface</A
+></H1
+><P
+>This interface aims at devices receiving and demodulating
+Teletext data [<A
+HREF="b17127.htm#ETS300706"
+><ABBR
+CLASS="ABBREV"
+>ETS&nbsp;300&nbsp;706</ABBR
+></A
+>, <A
+HREF="b17127.htm#ITU653"
+><ABBR
+CLASS="ABBREV"
+>ITU&nbsp;BT.653</ABBR
+></A
+>], evaluating the
+Teletext packages and storing formatted pages in cache memory. Such
+devices are usually implemented as microcontrollers with serial
+interface (I<SUP
+>2</SUP
+>C) and can be found on older
+TV cards, dedicated Teletext decoding cards and home-brew devices
+connected to the PC parallel port.</P
+><P
+>The Teletext API was designed by Martin Buck. It is defined in
+the kernel header file <TT
+CLASS="FILENAME"
+>linux/videotext.h</TT
+>, the
+specification is available from <A
+HREF="http://home.pages.de/~videotext/"
+TARGET="_top"
+>http://home.pages.de/~videotext/</A
+>. (Videotext is the name of
+the German public television Teletext service.) Conventional character
+device file names are <TT
+CLASS="FILENAME"
+>/dev/vtx</TT
+> and
+<TT
+CLASS="FILENAME"
+>/dev/vttuner</TT
+>, with device number 83, 0 and 83, 16
+respectively. A similar interface exists for the Philips SAA5249
+Teletext decoder [specification?] with character device file names
+<TT
+CLASS="FILENAME"
+>/dev/tlkN</TT
+>, device number 102, N.</P
+><P
+>Eventually the Teletext API was integrated into the V4L API
+with character device file names <TT
+CLASS="FILENAME"
+>/dev/vtx0</TT
+> to
+<TT
+CLASS="FILENAME"
+>/dev/vtx31</TT
+>, device major number 81, minor numbers
+192 to 223. For reference the V4L Teletext API specification is
+reproduced here in full: "Teletext interfaces talk the existing VTX
+API." Teletext devices with major number 83 and 102 will be removed in
+Linux 2.6.</P
+><P
+>There are no plans to replace the Teletext API or to integrate
+it into V4L2. Please write to the Video4Linux mailing list: <A
+HREF="https://listman.redhat.com/mailman/listinfo/video4linux-list"
+TARGET="_top"
+>https://listman.redhat.com/mailman/listinfo/video4linux-list</A
+> 
+when the need arises.</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x7236.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x7578.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Sliced VBI Data Interface</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c6488.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Radio Interface</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x7578.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x7578.htm
new file mode 100644
index 0000000..15e9fb1
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x7578.htm
@@ -0,0 +1,248 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Radio Interface</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Interfaces"
+HREF="c6488.htm"><LINK
+REL="PREVIOUS"
+TITLE="Teletext Interface"
+HREF="x7561.htm"><LINK
+REL="NEXT"
+TITLE="RDS Interface"
+HREF="x7607.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x7561.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 4. Interfaces</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x7607.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="RADIO"
+>4.10. Radio Interface</A
+></H1
+><P
+>This interface is intended for AM and FM (analog) radio
+receivers.</P
+><P
+>Conventionally V4L2 radio devices are accessed through
+character device special files named <TT
+CLASS="FILENAME"
+>/dev/radio</TT
+>
+and <TT
+CLASS="FILENAME"
+>/dev/radio0</TT
+> to
+<TT
+CLASS="FILENAME"
+>/dev/radio63</TT
+> with major number 81 and minor
+numbers 64 to 127.</P
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN7585"
+>4.10.1. Querying Capabilities</A
+></H2
+><P
+>Devices supporting the radio interface set the
+<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_RADIO</CODE
+> and
+<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_TUNER</CODE
+> flag in the
+<CODE
+CLASS="STRUCTFIELD"
+>capabilities</CODE
+> field of struct&nbsp;<A
+HREF="r13105.htm#V4L2-CAPABILITY"
+>v4l2_capability</A
+>
+returned by the <A
+HREF="r13105.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCAP</CODE
+></A
+> ioctl. Other combinations of
+capability flags are reserved for future extensions.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN7594"
+>4.10.2. Supplemental Functions</A
+></H2
+><P
+>Radio devices can support <A
+HREF="x542.htm"
+>controls</A
+>, and must support the <A
+HREF="x394.htm"
+>tuner</A
+> ioctls.</P
+><P
+>They do not support the video input or output, audio input
+or output, video standard, cropping and scaling, compression and
+streaming parameter, or overlay ioctls. All other ioctls and I/O
+methods are reserved for future extensions.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN7600"
+>4.10.3. Programming</A
+></H2
+><P
+>Radio devices may have a couple audio controls (as discussed
+in <A
+HREF="x542.htm"
+>Section 1.8</A
+>) such as a volume control, possibly custom
+controls. Further all radio devices have one tuner (these are
+discussed in <A
+HREF="x394.htm"
+>Section 1.6</A
+>) with index number zero to select
+the radio frequency and to determine if a monaural or FM stereo
+program is received. Drivers switch automatically between AM and FM
+depending on the selected frequency. The <A
+HREF="r12342.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_TUNER</CODE
+></A
+> ioctl
+reports the supported frequency range.</P
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x7561.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x7607.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Teletext Interface</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c6488.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>RDS Interface</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x7607.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x7607.htm
new file mode 100644
index 0000000..8986ce3
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x7607.htm
@@ -0,0 +1,197 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>RDS Interface</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Interfaces"
+HREF="c6488.htm"><LINK
+REL="PREVIOUS"
+TITLE="Radio Interface"
+HREF="x7578.htm"><LINK
+REL="NEXT"
+TITLE="Function Reference"
+HREF="r7624.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x7578.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 4. Interfaces</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="r7624.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="RDS"
+>4.11. RDS Interface</A
+></H1
+><P
+>The Radio Data System transmits supplementary
+information in binary format, for example the station name or travel
+information, on a inaudible audio subcarrier of a radio program. This
+interface aims at devices capable of receiving and decoding RDS
+information.</P
+><P
+>The V4L API defines its RDS API as follows.</P
+><P
+>From radio devices supporting it, RDS data can be read
+with the <A
+HREF="r14264.htm"
+><CODE
+CLASS="FUNCTION"
+>read()</CODE
+></A
+> function. The data is packed in groups of three,
+as follows:<P
+></P
+><OL
+TYPE="1"
+><LI
+><P
+>First Octet Least Significant Byte of RDS Block</P
+></LI
+><LI
+><P
+>Second Octet Most Significant Byte of RDS Block</P
+></LI
+><LI
+><P
+>Third Octet Bit 7: Error bit. Indicates that an
+uncorrectable error occurred during reception of this block. Bit 6:
+Corrected bit. Indicates that an error was corrected for this data
+block. Bits 5-3: Received Offset. Indicates the offset received by the
+sync system. Bits 2-0: Offset Name. Indicates the offset applied to
+this data.</P
+></LI
+></OL
+></P
+><P
+>It was argued  the RDS API should be
+extended before integration into V4L2, no new API has been devised yet.
+Please write to the Video4Linux mailing list for discussion: <A
+HREF="https://listman.redhat.com/mailman/listinfo/video4linux-list"
+TARGET="_top"
+>https://listman.redhat.com/mailman/listinfo/video4linux-list</A
+>. 
+Meanwhile no V4L2 driver should set the
+<CODE
+CLASS="CONSTANT"
+>V4L2_CAP_RDS_CAPTURE</CODE
+> capability flag.</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x7578.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="r7624.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Radio Interface</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c6488.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Function Reference</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x802.htm b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x802.htm
new file mode 100644
index 0000000..003da77
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/doc/spec/x802.htm
@@ -0,0 +1,3637 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
+<HTML
+><HEAD
+><TITLE
+>Extended Controls</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+TITLE="Video for Linux Two API Specification"
+HREF="book1.htm"><LINK
+REL="UP"
+TITLE="Common API Elements"
+HREF="c174.htm"><LINK
+REL="PREVIOUS"
+TITLE="User Controls"
+HREF="x542.htm"><LINK
+REL="NEXT"
+TITLE="Data Formats"
+HREF="x1859.htm"></HEAD
+><BODY
+CLASS="SECTION"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Video for Linux Two API Specification: Revision 0.24</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="x542.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 1. Common API Elements</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="x1859.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECTION"
+><H1
+CLASS="SECTION"
+><A
+NAME="EXTENDED-CONTROLS"
+>1.9. Extended Controls</A
+></H1
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN804"
+>1.9.1. Introduction</A
+></H2
+><P
+>The control mechanism as originally designed was meant
+to be used for user settings (brightness, saturation, etc). However,
+it turned out to be a very useful model for implementing more
+complicated driver APIs where each driver implements only a subset of
+a larger API.</P
+><P
+>The MPEG encoding API was the driving force behind
+designing and implementing this extended control mechanism: the MPEG
+standard is quite large and the currently supported hardware MPEG
+encoders each only implement a subset of this standard. Further more,
+many parameters relating to how the video is encoded into an MPEG
+stream are specific to the MPEG encoding chip since the MPEG standard
+only defines the format of the resulting MPEG stream, not how the
+video is actually encoded into that format.</P
+><P
+>Unfortunately, the original control API lacked some
+features needed for these new uses and so it was extended into the
+(not terribly originally named) extended control API.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN809"
+>1.9.2. The Extended Control API</A
+></H2
+><P
+>Three new ioctls are available: <A
+HREF="r10386.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_EXT_CTRLS</CODE
+></A
+>,
+<A
+HREF="r10386.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_EXT_CTRLS</CODE
+></A
+> and <A
+HREF="r10386.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_TRY_EXT_CTRLS</CODE
+></A
+>. These ioctls act on
+arrays of controls (as opposed to the <A
+HREF="r10104.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_G_CTRL</CODE
+></A
+> and
+<A
+HREF="r10104.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_S_CTRL</CODE
+></A
+> ioctls that act on a single control). This is needed
+since it is often required to atomically change several controls at
+once.</P
+><P
+>Each of the new ioctls expects a pointer to a
+struct&nbsp;<A
+HREF="r10386.htm#V4L2-EXT-CONTROLS"
+>v4l2_ext_controls</A
+>. This structure contains a pointer to the control
+array, a count of the number of controls in that array and a control
+class. Control classes are used to group similar controls into a
+single class. For example, control class
+<CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_CLASS_USER</CODE
+> contains all user controls
+(i.&nbsp;e. all controls that can also be set using the old
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_S_CTRL</CODE
+> ioctl). Control class
+<CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_CLASS_MPEG</CODE
+> contains all controls
+relating to MPEG encoding, etc.</P
+><P
+>All controls in the control array must belong to the
+specified control class. An error is returned if this is not the
+case.</P
+><P
+>It is also possible to use an empty control array (count
+== 0) to check whether the specified control class is
+supported.</P
+><P
+>The control array is a struct&nbsp;<A
+HREF="r10386.htm#V4L2-EXT-CONTROL"
+>v4l2_ext_control</A
+> array. The
+<CODE
+CLASS="STRUCTNAME"
+>v4l2_ext_control</CODE
+> structure is very similar to
+struct&nbsp;<A
+HREF="r10104.htm#V4L2-CONTROL"
+>v4l2_control</A
+>, except for the fact that it also allows for 64-bit
+values and pointers to be passed (although the latter is not yet used
+anywhere).</P
+><P
+>It is important to realize that due to the flexibility of
+controls it is necessary to check whether the control you want to set
+actually is supported in the driver and what the valid range of values
+is. So use the <A
+HREF="r13317.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCTRL</CODE
+></A
+> and <A
+HREF="r13317.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYMENU</CODE
+></A
+> ioctls to
+check this. Also note that it is possible that some of the menu
+indices in a control of type <CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_TYPE_MENU</CODE
+>
+may not be supported (<CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYMENU</CODE
+> will
+return an error). A good example is the list of supported MPEG audio
+bitrates. Some drivers only support one or two bitrates, others
+support a wider range.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN840"
+>1.9.3. Enumerating Extended Controls</A
+></H2
+><P
+>The recommended way to enumerate over the extended
+controls is by using <A
+HREF="r13317.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCTRL</CODE
+></A
+> in combination with the
+<CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_FLAG_NEXT_CTRL</CODE
+> flag:</P
+><DIV
+CLASS="INFORMALEXAMPLE"
+><P
+></P
+><A
+NAME="AEN846"
+></A
+><PRE
+CLASS="PROGRAMLISTING"
+>struct&nbsp;<A
+HREF="r13317.htm#V4L2-QUERYCTRL"
+>v4l2_queryctrl</A
+> qctrl;
+
+qctrl.id = V4L2_CTRL_FLAG_NEXT_CTRL;
+while (0 == ioctl (fd, <A
+HREF="r13317.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCTRL</CODE
+></A
+>, &amp;qctrl)) {
+        /* ... */
+        qctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL;
+}</PRE
+><P
+></P
+></DIV
+><P
+>The initial control ID is set to 0 ORed with the
+<CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_FLAG_NEXT_CTRL</CODE
+> flag. The
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCTRL</CODE
+> ioctl will return the first
+control with a higher ID than the specified one. When no such controls
+are found an error is returned.</P
+><P
+>If you want to get all controls within a specific control
+class, then you can set the initial
+<CODE
+CLASS="STRUCTFIELD"
+>qctrl.id</CODE
+> value to the control class and add
+an extra check to break out of the loop when a control of another
+control class is found:</P
+><DIV
+CLASS="INFORMALEXAMPLE"
+><P
+></P
+><A
+NAME="AEN856"
+></A
+><PRE
+CLASS="PROGRAMLISTING"
+>qctrl.id = V4L2_CTRL_CLASS_MPEG | V4L2_CTRL_FLAG_NEXT_CTRL;
+while (0 == ioctl (fd, <A
+HREF="r13317.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCTRL</CODE
+></A
+>, &amp;qctrl)) {
+        if (V4L2_CTRL_ID2CLASS (qctrl.id) != V4L2_CTRL_CLASS_MPEG)
+                break;
+                /* ... */
+                qctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL;
+        }</PRE
+><P
+></P
+></DIV
+><P
+>The 32-bit <CODE
+CLASS="STRUCTFIELD"
+>qctrl.id</CODE
+> value is
+subdivided into three bit ranges: the top 4 bits are reserved for
+flags (e.&nbsp;g. <CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_FLAG_NEXT_CTRL</CODE
+>) and are not
+actually part of the ID. The remaining 28 bits form the control ID, of
+which the most significant 12 bits define the control class and the
+least significant 16 bits identify the control within the control
+class. It is guaranteed that these last 16 bits are always non-zero
+for controls. The range of 0x1000 and up are reserved for
+driver-specific controls. The macro
+<CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_ID2CLASS(id)</CODE
+> returns the control class
+ID based on a control ID.</P
+><P
+>If the driver does not support extended controls, then
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCTRL</CODE
+> will fail when used in
+combination with <CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_FLAG_NEXT_CTRL</CODE
+>. In
+that case the old method of enumerating control should be used (see
+1.8). But if it is supported, then it is guaranteed to enumerate over
+all controls, including driver-private controls.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="AEN867"
+>1.9.4. Creating Control Panels</A
+></H2
+><P
+>It is possible to create control panels for a graphical
+user interface where the user can select the various controls.
+Basically you will have to iterate over all controls using the method
+described above. Each control class starts with a control of type
+<CODE
+CLASS="CONSTANT"
+>V4L2_CTRL_TYPE_CTRL_CLASS</CODE
+>.
+<CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCTRL</CODE
+> will return the name of this
+control class which can be used as the title of a tab page within a
+control panel.</P
+><P
+>The flags field of struct&nbsp;<A
+HREF="r13317.htm#V4L2-QUERYCTRL"
+>v4l2_queryctrl</A
+> also contains hints on
+the behavior of the control. See the <A
+HREF="r13317.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCTRL</CODE
+></A
+> documentation
+for more details.</P
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="MPEG-CONTROLS"
+>1.9.5. MPEG Control Reference</A
+></H2
+><P
+>Below all controls within the MPEG control class are
+described. First the generic controls, then controls specific for
+certain hardware.</P
+><DIV
+CLASS="SECTION"
+><H3
+CLASS="SECTION"
+><A
+NAME="AEN879"
+>1.9.5.1. Generic MPEG Controls</A
+></H3
+><DIV
+CLASS="TABLE"
+><A
+NAME="MPEG-CONTROL-ID"
+></A
+><P
+><B
+>Table 1-2. MPEG Control IDs</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="7%"
+TITLE="C1"><COL
+WIDTH="40%"
+TITLE="C2"><COL
+WIDTH="13%"
+TITLE="C3"><COL
+WIDTH="40%"
+TITLE="C4"><THEAD
+><TR
+><TH
+COLSPAN="2"
+ALIGN="LEFT"
+>ID</TH
+><TH
+ALIGN="LEFT"
+>Type</TH
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TH
+>&nbsp;</TH
+><TH
+COLSPAN="3"
+ALIGN="LEFT"
+>Description</TH
+></TR
+></THEAD
+><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_CLASS</CODE
+>&nbsp;</TD
+><TD
+>class</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>The MPEG class
+descriptor. Calling <A
+HREF="r13317.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCTRL</CODE
+></A
+> for this control will return a
+description of this control class. This description can be used as the
+caption of a Tab page in a GUI, for example.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_STREAM_TYPE</CODE
+>&nbsp;</TD
+><TD
+>enum</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>The MPEG-1, -2 or -4
+output stream type. One cannot assume anything here. Each hardware
+MPEG encoder tends to support different subsets of the available MPEG
+stream types. The currently defined stream types are:</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_STREAM_TYPE_MPEG2_PS</CODE
+>&nbsp;</TD
+><TD
+>MPEG-2 program stream</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_STREAM_TYPE_MPEG2_TS</CODE
+>&nbsp;</TD
+><TD
+>MPEG-2 transport stream</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_STREAM_TYPE_MPEG1_SS</CODE
+>&nbsp;</TD
+><TD
+>MPEG-1 system stream</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_STREAM_TYPE_MPEG2_DVD</CODE
+>&nbsp;</TD
+><TD
+>MPEG-2 DVD-compatible stream</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_STREAM_TYPE_MPEG1_VCD</CODE
+>&nbsp;</TD
+><TD
+>MPEG-1 VCD-compatible stream</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD</CODE
+>&nbsp;</TD
+><TD
+>MPEG-2 SVCD-compatible stream</TD
+></TR
+></TBODY
+></TABLE
+></TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_STREAM_PID_PMT</CODE
+>&nbsp;</TD
+><TD
+>integer</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Program Map Table
+Packet ID for the MPEG transport stream (default 16)</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_STREAM_PID_AUDIO</CODE
+>&nbsp;</TD
+><TD
+>integer</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Audio Packet ID for
+the MPEG transport stream (default 256)</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_STREAM_PID_VIDEO</CODE
+>&nbsp;</TD
+><TD
+>integer</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Video Packet ID for
+the MPEG transport stream (default 260)</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_STREAM_PID_PCR</CODE
+>&nbsp;</TD
+><TD
+>integer</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Packet ID for the
+MPEG transport stream carrying PCR fields (default 259)</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_STREAM_PES_ID_AUDIO</CODE
+>&nbsp;</TD
+><TD
+>integer</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Audio ID for MPEG
+PES</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_STREAM_PES_ID_VIDEO</CODE
+>&nbsp;</TD
+><TD
+>integer</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Video ID for MPEG
+PES</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_STREAM_VBI_FMT</CODE
+>&nbsp;</TD
+><TD
+>enum</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Some cards can embed
+VBI data (e.&nbsp;g. Closed Caption, Teletext) into the MPEG stream. This
+control selects whether VBI data should be embedded, and if so, what
+embedding method should be used. The list of possible VBI formats
+depends on the driver. The currently defined VBI format types
+are:</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_STREAM_VBI_FMT_NONE</CODE
+>&nbsp;</TD
+><TD
+>No VBI in the MPEG stream</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_STREAM_VBI_FMT_IVTV</CODE
+>&nbsp;</TD
+><TD
+>VBI in private packets, IVTV format (documented
+in the kernel sources in the file <TT
+CLASS="FILENAME"
+>Documentation/video4linux/cx2341x/README.vbi</TT
+>)</TD
+></TR
+></TBODY
+></TABLE
+></TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ</CODE
+>&nbsp;</TD
+><TD
+>enum</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>MPEG Audio sampling
+frequency. Possible values are:</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100</CODE
+>&nbsp;</TD
+><TD
+>44.1 kHz</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000</CODE
+>&nbsp;</TD
+><TD
+>48 kHz</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000</CODE
+>&nbsp;</TD
+><TD
+>32 kHz</TD
+></TR
+></TBODY
+></TABLE
+></TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_AUDIO_ENCODING</CODE
+>&nbsp;</TD
+><TD
+>enum</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>MPEG Audio encoding.
+Possible values are:</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_ENCODING_LAYER_1</CODE
+>&nbsp;</TD
+><TD
+>MPEG Layer I encoding</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_ENCODING_LAYER_2</CODE
+>&nbsp;</TD
+><TD
+>MPEG Layer II encoding</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_ENCODING_LAYER_3</CODE
+>&nbsp;</TD
+><TD
+>MPEG Layer III encoding</TD
+></TR
+></TBODY
+></TABLE
+></TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_AUDIO_L1_BITRATE</CODE
+>&nbsp;</TD
+><TD
+>enum</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Layer I bitrate.
+Possible values are:</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L1_BITRATE_32K</CODE
+>&nbsp;</TD
+><TD
+>32 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L1_BITRATE_64K</CODE
+>&nbsp;</TD
+><TD
+>64 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L1_BITRATE_96K</CODE
+>&nbsp;</TD
+><TD
+>96 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L1_BITRATE_128K</CODE
+>&nbsp;</TD
+><TD
+>128 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L1_BITRATE_160K</CODE
+>&nbsp;</TD
+><TD
+>160 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L1_BITRATE_192K</CODE
+>&nbsp;</TD
+><TD
+>192 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L1_BITRATE_224K</CODE
+>&nbsp;</TD
+><TD
+>224 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L1_BITRATE_256K</CODE
+>&nbsp;</TD
+><TD
+>256 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L1_BITRATE_288K</CODE
+>&nbsp;</TD
+><TD
+>288 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L1_BITRATE_320K</CODE
+>&nbsp;</TD
+><TD
+>320 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L1_BITRATE_352K</CODE
+>&nbsp;</TD
+><TD
+>352 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L1_BITRATE_384K</CODE
+>&nbsp;</TD
+><TD
+>384 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L1_BITRATE_416K</CODE
+>&nbsp;</TD
+><TD
+>416 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L1_BITRATE_448K</CODE
+>&nbsp;</TD
+><TD
+>448 kbit/s</TD
+></TR
+></TBODY
+></TABLE
+></TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_AUDIO_L2_BITRATE</CODE
+>&nbsp;</TD
+><TD
+>enum</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Layer II bitrate.
+Possible values are:</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L2_BITRATE_32K</CODE
+>&nbsp;</TD
+><TD
+>32 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L2_BITRATE_48K</CODE
+>&nbsp;</TD
+><TD
+>48 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L2_BITRATE_56K</CODE
+>&nbsp;</TD
+><TD
+>56 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L2_BITRATE_64K</CODE
+>&nbsp;</TD
+><TD
+>64 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L2_BITRATE_80K</CODE
+>&nbsp;</TD
+><TD
+>80 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L2_BITRATE_96K</CODE
+>&nbsp;</TD
+><TD
+>96 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L2_BITRATE_112K</CODE
+>&nbsp;</TD
+><TD
+>112 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L2_BITRATE_128K</CODE
+>&nbsp;</TD
+><TD
+>128 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L2_BITRATE_160K</CODE
+>&nbsp;</TD
+><TD
+>160 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L2_BITRATE_192K</CODE
+>&nbsp;</TD
+><TD
+>192 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L2_BITRATE_224K</CODE
+>&nbsp;</TD
+><TD
+>224 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L2_BITRATE_256K</CODE
+>&nbsp;</TD
+><TD
+>256 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L2_BITRATE_320K</CODE
+>&nbsp;</TD
+><TD
+>320 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L2_BITRATE_384K</CODE
+>&nbsp;</TD
+><TD
+>384 kbit/s</TD
+></TR
+></TBODY
+></TABLE
+></TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_AUDIO_L3_BITRATE</CODE
+>&nbsp;</TD
+><TD
+>enum</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Layer III bitrate.
+Possible values are:</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L3_BITRATE_32K</CODE
+>&nbsp;</TD
+><TD
+>32 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L3_BITRATE_40K</CODE
+>&nbsp;</TD
+><TD
+>40 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L3_BITRATE_48K</CODE
+>&nbsp;</TD
+><TD
+>48 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L3_BITRATE_56K</CODE
+>&nbsp;</TD
+><TD
+>56 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L3_BITRATE_64K</CODE
+>&nbsp;</TD
+><TD
+>64 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L3_BITRATE_80K</CODE
+>&nbsp;</TD
+><TD
+>80 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L3_BITRATE_96K</CODE
+>&nbsp;</TD
+><TD
+>96 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L3_BITRATE_112K</CODE
+>&nbsp;</TD
+><TD
+>112 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L3_BITRATE_128K</CODE
+>&nbsp;</TD
+><TD
+>128 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L3_BITRATE_160K</CODE
+>&nbsp;</TD
+><TD
+>160 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L3_BITRATE_192K</CODE
+>&nbsp;</TD
+><TD
+>192 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L3_BITRATE_224K</CODE
+>&nbsp;</TD
+><TD
+>224 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L3_BITRATE_256K</CODE
+>&nbsp;</TD
+><TD
+>256 kbit/s</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_L3_BITRATE_320K</CODE
+>&nbsp;</TD
+><TD
+>320 kbit/s</TD
+></TR
+></TBODY
+></TABLE
+></TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_AUDIO_MODE</CODE
+>&nbsp;</TD
+><TD
+>enum</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>MPEG Audio mode.
+Possible values are:</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_MODE_STEREO</CODE
+>&nbsp;</TD
+><TD
+>Stereo</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_MODE_JOINT_STEREO</CODE
+>&nbsp;</TD
+><TD
+>Joint Stereo</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_MODE_DUAL</CODE
+>&nbsp;</TD
+><TD
+>Bilingual</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_MODE_MONO</CODE
+>&nbsp;</TD
+><TD
+>Mono</TD
+></TR
+></TBODY
+></TABLE
+></TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_AUDIO_MODE_EXTENSION</CODE
+>&nbsp;</TD
+><TD
+>enum</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Joint Stereo
+audio mode extension. In Layer I and II they indicate which subbands
+are in intensity stereo. All other subbands are coded in stereo. Layer
+III is not (yet) supported. Possible values
+are:</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4</CODE
+>&nbsp;</TD
+><TD
+>Subbands 4-31 in intensity stereo</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8</CODE
+>&nbsp;</TD
+><TD
+>Subbands 8-31 in intensity stereo</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12</CODE
+>&nbsp;</TD
+><TD
+>Subbands 12-31 in intensity stereo</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16</CODE
+>&nbsp;</TD
+><TD
+>Subbands 16-31 in intensity stereo</TD
+></TR
+></TBODY
+></TABLE
+></TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_AUDIO_EMPHASIS</CODE
+>&nbsp;</TD
+><TD
+>enum</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Audio Emphasis.
+Possible values are:</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_EMPHASIS_NONE</CODE
+>&nbsp;</TD
+><TD
+>None</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS</CODE
+>&nbsp;</TD
+><TD
+>50/15 microsecond emphasis</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17</CODE
+>&nbsp;</TD
+><TD
+>CCITT J.17</TD
+></TR
+></TBODY
+></TABLE
+></TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_AUDIO_CRC</CODE
+>&nbsp;</TD
+><TD
+>enum</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>CRC method. Possible
+values are:</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_CRC_NONE</CODE
+>&nbsp;</TD
+><TD
+>None</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_AUDIO_CRC_CRC16</CODE
+>&nbsp;</TD
+><TD
+>16 bit parity check</TD
+></TR
+></TBODY
+></TABLE
+></TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_AUDIO_MUTE</CODE
+>&nbsp;</TD
+><TD
+>bool</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Mutes the audio when
+capturing. This is not done by muting audio hardware, which can still
+produce a slight hiss, but in the encoder itself, guaranteeing a fixed
+and reproducable audio bitstream. 0 = unmuted, 1 = muted.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_VIDEO_ENCODING</CODE
+>&nbsp;</TD
+><TD
+>enum</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>MPEG Video encoding
+method. Possible values are:</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_VIDEO_ENCODING_MPEG_1</CODE
+>&nbsp;</TD
+><TD
+>MPEG-1 Video encoding</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_VIDEO_ENCODING_MPEG_2</CODE
+>&nbsp;</TD
+><TD
+>MPEG-2 Video encoding</TD
+></TR
+></TBODY
+></TABLE
+></TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_VIDEO_ASPECT</CODE
+>&nbsp;</TD
+><TD
+>enum</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Video aspect.
+Possible values are:</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_VIDEO_ASPECT_1x1</CODE
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_VIDEO_ASPECT_4x3</CODE
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_VIDEO_ASPECT_16x9</CODE
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_VIDEO_ASPECT_221x100</CODE
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+></TBODY
+></TABLE
+></TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_VIDEO_B_FRAMES</CODE
+>&nbsp;</TD
+><TD
+>integer</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Number of B-Frames
+(default 2)</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_VIDEO_GOP_SIZE</CODE
+>&nbsp;</TD
+><TD
+>integer</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>GOP size (default
+12)</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_VIDEO_GOP_CLOSURE</CODE
+>&nbsp;</TD
+><TD
+>bool</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>GOP closure (default
+1)</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_VIDEO_PULLDOWN</CODE
+>&nbsp;</TD
+><TD
+>bool</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Enable 3:2 pulldown
+(default 0)</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_VIDEO_BITRATE_MODE</CODE
+>&nbsp;</TD
+><TD
+>enum</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Video bitrate mode.
+Possible values are:</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_VIDEO_BITRATE_MODE_VBR</CODE
+>&nbsp;</TD
+><TD
+>Variable bitrate</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_VIDEO_BITRATE_MODE_CBR</CODE
+>&nbsp;</TD
+><TD
+>Constant bitrate</TD
+></TR
+></TBODY
+></TABLE
+></TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_VIDEO_BITRATE</CODE
+>&nbsp;</TD
+><TD
+>integer</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Video bitrate in bits
+per second.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_VIDEO_BITRATE_PEAK</CODE
+>&nbsp;</TD
+><TD
+>integer</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Peak video bitrate in
+bits per second. Must be larger or equal to the average video bitrate.
+It is ignored if the video bitrate mode is set to constant
+bitrate.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION</CODE
+>&nbsp;</TD
+><TD
+>integer</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>For every captured
+frame, skip this many subsequent frames (default 0).</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_VIDEO_MUTE</CODE
+>&nbsp;</TD
+><TD
+>bool</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>"Mutes" the video to a
+fixed color when capturing. This is useful for testing, to produce a
+fixed video bitstream. 0 = unmuted, 1 = muted.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_VIDEO_MUTE_YUV</CODE
+>&nbsp;</TD
+><TD
+>integer</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Sets the "mute" color
+of the video. The supplied 32-bit integer is interpreted as follows (bit
+0 = least significant bit):</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>Bit 0:7</TD
+><TD
+>V chrominance information</TD
+></TR
+><TR
+><TD
+>Bit 8:15</TD
+><TD
+>U chrominance information</TD
+></TR
+><TR
+><TD
+>Bit 16:23</TD
+><TD
+>Y luminance information</TD
+></TR
+><TR
+><TD
+>Bit 24:31</TD
+><TD
+>Must be zero.</TD
+></TR
+></TBODY
+></TABLE
+></TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="SECTION"
+><H3
+CLASS="SECTION"
+><A
+NAME="AEN1509"
+>1.9.5.2. CX2341x MPEG Controls</A
+></H3
+><P
+>The following MPEG class controls deal with MPEG
+encoding settings that are specific to the Conexant CX23415 and
+CX23416 MPEG encoding chips.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="CX2341X-CONTROL-ID"
+></A
+><P
+><B
+>Table 1-3. CX2341x Control IDs</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="7%"
+TITLE="C1"><COL
+WIDTH="40%"
+TITLE="C2"><COL
+WIDTH="13%"
+TITLE="C3"><COL
+WIDTH="40%"
+TITLE="C4"><THEAD
+><TR
+><TH
+COLSPAN="2"
+ALIGN="LEFT"
+>ID</TH
+><TH
+ALIGN="LEFT"
+>Type</TH
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TH
+>&nbsp;</TH
+><TH
+COLSPAN="3"
+ALIGN="LEFT"
+>Description</TH
+></TR
+></THEAD
+><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE</CODE
+>&nbsp;</TD
+><TD
+>enum</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Sets the Spatial
+Filter mode (default <CODE
+CLASS="CONSTANT"
+>MANUAL</CODE
+>). Possible values
+are:</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL</CODE
+>&nbsp;</TD
+><TD
+>Choose the filter manually</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO</CODE
+>&nbsp;</TD
+><TD
+>Choose the filter automatically</TD
+></TR
+></TBODY
+></TABLE
+></TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER</CODE
+>&nbsp;</TD
+><TD
+>integer&nbsp;(0-15)</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>The setting for the
+Spatial Filter. 0 = off, 15 = maximum. (Default is 0.)</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE</CODE
+>&nbsp;</TD
+><TD
+>enum</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Select the algorithm
+to use for the Luma Spatial Filter (default
+<CODE
+CLASS="CONSTANT"
+>1D_HOR</CODE
+>). Possible values:</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF</CODE
+>&nbsp;</TD
+><TD
+>No filter</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR</CODE
+>&nbsp;</TD
+><TD
+>One-dimensional horizontal</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT</CODE
+>&nbsp;</TD
+><TD
+>One-dimensional vertical</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE</CODE
+>&nbsp;</TD
+><TD
+>Two-dimensional separable</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE</CODE
+>&nbsp;</TD
+><TD
+>Two-dimensional symmetrical
+non-separable</TD
+></TR
+></TBODY
+></TABLE
+></TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE</CODE
+>&nbsp;</TD
+><TD
+>enum</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Select the algorithm
+for the Chroma Spatial Filter (default <CODE
+CLASS="CONSTANT"
+>1D_HOR</CODE
+>).
+Possible values are:</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF</CODE
+>&nbsp;</TD
+><TD
+>No filter</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR</CODE
+>&nbsp;</TD
+><TD
+>One-dimensional horizontal</TD
+></TR
+></TBODY
+></TABLE
+></TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE</CODE
+>&nbsp;</TD
+><TD
+>enum</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Sets the Temporal
+Filter mode (default <CODE
+CLASS="CONSTANT"
+>MANUAL</CODE
+>). Possible values
+are:</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL</CODE
+>&nbsp;</TD
+><TD
+>Choose the filter manually</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO</CODE
+>&nbsp;</TD
+><TD
+>Choose the filter automatically</TD
+></TR
+></TBODY
+></TABLE
+></TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER</CODE
+>&nbsp;</TD
+><TD
+>integer&nbsp;(0-31)</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>The setting for the
+Temporal Filter. 0 = off, 31 = maximum. (Default is 8 for full-scale
+capturing and 0 for scaled capturing.)</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE</CODE
+>&nbsp;</TD
+><TD
+>enum</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Median Filter Type
+(default <CODE
+CLASS="CONSTANT"
+>OFF</CODE
+>). Possible values are:</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF</CODE
+>&nbsp;</TD
+><TD
+>No filter</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR</CODE
+>&nbsp;</TD
+><TD
+>Horizontal filter</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT</CODE
+>&nbsp;</TD
+><TD
+>Vertical filter</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT</CODE
+>&nbsp;</TD
+><TD
+>Horizontal and vertical filter</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG</CODE
+>&nbsp;</TD
+><TD
+>Diagonal filter</TD
+></TR
+></TBODY
+></TABLE
+></TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM</CODE
+>&nbsp;</TD
+><TD
+>integer&nbsp;(0-255)</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Threshold above which
+the luminance median filter is enabled (default 0)</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP</CODE
+>&nbsp;</TD
+><TD
+>integer&nbsp;(0-255)</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Threshold below which
+the luminance median filter is enabled (default 255)</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM</CODE
+>&nbsp;</TD
+><TD
+>integer&nbsp;(0-255)</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Threshold above which
+the chroma median filter is enabled (default 0)</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP</CODE
+>&nbsp;</TD
+><TD
+>integer&nbsp;(0-255)</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Threshold below which
+the chroma median filter is enabled (default 255)</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS</CODE
+>&nbsp;</TD
+><TD
+>bool</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>The CX2341X MPEG encoder
+can insert one empty MPEG-2 PES packet into the stream between every
+four video frames. The packet size is 2048 bytes, including the
+packet_start_code_prefix and stream_id fields. The stream_id is 0xBF
+(private stream 2). The payload consists of 0x00 bytes, to be filled
+in by the application. 0 = do not insert, 1 = insert packets.</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="SECTION"
+><H2
+CLASS="SECTION"
+><A
+NAME="CAMERA-CONTROLS"
+>1.9.6. Camera Control Reference</A
+></H2
+><P
+>The Camera class includes controls for mechanical (or
+equivalent digital) features of a device such as controllable lenses
+or sensors.</P
+><DIV
+CLASS="TABLE"
+><A
+NAME="CAMERA-CONTROL-ID"
+></A
+><P
+><B
+>Table 1-4. Camera Control IDs</B
+></P
+><TABLE
+BORDER="0"
+FRAME="void"
+WIDTH="100%"
+CLASS="CALSTABLE"
+><COL
+WIDTH="7%"
+TITLE="C1"><COL
+WIDTH="40%"
+TITLE="C2"><COL
+WIDTH="13%"
+TITLE="C3"><COL
+WIDTH="40%"
+TITLE="C4"><THEAD
+><TR
+><TH
+COLSPAN="2"
+ALIGN="LEFT"
+>ID</TH
+><TH
+ALIGN="LEFT"
+>Type</TH
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TH
+>&nbsp;</TH
+><TH
+COLSPAN="3"
+ALIGN="LEFT"
+>Description</TH
+></TR
+></THEAD
+><TBODY
+VALIGN="TOP"
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_CAMERA_CLASS</CODE
+>&nbsp;</TD
+><TD
+>class</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>The Camera class
+descriptor. Calling <A
+HREF="r13317.htm"
+><CODE
+CLASS="CONSTANT"
+>VIDIOC_QUERYCTRL</CODE
+></A
+> for this control will return a
+description of this control class.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_EXPOSURE_AUTO</CODE
+>&nbsp;</TD
+><TD
+>integer</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Enables automatic
+adjustments of the exposure time and/or iris aperture. The effect of
+manual changes of the exposure time or iris aperture while these
+features are enabled is undefined, drivers should ignore such
+requests. Possible values are:</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><COL><COL><TBODY
+VALIGN="TOP"
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_EXPOSURE_AUTO</CODE
+>&nbsp;</TD
+><TD
+>Automatic exposure time, automatic iris
+aperture.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_EXPOSURE_MANUAL</CODE
+>&nbsp;</TD
+><TD
+>Manual exposure time, manual iris.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_EXPOSURE_SHUTTER_PRIORITY</CODE
+>&nbsp;</TD
+><TD
+>Manual exposure time, auto iris.</TD
+></TR
+><TR
+><TD
+><CODE
+CLASS="CONSTANT"
+>V4L2_EXPOSURE_APERTURE_PRIORITY</CODE
+>&nbsp;</TD
+><TD
+>Auto exposure time, manual iris.</TD
+></TR
+></TBODY
+></TABLE
+></TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_EXPOSURE_ABSOLUTE</CODE
+>&nbsp;</TD
+><TD
+>integer</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Determines the exposure
+time of the camera sensor. The exposure time is limited by the frame
+interval. Drivers should interpret the values as 100 &micro;s units,
+where the value 1 stands for 1/10000th of a second, 10000 for 1 second
+and 100000 for 10 seconds.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_EXPOSURE_AUTO_PRIORITY</CODE
+>&nbsp;</TD
+><TD
+>boolean</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>When
+<CODE
+CLASS="CONSTANT"
+>V4L2_CID_EXPOSURE_AUTO</CODE
+> is set to
+<CODE
+CLASS="CONSTANT"
+>AUTO</CODE
+> or <CODE
+CLASS="CONSTANT"
+>SHUTTER_PRIORITY</CODE
+>,
+this control determines if the device may dynamically vary the frame
+rate. By default this feature is disabled (0) and the frame rate must
+remain constant.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_PAN_RELATIVE</CODE
+>&nbsp;</TD
+><TD
+>integer</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>This control turns the
+camera horizontally by the specified amount. The unit is undefined. A
+positive value moves the camera to the right (clockwise when viewed
+from above), a negative value to the left. A value of zero does not
+cause motion.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_TILT_RELATIVE</CODE
+>&nbsp;</TD
+><TD
+>integer</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>This control turns the
+camera vertically by the specified amount. The unit is undefined. A
+positive value moves the camera up, a negative value down. A value of
+zero does not cause motion.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_PAN_RESET</CODE
+>&nbsp;</TD
+><TD
+>boolean</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>When this control is set
+to <CODE
+CLASS="CONSTANT"
+>TRUE</CODE
+> (1), the camera moves horizontally to the
+default position.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_TILT_RESET</CODE
+>&nbsp;</TD
+><TD
+>boolean</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>When this control is set
+to <CODE
+CLASS="CONSTANT"
+>TRUE</CODE
+> (1), the camera moves vertically to the
+default position.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_PAN_ABSOLUTE</CODE
+>&nbsp;</TD
+><TD
+>integer</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>This control
+turns the camera horizontally to the specified position. Positive
+values move the camera to the right (clockwise when viewed from above),
+negative values to the left. Drivers should interpret the values as arc
+seconds, with valid values between -180 * 3600 and +180 * 3600
+inclusive.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_TILT_ABSOLUTE</CODE
+>&nbsp;</TD
+><TD
+>integer</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>This control
+turns the camera vertically to the specified position. Positive values
+move the camera up, negative values down. Drivers should interpret the
+values as arc seconds, with valid values between -180 * 3600 and +180
+* 3600 inclusive.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_FOCUS_ABSOLUTE</CODE
+>&nbsp;</TD
+><TD
+>integer</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>This control sets the
+focal point of the camera to the specified position. The unit is
+undefined. Positive values set the focus closer to the camera,
+negative values towards infinity.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_FOCUS_RELATIVE</CODE
+>&nbsp;</TD
+><TD
+>integer</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>This control moves the
+focal point of the camera by the specified amount. The unit is
+undefined. Positive values move the focus closer to the camera,
+negative values towards infinity.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+COLSPAN="2"
+><CODE
+CLASS="CONSTANT"
+>V4L2_CID_FOCUS_AUTO</CODE
+>&nbsp;</TD
+><TD
+>boolean</TD
+><TD
+>&nbsp;</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+COLSPAN="3"
+>Enables automatic focus
+adjustments. The effect of manual focus adjustments while this feature
+is enabled is undefined, drivers should ignore such requests.</TD
+></TR
+><TR
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+><TD
+>&nbsp;</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="x542.htm"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="book1.htm"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="x1859.htm"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>User Controls</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="c174.htm"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Data Formats</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
diff --git a/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_CROPCAP.c b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_CROPCAP.c
new file mode 100644
index 0000000..dbd9893
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_CROPCAP.c
@@ -0,0 +1,194 @@
+/*
+ * v4l-test: Test environment for Video For Linux Two API
+ *
+ * 21 Dec 2008  0.1  First release
+ *
+ * Written by Márton Németh <nm127@freemail.hu>
+ * Released under GPL
+ */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+#include <string.h>
+
+#include <linux/videodev2.h>
+#include <linux/errno.h>
+
+#include <CUnit/CUnit.h>
+
+#include "v4l2_test.h"
+#include "dev_video.h"
+#include "video_limits.h"
+
+#include "test_VIDIOC_CROPCAP.h"
+
+#ifndef V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY
+#define V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY 8
+#endif
+
+static void do_ioctl_VIDIOC_CROPCAP(enum v4l2_buf_type buf_type, int expected_ret) {
+	int ret;
+	struct v4l2_cropcap cropcap;
+	struct v4l2_cropcap cropcap2;
+
+	memset(&cropcap, 0xff, sizeof(cropcap));
+	cropcap.type = buf_type;
+	ret = ioctl(get_video_fd(), VIDIOC_CROPCAP, &cropcap);
+
+	if (expected_ret != 0) {
+		CU_ASSERT_EQUAL(ret, expected_ret);
+	}
+	if (ret == 0) {
+		CU_ASSERT_EQUAL(ret, 0);
+		CU_ASSERT_EQUAL(cropcap.type, buf_type);
+
+	/*     |   left                                   x   */
+	/* ----+----+-------------------------------------->  */
+	/*     |    :                                         */
+	/* top +    +-------- cropcap ------------+  ^        */
+	/*     |    |                             |  |        */
+	/*     |    | +------- defrect ---------+ |  |        */
+	/*     |    | |                         | |  |        */
+	/*     |    | |                         | |  |        */
+	/*     |    | |                         | |  | heigth */
+	/*     |    | +-------------------------+ |  |        */
+	/*     |    |                             |  |        */
+	/*     |    |                             |  |        */
+	/*     |    +-----------------------------+  v        */
+	/*     |    :                             :           */
+	/*     |    <---------- width ------------>           */
+	/*     |                                              */
+	/*     v y                                            */
+
+		/* top left corner */
+		CU_ASSERT(cropcap.bounds.left <= cropcap.defrect.left);
+		CU_ASSERT(cropcap.bounds.top <= cropcap.defrect.top);
+
+		/* size of default cropping rectangle should be smaller or */
+		/* equal to the cropping bounds */
+		CU_ASSERT(cropcap.defrect.width <= cropcap.bounds.width);
+		CU_ASSERT(cropcap.defrect.height <= cropcap.bounds.height);
+
+		/* the right bottom corner should not exceed bounds */
+		CU_ASSERT(cropcap.defrect.left + cropcap.defrect.width <=
+			  cropcap.bounds.left + cropcap.bounds.width);
+		CU_ASSERT(cropcap.defrect.top + cropcap.defrect.height <=
+			  cropcap.bounds.top + cropcap.bounds.height);
+
+		//CU_ASSERT_EQUAL(cropcap.pixelaspect.numerator, ?);
+		CU_ASSERT_NOT_EQUAL(cropcap.pixelaspect.numerator, 0);
+		//CU_ASSERT_EQUAL(cropcap.pixelaspect.denominator, ?);
+		CU_ASSERT_NOT_EQUAL(cropcap.pixelaspect.denominator, 0);
+
+		dprintf("\tcropcap = { .type = %i, "
+			".bounds = { .left = %i, .top = %i, .width = %i, .heigth = %i }, "
+			".defrect = { .left = %i, .top = %i, .width = %i, .heigth = %i }, "
+			".pixelaspect = { .numerator = %u, .denominator = %u } "
+			"}\n",
+			cropcap.type,
+
+			cropcap.bounds.left,
+			cropcap.bounds.top,
+			cropcap.bounds.width,
+			cropcap.bounds.height,
+
+			cropcap.defrect.left,
+			cropcap.defrect.top,
+			cropcap.defrect.width,
+			cropcap.defrect.height,
+
+			cropcap.pixelaspect.numerator,
+			cropcap.pixelaspect.denominator
+			);
+
+
+	} else {
+		CU_ASSERT_EQUAL(ret, -1);
+		CU_ASSERT_EQUAL(errno, EINVAL);
+
+		memset(&cropcap2, 0xff, sizeof(cropcap2));
+		cropcap2.type = buf_type;
+		CU_ASSERT_EQUAL(memcmp(&cropcap, &cropcap2, sizeof(cropcap)), 0);
+		dprintf("\ttype=%i, ret=%i, errno=%i, exoected_ret=%i\n", buf_type, ret, errno, expected_ret);
+
+	}
+
+}
+
+
+void test_VIDIOC_CROPCAP() {
+
+	do_ioctl_VIDIOC_CROPCAP(0, -1);
+	do_ioctl_VIDIOC_CROPCAP(V4L2_BUF_TYPE_VIDEO_CAPTURE, 0);
+	do_ioctl_VIDIOC_CROPCAP(V4L2_BUF_TYPE_VIDEO_OUTPUT, 0);
+	do_ioctl_VIDIOC_CROPCAP(V4L2_BUF_TYPE_VIDEO_OVERLAY, 0);
+	do_ioctl_VIDIOC_CROPCAP(V4L2_BUF_TYPE_VBI_CAPTURE, -1);
+	do_ioctl_VIDIOC_CROPCAP(V4L2_BUF_TYPE_VBI_OUTPUT, -1);
+	do_ioctl_VIDIOC_CROPCAP(V4L2_BUF_TYPE_SLICED_VBI_CAPTURE, -1);
+	do_ioctl_VIDIOC_CROPCAP(V4L2_BUF_TYPE_SLICED_VBI_OUTPUT, -1);
+	do_ioctl_VIDIOC_CROPCAP(V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY, -1);
+	do_ioctl_VIDIOC_CROPCAP(V4L2_BUF_TYPE_PRIVATE-1, -1);
+	do_ioctl_VIDIOC_CROPCAP(V4L2_BUF_TYPE_PRIVATE, 0);
+	do_ioctl_VIDIOC_CROPCAP(V4L2_BUF_TYPE_PRIVATE+1, 0);
+	do_ioctl_VIDIOC_CROPCAP(S32_MAX, 0);
+	do_ioctl_VIDIOC_CROPCAP(((__u32)S32_MAX)+1, -1);
+	do_ioctl_VIDIOC_CROPCAP(U32_MAX-1, -1);
+	do_ioctl_VIDIOC_CROPCAP(U32_MAX, -1);
+
+}
+
+void test_VIDIOC_CROPCAP_enum_INPUT() {
+	int ret;
+	int enum_ret;
+	__u32 input_index_orig;
+	struct v4l2_input input;
+	__u32 i;
+	int f;
+
+	f = get_video_fd();
+
+	memset(&input_index_orig, 0xff, sizeof(input_index_orig));
+	ret = ioctl(f, VIDIOC_G_INPUT, &input_index_orig);
+	CU_ASSERT_EQUAL(ret, 0);
+	if (ret == 0) {
+		i = 0;
+		do {
+			memset(&input, 0xff, sizeof(input));
+			input.index = i;
+			enum_ret = ioctl(f, VIDIOC_ENUMINPUT, &input);
+
+			dprintf("ENUMINPUT: i=%u, enum_ret=%i, errno=%i\n", i, enum_ret, errno);
+
+			if (enum_ret == 0) {
+				ret = ioctl(f, VIDIOC_S_INPUT, &input.index);
+				CU_ASSERT_EQUAL(ret, 0);
+				dprintf("input.index=0x%X, ret=%i, errno=%i\n", input.index, ret, errno);
+				if (ret == 0) {
+				    test_VIDIOC_CROPCAP();
+				}
+
+			}
+			i++;
+		} while (enum_ret == 0 && i != 0);
+
+		/* Setting the original input_id should not fail */
+		ret = ioctl(f, VIDIOC_S_INPUT, &input_index_orig);
+		CU_ASSERT_EQUAL(ret, 0);
+	}
+}
+
+void test_VIDIOC_CROPCAP_NULL() {
+	int ret;
+
+	ret = ioctl(get_video_fd(), VIDIOC_CROPCAP, NULL);
+
+	CU_ASSERT_EQUAL(ret, -1);
+	CU_ASSERT_EQUAL(errno, EFAULT);
+	dprintf("\tret=%i, errno=%i\n", ret, errno);
+
+}
diff --git a/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_CROPCAP.h b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_CROPCAP.h
new file mode 100644
index 0000000..52aaa8b
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_CROPCAP.h
@@ -0,0 +1,12 @@
+/*
+ * v4l-test: Test environment for Video For Linux Two API
+ *
+ * 21 Dec 2008  0.1  First release
+ *
+ * Written by Márton Németh <nm127@freemail.hu>
+ * Released under GPL
+ */
+
+void test_VIDIOC_CROPCAP(void);
+void test_VIDIOC_CROPCAP_enum_INPUT(void);
+void test_VIDIOC_CROPCAP_NULL(void);
diff --git a/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_ENUMAUDIO.c b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_ENUMAUDIO.c
new file mode 100644
index 0000000..14afb14
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_ENUMAUDIO.c
@@ -0,0 +1,93 @@
+/*
+ * v4l-test: Test environment for Video For Linux Two API
+ *
+ * 22 Dec 2008  0.2  Test case with NULL parameter added
+ * 18 Dec 2008  0.1  First release
+ *
+ * Written by Márton Németh <nm127@freemail.hu>
+ * Released under GPL
+ */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+#include <string.h>
+
+#include <linux/videodev2.h>
+#include <linux/errno.h>
+
+#include <CUnit/CUnit.h>
+#include <CUnit/Basic.h>
+
+#include "v4l2_test.h"
+#include "dev_video.h"
+#include "video_limits.h"
+
+#include "test_VIDIOC_ENUMAUDIO.h"
+
+void test_VIDIOC_ENUMAUDIO() {
+	int ret;
+	struct v4l2_audio audio;
+	struct v4l2_audio audio2;
+	__u32 i;
+
+	i = 0;
+	do {
+		memset(&audio, 0xff, sizeof(audio));
+		audio.index = i;
+		ret = ioctl(get_video_fd(), VIDIOC_ENUMAUDIO, &audio);
+
+		dprintf("VIDIOC_ENUMAUDIO, ret=%i\n", ret);
+
+		if (ret == 0) {
+			CU_ASSERT_EQUAL(ret, 0);
+			CU_ASSERT_EQUAL(audio.index, i);
+
+			//CU_ASSERT_EQUAL(audio.name, ?);
+			CU_ASSERT(0 < strlen( (char*)audio.name ));
+
+			//CU_ASSERT_EQUAL(audio.capability, ?);
+			//CU_ASSERT_EQUAL(audio.mode, ?);
+			CU_ASSERT_EQUAL(audio.reserved[0], 0);
+			CU_ASSERT_EQUAL(audio.reserved[1], 0);
+
+			dprintf("\taudio = {.index=%u, .name=\"%s\", "
+				".capability=0x%X, .mode=0x%X, "
+				".reserved[]={ 0x%X, 0x%X } }\n",
+				audio.index,
+				audio.name,
+				audio.capability,
+				audio.mode,
+				audio.reserved[0],
+				audio.reserved[1]
+				);
+
+		} else {
+			CU_ASSERT_EQUAL(ret, -1);
+			CU_ASSERT_EQUAL(errno, EINVAL);
+
+			memset(&audio2, 0xff, sizeof(audio2));
+			audio2.index = i;
+			CU_ASSERT_EQUAL(memcmp(&audio, &audio2, sizeof(audio)), 0);
+
+			dprintf("\terrno=%i\n", errno);
+
+		}
+		i++;
+	} while (ret == 0);
+
+}
+
+
+void test_VIDIOC_ENUMAUDIO_NULL() {
+	int ret;
+
+	ret = ioctl(get_video_fd(), VIDIOC_ENUMAUDIO, NULL);
+	CU_ASSERT_EQUAL(ret, -1);
+	CU_ASSERT_EQUAL(errno, EFAULT);
+
+}
diff --git a/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_ENUMAUDIO.h b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_ENUMAUDIO.h
new file mode 100644
index 0000000..d725cb1
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_ENUMAUDIO.h
@@ -0,0 +1,12 @@
+/*
+ * v4l-test: Test environment for Video For Linux Two API
+ *
+ * 22 Dec 2008  0.2  Test case with NULL parameter added
+ * 18 Dec 2008  0.1  First release
+ *
+ * Written by Márton Németh <nm127@freemail.hu>
+ * Released under GPL
+ */
+
+void test_VIDIOC_ENUMAUDIO(void);
+void test_VIDIOC_ENUMAUDIO_NULL(void);
diff --git a/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_ENUMINPUT.c b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_ENUMINPUT.c
new file mode 100644
index 0000000..e784e98
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_ENUMINPUT.c
@@ -0,0 +1,142 @@
+/*
+ * v4l-test: Test environment for Video For Linux Two API
+ *
+ * 22 Dec 2008  0.2  Test case with NULL parameter added
+ * 18 Dec 2008  0.1  First release
+ *
+ * Written by Márton Németh <nm127@freemail.hu>
+ * Released under GPL
+ */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+#include <string.h>
+
+#include <linux/videodev2.h>
+#include <linux/errno.h>
+
+#include <CUnit/CUnit.h>
+#include <CUnit/Basic.h>
+
+#include "v4l2_test.h"
+#include "dev_video.h"
+#include "video_limits.h"
+
+#include "test_VIDIOC_ENUMINPUT.h"
+
+/* VIDIOC_ENUMINPUT */
+
+#define MAX_EM28XX_INPUT	4
+
+void test_VIDIOC_ENUMINPUT_1() {
+	int ret;
+	struct v4l2_input input;
+	struct v4l2_input input2;
+	__u32 i;
+
+	i = 0;
+	do {
+		memset(&input, 0xff, sizeof(input));
+		input.index = i;
+		ret = ioctl(get_video_fd(), VIDIOC_ENUMINPUT, &input);
+
+		dprintf("VIDIOC_ENUMINPUT, ret=%i\n", ret);
+
+		if (ret == 0) {
+			CU_ASSERT_EQUAL(ret, 0);
+			CU_ASSERT_EQUAL(input.index, i);
+
+			//CU_ASSERT_EQUAL(input.name, ?);
+			CU_ASSERT(0 < strlen( (char*)input.name ));
+
+			//CU_ASSERT_EQUAL(input.type, ?);
+			//CU_ASSERT_EQUAL(input.audioset, ?);
+			//CU_ASSERT_EQUAL(input.tuner, ?);
+			//CU_ASSERT_EQUAL(input.std, ?);
+			//CU_ASSERT_EQUAL(input.status, ?);
+			CU_ASSERT_EQUAL(input.reserved[0], 0);
+			CU_ASSERT_EQUAL(input.reserved[1], 0);
+			CU_ASSERT_EQUAL(input.reserved[2], 0);
+			CU_ASSERT_EQUAL(input.reserved[3], 0);
+
+			dprintf("\tinput = {.index=%u, .name=\"%s\", "
+				".type=0x%X, .audioset=0x%X, .tuner=0x%X, "
+				".std=%llX, "
+				".status=0x%X, "
+				".reserved[]={ 0x%X, 0x%X, 0x%X, 0x%X } }\n",
+				input.index,
+				input.name,
+				input.type,
+				input.audioset,
+				input.tuner,
+				input.std,
+				input.status,
+				input.reserved[0],
+				input.reserved[1],
+				input.reserved[2],
+				input.reserved[3]
+				);
+
+		} else {
+			CU_ASSERT_EQUAL(ret, -1);
+			CU_ASSERT_EQUAL(errno, EINVAL);
+
+			memset(&input2, 0xff, sizeof(input2));
+			input2.index = i;
+			CU_ASSERT_EQUAL(memcmp(&input, &input2, sizeof(input)), 0);
+
+			dprintf("\terrno=%i\n", errno);
+
+		}
+		i++;
+	} while (ret == 0);
+
+}
+
+void test_VIDIOC_ENUMINPUT_2() {
+	int ret;
+	struct v4l2_input input;
+	struct v4l2_input input2;
+
+	memset(&input, 0xff, sizeof(input));
+	input.index = U32_MAX;
+	ret = ioctl(get_video_fd(), VIDIOC_ENUMINPUT, &input);
+
+	CU_ASSERT_EQUAL(ret, -1);
+	CU_ASSERT_EQUAL(errno, EINVAL);
+
+	memset(&input2, 0xff, sizeof(input2));
+	input2.index = U32_MAX;
+	CU_ASSERT_EQUAL(memcmp(&input, &input2, sizeof(input)), 0);
+}
+
+void test_VIDIOC_ENUMINPUT_3() {
+	int ret;
+	struct v4l2_input input;
+	struct v4l2_input input2;
+
+	memset(&input, 0xff, sizeof(input));
+	input.index = MAX_EM28XX_INPUT+1;
+	ret = ioctl(get_video_fd(), VIDIOC_ENUMINPUT, &input);
+
+	CU_ASSERT_EQUAL(ret, -1);
+	CU_ASSERT_EQUAL(errno, EINVAL);
+
+	memset(&input2, 0xff, sizeof(input2));
+	input2.index = MAX_EM28XX_INPUT+1;
+	CU_ASSERT_EQUAL(memcmp(&input, &input2, sizeof(input)), 0);
+}
+
+void test_VIDIOC_ENUMINPUT_NULL() {
+	int ret;
+
+	ret = ioctl(get_video_fd(), VIDIOC_ENUMINPUT, NULL);
+	CU_ASSERT_EQUAL(ret, -1);
+	CU_ASSERT_EQUAL(errno, EFAULT);
+
+}
diff --git a/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_ENUMINPUT.h b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_ENUMINPUT.h
new file mode 100644
index 0000000..75d02b1
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_ENUMINPUT.h
@@ -0,0 +1,14 @@
+/*
+ * v4l-test: Test environment for Video For Linux Two API
+ *
+ * 22 Dec 2008  0.2  Test case with NULL parameter added
+ * 18 Dec 2008  0.1  First release
+ *
+ * Written by Márton Németh <nm127@freemail.hu>
+ * Released under GPL
+ */
+
+void test_VIDIOC_ENUMINPUT_1(void);
+void test_VIDIOC_ENUMINPUT_2(void);
+void test_VIDIOC_ENUMINPUT_3(void);
+void test_VIDIOC_ENUMINPUT_NULL(void);
diff --git a/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_ENUMSTD.c b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_ENUMSTD.c
new file mode 100644
index 0000000..147fbfd
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_ENUMSTD.c
@@ -0,0 +1,137 @@
+/*
+ * v4l-test: Test environment for Video For Linux Two API
+ *
+ * 22 Dec 2008  0.2  Test case with NULL parameter added
+ * 18 Dec 2008  0.1  First release
+ *
+ * Written by Márton Németh <nm127@freemail.hu>
+ * Released under GPL
+ */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+#include <string.h>
+
+#include <linux/videodev2.h>
+#include <linux/errno.h>
+
+#include <CUnit/CUnit.h>
+#include <CUnit/Basic.h>
+
+#include "v4l2_test.h"
+#include "dev_video.h"
+#include "video_limits.h"
+
+#include "test_VIDIOC_ENUMSTD.h"
+
+#define MAX_EM28XX_TVNORMS	10
+
+void test_VIDIOC_ENUMSTD_1() {
+	int ret;
+	struct v4l2_standard std;
+	struct v4l2_standard std2;
+	__u32 i;
+
+	i = 0;
+	do {
+		memset(&std, 0xff, sizeof(std));
+		std.index = i;
+		ret = ioctl(get_video_fd(), VIDIOC_ENUMSTD, &std);
+
+		dprintf("VIDIOC_ENUMSTD, ret=%i\n", ret);
+
+		if (ret == 0) {
+			CU_ASSERT_EQUAL(ret, 0);
+			CU_ASSERT_EQUAL(std.index, i);
+			//CU_ASSERT_EQUAL(std.id, ?);
+
+			//CU_ASSERT_EQUAL(std.name, ?);
+			CU_ASSERT(0 < strlen( (char*)std.name ));
+
+			//CU_ASSERT_EQUAL(std.frameperiod.numerator, ?);
+			//CU_ASSERT_EQUAL(std.frameperiod.denominator, ?);
+			//CU_ASSERT_EQUAL(std.framelines, ?);
+			CU_ASSERT_EQUAL(std.reserved[0], 0);
+			CU_ASSERT_EQUAL(std.reserved[1], 0);
+			CU_ASSERT_EQUAL(std.reserved[2], 0);
+			CU_ASSERT_EQUAL(std.reserved[3], 0);
+
+			dprintf("\tstd = {.index=%u, .id=%llX, .name=\"%s\", "
+				".frameperiod={ .numerator=%u, .denominator=%u }, "
+				".framelines=%u, "
+				".reserved[]={ 0x%X, 0x%X, 0x%X, 0x%X } }\n",
+				std.index,
+				std.id,
+				std.name,
+				std.frameperiod.numerator,
+				std.frameperiod.denominator,
+				std.framelines,
+				std.reserved[0],
+				std.reserved[1],
+				std.reserved[2],
+				std.reserved[3]
+			);
+
+		} else {
+			CU_ASSERT_EQUAL(ret, -1);
+			CU_ASSERT_EQUAL(errno, EINVAL);
+
+			memset(&std2, 0xff, sizeof(std2));
+			std2.index = i;
+			CU_ASSERT_EQUAL(memcmp(&std, &std2, sizeof(std)), 0);
+
+			dprintf("\terrno=%i\n", errno);
+
+		}
+		i++;
+	} while (ret == 0);
+}
+
+void test_VIDIOC_ENUMSTD_2() {
+	int ret;
+	struct v4l2_standard std;
+	struct v4l2_standard std2;
+
+	memset(&std, 0xff, sizeof(std));
+	std.index = U32_MAX;
+	ret = ioctl(get_video_fd(), VIDIOC_ENUMSTD, &std);
+
+	CU_ASSERT_EQUAL(ret, -1);
+	CU_ASSERT_EQUAL(errno, EINVAL);
+
+	memset(&std2, 0xff, sizeof(std2));
+	std2.index = U32_MAX;
+	CU_ASSERT_EQUAL(memcmp(&std, &std2, sizeof(std)), 0);
+}
+
+
+void test_VIDIOC_ENUMSTD_3() {
+	int ret;
+	struct v4l2_standard std;
+	struct v4l2_standard std2;
+
+	memset(&std, 0xff, sizeof(std));
+	std.index = MAX_EM28XX_TVNORMS;
+	ret = ioctl(get_video_fd(), VIDIOC_ENUMSTD, &std);
+
+	CU_ASSERT_EQUAL(ret, -1);
+	CU_ASSERT_EQUAL(errno, EINVAL);
+
+	memset(&std2, 0xff, sizeof(std2));
+	std2.index = MAX_EM28XX_TVNORMS;
+	CU_ASSERT_EQUAL(memcmp(&std, &std2, sizeof(std)), 0);
+}
+
+void test_VIDIOC_ENUMSTD_NULL() {
+	int ret;
+
+	ret = ioctl(get_video_fd(), VIDIOC_ENUMSTD, NULL);
+	CU_ASSERT_EQUAL(ret, -1);
+	CU_ASSERT_EQUAL(errno, EFAULT);
+
+}
diff --git a/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_ENUMSTD.h b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_ENUMSTD.h
new file mode 100644
index 0000000..ae6a973
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_ENUMSTD.h
@@ -0,0 +1,14 @@
+/*
+ * v4l-test: Test environment for Video For Linux Two API
+ *
+ * 22 Dec 2008  0.2  Test case with NULL parameter added
+ * 18 Dec 2008  0.1  First release
+ *
+ * Written by Márton Németh <nm127@freemail.hu>
+ * Released under GPL
+ */
+
+void test_VIDIOC_ENUMSTD_1(void);
+void test_VIDIOC_ENUMSTD_2(void);
+void test_VIDIOC_ENUMSTD_3(void);
+void test_VIDIOC_ENUMSTD_NULL(void);
diff --git a/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_ENUM_FMT.c b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_ENUM_FMT.c
new file mode 100644
index 0000000..ddfe54b
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_ENUM_FMT.c
@@ -0,0 +1,206 @@
+/*
+ * v4l-test: Test environment for Video For Linux Two API
+ *
+ * 22 Dec 2008  0.2  Test case with NULL parameter added
+ * 18 Dec 2008  0.1  First release
+ *
+ * Written by Márton Németh <nm127@freemail.hu>
+ * Released under GPL
+ */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+#include <string.h>
+
+#include <linux/videodev2.h>
+#include <linux/errno.h>
+
+#include <CUnit/CUnit.h>
+#include <CUnit/Basic.h>
+
+#include "v4l2_test.h"
+#include "dev_video.h"
+#include "video_limits.h"
+
+#include "test_VIDIOC_ENUM_FMT.h"
+
+#ifndef V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY
+#define V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY 8
+#endif
+
+
+/* VIDIOC_ENUM_FMT */
+
+static void do_enumerate_formats(enum v4l2_buf_type type) {
+	int ret;
+	struct v4l2_fmtdesc format;
+	struct v4l2_fmtdesc format2;
+	__u32 i;
+
+	i = 0;
+	do {
+		memset(&format, 0xff, sizeof(format));
+		format.index = i;
+		format.type = type;
+
+		ret = ioctl(get_video_fd(), VIDIOC_ENUM_FMT, &format);
+		dprintf("VIDIOC_ENUM_FMT, ret=%i\n", ret);
+		if (ret == 0) {
+			CU_ASSERT_EQUAL(ret, 0);
+			CU_ASSERT_EQUAL(format.index, i);
+			//CU_ASSERT_EQUAL(format.type, ?);
+			//CU_ASSERT_EQUAL(format.flags, ?);
+
+			//CU_ASSERT_EQUAL(format.description, ?);
+			CU_ASSERT(0 < strlen( (char*)format.description ));
+
+			//CU_ASSERT_EQUAL(format.pixelformat, ?);
+			CU_ASSERT_EQUAL(format.reserved[0], 0);
+			CU_ASSERT_EQUAL(format.reserved[1], 0);
+			CU_ASSERT_EQUAL(format.reserved[2], 0);
+			CU_ASSERT_EQUAL(format.reserved[3], 0);
+
+			dprintf("\tformat = {.index=%u, .type=0x%X, .flags=0x%X, "
+				".description=\"%s\", .pixelformat=0x%X, "
+				".reserved[]={ 0x%X, 0x%X, 0x%X, 0x%X } }\n",
+				format.index,
+				format.type,
+				format.flags,
+				format.description,
+				format.pixelformat,
+				format.reserved[0],
+				format.reserved[1],
+				format.reserved[2],
+				format.reserved[3]
+			);
+
+		} else {
+			CU_ASSERT_EQUAL(ret, -1);
+			CU_ASSERT_EQUAL(errno, EINVAL);
+
+			memset(&format2, 0xff, sizeof(format2));
+			format2.index = i;
+			format2.type = type;
+			CU_ASSERT_EQUAL(memcmp(&format, &format2, sizeof(format)), 0);
+
+			dprintf("\terrno=%i\n", errno);
+
+		}
+		i++;
+	} while (ret == 0);
+
+}
+
+void test_VIDIOC_ENUM_FMT_1() {
+	do_enumerate_formats(V4L2_BUF_TYPE_VIDEO_CAPTURE);
+	do_enumerate_formats(V4L2_BUF_TYPE_VIDEO_CAPTURE);
+	do_enumerate_formats(V4L2_BUF_TYPE_VIDEO_OUTPUT);
+	do_enumerate_formats(V4L2_BUF_TYPE_VIDEO_OVERLAY);
+	do_enumerate_formats(V4L2_BUF_TYPE_VBI_CAPTURE);
+	do_enumerate_formats(V4L2_BUF_TYPE_VBI_OUTPUT);
+	do_enumerate_formats(V4L2_BUF_TYPE_SLICED_VBI_CAPTURE);
+	do_enumerate_formats(V4L2_BUF_TYPE_SLICED_VBI_OUTPUT);
+	do_enumerate_formats(V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY);
+	do_enumerate_formats(V4L2_BUF_TYPE_PRIVATE);
+}
+
+void test_VIDIOC_ENUM_FMT_2() {
+	int ret;
+	struct v4l2_fmtdesc format;
+	struct v4l2_fmtdesc format2;
+
+	/* test invalid index */
+	memset(&format, 0xff, sizeof(format));
+	format.index = U32_MAX;
+	format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+	ret = ioctl(get_video_fd(), VIDIOC_ENUM_FMT, &format);
+
+	CU_ASSERT_EQUAL(ret, -1);
+	CU_ASSERT_EQUAL(errno, EINVAL);
+
+	memset(&format2, 0xff, sizeof(format2));
+	format2.index = U32_MAX;
+	format2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+	CU_ASSERT_EQUAL(memcmp(&format, &format2, sizeof(format)), 0);
+}
+
+void test_VIDIOC_ENUM_FMT_3() {
+	int ret;
+	struct v4l2_fmtdesc format;
+	struct v4l2_fmtdesc format2;
+	int i;
+
+	/* test invalid .type=0 */
+	memset(&format, 0xff, sizeof(format));
+	format.index = 0;
+	format.type = 0;
+	ret = ioctl(get_video_fd(), VIDIOC_ENUM_FMT, &format);
+
+	CU_ASSERT_EQUAL(ret, -1);
+	CU_ASSERT_EQUAL(errno, EINVAL);
+
+	memset(&format2, 0xff, sizeof(format2));
+	format2.index = 0;
+	format2.type = 0;
+	CU_ASSERT_EQUAL(memcmp(&format, &format2, sizeof(format)), 0);
+
+	/* test invalid .type=0x8000 0000 */
+	memset(&format, 0xff, sizeof(format));
+	format.index = 0;
+	format.type = 0x80000000;
+	ret = ioctl(get_video_fd(), VIDIOC_ENUM_FMT, &format);
+
+	CU_ASSERT_EQUAL(ret, -1);
+	CU_ASSERT_EQUAL(errno, EINVAL);
+
+	memset(&format2, 0xff, sizeof(format2));
+	format2.index = 0;
+	format2.type = 0x80000000;
+	CU_ASSERT_EQUAL(memcmp(&format, &format2, sizeof(format)), 0);
+
+	/* test invalid .type=-1 */
+	memset(&format, 0xff, sizeof(format));
+	format.index = 0;
+	format.type = -1;
+	ret = ioctl(get_video_fd(), VIDIOC_ENUM_FMT, &format);
+
+	CU_ASSERT_EQUAL(ret, -1);
+	CU_ASSERT_EQUAL(errno, EINVAL);
+
+	memset(&format2, 0xff, sizeof(format2));
+	format2.index = 0;
+	format2.type = -1;
+	CU_ASSERT_EQUAL(memcmp(&format, &format2, sizeof(format)), 0);
+
+	/* test invalid .type= 8..0x7F */
+	for (i = V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY+1; i < V4L2_BUF_TYPE_PRIVATE; i++) {
+		memset(&format, 0xff, sizeof(format));
+		format.index = 0;
+		format.type = i;
+		ret = ioctl(get_video_fd(), VIDIOC_ENUM_FMT, &format);
+
+		CU_ASSERT_EQUAL(ret, -1);
+		CU_ASSERT_EQUAL(errno, EINVAL);
+
+		memset(&format2, 0xff, sizeof(format2));
+		format2.index = 0;
+		format2.type = i;
+		CU_ASSERT_EQUAL(memcmp(&format, &format2, sizeof(format)), 0);
+	}
+
+	/* .type = 0x80..0x7FFF FFFF is the private range */
+}
+
+void test_VIDIOC_ENUM_FMT_NULL() {
+	int ret;
+
+	ret = ioctl(get_video_fd(), VIDIOC_ENUM_FMT, NULL);
+	CU_ASSERT_EQUAL(ret, -1);
+	CU_ASSERT_EQUAL(errno, EFAULT);
+
+}
diff --git a/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_ENUM_FMT.h b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_ENUM_FMT.h
new file mode 100644
index 0000000..9323b10
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_ENUM_FMT.h
@@ -0,0 +1,14 @@
+/*
+ * v4l-test: Test environment for Video For Linux Two API
+ *
+ * 22 Dec 2008  0.2  Test case with NULL parameter added
+ * 18 Dec 2008  0.1  First release
+ *
+ * Written by Márton Németh <nm127@freemail.hu>
+ * Released under GPL
+ */
+
+void test_VIDIOC_ENUM_FMT_1(void);
+void test_VIDIOC_ENUM_FMT_2(void);
+void test_VIDIOC_ENUM_FMT_3(void);
+void test_VIDIOC_ENUM_FMT_NULL(void);
diff --git a/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_INPUT.c b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_INPUT.c
new file mode 100644
index 0000000..e0c340e
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_INPUT.c
@@ -0,0 +1,203 @@
+/*
+ * v4l-test: Test environment for Video For Linux Two API
+ *
+ * 22 Dec 2008  0.2  Test case with NULL parameter added
+ * 18 Dec 2008  0.1  First release
+ *
+ * Written by Márton Németh <nm127@freemail.hu>
+ * Released under GPL
+ */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+#include <string.h>
+
+#include <linux/videodev2.h>
+#include <linux/errno.h>
+
+#include <CUnit/CUnit.h>
+
+#include "v4l2_test.h"
+#include "dev_video.h"
+#include "video_limits.h"
+
+#include "test_VIDIOC_INPUT.h"
+
+int valid_input_index(int f, __u32 index) {
+	__u32 i;
+	struct v4l2_input input;
+	int ret;
+	int valid = 0;
+
+	/* Search for index with VIDIOC_ENUMINPUT. Do not just
+	 * check the given index with VIDIOC_ENUMINPUT because
+	 * we could miss the end of the enumeration. After the
+	 * end of enumeration no more indexes are allowed.
+	 */
+	i = 0;
+	do {
+		memset(&input, 0xff, sizeof(input));
+		input.index = i;
+		ret = ioctl(f, VIDIOC_ENUMINPUT, &input);
+		if (ret == 0 && index == i) {
+			valid = 1;
+			break;
+		}
+		i++;
+	} while (ret == 0 && i != 0);
+	return valid;
+}
+
+void test_VIDIOC_G_INPUT() {
+	int ret;
+	__u32 index;
+	int f;
+
+	f = get_video_fd();
+
+	memset(&index, 0xff, sizeof(index));
+	ret = ioctl(f, VIDIOC_G_INPUT, &index);
+
+	dprintf("VIDIOC_G_INPUT, ret=%i\n", ret);
+
+	CU_ASSERT_EQUAL(ret, 0);
+	if (ret == 0) {
+		CU_ASSERT(valid_input_index(f, index));
+
+		dprintf("index=0x%X\n", index);
+
+	}
+
+}
+
+void test_VIDIOC_S_INPUT_from_enum() {
+	int ret;
+	int enum_ret;
+	__u32 input_index_orig;
+	struct v4l2_input input;
+	__u32 i;
+	int f;
+
+	f = get_video_fd();
+
+	memset(&input_index_orig, 0xff, sizeof(input_index_orig));
+	ret = ioctl(f, VIDIOC_G_INPUT, &input_index_orig);
+	CU_ASSERT_EQUAL(ret, 0);
+	if (ret == 0) {
+		i = 0;
+		do {
+			memset(&input, 0xff, sizeof(input));
+			input.index = i;
+			enum_ret = ioctl(f, VIDIOC_ENUMINPUT, &input);
+
+			dprintf("ENUMINPUT: i=%u, enum_ret=%i, errno=%i\n", i, enum_ret, errno);
+
+			if (enum_ret == 0) {
+				ret = ioctl(f, VIDIOC_S_INPUT, &input.index);
+				CU_ASSERT_EQUAL(ret, 0);
+
+				dprintf("input.index=0x%X, ret=%i, errno=%i\n", input.index, ret, errno);
+
+			}
+			i++;
+		} while (enum_ret == 0 && i != 0);
+
+		/* Setting the original input_id should not fail */
+		ret = ioctl(f, VIDIOC_S_INPUT, &input_index_orig);
+		CU_ASSERT_EQUAL(ret, 0);
+	}
+}
+
+static void do_set_input(int f, __u32 first_wrong_input, __u32 index) {
+	struct v4l2_input input;
+	int ret;
+
+	if (first_wrong_input <= index) {
+
+		dprintf("do_set_input(f, 0x%X, 0x%X)\n", first_wrong_input, index);
+
+		memset(&input, 0xff, sizeof(input));
+		input.index = index;
+		ret = ioctl(f, VIDIOC_S_INPUT, &input.index);
+		CU_ASSERT_EQUAL(ret, -1);
+		CU_ASSERT_EQUAL(errno, EINVAL);
+
+		dprintf("input.index=0x%X, ret=%i, errno=%i\n", input.index, ret, errno);
+
+	}
+
+}
+
+void test_VIDIOC_S_INPUT_invalid_inputs() {
+	int ret;
+	int enum_ret;
+	__u32 input_index_orig;
+	struct v4l2_input input;
+	__u32 i, first_wrong_input;
+	int f;
+
+	f = get_video_fd();
+
+	memset(&input_index_orig, 0xff, sizeof(input_index_orig));
+	ret = ioctl(f, VIDIOC_G_INPUT, &input_index_orig);
+	CU_ASSERT_EQUAL(ret, 0);
+	if (ret == 0) {
+		i = 0;
+		do {
+			memset(&input, 0xff, sizeof(input));
+			input.index = i;
+			enum_ret = ioctl(f, VIDIOC_ENUMINPUT, &input);
+
+			dprintf("ENUMINPUT: i=%u, enum_ret=%i, errno=%i\n", i, enum_ret, errno);
+
+			i++;
+		} while (enum_ret == 0 && i != 0);
+
+		if (i != 0) {
+			first_wrong_input = i;
+
+			/* The input index range 0..(i-1) are valid inputs. */
+			/* Try index values from range i..U32_MAX */
+			do_set_input(f, first_wrong_input, i);
+			do_set_input(f, first_wrong_input, i+1);
+
+			/* Check for signed/unsigned mismatch near S32_MAX */
+			for (i = 0; i <= first_wrong_input+1; i++) {
+				do_set_input(f, first_wrong_input, ((__u32)S32_MAX) + i);
+			}
+
+			i = (U32_MAX-1)-first_wrong_input;
+			do {
+				do_set_input(f, first_wrong_input, i);
+				i++;
+			} while (i != 0);
+		}
+
+		/* Setting the original input_id should not fail */
+		ret = ioctl(f, VIDIOC_S_INPUT, &input_index_orig);
+		CU_ASSERT_EQUAL(ret, 0);
+	}
+}
+
+void test_VIDIOC_G_INPUT_NULL() {
+	int ret;
+
+	ret = ioctl(get_video_fd(), VIDIOC_G_INPUT, NULL);
+	CU_ASSERT_EQUAL(ret, -1);
+	CU_ASSERT_EQUAL(errno, EFAULT);
+
+}
+
+void test_VIDIOC_S_INPUT_NULL() {
+	int ret;
+
+	ret = ioctl(get_video_fd(), VIDIOC_S_INPUT, NULL);
+	CU_ASSERT_EQUAL(ret, -1);
+	CU_ASSERT_EQUAL(errno, EFAULT);
+
+}
diff --git a/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_INPUT.h b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_INPUT.h
new file mode 100644
index 0000000..4fb00de
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_INPUT.h
@@ -0,0 +1,16 @@
+/*
+ * v4l-test: Test environment for Video For Linux Two API
+ *
+ * 22 Dec 2008  0.2  Test case with NULL parameter added
+ * 18 Dec 2008  0.1  First release
+ *
+ * Written by Márton Németh <nm127@freemail.hu>
+ * Released under GPL
+ */
+
+void test_VIDIOC_G_INPUT(void);
+void test_VIDIOC_S_INPUT_from_enum(void);
+void test_VIDIOC_S_INPUT_invalid_inputs(void);
+
+void test_VIDIOC_G_INPUT_NULL(void);
+void test_VIDIOC_S_INPUT_NULL(void);
diff --git a/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_QUERYCAP.c b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_QUERYCAP.c
new file mode 100644
index 0000000..faf1ba9
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_QUERYCAP.c
@@ -0,0 +1,123 @@
+/*
+ * v4l-test: Test environment for Video For Linux Two API
+ *
+ * 22 Dec 2008  0.2  Test case with NULL parameter added
+ * 18 Dec 2008  0.1  First release
+ *
+ * Written by Márton Németh <nm127@freemail.hu>
+ * Released under GPL
+ */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+#include <string.h>
+
+#include <linux/videodev2.h>
+#include <linux/errno.h>
+
+#include <CUnit/CUnit.h>
+#include <CUnit/Basic.h>
+
+#include "v4l2_test.h"
+#include "dev_video.h"
+#include "video_limits.h"
+
+#include "test_VIDIOC_QUERYCAP.h"
+
+#ifndef V4L2_CAP_VIDEO_OUTPUT_OVERLAY
+#define V4L2_CAP_VIDEO_OUTPUT_OVERLAY  0x00000200
+#endif
+
+#ifndef V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY
+#define V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY 8
+#endif
+
+
+int valid_capabilities(__u32 capabilities) {
+	int valid = 1;
+
+	if ((capabilities & ~(V4L2_CAP_VIDEO_CAPTURE |
+			     V4L2_CAP_VIDEO_OUTPUT |
+			     V4L2_CAP_VIDEO_OVERLAY |
+			     V4L2_CAP_VBI_CAPTURE |
+			     V4L2_CAP_VBI_OUTPUT |
+			     V4L2_CAP_SLICED_VBI_CAPTURE |
+			     V4L2_CAP_SLICED_VBI_OUTPUT |
+			     V4L2_CAP_RDS_CAPTURE |
+			     V4L2_CAP_VIDEO_OUTPUT_OVERLAY |
+			     V4L2_CAP_TUNER |
+			     V4L2_CAP_AUDIO |
+			     V4L2_CAP_RADIO |
+			     V4L2_CAP_READWRITE |
+			     V4L2_CAP_ASYNCIO |
+			     V4L2_CAP_STREAMING)) != 0) {
+		valid = 0;
+	}
+
+	return valid;
+}
+
+
+void test_VIDIOC_QUERYCAP() {
+	int ret;
+	struct v4l2_capability cap;
+
+	memset(&cap, 0xff, sizeof(cap));
+
+	ret = ioctl(get_video_fd(), VIDIOC_QUERYCAP, &cap);
+
+	dprintf("VIDIOC_QUERYCAP, ret=%i\n", ret);
+	dprintf("\tcap = { .driver = \"%s\", .card = \"%s\", "
+		".bus_info = \"%s\", "
+		".version = %u.%u.%u, "
+		".capabilities = 0x%X, "
+		".reserved[]={ 0x%X, 0x%X, 0x%X, 0x%X } }\n",
+		cap.driver,
+		cap.card,
+		cap.bus_info,
+		(cap.version >> 16) & 0xFF,
+		(cap.version >> 8) & 0xFF,
+		cap.version & 0xFF,
+		cap.capabilities,
+		cap.reserved[0],
+		cap.reserved[1],
+		cap.reserved[2],
+		cap.reserved[3]
+	);
+
+	/* This ioctl must be implemented by ALL drivers */
+	CU_ASSERT_EQUAL(ret, 0);
+	if (ret == 0) {
+		//CU_ASSERT_EQUAL(cap.driver, ?);
+		CU_ASSERT(0 < strlen( (char*)cap.driver) );
+
+		//CU_ASSERT_EQUAL(cap.card, ?);
+		CU_ASSERT(0 < strlen( (char*)cap.card) );
+
+		//CU_ASSERT_EQUAL(cap.bus_info, ?);
+
+		//CU_ASSERT_EQUAL(cap.version, ?);
+		CU_ASSERT(valid_capabilities(cap.capabilities));
+
+		CU_ASSERT_EQUAL(cap.reserved[0], 0);
+		CU_ASSERT_EQUAL(cap.reserved[1], 0);
+		CU_ASSERT_EQUAL(cap.reserved[2], 0);
+		CU_ASSERT_EQUAL(cap.reserved[3], 0);
+
+	}
+
+}
+
+void test_VIDIOC_QUERYCAP_NULL() {
+	int ret;
+
+	ret = ioctl(get_video_fd(), VIDIOC_QUERYCAP, NULL);
+	CU_ASSERT_EQUAL(ret, -1);
+	CU_ASSERT_EQUAL(errno, EFAULT);
+
+}
diff --git a/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_QUERYCAP.h b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_QUERYCAP.h
new file mode 100644
index 0000000..314be04
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_QUERYCAP.h
@@ -0,0 +1,12 @@
+/*
+ * v4l-test: Test environment for Video For Linux Two API
+ *
+ * 22 Dec 2008  0.2  Test case with NULL parameter added
+ * 18 Dec 2008  0.1  First release
+ *
+ * Written by Márton Németh <nm127@freemail.hu>
+ * Released under GPL
+ */
+
+void test_VIDIOC_QUERYCAP(void);
+void test_VIDIOC_QUERYCAP_NULL(void);
diff --git a/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_STD.c b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_STD.c
new file mode 100644
index 0000000..7aabb85
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_STD.c
@@ -0,0 +1,250 @@
+/*
+ * v4l-test: Test environment for Video For Linux Two API
+ *
+ * 22 Dec 2008  0.2  Test case with NULL parameter added
+ * 18 Dec 2008  0.1  First release
+ *
+ * Written by Márton Németh <nm127@freemail.hu>
+ * Released under GPL
+ */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+#include <string.h>
+
+#include <linux/videodev2.h>
+#include <linux/errno.h>
+
+#include <CUnit/CUnit.h>
+
+#include "v4l2_test.h"
+#include "dev_video.h"
+#include "video_limits.h"
+
+#include "test_VIDIOC_STD.h"
+
+int valid_v4l2_std_id(v4l2_std_id std_id) {
+	int valid = 0;
+
+	if ( (std_id & ~(V4L2_STD_PAL_B |
+			 V4L2_STD_PAL_B1 |
+			 V4L2_STD_PAL_G |
+			 V4L2_STD_PAL_H |
+			 V4L2_STD_PAL_I |
+			 V4L2_STD_PAL_D |
+			 V4L2_STD_PAL_D1 |
+			 V4L2_STD_PAL_K |
+			 V4L2_STD_PAL_M |
+			 V4L2_STD_PAL_N |
+			 V4L2_STD_PAL_Nc |
+			 V4L2_STD_PAL_60 |
+			 V4L2_STD_NTSC_M |
+			 V4L2_STD_NTSC_M_JP |
+			 V4L2_STD_NTSC_443 |
+			 V4L2_STD_NTSC_M_KR |
+			 V4L2_STD_SECAM_B |
+			 V4L2_STD_SECAM_D |
+			 V4L2_STD_SECAM_G |
+			 V4L2_STD_SECAM_H |
+			 V4L2_STD_SECAM_K |
+			 V4L2_STD_SECAM_K1 |
+			 V4L2_STD_SECAM_L |
+			 V4L2_STD_SECAM_LC |
+			 V4L2_STD_ATSC_8_VSB |
+			 V4L2_STD_ATSC_16_VSB))
+		== 0) {
+		valid = 1;
+	} else {
+		valid = 0;
+	}
+	return valid;
+}
+
+void test_VIDIOC_G_STD() {
+	int ret;
+	v4l2_std_id std_id;
+
+	memset(&std_id, 0xff, sizeof(std_id));
+	ret = ioctl(get_video_fd(), VIDIOC_G_STD, &std_id);
+
+	dprintf("VIDIOC_G_STD, ret=%i\n", ret);
+
+	CU_ASSERT_EQUAL(ret, 0);
+	if (ret == 0) {
+		CU_ASSERT(valid_v4l2_std_id(std_id));
+
+		dprintf("std_id=0x%llX\n", std_id);
+
+	}
+
+}
+
+static int do_set_video_standard(int f, v4l2_std_id id) {
+	int ret;
+	int ret_set;
+	v4l2_std_id std_id;
+
+	std_id = id;
+	ret_set = ioctl(f, VIDIOC_S_STD, &std_id);
+	if (ret_set == 0) {
+		CU_ASSERT_EQUAL(ret_set, 0);
+		memset(&std_id, 0xff, sizeof(std_id));
+		ret = ioctl(f, VIDIOC_G_STD, &std_id);
+		CU_ASSERT_EQUAL(ret, 0);
+		if (ret == 0) {
+			CU_ASSERT( (id & std_id) == id);
+
+			if (std_id != id) {
+				dprintf("std_id=0x0x%llX, id=0x%llX\n", std_id, id);
+			}
+
+		}
+	} else {
+		CU_ASSERT_EQUAL(ret_set, -1);
+		CU_ASSERT_EQUAL(errno, EINVAL);
+
+		if (ret_set != -1) {
+			dprintf("ret_set=%i, errno=%i\n", ret_set, errno);
+		}
+	}
+
+	return ret_set;
+}
+
+void test_VIDIOC_S_STD() {
+	int ret;
+	v4l2_std_id std_id_orig;
+	int f;
+
+	f = get_video_fd();
+
+	memset(&std_id_orig, 0xff, sizeof(std_id_orig));
+	ret = ioctl(f, VIDIOC_G_STD, &std_id_orig);
+	CU_ASSERT_EQUAL(ret, 0);
+	if (ret == 0) {
+		ret = do_set_video_standard(f, V4L2_STD_PAL_B);
+		ret = do_set_video_standard(f, V4L2_STD_PAL_B1);
+		ret = do_set_video_standard(f, V4L2_STD_PAL_G);
+		ret = do_set_video_standard(f, V4L2_STD_PAL_H);
+		ret = do_set_video_standard(f, V4L2_STD_PAL_I);
+		ret = do_set_video_standard(f, V4L2_STD_PAL_D);
+		ret = do_set_video_standard(f, V4L2_STD_PAL_D1);
+		ret = do_set_video_standard(f, V4L2_STD_PAL_K);
+		ret = do_set_video_standard(f, V4L2_STD_PAL_M);
+		ret = do_set_video_standard(f, V4L2_STD_PAL_N);
+		ret = do_set_video_standard(f, V4L2_STD_PAL_Nc);
+		ret = do_set_video_standard(f, V4L2_STD_PAL_60);
+		ret = do_set_video_standard(f, V4L2_STD_NTSC_M);
+		ret = do_set_video_standard(f, V4L2_STD_NTSC_M_JP);
+		ret = do_set_video_standard(f, V4L2_STD_NTSC_443);
+		ret = do_set_video_standard(f, V4L2_STD_NTSC_M_KR);
+		ret = do_set_video_standard(f, V4L2_STD_SECAM_B);
+		ret = do_set_video_standard(f, V4L2_STD_SECAM_D);
+		ret = do_set_video_standard(f, V4L2_STD_SECAM_G);
+		ret = do_set_video_standard(f, V4L2_STD_SECAM_H);
+		ret = do_set_video_standard(f, V4L2_STD_SECAM_K);
+		ret = do_set_video_standard(f, V4L2_STD_SECAM_K1);
+		ret = do_set_video_standard(f, V4L2_STD_SECAM_L);
+		ret = do_set_video_standard(f, V4L2_STD_SECAM_LC);
+		ret = do_set_video_standard(f, V4L2_STD_ATSC_8_VSB);
+		ret = do_set_video_standard(f, V4L2_STD_ATSC_16_VSB);
+
+		/* Setting the original std_id should not fail */
+		ret = do_set_video_standard(f, std_id_orig);
+		CU_ASSERT_EQUAL(ret, 0);
+	}
+
+}
+
+void test_VIDIOC_S_STD_from_enum() {
+	int ret;
+	int enum_ret;
+	v4l2_std_id std_id_orig;
+	struct v4l2_standard std;
+	__u32 i;
+	int f;
+
+	f = get_video_fd();
+
+	memset(&std_id_orig, 0xff, sizeof(std_id_orig));
+	ret = ioctl(f, VIDIOC_G_STD, &std_id_orig);
+	CU_ASSERT_EQUAL(ret, 0);
+	if (ret == 0) {
+		i = 0;
+		do {
+			memset(&std, 0xff, sizeof(std));
+			std.index = i;
+			enum_ret = ioctl(f, VIDIOC_ENUMSTD, &std);
+
+			dprintf("ENUMSTD: i=%u, enum_ret=%i, errno=%i\n", i, enum_ret, errno);
+
+			if (enum_ret == 0) {
+				ret = do_set_video_standard(f, std.id);
+				CU_ASSERT_EQUAL(ret, 0);
+
+				dprintf("std.id=0x%llX, ret=%i\n", std.id, ret);
+			}
+			i++;
+		} while (enum_ret == 0 && i != 0);
+
+		/* Setting the original std_id should not fail */
+		ret = do_set_video_standard(f, std_id_orig);
+		CU_ASSERT_EQUAL(ret, 0);
+	}
+
+}
+
+
+void test_VIDIOC_S_STD_invalid_standard() {
+	int ret;
+	v4l2_std_id std_id_orig;
+	v4l2_std_id std_id;
+	int f;
+
+	f = get_video_fd();
+
+	memset(&std_id_orig, 0xff, sizeof(std_id_orig));
+	ret = ioctl(f, VIDIOC_G_STD, &std_id_orig);
+	CU_ASSERT_EQUAL(ret, 0);
+	if (ret == 0) {
+		std_id = 1;
+		while (std_id != 0) {
+			if (!valid_v4l2_std_id(std_id)) {
+				ret = do_set_video_standard(f, std_id);
+				CU_ASSERT_EQUAL(ret, -1);
+				CU_ASSERT_EQUAL(errno, EINVAL);
+			}
+			std_id = std_id<<1;
+		}
+
+		/* Setting the original std_id should not fail */
+		ret = do_set_video_standard(f, std_id_orig);
+		CU_ASSERT_EQUAL(ret, 0);
+	}
+}
+
+void test_VIDIOC_G_STD_NULL() {
+	int ret;
+
+	ret = ioctl(get_video_fd(), VIDIOC_G_STD, NULL);
+	CU_ASSERT_EQUAL(ret, -1);
+	CU_ASSERT_EQUAL(errno, EFAULT);
+
+}
+
+void test_VIDIOC_S_STD_NULL() {
+	int ret;
+
+	ret = ioctl(get_video_fd(), VIDIOC_S_STD, NULL);
+	CU_ASSERT_EQUAL(ret, -1);
+	CU_ASSERT_EQUAL(errno, EFAULT);
+
+}
+
+
+/* TODO: VIDIOC_S_STD while STREAM_ON */
diff --git a/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_STD.h b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_STD.h
new file mode 100644
index 0000000..000f603
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/test_VIDIOC_STD.h
@@ -0,0 +1,16 @@
+/*
+ * v4l-test: Test environment for Video For Linux Two API
+ *
+ * 22 Dec 2008  0.2  Test case with NULL parameter added
+ * 18 Dec 2008  0.1  First release
+ *
+ * Written by Márton Németh <nm127@freemail.hu>
+ * Released under GPL
+ */
+
+void test_VIDIOC_G_STD(void);
+void test_VIDIOC_S_STD(void);
+void test_VIDIOC_S_STD_from_enum(void);
+void test_VIDIOC_S_STD_invalid_standard(void);
+void test_VIDIOC_G_STD_NULL(void);
+void test_VIDIOC_S_STD_NULL(void);
diff --git a/testcases/kernel/device-drivers/v4l/user_space/test_invalid_ioctl.c b/testcases/kernel/device-drivers/v4l/user_space/test_invalid_ioctl.c
new file mode 100644
index 0000000..0f404af
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/test_invalid_ioctl.c
@@ -0,0 +1,56 @@
+/*
+ * v4l-test: Test environment for Video For Linux Two API
+ *
+ * 18 Dec 2008  0.1  First release
+ *
+ * Written by Márton Németh <nm127@freemail.hu>
+ * Released under GPL
+ */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+#include <string.h>
+
+#include <linux/videodev2.h>
+#include <linux/errno.h>
+
+#include <CUnit/CUnit.h>
+#include <CUnit/Basic.h>
+
+#include "v4l2_test.h"
+#include "dev_video.h"
+#include "video_limits.h"
+
+#include "test_invalid_ioctl.h"
+
+/* invalid ioctls */
+
+static void do_invalid_ioctl(int f, int request) {
+	int ret;
+
+	ret = ioctl(f, request, NULL);
+
+	CU_ASSERT_EQUAL(ret, -1);
+	CU_ASSERT_EQUAL(errno, EINVAL);
+}
+
+void test_invalid_ioctl_1() {
+	do_invalid_ioctl(get_video_fd(), _IO(0, 0));
+}
+
+void test_invalid_ioctl_2() {
+	do_invalid_ioctl(get_video_fd(), _IO(0xFF, 0xFF));
+}
+
+void test_invalid_ioctl_3() {
+	do_invalid_ioctl(get_video_fd(), _IO('v', 0xFF));
+}
+
+void test_invalid_ioctl_4() {
+	do_invalid_ioctl(get_video_fd(), _IO('V', 0xFF));
+}
diff --git a/testcases/kernel/device-drivers/v4l/user_space/test_invalid_ioctl.h b/testcases/kernel/device-drivers/v4l/user_space/test_invalid_ioctl.h
new file mode 100644
index 0000000..ce58951
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/test_invalid_ioctl.h
@@ -0,0 +1,14 @@
+/*
+ * v4l-test: Test environment for Video For Linux Two API
+ *
+ * 18 Dec 2008  0.1  First release
+ *
+ * Written by Márton Németh <nm127@freemail.hu>
+ * Released under GPL
+ */
+
+void test_invalid_ioctl_1(void);
+void test_invalid_ioctl_2(void);
+void test_invalid_ioctl_3(void);
+void test_invalid_ioctl_4(void);
+
diff --git a/testcases/kernel/device-drivers/v4l/user_space/v4l2_test.c b/testcases/kernel/device-drivers/v4l/user_space/v4l2_test.c
new file mode 100644
index 0000000..be13cc1
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/v4l2_test.c
@@ -0,0 +1,136 @@
+
+/* v4l-test: Test environment for Video For Linux Two API
+ *
+ * 22 Dec 2008  0.2  Test cases with NULL parameter added;
+ *                   Test cases for VIDIOC_CROPCAP added
+ * 18 Dec 2008  0.1  First release
+ *
+ * Written by Márton Németh <nm127@freemail.hu>
+ * Released under GPL
+ */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+#include <string.h>
+
+#include <linux/videodev2.h>
+#include <linux/errno.h>
+
+#include <CUnit/CUnit.h>
+#include <CUnit/Basic.h>
+
+#include "v4l2_test.h"
+#include "dev_video.h"
+#include "video_limits.h"
+
+#include "test_VIDIOC_QUERYCAP.h"
+#include "test_VIDIOC_CROPCAP.h"
+#include "test_VIDIOC_ENUMSTD.h"
+#include "test_VIDIOC_ENUM_FMT.h"
+#include "test_VIDIOC_ENUMINPUT.h"
+#include "test_VIDIOC_ENUMAUDIO.h"
+#include "test_VIDIOC_STD.h"
+#include "test_VIDIOC_INPUT.h"
+#include "test_invalid_ioctl.h"
+
+
+static CU_TestInfo suite_querycap[] = {
+  { "VIDIOC_QUERYCAP", test_VIDIOC_QUERYCAP },
+
+  { "VIDIOC_CROPCAP", test_VIDIOC_CROPCAP },
+  { "VIDIOC_CROPCAP with different inputs", test_VIDIOC_CROPCAP_enum_INPUT },
+  { "VIDIOC_CROPCAP with NULL parameter", test_VIDIOC_CROPCAP_NULL },
+
+  CU_TEST_INFO_NULL,
+};
+
+static CU_TestInfo suite_enums[] = {
+  { "VIDIOC_ENUMSTD", test_VIDIOC_ENUMSTD_1 },
+  { "VIDIOC_ENUMSTD, index=U32_MAX", test_VIDIOC_ENUMSTD_2 },
+  { "VIDIOC_ENUMSTD, index=MAX_EM28XX_TVNORMS", test_VIDIOC_ENUMSTD_3 },
+  { "VIDIOC_ENUMSTD with NULL parameter", test_VIDIOC_ENUMSTD_NULL },
+
+  { "VIDIOC_ENUMINPUT", test_VIDIOC_ENUMINPUT_1 },
+  { "VIDIOC_ENUMINPUT, index=U32_MAX", test_VIDIOC_ENUMINPUT_2 },
+  { "VIDIOC_ENUMINPUT, index=MAX_EM28XX_INPUT", test_VIDIOC_ENUMINPUT_3 },
+  { "VIDIOC_ENUMINPUT with NULL parameter", test_VIDIOC_ENUMINPUT_NULL },
+
+  { "VIDIOC_ENUM_FMT", test_VIDIOC_ENUM_FMT_1 },
+  { "VIDIOC_ENUM_FMT, index=U32_MAX", test_VIDIOC_ENUM_FMT_2 },
+  { "VIDIOC_ENUM_FMT, invalid type", test_VIDIOC_ENUM_FMT_3 },
+  { "VIDIOC_ENUM_FMT with NULL parameter", test_VIDIOC_ENUM_FMT_NULL },
+
+  { "VIDIOC_ENUMAUDIO", test_VIDIOC_ENUMAUDIO },
+  { "VIDIOC_ENUMAUDIO with NULL parameter", test_VIDIOC_ENUMAUDIO_NULL },
+
+  CU_TEST_INFO_NULL,
+};
+
+static CU_TestInfo suite_get_set_try[] = {
+  { "VIDIOC_G_STD", test_VIDIOC_G_STD },
+  { "VIDIOC_S_STD with the enumerated values", test_VIDIOC_S_STD_from_enum },
+  { "VIDIOC_S_STD", test_VIDIOC_S_STD },
+  { "VIDIOC_S_STD with invalid standard", test_VIDIOC_S_STD_invalid_standard },
+  { "VIDIOC_G_STD with NULL parameter", test_VIDIOC_G_STD_NULL },
+  { "VIDIOC_S_STD with NULL parameter", test_VIDIOC_S_STD_NULL },
+
+  { "VIDIOC_G_INPUT", test_VIDIOC_G_INPUT },
+  { "VIDIOC_S_INPUT from enum", test_VIDIOC_S_INPUT_from_enum },
+  { "VIDIOC_S_INPUT with invalid inputs", test_VIDIOC_S_INPUT_invalid_inputs },
+  { "VIDIOC_G_INPUT with NULL parameter", test_VIDIOC_G_INPUT_NULL },
+  { "VIDIOC_S_INPUT with NULL parameter", test_VIDIOC_S_INPUT_NULL },
+
+  CU_TEST_INFO_NULL,
+};
+
+static CU_TestInfo suite_invalid_ioctl[] = {
+  { "invalid ioctl _IO(0, 0)", test_invalid_ioctl_1 },
+  { "invalid ioctl _IO(0xFF, 0xFF)", test_invalid_ioctl_2 },
+  { "invalid v4l1 ioctl _IO('v', 0xFF)", test_invalid_ioctl_3 },
+  { "invalid v4l2 ioctl _IO('V', 0xFF)", test_invalid_ioctl_4 },
+
+  CU_TEST_INFO_NULL,
+};
+
+
+static CU_SuiteInfo suites[] = {
+  { "VIDIOC_QUERYCAP", open_video, close_video, suite_querycap },
+  { "VIDIOC_ENUM* ioctl calls", open_video, close_video, suite_enums },
+  { "VIDIOC_G_*, VIDIOC_S_* and VIDIOC_TRY_* ioctl calls", open_video, close_video, suite_get_set_try },
+  { "invalid ioctl calls", open_video, close_video, suite_invalid_ioctl },
+  CU_SUITE_INFO_NULL,
+};
+
+int main() {
+	CU_ErrorCode err;
+
+	err = CU_initialize_registry();
+	if (err != CUE_SUCCESS) {
+		printf("ERROR: cannot initialize CUNIT registry, giving up.\n");
+		return 1;
+	}
+
+	err = CU_register_suites(suites);
+	if (err == CUE_SUCCESS) {
+
+		//CU_basic_set_mode(CU_BRM_NORMAL);
+		//CU_basic_set_mode(CU_BRM_SILENT);
+		CU_basic_set_mode(CU_BRM_VERBOSE);
+		err = CU_basic_run_tests();
+		if (err != CUE_SUCCESS) {
+			printf("CU_basic_run_tests returned %i\n", err);
+		}
+
+	} else {
+		printf("ERROR: cannot add test suites\n");
+	}
+
+	CU_cleanup_registry();
+
+	return 0;
+}
diff --git a/testcases/kernel/device-drivers/v4l/user_space/v4l2_test.h b/testcases/kernel/device-drivers/v4l/user_space/v4l2_test.h
new file mode 100644
index 0000000..42725bd
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/v4l2_test.h
@@ -0,0 +1,17 @@
+/*
+ * v4l-test: Test environment for Video For Linux Two API
+ *
+ * 18 Dec 2008  0.1  First release
+ *
+ * Written by Márton Németh <nm127@freemail.hu>
+ * Released under GPL
+ */
+
+//#define DEBUG 1
+
+#ifdef DEBUG
+#define dprintf(fmt, ...)	printf(fmt, __VA_ARGS__)
+#else
+#define dprintf(fmt, ...)
+#endif
+
diff --git a/testcases/kernel/device-drivers/v4l/user_space/video_limits.h b/testcases/kernel/device-drivers/v4l/user_space/video_limits.h
new file mode 100644
index 0000000..0f9275c
--- /dev/null
+++ b/testcases/kernel/device-drivers/v4l/user_space/video_limits.h
@@ -0,0 +1,11 @@
+/*
+ * v4l-test: Test environment for Video For Linux Two API
+ *
+ * 18 Dec 2008  0.1  First release
+ *
+ * Written by Márton Németh <nm127@freemail.hu>
+ * Released under GPL
+ */
+
+#define S32_MAX		0x7FFFFFFF
+#define U32_MAX		0xFFFFFFFFU