aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/DocBook
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/DocBook')
-rw-r--r--Documentation/DocBook/80211.tmpl2
-rw-r--r--Documentation/DocBook/Makefile27
-rw-r--r--Documentation/DocBook/kernel-hacking.tmpl12
-rw-r--r--Documentation/DocBook/media/dvb/demux.xml23
-rw-r--r--Documentation/DocBook/media/dvb/dvbapi.xml4
-rw-r--r--Documentation/DocBook/media/dvb/dvbproperty.xml2
-rw-r--r--Documentation/DocBook/media/dvb/frontend.xml8
-rw-r--r--Documentation/DocBook/media/v4l/common.xml412
-rw-r--r--Documentation/DocBook/media/v4l/compat.xml15
-rw-r--r--Documentation/DocBook/media/v4l/controls.xml176
-rw-r--r--Documentation/DocBook/media/v4l/dev-osd.xml22
-rw-r--r--Documentation/DocBook/media/v4l/dev-sdr.xml110
-rw-r--r--Documentation/DocBook/media/v4l/io.xml189
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-nv16m.xml9
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml513
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-sdr-cu08.xml44
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt-sdr-cu16le.xml46
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt.xml34
-rw-r--r--Documentation/DocBook/media/v4l/remote_controllers.xml143
-rw-r--r--Documentation/DocBook/media/v4l/v4l2.xml26
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-enum-freq-bands.xml8
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-edid.xml (renamed from Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml)36
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml7
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-fmt.xml7
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-frequency.xml5
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-modulator.xml6
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-tuner.xml15
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-querycap.xml6
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml8
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-streamon.xml28
-rw-r--r--Documentation/DocBook/media_api.tmpl90
-rw-r--r--Documentation/DocBook/w1.tmpl101
-rw-r--r--Documentation/DocBook/writing-an-alsa-driver.tmpl72
33 files changed, 1197 insertions, 1009 deletions
diff --git a/Documentation/DocBook/80211.tmpl b/Documentation/DocBook/80211.tmpl
index 46ad6faee9ab..044b76436e83 100644
--- a/Documentation/DocBook/80211.tmpl
+++ b/Documentation/DocBook/80211.tmpl
@@ -98,6 +98,8 @@
98!Finclude/net/cfg80211.h priv_to_wiphy 98!Finclude/net/cfg80211.h priv_to_wiphy
99!Finclude/net/cfg80211.h set_wiphy_dev 99!Finclude/net/cfg80211.h set_wiphy_dev
100!Finclude/net/cfg80211.h wdev_priv 100!Finclude/net/cfg80211.h wdev_priv
101!Finclude/net/cfg80211.h ieee80211_iface_limit
102!Finclude/net/cfg80211.h ieee80211_iface_combination
101 </chapter> 103 </chapter>
102 <chapter> 104 <chapter>
103 <title>Actions and configuration</title> 105 <title>Actions and configuration</title>
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
index 0f9c6ff41aac..b444f2e8fe32 100644
--- a/Documentation/DocBook/Makefile
+++ b/Documentation/DocBook/Makefile
@@ -14,9 +14,9 @@ DOCBOOKS := z8530book.xml device-drivers.xml \
14 genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \ 14 genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \
15 80211.xml debugobjects.xml sh.xml regulator.xml \ 15 80211.xml debugobjects.xml sh.xml regulator.xml \
16 alsa-driver-api.xml writing-an-alsa-driver.xml \ 16 alsa-driver-api.xml writing-an-alsa-driver.xml \
17 tracepoint.xml drm.xml media_api.xml 17 tracepoint.xml drm.xml media_api.xml w1.xml
18 18
19include $(srctree)/Documentation/DocBook/media/Makefile 19include Documentation/DocBook/media/Makefile
20 20
21### 21###
22# The build process is as follows (targets): 22# The build process is as follows (targets):
@@ -36,6 +36,7 @@ PS_METHOD = $(prefer-db2x)
36# The targets that may be used. 36# The targets that may be used.
37PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs cleandocs 37PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs cleandocs
38 38
39targets += $(DOCBOOKS)
39BOOKS := $(addprefix $(obj)/,$(DOCBOOKS)) 40BOOKS := $(addprefix $(obj)/,$(DOCBOOKS))
40xmldocs: $(BOOKS) 41xmldocs: $(BOOKS)
41sgmldocs: xmldocs 42sgmldocs: xmldocs
@@ -58,14 +59,14 @@ mandocs: $(MAN)
58 59
59installmandocs: mandocs 60installmandocs: mandocs
60 mkdir -p /usr/local/man/man9/ 61 mkdir -p /usr/local/man/man9/
61 install Documentation/DocBook/man/*.9.gz /usr/local/man/man9/ 62 install $(obj)/man/*.9.gz /usr/local/man/man9/
62 63
63### 64###
64#External programs used 65#External programs used
65KERNELDOC = $(srctree)/scripts/kernel-doc 66KERNELDOC = $(srctree)/scripts/kernel-doc
66DOCPROC = $(objtree)/scripts/docproc 67DOCPROC = $(objtree)/scripts/docproc
67 68
68XMLTOFLAGS = -m $(srctree)/Documentation/DocBook/stylesheet.xsl 69XMLTOFLAGS = -m $(srctree)/$(src)/stylesheet.xsl
69XMLTOFLAGS += --skip-validation 70XMLTOFLAGS += --skip-validation
70 71
71### 72###
@@ -87,21 +88,9 @@ define rule_docproc
87 ) > $(dir $@).$(notdir $@).cmd 88 ) > $(dir $@).$(notdir $@).cmd
88endef 89endef
89 90
90%.xml: %.tmpl FORCE 91%.xml: %.tmpl $(KERNELDOC) $(DOCPROC) FORCE
91 $(call if_changed_rule,docproc) 92 $(call if_changed_rule,docproc)
92 93
93###
94#Read in all saved dependency files
95cmd_files := $(wildcard $(foreach f,$(BOOKS),$(dir $(f)).$(notdir $(f)).cmd))
96
97ifneq ($(cmd_files),)
98 include $(cmd_files)
99endif
100
101###
102# Changes in kernel-doc force a rebuild of all documentation
103$(BOOKS): $(KERNELDOC)
104
105# Tell kbuild to always build the programs 94# Tell kbuild to always build the programs
106always := $(hostprogs-y) 95always := $(hostprogs-y)
107 96
@@ -139,7 +128,7 @@ quiet_cmd_db2pdf = PDF $@
139 128
140 129
141index = index.html 130index = index.html
142main_idx = Documentation/DocBook/$(index) 131main_idx = $(obj)/$(index)
143build_main_index = rm -rf $(main_idx); \ 132build_main_index = rm -rf $(main_idx); \
144 echo '<h1>Linux Kernel HTML Documentation</h1>' >> $(main_idx) && \ 133 echo '<h1>Linux Kernel HTML Documentation</h1>' >> $(main_idx) && \
145 echo '<h2>Kernel Version: $(KERNELVERSION)</h2>' >> $(main_idx) && \ 134 echo '<h2>Kernel Version: $(KERNELVERSION)</h2>' >> $(main_idx) && \
@@ -148,7 +137,7 @@ build_main_index = rm -rf $(main_idx); \
148quiet_cmd_db2html = HTML $@ 137quiet_cmd_db2html = HTML $@
149 cmd_db2html = xmlto html $(XMLTOFLAGS) -o $(patsubst %.html,%,$@) $< && \ 138 cmd_db2html = xmlto html $(XMLTOFLAGS) -o $(patsubst %.html,%,$@) $< && \
150 echo '<a HREF="$(patsubst %.html,%,$(notdir $@))/index.html"> \ 139 echo '<a HREF="$(patsubst %.html,%,$(notdir $@))/index.html"> \
151 $(patsubst %.html,%,$(notdir $@))</a><p>' > $@ 140 $(patsubst %.html,%,$(notdir $@))</a><p>' > $@
152 141
153%.html: %.xml 142%.html: %.xml
154 @(which xmlto > /dev/null 2>&1) || \ 143 @(which xmlto > /dev/null 2>&1) || \
diff --git a/Documentation/DocBook/kernel-hacking.tmpl b/Documentation/DocBook/kernel-hacking.tmpl
index d0758b241b23..e84f09467cd7 100644
--- a/Documentation/DocBook/kernel-hacking.tmpl
+++ b/Documentation/DocBook/kernel-hacking.tmpl
@@ -671,7 +671,7 @@ printk(KERN_INFO "my ip: %pI4\n", &amp;ipaddress);
671 671
672 <sect1 id="routines-local-irqs"> 672 <sect1 id="routines-local-irqs">
673 <title><function>local_irq_save()</function>/<function>local_irq_restore()</function> 673 <title><function>local_irq_save()</function>/<function>local_irq_restore()</function>
674 <filename class="headerfile">include/asm/system.h</filename> 674 <filename class="headerfile">include/linux/irqflags.h</filename>
675 </title> 675 </title>
676 676
677 <para> 677 <para>
@@ -850,16 +850,6 @@ printk(KERN_INFO "my ip: %pI4\n", &amp;ipaddress);
850 <returnvalue>-ERESTARTSYS</returnvalue> if a signal is received. 850 <returnvalue>-ERESTARTSYS</returnvalue> if a signal is received.
851 The <function>wait_event()</function> version ignores signals. 851 The <function>wait_event()</function> version ignores signals.
852 </para> 852 </para>
853 <para>
854 Do not use the <function>sleep_on()</function> function family -
855 it is very easy to accidentally introduce races; almost certainly
856 one of the <function>wait_event()</function> family will do, or a
857 loop around <function>schedule_timeout()</function>. If you choose
858 to loop around <function>schedule_timeout()</function> remember
859 you must set the task state (with
860 <function>set_current_state()</function>) on each iteration to avoid
861 busy-looping.
862 </para>
863 853
864 </sect1> 854 </sect1>
865 855
diff --git a/Documentation/DocBook/media/dvb/demux.xml b/Documentation/DocBook/media/dvb/demux.xml
index 86de89cfbd67..c8683d66f059 100644
--- a/Documentation/DocBook/media/dvb/demux.xml
+++ b/Documentation/DocBook/media/dvb/demux.xml
@@ -1042,7 +1042,14 @@ role="subsection"><title>DMX_ADD_PID</title>
1042</para> 1042</para>
1043<informaltable><tgroup cols="1"><tbody><row><entry 1043<informaltable><tgroup cols="1"><tbody><row><entry
1044 align="char"> 1044 align="char">
1045<para>This ioctl is undocumented. Documentation is welcome.</para> 1045<para>This ioctl call allows to add multiple PIDs to a transport stream filter
1046previously set up with DMX_SET_PES_FILTER and output equal to DMX_OUT_TSDEMUX_TAP.
1047</para></entry></row><row><entry align="char"><para>
1048It is used by readers of /dev/dvb/adapterX/demuxY.
1049</para></entry></row><row><entry align="char"><para>
1050It may be called at any time, i.e. before or after the first filter on the
1051shared file descriptor was started. It makes it possible to record multiple
1052services without the need to de-multiplex or re-multiplex TS packets.</para>
1046</entry> 1053</entry>
1047 </row></tbody></tgroup></informaltable> 1054 </row></tbody></tgroup></informaltable>
1048<para>SYNOPSIS 1055<para>SYNOPSIS
@@ -1075,7 +1082,7 @@ role="subsection"><title>DMX_ADD_PID</title>
1075</para> 1082</para>
1076</entry><entry 1083</entry><entry
1077 align="char"> 1084 align="char">
1078<para>Undocumented.</para> 1085<para>PID number to be filtered.</para>
1079</entry> 1086</entry>
1080 </row></tbody></tgroup></informaltable> 1087 </row></tbody></tgroup></informaltable>
1081&return-value-dvb; 1088&return-value-dvb;
@@ -1087,7 +1094,15 @@ role="subsection"><title>DMX_REMOVE_PID</title>
1087</para> 1094</para>
1088<informaltable><tgroup cols="1"><tbody><row><entry 1095<informaltable><tgroup cols="1"><tbody><row><entry
1089 align="char"> 1096 align="char">
1090<para>This ioctl is undocumented. Documentation is welcome.</para> 1097<para>This ioctl call allows to remove a PID when multiple PIDs are set on a
1098transport stream filter, e. g. a filter previously set up with output equal to
1099DMX_OUT_TSDEMUX_TAP, created via either DMX_SET_PES_FILTER or DMX_ADD_PID.
1100</para></entry></row><row><entry align="char"><para>
1101It is used by readers of /dev/dvb/adapterX/demuxY.
1102</para></entry></row><row><entry align="char"><para>
1103It may be called at any time, i.e. before or after the first filter on the
1104shared file descriptor was started. It makes it possible to record multiple
1105services without the need to de-multiplex or re-multiplex TS packets.</para>
1091</entry> 1106</entry>
1092 </row></tbody></tgroup></informaltable> 1107 </row></tbody></tgroup></informaltable>
1093<para>SYNOPSIS 1108<para>SYNOPSIS
@@ -1120,7 +1135,7 @@ role="subsection"><title>DMX_REMOVE_PID</title>
1120</para> 1135</para>
1121</entry><entry 1136</entry><entry
1122 align="char"> 1137 align="char">
1123<para>Undocumented.</para> 1138<para>PID of the PES filter to be removed.</para>
1124</entry> 1139</entry>
1125 </row></tbody></tgroup></informaltable> 1140 </row></tbody></tgroup></informaltable>
1126&return-value-dvb; 1141&return-value-dvb;
diff --git a/Documentation/DocBook/media/dvb/dvbapi.xml b/Documentation/DocBook/media/dvb/dvbapi.xml
index 0197bcc7842d..4c15396c67e5 100644
--- a/Documentation/DocBook/media/dvb/dvbapi.xml
+++ b/Documentation/DocBook/media/dvb/dvbapi.xml
@@ -18,7 +18,7 @@
18<firstname>Mauro</firstname> 18<firstname>Mauro</firstname>
19<othername role="mi">Carvalho</othername> 19<othername role="mi">Carvalho</othername>
20<surname>Chehab</surname> 20<surname>Chehab</surname>
21<affiliation><address><email>mchehab@redhat.com</email></address></affiliation> 21<affiliation><address><email>m.chehab@samsung.com</email></address></affiliation>
22<contrib>Ported document to Docbook XML.</contrib> 22<contrib>Ported document to Docbook XML.</contrib>
23</author> 23</author>
24</authorgroup> 24</authorgroup>
@@ -28,7 +28,7 @@
28 <holder>Convergence GmbH</holder> 28 <holder>Convergence GmbH</holder>
29</copyright> 29</copyright>
30<copyright> 30<copyright>
31 <year>2009-2012</year> 31 <year>2009-2014</year>
32 <holder>Mauro Carvalho Chehab</holder> 32 <holder>Mauro Carvalho Chehab</holder>
33</copyright> 33</copyright>
34 34
diff --git a/Documentation/DocBook/media/dvb/dvbproperty.xml b/Documentation/DocBook/media/dvb/dvbproperty.xml
index a9b15e34c5b2..24c22cabc668 100644
--- a/Documentation/DocBook/media/dvb/dvbproperty.xml
+++ b/Documentation/DocBook/media/dvb/dvbproperty.xml
@@ -196,7 +196,7 @@ get/set up to 64 properties. The actual meaning of each property is described on
196 <para>1)For satellital delivery systems, it is measured in kHz. 196 <para>1)For satellital delivery systems, it is measured in kHz.
197 For the other ones, it is measured in Hz.</para> 197 For the other ones, it is measured in Hz.</para>
198 <para>2)For ISDB-T, the channels are usually transmitted with an offset of 143kHz. 198 <para>2)For ISDB-T, the channels are usually transmitted with an offset of 143kHz.
199 E.g. a valid frequncy could be 474143 kHz. The stepping is bound to the bandwidth of 199 E.g. a valid frequency could be 474143 kHz. The stepping is bound to the bandwidth of
200 the channel which is 6MHz.</para> 200 the channel which is 6MHz.</para>
201 201
202 <para>3)As in ISDB-Tsb the channel consists of only one or three segments the 202 <para>3)As in ISDB-Tsb the channel consists of only one or three segments the
diff --git a/Documentation/DocBook/media/dvb/frontend.xml b/Documentation/DocBook/media/dvb/frontend.xml
index 0d6e81bd9ed2..8a6a6ff27af5 100644
--- a/Documentation/DocBook/media/dvb/frontend.xml
+++ b/Documentation/DocBook/media/dvb/frontend.xml
@@ -744,7 +744,7 @@ typedef enum fe_hierarchy {
744</para> 744</para>
745<informaltable><tgroup cols="1"><tbody><row><entry 745<informaltable><tgroup cols="1"><tbody><row><entry
746 align="char"> 746 align="char">
747<para>int ioctl(int fd, int request = <link linkend="FE_READ_SNR">FE_READ_SNR</link>, int16_t 747<para>int ioctl(int fd, int request = <link linkend="FE_READ_SNR">FE_READ_SNR</link>, uint16_t
748 &#x22C6;snr);</para> 748 &#x22C6;snr);</para>
749</entry> 749</entry>
750 </row></tbody></tgroup></informaltable> 750 </row></tbody></tgroup></informaltable>
@@ -766,7 +766,7 @@ typedef enum fe_hierarchy {
766</entry> 766</entry>
767 </row><row><entry 767 </row><row><entry
768 align="char"> 768 align="char">
769<para>int16_t *snr</para> 769<para>uint16_t *snr</para>
770</entry><entry 770</entry><entry
771 align="char"> 771 align="char">
772<para>The signal-to-noise ratio is stored into *snr.</para> 772<para>The signal-to-noise ratio is stored into *snr.</para>
@@ -791,7 +791,7 @@ typedef enum fe_hierarchy {
791<informaltable><tgroup cols="1"><tbody><row><entry 791<informaltable><tgroup cols="1"><tbody><row><entry
792 align="char"> 792 align="char">
793<para>int ioctl( int fd, int request = 793<para>int ioctl( int fd, int request =
794 <link linkend="FE_READ_SIGNAL_STRENGTH">FE_READ_SIGNAL_STRENGTH</link>, int16_t &#x22C6;strength);</para> 794 <link linkend="FE_READ_SIGNAL_STRENGTH">FE_READ_SIGNAL_STRENGTH</link>, uint16_t &#x22C6;strength);</para>
795</entry> 795</entry>
796 </row></tbody></tgroup></informaltable> 796 </row></tbody></tgroup></informaltable>
797 797
@@ -814,7 +814,7 @@ typedef enum fe_hierarchy {
814</entry> 814</entry>
815 </row><row><entry 815 </row><row><entry
816 align="char"> 816 align="char">
817<para>int16_t *strength</para> 817<para>uint16_t *strength</para>
818</entry><entry 818</entry><entry
819 align="char"> 819 align="char">
820<para>The signal strength value is stored into *strength.</para> 820<para>The signal strength value is stored into *strength.</para>
diff --git a/Documentation/DocBook/media/v4l/common.xml b/Documentation/DocBook/media/v4l/common.xml
index 1ddf354aa997..71f6bf9e735e 100644
--- a/Documentation/DocBook/media/v4l/common.xml
+++ b/Documentation/DocBook/media/v4l/common.xml
@@ -38,70 +38,41 @@ the basic concepts applicable to all devices.</para>
38 38
39 <para>V4L2 drivers are implemented as kernel modules, loaded 39 <para>V4L2 drivers are implemented as kernel modules, loaded
40manually by the system administrator or automatically when a device is 40manually by the system administrator or automatically when a device is
41first opened. The driver modules plug into the "videodev" kernel 41first discovered. The driver modules plug into the "videodev" kernel
42module. It provides helper functions and a common application 42module. It provides helper functions and a common application
43interface specified in this document.</para> 43interface specified in this document.</para>
44 44
45 <para>Each driver thus loaded registers one or more device nodes 45 <para>Each driver thus loaded registers one or more device nodes
46with major number 81 and a minor number between 0 and 255. Assigning 46with major number 81 and a minor number between 0 and 255. Minor numbers
47minor numbers to V4L2 devices is entirely up to the system administrator, 47are allocated dynamically unless the kernel is compiled with the kernel
48this is primarily intended to solve conflicts between devices.<footnote> 48option CONFIG_VIDEO_FIXED_MINOR_RANGES. In that case minor numbers are
49 <para>Access permissions are associated with character 49allocated in ranges depending on the device node type (video, radio, etc.).</para>
50device special files, hence we must ensure device numbers cannot 50
51change with the module load order. To this end minor numbers are no 51 <para>Many drivers support "video_nr", "radio_nr" or "vbi_nr"
52longer automatically assigned by the "videodev" module as in V4L but 52module options to select specific video/radio/vbi node numbers. This allows
53requested by the driver. The defaults will suffice for most people 53the user to request that the device node is named e.g. /dev/video5 instead
54unless two drivers compete for the same minor numbers.</para> 54of leaving it to chance. When the driver supports multiple devices of the same
55 </footnote> The module options to select minor numbers are named 55type more than one device node number can be assigned, separated by commas:
56after the device special file with a "_nr" suffix. For example "video_nr" 56 <informalexample>
57for <filename>/dev/video</filename> video capture devices. The number is
58an offset to the base minor number associated with the device type.
59<footnote>
60 <para>In earlier versions of the V4L2 API the module options
61where named after the device special file with a "unit_" prefix, expressing
62the minor number itself, not an offset. Rationale for this change is unknown.
63Lastly the naming and semantics are just a convention among driver writers,
64the point to note is that minor numbers are not supposed to be hardcoded
65into drivers.</para>
66 </footnote> When the driver supports multiple devices of the same
67type more than one minor number can be assigned, separated by commas:
68<informalexample>
69 <screen> 57 <screen>
70&gt; insmod mydriver.o video_nr=0,1 radio_nr=0,1</screen> 58&gt; modprobe mydriver video_nr=0,1 radio_nr=0,1</screen>
71 </informalexample></para> 59 </informalexample></para>
72 60
73 <para>In <filename>/etc/modules.conf</filename> this may be 61 <para>In <filename>/etc/modules.conf</filename> this may be
74written as: <informalexample> 62written as: <informalexample>
75 <screen> 63 <screen>
76alias char-major-81-0 mydriver 64options mydriver video_nr=0,1 radio_nr=0,1
77alias char-major-81-1 mydriver
78alias char-major-81-64 mydriver <co id="alias" />
79options mydriver video_nr=0,1 radio_nr=0,1 <co id="options" />
80 </screen> 65 </screen>
81 <calloutlist> 66 </informalexample> When no device node number is given as module
82 <callout arearefs="alias"> 67option the driver supplies a default.</para>
83 <para>When an application attempts to open a device 68
84special file with major number 81 and minor number 0, 1, or 64, load 69 <para>Normally udev will create the device nodes in /dev automatically
85"mydriver" (and the "videodev" module it depends upon).</para> 70for you. If udev is not installed, then you need to enable the
86 </callout> 71CONFIG_VIDEO_FIXED_MINOR_RANGES kernel option in order to be able to correctly
87 <callout arearefs="options"> 72relate a minor number to a device node number. I.e., you need to be certain
88 <para>Register the first two video capture devices with 73that minor number 5 maps to device node name video5. With this kernel option
89minor number 0 and 1 (base number is 0), the first two radio device 74different device types have different minor number ranges. These ranges are
90with minor number 64 and 65 (base 64).</para> 75listed in <xref linkend="devices" />.
91 </callout>
92 </calloutlist>
93 </informalexample> When no minor number is given as module
94option the driver supplies a default. <xref linkend="devices" />
95recommends the base minor numbers to be used for the various device
96types. Obviously minor numbers must be unique. When the number is
97already in use the <emphasis>offending device</emphasis> will not be
98registered. <!-- Blessed by Linus Torvalds on
99linux-kernel@vger.kernel.org, 2002-11-20. --></para>
100
101 <para>By convention system administrators create various
102character device special files with these major and minor numbers in
103the <filename>/dev</filename> directory. The names recommended for the
104different V4L2 device types are listed in <xref linkend="devices" />.
105</para> 76</para>
106 77
107 <para>The creation of character special files (with 78 <para>The creation of character special files (with
@@ -110,85 +81,66 @@ devices cannot be opened by major and minor number. That means
110applications cannot <emphasis>reliable</emphasis> scan for loaded or 81applications cannot <emphasis>reliable</emphasis> scan for loaded or
111installed drivers. The user must enter a device name, or the 82installed drivers. The user must enter a device name, or the
112application can try the conventional device names.</para> 83application can try the conventional device names.</para>
113
114 <para>Under the device filesystem (devfs) the minor number
115options are ignored. V4L2 drivers (or by proxy the "videodev" module)
116automatically create the required device files in the
117<filename>/dev/v4l</filename> directory using the conventional device
118names above.</para>
119 </section> 84 </section>
120 85
121 <section id="related"> 86 <section id="related">
122 <title>Related Devices</title> 87 <title>Related Devices</title>
123 88
124 <para>Devices can support several related functions. For example 89 <para>Devices can support several functions. For example
125video capturing, video overlay and VBI capturing are related because 90video capturing, VBI capturing and radio support.</para>
126these functions share, amongst other, the same video input and tuner 91
127frequency. V4L and earlier versions of V4L2 used the same device name 92 <para>The V4L2 API creates different nodes for each of these functions.</para>
128and minor number for video capturing and overlay, but different ones 93
129for VBI. Experience showed this approach has several problems<footnote> 94 <para>The V4L2 API was designed with the idea that one device node could support
130 <para>Given a device file name one cannot reliable find 95all functions. However, in practice this never worked: this 'feature'
131related devices. For once names are arbitrary and in a system with 96was never used by applications and many drivers did not support it and if
132multiple devices, where only some support VBI capturing, a 97they did it was certainly never tested. In addition, switching a device
133<filename>/dev/video2</filename> is not necessarily related to 98node between different functions only works when using the streaming I/O
134<filename>/dev/vbi2</filename>. The V4L 99API, not with the read()/write() API.</para>
135<constant>VIDIOCGUNIT</constant> ioctl would require a search for a 100
136device file with a particular major and minor number.</para> 101 <para>Today each device node supports just one function.</para>
137 </footnote>, and to make things worse the V4L videodev module
138used to prohibit multiple opens of a device.</para>
139
140 <para>As a remedy the present version of the V4L2 API relaxed the
141concept of device types with specific names and minor numbers. For
142compatibility with old applications drivers must still register different
143minor numbers to assign a default function to the device. But if related
144functions are supported by the driver they must be available under all
145registered minor numbers. The desired function can be selected after
146opening the device as described in <xref linkend="devices" />.</para>
147
148 <para>Imagine a driver supporting video capturing, video
149overlay, raw VBI capturing, and FM radio reception. It registers three
150devices with minor number 0, 64 and 224 (this numbering scheme is
151inherited from the V4L API). Regardless if
152<filename>/dev/video</filename> (81, 0) or
153<filename>/dev/vbi</filename> (81, 224) is opened the application can
154select any one of the video capturing, overlay or VBI capturing
155functions. Without programming (e.&nbsp;g. reading from the device
156with <application>dd</application> or <application>cat</application>)
157<filename>/dev/video</filename> captures video images, while
158<filename>/dev/vbi</filename> captures raw VBI data.
159<filename>/dev/radio</filename> (81, 64) is invariable a radio device,
160unrelated to the video functions. Being unrelated does not imply the
161devices can be used at the same time, however. The &func-open;
162function may very well return an &EBUSY;.</para>
163 102
164 <para>Besides video input or output the hardware may also 103 <para>Besides video input or output the hardware may also
165support audio sampling or playback. If so, these functions are 104support audio sampling or playback. If so, these functions are
166implemented as OSS or ALSA PCM devices and eventually OSS or ALSA 105implemented as ALSA PCM devices with optional ALSA audio mixer
167audio mixer. The V4L2 API makes no provisions yet to find these 106devices.</para>
168related devices. If you have an idea please write to the linux-media 107
169mailing list: &v4l-ml;.</para> 108 <para>One problem with all these devices is that the V4L2 API
109makes no provisions to find these related devices. Some really
110complex devices use the Media Controller (see <xref linkend="media_controller" />)
111which can be used for this purpose. But most drivers do not use it,
112and while some code exists that uses sysfs to discover related devices
113(see libmedia_dev in the <ulink url="http://git.linuxtv.org/v4l-utils/">v4l-utils</ulink>
114git repository), there is no library yet that can provide a single API towards
115both Media Controller-based devices and devices that do not use the Media Controller.
116If you want to work on this please write to the linux-media mailing list: &v4l-ml;.</para>
170 </section> 117 </section>
171 118
172 <section> 119 <section>
173 <title>Multiple Opens</title> 120 <title>Multiple Opens</title>
174 121
175 <para>In general, V4L2 devices can be opened more than once. 122 <para>V4L2 devices can be opened more than once.<footnote><para>
123There are still some old and obscure drivers that have not been updated to
124allow for multiple opens. This implies that for such drivers &func-open; can
125return an &EBUSY; when the device is already in use.</para></footnote>
176When this is supported by the driver, users can for example start a 126When this is supported by the driver, users can for example start a
177"panel" application to change controls like brightness or audio 127"panel" application to change controls like brightness or audio
178volume, while another application captures video and audio. In other words, panel 128volume, while another application captures video and audio. In other words, panel
179applications are comparable to an OSS or ALSA audio mixer application. 129applications are comparable to an ALSA audio mixer application.
180When a device supports multiple functions like capturing and overlay 130Just opening a V4L2 device should not change the state of the device.<footnote>
181<emphasis>simultaneously</emphasis>, multiple opens allow concurrent 131<para>Unfortunately, opening a radio device often switches the state of the
182use of the device by forked processes or specialized applications.</para> 132device to radio mode in many drivers. This behavior should be fixed eventually
183 133as it violates the V4L2 specification.</para></footnote></para>
184 <para>Multiple opens are optional, although drivers should 134
185permit at least concurrent accesses without data exchange, &ie; panel 135 <para>Once an application has allocated the memory buffers needed for
186applications. This implies &func-open; can return an &EBUSY; when the 136streaming data (by calling the &VIDIOC-REQBUFS; or &VIDIOC-CREATE-BUFS; ioctls,
187device is already in use, as well as &func-ioctl; functions initiating 137or implicitly by calling the &func-read; or &func-write; functions) that
188data exchange (namely the &VIDIOC-S-FMT; ioctl), and the &func-read; 138application (filehandle) becomes the owner of the device. It is no longer
189and &func-write; functions.</para> 139allowed to make changes that would affect the buffer sizes (e.g. by calling
190 140the &VIDIOC-S-FMT; ioctl) and other applications are no longer allowed to allocate
191 <para>Mere opening a V4L2 device does not grant exclusive 141buffers or start or stop streaming. The &EBUSY; will be returned instead.</para>
142
143 <para>Merely opening a V4L2 device does not grant exclusive
192access.<footnote> 144access.<footnote>
193 <para>Drivers could recognize the 145 <para>Drivers could recognize the
194<constant>O_EXCL</constant> open flag. Presently this is not required, 146<constant>O_EXCL</constant> open flag. Presently this is not required,
@@ -206,12 +158,7 @@ additional access privileges using the priority mechanism described in
206 <para>V4L2 drivers should not support multiple applications 158 <para>V4L2 drivers should not support multiple applications
207reading or writing the same data stream on a device by copying 159reading or writing the same data stream on a device by copying
208buffers, time multiplexing or similar means. This is better handled by 160buffers, time multiplexing or similar means. This is better handled by
209a proxy application in user space. When the driver supports stream 161a proxy application in user space.</para>
210sharing anyway it must be implemented transparently. The V4L2 API does
211not specify how conflicts are solved. <!-- For example O_EXCL when the
212application does not want to be preempted, PROT_READ mmapped buffers
213which can be mapped twice, what happens when image formats do not
214match etc.--></para>
215 </section> 162 </section>
216 163
217 <section> 164 <section>
@@ -240,15 +187,15 @@ methods</link> supported by the device.</para>
240 187
241 <para>Starting with kernel version 3.1, VIDIOC-QUERYCAP will return the 188 <para>Starting with kernel version 3.1, VIDIOC-QUERYCAP will return the
242V4L2 API version used by the driver, with generally matches the Kernel version. 189V4L2 API version used by the driver, with generally matches the Kernel version.
243There's no need of using &VIDIOC-QUERYCAP; to check if an specific ioctl is 190There's no need of using &VIDIOC-QUERYCAP; to check if a specific ioctl is
244supported, the V4L2 core now returns ENOIOCTLCMD if a driver doesn't provide 191supported, the V4L2 core now returns ENOTTY if a driver doesn't provide
245support for an ioctl.</para> 192support for an ioctl.</para>
246 193
247 <para>Other features can be queried 194 <para>Other features can be queried
248by calling the respective ioctl, for example &VIDIOC-ENUMINPUT; 195by calling the respective ioctl, for example &VIDIOC-ENUMINPUT;
249to learn about the number, types and names of video connectors on the 196to learn about the number, types and names of video connectors on the
250device. Although abstraction is a major objective of this API, the 197device. Although abstraction is a major objective of this API, the
251ioctl also allows driver specific applications to reliable identify 198&VIDIOC-QUERYCAP; ioctl also allows driver specific applications to reliably identify
252the driver.</para> 199the driver.</para>
253 200
254 <para>All V4L2 drivers must support 201 <para>All V4L2 drivers must support
@@ -278,9 +225,7 @@ Applications requiring a different priority will usually call
278the &VIDIOC-QUERYCAP; ioctl.</para> 225the &VIDIOC-QUERYCAP; ioctl.</para>
279 226
280 <para>Ioctls changing driver properties, such as &VIDIOC-S-INPUT;, 227 <para>Ioctls changing driver properties, such as &VIDIOC-S-INPUT;,
281return an &EBUSY; after another application obtained higher priority. 228return an &EBUSY; after another application obtained higher priority.</para>
282An event mechanism to notify applications about asynchronous property
283changes has been proposed but not added yet.</para>
284 </section> 229 </section>
285 230
286 <section id="video"> 231 <section id="video">
@@ -288,9 +233,9 @@ changes has been proposed but not added yet.</para>
288 233
289 <para>Video inputs and outputs are physical connectors of a 234 <para>Video inputs and outputs are physical connectors of a
290device. These can be for example RF connectors (antenna/cable), CVBS 235device. These can be for example RF connectors (antenna/cable), CVBS
291a.k.a. Composite Video, S-Video or RGB connectors. Only video and VBI 236a.k.a. Composite Video, S-Video or RGB connectors. Video and VBI
292capture devices have inputs, output devices have outputs, at least one 237capture devices have inputs. Video and VBI output devices have outputs,
293each. Radio devices have no video inputs or outputs.</para> 238at least one each. Radio devices have no video inputs or outputs.</para>
294 239
295 <para>To learn about the number and attributes of the 240 <para>To learn about the number and attributes of the
296available inputs and outputs applications can enumerate them with the 241available inputs and outputs applications can enumerate them with the
@@ -299,30 +244,13 @@ available inputs and outputs applications can enumerate them with the
299ioctl also contains signal status information applicable when the 244ioctl also contains signal status information applicable when the
300current video input is queried.</para> 245current video input is queried.</para>
301 246
302 <para>The &VIDIOC-G-INPUT; and &VIDIOC-G-OUTPUT; ioctl return the 247 <para>The &VIDIOC-G-INPUT; and &VIDIOC-G-OUTPUT; ioctls return the
303index of the current video input or output. To select a different 248index of the current video input or output. To select a different
304input or output applications call the &VIDIOC-S-INPUT; and 249input or output applications call the &VIDIOC-S-INPUT; and
305&VIDIOC-S-OUTPUT; ioctl. Drivers must implement all the input ioctls 250&VIDIOC-S-OUTPUT; ioctls. Drivers must implement all the input ioctls
306when the device has one or more inputs, all the output ioctls when the 251when the device has one or more inputs, all the output ioctls when the
307device has one or more outputs.</para> 252device has one or more outputs.</para>
308 253
309 <!--
310 <figure id=io-tree>
311 <title>Input and output enumeration is the root of most device properties.</title>
312 <mediaobject>
313 <imageobject>
314 <imagedata fileref="links.pdf" format="ps" />
315 </imageobject>
316 <imageobject>
317 <imagedata fileref="links.gif" format="gif" />
318 </imageobject>
319 <textobject>
320 <phrase>Links between various device property structures.</phrase>
321 </textobject>
322 </mediaobject>
323 </figure>
324 -->
325
326 <example> 254 <example>
327 <title>Information about the current video input</title> 255 <title>Information about the current video input</title>
328 256
@@ -330,20 +258,20 @@ device has one or more outputs.</para>
330&v4l2-input; input; 258&v4l2-input; input;
331int index; 259int index;
332 260
333if (-1 == ioctl (fd, &VIDIOC-G-INPUT;, &amp;index)) { 261if (-1 == ioctl(fd, &VIDIOC-G-INPUT;, &amp;index)) {
334 perror ("VIDIOC_G_INPUT"); 262 perror("VIDIOC_G_INPUT");
335 exit (EXIT_FAILURE); 263 exit(EXIT_FAILURE);
336} 264}
337 265
338memset (&amp;input, 0, sizeof (input)); 266memset(&amp;input, 0, sizeof(input));
339input.index = index; 267input.index = index;
340 268
341if (-1 == ioctl (fd, &VIDIOC-ENUMINPUT;, &amp;input)) { 269if (-1 == ioctl(fd, &VIDIOC-ENUMINPUT;, &amp;input)) {
342 perror ("VIDIOC_ENUMINPUT"); 270 perror("VIDIOC_ENUMINPUT");
343 exit (EXIT_FAILURE); 271 exit(EXIT_FAILURE);
344} 272}
345 273
346printf ("Current input: %s\n", input.name); 274printf("Current input: %s\n", input.name);
347 </programlisting> 275 </programlisting>
348 </example> 276 </example>
349 277
@@ -355,9 +283,9 @@ int index;
355 283
356index = 0; 284index = 0;
357 285
358if (-1 == ioctl (fd, &VIDIOC-S-INPUT;, &amp;index)) { 286if (-1 == ioctl(fd, &VIDIOC-S-INPUT;, &amp;index)) {
359 perror ("VIDIOC_S_INPUT"); 287 perror("VIDIOC_S_INPUT");
360 exit (EXIT_FAILURE); 288 exit(EXIT_FAILURE);
361} 289}
362 </programlisting> 290 </programlisting>
363 </example> 291 </example>
@@ -397,7 +325,7 @@ available inputs and outputs applications can enumerate them with the
397also contains signal status information applicable when the current 325also contains signal status information applicable when the current
398audio input is queried.</para> 326audio input is queried.</para>
399 327
400 <para>The &VIDIOC-G-AUDIO; and &VIDIOC-G-AUDOUT; ioctl report 328 <para>The &VIDIOC-G-AUDIO; and &VIDIOC-G-AUDOUT; ioctls report
401the current audio input and output, respectively. Note that, unlike 329the current audio input and output, respectively. Note that, unlike
402&VIDIOC-G-INPUT; and &VIDIOC-G-OUTPUT; these ioctls return a structure 330&VIDIOC-G-INPUT; and &VIDIOC-G-OUTPUT; these ioctls return a structure
403as <constant>VIDIOC_ENUMAUDIO</constant> and 331as <constant>VIDIOC_ENUMAUDIO</constant> and
@@ -408,11 +336,11 @@ applications call the &VIDIOC-S-AUDIO; ioctl. To select an audio
408output (which presently has no changeable properties) applications 336output (which presently has no changeable properties) applications
409call the &VIDIOC-S-AUDOUT; ioctl.</para> 337call the &VIDIOC-S-AUDOUT; ioctl.</para>
410 338
411 <para>Drivers must implement all input ioctls when the device 339 <para>Drivers must implement all audio input ioctls when the device
412has one or more inputs, all output ioctls when the device has one 340has multiple selectable audio inputs, all audio output ioctls when the
413or more outputs. When the device has any audio inputs or outputs the 341device has multiple selectable audio outputs. When the device has any
414driver must set the <constant>V4L2_CAP_AUDIO</constant> flag in the 342audio inputs or outputs the driver must set the <constant>V4L2_CAP_AUDIO</constant>
415&v4l2-capability; returned by the &VIDIOC-QUERYCAP; ioctl.</para> 343flag in the &v4l2-capability; returned by the &VIDIOC-QUERYCAP; ioctl.</para>
416 344
417 <example> 345 <example>
418 <title>Information about the current audio input</title> 346 <title>Information about the current audio input</title>
@@ -420,14 +348,14 @@ driver must set the <constant>V4L2_CAP_AUDIO</constant> flag in the
420 <programlisting> 348 <programlisting>
421&v4l2-audio; audio; 349&v4l2-audio; audio;
422 350
423memset (&amp;audio, 0, sizeof (audio)); 351memset(&amp;audio, 0, sizeof(audio));
424 352
425if (-1 == ioctl (fd, &VIDIOC-G-AUDIO;, &amp;audio)) { 353if (-1 == ioctl(fd, &VIDIOC-G-AUDIO;, &amp;audio)) {
426 perror ("VIDIOC_G_AUDIO"); 354 perror("VIDIOC_G_AUDIO");
427 exit (EXIT_FAILURE); 355 exit(EXIT_FAILURE);
428} 356}
429 357
430printf ("Current input: %s\n", audio.name); 358printf("Current input: %s\n", audio.name);
431 </programlisting> 359 </programlisting>
432 </example> 360 </example>
433 361
@@ -437,13 +365,13 @@ printf ("Current input: %s\n", audio.name);
437 <programlisting> 365 <programlisting>
438&v4l2-audio; audio; 366&v4l2-audio; audio;
439 367
440memset (&amp;audio, 0, sizeof (audio)); /* clear audio.mode, audio.reserved */ 368memset(&amp;audio, 0, sizeof(audio)); /* clear audio.mode, audio.reserved */
441 369
442audio.index = 0; 370audio.index = 0;
443 371
444if (-1 == ioctl (fd, &VIDIOC-S-AUDIO;, &amp;audio)) { 372if (-1 == ioctl(fd, &VIDIOC-S-AUDIO;, &amp;audio)) {
445 perror ("VIDIOC_S_AUDIO"); 373 perror("VIDIOC_S_AUDIO");
446 exit (EXIT_FAILURE); 374 exit(EXIT_FAILURE);
447} 375}
448 </programlisting> 376 </programlisting>
449 </example> 377 </example>
@@ -468,7 +396,7 @@ the tuner.</para>
468video inputs.</para> 396video inputs.</para>
469 397
470 <para>To query and change tuner properties applications use the 398 <para>To query and change tuner properties applications use the
471&VIDIOC-G-TUNER; and &VIDIOC-S-TUNER; ioctl, respectively. The 399&VIDIOC-G-TUNER; and &VIDIOC-S-TUNER; ioctls, respectively. The
472&v4l2-tuner; returned by <constant>VIDIOC_G_TUNER</constant> also 400&v4l2-tuner; returned by <constant>VIDIOC_G_TUNER</constant> also
473contains signal status information applicable when the tuner of the 401contains signal status information applicable when the tuner of the
474current video or radio input is queried. Note that 402current video or radio input is queried. Note that
@@ -533,7 +461,7 @@ standards or variations of standards. Each video input and output may
533support another set of standards. This set is reported by the 461support another set of standards. This set is reported by the
534<structfield>std</structfield> field of &v4l2-input; and 462<structfield>std</structfield> field of &v4l2-input; and
535&v4l2-output; returned by the &VIDIOC-ENUMINPUT; and 463&v4l2-output; returned by the &VIDIOC-ENUMINPUT; and
536&VIDIOC-ENUMOUTPUT; ioctl, respectively.</para> 464&VIDIOC-ENUMOUTPUT; ioctls, respectively.</para>
537 465
538 <para>V4L2 defines one bit for each analog video standard 466 <para>V4L2 defines one bit for each analog video standard
539currently in use worldwide, and sets aside bits for driver defined 467currently in use worldwide, and sets aside bits for driver defined
@@ -564,28 +492,10 @@ automatically.</para>
564 <para>To query and select the standard used by the current video 492 <para>To query and select the standard used by the current video
565input or output applications call the &VIDIOC-G-STD; and 493input or output applications call the &VIDIOC-G-STD; and
566&VIDIOC-S-STD; ioctl, respectively. The <emphasis>received</emphasis> 494&VIDIOC-S-STD; ioctl, respectively. The <emphasis>received</emphasis>
567standard can be sensed with the &VIDIOC-QUERYSTD; ioctl. Note that the parameter of all these ioctls is a pointer to a &v4l2-std-id; type (a standard set), <emphasis>not</emphasis> an index into the standard enumeration.<footnote> 495standard can be sensed with the &VIDIOC-QUERYSTD; ioctl. Note that the
568 <para>An alternative to the current scheme is to use pointers 496parameter of all these ioctls is a pointer to a &v4l2-std-id; type
569to indices as arguments of <constant>VIDIOC_G_STD</constant> and 497(a standard set), <emphasis>not</emphasis> an index into the standard
570<constant>VIDIOC_S_STD</constant>, the &v4l2-input; and 498enumeration. Drivers must implement all video standard ioctls
571&v4l2-output; <structfield>std</structfield> field would be a set of
572indices like <structfield>audioset</structfield>.</para>
573 <para>Indices are consistent with the rest of the API
574and identify the standard unambiguously. In the present scheme of
575things an enumerated standard is looked up by &v4l2-std-id;. Now the
576standards supported by the inputs of a device can overlap. Just
577assume the tuner and composite input in the example above both
578exist on a device. An enumeration of "PAL-B/G", "PAL-H/I" suggests
579a choice which does not exist. We cannot merge or omit sets, because
580applications would be unable to find the standards reported by
581<constant>VIDIOC_G_STD</constant>. That leaves separate enumerations
582for each input. Also selecting a standard by &v4l2-std-id; can be
583ambiguous. Advantage of this method is that applications need not
584identify the standard indirectly, after enumerating.</para><para>So in
585summary, the lookup itself is unavoidable. The difference is only
586whether the lookup is necessary to find an enumerated standard or to
587switch to a standard by &v4l2-std-id;.</para>
588 </footnote> Drivers must implement all video standard ioctls
589when the device has one or more video inputs or outputs.</para> 499when the device has one or more video inputs or outputs.</para>
590 500
591 <para>Special rules apply to devices such as USB cameras where the notion of video 501 <para>Special rules apply to devices such as USB cameras where the notion of video
@@ -604,17 +514,10 @@ to zero and the <constant>VIDIOC_G_STD</constant>,
604<constant>VIDIOC_S_STD</constant>, 514<constant>VIDIOC_S_STD</constant>,
605<constant>VIDIOC_QUERYSTD</constant> and 515<constant>VIDIOC_QUERYSTD</constant> and
606<constant>VIDIOC_ENUMSTD</constant> ioctls shall return the 516<constant>VIDIOC_ENUMSTD</constant> ioctls shall return the
607&ENOTTY;.<footnote> 517&ENOTTY; or the &EINVAL;.</para>
608 <para>See <xref linkend="buffer" /> for a rationale.</para>
609 <para>Applications can make use of the <xref linkend="input-capabilities" /> and 518 <para>Applications can make use of the <xref linkend="input-capabilities" /> and
610<xref linkend="output-capabilities"/> flags to determine whether the video standard ioctls 519<xref linkend="output-capabilities"/> flags to determine whether the video standard ioctls
611are available for the device.</para> 520can be used with the given input or output.</para>
612
613 <para>See <xref linkend="buffer" /> for a rationale. Probably
614even USB cameras follow some well known video standard. It might have
615been better to explicitly indicate elsewhere if a device cannot live
616up to normal expectations, instead of this exception.</para>
617 </footnote></para>
618 521
619 <example> 522 <example>
620 <title>Information about the current video standard</title> 523 <title>Information about the current video standard</title>
@@ -623,22 +526,22 @@ up to normal expectations, instead of this exception.</para>
623&v4l2-std-id; std_id; 526&v4l2-std-id; std_id;
624&v4l2-standard; standard; 527&v4l2-standard; standard;
625 528
626if (-1 == ioctl (fd, &VIDIOC-G-STD;, &amp;std_id)) { 529if (-1 == ioctl(fd, &VIDIOC-G-STD;, &amp;std_id)) {
627 /* Note when VIDIOC_ENUMSTD always returns ENOTTY this 530 /* Note when VIDIOC_ENUMSTD always returns ENOTTY this
628 is no video device or it falls under the USB exception, 531 is no video device or it falls under the USB exception,
629 and VIDIOC_G_STD returning ENOTTY is no error. */ 532 and VIDIOC_G_STD returning ENOTTY is no error. */
630 533
631 perror ("VIDIOC_G_STD"); 534 perror("VIDIOC_G_STD");
632 exit (EXIT_FAILURE); 535 exit(EXIT_FAILURE);
633} 536}
634 537
635memset (&amp;standard, 0, sizeof (standard)); 538memset(&amp;standard, 0, sizeof(standard));
636standard.index = 0; 539standard.index = 0;
637 540
638while (0 == ioctl (fd, &VIDIOC-ENUMSTD;, &amp;standard)) { 541while (0 == ioctl(fd, &VIDIOC-ENUMSTD;, &amp;standard)) {
639 if (standard.id &amp; std_id) { 542 if (standard.id &amp; std_id) {
640 printf ("Current video standard: %s\n", standard.name); 543 printf("Current video standard: %s\n", standard.name);
641 exit (EXIT_SUCCESS); 544 exit(EXIT_SUCCESS);
642 } 545 }
643 546
644 standard.index++; 547 standard.index++;
@@ -648,8 +551,8 @@ while (0 == ioctl (fd, &VIDIOC-ENUMSTD;, &amp;standard)) {
648 empty unless this device falls under the USB exception. */ 551 empty unless this device falls under the USB exception. */
649 552
650if (errno == EINVAL || standard.index == 0) { 553if (errno == EINVAL || standard.index == 0) {
651 perror ("VIDIOC_ENUMSTD"); 554 perror("VIDIOC_ENUMSTD");
652 exit (EXIT_FAILURE); 555 exit(EXIT_FAILURE);
653} 556}
654 </programlisting> 557 </programlisting>
655 </example> 558 </example>
@@ -662,26 +565,26 @@ input</title>
662&v4l2-input; input; 565&v4l2-input; input;
663&v4l2-standard; standard; 566&v4l2-standard; standard;
664 567
665memset (&amp;input, 0, sizeof (input)); 568memset(&amp;input, 0, sizeof(input));
666 569
667if (-1 == ioctl (fd, &VIDIOC-G-INPUT;, &amp;input.index)) { 570if (-1 == ioctl(fd, &VIDIOC-G-INPUT;, &amp;input.index)) {
668 perror ("VIDIOC_G_INPUT"); 571 perror("VIDIOC_G_INPUT");
669 exit (EXIT_FAILURE); 572 exit(EXIT_FAILURE);
670} 573}
671 574
672if (-1 == ioctl (fd, &VIDIOC-ENUMINPUT;, &amp;input)) { 575if (-1 == ioctl(fd, &VIDIOC-ENUMINPUT;, &amp;input)) {
673 perror ("VIDIOC_ENUM_INPUT"); 576 perror("VIDIOC_ENUM_INPUT");
674 exit (EXIT_FAILURE); 577 exit(EXIT_FAILURE);
675} 578}
676 579
677printf ("Current input %s supports:\n", input.name); 580printf("Current input %s supports:\n", input.name);
678 581
679memset (&amp;standard, 0, sizeof (standard)); 582memset(&amp;standard, 0, sizeof(standard));
680standard.index = 0; 583standard.index = 0;
681 584
682while (0 == ioctl (fd, &VIDIOC-ENUMSTD;, &amp;standard)) { 585while (0 == ioctl(fd, &VIDIOC-ENUMSTD;, &amp;standard)) {
683 if (standard.id &amp; input.std) 586 if (standard.id &amp; input.std)
684 printf ("%s\n", standard.name); 587 printf("%s\n", standard.name);
685 588
686 standard.index++; 589 standard.index++;
687} 590}
@@ -690,8 +593,8 @@ while (0 == ioctl (fd, &VIDIOC-ENUMSTD;, &amp;standard)) {
690 empty unless this device falls under the USB exception. */ 593 empty unless this device falls under the USB exception. */
691 594
692if (errno != EINVAL || standard.index == 0) { 595if (errno != EINVAL || standard.index == 0) {
693 perror ("VIDIOC_ENUMSTD"); 596 perror("VIDIOC_ENUMSTD");
694 exit (EXIT_FAILURE); 597 exit(EXIT_FAILURE);
695} 598}
696 </programlisting> 599 </programlisting>
697 </example> 600 </example>
@@ -703,21 +606,21 @@ if (errno != EINVAL || standard.index == 0) {
703&v4l2-input; input; 606&v4l2-input; input;
704&v4l2-std-id; std_id; 607&v4l2-std-id; std_id;
705 608
706memset (&amp;input, 0, sizeof (input)); 609memset(&amp;input, 0, sizeof(input));
707 610
708if (-1 == ioctl (fd, &VIDIOC-G-INPUT;, &amp;input.index)) { 611if (-1 == ioctl(fd, &VIDIOC-G-INPUT;, &amp;input.index)) {
709 perror ("VIDIOC_G_INPUT"); 612 perror("VIDIOC_G_INPUT");
710 exit (EXIT_FAILURE); 613 exit(EXIT_FAILURE);
711} 614}
712 615
713if (-1 == ioctl (fd, &VIDIOC-ENUMINPUT;, &amp;input)) { 616if (-1 == ioctl(fd, &VIDIOC-ENUMINPUT;, &amp;input)) {
714 perror ("VIDIOC_ENUM_INPUT"); 617 perror("VIDIOC_ENUM_INPUT");
715 exit (EXIT_FAILURE); 618 exit(EXIT_FAILURE);
716} 619}
717 620
718if (0 == (input.std &amp; V4L2_STD_PAL_BG)) { 621if (0 == (input.std &amp; V4L2_STD_PAL_BG)) {
719 fprintf (stderr, "Oops. B/G PAL is not supported.\n"); 622 fprintf(stderr, "Oops. B/G PAL is not supported.\n");
720 exit (EXIT_FAILURE); 623 exit(EXIT_FAILURE);
721} 624}
722 625
723/* Note this is also supposed to work when only B 626/* Note this is also supposed to work when only B
@@ -725,9 +628,9 @@ if (0 == (input.std &amp; V4L2_STD_PAL_BG)) {
725 628
726std_id = V4L2_STD_PAL_BG; 629std_id = V4L2_STD_PAL_BG;
727 630
728if (-1 == ioctl (fd, &VIDIOC-S-STD;, &amp;std_id)) { 631if (-1 == ioctl(fd, &VIDIOC-S-STD;, &amp;std_id)) {
729 perror ("VIDIOC_S_STD"); 632 perror("VIDIOC_S_STD");
730 exit (EXIT_FAILURE); 633 exit(EXIT_FAILURE);
731} 634}
732 </programlisting> 635 </programlisting>
733 </example> 636 </example>
@@ -740,26 +643,25 @@ corresponding video timings. Today there are many more different hardware interf
740such as High Definition TV interfaces (HDMI), VGA, DVI connectors etc., that carry 643such as High Definition TV interfaces (HDMI), VGA, DVI connectors etc., that carry
741video signals and there is a need to extend the API to select the video timings 644video signals and there is a need to extend the API to select the video timings
742for these interfaces. Since it is not possible to extend the &v4l2-std-id; due to 645for these interfaces. Since it is not possible to extend the &v4l2-std-id; due to
743the limited bits available, a new set of IOCTLs was added to set/get video timings at 646the limited bits available, a new set of ioctls was added to set/get video timings at
744the input and output: </para><itemizedlist> 647the input and output.</para>
745 <listitem> 648
746 <para>DV Timings: This will allow applications to define detailed 649 <para>These ioctls deal with the detailed digital video timings that define
747video timings for the interface. This includes parameters such as width, height, 650each video format. This includes parameters such as the active video width and height,
748polarities, frontporch, backporch etc. The <filename>linux/v4l2-dv-timings.h</filename> 651signal polarities, frontporches, backporches, sync widths etc. The <filename>linux/v4l2-dv-timings.h</filename>
749header can be used to get the timings of the formats in the <xref linkend="cea861" /> and 652header can be used to get the timings of the formats in the <xref linkend="cea861" /> and
750<xref linkend="vesadmt" /> standards. 653<xref linkend="vesadmt" /> standards.
751 </para> 654 </para>
752 </listitem> 655
753 </itemizedlist> 656 <para>To enumerate and query the attributes of the DV timings supported by a device
754 <para>To enumerate and query the attributes of the DV timings supported by a device,
755 applications use the &VIDIOC-ENUM-DV-TIMINGS; and &VIDIOC-DV-TIMINGS-CAP; ioctls. 657 applications use the &VIDIOC-ENUM-DV-TIMINGS; and &VIDIOC-DV-TIMINGS-CAP; ioctls.
756 To set DV timings for the device, applications use the 658 To set DV timings for the device applications use the
757&VIDIOC-S-DV-TIMINGS; ioctl and to get current DV timings they use the 659&VIDIOC-S-DV-TIMINGS; ioctl and to get current DV timings they use the
758&VIDIOC-G-DV-TIMINGS; ioctl. To detect the DV timings as seen by the video receiver applications 660&VIDIOC-G-DV-TIMINGS; ioctl. To detect the DV timings as seen by the video receiver applications
759use the &VIDIOC-QUERY-DV-TIMINGS; ioctl.</para> 661use the &VIDIOC-QUERY-DV-TIMINGS; ioctl.</para>
760 <para>Applications can make use of the <xref linkend="input-capabilities" /> and 662 <para>Applications can make use of the <xref linkend="input-capabilities" /> and
761<xref linkend="output-capabilities"/> flags to decide what ioctls are available to set the 663<xref linkend="output-capabilities"/> flags to determine whether the digital video ioctls
762video timings for the device.</para> 664can be used with the given input or output.</para>
763 </section> 665 </section>
764 666
765 &sub-controls; 667 &sub-controls;
diff --git a/Documentation/DocBook/media/v4l/compat.xml b/Documentation/DocBook/media/v4l/compat.xml
index c4cac6dbf9af..eee6f0f4aa43 100644
--- a/Documentation/DocBook/media/v4l/compat.xml
+++ b/Documentation/DocBook/media/v4l/compat.xml
@@ -397,7 +397,7 @@ linkend="control" />.</para>
397 397
398 <para>The <structfield>depth</structfield> (average number of 398 <para>The <structfield>depth</structfield> (average number of
399bits per pixel) of a video image is implied by the selected image 399bits per pixel) of a video image is implied by the selected image
400format. V4L2 does not explicitely provide such information assuming 400format. V4L2 does not explicitly provide such information assuming
401applications recognizing the format are aware of the image depth and 401applications recognizing the format are aware of the image depth and
402others need not know. The <structfield>palette</structfield> field 402others need not know. The <structfield>palette</structfield> field
403moved into the &v4l2-pix-format;:<informaltable> 403moved into the &v4l2-pix-format;:<informaltable>
@@ -2535,6 +2535,16 @@ fields changed from _s32 to _u32.
2535 </orderedlist> 2535 </orderedlist>
2536 </section> 2536 </section>
2537 2537
2538 <section>
2539 <title>V4L2 in Linux 3.15</title>
2540 <orderedlist>
2541 <listitem>
2542 <para>Added Software Defined Radio (SDR) Interface.
2543 </para>
2544 </listitem>
2545 </orderedlist>
2546 </section>
2547
2538 <section id="other"> 2548 <section id="other">
2539 <title>Relation of V4L2 to other Linux multimedia APIs</title> 2549 <title>Relation of V4L2 to other Linux multimedia APIs</title>
2540 2550
@@ -2651,6 +2661,9 @@ ioctls.</para>
2651 <listitem> 2661 <listitem>
2652 <para>Exporting DMABUF files using &VIDIOC-EXPBUF; ioctl.</para> 2662 <para>Exporting DMABUF files using &VIDIOC-EXPBUF; ioctl.</para>
2653 </listitem> 2663 </listitem>
2664 <listitem>
2665 <para>Software Defined Radio (SDR) Interface, <xref linkend="sdr" />.</para>
2666 </listitem>
2654 </itemizedlist> 2667 </itemizedlist>
2655 </section> 2668 </section>
2656 2669
diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml
index a5a3188e5af7..47198eef75a4 100644
--- a/Documentation/DocBook/media/v4l/controls.xml
+++ b/Documentation/DocBook/media/v4l/controls.xml
@@ -2258,6 +2258,26 @@ Applicable to the MPEG1, MPEG2, MPEG4 encoders.</entry>
2258VBV buffer control.</entry> 2258VBV buffer control.</entry>
2259 </row> 2259 </row>
2260 2260
2261 <row><entry></entry></row>
2262 <row id="v4l2-mpeg-video-hor-search-range">
2263 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MV_H_SEARCH_RANGE</constant>&nbsp;</entry>
2264 <entry>integer</entry>
2265 </row>
2266 <row><entry spanname="descr">Horizontal search range defines maximum horizontal search area in pixels
2267to search and match for the present Macroblock (MB) in the reference picture. This V4L2 control macro is used to set
2268horizontal search range for motion estimation module in video encoder.</entry>
2269 </row>
2270
2271 <row><entry></entry></row>
2272 <row id="v4l2-mpeg-video-vert-search-range">
2273 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE</constant>&nbsp;</entry>
2274 <entry>integer</entry>
2275 </row>
2276 <row><entry spanname="descr">Vertical search range defines maximum vertical search area in pixels
2277to search and match for the present Macroblock (MB) in the reference picture. This V4L2 control macro is used to set
2278vertical search range for motion estimation module in video encoder.</entry>
2279 </row>
2280
2261 <row><entry></entry></row> 2281 <row><entry></entry></row>
2262 <row> 2282 <row>
2263 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE</constant>&nbsp;</entry> 2283 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE</constant>&nbsp;</entry>
@@ -4370,6 +4390,24 @@ interface and may change in the future.</para>
4370 <entry>The flash controller has detected a short or open 4390 <entry>The flash controller has detected a short or open
4371 circuit condition on the indicator LED.</entry> 4391 circuit condition on the indicator LED.</entry>
4372 </row> 4392 </row>
4393 <row>
4394 <entry><constant>V4L2_FLASH_FAULT_UNDER_VOLTAGE</constant></entry>
4395 <entry>Flash controller voltage to the flash LED
4396 has been below the minimum limit specific to the flash
4397 controller.</entry>
4398 </row>
4399 <row>
4400 <entry><constant>V4L2_FLASH_FAULT_INPUT_VOLTAGE</constant></entry>
4401 <entry>The input voltage of the flash controller is below
4402 the limit under which strobing the flash at full current
4403 will not be possible.The condition persists until this flag
4404 is no longer set.</entry>
4405 </row>
4406 <row>
4407 <entry><constant>V4L2_FLASH_FAULT_LED_OVER_TEMPERATURE</constant></entry>
4408 <entry>The temperature of the LED has exceeded its
4409 allowed upper limit.</entry>
4410 </row>
4373 </tbody> 4411 </tbody>
4374 </entrytbl> 4412 </entrytbl>
4375 </row> 4413 </row>
@@ -4971,4 +5009,142 @@ defines possible values for de-emphasis. Here they are:</entry>
4971 </table> 5009 </table>
4972 5010
4973 </section> 5011 </section>
5012
5013 <section id="rf-tuner-controls">
5014 <title>RF Tuner Control Reference</title>
5015
5016 <para>
5017The RF Tuner (RF_TUNER) class includes controls for common features of devices
5018having RF tuner.
5019 </para>
5020 <para>
5021In this context, RF tuner is radio receiver circuit between antenna and
5022demodulator. It receives radio frequency (RF) from the antenna and converts that
5023received signal to lower intermediate frequency (IF) or baseband frequency (BB).
5024Tuners that could do baseband output are often called Zero-IF tuners. Older
5025tuners were typically simple PLL tuners inside a metal box, whilst newer ones
5026are highly integrated chips without a metal box "silicon tuners". These controls
5027are mostly applicable for new feature rich silicon tuners, just because older
5028tuners does not have much adjustable features.
5029 </para>
5030 <para>
5031For more information about RF tuners see
5032<ulink url="http://en.wikipedia.org/wiki/Tuner_%28radio%29">Tuner (radio)</ulink>
5033and
5034<ulink url="http://en.wikipedia.org/wiki/RF_front_end">RF front end</ulink>
5035from Wikipedia.
5036 </para>
5037
5038 <table pgwide="1" frame="none" id="rf-tuner-control-id">
5039 <title>RF_TUNER Control IDs</title>
5040
5041 <tgroup cols="4">
5042 <colspec colname="c1" colwidth="1*" />
5043 <colspec colname="c2" colwidth="6*" />
5044 <colspec colname="c3" colwidth="2*" />
5045 <colspec colname="c4" colwidth="6*" />
5046 <spanspec namest="c1" nameend="c2" spanname="id" />
5047 <spanspec namest="c2" nameend="c4" spanname="descr" />
5048 <thead>
5049 <row>
5050 <entry spanname="id" align="left">ID</entry>
5051 <entry align="left">Type</entry>
5052 </row>
5053 <row rowsep="1">
5054 <entry spanname="descr" align="left">Description</entry>
5055 </row>
5056 </thead>
5057 <tbody valign="top">
5058 <row><entry></entry></row>
5059 <row>
5060 <entry spanname="id"><constant>V4L2_CID_RF_TUNER_CLASS</constant>&nbsp;</entry>
5061 <entry>class</entry>
5062 </row><row><entry spanname="descr">The RF_TUNER class
5063descriptor. Calling &VIDIOC-QUERYCTRL; for this control will return a
5064description of this control class.</entry>
5065 </row>
5066 <row>
5067 <entry spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH_AUTO</constant>&nbsp;</entry>
5068 <entry>boolean</entry>
5069 </row>
5070 <row>
5071 <entry spanname="descr">Enables/disables tuner radio channel
5072bandwidth configuration. In automatic mode bandwidth configuration is performed
5073by the driver.</entry>
5074 </row>
5075 <row>
5076 <entry spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH</constant>&nbsp;</entry>
5077 <entry>integer</entry>
5078 </row>
5079 <row>
5080 <entry spanname="descr">Filter(s) on tuner signal path are used to
5081filter signal according to receiving party needs. Driver configures filters to
5082fulfill desired bandwidth requirement. Used when V4L2_CID_RF_TUNER_BANDWIDTH_AUTO is not
5083set. Unit is in Hz. The range and step are driver-specific.</entry>
5084 </row>
5085 <row>
5086 <entry spanname="id"><constant>V4L2_CID_RF_TUNER_LNA_GAIN_AUTO</constant>&nbsp;</entry>
5087 <entry>boolean</entry>
5088 </row>
5089 <row>
5090 <entry spanname="descr">Enables/disables LNA automatic gain control (AGC)</entry>
5091 </row>
5092 <row>
5093 <entry spanname="id"><constant>V4L2_CID_RF_TUNER_MIXER_GAIN_AUTO</constant>&nbsp;</entry>
5094 <entry>boolean</entry>
5095 </row>
5096 <row>
5097 <entry spanname="descr">Enables/disables mixer automatic gain control (AGC)</entry>
5098 </row>
5099 <row>
5100 <entry spanname="id"><constant>V4L2_CID_RF_TUNER_IF_GAIN_AUTO</constant>&nbsp;</entry>
5101 <entry>boolean</entry>
5102 </row>
5103 <row>
5104 <entry spanname="descr">Enables/disables IF automatic gain control (AGC)</entry>
5105 </row>
5106 <row>
5107 <entry spanname="id"><constant>V4L2_CID_RF_TUNER_LNA_GAIN</constant>&nbsp;</entry>
5108 <entry>integer</entry>
5109 </row>
5110 <row>
5111 <entry spanname="descr">LNA (low noise amplifier) gain is first
5112gain stage on the RF tuner signal path. It is located very close to tuner
5113antenna input. Used when <constant>V4L2_CID_RF_TUNER_LNA_GAIN_AUTO</constant> is not set.
5114The range and step are driver-specific.</entry>
5115 </row>
5116 <row>
5117 <entry spanname="id"><constant>V4L2_CID_RF_TUNER_MIXER_GAIN</constant>&nbsp;</entry>
5118 <entry>integer</entry>
5119 </row>
5120 <row>
5121 <entry spanname="descr">Mixer gain is second gain stage on the RF
5122tuner signal path. It is located inside mixer block, where RF signal is
5123down-converted by the mixer. Used when <constant>V4L2_CID_RF_TUNER_MIXER_GAIN_AUTO</constant>
5124is not set. The range and step are driver-specific.</entry>
5125 </row>
5126 <row>
5127 <entry spanname="id"><constant>V4L2_CID_RF_TUNER_IF_GAIN</constant>&nbsp;</entry>
5128 <entry>integer</entry>
5129 </row>
5130 <row>
5131 <entry spanname="descr">IF gain is last gain stage on the RF tuner
5132signal path. It is located on output of RF tuner. It controls signal level of
5133intermediate frequency output or baseband output. Used when
5134<constant>V4L2_CID_RF_TUNER_IF_GAIN_AUTO</constant> is not set. The range and step are
5135driver-specific.</entry>
5136 </row>
5137 <row>
5138 <entry spanname="id"><constant>V4L2_CID_RF_TUNER_PLL_LOCK</constant>&nbsp;</entry>
5139 <entry>boolean</entry>
5140 </row>
5141 <row>
5142 <entry spanname="descr">Is synthesizer PLL locked? RF tuner is
5143receiving given frequency when that control is set. This is a read-only control.
5144</entry>
5145 </row>
5146 </tbody>
5147 </tgroup>
5148 </table>
5149 </section>
4974</section> 5150</section>
diff --git a/Documentation/DocBook/media/v4l/dev-osd.xml b/Documentation/DocBook/media/v4l/dev-osd.xml
index dd91d6134e8c..54853329140b 100644
--- a/Documentation/DocBook/media/v4l/dev-osd.xml
+++ b/Documentation/DocBook/media/v4l/dev-osd.xml
@@ -56,18 +56,18 @@ framebuffer device.</para>
56unsigned int i; 56unsigned int i;
57int fb_fd; 57int fb_fd;
58 58
59if (-1 == ioctl (fd, VIDIOC_G_FBUF, &amp;fbuf)) { 59if (-1 == ioctl(fd, VIDIOC_G_FBUF, &amp;fbuf)) {
60 perror ("VIDIOC_G_FBUF"); 60 perror("VIDIOC_G_FBUF");
61 exit (EXIT_FAILURE); 61 exit(EXIT_FAILURE);
62} 62}
63 63
64for (i = 0; i &gt; 30; ++i) { 64for (i = 0; i &lt; 30; i++) {
65 char dev_name[16]; 65 char dev_name[16];
66 struct fb_fix_screeninfo si; 66 struct fb_fix_screeninfo si;
67 67
68 snprintf (dev_name, sizeof (dev_name), "/dev/fb%u", i); 68 snprintf(dev_name, sizeof(dev_name), "/dev/fb%u", i);
69 69
70 fb_fd = open (dev_name, O_RDWR); 70 fb_fd = open(dev_name, O_RDWR);
71 if (-1 == fb_fd) { 71 if (-1 == fb_fd) {
72 switch (errno) { 72 switch (errno) {
73 case ENOENT: /* no such file */ 73 case ENOENT: /* no such file */
@@ -75,19 +75,19 @@ for (i = 0; i &gt; 30; ++i) {
75 continue; 75 continue;
76 76
77 default: 77 default:
78 perror ("open"); 78 perror("open");
79 exit (EXIT_FAILURE); 79 exit(EXIT_FAILURE);
80 } 80 }
81 } 81 }
82 82
83 if (0 == ioctl (fb_fd, FBIOGET_FSCREENINFO, &amp;si)) { 83 if (0 == ioctl(fb_fd, FBIOGET_FSCREENINFO, &amp;si)) {
84 if (si.smem_start == (unsigned long) fbuf.base) 84 if (si.smem_start == (unsigned long)fbuf.base)
85 break; 85 break;
86 } else { 86 } else {
87 /* Apparently not a framebuffer device. */ 87 /* Apparently not a framebuffer device. */
88 } 88 }
89 89
90 close (fb_fd); 90 close(fb_fd);
91 fb_fd = -1; 91 fb_fd = -1;
92} 92}
93 93
diff --git a/Documentation/DocBook/media/v4l/dev-sdr.xml b/Documentation/DocBook/media/v4l/dev-sdr.xml
new file mode 100644
index 000000000000..dc14804f5436
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/dev-sdr.xml
@@ -0,0 +1,110 @@
1 <title>Software Defined Radio Interface (SDR)</title>
2
3 <note>
4 <title>Experimental</title>
5 <para>This is an <link linkend="experimental"> experimental </link>
6 interface and may change in the future.</para>
7 </note>
8
9 <para>
10SDR is an abbreviation of Software Defined Radio, the radio device
11which uses application software for modulation or demodulation. This interface
12is intended for controlling and data streaming of such devices.
13 </para>
14
15 <para>
16SDR devices are accessed through character device special files named
17<filename>/dev/swradio0</filename> to <filename>/dev/swradio255</filename>
18with major number 81 and dynamically allocated minor numbers 0 to 255.
19 </para>
20
21 <section>
22 <title>Querying Capabilities</title>
23
24 <para>
25Devices supporting the SDR receiver interface set the
26<constant>V4L2_CAP_SDR_CAPTURE</constant> and
27<constant>V4L2_CAP_TUNER</constant> flag in the
28<structfield>capabilities</structfield> field of &v4l2-capability;
29returned by the &VIDIOC-QUERYCAP; ioctl. That flag means the device has an
30Analog to Digital Converter (ADC), which is a mandatory element for the SDR receiver.
31At least one of the read/write, streaming or asynchronous I/O methods must
32be supported.
33 </para>
34 </section>
35
36 <section>
37 <title>Supplemental Functions</title>
38
39 <para>
40SDR devices can support <link linkend="control">controls</link>, and must
41support the <link linkend="tuner">tuner</link> ioctls. Tuner ioctls are used
42for setting the ADC sampling rate (sampling frequency) and the possible RF tuner
43frequency.
44 </para>
45
46 <para>
47The <constant>V4L2_TUNER_ADC</constant> tuner type is used for ADC tuners, and
48the <constant>V4L2_TUNER_RF</constant> tuner type is used for RF tuners. The
49tuner index of the RF tuner (if any) must always follow the ADC tuner index.
50Normally the ADC tuner is #0 and the RF tuner is #1.
51 </para>
52
53 <para>
54The &VIDIOC-S-HW-FREQ-SEEK; ioctl is not supported.
55 </para>
56 </section>
57
58 <section>
59 <title>Data Format Negotiation</title>
60
61 <para>
62The SDR capture device uses the <link linkend="format">format</link> ioctls to
63select the capture format. Both the sampling resolution and the data streaming
64format are bound to that selectable format. In addition to the basic
65<link linkend="format">format</link> ioctls, the &VIDIOC-ENUM-FMT; ioctl
66must be supported as well.
67 </para>
68
69 <para>
70To use the <link linkend="format">format</link> ioctls applications set the
71<structfield>type</structfield> field of a &v4l2-format; to
72<constant>V4L2_BUF_TYPE_SDR_CAPTURE</constant> and use the &v4l2-sdr-format;
73<structfield>sdr</structfield> member of the <structfield>fmt</structfield>
74union as needed per the desired operation.
75Currently only the <structfield>pixelformat</structfield> field of
76&v4l2-sdr-format; is used. The content of that field is the V4L2 fourcc code
77of the data format.
78 </para>
79
80 <table pgwide="1" frame="none" id="v4l2-sdr-format">
81 <title>struct <structname>v4l2_sdr_format</structname></title>
82 <tgroup cols="3">
83 &cs-str;
84 <tbody valign="top">
85 <row>
86 <entry>__u32</entry>
87 <entry><structfield>pixelformat</structfield></entry>
88 <entry>
89The data format or type of compression, set by the application. This is a
90little endian <link linkend="v4l2-fourcc">four character code</link>.
91V4L2 defines SDR formats in <xref linkend="sdr-formats" />.
92 </entry>
93 </row>
94 <row>
95 <entry>__u8</entry>
96 <entry><structfield>reserved[28]</structfield></entry>
97 <entry>This array is reserved for future extensions.
98Drivers and applications must set it to zero.</entry>
99 </row>
100 </tbody>
101 </tgroup>
102 </table>
103
104 <para>
105An SDR device may support <link linkend="rw">read/write</link>
106and/or streaming (<link linkend="mmap">memory mapping</link>
107or <link linkend="userp">user pointer</link>) I/O.
108 </para>
109
110 </section>
diff --git a/Documentation/DocBook/media/v4l/io.xml b/Documentation/DocBook/media/v4l/io.xml
index 2c4c068dde83..97a69bf6f3eb 100644
--- a/Documentation/DocBook/media/v4l/io.xml
+++ b/Documentation/DocBook/media/v4l/io.xml
@@ -339,8 +339,8 @@ returns immediately with an &EAGAIN; when no buffer is available. The
339queues as a side effect. Since there is no notion of doing anything 339queues as a side effect. Since there is no notion of doing anything
340"now" on a multitasking system, if an application needs to synchronize 340"now" on a multitasking system, if an application needs to synchronize
341with another event it should examine the &v4l2-buffer; 341with another event it should examine the &v4l2-buffer;
342<structfield>timestamp</structfield> of captured buffers, or set the 342<structfield>timestamp</structfield> of captured or outputted buffers.
343field before enqueuing buffers for output.</para> 343</para>
344 344
345 <para>Drivers implementing memory mapping I/O must 345 <para>Drivers implementing memory mapping I/O must
346support the <constant>VIDIOC_REQBUFS</constant>, 346support the <constant>VIDIOC_REQBUFS</constant>,
@@ -457,7 +457,7 @@ queues and unlocks all buffers as a side effect. Since there is no
457notion of doing anything "now" on a multitasking system, if an 457notion of doing anything "now" on a multitasking system, if an
458application needs to synchronize with another event it should examine 458application needs to synchronize with another event it should examine
459the &v4l2-buffer; <structfield>timestamp</structfield> of captured 459the &v4l2-buffer; <structfield>timestamp</structfield> of captured
460buffers, or set the field before enqueuing buffers for output.</para> 460or outputted buffers.</para>
461 461
462 <para>Drivers implementing user pointer I/O must 462 <para>Drivers implementing user pointer I/O must
463support the <constant>VIDIOC_REQBUFS</constant>, 463support the <constant>VIDIOC_REQBUFS</constant>,
@@ -620,8 +620,7 @@ returns immediately with an &EAGAIN; when no buffer is available. The
620unlocks all buffers as a side effect. Since there is no notion of doing 620unlocks all buffers as a side effect. Since there is no notion of doing
621anything "now" on a multitasking system, if an application needs to synchronize 621anything "now" on a multitasking system, if an application needs to synchronize
622with another event it should examine the &v4l2-buffer; 622with another event it should examine the &v4l2-buffer;
623<structfield>timestamp</structfield> of captured buffers, or set the field 623<structfield>timestamp</structfield> of captured or outputted buffers.</para>
624before enqueuing buffers for output.</para>
625 624
626 <para>Drivers implementing DMABUF importing I/O must support the 625 <para>Drivers implementing DMABUF importing I/O must support the
627<constant>VIDIOC_REQBUFS</constant>, <constant>VIDIOC_QBUF</constant>, 626<constant>VIDIOC_REQBUFS</constant>, <constant>VIDIOC_QBUF</constant>,
@@ -654,38 +653,19 @@ plane, are stored in struct <structname>v4l2_plane</structname> instead.
654In that case, struct <structname>v4l2_buffer</structname> contains an array of 653In that case, struct <structname>v4l2_buffer</structname> contains an array of
655plane structures.</para> 654plane structures.</para>
656 655
657 <para>Nominally timestamps refer to the first data byte transmitted. 656 <para>Dequeued video buffers come with timestamps. The driver
658In practice however the wide range of hardware covered by the V4L2 API 657 decides at which part of the frame and with which clock the
659limits timestamp accuracy. Often an interrupt routine will 658 timestamp is taken. Please see flags in the masks
660sample the system clock shortly after the field or frame was stored 659 <constant>V4L2_BUF_FLAG_TIMESTAMP_MASK</constant> and
661completely in memory. So applications must expect a constant 660 <constant>V4L2_BUF_FLAG_TSTAMP_SRC_MASK</constant> in <xref
662difference up to one field or frame period plus a small (few scan 661 linkend="buffer-flags" />. These flags are always valid and constant
663lines) random error. The delay and error can be much 662 across all buffers during the whole video stream. Changes in these
664larger due to compression or transmission over an external bus when 663 flags may take place as a side effect of &VIDIOC-S-INPUT; or
665the frames are not properly stamped by the sender. This is frequently 664 &VIDIOC-S-OUTPUT; however. The
666the case with USB cameras. Here timestamps refer to the instant the 665 <constant>V4L2_BUF_FLAG_TIMESTAMP_COPY</constant> timestamp type
667field or frame was received by the driver, not the capture time. These 666 which is used by e.g. on mem-to-mem devices is an exception to the
668devices identify by not enumerating any video standards, see <xref 667 rule: the timestamp source flags are copied from the OUTPUT video
669linkend="standard" />.</para> 668 buffer to the CAPTURE video buffer.</para>
670
671 <para>Similar limitations apply to output timestamps. Typically
672the video hardware locks to a clock controlling the video timing, the
673horizontal and vertical synchronization pulses. At some point in the
674line sequence, possibly the vertical blanking, an interrupt routine
675samples the system clock, compares against the timestamp and programs
676the hardware to repeat the previous field or frame, or to display the
677buffer contents.</para>
678
679 <para>Apart of limitations of the video device and natural
680inaccuracies of all clocks, it should be noted system time itself is
681not perfectly stable. It can be affected by power saving cycles,
682warped to insert leap seconds, or even turned back or forth by the
683system administrator affecting long term measurements. <footnote>
684 <para>Since no other Linux multimedia
685API supports unadjusted time it would be foolish to introduce here. We
686must use a universally supported clock to synchronize different media,
687hence time of day.</para>
688 </footnote></para>
689 669
690 <table frame="none" pgwide="1" id="v4l2-buffer"> 670 <table frame="none" pgwide="1" id="v4l2-buffer">
691 <title>struct <structname>v4l2_buffer</structname></title> 671 <title>struct <structname>v4l2_buffer</structname></title>
@@ -696,10 +676,11 @@ hence time of day.</para>
696 <entry>__u32</entry> 676 <entry>__u32</entry>
697 <entry><structfield>index</structfield></entry> 677 <entry><structfield>index</structfield></entry>
698 <entry></entry> 678 <entry></entry>
699 <entry>Number of the buffer, set by the application. This 679 <entry>Number of the buffer, set by the application except
700field is only used for <link linkend="mmap">memory mapping</link> I/O 680when calling &VIDIOC-DQBUF;, then it is set by the driver.
701and can range from zero to the number of buffers allocated 681This field can range from zero to the number of buffers allocated
702with the &VIDIOC-REQBUFS; ioctl (&v4l2-requestbuffers; <structfield>count</structfield>) minus one.</entry> 682with the &VIDIOC-REQBUFS; ioctl (&v4l2-requestbuffers; <structfield>count</structfield>),
683plus any buffers allocated with &VIDIOC-CREATE-BUFS; minus one.</entry>
703 </row> 684 </row>
704 <row> 685 <row>
705 <entry>__u32</entry> 686 <entry>__u32</entry>
@@ -718,7 +699,7 @@ linkend="v4l2-buf-type" /></entry>
718buffer. It depends on the negotiated data format and may change with 699buffer. It depends on the negotiated data format and may change with
719each buffer for compressed variable size data like JPEG images. 700each buffer for compressed variable size data like JPEG images.
720Drivers must set this field when <structfield>type</structfield> 701Drivers must set this field when <structfield>type</structfield>
721refers to an input stream, applications when an output stream.</entry> 702refers to an input stream, applications when it refers to an output stream.</entry>
722 </row> 703 </row>
723 <row> 704 <row>
724 <entry>__u32</entry> 705 <entry>__u32</entry>
@@ -735,7 +716,7 @@ linkend="buffer-flags" />.</entry>
735buffer, see <xref linkend="v4l2-field" />. This field is not used when 716buffer, see <xref linkend="v4l2-field" />. This field is not used when
736the buffer contains VBI data. Drivers must set it when 717the buffer contains VBI data. Drivers must set it when
737<structfield>type</structfield> refers to an input stream, 718<structfield>type</structfield> refers to an input stream,
738applications when an output stream.</entry> 719applications when it refers to an output stream.</entry>
739 </row> 720 </row>
740 <row> 721 <row>
741 <entry>struct timeval</entry> 722 <entry>struct timeval</entry>
@@ -745,15 +726,13 @@ applications when an output stream.</entry>
745 byte was captured, as returned by the 726 byte was captured, as returned by the
746 <function>clock_gettime()</function> function for the relevant 727 <function>clock_gettime()</function> function for the relevant
747 clock id; see <constant>V4L2_BUF_FLAG_TIMESTAMP_*</constant> in 728 clock id; see <constant>V4L2_BUF_FLAG_TIMESTAMP_*</constant> in
748 <xref linkend="buffer-flags" />. For output streams the data 729 <xref linkend="buffer-flags" />. For output streams the driver
749 will not be displayed before this time, secondary to the nominal 730 stores the time at which the last data byte was actually sent out
750 frame rate determined by the current video standard in enqueued 731 in the <structfield>timestamp</structfield> field. This permits
751 order. Applications can for example zero this field to display
752 frames as soon as possible. The driver stores the time at which
753 the first data byte was actually sent out in the
754 <structfield>timestamp</structfield> field. This permits
755 applications to monitor the drift between the video and system 732 applications to monitor the drift between the video and system
756 clock.</para></entry> 733 clock. For output streams that use <constant>V4L2_BUF_FLAG_TIMESTAMP_COPY</constant>
734 the application has to fill in the timestamp which will be copied
735 by the driver to the capture stream.</para></entry>
757 </row> 736 </row>
758 <row> 737 <row>
759 <entry>&v4l2-timecode;</entry> 738 <entry>&v4l2-timecode;</entry>
@@ -846,7 +825,8 @@ is the file descriptor associated with a DMABUF buffer.</entry>
846 <entry><structfield>length</structfield></entry> 825 <entry><structfield>length</structfield></entry>
847 <entry></entry> 826 <entry></entry>
848 <entry>Size of the buffer (not the payload) in bytes for the 827 <entry>Size of the buffer (not the payload) in bytes for the
849 single-planar API. For the multi-planar API the application sets 828 single-planar API. This is set by the driver based on the calls to
829 &VIDIOC-REQBUFS; and/or &VIDIOC-CREATE-BUFS;. For the multi-planar API the application sets
850 this to the number of elements in the <structfield>planes</structfield> 830 this to the number of elements in the <structfield>planes</structfield>
851 array. The driver will fill in the actual number of valid elements in 831 array. The driver will fill in the actual number of valid elements in
852 that array. 832 that array.
@@ -880,13 +860,15 @@ should set this to 0.</entry>
880 <entry><structfield>bytesused</structfield></entry> 860 <entry><structfield>bytesused</structfield></entry>
881 <entry></entry> 861 <entry></entry>
882 <entry>The number of bytes occupied by data in the plane 862 <entry>The number of bytes occupied by data in the plane
883 (its payload).</entry> 863 (its payload). Drivers must set this field when <structfield>type</structfield>
864 refers to an input stream, applications when it refers to an output stream.</entry>
884 </row> 865 </row>
885 <row> 866 <row>
886 <entry>__u32</entry> 867 <entry>__u32</entry>
887 <entry><structfield>length</structfield></entry> 868 <entry><structfield>length</structfield></entry>
888 <entry></entry> 869 <entry></entry>
889 <entry>Size in bytes of the plane (not its payload).</entry> 870 <entry>Size in bytes of the plane (not its payload). This is set by the driver
871 based on the calls to &VIDIOC-REQBUFS; and/or &VIDIOC-CREATE-BUFS;.</entry>
890 </row> 872 </row>
891 <row> 873 <row>
892 <entry>union</entry> 874 <entry>union</entry>
@@ -925,7 +907,9 @@ should set this to 0.</entry>
925 <entry>__u32</entry> 907 <entry>__u32</entry>
926 <entry><structfield>data_offset</structfield></entry> 908 <entry><structfield>data_offset</structfield></entry>
927 <entry></entry> 909 <entry></entry>
928 <entry>Offset in bytes to video data in the plane, if applicable. 910 <entry>Offset in bytes to video data in the plane.
911 Drivers must set this field when <structfield>type</structfield>
912 refers to an input stream, applications when it refers to an output stream.
929 </entry> 913 </entry>
930 </row> 914 </row>
931 <row> 915 <row>
@@ -1005,6 +989,12 @@ should set this to 0.</entry>
1005 <entry>Buffer for video output overlay (OSD), see <xref 989 <entry>Buffer for video output overlay (OSD), see <xref
1006 linkend="osd" />.</entry> 990 linkend="osd" />.</entry>
1007 </row> 991 </row>
992 <row>
993 <entry><constant>V4L2_BUF_TYPE_SDR_CAPTURE</constant></entry>
994 <entry>11</entry>
995 <entry>Buffer for Software Defined Radio (SDR), see <xref
996 linkend="sdr" />.</entry>
997 </row>
1008 </tbody> 998 </tbody>
1009 </tgroup> 999 </tgroup>
1010 </table> 1000 </table>
@@ -1016,7 +1006,7 @@ should set this to 0.</entry>
1016 <tbody valign="top"> 1006 <tbody valign="top">
1017 <row> 1007 <row>
1018 <entry><constant>V4L2_BUF_FLAG_MAPPED</constant></entry> 1008 <entry><constant>V4L2_BUF_FLAG_MAPPED</constant></entry>
1019 <entry>0x0001</entry> 1009 <entry>0x00000001</entry>
1020 <entry>The buffer resides in device memory and has been mapped 1010 <entry>The buffer resides in device memory and has been mapped
1021into the application's address space, see <xref linkend="mmap" /> for details. 1011into the application's address space, see <xref linkend="mmap" /> for details.
1022Drivers set or clear this flag when the 1012Drivers set or clear this flag when the
@@ -1026,7 +1016,7 @@ Drivers set or clear this flag when the
1026 </row> 1016 </row>
1027 <row> 1017 <row>
1028 <entry><constant>V4L2_BUF_FLAG_QUEUED</constant></entry> 1018 <entry><constant>V4L2_BUF_FLAG_QUEUED</constant></entry>
1029 <entry>0x0002</entry> 1019 <entry>0x00000002</entry>
1030 <entry>Internally drivers maintain two buffer queues, an 1020 <entry>Internally drivers maintain two buffer queues, an
1031incoming and outgoing queue. When this flag is set, the buffer is 1021incoming and outgoing queue. When this flag is set, the buffer is
1032currently on the incoming queue. It automatically moves to the 1022currently on the incoming queue. It automatically moves to the
@@ -1039,7 +1029,7 @@ cleared.</entry>
1039 </row> 1029 </row>
1040 <row> 1030 <row>
1041 <entry><constant>V4L2_BUF_FLAG_DONE</constant></entry> 1031 <entry><constant>V4L2_BUF_FLAG_DONE</constant></entry>
1042 <entry>0x0004</entry> 1032 <entry>0x00000004</entry>
1043 <entry>When this flag is set, the buffer is currently on 1033 <entry>When this flag is set, the buffer is currently on
1044the outgoing queue, ready to be dequeued from the driver. Drivers set 1034the outgoing queue, ready to be dequeued from the driver. Drivers set
1045or clear this flag when the <constant>VIDIOC_QUERYBUF</constant> ioctl 1035or clear this flag when the <constant>VIDIOC_QUERYBUF</constant> ioctl
@@ -1049,11 +1039,11 @@ buffer cannot be on both queues at the same time, the
1049<constant>V4L2_BUF_FLAG_QUEUED</constant> and 1039<constant>V4L2_BUF_FLAG_QUEUED</constant> and
1050<constant>V4L2_BUF_FLAG_DONE</constant> flag are mutually exclusive. 1040<constant>V4L2_BUF_FLAG_DONE</constant> flag are mutually exclusive.
1051They can be both cleared however, then the buffer is in "dequeued" 1041They can be both cleared however, then the buffer is in "dequeued"
1052state, in the application domain to say so.</entry> 1042state, in the application domain so to say.</entry>
1053 </row> 1043 </row>
1054 <row> 1044 <row>
1055 <entry><constant>V4L2_BUF_FLAG_ERROR</constant></entry> 1045 <entry><constant>V4L2_BUF_FLAG_ERROR</constant></entry>
1056 <entry>0x0040</entry> 1046 <entry>0x00000040</entry>
1057 <entry>When this flag is set, the buffer has been dequeued 1047 <entry>When this flag is set, the buffer has been dequeued
1058 successfully, although the data might have been corrupted. 1048 successfully, although the data might have been corrupted.
1059 This is recoverable, streaming may continue as normal and 1049 This is recoverable, streaming may continue as normal and
@@ -1063,35 +1053,43 @@ state, in the application domain to say so.</entry>
1063 </row> 1053 </row>
1064 <row> 1054 <row>
1065 <entry><constant>V4L2_BUF_FLAG_KEYFRAME</constant></entry> 1055 <entry><constant>V4L2_BUF_FLAG_KEYFRAME</constant></entry>
1066 <entry>0x0008</entry> 1056 <entry>0x00000008</entry>
1067 <entry>Drivers set or clear this flag when calling the 1057 <entry>Drivers set or clear this flag when calling the
1068<constant>VIDIOC_DQBUF</constant> ioctl. It may be set by video 1058<constant>VIDIOC_DQBUF</constant> ioctl. It may be set by video
1069capture devices when the buffer contains a compressed image which is a 1059capture devices when the buffer contains a compressed image which is a
1070key frame (or field), &ie; can be decompressed on its own.</entry> 1060key frame (or field), &ie; can be decompressed on its own. Also know as
1061an I-frame. Applications can set this bit when <structfield>type</structfield>
1062refers to an output stream.</entry>
1071 </row> 1063 </row>
1072 <row> 1064 <row>
1073 <entry><constant>V4L2_BUF_FLAG_PFRAME</constant></entry> 1065 <entry><constant>V4L2_BUF_FLAG_PFRAME</constant></entry>
1074 <entry>0x0010</entry> 1066 <entry>0x00000010</entry>
1075 <entry>Similar to <constant>V4L2_BUF_FLAG_KEYFRAME</constant> 1067 <entry>Similar to <constant>V4L2_BUF_FLAG_KEYFRAME</constant>
1076this flags predicted frames or fields which contain only differences to a 1068this flags predicted frames or fields which contain only differences to a
1077previous key frame.</entry> 1069previous key frame. Applications can set this bit when <structfield>type</structfield>
1070refers to an output stream.</entry>
1078 </row> 1071 </row>
1079 <row> 1072 <row>
1080 <entry><constant>V4L2_BUF_FLAG_BFRAME</constant></entry> 1073 <entry><constant>V4L2_BUF_FLAG_BFRAME</constant></entry>
1081 <entry>0x0020</entry> 1074 <entry>0x00000020</entry>
1082 <entry>Similar to <constant>V4L2_BUF_FLAG_PFRAME</constant> 1075 <entry>Similar to <constant>V4L2_BUF_FLAG_KEYFRAME</constant>
1083 this is a bidirectional predicted frame or field. [ooc tbd]</entry> 1076this flags a bi-directional predicted frame or field which contains only
1077the differences between the current frame and both the preceding and following
1078key frames to specify its content. Applications can set this bit when
1079<structfield>type</structfield> refers to an output stream.</entry>
1084 </row> 1080 </row>
1085 <row> 1081 <row>
1086 <entry><constant>V4L2_BUF_FLAG_TIMECODE</constant></entry> 1082 <entry><constant>V4L2_BUF_FLAG_TIMECODE</constant></entry>
1087 <entry>0x0100</entry> 1083 <entry>0x00000100</entry>
1088 <entry>The <structfield>timecode</structfield> field is valid. 1084 <entry>The <structfield>timecode</structfield> field is valid.
1089Drivers set or clear this flag when the <constant>VIDIOC_DQBUF</constant> 1085Drivers set or clear this flag when the <constant>VIDIOC_DQBUF</constant>
1090ioctl is called.</entry> 1086ioctl is called. Applications can set this bit and the corresponding
1087<structfield>timecode</structfield> structure when <structfield>type</structfield>
1088refers to an output stream.</entry>
1091 </row> 1089 </row>
1092 <row> 1090 <row>
1093 <entry><constant>V4L2_BUF_FLAG_PREPARED</constant></entry> 1091 <entry><constant>V4L2_BUF_FLAG_PREPARED</constant></entry>
1094 <entry>0x0400</entry> 1092 <entry>0x00000400</entry>
1095 <entry>The buffer has been prepared for I/O and can be queued by the 1093 <entry>The buffer has been prepared for I/O and can be queued by the
1096application. Drivers set or clear this flag when the 1094application. Drivers set or clear this flag when the
1097<link linkend="vidioc-querybuf">VIDIOC_QUERYBUF</link>, <link 1095<link linkend="vidioc-querybuf">VIDIOC_QUERYBUF</link>, <link
@@ -1101,7 +1099,7 @@ application. Drivers set or clear this flag when the
1101 </row> 1099 </row>
1102 <row> 1100 <row>
1103 <entry><constant>V4L2_BUF_FLAG_NO_CACHE_INVALIDATE</constant></entry> 1101 <entry><constant>V4L2_BUF_FLAG_NO_CACHE_INVALIDATE</constant></entry>
1104 <entry>0x0800</entry> 1102 <entry>0x00000800</entry>
1105 <entry>Caches do not have to be invalidated for this buffer. 1103 <entry>Caches do not have to be invalidated for this buffer.
1106Typically applications shall use this flag if the data captured in the buffer 1104Typically applications shall use this flag if the data captured in the buffer
1107is not going to be touched by the CPU, instead the buffer will, probably, be 1105is not going to be touched by the CPU, instead the buffer will, probably, be
@@ -1110,7 +1108,7 @@ passed on to a DMA-capable hardware unit for further processing or output.
1110 </row> 1108 </row>
1111 <row> 1109 <row>
1112 <entry><constant>V4L2_BUF_FLAG_NO_CACHE_CLEAN</constant></entry> 1110 <entry><constant>V4L2_BUF_FLAG_NO_CACHE_CLEAN</constant></entry>
1113 <entry>0x1000</entry> 1111 <entry>0x00001000</entry>
1114 <entry>Caches do not have to be cleaned for this buffer. 1112 <entry>Caches do not have to be cleaned for this buffer.
1115Typically applications shall use this flag for output buffers if the data 1113Typically applications shall use this flag for output buffers if the data
1116in this buffer has not been created by the CPU but by some DMA-capable unit, 1114in this buffer has not been created by the CPU but by some DMA-capable unit,
@@ -1118,7 +1116,7 @@ in which case caches have not been used.</entry>
1118 </row> 1116 </row>
1119 <row> 1117 <row>
1120 <entry><constant>V4L2_BUF_FLAG_TIMESTAMP_MASK</constant></entry> 1118 <entry><constant>V4L2_BUF_FLAG_TIMESTAMP_MASK</constant></entry>
1121 <entry>0xe000</entry> 1119 <entry>0x0000e000</entry>
1122 <entry>Mask for timestamp types below. To test the 1120 <entry>Mask for timestamp types below. To test the
1123 timestamp type, mask out bits not belonging to timestamp 1121 timestamp type, mask out bits not belonging to timestamp
1124 type by performing a logical and operation with buffer 1122 type by performing a logical and operation with buffer
@@ -1126,7 +1124,7 @@ in which case caches have not been used.</entry>
1126 </row> 1124 </row>
1127 <row> 1125 <row>
1128 <entry><constant>V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN</constant></entry> 1126 <entry><constant>V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN</constant></entry>
1129 <entry>0x0000</entry> 1127 <entry>0x00000000</entry>
1130 <entry>Unknown timestamp type. This type is used by 1128 <entry>Unknown timestamp type. This type is used by
1131 drivers before Linux 3.9 and may be either monotonic (see 1129 drivers before Linux 3.9 and may be either monotonic (see
1132 below) or realtime (wall clock). Monotonic clock has been 1130 below) or realtime (wall clock). Monotonic clock has been
@@ -1139,7 +1137,7 @@ in which case caches have not been used.</entry>
1139 </row> 1137 </row>
1140 <row> 1138 <row>
1141 <entry><constant>V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC</constant></entry> 1139 <entry><constant>V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC</constant></entry>
1142 <entry>0x2000</entry> 1140 <entry>0x00002000</entry>
1143 <entry>The buffer timestamp has been taken from the 1141 <entry>The buffer timestamp has been taken from the
1144 <constant>CLOCK_MONOTONIC</constant> clock. To access the 1142 <constant>CLOCK_MONOTONIC</constant> clock. To access the
1145 same clock outside V4L2, use 1143 same clock outside V4L2, use
@@ -1147,10 +1145,42 @@ in which case caches have not been used.</entry>
1147 </row> 1145 </row>
1148 <row> 1146 <row>
1149 <entry><constant>V4L2_BUF_FLAG_TIMESTAMP_COPY</constant></entry> 1147 <entry><constant>V4L2_BUF_FLAG_TIMESTAMP_COPY</constant></entry>
1150 <entry>0x4000</entry> 1148 <entry>0x00004000</entry>
1151 <entry>The CAPTURE buffer timestamp has been taken from the 1149 <entry>The CAPTURE buffer timestamp has been taken from the
1152 corresponding OUTPUT buffer. This flag applies only to mem2mem devices.</entry> 1150 corresponding OUTPUT buffer. This flag applies only to mem2mem devices.</entry>
1153 </row> 1151 </row>
1152 <row>
1153 <entry><constant>V4L2_BUF_FLAG_TSTAMP_SRC_MASK</constant></entry>
1154 <entry>0x00070000</entry>
1155 <entry>Mask for timestamp sources below. The timestamp source
1156 defines the point of time the timestamp is taken in relation to
1157 the frame. Logical 'and' operation between the
1158 <structfield>flags</structfield> field and
1159 <constant>V4L2_BUF_FLAG_TSTAMP_SRC_MASK</constant> produces the
1160 value of the timestamp source. Applications must set the timestamp
1161 source when <structfield>type</structfield> refers to an output stream
1162 and <constant>V4L2_BUF_FLAG_TIMESTAMP_COPY</constant> is set.</entry>
1163 </row>
1164 <row>
1165 <entry><constant>V4L2_BUF_FLAG_TSTAMP_SRC_EOF</constant></entry>
1166 <entry>0x00000000</entry>
1167 <entry>End Of Frame. The buffer timestamp has been taken
1168 when the last pixel of the frame has been received or the
1169 last pixel of the frame has been transmitted. In practice,
1170 software generated timestamps will typically be read from
1171 the clock a small amount of time after the last pixel has
1172 been received or transmitten, depending on the system and
1173 other activity in it.</entry>
1174 </row>
1175 <row>
1176 <entry><constant>V4L2_BUF_FLAG_TSTAMP_SRC_SOE</constant></entry>
1177 <entry>0x00010000</entry>
1178 <entry>Start Of Exposure. The buffer timestamp has been
1179 taken when the exposure of the frame has begun. This is
1180 only valid for the
1181 <constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant> buffer
1182 type.</entry>
1183 </row>
1154 </tbody> 1184 </tbody>
1155 </tgroup> 1185 </tgroup>
1156 </table> 1186 </table>
@@ -1440,10 +1470,9 @@ or application, depending on data direction, must set &v4l2-buffer;
1440<constant>V4L2_FIELD_BOTTOM</constant>. Any two successive fields pair 1470<constant>V4L2_FIELD_BOTTOM</constant>. Any two successive fields pair
1441to build a frame. If fields are successive, without any dropped fields 1471to build a frame. If fields are successive, without any dropped fields
1442between them (fields can drop individually), can be determined from 1472between them (fields can drop individually), can be determined from
1443the &v4l2-buffer; <structfield>sequence</structfield> field. Image 1473the &v4l2-buffer; <structfield>sequence</structfield> field. This format
1444sizes refer to the frame, not fields. This format cannot be selected 1474cannot be selected when using the read/write I/O method since there
1445when using the read/write I/O method.<!-- Where it's indistinguishable 1475is no way to communicate if a field was a top or bottom field.</entry>
1446from V4L2_FIELD_SEQ_*. --></entry>
1447 </row> 1476 </row>
1448 <row> 1477 <row>
1449 <entry><constant>V4L2_FIELD_INTERLACED_TB</constant></entry> 1478 <entry><constant>V4L2_FIELD_INTERLACED_TB</constant></entry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-nv16m.xml b/Documentation/DocBook/media/v4l/pixfmt-nv16m.xml
index c51d5a4cda09..fb2b5e35d665 100644
--- a/Documentation/DocBook/media/v4l/pixfmt-nv16m.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt-nv16m.xml
@@ -12,18 +12,17 @@
12 <refsect1> 12 <refsect1>
13 <title>Description</title> 13 <title>Description</title>
14 14
15 <para>This is a multi-planar, two-plane version of the YUV 4:2:0 format. 15 <para>This is a multi-planar, two-plane version of the YUV 4:2:2 format.
16The three components are separated into two sub-images or planes. 16The three components are separated into two sub-images or planes.
17<constant>V4L2_PIX_FMT_NV16M</constant> differs from <constant>V4L2_PIX_FMT_NV16 17<constant>V4L2_PIX_FMT_NV16M</constant> differs from <constant>V4L2_PIX_FMT_NV16
18</constant> in that the two planes are non-contiguous in memory, i.e. the chroma 18</constant> in that the two planes are non-contiguous in memory, i.e. the chroma
19plane does not necessarily immediately follows the luma plane. 19plane does not necessarily immediately follow the luma plane.
20The luminance data occupies the first plane. The Y plane has one byte per pixel. 20The luminance data occupies the first plane. The Y plane has one byte per pixel.
21In the second plane there is chrominance data with alternating chroma samples. 21In the second plane there is chrominance data with alternating chroma samples.
22The CbCr plane is the same width and height, in bytes, as the Y plane. 22The CbCr plane is the same width and height, in bytes, as the Y plane.
23Each CbCr pair belongs to four pixels. For example, 23Each CbCr pair belongs to two pixels. For example,
24Cb<subscript>0</subscript>/Cr<subscript>0</subscript> belongs to 24Cb<subscript>0</subscript>/Cr<subscript>0</subscript> belongs to
25Y'<subscript>00</subscript>, Y'<subscript>01</subscript>, 25Y'<subscript>00</subscript>, Y'<subscript>01</subscript>.
26Y'<subscript>10</subscript>, Y'<subscript>11</subscript>.
27<constant>V4L2_PIX_FMT_NV61M</constant> is the same as <constant>V4L2_PIX_FMT_NV16M</constant> 26<constant>V4L2_PIX_FMT_NV61M</constant> is the same as <constant>V4L2_PIX_FMT_NV16M</constant>
28except the Cb and Cr bytes are swapped, the CrCb plane starts with a Cr byte.</para> 27except the Cb and Cr bytes are swapped, the CrCb plane starts with a Cr byte.</para>
29 28
diff --git a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
index 166c8d65e4f7..e1c4f8b4c0b3 100644
--- a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml
@@ -121,14 +121,14 @@ colorspace <constant>V4L2_COLORSPACE_SRGB</constant>.</para>
121 <entry><constant>V4L2_PIX_FMT_RGB332</constant></entry> 121 <entry><constant>V4L2_PIX_FMT_RGB332</constant></entry>
122 <entry>'RGB1'</entry> 122 <entry>'RGB1'</entry>
123 <entry></entry> 123 <entry></entry>
124 <entry>b<subscript>1</subscript></entry>
125 <entry>b<subscript>0</subscript></entry>
126 <entry>g<subscript>2</subscript></entry>
127 <entry>g<subscript>1</subscript></entry>
128 <entry>g<subscript>0</subscript></entry>
129 <entry>r<subscript>2</subscript></entry> 124 <entry>r<subscript>2</subscript></entry>
130 <entry>r<subscript>1</subscript></entry> 125 <entry>r<subscript>1</subscript></entry>
131 <entry>r<subscript>0</subscript></entry> 126 <entry>r<subscript>0</subscript></entry>
127 <entry>g<subscript>2</subscript></entry>
128 <entry>g<subscript>1</subscript></entry>
129 <entry>g<subscript>0</subscript></entry>
130 <entry>b<subscript>1</subscript></entry>
131 <entry>b<subscript>0</subscript></entry>
132 </row> 132 </row>
133 <row id="V4L2-PIX-FMT-RGB444"> 133 <row id="V4L2-PIX-FMT-RGB444">
134 <entry><constant>V4L2_PIX_FMT_RGB444</constant></entry> 134 <entry><constant>V4L2_PIX_FMT_RGB444</constant></entry>
@@ -159,18 +159,18 @@ colorspace <constant>V4L2_COLORSPACE_SRGB</constant>.</para>
159 <entry>g<subscript>2</subscript></entry> 159 <entry>g<subscript>2</subscript></entry>
160 <entry>g<subscript>1</subscript></entry> 160 <entry>g<subscript>1</subscript></entry>
161 <entry>g<subscript>0</subscript></entry> 161 <entry>g<subscript>0</subscript></entry>
162 <entry>r<subscript>4</subscript></entry>
163 <entry>r<subscript>3</subscript></entry>
164 <entry>r<subscript>2</subscript></entry>
165 <entry>r<subscript>1</subscript></entry>
166 <entry>r<subscript>0</subscript></entry>
167 <entry></entry>
168 <entry>a</entry>
169 <entry>b<subscript>4</subscript></entry> 162 <entry>b<subscript>4</subscript></entry>
170 <entry>b<subscript>3</subscript></entry> 163 <entry>b<subscript>3</subscript></entry>
171 <entry>b<subscript>2</subscript></entry> 164 <entry>b<subscript>2</subscript></entry>
172 <entry>b<subscript>1</subscript></entry> 165 <entry>b<subscript>1</subscript></entry>
173 <entry>b<subscript>0</subscript></entry> 166 <entry>b<subscript>0</subscript></entry>
167 <entry></entry>
168 <entry>a</entry>
169 <entry>r<subscript>4</subscript></entry>
170 <entry>r<subscript>3</subscript></entry>
171 <entry>r<subscript>2</subscript></entry>
172 <entry>r<subscript>1</subscript></entry>
173 <entry>r<subscript>0</subscript></entry>
174 <entry>g<subscript>4</subscript></entry> 174 <entry>g<subscript>4</subscript></entry>
175 <entry>g<subscript>3</subscript></entry> 175 <entry>g<subscript>3</subscript></entry>
176 </row> 176 </row>
@@ -181,17 +181,17 @@ colorspace <constant>V4L2_COLORSPACE_SRGB</constant>.</para>
181 <entry>g<subscript>2</subscript></entry> 181 <entry>g<subscript>2</subscript></entry>
182 <entry>g<subscript>1</subscript></entry> 182 <entry>g<subscript>1</subscript></entry>
183 <entry>g<subscript>0</subscript></entry> 183 <entry>g<subscript>0</subscript></entry>
184 <entry>r<subscript>4</subscript></entry>
185 <entry>r<subscript>3</subscript></entry>
186 <entry>r<subscript>2</subscript></entry>
187 <entry>r<subscript>1</subscript></entry>
188 <entry>r<subscript>0</subscript></entry>
189 <entry></entry>
190 <entry>b<subscript>4</subscript></entry> 184 <entry>b<subscript>4</subscript></entry>
191 <entry>b<subscript>3</subscript></entry> 185 <entry>b<subscript>3</subscript></entry>
192 <entry>b<subscript>2</subscript></entry> 186 <entry>b<subscript>2</subscript></entry>
193 <entry>b<subscript>1</subscript></entry> 187 <entry>b<subscript>1</subscript></entry>
194 <entry>b<subscript>0</subscript></entry> 188 <entry>b<subscript>0</subscript></entry>
189 <entry></entry>
190 <entry>r<subscript>4</subscript></entry>
191 <entry>r<subscript>3</subscript></entry>
192 <entry>r<subscript>2</subscript></entry>
193 <entry>r<subscript>1</subscript></entry>
194 <entry>r<subscript>0</subscript></entry>
195 <entry>g<subscript>5</subscript></entry> 195 <entry>g<subscript>5</subscript></entry>
196 <entry>g<subscript>4</subscript></entry> 196 <entry>g<subscript>4</subscript></entry>
197 <entry>g<subscript>3</subscript></entry> 197 <entry>g<subscript>3</subscript></entry>
@@ -201,32 +201,32 @@ colorspace <constant>V4L2_COLORSPACE_SRGB</constant>.</para>
201 <entry>'RGBQ'</entry> 201 <entry>'RGBQ'</entry>
202 <entry></entry> 202 <entry></entry>
203 <entry>a</entry> 203 <entry>a</entry>
204 <entry>b<subscript>4</subscript></entry>
205 <entry>b<subscript>3</subscript></entry>
206 <entry>b<subscript>2</subscript></entry>
207 <entry>b<subscript>1</subscript></entry>
208 <entry>b<subscript>0</subscript></entry>
209 <entry>g<subscript>4</subscript></entry>
210 <entry>g<subscript>3</subscript></entry>
211 <entry></entry>
212 <entry>g<subscript>2</subscript></entry>
213 <entry>g<subscript>1</subscript></entry>
214 <entry>g<subscript>0</subscript></entry>
215 <entry>r<subscript>4</subscript></entry> 204 <entry>r<subscript>4</subscript></entry>
216 <entry>r<subscript>3</subscript></entry> 205 <entry>r<subscript>3</subscript></entry>
217 <entry>r<subscript>2</subscript></entry> 206 <entry>r<subscript>2</subscript></entry>
218 <entry>r<subscript>1</subscript></entry> 207 <entry>r<subscript>1</subscript></entry>
219 <entry>r<subscript>0</subscript></entry> 208 <entry>r<subscript>0</subscript></entry>
220 </row> 209 <entry>g<subscript>4</subscript></entry>
221 <row id="V4L2-PIX-FMT-RGB565X"> 210 <entry>g<subscript>3</subscript></entry>
222 <entry><constant>V4L2_PIX_FMT_RGB565X</constant></entry>
223 <entry>'RGBR'</entry>
224 <entry></entry> 211 <entry></entry>
212 <entry>g<subscript>2</subscript></entry>
213 <entry>g<subscript>1</subscript></entry>
214 <entry>g<subscript>0</subscript></entry>
225 <entry>b<subscript>4</subscript></entry> 215 <entry>b<subscript>4</subscript></entry>
226 <entry>b<subscript>3</subscript></entry> 216 <entry>b<subscript>3</subscript></entry>
227 <entry>b<subscript>2</subscript></entry> 217 <entry>b<subscript>2</subscript></entry>
228 <entry>b<subscript>1</subscript></entry> 218 <entry>b<subscript>1</subscript></entry>
229 <entry>b<subscript>0</subscript></entry> 219 <entry>b<subscript>0</subscript></entry>
220 </row>
221 <row id="V4L2-PIX-FMT-RGB565X">
222 <entry><constant>V4L2_PIX_FMT_RGB565X</constant></entry>
223 <entry>'RGBR'</entry>
224 <entry></entry>
225 <entry>r<subscript>4</subscript></entry>
226 <entry>r<subscript>3</subscript></entry>
227 <entry>r<subscript>2</subscript></entry>
228 <entry>r<subscript>1</subscript></entry>
229 <entry>r<subscript>0</subscript></entry>
230 <entry>g<subscript>5</subscript></entry> 230 <entry>g<subscript>5</subscript></entry>
231 <entry>g<subscript>4</subscript></entry> 231 <entry>g<subscript>4</subscript></entry>
232 <entry>g<subscript>3</subscript></entry> 232 <entry>g<subscript>3</subscript></entry>
@@ -234,11 +234,11 @@ colorspace <constant>V4L2_COLORSPACE_SRGB</constant>.</para>
234 <entry>g<subscript>2</subscript></entry> 234 <entry>g<subscript>2</subscript></entry>
235 <entry>g<subscript>1</subscript></entry> 235 <entry>g<subscript>1</subscript></entry>
236 <entry>g<subscript>0</subscript></entry> 236 <entry>g<subscript>0</subscript></entry>
237 <entry>r<subscript>4</subscript></entry> 237 <entry>b<subscript>4</subscript></entry>
238 <entry>r<subscript>3</subscript></entry> 238 <entry>b<subscript>3</subscript></entry>
239 <entry>r<subscript>2</subscript></entry> 239 <entry>b<subscript>2</subscript></entry>
240 <entry>r<subscript>1</subscript></entry> 240 <entry>b<subscript>1</subscript></entry>
241 <entry>r<subscript>0</subscript></entry> 241 <entry>b<subscript>0</subscript></entry>
242 </row> 242 </row>
243 <row id="V4L2-PIX-FMT-BGR666"> 243 <row id="V4L2-PIX-FMT-BGR666">
244 <entry><constant>V4L2_PIX_FMT_BGR666</constant></entry> 244 <entry><constant>V4L2_PIX_FMT_BGR666</constant></entry>
@@ -385,6 +385,15 @@ colorspace <constant>V4L2_COLORSPACE_SRGB</constant>.</para>
385 <entry><constant>V4L2_PIX_FMT_RGB32</constant></entry> 385 <entry><constant>V4L2_PIX_FMT_RGB32</constant></entry>
386 <entry>'RGB4'</entry> 386 <entry>'RGB4'</entry>
387 <entry></entry> 387 <entry></entry>
388 <entry>a<subscript>7</subscript></entry>
389 <entry>a<subscript>6</subscript></entry>
390 <entry>a<subscript>5</subscript></entry>
391 <entry>a<subscript>4</subscript></entry>
392 <entry>a<subscript>3</subscript></entry>
393 <entry>a<subscript>2</subscript></entry>
394 <entry>a<subscript>1</subscript></entry>
395 <entry>a<subscript>0</subscript></entry>
396 <entry></entry>
388 <entry>r<subscript>7</subscript></entry> 397 <entry>r<subscript>7</subscript></entry>
389 <entry>r<subscript>6</subscript></entry> 398 <entry>r<subscript>6</subscript></entry>
390 <entry>r<subscript>5</subscript></entry> 399 <entry>r<subscript>5</subscript></entry>
@@ -411,25 +420,16 @@ colorspace <constant>V4L2_COLORSPACE_SRGB</constant>.</para>
411 <entry>b<subscript>2</subscript></entry> 420 <entry>b<subscript>2</subscript></entry>
412 <entry>b<subscript>1</subscript></entry> 421 <entry>b<subscript>1</subscript></entry>
413 <entry>b<subscript>0</subscript></entry> 422 <entry>b<subscript>0</subscript></entry>
414 <entry></entry>
415 <entry>a<subscript>7</subscript></entry>
416 <entry>a<subscript>6</subscript></entry>
417 <entry>a<subscript>5</subscript></entry>
418 <entry>a<subscript>4</subscript></entry>
419 <entry>a<subscript>3</subscript></entry>
420 <entry>a<subscript>2</subscript></entry>
421 <entry>a<subscript>1</subscript></entry>
422 <entry>a<subscript>0</subscript></entry>
423 </row> 423 </row>
424 </tbody> 424 </tbody>
425 </tgroup> 425 </tgroup>
426 </table> 426 </table>
427 427
428 <para>Bit 7 is the most significant bit. The value of a = alpha 428 <para>Bit 7 is the most significant bit. The value of the a = alpha
429bits is undefined when reading from the driver, ignored when writing 429bits is undefined when reading from the driver, ignored when writing
430to the driver, except when alpha blending has been negotiated for a 430to the driver, except when alpha blending has been negotiated for a
431<link linkend="overlay">Video Overlay</link> or <link linkend="osd"> 431<link linkend="overlay">Video Overlay</link> or <link linkend="osd">
432Video Output Overlay</link> or when alpha component has been configured 432Video Output Overlay</link> or when the alpha component has been configured
433for a <link linkend="capture">Video Capture</link> by means of <link 433for a <link linkend="capture">Video Capture</link> by means of <link
434linkend="v4l2-alpha-component"> <constant>V4L2_CID_ALPHA_COMPONENT 434linkend="v4l2-alpha-component"> <constant>V4L2_CID_ALPHA_COMPONENT
435</constant> </link> control.</para> 435</constant> </link> control.</para>
@@ -512,421 +512,6 @@ image</title>
512 </formalpara> 512 </formalpara>
513 </example> 513 </example>
514 514
515 <important>
516 <para>Drivers may interpret these formats differently.</para>
517 </important>
518
519 <para>Some RGB formats above are uncommon and were probably
520defined in error. Drivers may interpret them as in <xref
521 linkend="rgb-formats-corrected" />.</para>
522
523 <table pgwide="1" frame="none" id="rgb-formats-corrected">
524 <title>Packed RGB Image Formats (corrected)</title>
525 <tgroup cols="37" align="center">
526 <colspec colname="id" align="left" />
527 <colspec colname="fourcc" />
528 <colspec colname="bit" />
529
530 <colspec colnum="4" colname="b07" align="center" />
531 <colspec colnum="5" colname="b06" align="center" />
532 <colspec colnum="6" colname="b05" align="center" />
533 <colspec colnum="7" colname="b04" align="center" />
534 <colspec colnum="8" colname="b03" align="center" />
535 <colspec colnum="9" colname="b02" align="center" />
536 <colspec colnum="10" colname="b01" align="center" />
537 <colspec colnum="11" colname="b00" align="center" />
538
539 <colspec colnum="13" colname="b17" align="center" />
540 <colspec colnum="14" colname="b16" align="center" />
541 <colspec colnum="15" colname="b15" align="center" />
542 <colspec colnum="16" colname="b14" align="center" />
543 <colspec colnum="17" colname="b13" align="center" />
544 <colspec colnum="18" colname="b12" align="center" />
545 <colspec colnum="19" colname="b11" align="center" />
546 <colspec colnum="20" colname="b10" align="center" />
547
548 <colspec colnum="22" colname="b27" align="center" />
549 <colspec colnum="23" colname="b26" align="center" />
550 <colspec colnum="24" colname="b25" align="center" />
551 <colspec colnum="25" colname="b24" align="center" />
552 <colspec colnum="26" colname="b23" align="center" />
553 <colspec colnum="27" colname="b22" align="center" />
554 <colspec colnum="28" colname="b21" align="center" />
555 <colspec colnum="29" colname="b20" align="center" />
556
557 <colspec colnum="31" colname="b37" align="center" />
558 <colspec colnum="32" colname="b36" align="center" />
559 <colspec colnum="33" colname="b35" align="center" />
560 <colspec colnum="34" colname="b34" align="center" />
561 <colspec colnum="35" colname="b33" align="center" />
562 <colspec colnum="36" colname="b32" align="center" />
563 <colspec colnum="37" colname="b31" align="center" />
564 <colspec colnum="38" colname="b30" align="center" />
565
566 <spanspec namest="b07" nameend="b00" spanname="b0" />
567 <spanspec namest="b17" nameend="b10" spanname="b1" />
568 <spanspec namest="b27" nameend="b20" spanname="b2" />
569 <spanspec namest="b37" nameend="b30" spanname="b3" />
570 <thead>
571 <row>
572 <entry>Identifier</entry>
573 <entry>Code</entry>
574 <entry>&nbsp;</entry>
575 <entry spanname="b0">Byte&nbsp;0 in memory</entry>
576 <entry spanname="b1">Byte&nbsp;1</entry>
577 <entry spanname="b2">Byte&nbsp;2</entry>
578 <entry spanname="b3">Byte&nbsp;3</entry>
579 </row>
580 <row>
581 <entry>&nbsp;</entry>
582 <entry>&nbsp;</entry>
583 <entry>Bit</entry>
584 <entry>7</entry>
585 <entry>6</entry>
586 <entry>5</entry>
587 <entry>4</entry>
588 <entry>3</entry>
589 <entry>2</entry>
590 <entry>1</entry>
591 <entry>0</entry>
592 <entry>&nbsp;</entry>
593 <entry>7</entry>
594 <entry>6</entry>
595 <entry>5</entry>
596 <entry>4</entry>
597 <entry>3</entry>
598 <entry>2</entry>
599 <entry>1</entry>
600 <entry>0</entry>
601 <entry>&nbsp;</entry>
602 <entry>7</entry>
603 <entry>6</entry>
604 <entry>5</entry>
605 <entry>4</entry>
606 <entry>3</entry>
607 <entry>2</entry>
608 <entry>1</entry>
609 <entry>0</entry>
610 <entry>&nbsp;</entry>
611 <entry>7</entry>
612 <entry>6</entry>
613 <entry>5</entry>
614 <entry>4</entry>
615 <entry>3</entry>
616 <entry>2</entry>
617 <entry>1</entry>
618 <entry>0</entry>
619 </row>
620 </thead>
621 <tbody valign="top">
622 <row><!-- id="V4L2-PIX-FMT-RGB332" -->
623 <entry><constant>V4L2_PIX_FMT_RGB332</constant></entry>
624 <entry>'RGB1'</entry>
625 <entry></entry>
626 <entry>r<subscript>2</subscript></entry>
627 <entry>r<subscript>1</subscript></entry>
628 <entry>r<subscript>0</subscript></entry>
629 <entry>g<subscript>2</subscript></entry>
630 <entry>g<subscript>1</subscript></entry>
631 <entry>g<subscript>0</subscript></entry>
632 <entry>b<subscript>1</subscript></entry>
633 <entry>b<subscript>0</subscript></entry>
634 </row>
635 <row><!-- id="V4L2-PIX-FMT-RGB444" -->
636 <entry><constant>V4L2_PIX_FMT_RGB444</constant></entry>
637 <entry>'R444'</entry>
638 <entry></entry>
639 <entry>g<subscript>3</subscript></entry>
640 <entry>g<subscript>2</subscript></entry>
641 <entry>g<subscript>1</subscript></entry>
642 <entry>g<subscript>0</subscript></entry>
643 <entry>b<subscript>3</subscript></entry>
644 <entry>b<subscript>2</subscript></entry>
645 <entry>b<subscript>1</subscript></entry>
646 <entry>b<subscript>0</subscript></entry>
647 <entry></entry>
648 <entry>a<subscript>3</subscript></entry>
649 <entry>a<subscript>2</subscript></entry>
650 <entry>a<subscript>1</subscript></entry>
651 <entry>a<subscript>0</subscript></entry>
652 <entry>r<subscript>3</subscript></entry>
653 <entry>r<subscript>2</subscript></entry>
654 <entry>r<subscript>1</subscript></entry>
655 <entry>r<subscript>0</subscript></entry>
656 </row>
657 <row><!-- id="V4L2-PIX-FMT-RGB555" -->
658 <entry><constant>V4L2_PIX_FMT_RGB555</constant></entry>
659 <entry>'RGBO'</entry>
660 <entry></entry>
661 <entry>g<subscript>2</subscript></entry>
662 <entry>g<subscript>1</subscript></entry>
663 <entry>g<subscript>0</subscript></entry>
664 <entry>b<subscript>4</subscript></entry>
665 <entry>b<subscript>3</subscript></entry>
666 <entry>b<subscript>2</subscript></entry>
667 <entry>b<subscript>1</subscript></entry>
668 <entry>b<subscript>0</subscript></entry>
669 <entry></entry>
670 <entry>a</entry>
671 <entry>r<subscript>4</subscript></entry>
672 <entry>r<subscript>3</subscript></entry>
673 <entry>r<subscript>2</subscript></entry>
674 <entry>r<subscript>1</subscript></entry>
675 <entry>r<subscript>0</subscript></entry>
676 <entry>g<subscript>4</subscript></entry>
677 <entry>g<subscript>3</subscript></entry>
678 </row>
679 <row><!-- id="V4L2-PIX-FMT-RGB565" -->
680 <entry><constant>V4L2_PIX_FMT_RGB565</constant></entry>
681 <entry>'RGBP'</entry>
682 <entry></entry>
683 <entry>g<subscript>2</subscript></entry>
684 <entry>g<subscript>1</subscript></entry>
685 <entry>g<subscript>0</subscript></entry>
686 <entry>b<subscript>4</subscript></entry>
687 <entry>b<subscript>3</subscript></entry>
688 <entry>b<subscript>2</subscript></entry>
689 <entry>b<subscript>1</subscript></entry>
690 <entry>b<subscript>0</subscript></entry>
691 <entry></entry>
692 <entry>r<subscript>4</subscript></entry>
693 <entry>r<subscript>3</subscript></entry>
694 <entry>r<subscript>2</subscript></entry>
695 <entry>r<subscript>1</subscript></entry>
696 <entry>r<subscript>0</subscript></entry>
697 <entry>g<subscript>5</subscript></entry>
698 <entry>g<subscript>4</subscript></entry>
699 <entry>g<subscript>3</subscript></entry>
700 </row>
701 <row><!-- id="V4L2-PIX-FMT-RGB555X" -->
702 <entry><constant>V4L2_PIX_FMT_RGB555X</constant></entry>
703 <entry>'RGBQ'</entry>
704 <entry></entry>
705 <entry>a</entry>
706 <entry>r<subscript>4</subscript></entry>
707 <entry>r<subscript>3</subscript></entry>
708 <entry>r<subscript>2</subscript></entry>
709 <entry>r<subscript>1</subscript></entry>
710 <entry>r<subscript>0</subscript></entry>
711 <entry>g<subscript>4</subscript></entry>
712 <entry>g<subscript>3</subscript></entry>
713 <entry></entry>
714 <entry>g<subscript>2</subscript></entry>
715 <entry>g<subscript>1</subscript></entry>
716 <entry>g<subscript>0</subscript></entry>
717 <entry>b<subscript>4</subscript></entry>
718 <entry>b<subscript>3</subscript></entry>
719 <entry>b<subscript>2</subscript></entry>
720 <entry>b<subscript>1</subscript></entry>
721 <entry>b<subscript>0</subscript></entry>
722 </row>
723 <row><!-- id="V4L2-PIX-FMT-RGB565X" -->
724 <entry><constant>V4L2_PIX_FMT_RGB565X</constant></entry>
725 <entry>'RGBR'</entry>
726 <entry></entry>
727 <entry>r<subscript>4</subscript></entry>
728 <entry>r<subscript>3</subscript></entry>
729 <entry>r<subscript>2</subscript></entry>
730 <entry>r<subscript>1</subscript></entry>
731 <entry>r<subscript>0</subscript></entry>
732 <entry>g<subscript>5</subscript></entry>
733 <entry>g<subscript>4</subscript></entry>
734 <entry>g<subscript>3</subscript></entry>
735 <entry></entry>
736 <entry>g<subscript>2</subscript></entry>
737 <entry>g<subscript>1</subscript></entry>
738 <entry>g<subscript>0</subscript></entry>
739 <entry>b<subscript>4</subscript></entry>
740 <entry>b<subscript>3</subscript></entry>
741 <entry>b<subscript>2</subscript></entry>
742 <entry>b<subscript>1</subscript></entry>
743 <entry>b<subscript>0</subscript></entry>
744 </row>
745 <row><!-- id="V4L2-PIX-FMT-BGR666" -->
746 <entry><constant>V4L2_PIX_FMT_BGR666</constant></entry>
747 <entry>'BGRH'</entry>
748 <entry></entry>
749 <entry>b<subscript>5</subscript></entry>
750 <entry>b<subscript>4</subscript></entry>
751 <entry>b<subscript>3</subscript></entry>
752 <entry>b<subscript>2</subscript></entry>
753 <entry>b<subscript>1</subscript></entry>
754 <entry>b<subscript>0</subscript></entry>
755 <entry>g<subscript>5</subscript></entry>
756 <entry>g<subscript>4</subscript></entry>
757 <entry></entry>
758 <entry>g<subscript>3</subscript></entry>
759 <entry>g<subscript>2</subscript></entry>
760 <entry>g<subscript>1</subscript></entry>
761 <entry>g<subscript>0</subscript></entry>
762 <entry>r<subscript>5</subscript></entry>
763 <entry>r<subscript>4</subscript></entry>
764 <entry>r<subscript>3</subscript></entry>
765 <entry>r<subscript>2</subscript></entry>
766 <entry></entry>
767 <entry>r<subscript>1</subscript></entry>
768 <entry>r<subscript>0</subscript></entry>
769 <entry></entry>
770 <entry></entry>
771 <entry></entry>
772 <entry></entry>
773 <entry></entry>
774 <entry></entry>
775 <entry></entry>
776 <entry></entry>
777 <entry></entry>
778 <entry></entry>
779 <entry></entry>
780 <entry></entry>
781 <entry></entry>
782 <entry></entry>
783 </row>
784 <row><!-- id="V4L2-PIX-FMT-BGR24" -->
785 <entry><constant>V4L2_PIX_FMT_BGR24</constant></entry>
786 <entry>'BGR3'</entry>
787 <entry></entry>
788 <entry>b<subscript>7</subscript></entry>
789 <entry>b<subscript>6</subscript></entry>
790 <entry>b<subscript>5</subscript></entry>
791 <entry>b<subscript>4</subscript></entry>
792 <entry>b<subscript>3</subscript></entry>
793 <entry>b<subscript>2</subscript></entry>
794 <entry>b<subscript>1</subscript></entry>
795 <entry>b<subscript>0</subscript></entry>
796 <entry></entry>
797 <entry>g<subscript>7</subscript></entry>
798 <entry>g<subscript>6</subscript></entry>
799 <entry>g<subscript>5</subscript></entry>
800 <entry>g<subscript>4</subscript></entry>
801 <entry>g<subscript>3</subscript></entry>
802 <entry>g<subscript>2</subscript></entry>
803 <entry>g<subscript>1</subscript></entry>
804 <entry>g<subscript>0</subscript></entry>
805 <entry></entry>
806 <entry>r<subscript>7</subscript></entry>
807 <entry>r<subscript>6</subscript></entry>
808 <entry>r<subscript>5</subscript></entry>
809 <entry>r<subscript>4</subscript></entry>
810 <entry>r<subscript>3</subscript></entry>
811 <entry>r<subscript>2</subscript></entry>
812 <entry>r<subscript>1</subscript></entry>
813 <entry>r<subscript>0</subscript></entry>
814 </row>
815 <row><!-- id="V4L2-PIX-FMT-RGB24" -->
816 <entry><constant>V4L2_PIX_FMT_RGB24</constant></entry>
817 <entry>'RGB3'</entry>
818 <entry></entry>
819 <entry>r<subscript>7</subscript></entry>
820 <entry>r<subscript>6</subscript></entry>
821 <entry>r<subscript>5</subscript></entry>
822 <entry>r<subscript>4</subscript></entry>
823 <entry>r<subscript>3</subscript></entry>
824 <entry>r<subscript>2</subscript></entry>
825 <entry>r<subscript>1</subscript></entry>
826 <entry>r<subscript>0</subscript></entry>
827 <entry></entry>
828 <entry>g<subscript>7</subscript></entry>
829 <entry>g<subscript>6</subscript></entry>
830 <entry>g<subscript>5</subscript></entry>
831 <entry>g<subscript>4</subscript></entry>
832 <entry>g<subscript>3</subscript></entry>
833 <entry>g<subscript>2</subscript></entry>
834 <entry>g<subscript>1</subscript></entry>
835 <entry>g<subscript>0</subscript></entry>
836 <entry></entry>
837 <entry>b<subscript>7</subscript></entry>
838 <entry>b<subscript>6</subscript></entry>
839 <entry>b<subscript>5</subscript></entry>
840 <entry>b<subscript>4</subscript></entry>
841 <entry>b<subscript>3</subscript></entry>
842 <entry>b<subscript>2</subscript></entry>
843 <entry>b<subscript>1</subscript></entry>
844 <entry>b<subscript>0</subscript></entry>
845 </row>
846 <row><!-- id="V4L2-PIX-FMT-BGR32" -->
847 <entry><constant>V4L2_PIX_FMT_BGR32</constant></entry>
848 <entry>'BGR4'</entry>
849 <entry></entry>
850 <entry>b<subscript>7</subscript></entry>
851 <entry>b<subscript>6</subscript></entry>
852 <entry>b<subscript>5</subscript></entry>
853 <entry>b<subscript>4</subscript></entry>
854 <entry>b<subscript>3</subscript></entry>
855 <entry>b<subscript>2</subscript></entry>
856 <entry>b<subscript>1</subscript></entry>
857 <entry>b<subscript>0</subscript></entry>
858 <entry></entry>
859 <entry>g<subscript>7</subscript></entry>
860 <entry>g<subscript>6</subscript></entry>
861 <entry>g<subscript>5</subscript></entry>
862 <entry>g<subscript>4</subscript></entry>
863 <entry>g<subscript>3</subscript></entry>
864 <entry>g<subscript>2</subscript></entry>
865 <entry>g<subscript>1</subscript></entry>
866 <entry>g<subscript>0</subscript></entry>
867 <entry></entry>
868 <entry>r<subscript>7</subscript></entry>
869 <entry>r<subscript>6</subscript></entry>
870 <entry>r<subscript>5</subscript></entry>
871 <entry>r<subscript>4</subscript></entry>
872 <entry>r<subscript>3</subscript></entry>
873 <entry>r<subscript>2</subscript></entry>
874 <entry>r<subscript>1</subscript></entry>
875 <entry>r<subscript>0</subscript></entry>
876 <entry></entry>
877 <entry>a<subscript>7</subscript></entry>
878 <entry>a<subscript>6</subscript></entry>
879 <entry>a<subscript>5</subscript></entry>
880 <entry>a<subscript>4</subscript></entry>
881 <entry>a<subscript>3</subscript></entry>
882 <entry>a<subscript>2</subscript></entry>
883 <entry>a<subscript>1</subscript></entry>
884 <entry>a<subscript>0</subscript></entry>
885 </row>
886 <row><!-- id="V4L2-PIX-FMT-RGB32" -->
887 <entry><constant>V4L2_PIX_FMT_RGB32</constant></entry>
888 <entry>'RGB4'</entry>
889 <entry></entry>
890 <entry>a<subscript>7</subscript></entry>
891 <entry>a<subscript>6</subscript></entry>
892 <entry>a<subscript>5</subscript></entry>
893 <entry>a<subscript>4</subscript></entry>
894 <entry>a<subscript>3</subscript></entry>
895 <entry>a<subscript>2</subscript></entry>
896 <entry>a<subscript>1</subscript></entry>
897 <entry>a<subscript>0</subscript></entry>
898 <entry></entry>
899 <entry>r<subscript>7</subscript></entry>
900 <entry>r<subscript>6</subscript></entry>
901 <entry>r<subscript>5</subscript></entry>
902 <entry>r<subscript>4</subscript></entry>
903 <entry>r<subscript>3</subscript></entry>
904 <entry>r<subscript>2</subscript></entry>
905 <entry>r<subscript>1</subscript></entry>
906 <entry>r<subscript>0</subscript></entry>
907 <entry></entry>
908 <entry>g<subscript>7</subscript></entry>
909 <entry>g<subscript>6</subscript></entry>
910 <entry>g<subscript>5</subscript></entry>
911 <entry>g<subscript>4</subscript></entry>
912 <entry>g<subscript>3</subscript></entry>
913 <entry>g<subscript>2</subscript></entry>
914 <entry>g<subscript>1</subscript></entry>
915 <entry>g<subscript>0</subscript></entry>
916 <entry></entry>
917 <entry>b<subscript>7</subscript></entry>
918 <entry>b<subscript>6</subscript></entry>
919 <entry>b<subscript>5</subscript></entry>
920 <entry>b<subscript>4</subscript></entry>
921 <entry>b<subscript>3</subscript></entry>
922 <entry>b<subscript>2</subscript></entry>
923 <entry>b<subscript>1</subscript></entry>
924 <entry>b<subscript>0</subscript></entry>
925 </row>
926 </tbody>
927 </tgroup>
928 </table>
929
930 <para>A test utility to determine which RGB formats a driver 515 <para>A test utility to determine which RGB formats a driver
931actually supports is available from the LinuxTV v4l-dvb repository. 516actually supports is available from the LinuxTV v4l-dvb repository.
932See &v4l-dvb; for access instructions.</para> 517See &v4l-dvb; for access instructions.</para>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-sdr-cu08.xml b/Documentation/DocBook/media/v4l/pixfmt-sdr-cu08.xml
new file mode 100644
index 000000000000..2d80104c178b
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-sdr-cu08.xml
@@ -0,0 +1,44 @@
1<refentry id="V4L2-SDR-FMT-CU08">
2 <refmeta>
3 <refentrytitle>V4L2_SDR_FMT_CU8 ('CU08')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname>
8 <constant>V4L2_SDR_FMT_CU8</constant>
9 </refname>
10 <refpurpose>Complex unsigned 8-bit IQ sample</refpurpose>
11 </refnamediv>
12 <refsect1>
13 <title>Description</title>
14 <para>
15This format contains sequence of complex number samples. Each complex number
16consist two parts, called In-phase and Quadrature (IQ). Both I and Q are
17represented as a 8 bit unsigned number. I value comes first and Q value after
18that.
19 </para>
20 <example>
21 <title><constant>V4L2_SDR_FMT_CU8</constant> 1 sample</title>
22 <formalpara>
23 <title>Byte Order.</title>
24 <para>Each cell is one byte.
25 <informaltable frame="none">
26 <tgroup cols="2" align="center">
27 <colspec align="left" colwidth="2*" />
28 <tbody valign="top">
29 <row>
30 <entry>start&nbsp;+&nbsp;0:</entry>
31 <entry>I'<subscript>0</subscript></entry>
32 </row>
33 <row>
34 <entry>start&nbsp;+&nbsp;1:</entry>
35 <entry>Q'<subscript>0</subscript></entry>
36 </row>
37 </tbody>
38 </tgroup>
39 </informaltable>
40 </para>
41 </formalpara>
42 </example>
43 </refsect1>
44</refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-sdr-cu16le.xml b/Documentation/DocBook/media/v4l/pixfmt-sdr-cu16le.xml
new file mode 100644
index 000000000000..26288ffa9071
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-sdr-cu16le.xml
@@ -0,0 +1,46 @@
1<refentry id="V4L2-SDR-FMT-CU16LE">
2 <refmeta>
3 <refentrytitle>V4L2_SDR_FMT_CU16LE ('CU16')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname>
8 <constant>V4L2_SDR_FMT_CU16LE</constant>
9 </refname>
10 <refpurpose>Complex unsigned 16-bit little endian IQ sample</refpurpose>
11 </refnamediv>
12 <refsect1>
13 <title>Description</title>
14 <para>
15This format contains sequence of complex number samples. Each complex number
16consist two parts, called In-phase and Quadrature (IQ). Both I and Q are
17represented as a 16 bit unsigned little endian number. I value comes first
18and Q value after that.
19 </para>
20 <example>
21 <title><constant>V4L2_SDR_FMT_CU16LE</constant> 1 sample</title>
22 <formalpara>
23 <title>Byte Order.</title>
24 <para>Each cell is one byte.
25 <informaltable frame="none">
26 <tgroup cols="3" align="center">
27 <colspec align="left" colwidth="2*" />
28 <tbody valign="top">
29 <row>
30 <entry>start&nbsp;+&nbsp;0:</entry>
31 <entry>I'<subscript>0[7:0]</subscript></entry>
32 <entry>I'<subscript>0[15:8]</subscript></entry>
33 </row>
34 <row>
35 <entry>start&nbsp;+&nbsp;2:</entry>
36 <entry>Q'<subscript>0[7:0]</subscript></entry>
37 <entry>Q'<subscript>0[15:8]</subscript></entry>
38 </row>
39 </tbody>
40 </tgroup>
41 </informaltable>
42 </para>
43 </formalpara>
44 </example>
45 </refsect1>
46</refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml b/Documentation/DocBook/media/v4l/pixfmt.xml
index 72d72bd67d0a..ea514d6075c5 100644
--- a/Documentation/DocBook/media/v4l/pixfmt.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt.xml
@@ -25,7 +25,12 @@ capturing and output, for overlay frame buffer formats see also
25 <row> 25 <row>
26 <entry>__u32</entry> 26 <entry>__u32</entry>
27 <entry><structfield>height</structfield></entry> 27 <entry><structfield>height</structfield></entry>
28 <entry>Image height in pixels.</entry> 28 <entry>Image height in pixels. If <structfield>field</structfield> is
29 one of <constant>V4L2_FIELD_TOP</constant>, <constant>V4L2_FIELD_BOTTOM</constant>
30 or <constant>V4L2_FIELD_ALTERNATE</constant> then height refers to the
31 number of lines in the field, otherwise it refers to the number of
32 lines in the frame (which is twice the field height for interlaced
33 formats).</entry>
29 </row> 34 </row>
30 <row> 35 <row>
31 <entry spanname="hspan">Applications set these fields to 36 <entry spanname="hspan">Applications set these fields to
@@ -54,7 +59,7 @@ linkend="reserved-formats" /></entry>
54can request to capture or output only the top or bottom field, or both 59can request to capture or output only the top or bottom field, or both
55fields interlaced or sequentially stored in one buffer or alternating 60fields interlaced or sequentially stored in one buffer or alternating
56in separate buffers. Drivers return the actual field order selected. 61in separate buffers. Drivers return the actual field order selected.
57For details see <xref linkend="field-order" />.</entry> 62For more details on fields see <xref linkend="field-order" />.</entry>
58 </row> 63 </row>
59 <row> 64 <row>
60 <entry>__u32</entry> 65 <entry>__u32</entry>
@@ -81,7 +86,10 @@ plane and is divided by the same factor as the
81example the Cb and Cr planes of a YUV 4:2:0 image have half as many 86example the Cb and Cr planes of a YUV 4:2:0 image have half as many
82padding bytes following each line as the Y plane. To avoid ambiguities 87padding bytes following each line as the Y plane. To avoid ambiguities
83drivers must return a <structfield>bytesperline</structfield> value 88drivers must return a <structfield>bytesperline</structfield> value
84rounded up to a multiple of the scale factor.</para></entry> 89rounded up to a multiple of the scale factor.</para>
90<para>For compressed formats the <structfield>bytesperline</structfield>
91value makes no sense. Applications and drivers must set this to 0 in
92that case.</para></entry>
85 </row> 93 </row>
86 <row> 94 <row>
87 <entry>__u32</entry> 95 <entry>__u32</entry>
@@ -97,7 +105,8 @@ hold an image.</entry>
97 <entry>&v4l2-colorspace;</entry> 105 <entry>&v4l2-colorspace;</entry>
98 <entry><structfield>colorspace</structfield></entry> 106 <entry><structfield>colorspace</structfield></entry>
99 <entry>This information supplements the 107 <entry>This information supplements the
100<structfield>pixelformat</structfield> and must be set by the driver, 108<structfield>pixelformat</structfield> and must be set by the driver for
109capture streams and by the application for output streams,
101see <xref linkend="colorspaces" />.</entry> 110see <xref linkend="colorspaces" />.</entry>
102 </row> 111 </row>
103 <row> 112 <row>
@@ -135,7 +144,7 @@ set this field to zero.</entry>
135 <entry>__u16</entry> 144 <entry>__u16</entry>
136 <entry><structfield>bytesperline</structfield></entry> 145 <entry><structfield>bytesperline</structfield></entry>
137 <entry>Distance in bytes between the leftmost pixels in two adjacent 146 <entry>Distance in bytes between the leftmost pixels in two adjacent
138 lines.</entry> 147 lines. See &v4l2-pix-format;.</entry>
139 </row> 148 </row>
140 <row> 149 <row>
141 <entry>__u16</entry> 150 <entry>__u16</entry>
@@ -154,12 +163,12 @@ set this field to zero.</entry>
154 <row> 163 <row>
155 <entry>__u32</entry> 164 <entry>__u32</entry>
156 <entry><structfield>width</structfield></entry> 165 <entry><structfield>width</structfield></entry>
157 <entry>Image width in pixels.</entry> 166 <entry>Image width in pixels. See &v4l2-pix-format;.</entry>
158 </row> 167 </row>
159 <row> 168 <row>
160 <entry>__u32</entry> 169 <entry>__u32</entry>
161 <entry><structfield>height</structfield></entry> 170 <entry><structfield>height</structfield></entry>
162 <entry>Image height in pixels.</entry> 171 <entry>Image height in pixels. See &v4l2-pix-format;.</entry>
163 </row> 172 </row>
164 <row> 173 <row>
165 <entry>__u32</entry> 174 <entry>__u32</entry>
@@ -811,6 +820,17 @@ extended control <constant>V4L2_CID_MPEG_STREAM_TYPE</constant>, see
811 </table> 820 </table>
812 </section> 821 </section>
813 822
823 <section id="sdr-formats">
824 <title>SDR Formats</title>
825
826 <para>These formats are used for <link linkend="sdr">SDR Capture</link>
827interface only.</para>
828
829 &sub-sdr-cu08;
830 &sub-sdr-cu16le;
831
832 </section>
833
814 <section id="pixfmt-reserved"> 834 <section id="pixfmt-reserved">
815 <title>Reserved Format Identifiers</title> 835 <title>Reserved Format Identifiers</title>
816 836
diff --git a/Documentation/DocBook/media/v4l/remote_controllers.xml b/Documentation/DocBook/media/v4l/remote_controllers.xml
index 160e464d44b7..5124a6c4daa8 100644
--- a/Documentation/DocBook/media/v4l/remote_controllers.xml
+++ b/Documentation/DocBook/media/v4l/remote_controllers.xml
@@ -1,10 +1,152 @@
1<partinfo>
2<authorgroup>
3<author>
4<firstname>Mauro</firstname>
5<surname>Chehab</surname>
6<othername role="mi">Carvalho</othername>
7<affiliation><address><email>m.chehab@samsung.com</email></address></affiliation>
8<contrib>Initial version.</contrib>
9</author>
10</authorgroup>
11<copyright>
12 <year>2009-2014</year>
13 <holder>Mauro Carvalho Chehab</holder>
14</copyright>
15
16<revhistory>
17<!-- Put document revisions here, newest first. -->
18<revision>
19<revnumber>3.15</revnumber>
20<date>2014-02-06</date>
21<authorinitials>mcc</authorinitials>
22<revremark>Added the interface description and the RC sysfs class description.</revremark>
23</revision>
24<revision>
25<revnumber>1.0</revnumber>
26<date>2009-09-06</date>
27<authorinitials>mcc</authorinitials>
28<revremark>Initial revision</revremark>
29</revision>
30</revhistory>
31</partinfo>
32
33 <title>Remote Controller API</title>
34 <chapter id="remote_controllers">
35
1<title>Remote Controllers</title> 36<title>Remote Controllers</title>
37
2<section id="Remote_controllers_Intro"> 38<section id="Remote_controllers_Intro">
3<title>Introduction</title> 39<title>Introduction</title>
4 40
5<para>Currently, most analog and digital devices have a Infrared input for remote controllers. Each 41<para>Currently, most analog and digital devices have a Infrared input for remote controllers. Each
6manufacturer has their own type of control. It is not rare for the same manufacturer to ship different 42manufacturer has their own type of control. It is not rare for the same manufacturer to ship different
7types of controls, depending on the device.</para> 43types of controls, depending on the device.</para>
44<para>A Remote Controller interface is mapped as a normal evdev/input interface, just like a keyboard or a mouse.
45So, it uses all ioctls already defined for any other input devices.</para>
46<para>However, remove controllers are more flexible than a normal input device, as the IR
47receiver (and/or transmitter) can be used in conjunction with a wide variety of different IR remotes.</para>
48<para>In order to allow flexibility, the Remote Controller subsystem allows controlling the
49RC-specific attributes via <link linkend="remote_controllers_sysfs_nodes">the sysfs class nodes</link>.</para>
50</section>
51
52<section id="remote_controllers_sysfs_nodes">
53<title>Remote Controller's sysfs nodes</title>
54<para>As defined at <constant>Documentation/ABI/testing/sysfs-class-rc</constant>, those are the sysfs nodes that control the Remote Controllers:</para>
55
56<section id="sys_class_rc">
57<title>/sys/class/rc/</title>
58<para>The <constant>/sys/class/rc/</constant> class sub-directory belongs to the Remote Controller
59core and provides a sysfs interface for configuring infrared remote controller receivers.
60</para>
61
62</section>
63<section id="sys_class_rc_rcN">
64<title>/sys/class/rc/rcN/</title>
65<para>A <constant>/sys/class/rc/rcN</constant> directory is created for each remote
66 control receiver device where N is the number of the receiver.</para>
67
68</section>
69<section id="sys_class_rc_rcN_protocols">
70<title>/sys/class/rc/rcN/protocols</title>
71<para>Reading this file returns a list of available protocols, something like:</para>
72<para><constant>rc5 [rc6] nec jvc [sony]</constant></para>
73<para>Enabled protocols are shown in [] brackets.</para>
74<para>Writing "+proto" will add a protocol to the list of enabled protocols.</para>
75<para>Writing "-proto" will remove a protocol from the list of enabled protocols.</para>
76<para>Writing "proto" will enable only "proto".</para>
77<para>Writing "none" will disable all protocols.</para>
78<para>Write fails with EINVAL if an invalid protocol combination or unknown protocol name is used.</para>
79
80</section>
81<section id="sys_class_rc_rcN_filter">
82<title>/sys/class/rc/rcN/filter</title>
83<para>Sets the scancode filter expected value.</para>
84<para>Use in combination with <constant>/sys/class/rc/rcN/filter_mask</constant> to set the
85expected value of the bits set in the filter mask.
86If the hardware supports it then scancodes which do not match
87the filter will be ignored. Otherwise the write will fail with
88an error.</para>
89<para>This value may be reset to 0 if the current protocol is altered.</para>
90
91</section>
92<section id="sys_class_rc_rcN_filter_mask">
93<title>/sys/class/rc/rcN/filter_mask</title>
94<para>Sets the scancode filter mask of bits to compare.
95Use in combination with <constant>/sys/class/rc/rcN/filter</constant> to set the bits
96of the scancode which should be compared against the expected
97value. A value of 0 disables the filter to allow all valid
98scancodes to be processed.</para>
99<para>If the hardware supports it then scancodes which do not match
100the filter will be ignored. Otherwise the write will fail with
101an error.</para>
102<para>This value may be reset to 0 if the current protocol is altered.</para>
103
104</section>
105<section id="sys_class_rc_rcN_wakeup_protocols">
106<title>/sys/class/rc/rcN/wakeup_protocols</title>
107<para>Reading this file returns a list of available protocols to use for the
108wakeup filter, something like:</para>
109<para><constant>rc5 rc6 nec jvc [sony]</constant></para>
110<para>The enabled wakeup protocol is shown in [] brackets.</para>
111<para>Writing "+proto" will add a protocol to the list of enabled wakeup
112protocols.</para>
113<para>Writing "-proto" will remove a protocol from the list of enabled wakeup
114protocols.</para>
115<para>Writing "proto" will use "proto" for wakeup events.</para>
116<para>Writing "none" will disable wakeup.</para>
117<para>Write fails with EINVAL if an invalid protocol combination or unknown
118protocol name is used, or if wakeup is not supported by the hardware.</para>
119
120</section>
121<section id="sys_class_rc_rcN_wakeup_filter">
122<title>/sys/class/rc/rcN/wakeup_filter</title>
123<para>Sets the scancode wakeup filter expected value.
124Use in combination with <constant>/sys/class/rc/rcN/wakeup_filter_mask</constant> to
125set the expected value of the bits set in the wakeup filter mask
126to trigger a system wake event.</para>
127<para>If the hardware supports it and wakeup_filter_mask is not 0 then
128scancodes which match the filter will wake the system from e.g.
129suspend to RAM or power off.
130Otherwise the write will fail with an error.</para>
131<para>This value may be reset to 0 if the wakeup protocol is altered.</para>
132
133</section>
134<section id="sys_class_rc_rcN_wakeup_filter_mask">
135<title>/sys/class/rc/rcN/wakeup_filter_mask</title>
136<para>Sets the scancode wakeup filter mask of bits to compare.
137Use in combination with <constant>/sys/class/rc/rcN/wakeup_filter</constant> to set
138the bits of the scancode which should be compared against the
139expected value to trigger a system wake event.</para>
140<para>If the hardware supports it and wakeup_filter_mask is not 0 then
141scancodes which match the filter will wake the system from e.g.
142suspend to RAM or power off.
143Otherwise the write will fail with an error.</para>
144<para>This value may be reset to 0 if the wakeup protocol is altered.</para>
145</section>
146</section>
147
148<section id="Remote_controllers_tables">
149<title>Remote controller tables</title>
8<para>Unfortunately, for several years, there was no effort to create uniform IR keycodes for 150<para>Unfortunately, for several years, there was no effort to create uniform IR keycodes for
9different devices. This caused the same IR keyname to be mapped completely differently on 151different devices. This caused the same IR keyname to be mapped completely differently on
10different IR devices. This resulted that the same IR keyname to be mapped completely different on 152different IR devices. This resulted that the same IR keyname to be mapped completely different on
@@ -175,3 +317,4 @@ keymapping.</para>
175</section> 317</section>
176 318
177&sub-lirc_device_interface; 319&sub-lirc_device_interface;
320</chapter>
diff --git a/Documentation/DocBook/media/v4l/v4l2.xml b/Documentation/DocBook/media/v4l/v4l2.xml
index 74b7f27af71a..b445161b912c 100644
--- a/Documentation/DocBook/media/v4l/v4l2.xml
+++ b/Documentation/DocBook/media/v4l/v4l2.xml
@@ -70,7 +70,7 @@ MPEG stream embedded, sliced VBI data format in this specification.
70Remote Controller chapter.</contrib> 70Remote Controller chapter.</contrib>
71 <affiliation> 71 <affiliation>
72 <address> 72 <address>
73 <email>mchehab@redhat.com</email> 73 <email>m.chehab@samsung.com</email>
74 </address> 74 </address>
75 </affiliation> 75 </affiliation>
76 </author> 76 </author>
@@ -107,6 +107,16 @@ Remote Controller chapter.</contrib>
107 </address> 107 </address>
108 </affiliation> 108 </affiliation>
109 </author> 109 </author>
110 <author>
111 <firstname>Antti</firstname>
112 <surname>Palosaari</surname>
113 <contrib>SDR API.</contrib>
114 <affiliation>
115 <address>
116 <email>crope@iki.fi</email>
117 </address>
118 </affiliation>
119 </author>
110 </authorgroup> 120 </authorgroup>
111 121
112 <copyright> 122 <copyright>
@@ -125,6 +135,7 @@ Remote Controller chapter.</contrib>
125 <year>2011</year> 135 <year>2011</year>
126 <year>2012</year> 136 <year>2012</year>
127 <year>2013</year> 137 <year>2013</year>
138 <year>2014</year>
128 <holder>Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin 139 <holder>Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin
129Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab, 140Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab,
130 Pawel Osciak</holder> 141 Pawel Osciak</holder>
@@ -141,6 +152,16 @@ structs, ioctls) must be noted in more detail in the history chapter
141applications. --> 152applications. -->
142 153
143 <revision> 154 <revision>
155 <revnumber>3.15</revnumber>
156 <date>2014-02-03</date>
157 <authorinitials>hv, ap</authorinitials>
158 <revremark>Update several sections of "Common API Elements": "Opening and Closing Devices"
159"Querying Capabilities", "Application Priority", "Video Inputs and Outputs", "Audio Inputs and Outputs"
160"Tuners and Modulators", "Video Standards" and "Digital Video (DV) Timings". Added SDR API.
161 </revremark>
162 </revision>
163
164 <revision>
144 <revnumber>3.14</revnumber> 165 <revnumber>3.14</revnumber>
145 <date>2013-11-25</date> 166 <date>2013-11-25</date>
146 <authorinitials>rr</authorinitials> 167 <authorinitials>rr</authorinitials>
@@ -537,6 +558,7 @@ and discussions on the V4L mailing list.</revremark>
537 <section id="ttx"> &sub-dev-teletext; </section> 558 <section id="ttx"> &sub-dev-teletext; </section>
538 <section id="radio"> &sub-dev-radio; </section> 559 <section id="radio"> &sub-dev-radio; </section>
539 <section id="rds"> &sub-dev-rds; </section> 560 <section id="rds"> &sub-dev-rds; </section>
561 <section id="sdr"> &sub-dev-sdr; </section>
540 <section id="event"> &sub-dev-event; </section> 562 <section id="event"> &sub-dev-event; </section>
541 <section id="subdev"> &sub-dev-subdev; </section> 563 <section id="subdev"> &sub-dev-subdev; </section>
542 </chapter> 564 </chapter>
@@ -585,6 +607,7 @@ and discussions on the V4L mailing list.</revremark>
585 &sub-g-crop; 607 &sub-g-crop;
586 &sub-g-ctrl; 608 &sub-g-ctrl;
587 &sub-g-dv-timings; 609 &sub-g-dv-timings;
610 &sub-g-edid;
588 &sub-g-enc-index; 611 &sub-g-enc-index;
589 &sub-g-ext-ctrls; 612 &sub-g-ext-ctrls;
590 &sub-g-fbuf; 613 &sub-g-fbuf;
@@ -616,7 +639,6 @@ and discussions on the V4L mailing list.</revremark>
616 &sub-subdev-enum-frame-size; 639 &sub-subdev-enum-frame-size;
617 &sub-subdev-enum-mbus-code; 640 &sub-subdev-enum-mbus-code;
618 &sub-subdev-g-crop; 641 &sub-subdev-g-crop;
619 &sub-subdev-g-edid;
620 &sub-subdev-g-fmt; 642 &sub-subdev-g-fmt;
621 &sub-subdev-g-frame-interval; 643 &sub-subdev-g-frame-interval;
622 &sub-subdev-g-selection; 644 &sub-subdev-g-selection;
diff --git a/Documentation/DocBook/media/v4l/vidioc-enum-freq-bands.xml b/Documentation/DocBook/media/v4l/vidioc-enum-freq-bands.xml
index 6541ba0175ed..4e8ea65f7282 100644
--- a/Documentation/DocBook/media/v4l/vidioc-enum-freq-bands.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-enum-freq-bands.xml
@@ -100,7 +100,7 @@ See <xref linkend="v4l2-tuner-type" /></entry>
100 <entry><structfield>capability</structfield></entry> 100 <entry><structfield>capability</structfield></entry>
101 <entry spanname="hspan">The tuner/modulator capability flags for 101 <entry spanname="hspan">The tuner/modulator capability flags for
102this frequency band, see <xref linkend="tuner-capability" />. The <constant>V4L2_TUNER_CAP_LOW</constant> 102this frequency band, see <xref linkend="tuner-capability" />. The <constant>V4L2_TUNER_CAP_LOW</constant>
103capability must be the same for all frequency bands of the selected tuner/modulator. 103or <constant>V4L2_TUNER_CAP_1HZ</constant> capability must be the same for all frequency bands of the selected tuner/modulator.
104So either all bands have that capability set, or none of them have that capability.</entry> 104So either all bands have that capability set, or none of them have that capability.</entry>
105 </row> 105 </row>
106 <row> 106 <row>
@@ -109,7 +109,8 @@ So either all bands have that capability set, or none of them have that capabili
109 <entry spanname="hspan">The lowest tunable frequency in 109 <entry spanname="hspan">The lowest tunable frequency in
110units of 62.5 kHz, or if the <structfield>capability</structfield> 110units of 62.5 kHz, or if the <structfield>capability</structfield>
111flag <constant>V4L2_TUNER_CAP_LOW</constant> is set, in units of 62.5 111flag <constant>V4L2_TUNER_CAP_LOW</constant> is set, in units of 62.5
112Hz, for this frequency band.</entry> 112Hz, for this frequency band. A 1 Hz unit is used when the <structfield>capability</structfield> flag
113<constant>V4L2_TUNER_CAP_1HZ</constant> is set.</entry>
113 </row> 114 </row>
114 <row> 115 <row>
115 <entry>__u32</entry> 116 <entry>__u32</entry>
@@ -117,7 +118,8 @@ Hz, for this frequency band.</entry>
117 <entry spanname="hspan">The highest tunable frequency in 118 <entry spanname="hspan">The highest tunable frequency in
118units of 62.5 kHz, or if the <structfield>capability</structfield> 119units of 62.5 kHz, or if the <structfield>capability</structfield>
119flag <constant>V4L2_TUNER_CAP_LOW</constant> is set, in units of 62.5 120flag <constant>V4L2_TUNER_CAP_LOW</constant> is set, in units of 62.5
120Hz, for this frequency band.</entry> 121Hz, for this frequency band. A 1 Hz unit is used when the <structfield>capability</structfield> flag
122<constant>V4L2_TUNER_CAP_1HZ</constant> is set.</entry>
121 </row> 123 </row>
122 <row> 124 <row>
123 <entry>__u32</entry> 125 <entry>__u32</entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml b/Documentation/DocBook/media/v4l/vidioc-g-edid.xml
index bbd18f0e6ede..ce4563b87131 100644
--- a/Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-edid.xml
@@ -1,12 +1,12 @@
1<refentry id="vidioc-subdev-g-edid"> 1<refentry id="vidioc-g-edid">
2 <refmeta> 2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_S_EDID</refentrytitle> 3 <refentrytitle>ioctl VIDIOC_G_EDID, VIDIOC_S_EDID</refentrytitle>
4 &manvol; 4 &manvol;
5 </refmeta> 5 </refmeta>
6 6
7 <refnamediv> 7 <refnamediv>
8 <refname>VIDIOC_SUBDEV_G_EDID</refname> 8 <refname>VIDIOC_G_EDID</refname>
9 <refname>VIDIOC_SUBDEV_S_EDID</refname> 9 <refname>VIDIOC_S_EDID</refname>
10 <refpurpose>Get or set the EDID of a video receiver/transmitter</refpurpose> 10 <refpurpose>Get or set the EDID of a video receiver/transmitter</refpurpose>
11 </refnamediv> 11 </refnamediv>
12 12
@@ -16,7 +16,7 @@
16 <funcdef>int <function>ioctl</function></funcdef> 16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef> 17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef> 18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_subdev_edid *<parameter>argp</parameter></paramdef> 19 <paramdef>struct v4l2_edid *<parameter>argp</parameter></paramdef>
20 </funcprototype> 20 </funcprototype>
21 </funcsynopsis> 21 </funcsynopsis>
22 <funcsynopsis> 22 <funcsynopsis>
@@ -24,7 +24,7 @@
24 <funcdef>int <function>ioctl</function></funcdef> 24 <funcdef>int <function>ioctl</function></funcdef>
25 <paramdef>int <parameter>fd</parameter></paramdef> 25 <paramdef>int <parameter>fd</parameter></paramdef>
26 <paramdef>int <parameter>request</parameter></paramdef> 26 <paramdef>int <parameter>request</parameter></paramdef>
27 <paramdef>const struct v4l2_subdev_edid *<parameter>argp</parameter></paramdef> 27 <paramdef>const struct v4l2_edid *<parameter>argp</parameter></paramdef>
28 </funcprototype> 28 </funcprototype>
29 </funcsynopsis> 29 </funcsynopsis>
30 </refsynopsisdiv> 30 </refsynopsisdiv>
@@ -42,7 +42,7 @@
42 <varlistentry> 42 <varlistentry>
43 <term><parameter>request</parameter></term> 43 <term><parameter>request</parameter></term>
44 <listitem> 44 <listitem>
45 <para>VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_S_EDID</para> 45 <para>VIDIOC_G_EDID, VIDIOC_S_EDID</para>
46 </listitem> 46 </listitem>
47 </varlistentry> 47 </varlistentry>
48 <varlistentry> 48 <varlistentry>
@@ -56,12 +56,20 @@
56 56
57 <refsect1> 57 <refsect1>
58 <title>Description</title> 58 <title>Description</title>
59 <para>These ioctls can be used to get or set an EDID associated with an input pad 59 <para>These ioctls can be used to get or set an EDID associated with an input
60 from a receiver or an output pad of a transmitter subdevice.</para> 60 from a receiver or an output of a transmitter device. They can be
61 used with subdevice nodes (/dev/v4l-subdevX) or with video nodes (/dev/videoX).</para>
62
63 <para>When used with video nodes the <structfield>pad</structfield> field represents the
64 input (for video capture devices) or output (for video output devices) index as
65 is returned by &VIDIOC-ENUMINPUT; and &VIDIOC-ENUMOUTPUT; respectively. When used
66 with subdevice nodes the <structfield>pad</structfield> field represents the
67 input or output pad of the subdevice. If there is no EDID support for the given
68 <structfield>pad</structfield> value, then the &EINVAL; will be returned.</para>
61 69
62 <para>To get the EDID data the application has to fill in the <structfield>pad</structfield>, 70 <para>To get the EDID data the application has to fill in the <structfield>pad</structfield>,
63 <structfield>start_block</structfield>, <structfield>blocks</structfield> and <structfield>edid</structfield> 71 <structfield>start_block</structfield>, <structfield>blocks</structfield> and <structfield>edid</structfield>
64 fields and call <constant>VIDIOC_SUBDEV_G_EDID</constant>. The current EDID from block 72 fields and call <constant>VIDIOC_G_EDID</constant>. The current EDID from block
65 <structfield>start_block</structfield> and of size <structfield>blocks</structfield> 73 <structfield>start_block</structfield> and of size <structfield>blocks</structfield>
66 will be placed in the memory <structfield>edid</structfield> points to. The <structfield>edid</structfield> 74 will be placed in the memory <structfield>edid</structfield> points to. The <structfield>edid</structfield>
67 pointer must point to memory at least <structfield>blocks</structfield>&nbsp;*&nbsp;128 bytes 75 pointer must point to memory at least <structfield>blocks</structfield>&nbsp;*&nbsp;128 bytes
@@ -91,15 +99,17 @@
91 data in some way. In any case, the end result is the same: the EDID is no longer available. 99 data in some way. In any case, the end result is the same: the EDID is no longer available.
92 </para> 100 </para>
93 101
94 <table pgwide="1" frame="none" id="v4l2-subdev-edid"> 102 <table pgwide="1" frame="none" id="v4l2-edid">
95 <title>struct <structname>v4l2_subdev_edid</structname></title> 103 <title>struct <structname>v4l2_edid</structname></title>
96 <tgroup cols="3"> 104 <tgroup cols="3">
97 &cs-str; 105 &cs-str;
98 <tbody valign="top"> 106 <tbody valign="top">
99 <row> 107 <row>
100 <entry>__u32</entry> 108 <entry>__u32</entry>
101 <entry><structfield>pad</structfield></entry> 109 <entry><structfield>pad</structfield></entry>
102 <entry>Pad for which to get/set the EDID blocks.</entry> 110 <entry>Pad for which to get/set the EDID blocks. When used with a video device
111 node the pad represents the input or output index as returned by
112 &VIDIOC-ENUMINPUT; and &VIDIOC-ENUMOUTPUT; respectively.</entry>
103 </row> 113 </row>
104 <row> 114 <row>
105 <entry>__u32</entry> 115 <entry>__u32</entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml b/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml
index b3bb9575b2e0..e9f6735c0823 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml
@@ -327,7 +327,12 @@ These controls are described in <xref
327These controls are described in <xref 327These controls are described in <xref
328 linkend="fm-rx-controls" />.</entry> 328 linkend="fm-rx-controls" />.</entry>
329 </row> 329 </row>
330 330 <row>
331 <entry><constant>V4L2_CTRL_CLASS_RF_TUNER</constant></entry>
332 <entry>0xa20000</entry>
333 <entry>The class containing RF tuner controls.
334These controls are described in <xref linkend="rf-tuner-controls" />.</entry>
335 </row>
331 </tbody> 336 </tbody>
332 </tgroup> 337 </tgroup>
333 </table> 338 </table>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml b/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml
index ee8f56e1bac0..4fe19a7a9a31 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml
@@ -172,6 +172,13 @@ capture and output devices.</entry>
172 </row> 172 </row>
173 <row> 173 <row>
174 <entry></entry> 174 <entry></entry>
175 <entry>&v4l2-sdr-format;</entry>
176 <entry><structfield>sdr</structfield></entry>
177 <entry>Definition of a data format, see
178<xref linkend="pixfmt" />, used by SDR capture devices.</entry>
179 </row>
180 <row>
181 <entry></entry>
175 <entry>__u8</entry> 182 <entry>__u8</entry>
176 <entry><structfield>raw_data</structfield>[200]</entry> 183 <entry><structfield>raw_data</structfield>[200]</entry>
177 <entry>Place holder for future extensions.</entry> 184 <entry>Place holder for future extensions.</entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-frequency.xml b/Documentation/DocBook/media/v4l/vidioc-g-frequency.xml
index c7a1c462e724..d1034fb61d15 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-frequency.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-frequency.xml
@@ -109,9 +109,10 @@ See <xref linkend="v4l2-tuner-type" /></entry>
109 <entry>__u32</entry> 109 <entry>__u32</entry>
110 <entry><structfield>frequency</structfield></entry> 110 <entry><structfield>frequency</structfield></entry>
111 <entry>Tuning frequency in units of 62.5 kHz, or if the 111 <entry>Tuning frequency in units of 62.5 kHz, or if the
112&v4l2-tuner; or &v4l2-modulator; <structfield>capabilities</structfield> flag 112&v4l2-tuner; or &v4l2-modulator; <structfield>capability</structfield> flag
113<constant>V4L2_TUNER_CAP_LOW</constant> is set, in units of 62.5 113<constant>V4L2_TUNER_CAP_LOW</constant> is set, in units of 62.5
114Hz.</entry> 114Hz. A 1 Hz unit is used when the <structfield>capability</structfield> flag
115<constant>V4L2_TUNER_CAP_1HZ</constant> is set.</entry>
115 </row> 116 </row>
116 <row> 117 <row>
117 <entry>__u32</entry> 118 <entry>__u32</entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml b/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml
index 7f4ac7e41fa8..7068b599a00d 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml
@@ -113,7 +113,8 @@ change for example with the current video standard.</entry>
113 <entry>The lowest tunable frequency in units of 62.5 113 <entry>The lowest tunable frequency in units of 62.5
114KHz, or if the <structfield>capability</structfield> flag 114KHz, or if the <structfield>capability</structfield> flag
115<constant>V4L2_TUNER_CAP_LOW</constant> is set, in units of 62.5 115<constant>V4L2_TUNER_CAP_LOW</constant> is set, in units of 62.5
116Hz.</entry> 116Hz, or if the <structfield>capability</structfield> flag
117<constant>V4L2_TUNER_CAP_1HZ</constant> is set, in units of 1 Hz.</entry>
117 </row> 118 </row>
118 <row> 119 <row>
119 <entry>__u32</entry> 120 <entry>__u32</entry>
@@ -121,7 +122,8 @@ Hz.</entry>
121 <entry>The highest tunable frequency in units of 62.5 122 <entry>The highest tunable frequency in units of 62.5
122KHz, or if the <structfield>capability</structfield> flag 123KHz, or if the <structfield>capability</structfield> flag
123<constant>V4L2_TUNER_CAP_LOW</constant> is set, in units of 62.5 124<constant>V4L2_TUNER_CAP_LOW</constant> is set, in units of 62.5
124Hz.</entry> 125Hz, or if the <structfield>capability</structfield> flag
126<constant>V4L2_TUNER_CAP_1HZ</constant> is set, in units of 1 Hz.</entry>
125 </row> 127 </row>
126 <row> 128 <row>
127 <entry>__u32</entry> 129 <entry>__u32</entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml b/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml
index 6cc82010c736..b0d865933da6 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml
@@ -134,7 +134,9 @@ the structure refers to a radio tuner the
134 <entry spanname="hspan">The lowest tunable frequency in 134 <entry spanname="hspan">The lowest tunable frequency in
135units of 62.5 kHz, or if the <structfield>capability</structfield> 135units of 62.5 kHz, or if the <structfield>capability</structfield>
136flag <constant>V4L2_TUNER_CAP_LOW</constant> is set, in units of 62.5 136flag <constant>V4L2_TUNER_CAP_LOW</constant> is set, in units of 62.5
137Hz. If multiple frequency bands are supported, then 137Hz, or if the <structfield>capability</structfield> flag
138<constant>V4L2_TUNER_CAP_1HZ</constant> is set, in units of 1 Hz.
139If multiple frequency bands are supported, then
138<structfield>rangelow</structfield> is the lowest frequency 140<structfield>rangelow</structfield> is the lowest frequency
139of all the frequency bands.</entry> 141of all the frequency bands.</entry>
140 </row> 142 </row>
@@ -144,7 +146,9 @@ of all the frequency bands.</entry>
144 <entry spanname="hspan">The highest tunable frequency in 146 <entry spanname="hspan">The highest tunable frequency in
145units of 62.5 kHz, or if the <structfield>capability</structfield> 147units of 62.5 kHz, or if the <structfield>capability</structfield>
146flag <constant>V4L2_TUNER_CAP_LOW</constant> is set, in units of 62.5 148flag <constant>V4L2_TUNER_CAP_LOW</constant> is set, in units of 62.5
147Hz. If multiple frequency bands are supported, then 149Hz, or if the <structfield>capability</structfield> flag
150<constant>V4L2_TUNER_CAP_1HZ</constant> is set, in units of 1 Hz.
151If multiple frequency bands are supported, then
148<structfield>rangehigh</structfield> is the highest frequency 152<structfield>rangehigh</structfield> is the highest frequency
149of all the frequency bands.</entry> 153of all the frequency bands.</entry>
150 </row> 154 </row>
@@ -270,7 +274,7 @@ applications must set the array to zero.</entry>
270 <entry><constant>V4L2_TUNER_CAP_LOW</constant></entry> 274 <entry><constant>V4L2_TUNER_CAP_LOW</constant></entry>
271 <entry>0x0001</entry> 275 <entry>0x0001</entry>
272 <entry>When set, tuning frequencies are expressed in units of 276 <entry>When set, tuning frequencies are expressed in units of
27362.5&nbsp;Hz, otherwise in units of 62.5&nbsp;kHz.</entry> 27762.5 Hz instead of 62.5 kHz.</entry>
274 </row> 278 </row>
275 <row> 279 <row>
276 <entry><constant>V4L2_TUNER_CAP_NORM</constant></entry> 280 <entry><constant>V4L2_TUNER_CAP_NORM</constant></entry>
@@ -360,6 +364,11 @@ radio tuners.</entry>
360 <entry>The range to search when using the hardware seek functionality 364 <entry>The range to search when using the hardware seek functionality
361 is programmable, see &VIDIOC-S-HW-FREQ-SEEK; for details.</entry> 365 is programmable, see &VIDIOC-S-HW-FREQ-SEEK; for details.</entry>
362 </row> 366 </row>
367 <row>
368 <entry><constant>V4L2_TUNER_CAP_1HZ</constant></entry>
369 <entry>0x1000</entry>
370 <entry>When set, tuning frequencies are expressed in units of 1 Hz instead of 62.5 kHz.</entry>
371 </row>
363 </tbody> 372 </tbody>
364 </tgroup> 373 </tgroup>
365 </table> 374 </table>
diff --git a/Documentation/DocBook/media/v4l/vidioc-querycap.xml b/Documentation/DocBook/media/v4l/vidioc-querycap.xml
index d5a3c97b206a..370d49d6fb64 100644
--- a/Documentation/DocBook/media/v4l/vidioc-querycap.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-querycap.xml
@@ -296,6 +296,12 @@ modulator programming see
296<xref linkend="tuner" />.</entry> 296<xref linkend="tuner" />.</entry>
297 </row> 297 </row>
298 <row> 298 <row>
299 <entry><constant>V4L2_CAP_SDR_CAPTURE</constant></entry>
300 <entry>0x00100000</entry>
301 <entry>The device supports the
302<link linkend="sdr">SDR Capture</link> interface.</entry>
303 </row>
304 <row>
299 <entry><constant>V4L2_CAP_READWRITE</constant></entry> 305 <entry><constant>V4L2_CAP_READWRITE</constant></entry>
300 <entry>0x01000000</entry> 306 <entry>0x01000000</entry>
301 <entry>The device supports the <link 307 <entry>The device supports the <link
diff --git a/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml b/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml
index 5b379e752194..a5fc4c4880f3 100644
--- a/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml
@@ -121,7 +121,9 @@ field and the &v4l2-tuner; <structfield>index</structfield> field.</entry>
121 <entry>If non-zero, the lowest tunable frequency of the band to 121 <entry>If non-zero, the lowest tunable frequency of the band to
122search in units of 62.5 kHz, or if the &v4l2-tuner; 122search in units of 62.5 kHz, or if the &v4l2-tuner;
123<structfield>capability</structfield> field has the 123<structfield>capability</structfield> field has the
124<constant>V4L2_TUNER_CAP_LOW</constant> flag set, in units of 62.5 Hz. 124<constant>V4L2_TUNER_CAP_LOW</constant> flag set, in units of 62.5 Hz or if the &v4l2-tuner;
125<structfield>capability</structfield> field has the
126<constant>V4L2_TUNER_CAP_1HZ</constant> flag set, in units of 1 Hz.
125If <structfield>rangelow</structfield> is zero a reasonable default value 127If <structfield>rangelow</structfield> is zero a reasonable default value
126is used.</entry> 128is used.</entry>
127 </row> 129 </row>
@@ -131,7 +133,9 @@ is used.</entry>
131 <entry>If non-zero, the highest tunable frequency of the band to 133 <entry>If non-zero, the highest tunable frequency of the band to
132search in units of 62.5 kHz, or if the &v4l2-tuner; 134search in units of 62.5 kHz, or if the &v4l2-tuner;
133<structfield>capability</structfield> field has the 135<structfield>capability</structfield> field has the
134<constant>V4L2_TUNER_CAP_LOW</constant> flag set, in units of 62.5 Hz. 136<constant>V4L2_TUNER_CAP_LOW</constant> flag set, in units of 62.5 Hz or if the &v4l2-tuner;
137<structfield>capability</structfield> field has the
138<constant>V4L2_TUNER_CAP_1HZ</constant> flag set, in units of 1 Hz.
135If <structfield>rangehigh</structfield> is zero a reasonable default value 139If <structfield>rangehigh</structfield> is zero a reasonable default value
136is used.</entry> 140is used.</entry>
137 </row> 141 </row>
diff --git a/Documentation/DocBook/media/v4l/vidioc-streamon.xml b/Documentation/DocBook/media/v4l/vidioc-streamon.xml
index 65dff55079d7..df2c63d07bac 100644
--- a/Documentation/DocBook/media/v4l/vidioc-streamon.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-streamon.xml
@@ -52,16 +52,24 @@
52 <para>The <constant>VIDIOC_STREAMON</constant> and 52 <para>The <constant>VIDIOC_STREAMON</constant> and
53<constant>VIDIOC_STREAMOFF</constant> ioctl start and stop the capture 53<constant>VIDIOC_STREAMOFF</constant> ioctl start and stop the capture
54or output process during streaming (<link linkend="mmap">memory 54or output process during streaming (<link linkend="mmap">memory
55mapping</link> or <link linkend="userp">user pointer</link>) I/O.</para> 55mapping</link>, <link linkend="userp">user pointer</link> or
56<link linkend="dmabuf">DMABUF</link>) I/O.</para>
56 57
57 <para>Specifically the capture hardware is disabled and no input 58 <para>Capture hardware is disabled and no input
58buffers are filled (if there are any empty buffers in the incoming 59buffers are filled (if there are any empty buffers in the incoming
59queue) until <constant>VIDIOC_STREAMON</constant> has been called. 60queue) until <constant>VIDIOC_STREAMON</constant> has been called.
60Accordingly the output hardware is disabled, no video signal is 61Output hardware is disabled and no video signal is
61produced until <constant>VIDIOC_STREAMON</constant> has been called. 62produced until <constant>VIDIOC_STREAMON</constant> has been called.
62The ioctl will succeed when at least one output buffer is in the 63The ioctl will succeed when at least one output buffer is in the
63incoming queue.</para> 64incoming queue.</para>
64 65
66 <para>Memory-to-memory devices will not start until
67<constant>VIDIOC_STREAMON</constant> has been called for both the capture
68and output stream types.</para>
69
70 <para>If <constant>VIDIOC_STREAMON</constant> fails then any already
71queued buffers will remain queued.</para>
72
65 <para>The <constant>VIDIOC_STREAMOFF</constant> ioctl, apart of 73 <para>The <constant>VIDIOC_STREAMOFF</constant> ioctl, apart of
66aborting or finishing any DMA in progress, unlocks any user pointer 74aborting or finishing any DMA in progress, unlocks any user pointer
67buffers locked in physical memory, and it removes all buffers from the 75buffers locked in physical memory, and it removes all buffers from the
@@ -70,14 +78,22 @@ dequeued yet will be lost, likewise all images enqueued for output but
70not transmitted yet. I/O returns to the same state as after calling 78not transmitted yet. I/O returns to the same state as after calling
71&VIDIOC-REQBUFS; and can be restarted accordingly.</para> 79&VIDIOC-REQBUFS; and can be restarted accordingly.</para>
72 80
81 <para>If buffers have been queued with &VIDIOC-QBUF; and
82<constant>VIDIOC_STREAMOFF</constant> is called without ever having
83called <constant>VIDIOC_STREAMON</constant>, then those queued buffers
84will also be removed from the incoming queue and all are returned to the
85same state as after calling &VIDIOC-REQBUFS; and can be restarted
86accordingly.</para>
87
73 <para>Both ioctls take a pointer to an integer, the desired buffer or 88 <para>Both ioctls take a pointer to an integer, the desired buffer or
74stream type. This is the same as &v4l2-requestbuffers; 89stream type. This is the same as &v4l2-requestbuffers;
75<structfield>type</structfield>.</para> 90<structfield>type</structfield>.</para>
76 91
77 <para>If <constant>VIDIOC_STREAMON</constant> is called when streaming 92 <para>If <constant>VIDIOC_STREAMON</constant> is called when streaming
78is already in progress, or if <constant>VIDIOC_STREAMOFF</constant> is called 93is already in progress, or if <constant>VIDIOC_STREAMOFF</constant> is called
79when streaming is already stopped, then the ioctl does nothing and 0 is 94when streaming is already stopped, then 0 is returned. Nothing happens in the
80returned.</para> 95case of <constant>VIDIOC_STREAMON</constant>, but <constant>VIDIOC_STREAMOFF</constant>
96will return queued buffers to their starting state as mentioned above.</para>
81 97
82 <para>Note that applications can be preempted for unknown periods right 98 <para>Note that applications can be preempted for unknown periods right
83before or after the <constant>VIDIOC_STREAMON</constant> or 99before or after the <constant>VIDIOC_STREAMON</constant> or
@@ -93,7 +109,7 @@ synchronize with other events.</para>
93 <varlistentry> 109 <varlistentry>
94 <term><errorcode>EINVAL</errorcode></term> 110 <term><errorcode>EINVAL</errorcode></term>
95 <listitem> 111 <listitem>
96 <para>The buffer<structfield>type</structfield> is not supported, 112 <para>The buffer <structfield>type</structfield> is not supported,
97 or no buffers have been allocated (memory mapping) or enqueued 113 or no buffers have been allocated (memory mapping) or enqueued
98 (output) yet.</para> 114 (output) yet.</para>
99 </listitem> 115 </listitem>
diff --git a/Documentation/DocBook/media_api.tmpl b/Documentation/DocBook/media_api.tmpl
index 4c8d282545a2..4decb46bfa76 100644
--- a/Documentation/DocBook/media_api.tmpl
+++ b/Documentation/DocBook/media_api.tmpl
@@ -34,22 +34,20 @@
34 34
35<book id="media_api"> 35<book id="media_api">
36<bookinfo> 36<bookinfo>
37<title>LINUX MEDIA INFRASTRUCTURE API</title> 37 <title>LINUX MEDIA INFRASTRUCTURE API</title>
38 38
39<copyright> 39 <copyright>
40 <year>2009-2012</year> 40 <year>2009-2014</year>
41 <holder>LinuxTV Developers</holder> 41 <holder>LinuxTV Developers</holder>
42</copyright> 42 </copyright>
43 43
44<legalnotice> 44 <legalnotice>
45 45 <para>Permission is granted to copy, distribute and/or modify
46<para>Permission is granted to copy, distribute and/or modify 46 this document under the terms of the GNU Free Documentation License,
47this document under the terms of the GNU Free Documentation License, 47 Version 1.1 or any later version published by the Free Software
48Version 1.1 or any later version published by the Free Software 48 Foundation. A copy of the license is included in the chapter entitled
49Foundation. A copy of the license is included in the chapter entitled 49 "GNU Free Documentation License"</para>
50"GNU Free Documentation License"</para> 50 </legalnotice>
51</legalnotice>
52
53</bookinfo> 51</bookinfo>
54 52
55<toc></toc> <!-- autogenerated --> 53<toc></toc> <!-- autogenerated -->
@@ -58,12 +56,13 @@ Foundation. A copy of the license is included in the chapter entitled
58 <title>Introduction</title> 56 <title>Introduction</title>
59 57
60 <para>This document covers the Linux Kernel to Userspace API's used by 58 <para>This document covers the Linux Kernel to Userspace API's used by
61 video and radio straming devices, including video cameras, 59 video and radio streaming devices, including video cameras,
62 analog and digital TV receiver cards, AM/FM receiver cards, 60 analog and digital TV receiver cards, AM/FM receiver cards,
63 streaming capture devices.</para> 61 streaming capture and output devices, codec devices and remote
62 controllers.</para>
64 <para>It is divided into four parts.</para> 63 <para>It is divided into four parts.</para>
65 <para>The first part covers radio, capture, 64 <para>The first part covers radio, video capture and output,
66 cameras and analog TV devices.</para> 65 cameras, analog TV devices and codecs.</para>
67 <para>The second part covers the 66 <para>The second part covers the
68 API used for digital TV and Internet reception via one of the 67 API used for digital TV and Internet reception via one of the
69 several digital tv standards. While it is called as DVB API, 68 several digital tv standards. While it is called as DVB API,
@@ -75,55 +74,14 @@ Foundation. A copy of the license is included in the chapter entitled
75 <para>For additional information and for the latest development code, 74 <para>For additional information and for the latest development code,
76 see: <ulink url="http://linuxtv.org">http://linuxtv.org</ulink>.</para> 75 see: <ulink url="http://linuxtv.org">http://linuxtv.org</ulink>.</para>
77 <para>For discussing improvements, reporting troubles, sending new drivers, etc, please mail to: <ulink url="http://vger.kernel.org/vger-lists.html#linux-media">Linux Media Mailing List (LMML).</ulink>.</para> 76 <para>For discussing improvements, reporting troubles, sending new drivers, etc, please mail to: <ulink url="http://vger.kernel.org/vger-lists.html#linux-media">Linux Media Mailing List (LMML).</ulink>.</para>
78
79</preface> 77</preface>
80 78
81<part id="v4l2spec"> 79<part id="v4l2spec">&sub-v4l2;</part>
82&sub-v4l2; 80<part id="dvbapi">&sub-dvbapi;</part>
83</part> 81<part id="remotes">&sub-remote_controllers;</part>
84<part id="dvbapi"> 82<part id="media_common">&sub-media-controller;</part>
85&sub-dvbapi;
86</part>
87<part id="v4ldvb_common">
88<partinfo>
89<authorgroup>
90<author>
91<firstname>Mauro</firstname>
92<surname>Chehab</surname>
93<othername role="mi">Carvalho</othername>
94<affiliation><address><email>mchehab@redhat.com</email></address></affiliation>
95<contrib>Initial version.</contrib>
96</author>
97</authorgroup>
98<copyright>
99 <year>2009-2012</year>
100 <holder>Mauro Carvalho Chehab</holder>
101</copyright>
102
103<revhistory>
104<!-- Put document revisions here, newest first. -->
105<revision>
106<revnumber>1.0.0</revnumber>
107<date>2009-09-06</date>
108<authorinitials>mcc</authorinitials>
109<revremark>Initial revision</revremark>
110</revision>
111</revhistory>
112</partinfo>
113
114<title>Remote Controller API</title>
115<chapter id="remote_controllers">
116&sub-remote_controllers;
117</chapter>
118</part>
119<part id="media_common">
120&sub-media-controller;
121</part>
122
123<chapter id="gen_errors">
124&sub-gen-errors;
125</chapter>
126 83
84<chapter id="gen_errors">&sub-gen-errors;</chapter>
127 85
128&sub-fdl-appendix; 86&sub-fdl-appendix;
129 87
diff --git a/Documentation/DocBook/w1.tmpl b/Documentation/DocBook/w1.tmpl
new file mode 100644
index 000000000000..b0228d4c81bb
--- /dev/null
+++ b/Documentation/DocBook/w1.tmpl
@@ -0,0 +1,101 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
4
5<book id="w1id">
6 <bookinfo>
7 <title>W1: Dallas' 1-wire bus</title>
8
9 <authorgroup>
10 <author>
11 <firstname>David</firstname>
12 <surname>Fries</surname>
13 <affiliation>
14 <address>
15 <email>David@Fries.net</email>
16 </address>
17 </affiliation>
18 </author>
19
20 </authorgroup>
21
22 <copyright>
23 <year>2013</year>
24 <!--
25 <holder></holder>
26 -->
27 </copyright>
28
29 <legalnotice>
30 <para>
31 This documentation is free software; you can redistribute
32 it and/or modify it under the terms of the GNU General Public
33 License version 2.
34 </para>
35
36 <para>
37 This program is distributed in the hope that it will be
38 useful, but WITHOUT ANY WARRANTY; without even the implied
39 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
40 For more details see the file COPYING in the source
41 distribution of Linux.
42 </para>
43 </legalnotice>
44 </bookinfo>
45
46 <toc></toc>
47
48 <chapter id="w1_internal">
49 <title>W1 API internal to the kernel</title>
50
51 <sect1 id="w1_internal_api">
52 <title>W1 API internal to the kernel</title>
53 <sect2 id="w1.h">
54 <title>drivers/w1/w1.h</title>
55 <para>W1 core functions.</para>
56!Idrivers/w1/w1.h
57 </sect2>
58
59 <sect2 id="w1.c">
60 <title>drivers/w1/w1.c</title>
61 <para>W1 core functions.</para>
62!Idrivers/w1/w1.c
63 </sect2>
64
65 <sect2 id="w1_family.h">
66 <title>drivers/w1/w1_family.h</title>
67 <para>Allows registering device family operations.</para>
68!Idrivers/w1/w1_family.h
69 </sect2>
70
71 <sect2 id="w1_family.c">
72 <title>drivers/w1/w1_family.c</title>
73 <para>Allows registering device family operations.</para>
74!Edrivers/w1/w1_family.c
75 </sect2>
76
77 <sect2 id="w1_int.c">
78 <title>drivers/w1/w1_int.c</title>
79 <para>W1 internal initialization for master devices.</para>
80!Edrivers/w1/w1_int.c
81 </sect2>
82
83 <sect2 id="w1_netlink.h">
84 <title>drivers/w1/w1_netlink.h</title>
85 <para>W1 external netlink API structures and commands.</para>
86!Idrivers/w1/w1_netlink.h
87 </sect2>
88
89 <sect2 id="w1_io.c">
90 <title>drivers/w1/w1_io.c</title>
91 <para>W1 input/output.</para>
92!Edrivers/w1/w1_io.c
93!Idrivers/w1/w1_io.c
94 </sect2>
95
96 </sect1>
97
98
99 </chapter>
100
101</book>
diff --git a/Documentation/DocBook/writing-an-alsa-driver.tmpl b/Documentation/DocBook/writing-an-alsa-driver.tmpl
index 06741e925985..d0056a4e9c53 100644
--- a/Documentation/DocBook/writing-an-alsa-driver.tmpl
+++ b/Documentation/DocBook/writing-an-alsa-driver.tmpl
@@ -468,8 +468,6 @@
468 return err; 468 return err;
469 } 469 }
470 470
471 snd_card_set_dev(card, &pci->dev);
472
473 *rchip = chip; 471 *rchip = chip;
474 return 0; 472 return 0;
475 } 473 }
@@ -492,7 +490,8 @@
492 } 490 }
493 491
494 /* (2) */ 492 /* (2) */
495 err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card); 493 err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
494 0, &card);
496 if (err < 0) 495 if (err < 0)
497 return err; 496 return err;
498 497
@@ -591,7 +590,8 @@
591 struct snd_card *card; 590 struct snd_card *card;
592 int err; 591 int err;
593 .... 592 ....
594 err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card); 593 err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
594 0, &card);
595]]> 595]]>
596 </programlisting> 596 </programlisting>
597 </informalexample> 597 </informalexample>
@@ -809,28 +809,34 @@
809 809
810 <para> 810 <para>
811 As mentioned above, to create a card instance, call 811 As mentioned above, to create a card instance, call
812 <function>snd_card_create()</function>. 812 <function>snd_card_new()</function>.
813 813
814 <informalexample> 814 <informalexample>
815 <programlisting> 815 <programlisting>
816<![CDATA[ 816<![CDATA[
817 struct snd_card *card; 817 struct snd_card *card;
818 int err; 818 int err;
819 err = snd_card_create(index, id, module, extra_size, &card); 819 err = snd_card_new(&pci->dev, index, id, module, extra_size, &card);
820]]> 820]]>
821 </programlisting> 821 </programlisting>
822 </informalexample> 822 </informalexample>
823 </para> 823 </para>
824 824
825 <para> 825 <para>
826 The function takes five arguments, the card-index number, the 826 The function takes six arguments: the parent device pointer,
827 id string, the module pointer (usually 827 the card-index number, the id string, the module pointer (usually
828 <constant>THIS_MODULE</constant>), 828 <constant>THIS_MODULE</constant>),
829 the size of extra-data space, and the pointer to return the 829 the size of extra-data space, and the pointer to return the
830 card instance. The extra_size argument is used to 830 card instance. The extra_size argument is used to
831 allocate card-&gt;private_data for the 831 allocate card-&gt;private_data for the
832 chip-specific data. Note that these data 832 chip-specific data. Note that these data
833 are allocated by <function>snd_card_create()</function>. 833 are allocated by <function>snd_card_new()</function>.
834 </para>
835
836 <para>
837 The first argument, the pointer of struct
838 <structname>device</structname>, specifies the parent device.
839 For PCI devices, typically &amp;pci-&gt; is passed there.
834 </para> 840 </para>
835 </section> 841 </section>
836 842
@@ -916,16 +922,16 @@
916 </para> 922 </para>
917 923
918 <section id="card-management-chip-specific-snd-card-new"> 924 <section id="card-management-chip-specific-snd-card-new">
919 <title>1. Allocating via <function>snd_card_create()</function>.</title> 925 <title>1. Allocating via <function>snd_card_new()</function>.</title>
920 <para> 926 <para>
921 As mentioned above, you can pass the extra-data-length 927 As mentioned above, you can pass the extra-data-length
922 to the 4th argument of <function>snd_card_create()</function>, i.e. 928 to the 5th argument of <function>snd_card_new()</function>, i.e.
923 929
924 <informalexample> 930 <informalexample>
925 <programlisting> 931 <programlisting>
926<![CDATA[ 932<![CDATA[
927 err = snd_card_create(index[dev], id[dev], THIS_MODULE, 933 err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
928 sizeof(struct mychip), &card); 934 sizeof(struct mychip), &card);
929]]> 935]]>
930 </programlisting> 936 </programlisting>
931 </informalexample> 937 </informalexample>
@@ -954,7 +960,7 @@
954 960
955 <para> 961 <para>
956 After allocating a card instance via 962 After allocating a card instance via
957 <function>snd_card_create()</function> (with 963 <function>snd_card_new()</function> (with
958 <constant>0</constant> on the 4th arg), call 964 <constant>0</constant> on the 4th arg), call
959 <function>kzalloc()</function>. 965 <function>kzalloc()</function>.
960 966
@@ -963,7 +969,8 @@
963<![CDATA[ 969<![CDATA[
964 struct snd_card *card; 970 struct snd_card *card;
965 struct mychip *chip; 971 struct mychip *chip;
966 err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card); 972 err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
973 0, &card);
967 ..... 974 .....
968 chip = kzalloc(sizeof(*chip), GFP_KERNEL); 975 chip = kzalloc(sizeof(*chip), GFP_KERNEL);
969]]> 976]]>
@@ -1170,8 +1177,6 @@
1170 return err; 1177 return err;
1171 } 1178 }
1172 1179
1173 snd_card_set_dev(card, &pci->dev);
1174
1175 *rchip = chip; 1180 *rchip = chip;
1176 return 0; 1181 return 0;
1177 } 1182 }
@@ -1526,30 +1531,6 @@
1526 1531
1527 </section> 1532 </section>
1528 1533
1529 <section id="pci-resource-device-struct">
1530 <title>Registration of Device Struct</title>
1531 <para>
1532 At some point, typically after calling <function>snd_device_new()</function>,
1533 you need to register the struct <structname>device</structname> of the chip
1534 you're handling for udev and co. ALSA provides a macro for compatibility with
1535 older kernels. Simply call like the following:
1536 <informalexample>
1537 <programlisting>
1538<![CDATA[
1539 snd_card_set_dev(card, &pci->dev);
1540]]>
1541 </programlisting>
1542 </informalexample>
1543 so that it stores the PCI's device pointer to the card. This will be
1544 referred by ALSA core functions later when the devices are registered.
1545 </para>
1546 <para>
1547 In the case of non-PCI, pass the proper device struct pointer of the BUS
1548 instead. (In the case of legacy ISA without PnP, you don't have to do
1549 anything.)
1550 </para>
1551 </section>
1552
1553 <section id="pci-resource-entries"> 1534 <section id="pci-resource-entries">
1554 <title>PCI Entries</title> 1535 <title>PCI Entries</title>
1555 <para> 1536 <para>
@@ -5740,7 +5721,8 @@ struct _snd_pcm_runtime {
5740 struct mychip *chip; 5721 struct mychip *chip;
5741 int err; 5722 int err;
5742 .... 5723 ....
5743 err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card); 5724 err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
5725 0, &card);
5744 .... 5726 ....
5745 chip = kzalloc(sizeof(*chip), GFP_KERNEL); 5727 chip = kzalloc(sizeof(*chip), GFP_KERNEL);
5746 .... 5728 ....
@@ -5752,7 +5734,7 @@ struct _snd_pcm_runtime {
5752 </informalexample> 5734 </informalexample>
5753 5735
5754 When you created the chip data with 5736 When you created the chip data with
5755 <function>snd_card_create()</function>, it's anyway accessible 5737 <function>snd_card_new()</function>, it's anyway accessible
5756 via <structfield>private_data</structfield> field. 5738 via <structfield>private_data</structfield> field.
5757 5739
5758 <informalexample> 5740 <informalexample>
@@ -5766,8 +5748,8 @@ struct _snd_pcm_runtime {
5766 struct mychip *chip; 5748 struct mychip *chip;
5767 int err; 5749 int err;
5768 .... 5750 ....
5769 err = snd_card_create(index[dev], id[dev], THIS_MODULE, 5751 err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
5770 sizeof(struct mychip), &card); 5752 sizeof(struct mychip), &card);
5771 .... 5753 ....
5772 chip = card->private_data; 5754 chip = card->private_data;
5773 .... 5755 ....