aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/ABI/testing/sysfs-block-zram99
-rw-r--r--Documentation/DocBook/media-entities.tmpl6
-rw-r--r--Documentation/DocBook/v4l/compat.xml24
-rw-r--r--Documentation/DocBook/v4l/controls.xml12
-rw-r--r--Documentation/DocBook/v4l/dev-rds.xml68
-rw-r--r--Documentation/DocBook/v4l/dev-teletext.xml29
-rw-r--r--Documentation/DocBook/v4l/pixfmt-packed-rgb.xml2
-rw-r--r--Documentation/DocBook/v4l/pixfmt-srggb10.xml90
-rw-r--r--Documentation/DocBook/v4l/pixfmt-srggb8.xml67
-rw-r--r--Documentation/DocBook/v4l/pixfmt-y10.xml79
-rw-r--r--Documentation/DocBook/v4l/pixfmt.xml32
-rw-r--r--Documentation/DocBook/v4l/v4l2.xml10
-rw-r--r--Documentation/DocBook/v4l/videodev2.h.xml106
-rw-r--r--Documentation/DocBook/v4l/vidioc-g-dv-preset.xml3
-rw-r--r--Documentation/DocBook/v4l/vidioc-g-dv-timings.xml3
-rw-r--r--Documentation/DocBook/v4l/vidioc-query-dv-preset.xml2
-rw-r--r--Documentation/DocBook/v4l/vidioc-querycap.xml7
-rw-r--r--Documentation/DocBook/v4l/vidioc-queryctrl.xml18
-rw-r--r--Documentation/DocBook/v4l/vidioc-s-hw-freq-seek.xml10
-rw-r--r--Documentation/accounting/getdelays.c38
-rw-r--r--Documentation/cgroups/cgroups.txt14
-rw-r--r--Documentation/coccinelle.txt50
-rw-r--r--Documentation/devices.txt9
-rw-r--r--Documentation/dvb/get_dvb_firmware46
-rw-r--r--Documentation/dvb/lmedm04.txt58
-rw-r--r--Documentation/fb/viafb.txt48
-rw-r--r--Documentation/feature-removal-schedule.txt57
-rw-r--r--Documentation/filesystems/00-INDEX2
-rw-r--r--Documentation/filesystems/9p.txt4
-rw-r--r--Documentation/filesystems/ext4.txt14
-rw-r--r--Documentation/filesystems/proc.txt17
-rw-r--r--Documentation/filesystems/smbfs.txt8
-rw-r--r--Documentation/hwmon/it8728
-rw-r--r--Documentation/hwmon/lm8560
-rw-r--r--Documentation/hwmon/lm9042
-rw-r--r--Documentation/hwmon/pcf859118
-rw-r--r--Documentation/hwmon/sysfs-interface15
-rw-r--r--Documentation/ioctl/ioctl-number.txt3
-rw-r--r--Documentation/kbuild/kconfig-language.txt3
-rw-r--r--Documentation/kbuild/makefiles.txt7
-rw-r--r--Documentation/kbuild/modules.txt733
-rw-r--r--Documentation/kernel-parameters.txt5
-rw-r--r--Documentation/networking/phy.txt18
-rw-r--r--Documentation/sysctl/vm.txt12
-rw-r--r--Documentation/video4linux/CARDLIST.cx881
-rw-r--r--Documentation/video4linux/CARDLIST.em28xx3
-rw-r--r--Documentation/video4linux/CARDLIST.saa71342
-rw-r--r--Documentation/video4linux/bttv/MAKEDEV1
-rw-r--r--Documentation/video4linux/gspca.txt2
-rw-r--r--Documentation/video4linux/v4l2-framework.txt35
50 files changed, 1416 insertions, 604 deletions
diff --git a/Documentation/ABI/testing/sysfs-block-zram b/Documentation/ABI/testing/sysfs-block-zram
new file mode 100644
index 000000000000..c8b3b48ec62c
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-block-zram
@@ -0,0 +1,99 @@
1What: /sys/block/zram<id>/disksize
2Date: August 2010
3Contact: Nitin Gupta <ngupta@vflare.org>
4Description:
5 The disksize file is read-write and specifies the disk size
6 which represents the limit on the *uncompressed* worth of data
7 that can be stored in this disk.
8
9What: /sys/block/zram<id>/initstate
10Date: August 2010
11Contact: Nitin Gupta <ngupta@vflare.org>
12Description:
13 The disksize file is read-only and shows the initialization
14 state of the device.
15
16What: /sys/block/zram<id>/reset
17Date: August 2010
18Contact: Nitin Gupta <ngupta@vflare.org>
19Description:
20 The disksize file is write-only and allows resetting the
21 device. The reset operation frees all the memory assocaited
22 with this device.
23
24What: /sys/block/zram<id>/num_reads
25Date: August 2010
26Contact: Nitin Gupta <ngupta@vflare.org>
27Description:
28 The num_reads file is read-only and specifies the number of
29 reads (failed or successful) done on this device.
30
31What: /sys/block/zram<id>/num_writes
32Date: August 2010
33Contact: Nitin Gupta <ngupta@vflare.org>
34Description:
35 The num_writes file is read-only and specifies the number of
36 writes (failed or successful) done on this device.
37
38What: /sys/block/zram<id>/invalid_io
39Date: August 2010
40Contact: Nitin Gupta <ngupta@vflare.org>
41Description:
42 The invalid_io file is read-only and specifies the number of
43 non-page-size-aligned I/O requests issued to this device.
44
45What: /sys/block/zram<id>/notify_free
46Date: August 2010
47Contact: Nitin Gupta <ngupta@vflare.org>
48Description:
49 The notify_free file is read-only and specifies the number of
50 swap slot free notifications received by this device. These
51 notifications are send to a swap block device when a swap slot
52 is freed. This statistic is applicable only when this disk is
53 being used as a swap disk.
54
55What: /sys/block/zram<id>/discard
56Date: August 2010
57Contact: Nitin Gupta <ngupta@vflare.org>
58Description:
59 The discard file is read-only and specifies the number of
60 discard requests received by this device. These requests
61 provide information to block device regarding blocks which are
62 no longer used by filesystem.
63
64What: /sys/block/zram<id>/zero_pages
65Date: August 2010
66Contact: Nitin Gupta <ngupta@vflare.org>
67Description:
68 The zero_pages file is read-only and specifies number of zero
69 filled pages written to this disk. No memory is allocated for
70 such pages.
71
72What: /sys/block/zram<id>/orig_data_size
73Date: August 2010
74Contact: Nitin Gupta <ngupta@vflare.org>
75Description:
76 The orig_data_size file is read-only and specifies uncompressed
77 size of data stored in this disk. This excludes zero-filled
78 pages (zero_pages) since no memory is allocated for them.
79 Unit: bytes
80
81What: /sys/block/zram<id>/compr_data_size
82Date: August 2010
83Contact: Nitin Gupta <ngupta@vflare.org>
84Description:
85 The compr_data_size file is read-only and specifies compressed
86 size of data stored in this disk. So, compression ratio can be
87 calculated using orig_data_size and this statistic.
88 Unit: bytes
89
90What: /sys/block/zram<id>/mem_used_total
91Date: August 2010
92Contact: Nitin Gupta <ngupta@vflare.org>
93Description:
94 The mem_used_total file is read-only and specifies the amount
95 of memory, including allocator fragmentation and metadata
96 overhead, allocated for this disk. So, allocator space
97 efficiency can be calculated using compr_data_size and this
98 statistic.
99 Unit: bytes \ No newline at end of file
diff --git a/Documentation/DocBook/media-entities.tmpl b/Documentation/DocBook/media-entities.tmpl
index 6ae97157b1c7..be34dcbe0d90 100644
--- a/Documentation/DocBook/media-entities.tmpl
+++ b/Documentation/DocBook/media-entities.tmpl
@@ -250,6 +250,9 @@
250<!ENTITY sub-yuv422p SYSTEM "v4l/pixfmt-yuv422p.xml"> 250<!ENTITY sub-yuv422p SYSTEM "v4l/pixfmt-yuv422p.xml">
251<!ENTITY sub-yuyv SYSTEM "v4l/pixfmt-yuyv.xml"> 251<!ENTITY sub-yuyv SYSTEM "v4l/pixfmt-yuyv.xml">
252<!ENTITY sub-yvyu SYSTEM "v4l/pixfmt-yvyu.xml"> 252<!ENTITY sub-yvyu SYSTEM "v4l/pixfmt-yvyu.xml">
253<!ENTITY sub-srggb10 SYSTEM "v4l/pixfmt-srggb10.xml">
254<!ENTITY sub-srggb8 SYSTEM "v4l/pixfmt-srggb8.xml">
255<!ENTITY sub-y10 SYSTEM "v4l/pixfmt-y10.xml">
253<!ENTITY sub-pixfmt SYSTEM "v4l/pixfmt.xml"> 256<!ENTITY sub-pixfmt SYSTEM "v4l/pixfmt.xml">
254<!ENTITY sub-cropcap SYSTEM "v4l/vidioc-cropcap.xml"> 257<!ENTITY sub-cropcap SYSTEM "v4l/vidioc-cropcap.xml">
255<!ENTITY sub-dbg-g-register SYSTEM "v4l/vidioc-dbg-g-register.xml"> 258<!ENTITY sub-dbg-g-register SYSTEM "v4l/vidioc-dbg-g-register.xml">
@@ -347,6 +350,9 @@
347<!ENTITY yuv422p SYSTEM "v4l/pixfmt-yuv422p.xml"> 350<!ENTITY yuv422p SYSTEM "v4l/pixfmt-yuv422p.xml">
348<!ENTITY yuyv SYSTEM "v4l/pixfmt-yuyv.xml"> 351<!ENTITY yuyv SYSTEM "v4l/pixfmt-yuyv.xml">
349<!ENTITY yvyu SYSTEM "v4l/pixfmt-yvyu.xml"> 352<!ENTITY yvyu SYSTEM "v4l/pixfmt-yvyu.xml">
353<!ENTITY srggb10 SYSTEM "v4l/pixfmt-srggb10.xml">
354<!ENTITY srggb8 SYSTEM "v4l/pixfmt-srggb8.xml">
355<!ENTITY y10 SYSTEM "v4l/pixfmt-y10.xml">
350<!ENTITY cropcap SYSTEM "v4l/vidioc-cropcap.xml"> 356<!ENTITY cropcap SYSTEM "v4l/vidioc-cropcap.xml">
351<!ENTITY dbg-g-register SYSTEM "v4l/vidioc-dbg-g-register.xml"> 357<!ENTITY dbg-g-register SYSTEM "v4l/vidioc-dbg-g-register.xml">
352<!ENTITY encoder-cmd SYSTEM "v4l/vidioc-encoder-cmd.xml"> 358<!ENTITY encoder-cmd SYSTEM "v4l/vidioc-encoder-cmd.xml">
diff --git a/Documentation/DocBook/v4l/compat.xml b/Documentation/DocBook/v4l/compat.xml
index 54447f0d0784..c9ce61d981f5 100644
--- a/Documentation/DocBook/v4l/compat.xml
+++ b/Documentation/DocBook/v4l/compat.xml
@@ -21,11 +21,15 @@ API.</para>
21 <title>Opening and Closing Devices</title> 21 <title>Opening and Closing Devices</title>
22 22
23 <para>For compatibility reasons the character device file names 23 <para>For compatibility reasons the character device file names
24recommended for V4L2 video capture, overlay, radio, teletext and raw 24recommended for V4L2 video capture, overlay, radio and raw
25vbi capture devices did not change from those used by V4L. They are 25vbi capture devices did not change from those used by V4L. They are
26listed in <xref linkend="devices" /> and below in <xref 26listed in <xref linkend="devices" /> and below in <xref
27 linkend="v4l-dev" />.</para> 27 linkend="v4l-dev" />.</para>
28 28
29 <para>The teletext devices (minor range 192-223) have been removed in
30V4L2 and no longer exist. There is no hardware available anymore for handling
31pure teletext. Instead raw or sliced VBI is used.</para>
32
29 <para>The V4L <filename>videodev</filename> module automatically 33 <para>The V4L <filename>videodev</filename> module automatically
30assigns minor numbers to drivers in load order, depending on the 34assigns minor numbers to drivers in load order, depending on the
31registered device type. We recommend that V4L2 drivers by default 35registered device type. We recommend that V4L2 drivers by default
@@ -66,13 +70,6 @@ not compatible with V4L or V4L2.</para> </footnote>,
66 <entry>64-127</entry> 70 <entry>64-127</entry>
67 </row> 71 </row>
68 <row> 72 <row>
69 <entry>Teletext decoder</entry>
70 <entry><para><filename>/dev/vtx</filename>,
71<filename>/dev/vtx0</filename> to
72<filename>/dev/vtx31</filename></para></entry>
73 <entry>192-223</entry>
74 </row>
75 <row>
76 <entry>Raw VBI capture</entry> 73 <entry>Raw VBI capture</entry>
77 <entry><para><filename>/dev/vbi</filename>, 74 <entry><para><filename>/dev/vbi</filename>,
78<filename>/dev/vbi0</filename> to 75<filename>/dev/vbi0</filename> to
@@ -2345,6 +2342,17 @@ more information.</para>
2345 </listitem> 2342 </listitem>
2346 </orderedlist> 2343 </orderedlist>
2347 </section> 2344 </section>
2345 <section>
2346 <title>V4L2 in Linux 2.6.37</title>
2347 <orderedlist>
2348 <listitem>
2349 <para>Remove the vtx (videotext/teletext) API. This API was no longer
2350used and no hardware exists to verify the API. Nor were any userspace applications found
2351that used it. It was originally scheduled for removal in 2.6.35.
2352 </para>
2353 </listitem>
2354 </orderedlist>
2355 </section>
2348 2356
2349 <section id="other"> 2357 <section id="other">
2350 <title>Relation of V4L2 to other Linux multimedia APIs</title> 2358 <title>Relation of V4L2 to other Linux multimedia APIs</title>
diff --git a/Documentation/DocBook/v4l/controls.xml b/Documentation/DocBook/v4l/controls.xml
index 8408caaee276..2fae3e87ce73 100644
--- a/Documentation/DocBook/v4l/controls.xml
+++ b/Documentation/DocBook/v4l/controls.xml
@@ -312,10 +312,17 @@ minimum value disables backlight compensation.</entry>
312 information and bits 24-31 must be zero.</entry> 312 information and bits 24-31 must be zero.</entry>
313 </row> 313 </row>
314 <row> 314 <row>
315 <entry><constant>V4L2_CID_ILLUMINATORS_1</constant>
316 <constant>V4L2_CID_ILLUMINATORS_2</constant></entry>
317 <entry>boolean</entry>
318 <entry>Switch on or off the illuminator 1 or 2 of the device
319 (usually a microscope).</entry>
320 </row>
321 <row>
315 <entry><constant>V4L2_CID_LASTP1</constant></entry> 322 <entry><constant>V4L2_CID_LASTP1</constant></entry>
316 <entry></entry> 323 <entry></entry>
317 <entry>End of the predefined control IDs (currently 324 <entry>End of the predefined control IDs (currently
318<constant>V4L2_CID_BG_COLOR</constant> + 1).</entry> 325<constant>V4L2_CID_ILLUMINATORS_2</constant> + 1).</entry>
319 </row> 326 </row>
320 <row> 327 <row>
321 <entry><constant>V4L2_CID_PRIVATE_BASE</constant></entry> 328 <entry><constant>V4L2_CID_PRIVATE_BASE</constant></entry>
@@ -357,9 +364,6 @@ enumerate_menu (void)
357 querymenu.index++) { 364 querymenu.index++) {
358 if (0 == ioctl (fd, &VIDIOC-QUERYMENU;, &amp;querymenu)) { 365 if (0 == ioctl (fd, &VIDIOC-QUERYMENU;, &amp;querymenu)) {
359 printf (" %s\n", querymenu.name); 366 printf (" %s\n", querymenu.name);
360 } else {
361 perror ("VIDIOC_QUERYMENU");
362 exit (EXIT_FAILURE);
363 } 367 }
364 } 368 }
365} 369}
diff --git a/Documentation/DocBook/v4l/dev-rds.xml b/Documentation/DocBook/v4l/dev-rds.xml
index 0869d701b1e5..360d2737e649 100644
--- a/Documentation/DocBook/v4l/dev-rds.xml
+++ b/Documentation/DocBook/v4l/dev-rds.xml
@@ -3,15 +3,16 @@
3 <para>The Radio Data System transmits supplementary 3 <para>The Radio Data System transmits supplementary
4information in binary format, for example the station name or travel 4information in binary format, for example the station name or travel
5information, on an inaudible audio subcarrier of a radio program. This 5information, on an inaudible audio subcarrier of a radio program. This
6interface is aimed at devices capable of receiving and decoding RDS 6interface is aimed at devices capable of receiving and/or transmitting RDS
7information.</para> 7information.</para>
8 8
9 <para>For more information see the core RDS standard <xref linkend="en50067" /> 9 <para>For more information see the core RDS standard <xref linkend="en50067" />
10and the RBDS standard <xref linkend="nrsc4" />.</para> 10and the RBDS standard <xref linkend="nrsc4" />.</para>
11 11
12 <para>Note that the RBDS standard as is used in the USA is almost identical 12 <para>Note that the RBDS standard as is used in the USA is almost identical
13to the RDS standard. Any RDS decoder can also handle RBDS. Only some of the fields 13to the RDS standard. Any RDS decoder/encoder can also handle RBDS. Only some of the
14have slightly different meanings. See the RBDS standard for more information.</para> 14fields have slightly different meanings. See the RBDS standard for more
15information.</para>
15 16
16 <para>The RBDS standard also specifies support for MMBS (Modified Mobile Search). 17 <para>The RBDS standard also specifies support for MMBS (Modified Mobile Search).
17This is a proprietary format which seems to be discontinued. The RDS interface does not 18This is a proprietary format which seems to be discontinued. The RDS interface does not
@@ -21,16 +22,25 @@ be needed, then please contact the linux-media mailing list: &v4l-ml;.</para>
21 <section> 22 <section>
22 <title>Querying Capabilities</title> 23 <title>Querying Capabilities</title>
23 24
24 <para>Devices supporting the RDS capturing API 25 <para>Devices supporting the RDS capturing API set
25set the <constant>V4L2_CAP_RDS_CAPTURE</constant> flag in 26the <constant>V4L2_CAP_RDS_CAPTURE</constant> flag in
26the <structfield>capabilities</structfield> field of &v4l2-capability; 27the <structfield>capabilities</structfield> field of &v4l2-capability;
27returned by the &VIDIOC-QUERYCAP; ioctl. 28returned by the &VIDIOC-QUERYCAP; ioctl. Any tuner that supports RDS
28Any tuner that supports RDS will set the 29will set the <constant>V4L2_TUNER_CAP_RDS</constant> flag in
29<constant>V4L2_TUNER_CAP_RDS</constant> flag in the <structfield>capability</structfield> 30the <structfield>capability</structfield> field of &v4l2-tuner;. If
30field of &v4l2-tuner;. 31the driver only passes RDS blocks without interpreting the data
31Whether an RDS signal is present can be detected by looking at 32the <constant>V4L2_TUNER_SUB_RDS_BLOCK_IO</constant> flag has to be
32the <structfield>rxsubchans</structfield> field of &v4l2-tuner;: the 33set, see <link linkend="reading-rds-data">Reading RDS data</link>.
33<constant>V4L2_TUNER_SUB_RDS</constant> will be set if RDS data was detected.</para> 34For future use the
35flag <constant>V4L2_TUNER_SUB_RDS_CONTROLS</constant> has also been
36defined. However, a driver for a radio tuner with this capability does
37not yet exist, so if you are planning to write such a driver you
38should discuss this on the linux-media mailing list: &v4l-ml;.</para>
39
40 <para> Whether an RDS signal is present can be detected by looking
41at the <structfield>rxsubchans</structfield> field of &v4l2-tuner;:
42the <constant>V4L2_TUNER_SUB_RDS</constant> will be set if RDS data
43was detected.</para>
34 44
35 <para>Devices supporting the RDS output API 45 <para>Devices supporting the RDS output API
36set the <constant>V4L2_CAP_RDS_OUTPUT</constant> flag in 46set the <constant>V4L2_CAP_RDS_OUTPUT</constant> flag in
@@ -40,16 +50,31 @@ Any modulator that supports RDS will set the
40<constant>V4L2_TUNER_CAP_RDS</constant> flag in the <structfield>capability</structfield> 50<constant>V4L2_TUNER_CAP_RDS</constant> flag in the <structfield>capability</structfield>
41field of &v4l2-modulator;. 51field of &v4l2-modulator;.
42In order to enable the RDS transmission one must set the <constant>V4L2_TUNER_SUB_RDS</constant> 52In order to enable the RDS transmission one must set the <constant>V4L2_TUNER_SUB_RDS</constant>
43bit in the <structfield>txsubchans</structfield> field of &v4l2-modulator;.</para> 53bit in the <structfield>txsubchans</structfield> field of &v4l2-modulator;.
44 54If the driver only passes RDS blocks without interpreting the data
55the <constant>V4L2_TUNER_SUB_RDS_BLOCK_IO</constant> flag has to be set. If the
56tuner is capable of handling RDS entities like program identification codes and radio
57text, the flag <constant>V4L2_TUNER_SUB_RDS_CONTROLS</constant> should be set,
58see <link linkend="writing-rds-data">Writing RDS data</link> and
59<link linkend="fm-tx-controls">FM Transmitter Control Reference</link>.</para>
45 </section> 60 </section>
46 61
47 <section> 62 <section id="reading-rds-data">
48 <title>Reading RDS data</title> 63 <title>Reading RDS data</title>
49 64
50 <para>RDS data can be read from the radio device 65 <para>RDS data can be read from the radio device
51with the &func-read; function. The data is packed in groups of three bytes, 66with the &func-read; function. The data is packed in groups of three bytes.</para>
67 </section>
68
69 <section id="writing-rds-data">
70 <title>Writing RDS data</title>
71
72 <para>RDS data can be written to the radio device
73with the &func-write; function. The data is packed in groups of three bytes,
52as follows:</para> 74as follows:</para>
75 </section>
76
77 <section>
53 <table frame="none" pgwide="1" id="v4l2-rds-data"> 78 <table frame="none" pgwide="1" id="v4l2-rds-data">
54 <title>struct 79 <title>struct
55<structname>v4l2_rds_data</structname></title> 80<structname>v4l2_rds_data</structname></title>
@@ -111,48 +136,57 @@ as follows:</para>
111 <tbody valign="top"> 136 <tbody valign="top">
112 <row> 137 <row>
113 <entry>V4L2_RDS_BLOCK_MSK</entry> 138 <entry>V4L2_RDS_BLOCK_MSK</entry>
139 <entry> </entry>
114 <entry>7</entry> 140 <entry>7</entry>
115 <entry>Mask for bits 0-2 to get the block ID.</entry> 141 <entry>Mask for bits 0-2 to get the block ID.</entry>
116 </row> 142 </row>
117 <row> 143 <row>
118 <entry>V4L2_RDS_BLOCK_A</entry> 144 <entry>V4L2_RDS_BLOCK_A</entry>
145 <entry> </entry>
119 <entry>0</entry> 146 <entry>0</entry>
120 <entry>Block A.</entry> 147 <entry>Block A.</entry>
121 </row> 148 </row>
122 <row> 149 <row>
123 <entry>V4L2_RDS_BLOCK_B</entry> 150 <entry>V4L2_RDS_BLOCK_B</entry>
151 <entry> </entry>
124 <entry>1</entry> 152 <entry>1</entry>
125 <entry>Block B.</entry> 153 <entry>Block B.</entry>
126 </row> 154 </row>
127 <row> 155 <row>
128 <entry>V4L2_RDS_BLOCK_C</entry> 156 <entry>V4L2_RDS_BLOCK_C</entry>
157 <entry> </entry>
129 <entry>2</entry> 158 <entry>2</entry>
130 <entry>Block C.</entry> 159 <entry>Block C.</entry>
131 </row> 160 </row>
132 <row> 161 <row>
133 <entry>V4L2_RDS_BLOCK_D</entry> 162 <entry>V4L2_RDS_BLOCK_D</entry>
163 <entry> </entry>
134 <entry>3</entry> 164 <entry>3</entry>
135 <entry>Block D.</entry> 165 <entry>Block D.</entry>
136 </row> 166 </row>
137 <row> 167 <row>
138 <entry>V4L2_RDS_BLOCK_C_ALT</entry> 168 <entry>V4L2_RDS_BLOCK_C_ALT</entry>
169 <entry> </entry>
139 <entry>4</entry> 170 <entry>4</entry>
140 <entry>Block C'.</entry> 171 <entry>Block C'.</entry>
141 </row> 172 </row>
142 <row> 173 <row>
143 <entry>V4L2_RDS_BLOCK_INVALID</entry> 174 <entry>V4L2_RDS_BLOCK_INVALID</entry>
175 <entry>read-only</entry>
144 <entry>7</entry> 176 <entry>7</entry>
145 <entry>An invalid block.</entry> 177 <entry>An invalid block.</entry>
146 </row> 178 </row>
147 <row> 179 <row>
148 <entry>V4L2_RDS_BLOCK_CORRECTED</entry> 180 <entry>V4L2_RDS_BLOCK_CORRECTED</entry>
181 <entry>read-only</entry>
149 <entry>0x40</entry> 182 <entry>0x40</entry>
150 <entry>A bit error was detected but corrected.</entry> 183 <entry>A bit error was detected but corrected.</entry>
151 </row> 184 </row>
152 <row> 185 <row>
153 <entry>V4L2_RDS_BLOCK_ERROR</entry> 186 <entry>V4L2_RDS_BLOCK_ERROR</entry>
187 <entry>read-only</entry>
154 <entry>0x80</entry> 188 <entry>0x80</entry>
155 <entry>An incorrectable error occurred.</entry> 189 <entry>An uncorrectable error occurred.</entry>
156 </row> 190 </row>
157 </tbody> 191 </tbody>
158 </tgroup> 192 </tgroup>
diff --git a/Documentation/DocBook/v4l/dev-teletext.xml b/Documentation/DocBook/v4l/dev-teletext.xml
index 76184e8ed618..414b1cfff9f4 100644
--- a/Documentation/DocBook/v4l/dev-teletext.xml
+++ b/Documentation/DocBook/v4l/dev-teletext.xml
@@ -1,35 +1,32 @@
1 <title>Teletext Interface</title> 1 <title>Teletext Interface</title>
2 2
3 <para>This interface aims at devices receiving and demodulating 3 <para>This interface was aimed at devices receiving and demodulating
4Teletext data [<xref linkend="ets300706" />, <xref linkend="itu653" />], evaluating the 4Teletext data [<xref linkend="ets300706" />, <xref linkend="itu653" />], evaluating the
5Teletext packages and storing formatted pages in cache memory. Such 5Teletext packages and storing formatted pages in cache memory. Such
6devices are usually implemented as microcontrollers with serial 6devices are usually implemented as microcontrollers with serial
7interface (I<superscript>2</superscript>C) and can be found on older 7interface (I<superscript>2</superscript>C) and could be found on old
8TV cards, dedicated Teletext decoding cards and home-brew devices 8TV cards, dedicated Teletext decoding cards and home-brew devices
9connected to the PC parallel port.</para> 9connected to the PC parallel port.</para>
10 10
11 <para>The Teletext API was designed by Martin Buck. It is defined in 11 <para>The Teletext API was designed by Martin Buck. It was defined in
12the kernel header file <filename>linux/videotext.h</filename>, the 12the kernel header file <filename>linux/videotext.h</filename>, the
13specification is available from <ulink url="ftp://ftp.gwdg.de/pub/linux/misc/videotext/"> 13specification is available from <ulink url="ftp://ftp.gwdg.de/pub/linux/misc/videotext/">
14ftp://ftp.gwdg.de/pub/linux/misc/videotext/</ulink>. (Videotext is the name of 14ftp://ftp.gwdg.de/pub/linux/misc/videotext/</ulink>. (Videotext is the name of
15the German public television Teletext service.) Conventional character 15the German public television Teletext service.)</para>
16device file names are <filename>/dev/vtx</filename> and
17<filename>/dev/vttuner</filename>, with device number 83, 0 and 83, 16
18respectively. A similar interface exists for the Philips SAA5249
19Teletext decoder [specification?] with character device file names
20<filename>/dev/tlkN</filename>, device number 102, N.</para>
21 16
22 <para>Eventually the Teletext API was integrated into the V4L API 17 <para>Eventually the Teletext API was integrated into the V4L API
23with character device file names <filename>/dev/vtx0</filename> to 18with character device file names <filename>/dev/vtx0</filename> to
24<filename>/dev/vtx31</filename>, device major number 81, minor numbers 19<filename>/dev/vtx31</filename>, device major number 81, minor numbers
25192 to 223. For reference the V4L Teletext API specification is 20192 to 223.</para>
26reproduced here in full: "Teletext interfaces talk the existing VTX
27API." Teletext devices with major number 83 and 102 will be removed in
28Linux 2.6.</para>
29 21
30 <para>There are no plans to replace the Teletext API or to integrate 22 <para>However, teletext decoders were quickly replaced by more
31it into V4L2. Please write to the linux-media mailing list: &v4l-ml; 23generic VBI demodulators and those dedicated teletext decoders no longer exist.
32when the need arises.</para> 24For many years the vtx devices were still around, even though nobody used
25them. So the decision was made to finally remove support for the Teletext API in
26kernel 2.6.37.</para>
27
28 <para>Modern devices all use the <link linkend="raw-vbi">raw</link> or
29<link linkend="sliced">sliced</link> VBI API.</para>
33 30
34 <!-- 31 <!--
35Local Variables: 32Local Variables:
diff --git a/Documentation/DocBook/v4l/pixfmt-packed-rgb.xml b/Documentation/DocBook/v4l/pixfmt-packed-rgb.xml
index 26e879231088..4db272b8a0d3 100644
--- a/Documentation/DocBook/v4l/pixfmt-packed-rgb.xml
+++ b/Documentation/DocBook/v4l/pixfmt-packed-rgb.xml
@@ -739,7 +739,7 @@ defined in error. Drivers may interpret them as in <xref
739 <entry>b<subscript>1</subscript></entry> 739 <entry>b<subscript>1</subscript></entry>
740 <entry>b<subscript>0</subscript></entry> 740 <entry>b<subscript>0</subscript></entry>
741 </row> 741 </row>
742 <row id="V4L2-PIX-FMT-BGR666"> 742 <row><!-- id="V4L2-PIX-FMT-BGR666" -->
743 <entry><constant>V4L2_PIX_FMT_BGR666</constant></entry> 743 <entry><constant>V4L2_PIX_FMT_BGR666</constant></entry>
744 <entry>'BGRH'</entry> 744 <entry>'BGRH'</entry>
745 <entry></entry> 745 <entry></entry>
diff --git a/Documentation/DocBook/v4l/pixfmt-srggb10.xml b/Documentation/DocBook/v4l/pixfmt-srggb10.xml
new file mode 100644
index 000000000000..7b274092e60c
--- /dev/null
+++ b/Documentation/DocBook/v4l/pixfmt-srggb10.xml
@@ -0,0 +1,90 @@
1 <refentry>
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_SRGGB10 ('RG10'),
4 V4L2_PIX_FMT_SGRBG10 ('BA10'),
5 V4L2_PIX_FMT_SGBRG10 ('GB10'),
6 V4L2_PIX_FMT_SBGGR10 ('BG10'),
7 </refentrytitle>
8 &manvol;
9 </refmeta>
10 <refnamediv>
11 <refname id="V4L2-PIX-FMT-SRGGB10"><constant>V4L2_PIX_FMT_SRGGB10</constant></refname>
12 <refname id="V4L2-PIX-FMT-SGRBG10"><constant>V4L2_PIX_FMT_SGRBG10</constant></refname>
13 <refname id="V4L2-PIX-FMT-SGBRG10"><constant>V4L2_PIX_FMT_SGBRG10</constant></refname>
14 <refname id="V4L2-PIX-FMT-SBGGR10"><constant>V4L2_PIX_FMT_SBGGR10</constant></refname>
15 <refpurpose>10-bit Bayer formats expanded to 16 bits</refpurpose>
16 </refnamediv>
17 <refsect1>
18 <title>Description</title>
19
20 <para>The following four pixel formats are raw sRGB / Bayer formats with
2110 bits per colour. Each colour component is stored in a 16-bit word, with 6
22unused high bits filled with zeros. Each n-pixel row contains n/2 green samples
23and n/2 blue or red samples, with alternating red and blue rows. Bytes are
24stored in memory in little endian order. They are conventionally described
25as GRGR... BGBG..., RGRG... GBGB..., etc. Below is an example of one of these
26formats</para>
27
28 <example>
29 <title><constant>V4L2_PIX_FMT_SBGGR10</constant> 4 &times; 4
30pixel image</title>
31
32 <formalpara>
33 <title>Byte Order.</title>
34 <para>Each cell is one byte, high 6 bits in high bytes are 0.
35 <informaltable frame="none">
36 <tgroup cols="5" align="center">
37 <colspec align="left" colwidth="2*" />
38 <tbody valign="top">
39 <row>
40 <entry>start&nbsp;+&nbsp;0:</entry>
41 <entry>B<subscript>00low</subscript></entry>
42 <entry>B<subscript>00high</subscript></entry>
43 <entry>G<subscript>01low</subscript></entry>
44 <entry>G<subscript>01high</subscript></entry>
45 <entry>B<subscript>02low</subscript></entry>
46 <entry>B<subscript>02high</subscript></entry>
47 <entry>G<subscript>03low</subscript></entry>
48 <entry>G<subscript>03high</subscript></entry>
49 </row>
50 <row>
51 <entry>start&nbsp;+&nbsp;8:</entry>
52 <entry>G<subscript>10low</subscript></entry>
53 <entry>G<subscript>10high</subscript></entry>
54 <entry>R<subscript>11low</subscript></entry>
55 <entry>R<subscript>11high</subscript></entry>
56 <entry>G<subscript>12low</subscript></entry>
57 <entry>G<subscript>12high</subscript></entry>
58 <entry>R<subscript>13low</subscript></entry>
59 <entry>R<subscript>13high</subscript></entry>
60 </row>
61 <row>
62 <entry>start&nbsp;+&nbsp;16:</entry>
63 <entry>B<subscript>20low</subscript></entry>
64 <entry>B<subscript>20high</subscript></entry>
65 <entry>G<subscript>21low</subscript></entry>
66 <entry>G<subscript>21high</subscript></entry>
67 <entry>B<subscript>22low</subscript></entry>
68 <entry>B<subscript>22high</subscript></entry>
69 <entry>G<subscript>23low</subscript></entry>
70 <entry>G<subscript>23high</subscript></entry>
71 </row>
72 <row>
73 <entry>start&nbsp;+&nbsp;24:</entry>
74 <entry>G<subscript>30low</subscript></entry>
75 <entry>G<subscript>30high</subscript></entry>
76 <entry>R<subscript>31low</subscript></entry>
77 <entry>R<subscript>31high</subscript></entry>
78 <entry>G<subscript>32low</subscript></entry>
79 <entry>G<subscript>32high</subscript></entry>
80 <entry>R<subscript>33low</subscript></entry>
81 <entry>R<subscript>33high</subscript></entry>
82 </row>
83 </tbody>
84 </tgroup>
85 </informaltable>
86 </para>
87 </formalpara>
88 </example>
89 </refsect1>
90</refentry>
diff --git a/Documentation/DocBook/v4l/pixfmt-srggb8.xml b/Documentation/DocBook/v4l/pixfmt-srggb8.xml
new file mode 100644
index 000000000000..2570e3be3cf1
--- /dev/null
+++ b/Documentation/DocBook/v4l/pixfmt-srggb8.xml
@@ -0,0 +1,67 @@
1 <refentry id="V4L2-PIX-FMT-SRGGB8">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_SRGGB8 ('RGGB')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname><constant>V4L2_PIX_FMT_SRGGB8</constant></refname>
8 <refpurpose>Bayer RGB format</refpurpose>
9 </refnamediv>
10 <refsect1>
11 <title>Description</title>
12
13 <para>This is commonly the native format of digital cameras,
14reflecting the arrangement of sensors on the CCD device. Only one red,
15green or blue value is given for each pixel. Missing components must
16be interpolated from neighbouring pixels. From left to right the first
17row consists of a red and green value, the second row of a green and
18blue value. This scheme repeats to the right and down for every two
19columns and rows.</para>
20
21 <example>
22 <title><constant>V4L2_PIX_FMT_SRGGB8</constant> 4 &times; 4
23pixel image</title>
24
25 <formalpara>
26 <title>Byte Order.</title>
27 <para>Each cell is one byte.
28 <informaltable frame="none">
29 <tgroup cols="5" align="center">
30 <colspec align="left" colwidth="2*" />
31 <tbody valign="top">
32 <row>
33 <entry>start&nbsp;+&nbsp;0:</entry>
34 <entry>R<subscript>00</subscript></entry>
35 <entry>G<subscript>01</subscript></entry>
36 <entry>R<subscript>02</subscript></entry>
37 <entry>G<subscript>03</subscript></entry>
38 </row>
39 <row>
40 <entry>start&nbsp;+&nbsp;4:</entry>
41 <entry>G<subscript>10</subscript></entry>
42 <entry>B<subscript>11</subscript></entry>
43 <entry>G<subscript>12</subscript></entry>
44 <entry>B<subscript>13</subscript></entry>
45 </row>
46 <row>
47 <entry>start&nbsp;+&nbsp;8:</entry>
48 <entry>R<subscript>20</subscript></entry>
49 <entry>G<subscript>21</subscript></entry>
50 <entry>R<subscript>22</subscript></entry>
51 <entry>G<subscript>23</subscript></entry>
52 </row>
53 <row>
54 <entry>start&nbsp;+&nbsp;12:</entry>
55 <entry>G<subscript>30</subscript></entry>
56 <entry>B<subscript>31</subscript></entry>
57 <entry>G<subscript>32</subscript></entry>
58 <entry>B<subscript>33</subscript></entry>
59 </row>
60 </tbody>
61 </tgroup>
62 </informaltable>
63 </para>
64 </formalpara>
65 </example>
66 </refsect1>
67 </refentry>
diff --git a/Documentation/DocBook/v4l/pixfmt-y10.xml b/Documentation/DocBook/v4l/pixfmt-y10.xml
new file mode 100644
index 000000000000..d065043db8d8
--- /dev/null
+++ b/Documentation/DocBook/v4l/pixfmt-y10.xml
@@ -0,0 +1,79 @@
1<refentry id="V4L2-PIX-FMT-Y10">
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_Y10 ('Y10 ')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname><constant>V4L2_PIX_FMT_Y10</constant></refname>
8 <refpurpose>Grey-scale image</refpurpose>
9 </refnamediv>
10 <refsect1>
11 <title>Description</title>
12
13 <para>This is a grey-scale image with a depth of 10 bits per pixel. Pixels
14are stored in 16-bit words with unused high bits padded with 0. The least
15significant byte is stored at lower memory addresses (little-endian).</para>
16
17 <example>
18 <title><constant>V4L2_PIX_FMT_Y10</constant> 4 &times; 4
19pixel image</title>
20
21 <formalpara>
22 <title>Byte Order.</title>
23 <para>Each cell is one byte.
24 <informaltable frame="none">
25 <tgroup cols="9" align="center">
26 <colspec align="left" colwidth="2*" />
27 <tbody valign="top">
28 <row>
29 <entry>start&nbsp;+&nbsp;0:</entry>
30 <entry>Y'<subscript>00low</subscript></entry>
31 <entry>Y'<subscript>00high</subscript></entry>
32 <entry>Y'<subscript>01low</subscript></entry>
33 <entry>Y'<subscript>01high</subscript></entry>
34 <entry>Y'<subscript>02low</subscript></entry>
35 <entry>Y'<subscript>02high</subscript></entry>
36 <entry>Y'<subscript>03low</subscript></entry>
37 <entry>Y'<subscript>03high</subscript></entry>
38 </row>
39 <row>
40 <entry>start&nbsp;+&nbsp;8:</entry>
41 <entry>Y'<subscript>10low</subscript></entry>
42 <entry>Y'<subscript>10high</subscript></entry>
43 <entry>Y'<subscript>11low</subscript></entry>
44 <entry>Y'<subscript>11high</subscript></entry>
45 <entry>Y'<subscript>12low</subscript></entry>
46 <entry>Y'<subscript>12high</subscript></entry>
47 <entry>Y'<subscript>13low</subscript></entry>
48 <entry>Y'<subscript>13high</subscript></entry>
49 </row>
50 <row>
51 <entry>start&nbsp;+&nbsp;16:</entry>
52 <entry>Y'<subscript>20low</subscript></entry>
53 <entry>Y'<subscript>20high</subscript></entry>
54 <entry>Y'<subscript>21low</subscript></entry>
55 <entry>Y'<subscript>21high</subscript></entry>
56 <entry>Y'<subscript>22low</subscript></entry>
57 <entry>Y'<subscript>22high</subscript></entry>
58 <entry>Y'<subscript>23low</subscript></entry>
59 <entry>Y'<subscript>23high</subscript></entry>
60 </row>
61 <row>
62 <entry>start&nbsp;+&nbsp;24:</entry>
63 <entry>Y'<subscript>30low</subscript></entry>
64 <entry>Y'<subscript>30high</subscript></entry>
65 <entry>Y'<subscript>31low</subscript></entry>
66 <entry>Y'<subscript>31high</subscript></entry>
67 <entry>Y'<subscript>32low</subscript></entry>
68 <entry>Y'<subscript>32high</subscript></entry>
69 <entry>Y'<subscript>33low</subscript></entry>
70 <entry>Y'<subscript>33high</subscript></entry>
71 </row>
72 </tbody>
73 </tgroup>
74 </informaltable>
75 </para>
76 </formalpara>
77 </example>
78 </refsect1>
79</refentry>
diff --git a/Documentation/DocBook/v4l/pixfmt.xml b/Documentation/DocBook/v4l/pixfmt.xml
index c4ad0a8e42dc..d7c467187095 100644
--- a/Documentation/DocBook/v4l/pixfmt.xml
+++ b/Documentation/DocBook/v4l/pixfmt.xml
@@ -566,7 +566,9 @@ access the palette, this must be done with ioctls of the Linux framebuffer API.<
566 &sub-sbggr8; 566 &sub-sbggr8;
567 &sub-sgbrg8; 567 &sub-sgbrg8;
568 &sub-sgrbg8; 568 &sub-sgrbg8;
569 &sub-srggb8;
569 &sub-sbggr16; 570 &sub-sbggr16;
571 &sub-srggb10;
570 </section> 572 </section>
571 573
572 <section id="yuv-formats"> 574 <section id="yuv-formats">
@@ -589,6 +591,7 @@ information.</para>
589 591
590 &sub-packed-yuv; 592 &sub-packed-yuv;
591 &sub-grey; 593 &sub-grey;
594 &sub-y10;
592 &sub-y16; 595 &sub-y16;
593 &sub-yuyv; 596 &sub-yuyv;
594 &sub-uyvy; 597 &sub-uyvy;
@@ -685,6 +688,11 @@ http://www.ivtvdriver.org/</ulink></para><para>The format is documented in the
685kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.hm12</filename> 688kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.hm12</filename>
686</para></entry> 689</para></entry>
687 </row> 690 </row>
691 <row id="V4L2-PIX-FMT-CPIA1">
692 <entry><constant>V4L2_PIX_FMT_CPIA1</constant></entry>
693 <entry>'CPIA'</entry>
694 <entry>YUV format used by the gspca cpia1 driver.</entry>
695 </row>
688 <row id="V4L2-PIX-FMT-SPCA501"> 696 <row id="V4L2-PIX-FMT-SPCA501">
689 <entry><constant>V4L2_PIX_FMT_SPCA501</constant></entry> 697 <entry><constant>V4L2_PIX_FMT_SPCA501</constant></entry>
690 <entry>'S501'</entry> 698 <entry>'S501'</entry>
@@ -705,11 +713,6 @@ kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.hm
705 <entry>'S561'</entry> 713 <entry>'S561'</entry>
706 <entry>Compressed GBRG Bayer format used by the gspca driver.</entry> 714 <entry>Compressed GBRG Bayer format used by the gspca driver.</entry>
707 </row> 715 </row>
708 <row id="V4L2-PIX-FMT-SGRBG10">
709 <entry><constant>V4L2_PIX_FMT_SGRBG10</constant></entry>
710 <entry>'DA10'</entry>
711 <entry>10 bit raw Bayer, expanded to 16 bits.</entry>
712 </row>
713 <row id="V4L2-PIX-FMT-SGRBG10DPCM8"> 716 <row id="V4L2-PIX-FMT-SGRBG10DPCM8">
714 <entry><constant>V4L2_PIX_FMT_SGRBG10DPCM8</constant></entry> 717 <entry><constant>V4L2_PIX_FMT_SGRBG10DPCM8</constant></entry>
715 <entry>'DB10'</entry> 718 <entry>'DB10'</entry>
@@ -770,6 +773,11 @@ kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.hm
770 <entry>'S920'</entry> 773 <entry>'S920'</entry>
771 <entry>YUV 4:2:0 format of the gspca sn9c20x driver.</entry> 774 <entry>YUV 4:2:0 format of the gspca sn9c20x driver.</entry>
772 </row> 775 </row>
776 <row id="V4L2-PIX-FMT-SN9C2028">
777 <entry><constant>V4L2_PIX_FMT_SN9C2028</constant></entry>
778 <entry>'SONX'</entry>
779 <entry>Compressed GBRG bayer format of the gspca sn9c2028 driver.</entry>
780 </row>
773 <row id="V4L2-PIX-FMT-STV0680"> 781 <row id="V4L2-PIX-FMT-STV0680">
774 <entry><constant>V4L2_PIX_FMT_STV0680</constant></entry> 782 <entry><constant>V4L2_PIX_FMT_STV0680</constant></entry>
775 <entry>'S680'</entry> 783 <entry>'S680'</entry>
@@ -787,6 +795,20 @@ http://www.thedirks.org/winnov/</ulink></para></entry>
787 <entry>'TM60'</entry> 795 <entry>'TM60'</entry>
788 <entry><para>Used by Trident tm6000</para></entry> 796 <entry><para>Used by Trident tm6000</para></entry>
789 </row> 797 </row>
798 <row id="V4L2-PIX-FMT-CIT-YYVYUY">
799 <entry><constant>V4L2_PIX_FMT_CIT_YYVYUY</constant></entry>
800 <entry>'CITV'</entry>
801 <entry><para>Used by xirlink CIT, found at IBM webcams.</para>
802 <para>Uses one line of Y then 1 line of VYUY</para>
803 </entry>
804 </row>
805 <row id="V4L2-PIX-FMT-KONICA420">
806 <entry><constant>V4L2_PIX_FMT_KONICA420</constant></entry>
807 <entry>'KONI'</entry>
808 <entry><para>Used by Konica webcams.</para>
809 <para>YUV420 planar in blocks of 256 pixels.</para>
810 </entry>
811 </row>
790 <row id="V4L2-PIX-FMT-YYUV"> 812 <row id="V4L2-PIX-FMT-YYUV">
791 <entry><constant>V4L2_PIX_FMT_YYUV</constant></entry> 813 <entry><constant>V4L2_PIX_FMT_YYUV</constant></entry>
792 <entry>'YYUV'</entry> 814 <entry>'YYUV'</entry>
diff --git a/Documentation/DocBook/v4l/v4l2.xml b/Documentation/DocBook/v4l/v4l2.xml
index 7c3c098d5d08..839e93e875ae 100644
--- a/Documentation/DocBook/v4l/v4l2.xml
+++ b/Documentation/DocBook/v4l/v4l2.xml
@@ -99,6 +99,7 @@ Remote Controller chapter.</contrib>
99 <year>2007</year> 99 <year>2007</year>
100 <year>2008</year> 100 <year>2008</year>
101 <year>2009</year> 101 <year>2009</year>
102 <year>2010</year>
102 <holder>Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin 103 <holder>Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin
103Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab</holder> 104Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab</holder>
104 </copyright> 105 </copyright>
@@ -110,10 +111,17 @@ Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab</holder>
110 <!-- Put document revisions here, newest first. --> 111 <!-- Put document revisions here, newest first. -->
111 <!-- API revisions (changes and additions of defines, enums, 112 <!-- API revisions (changes and additions of defines, enums,
112structs, ioctls) must be noted in more detail in the history chapter 113structs, ioctls) must be noted in more detail in the history chapter
113(compat.sgml), along with the possible impact on existing drivers and 114(compat.xml), along with the possible impact on existing drivers and
114applications. --> 115applications. -->
115 116
116 <revision> 117 <revision>
118 <revnumber>2.6.37</revnumber>
119 <date>2010-08-06</date>
120 <authorinitials>hv</authorinitials>
121 <revremark>Removed obsolete vtx (videotext) API.</revremark>
122 </revision>
123
124 <revision>
117 <revnumber>2.6.33</revnumber> 125 <revnumber>2.6.33</revnumber>
118 <date>2009-12-03</date> 126 <date>2009-12-03</date>
119 <authorinitials>mk</authorinitials> 127 <authorinitials>mk</authorinitials>
diff --git a/Documentation/DocBook/v4l/videodev2.h.xml b/Documentation/DocBook/v4l/videodev2.h.xml
index 865b06d9e679..325b23b6964c 100644
--- a/Documentation/DocBook/v4l/videodev2.h.xml
+++ b/Documentation/DocBook/v4l/videodev2.h.xml
@@ -154,23 +154,13 @@ enum <link linkend="v4l2-buf-type">v4l2_buf_type</link> {
154 V4L2_BUF_TYPE_VBI_OUTPUT = 5, 154 V4L2_BUF_TYPE_VBI_OUTPUT = 5,
155 V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6, 155 V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6,
156 V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7, 156 V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7,
157#if 1 /*KEEP*/ 157#if 1
158 /* Experimental */ 158 /* Experimental */
159 V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8, 159 V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8,
160#endif 160#endif
161 V4L2_BUF_TYPE_PRIVATE = 0x80, 161 V4L2_BUF_TYPE_PRIVATE = 0x80,
162}; 162};
163 163
164enum <link linkend="v4l2-ctrl-type">v4l2_ctrl_type</link> {
165 V4L2_CTRL_TYPE_INTEGER = 1,
166 V4L2_CTRL_TYPE_BOOLEAN = 2,
167 V4L2_CTRL_TYPE_MENU = 3,
168 V4L2_CTRL_TYPE_BUTTON = 4,
169 V4L2_CTRL_TYPE_INTEGER64 = 5,
170 V4L2_CTRL_TYPE_CTRL_CLASS = 6,
171 V4L2_CTRL_TYPE_STRING = 7,
172};
173
174enum <link linkend="v4l2-tuner-type">v4l2_tuner_type</link> { 164enum <link linkend="v4l2-tuner-type">v4l2_tuner_type</link> {
175 V4L2_TUNER_RADIO = 1, 165 V4L2_TUNER_RADIO = 1,
176 V4L2_TUNER_ANALOG_TV = 2, 166 V4L2_TUNER_ANALOG_TV = 2,
@@ -288,6 +278,7 @@ struct <link linkend="v4l2-pix-format">v4l2_pix_format</link> {
288#define <link linkend="V4L2-PIX-FMT-RGB565">V4L2_PIX_FMT_RGB565</link> v4l2_fourcc('R', 'G', 'B', 'P') /* 16 RGB-5-6-5 */ 278#define <link linkend="V4L2-PIX-FMT-RGB565">V4L2_PIX_FMT_RGB565</link> v4l2_fourcc('R', 'G', 'B', 'P') /* 16 RGB-5-6-5 */
289#define <link linkend="V4L2-PIX-FMT-RGB555X">V4L2_PIX_FMT_RGB555X</link> v4l2_fourcc('R', 'G', 'B', 'Q') /* 16 RGB-5-5-5 BE */ 279#define <link linkend="V4L2-PIX-FMT-RGB555X">V4L2_PIX_FMT_RGB555X</link> v4l2_fourcc('R', 'G', 'B', 'Q') /* 16 RGB-5-5-5 BE */
290#define <link linkend="V4L2-PIX-FMT-RGB565X">V4L2_PIX_FMT_RGB565X</link> v4l2_fourcc('R', 'G', 'B', 'R') /* 16 RGB-5-6-5 BE */ 280#define <link linkend="V4L2-PIX-FMT-RGB565X">V4L2_PIX_FMT_RGB565X</link> v4l2_fourcc('R', 'G', 'B', 'R') /* 16 RGB-5-6-5 BE */
281#define <link linkend="V4L2-PIX-FMT-BGR666">V4L2_PIX_FMT_BGR666</link> v4l2_fourcc('B', 'G', 'R', 'H') /* 18 BGR-6-6-6 */
291#define <link linkend="V4L2-PIX-FMT-BGR24">V4L2_PIX_FMT_BGR24</link> v4l2_fourcc('B', 'G', 'R', '3') /* 24 BGR-8-8-8 */ 282#define <link linkend="V4L2-PIX-FMT-BGR24">V4L2_PIX_FMT_BGR24</link> v4l2_fourcc('B', 'G', 'R', '3') /* 24 BGR-8-8-8 */
292#define <link linkend="V4L2-PIX-FMT-RGB24">V4L2_PIX_FMT_RGB24</link> v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */ 283#define <link linkend="V4L2-PIX-FMT-RGB24">V4L2_PIX_FMT_RGB24</link> v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */
293#define <link linkend="V4L2-PIX-FMT-BGR32">V4L2_PIX_FMT_BGR32</link> v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */ 284#define <link linkend="V4L2-PIX-FMT-BGR32">V4L2_PIX_FMT_BGR32</link> v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */
@@ -295,6 +286,9 @@ struct <link linkend="v4l2-pix-format">v4l2_pix_format</link> {
295 286
296/* Grey formats */ 287/* Grey formats */
297#define <link linkend="V4L2-PIX-FMT-GREY">V4L2_PIX_FMT_GREY</link> v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */ 288#define <link linkend="V4L2-PIX-FMT-GREY">V4L2_PIX_FMT_GREY</link> v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */
289#define <link linkend="V4L2-PIX-FMT-Y4">V4L2_PIX_FMT_Y4</link> v4l2_fourcc('Y', '0', '4', ' ') /* 4 Greyscale */
290#define <link linkend="V4L2-PIX-FMT-Y6">V4L2_PIX_FMT_Y6</link> v4l2_fourcc('Y', '0', '6', ' ') /* 6 Greyscale */
291#define <link linkend="V4L2-PIX-FMT-Y10">V4L2_PIX_FMT_Y10</link> v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */
298#define <link linkend="V4L2-PIX-FMT-Y16">V4L2_PIX_FMT_Y16</link> v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ 292#define <link linkend="V4L2-PIX-FMT-Y16">V4L2_PIX_FMT_Y16</link> v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */
299 293
300/* Palette formats */ 294/* Palette formats */
@@ -330,7 +324,11 @@ struct <link linkend="v4l2-pix-format">v4l2_pix_format</link> {
330#define <link linkend="V4L2-PIX-FMT-SBGGR8">V4L2_PIX_FMT_SBGGR8</link> v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ 324#define <link linkend="V4L2-PIX-FMT-SBGGR8">V4L2_PIX_FMT_SBGGR8</link> v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */
331#define <link linkend="V4L2-PIX-FMT-SGBRG8">V4L2_PIX_FMT_SGBRG8</link> v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ 325#define <link linkend="V4L2-PIX-FMT-SGBRG8">V4L2_PIX_FMT_SGBRG8</link> v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */
332#define <link linkend="V4L2-PIX-FMT-SGRBG8">V4L2_PIX_FMT_SGRBG8</link> v4l2_fourcc('G', 'R', 'B', 'G') /* 8 GRGR.. BGBG.. */ 326#define <link linkend="V4L2-PIX-FMT-SGRBG8">V4L2_PIX_FMT_SGRBG8</link> v4l2_fourcc('G', 'R', 'B', 'G') /* 8 GRGR.. BGBG.. */
333#define <link linkend="V4L2-PIX-FMT-SGRBG10">V4L2_PIX_FMT_SGRBG10</link> v4l2_fourcc('B', 'A', '1', '0') /* 10bit raw bayer */ 327#define <link linkend="V4L2-PIX-FMT-SRGGB8">V4L2_PIX_FMT_SRGGB8</link> v4l2_fourcc('R', 'G', 'G', 'B') /* 8 RGRG.. GBGB.. */
328#define <link linkend="V4L2-PIX-FMT-SBGGR10">V4L2_PIX_FMT_SBGGR10</link> v4l2_fourcc('B', 'G', '1', '0') /* 10 BGBG.. GRGR.. */
329#define <link linkend="V4L2-PIX-FMT-SGBRG10">V4L2_PIX_FMT_SGBRG10</link> v4l2_fourcc('G', 'B', '1', '0') /* 10 GBGB.. RGRG.. */
330#define <link linkend="V4L2-PIX-FMT-SGRBG10">V4L2_PIX_FMT_SGRBG10</link> v4l2_fourcc('B', 'A', '1', '0') /* 10 GRGR.. BGBG.. */
331#define <link linkend="V4L2-PIX-FMT-SRGGB10">V4L2_PIX_FMT_SRGGB10</link> v4l2_fourcc('R', 'G', '1', '0') /* 10 RGRG.. GBGB.. */
334 /* 10bit raw bayer DPCM compressed to 8 bits */ 332 /* 10bit raw bayer DPCM compressed to 8 bits */
335#define <link linkend="V4L2-PIX-FMT-SGRBG10DPCM8">V4L2_PIX_FMT_SGRBG10DPCM8</link> v4l2_fourcc('B', 'D', '1', '0') 333#define <link linkend="V4L2-PIX-FMT-SGRBG10DPCM8">V4L2_PIX_FMT_SGRBG10DPCM8</link> v4l2_fourcc('B', 'D', '1', '0')
336 /* 334 /*
@@ -346,6 +344,7 @@ struct <link linkend="v4l2-pix-format">v4l2_pix_format</link> {
346#define <link linkend="V4L2-PIX-FMT-MPEG">V4L2_PIX_FMT_MPEG</link> v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 */ 344#define <link linkend="V4L2-PIX-FMT-MPEG">V4L2_PIX_FMT_MPEG</link> v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 */
347 345
348/* Vendor-specific formats */ 346/* Vendor-specific formats */
347#define <link linkend="V4L2-PIX-FMT-CPIA1">V4L2_PIX_FMT_CPIA1</link> v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */
349#define <link linkend="V4L2-PIX-FMT-WNVA">V4L2_PIX_FMT_WNVA</link> v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */ 348#define <link linkend="V4L2-PIX-FMT-WNVA">V4L2_PIX_FMT_WNVA</link> v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */
350#define <link linkend="V4L2-PIX-FMT-SN9C10X">V4L2_PIX_FMT_SN9C10X</link> v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */ 349#define <link linkend="V4L2-PIX-FMT-SN9C10X">V4L2_PIX_FMT_SN9C10X</link> v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */
351#define <link linkend="V4L2-PIX-FMT-SN9C20X-I420">V4L2_PIX_FMT_SN9C20X_I420</link> v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */ 350#define <link linkend="V4L2-PIX-FMT-SN9C20X-I420">V4L2_PIX_FMT_SN9C20X_I420</link> v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */
@@ -358,12 +357,15 @@ struct <link linkend="v4l2-pix-format">v4l2_pix_format</link> {
358#define <link linkend="V4L2-PIX-FMT-SPCA561">V4L2_PIX_FMT_SPCA561</link> v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */ 357#define <link linkend="V4L2-PIX-FMT-SPCA561">V4L2_PIX_FMT_SPCA561</link> v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */
359#define <link linkend="V4L2-PIX-FMT-PAC207">V4L2_PIX_FMT_PAC207</link> v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */ 358#define <link linkend="V4L2-PIX-FMT-PAC207">V4L2_PIX_FMT_PAC207</link> v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */
360#define <link linkend="V4L2-PIX-FMT-MR97310A">V4L2_PIX_FMT_MR97310A</link> v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */ 359#define <link linkend="V4L2-PIX-FMT-MR97310A">V4L2_PIX_FMT_MR97310A</link> v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */
360#define <link linkend="V4L2-PIX-FMT-SN9C2028">V4L2_PIX_FMT_SN9C2028</link> v4l2_fourcc('S', 'O', 'N', 'X') /* compressed GBRG bayer */
361#define <link linkend="V4L2-PIX-FMT-SQ905C">V4L2_PIX_FMT_SQ905C</link> v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */ 361#define <link linkend="V4L2-PIX-FMT-SQ905C">V4L2_PIX_FMT_SQ905C</link> v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */
362#define <link linkend="V4L2-PIX-FMT-PJPG">V4L2_PIX_FMT_PJPG</link> v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ 362#define <link linkend="V4L2-PIX-FMT-PJPG">V4L2_PIX_FMT_PJPG</link> v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */
363#define <link linkend="V4L2-PIX-FMT-OV511">V4L2_PIX_FMT_OV511</link> v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */ 363#define <link linkend="V4L2-PIX-FMT-OV511">V4L2_PIX_FMT_OV511</link> v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */
364#define <link linkend="V4L2-PIX-FMT-OV518">V4L2_PIX_FMT_OV518</link> v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */ 364#define <link linkend="V4L2-PIX-FMT-OV518">V4L2_PIX_FMT_OV518</link> v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */
365#define <link linkend="V4L2-PIX-FMT-TM6000">V4L2_PIX_FMT_TM6000</link> v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */
366#define <link linkend="V4L2-PIX-FMT-STV0680">V4L2_PIX_FMT_STV0680</link> v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */ 365#define <link linkend="V4L2-PIX-FMT-STV0680">V4L2_PIX_FMT_STV0680</link> v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */
366#define <link linkend="V4L2-PIX-FMT-TM6000">V4L2_PIX_FMT_TM6000</link> v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */
367#define <link linkend="V4L2-PIX-FMT-CIT-YYVYUY">V4L2_PIX_FMT_CIT_YYVYUY</link> v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */
368#define <link linkend="V4L2-PIX-FMT-KONICA420">V4L2_PIX_FMT_KONICA420</link> v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */
367 369
368/* 370/*
369 * F O R M A T E N U M E R A T I O N 371 * F O R M A T E N U M E R A T I O N
@@ -380,7 +382,7 @@ struct <link linkend="v4l2-fmtdesc">v4l2_fmtdesc</link> {
380#define V4L2_FMT_FLAG_COMPRESSED 0x0001 382#define V4L2_FMT_FLAG_COMPRESSED 0x0001
381#define V4L2_FMT_FLAG_EMULATED 0x0002 383#define V4L2_FMT_FLAG_EMULATED 0x0002
382 384
383#if 1 /*KEEP*/ 385#if 1
384 /* Experimental Frame Size and frame rate enumeration */ 386 /* Experimental Frame Size and frame rate enumeration */
385/* 387/*
386 * F R A M E S I Z E E N U M E R A T I O N 388 * F R A M E S I Z E E N U M E R A T I O N
@@ -544,6 +546,8 @@ struct <link linkend="v4l2-buffer">v4l2_buffer</link> {
544#define V4L2_BUF_FLAG_KEYFRAME 0x0008 /* Image is a keyframe (I-frame) */ 546#define V4L2_BUF_FLAG_KEYFRAME 0x0008 /* Image is a keyframe (I-frame) */
545#define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */ 547#define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */
546#define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */ 548#define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */
549/* Buffer is ready, but the data contained within is corrupted. */
550#define V4L2_BUF_FLAG_ERROR 0x0040
547#define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */ 551#define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */
548#define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid */ 552#define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid */
549 553
@@ -934,6 +938,16 @@ struct <link linkend="v4l2-ext-controls">v4l2_ext_controls</link> {
934#define V4L2_CTRL_ID2CLASS(id) ((id) &amp; 0x0fff0000UL) 938#define V4L2_CTRL_ID2CLASS(id) ((id) &amp; 0x0fff0000UL)
935#define V4L2_CTRL_DRIVER_PRIV(id) (((id) &amp; 0xffff) &gt;= 0x1000) 939#define V4L2_CTRL_DRIVER_PRIV(id) (((id) &amp; 0xffff) &gt;= 0x1000)
936 940
941enum <link linkend="v4l2-ctrl-type">v4l2_ctrl_type</link> {
942 V4L2_CTRL_TYPE_INTEGER = 1,
943 V4L2_CTRL_TYPE_BOOLEAN = 2,
944 V4L2_CTRL_TYPE_MENU = 3,
945 V4L2_CTRL_TYPE_BUTTON = 4,
946 V4L2_CTRL_TYPE_INTEGER64 = 5,
947 V4L2_CTRL_TYPE_CTRL_CLASS = 6,
948 V4L2_CTRL_TYPE_STRING = 7,
949};
950
937/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ 951/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
938struct <link linkend="v4l2-queryctrl">v4l2_queryctrl</link> { 952struct <link linkend="v4l2-queryctrl">v4l2_queryctrl</link> {
939 __u32 id; 953 __u32 id;
@@ -1018,21 +1032,27 @@ enum <link linkend="v4l2-colorfx">v4l2_colorfx</link> {
1018 V4L2_COLORFX_NONE = 0, 1032 V4L2_COLORFX_NONE = 0,
1019 V4L2_COLORFX_BW = 1, 1033 V4L2_COLORFX_BW = 1,
1020 V4L2_COLORFX_SEPIA = 2, 1034 V4L2_COLORFX_SEPIA = 2,
1021 V4L2_COLORFX_NEGATIVE = 3, 1035 V4L2_COLORFX_NEGATIVE = 3,
1022 V4L2_COLORFX_EMBOSS = 4, 1036 V4L2_COLORFX_EMBOSS = 4,
1023 V4L2_COLORFX_SKETCH = 5, 1037 V4L2_COLORFX_SKETCH = 5,
1024 V4L2_COLORFX_SKY_BLUE = 6, 1038 V4L2_COLORFX_SKY_BLUE = 6,
1025 V4L2_COLORFX_GRASS_GREEN = 7, 1039 V4L2_COLORFX_GRASS_GREEN = 7,
1026 V4L2_COLORFX_SKIN_WHITEN = 8, 1040 V4L2_COLORFX_SKIN_WHITEN = 8,
1027 V4L2_COLORFX_VIVID = 9. 1041 V4L2_COLORFX_VIVID = 9,
1028}; 1042};
1029#define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32) 1043#define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32)
1030#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33) 1044#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33)
1031 1045
1032#define V4L2_CID_ROTATE (V4L2_CID_BASE+34) 1046#define V4L2_CID_ROTATE (V4L2_CID_BASE+34)
1033#define V4L2_CID_BG_COLOR (V4L2_CID_BASE+35) 1047#define V4L2_CID_BG_COLOR (V4L2_CID_BASE+35)
1048
1049#define V4L2_CID_CHROMA_GAIN (V4L2_CID_BASE+36)
1050
1051#define V4L2_CID_ILLUMINATORS_1 (V4L2_CID_BASE+37)
1052#define V4L2_CID_ILLUMINATORS_2 (V4L2_CID_BASE+38)
1053
1034/* last CID + 1 */ 1054/* last CID + 1 */
1035#define V4L2_CID_LASTP1 (V4L2_CID_BASE+36) 1055#define V4L2_CID_LASTP1 (V4L2_CID_BASE+39)
1036 1056
1037/* MPEG-class control IDs defined by V4L2 */ 1057/* MPEG-class control IDs defined by V4L2 */
1038#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) 1058#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
@@ -1349,6 +1369,8 @@ struct <link linkend="v4l2-modulator">v4l2_modulator</link> {
1349#define V4L2_TUNER_CAP_SAP 0x0020 1369#define V4L2_TUNER_CAP_SAP 0x0020
1350#define V4L2_TUNER_CAP_LANG1 0x0040 1370#define V4L2_TUNER_CAP_LANG1 0x0040
1351#define V4L2_TUNER_CAP_RDS 0x0080 1371#define V4L2_TUNER_CAP_RDS 0x0080
1372#define V4L2_TUNER_CAP_RDS_BLOCK_IO 0x0100
1373#define V4L2_TUNER_CAP_RDS_CONTROLS 0x0200
1352 1374
1353/* Flags for the 'rxsubchans' field */ 1375/* Flags for the 'rxsubchans' field */
1354#define V4L2_TUNER_SUB_MONO 0x0001 1376#define V4L2_TUNER_SUB_MONO 0x0001
@@ -1378,7 +1400,8 @@ struct <link linkend="v4l2-hw-freq-seek">v4l2_hw_freq_seek</link> {
1378 enum <link linkend="v4l2-tuner-type">v4l2_tuner_type</link> type; 1400 enum <link linkend="v4l2-tuner-type">v4l2_tuner_type</link> type;
1379 __u32 seek_upward; 1401 __u32 seek_upward;
1380 __u32 wrap_around; 1402 __u32 wrap_around;
1381 __u32 reserved[8]; 1403 __u32 spacing;
1404 __u32 reserved[7];
1382}; 1405};
1383 1406
1384/* 1407/*
@@ -1433,7 +1456,7 @@ struct <link linkend="v4l2-audioout">v4l2_audioout</link> {
1433 * 1456 *
1434 * NOTE: EXPERIMENTAL API 1457 * NOTE: EXPERIMENTAL API
1435 */ 1458 */
1436#if 1 /*KEEP*/ 1459#if 1
1437#define V4L2_ENC_IDX_FRAME_I (0) 1460#define V4L2_ENC_IDX_FRAME_I (0)
1438#define V4L2_ENC_IDX_FRAME_P (1) 1461#define V4L2_ENC_IDX_FRAME_P (1)
1439#define V4L2_ENC_IDX_FRAME_B (2) 1462#define V4L2_ENC_IDX_FRAME_B (2)
@@ -1626,6 +1649,38 @@ struct <link linkend="v4l2-streamparm">v4l2_streamparm</link> {
1626}; 1649};
1627 1650
1628/* 1651/*
1652 * E V E N T S
1653 */
1654
1655#define V4L2_EVENT_ALL 0
1656#define V4L2_EVENT_VSYNC 1
1657#define V4L2_EVENT_EOS 2
1658#define V4L2_EVENT_PRIVATE_START 0x08000000
1659
1660/* Payload for V4L2_EVENT_VSYNC */
1661struct <link linkend="v4l2-event-vsync">v4l2_event_vsync</link> {
1662 /* Can be V4L2_FIELD_ANY, _NONE, _TOP or _BOTTOM */
1663 __u8 field;
1664} __attribute__ ((packed));
1665
1666struct <link linkend="v4l2-event">v4l2_event</link> {
1667 __u32 type;
1668 union {
1669 struct <link linkend="v4l2-event-vsync">v4l2_event_vsync</link> vsync;
1670 __u8 data[64];
1671 } u;
1672 __u32 pending;
1673 __u32 sequence;
1674 struct timespec timestamp;
1675 __u32 reserved[9];
1676};
1677
1678struct <link linkend="v4l2-event-subscription">v4l2_event_subscription</link> {
1679 __u32 type;
1680 __u32 reserved[7];
1681};
1682
1683/*
1629 * A D V A N C E D D E B U G G I N G 1684 * A D V A N C E D D E B U G G I N G
1630 * 1685 *
1631 * NOTE: EXPERIMENTAL API, NEVER RELY ON THIS IN APPLICATIONS! 1686 * NOTE: EXPERIMENTAL API, NEVER RELY ON THIS IN APPLICATIONS!
@@ -1720,7 +1775,7 @@ struct <link linkend="v4l2-dbg-chip-ident">v4l2_dbg_chip_ident</link> {
1720#define VIDIOC_G_EXT_CTRLS _IOWR('V', 71, struct <link linkend="v4l2-ext-controls">v4l2_ext_controls</link>) 1775#define VIDIOC_G_EXT_CTRLS _IOWR('V', 71, struct <link linkend="v4l2-ext-controls">v4l2_ext_controls</link>)
1721#define VIDIOC_S_EXT_CTRLS _IOWR('V', 72, struct <link linkend="v4l2-ext-controls">v4l2_ext_controls</link>) 1776#define VIDIOC_S_EXT_CTRLS _IOWR('V', 72, struct <link linkend="v4l2-ext-controls">v4l2_ext_controls</link>)
1722#define VIDIOC_TRY_EXT_CTRLS _IOWR('V', 73, struct <link linkend="v4l2-ext-controls">v4l2_ext_controls</link>) 1777#define VIDIOC_TRY_EXT_CTRLS _IOWR('V', 73, struct <link linkend="v4l2-ext-controls">v4l2_ext_controls</link>)
1723#if 1 /*KEEP*/ 1778#if 1
1724#define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct <link linkend="v4l2-frmsizeenum">v4l2_frmsizeenum</link>) 1779#define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct <link linkend="v4l2-frmsizeenum">v4l2_frmsizeenum</link>)
1725#define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct <link linkend="v4l2-frmivalenum">v4l2_frmivalenum</link>) 1780#define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct <link linkend="v4l2-frmivalenum">v4l2_frmivalenum</link>)
1726#define VIDIOC_G_ENC_INDEX _IOR('V', 76, struct <link linkend="v4l2-enc-idx">v4l2_enc_idx</link>) 1781#define VIDIOC_G_ENC_INDEX _IOR('V', 76, struct <link linkend="v4l2-enc-idx">v4l2_enc_idx</link>)
@@ -1728,7 +1783,7 @@ struct <link linkend="v4l2-dbg-chip-ident">v4l2_dbg_chip_ident</link> {
1728#define VIDIOC_TRY_ENCODER_CMD _IOWR('V', 78, struct <link linkend="v4l2-encoder-cmd">v4l2_encoder_cmd</link>) 1783#define VIDIOC_TRY_ENCODER_CMD _IOWR('V', 78, struct <link linkend="v4l2-encoder-cmd">v4l2_encoder_cmd</link>)
1729#endif 1784#endif
1730 1785
1731#if 1 /*KEEP*/ 1786#if 1
1732/* Experimental, meant for debugging, testing and internal use. 1787/* Experimental, meant for debugging, testing and internal use.
1733 Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined. 1788 Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined.
1734 You must be root to use these ioctls. Never use these in applications! */ 1789 You must be root to use these ioctls. Never use these in applications! */
@@ -1747,6 +1802,9 @@ struct <link linkend="v4l2-dbg-chip-ident">v4l2_dbg_chip_ident</link> {
1747#define VIDIOC_QUERY_DV_PRESET _IOR('V', 86, struct <link linkend="v4l2-dv-preset">v4l2_dv_preset</link>) 1802#define VIDIOC_QUERY_DV_PRESET _IOR('V', 86, struct <link linkend="v4l2-dv-preset">v4l2_dv_preset</link>)
1748#define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct <link linkend="v4l2-dv-timings">v4l2_dv_timings</link>) 1803#define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct <link linkend="v4l2-dv-timings">v4l2_dv_timings</link>)
1749#define VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct <link linkend="v4l2-dv-timings">v4l2_dv_timings</link>) 1804#define VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct <link linkend="v4l2-dv-timings">v4l2_dv_timings</link>)
1805#define VIDIOC_DQEVENT _IOR('V', 89, struct <link linkend="v4l2-event">v4l2_event</link>)
1806#define VIDIOC_SUBSCRIBE_EVENT _IOW('V', 90, struct <link linkend="v4l2-event-subscription">v4l2_event_subscription</link>)
1807#define VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct <link linkend="v4l2-event-subscription">v4l2_event_subscription</link>)
1750 1808
1751/* Reminder: when adding new ioctls please add support for them to 1809/* Reminder: when adding new ioctls please add support for them to
1752 drivers/media/video/v4l2-compat-ioctl32.c as well! */ 1810 drivers/media/video/v4l2-compat-ioctl32.c as well! */
diff --git a/Documentation/DocBook/v4l/vidioc-g-dv-preset.xml b/Documentation/DocBook/v4l/vidioc-g-dv-preset.xml
index 3c6784e132f3..d733721a7519 100644
--- a/Documentation/DocBook/v4l/vidioc-g-dv-preset.xml
+++ b/Documentation/DocBook/v4l/vidioc-g-dv-preset.xml
@@ -16,8 +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>&v4l2-dv-preset; 19 <paramdef>struct v4l2_dv_preset *<parameter>argp</parameter></paramdef>
20*<parameter>argp</parameter></paramdef>
21 </funcprototype> 20 </funcprototype>
22 </funcsynopsis> 21 </funcsynopsis>
23 </refsynopsisdiv> 22 </refsynopsisdiv>
diff --git a/Documentation/DocBook/v4l/vidioc-g-dv-timings.xml b/Documentation/DocBook/v4l/vidioc-g-dv-timings.xml
index ecc19576bb8f..d5ec6abf0ce2 100644
--- a/Documentation/DocBook/v4l/vidioc-g-dv-timings.xml
+++ b/Documentation/DocBook/v4l/vidioc-g-dv-timings.xml
@@ -16,8 +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>&v4l2-dv-timings; 19 <paramdef>struct v4l2_dv_timings *<parameter>argp</parameter></paramdef>
20*<parameter>argp</parameter></paramdef>
21 </funcprototype> 20 </funcprototype>
22 </funcsynopsis> 21 </funcsynopsis>
23 </refsynopsisdiv> 22 </refsynopsisdiv>
diff --git a/Documentation/DocBook/v4l/vidioc-query-dv-preset.xml b/Documentation/DocBook/v4l/vidioc-query-dv-preset.xml
index 402229ee06f6..d272f7ab91b8 100644
--- a/Documentation/DocBook/v4l/vidioc-query-dv-preset.xml
+++ b/Documentation/DocBook/v4l/vidioc-query-dv-preset.xml
@@ -16,7 +16,7 @@ input</refpurpose>
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>&v4l2-dv-preset; *<parameter>argp</parameter></paramdef> 19 <paramdef>struct v4l2_dv_preset *<parameter>argp</parameter></paramdef>
20 </funcprototype> 20 </funcprototype>
21 </funcsynopsis> 21 </funcsynopsis>
22 </refsynopsisdiv> 22 </refsynopsisdiv>
diff --git a/Documentation/DocBook/v4l/vidioc-querycap.xml b/Documentation/DocBook/v4l/vidioc-querycap.xml
index 6ab7e25b31b6..d499da93a450 100644
--- a/Documentation/DocBook/v4l/vidioc-querycap.xml
+++ b/Documentation/DocBook/v4l/vidioc-querycap.xml
@@ -184,7 +184,7 @@ data.</entry>
184 <row> 184 <row>
185 <entry><constant>V4L2_CAP_RDS_CAPTURE</constant></entry> 185 <entry><constant>V4L2_CAP_RDS_CAPTURE</constant></entry>
186 <entry>0x00000100</entry> 186 <entry>0x00000100</entry>
187 <entry>The device supports the <link linkend="rds">RDS</link> interface.</entry> 187 <entry>The device supports the <link linkend="rds">RDS</link> capture interface.</entry>
188 </row> 188 </row>
189 <row> 189 <row>
190 <entry><constant>V4L2_CAP_VIDEO_OUTPUT_OVERLAY</constant></entry> 190 <entry><constant>V4L2_CAP_VIDEO_OUTPUT_OVERLAY</constant></entry>
@@ -206,6 +206,11 @@ driver capabilities.</para></footnote></entry>
206hardware frequency seeking.</entry> 206hardware frequency seeking.</entry>
207 </row> 207 </row>
208 <row> 208 <row>
209 <entry><constant>V4L2_CAP_RDS_OUTPUT</constant></entry>
210 <entry>0x00000800</entry>
211 <entry>The device supports the <link linkend="rds">RDS</link> output interface.</entry>
212 </row>
213 <row>
209 <entry><constant>V4L2_CAP_TUNER</constant></entry> 214 <entry><constant>V4L2_CAP_TUNER</constant></entry>
210 <entry>0x00010000</entry> 215 <entry>0x00010000</entry>
211 <entry>The device has some sort of tuner to 216 <entry>The device has some sort of tuner to
diff --git a/Documentation/DocBook/v4l/vidioc-queryctrl.xml b/Documentation/DocBook/v4l/vidioc-queryctrl.xml
index 8e0e055ac934..0d5e8283cf32 100644
--- a/Documentation/DocBook/v4l/vidioc-queryctrl.xml
+++ b/Documentation/DocBook/v4l/vidioc-queryctrl.xml
@@ -103,8 +103,12 @@ structure. The driver fills the rest of the structure or returns an
103<structfield>index</structfield> is invalid. Menu items are enumerated 103<structfield>index</structfield> is invalid. Menu items are enumerated
104by calling <constant>VIDIOC_QUERYMENU</constant> with successive 104by calling <constant>VIDIOC_QUERYMENU</constant> with successive
105<structfield>index</structfield> values from &v4l2-queryctrl; 105<structfield>index</structfield> values from &v4l2-queryctrl;
106<structfield>minimum</structfield> (0) to 106<structfield>minimum</structfield> to
107<structfield>maximum</structfield>, inclusive.</para> 107<structfield>maximum</structfield>, inclusive. Note that it is possible
108for <constant>VIDIOC_QUERYMENU</constant> to return an &EINVAL; for some
109indices between <structfield>minimum</structfield> and <structfield>maximum</structfield>.
110In that case that particular menu item is not supported by this driver. Also note that
111the <structfield>minimum</structfield> value is not necessarily 0.</para>
108 112
109 <para>See also the examples in <xref linkend="control" />.</para> 113 <para>See also the examples in <xref linkend="control" />.</para>
110 114
@@ -139,7 +143,7 @@ string. This information is intended for the user.</entry>
139 <entry><structfield>minimum</structfield></entry> 143 <entry><structfield>minimum</structfield></entry>
140 <entry>Minimum value, inclusive. This field gives a lower 144 <entry>Minimum value, inclusive. This field gives a lower
141bound for <constant>V4L2_CTRL_TYPE_INTEGER</constant> controls and the 145bound for <constant>V4L2_CTRL_TYPE_INTEGER</constant> controls and the
142lowest valid index (always 0) for <constant>V4L2_CTRL_TYPE_MENU</constant> controls. 146lowest valid index for <constant>V4L2_CTRL_TYPE_MENU</constant> controls.
143For <constant>V4L2_CTRL_TYPE_STRING</constant> controls the minimum value 147For <constant>V4L2_CTRL_TYPE_STRING</constant> controls the minimum value
144gives the minimum length of the string. This length <emphasis>does not include the terminating 148gives the minimum length of the string. This length <emphasis>does not include the terminating
145zero</emphasis>. It may not be valid for any other type of control, including 149zero</emphasis>. It may not be valid for any other type of control, including
@@ -279,7 +283,7 @@ values which are actually different on the hardware.</entry>
279 </row> 283 </row>
280 <row> 284 <row>
281 <entry><constant>V4L2_CTRL_TYPE_MENU</constant></entry> 285 <entry><constant>V4L2_CTRL_TYPE_MENU</constant></entry>
282 <entry>0</entry> 286 <entry>&ge; 0</entry>
283 <entry>1</entry> 287 <entry>1</entry>
284 <entry>N-1</entry> 288 <entry>N-1</entry>
285 <entry>The control has a menu of N choices. The names of 289 <entry>The control has a menu of N choices. The names of
@@ -405,8 +409,10 @@ writing a value will cause the device to carry out a given action
405 <term><errorcode>EINVAL</errorcode></term> 409 <term><errorcode>EINVAL</errorcode></term>
406 <listitem> 410 <listitem>
407 <para>The &v4l2-queryctrl; <structfield>id</structfield> 411 <para>The &v4l2-queryctrl; <structfield>id</structfield>
408is invalid. The &v4l2-querymenu; <structfield>id</structfield> or 412is invalid. The &v4l2-querymenu; <structfield>id</structfield> is
409<structfield>index</structfield> is invalid.</para> 413invalid or <structfield>index</structfield> is out of range (less than
414<structfield>minimum</structfield> or greater than <structfield>maximum</structfield>)
415or this particular menu item is not supported by the driver.</para>
410 </listitem> 416 </listitem>
411 </varlistentry> 417 </varlistentry>
412 <varlistentry> 418 <varlistentry>
diff --git a/Documentation/DocBook/v4l/vidioc-s-hw-freq-seek.xml b/Documentation/DocBook/v4l/vidioc-s-hw-freq-seek.xml
index 14b3ec7ed75b..c30dcc4232c0 100644
--- a/Documentation/DocBook/v4l/vidioc-s-hw-freq-seek.xml
+++ b/Documentation/DocBook/v4l/vidioc-s-hw-freq-seek.xml
@@ -51,7 +51,8 @@
51 51
52 <para>Start a hardware frequency seek from the current frequency. 52 <para>Start a hardware frequency seek from the current frequency.
53To do this applications initialize the <structfield>tuner</structfield>, 53To do this applications initialize the <structfield>tuner</structfield>,
54<structfield>type</structfield>, <structfield>seek_upward</structfield> and 54<structfield>type</structfield>, <structfield>seek_upward</structfield>,
55<structfield>spacing</structfield> and
55<structfield>wrap_around</structfield> fields, and zero out the 56<structfield>wrap_around</structfield> fields, and zero out the
56<structfield>reserved</structfield> array of a &v4l2-hw-freq-seek; and 57<structfield>reserved</structfield> array of a &v4l2-hw-freq-seek; and
57call the <constant>VIDIOC_S_HW_FREQ_SEEK</constant> ioctl with a pointer 58call the <constant>VIDIOC_S_HW_FREQ_SEEK</constant> ioctl with a pointer
@@ -89,7 +90,12 @@ field and the &v4l2-tuner; <structfield>index</structfield> field.</entry>
89 </row> 90 </row>
90 <row> 91 <row>
91 <entry>__u32</entry> 92 <entry>__u32</entry>
92 <entry><structfield>reserved</structfield>[8]</entry> 93 <entry><structfield>spacing</structfield></entry>
94 <entry>If non-zero, defines the hardware seek resolution in Hz. The driver selects the nearest value that is supported by the device. If spacing is zero a reasonable default value is used.</entry>
95 </row>
96 <row>
97 <entry>__u32</entry>
98 <entry><structfield>reserved</structfield>[7]</entry>
93 <entry>Reserved for future extensions. Drivers and 99 <entry>Reserved for future extensions. Drivers and
94 applications must set the array to zero.</entry> 100 applications must set the array to zero.</entry>
95 </row> 101 </row>
diff --git a/Documentation/accounting/getdelays.c b/Documentation/accounting/getdelays.c
index 6e25c2659e0a..a2976a6de033 100644
--- a/Documentation/accounting/getdelays.c
+++ b/Documentation/accounting/getdelays.c
@@ -21,6 +21,7 @@
21#include <sys/types.h> 21#include <sys/types.h>
22#include <sys/stat.h> 22#include <sys/stat.h>
23#include <sys/socket.h> 23#include <sys/socket.h>
24#include <sys/wait.h>
24#include <signal.h> 25#include <signal.h>
25 26
26#include <linux/genetlink.h> 27#include <linux/genetlink.h>
@@ -266,11 +267,13 @@ int main(int argc, char *argv[])
266 int containerset = 0; 267 int containerset = 0;
267 char containerpath[1024]; 268 char containerpath[1024];
268 int cfd = 0; 269 int cfd = 0;
270 int forking = 0;
271 sigset_t sigset;
269 272
270 struct msgtemplate msg; 273 struct msgtemplate msg;
271 274
272 while (1) { 275 while (!forking) {
273 c = getopt(argc, argv, "qdiw:r:m:t:p:vlC:"); 276 c = getopt(argc, argv, "qdiw:r:m:t:p:vlC:c:");
274 if (c < 0) 277 if (c < 0)
275 break; 278 break;
276 279
@@ -319,6 +322,28 @@ int main(int argc, char *argv[])
319 err(1, "Invalid pid\n"); 322 err(1, "Invalid pid\n");
320 cmd_type = TASKSTATS_CMD_ATTR_PID; 323 cmd_type = TASKSTATS_CMD_ATTR_PID;
321 break; 324 break;
325 case 'c':
326
327 /* Block SIGCHLD for sigwait() later */
328 if (sigemptyset(&sigset) == -1)
329 err(1, "Failed to empty sigset");
330 if (sigaddset(&sigset, SIGCHLD))
331 err(1, "Failed to set sigchld in sigset");
332 sigprocmask(SIG_BLOCK, &sigset, NULL);
333
334 /* fork/exec a child */
335 tid = fork();
336 if (tid < 0)
337 err(1, "Fork failed\n");
338 if (tid == 0)
339 if (execvp(argv[optind - 1],
340 &argv[optind - 1]) < 0)
341 exit(-1);
342
343 /* Set the command type and avoid further processing */
344 cmd_type = TASKSTATS_CMD_ATTR_PID;
345 forking = 1;
346 break;
322 case 'v': 347 case 'v':
323 printf("debug on\n"); 348 printf("debug on\n");
324 dbg = 1; 349 dbg = 1;
@@ -370,6 +395,15 @@ int main(int argc, char *argv[])
370 goto err; 395 goto err;
371 } 396 }
372 397
398 /*
399 * If we forked a child, wait for it to exit. Cannot use waitpid()
400 * as all the delicious data would be reaped as part of the wait
401 */
402 if (tid && forking) {
403 int sig_received;
404 sigwait(&sigset, &sig_received);
405 }
406
373 if (tid) { 407 if (tid) {
374 rc = send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET, 408 rc = send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET,
375 cmd_type, &tid, sizeof(__u32)); 409 cmd_type, &tid, sizeof(__u32));
diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt
index b34823ff1646..190018b0c649 100644
--- a/Documentation/cgroups/cgroups.txt
+++ b/Documentation/cgroups/cgroups.txt
@@ -18,7 +18,8 @@ CONTENTS:
18 1.2 Why are cgroups needed ? 18 1.2 Why are cgroups needed ?
19 1.3 How are cgroups implemented ? 19 1.3 How are cgroups implemented ?
20 1.4 What does notify_on_release do ? 20 1.4 What does notify_on_release do ?
21 1.5 How do I use cgroups ? 21 1.5 What does clone_children do ?
22 1.6 How do I use cgroups ?
222. Usage Examples and Syntax 232. Usage Examples and Syntax
23 2.1 Basic Usage 24 2.1 Basic Usage
24 2.2 Attaching processes 25 2.2 Attaching processes
@@ -293,7 +294,16 @@ notify_on_release in the root cgroup at system boot is disabled
293value of their parents notify_on_release setting. The default value of 294value of their parents notify_on_release setting. The default value of
294a cgroup hierarchy's release_agent path is empty. 295a cgroup hierarchy's release_agent path is empty.
295 296
2961.5 How do I use cgroups ? 2971.5 What does clone_children do ?
298---------------------------------
299
300If the clone_children flag is enabled (1) in a cgroup, then all
301cgroups created beneath will call the post_clone callbacks for each
302subsystem of the newly created cgroup. Usually when this callback is
303implemented for a subsystem, it copies the values of the parent
304subsystem, this is the case for the cpuset.
305
3061.6 How do I use cgroups ?
297-------------------------- 307--------------------------
298 308
299To start a new job that is to be contained within a cgroup, using 309To start a new job that is to be contained within a cgroup, using
diff --git a/Documentation/coccinelle.txt b/Documentation/coccinelle.txt
index cd2b02837066..4a276ea7001c 100644
--- a/Documentation/coccinelle.txt
+++ b/Documentation/coccinelle.txt
@@ -24,6 +24,9 @@ of many distributions, e.g. :
24You can get the latest version released from the Coccinelle homepage at 24You can get the latest version released from the Coccinelle homepage at
25http://coccinelle.lip6.fr/ 25http://coccinelle.lip6.fr/
26 26
27Information and tips about Coccinelle are also provided on the wiki
28pages at http://cocci.ekstranet.diku.dk/wiki/doku.php
29
27Once you have it, run the following command: 30Once you have it, run the following command:
28 31
29 ./configure 32 ./configure
@@ -41,20 +44,22 @@ A Coccinelle-specific target is defined in the top level
41Makefile. This target is named 'coccicheck' and calls the 'coccicheck' 44Makefile. This target is named 'coccicheck' and calls the 'coccicheck'
42front-end in the 'scripts' directory. 45front-end in the 'scripts' directory.
43 46
44Four modes are defined: report, patch, context, and org. The mode to 47Four modes are defined: patch, report, context, and org. The mode to
45use is specified by setting the MODE variable with 'MODE=<mode>'. 48use is specified by setting the MODE variable with 'MODE=<mode>'.
46 49
50'patch' proposes a fix, when possible.
51
47'report' generates a list in the following format: 52'report' generates a list in the following format:
48 file:line:column-column: message 53 file:line:column-column: message
49 54
50'patch' proposes a fix, when possible.
51
52'context' highlights lines of interest and their context in a 55'context' highlights lines of interest and their context in a
53diff-like style.Lines of interest are indicated with '-'. 56diff-like style.Lines of interest are indicated with '-'.
54 57
55'org' generates a report in the Org mode format of Emacs. 58'org' generates a report in the Org mode format of Emacs.
56 59
57Note that not all semantic patches implement all modes. 60Note that not all semantic patches implement all modes. For easy use
61of Coccinelle, the default mode is "chain" which tries the previous
62modes in the order above until one succeeds.
58 63
59To make a report for every semantic patch, run the following command: 64To make a report for every semantic patch, run the following command:
60 65
@@ -68,9 +73,9 @@ To produce patches, run:
68 73
69 74
70The coccicheck target applies every semantic patch available in the 75The coccicheck target applies every semantic patch available in the
71subdirectories of 'scripts/coccinelle' to the entire Linux kernel. 76sub-directories of 'scripts/coccinelle' to the entire Linux kernel.
72 77
73For each semantic patch, a changelog message is proposed. It gives a 78For each semantic patch, a commit message is proposed. It gives a
74description of the problem being checked by the semantic patch, and 79description of the problem being checked by the semantic patch, and
75includes a reference to Coccinelle. 80includes a reference to Coccinelle.
76 81
@@ -93,12 +98,35 @@ or
93 make coccicheck COCCI=<my_SP.cocci> MODE=report 98 make coccicheck COCCI=<my_SP.cocci> MODE=report
94 99
95 100
101 Using Coccinelle on (modified) files
102~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
103
104To apply Coccinelle on a file basis, instead of a directory basis, the
105following command may be used:
106
107 make C=1 CHECK="scripts/coccicheck"
108
109To check only newly edited code, use the value 2 for the C flag, i.e.
110
111 make C=2 CHECK="scripts/coccicheck"
112
113This runs every semantic patch in scripts/coccinelle by default. The
114COCCI variable may additionally be used to only apply a single
115semantic patch as shown in the previous section.
116
117The "chain" mode is the default. You can select another one with the
118MODE variable explained above.
119
120In this mode, there is no information about semantic patches
121displayed, and no commit message proposed.
122
123
96 Proposing new semantic patches 124 Proposing new semantic patches
97~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 125~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
98 126
99New semantic patches can be proposed and submitted by kernel 127New semantic patches can be proposed and submitted by kernel
100developers. For sake of clarity, they should be organized in the 128developers. For sake of clarity, they should be organized in the
101subdirectories of 'scripts/coccinelle/'. 129sub-directories of 'scripts/coccinelle/'.
102 130
103 131
104 Detailed description of the 'report' mode 132 Detailed description of the 'report' mode
@@ -111,7 +139,7 @@ Example:
111 139
112Running 140Running
113 141
114 make coccicheck MODE=report COCCI=scripts/coccinelle/err_cast.cocci 142 make coccicheck MODE=report COCCI=scripts/coccinelle/api/err_cast.cocci
115 143
116will execute the following part of the SmPL script. 144will execute the following part of the SmPL script.
117 145
@@ -149,7 +177,7 @@ identified.
149Example: 177Example:
150 178
151Running 179Running
152 make coccicheck MODE=patch COCCI=scripts/coccinelle/err_cast.cocci 180 make coccicheck MODE=patch COCCI=scripts/coccinelle/api/err_cast.cocci
153 181
154will execute the following part of the SmPL script. 182will execute the following part of the SmPL script.
155 183
@@ -193,7 +221,7 @@ NOTE: The diff-like output generated is NOT an applicable patch. The
193Example: 221Example:
194 222
195Running 223Running
196 make coccicheck MODE=context COCCI=scripts/coccinelle/err_cast.cocci 224 make coccicheck MODE=context COCCI=scripts/coccinelle/api/err_cast.cocci
197 225
198will execute the following part of the SmPL script. 226will execute the following part of the SmPL script.
199 227
@@ -228,7 +256,7 @@ diff -u -p /home/user/linux/crypto/ctr.c /tmp/nothing
228Example: 256Example:
229 257
230Running 258Running
231 make coccicheck MODE=org COCCI=scripts/coccinelle/err_cast.cocci 259 make coccicheck MODE=org COCCI=scripts/coccinelle/api/err_cast.cocci
232 260
233will execute the following part of the SmPL script. 261will execute the following part of the SmPL script.
234 262
diff --git a/Documentation/devices.txt b/Documentation/devices.txt
index c58abf1ccc71..eccffe715229 100644
--- a/Documentation/devices.txt
+++ b/Documentation/devices.txt
@@ -1496,9 +1496,6 @@ Your cooperation is appreciated.
1496 64 = /dev/radio0 Radio device 1496 64 = /dev/radio0 Radio device
1497 ... 1497 ...
1498 127 = /dev/radio63 Radio device 1498 127 = /dev/radio63 Radio device
1499 192 = /dev/vtx0 Teletext device
1500 ...
1501 223 = /dev/vtx31 Teletext device
1502 224 = /dev/vbi0 Vertical blank interrupt 1499 224 = /dev/vbi0 Vertical blank interrupt
1503 ... 1500 ...
1504 255 = /dev/vbi31 Vertical blank interrupt 1501 255 = /dev/vbi31 Vertical blank interrupt
@@ -2520,6 +2517,12 @@ Your cooperation is appreciated.
2520 8 = /dev/mmcblk1 Second SD/MMC card 2517 8 = /dev/mmcblk1 Second SD/MMC card
2521 ... 2518 ...
2522 2519
2520 The start of next SD/MMC card can be configured with
2521 CONFIG_MMC_BLOCK_MINORS, or overridden at boot/modprobe
2522 time using the mmcblk.perdev_minors option. That would
2523 bump the offset between each card to be the configured
2524 value instead of the default 8.
2525
2523179 char CCube DVXChip-based PCI products 2526179 char CCube DVXChip-based PCI products
2524 0 = /dev/dvxirq0 First DVX device 2527 0 = /dev/dvxirq0 First DVX device
2525 1 = /dev/dvxirq1 Second DVX device 2528 1 = /dev/dvxirq1 Second DVX device
diff --git a/Documentation/dvb/get_dvb_firmware b/Documentation/dvb/get_dvb_firmware
index 350959f4e41b..59690de8ebfe 100644
--- a/Documentation/dvb/get_dvb_firmware
+++ b/Documentation/dvb/get_dvb_firmware
@@ -26,7 +26,8 @@ use IO::Handle;
26 "dec3000s", "vp7041", "dibusb", "nxt2002", "nxt2004", 26 "dec3000s", "vp7041", "dibusb", "nxt2002", "nxt2004",
27 "or51211", "or51132_qam", "or51132_vsb", "bluebird", 27 "or51211", "or51132_qam", "or51132_vsb", "bluebird",
28 "opera1", "cx231xx", "cx18", "cx23885", "pvrusb2", "mpc718", 28 "opera1", "cx231xx", "cx18", "cx23885", "pvrusb2", "mpc718",
29 "af9015", "ngene", "az6027"); 29 "af9015", "ngene", "az6027", "lme2510_lg", "lme2510c_s7395",
30 "lme2510c_s7395_old");
30 31
31# Check args 32# Check args
32syntax() if (scalar(@ARGV) != 1); 33syntax() if (scalar(@ARGV) != 1);
@@ -584,6 +585,49 @@ sub az6027{
584 585
585 $firmware; 586 $firmware;
586} 587}
588
589sub lme2510_lg {
590 my $sourcefile = "LMEBDA_DVBS.sys";
591 my $hash = "fc6017ad01e79890a97ec53bea157ed2";
592 my $outfile = "dvb-usb-lme2510-lg.fw";
593 my $hasho = "caa065d5fdbd2c09ad57b399bbf55cad";
594
595 checkstandard();
596
597 verify($sourcefile, $hash);
598 extract($sourcefile, 4168, 3841, $outfile);
599 verify($outfile, $hasho);
600 $outfile;
601}
602
603sub lme2510c_s7395 {
604 my $sourcefile = "US2A0D.sys";
605 my $hash = "b0155a8083fb822a3bd47bc360e74601";
606 my $outfile = "dvb-usb-lme2510c-s7395.fw";
607 my $hasho = "3a3cf1aeebd17b6ddc04cebe131e94cf";
608
609 checkstandard();
610
611 verify($sourcefile, $hash);
612 extract($sourcefile, 37248, 3720, $outfile);
613 verify($outfile, $hasho);
614 $outfile;
615}
616
617sub lme2510c_s7395_old {
618 my $sourcefile = "LMEBDA_DVBS7395C.sys";
619 my $hash = "7572ae0eb9cdf91baabd7c0ba9e09b31";
620 my $outfile = "dvb-usb-lme2510c-s7395.fw";
621 my $hasho = "90430c5b435eb5c6f88fd44a9d950674";
622
623 checkstandard();
624
625 verify($sourcefile, $hash);
626 extract($sourcefile, 4208, 3881, $outfile);
627 verify($outfile, $hasho);
628 $outfile;
629}
630
587# --------------------------------------------------------------- 631# ---------------------------------------------------------------
588# Utilities 632# Utilities
589 633
diff --git a/Documentation/dvb/lmedm04.txt b/Documentation/dvb/lmedm04.txt
new file mode 100644
index 000000000000..e175784b89bf
--- /dev/null
+++ b/Documentation/dvb/lmedm04.txt
@@ -0,0 +1,58 @@
1To extract firmware for the DM04/QQBOX you need to copy the
2following file(s) to this directory.
3
4for DM04+/QQBOX LME2510C (Sharp 7395 Tuner)
5-------------------------------------------
6
7The Sharp 7395 driver can be found in windows/system32/driver
8
9US2A0D.sys (dated 17 Mar 2009)
10
11
12and run
13./get_dvb_firmware lme2510c_s7395
14
15 will produce
16 dvb-usb-lme2510c-s7395.fw
17
18An alternative but older firmware can be found on the driver
19disk DVB-S_EN_3.5A in BDADriver/driver
20
21LMEBDA_DVBS7395C.sys (dated 18 Jan 2008)
22
23and run
24./get_dvb_firmware lme2510c_s7395_old
25
26 will produce
27 dvb-usb-lme2510c-s7395.fw
28
29--------------------------------------------------------------------
30
31The LG firmware can be found on the driver
32disk DM04+_5.1A[LG] in BDADriver/driver
33
34for DM04 LME2510 (LG Tuner)
35---------------------------
36
37LMEBDA_DVBS.sys (dated 13 Nov 2007)
38
39and run
40./get_dvb_firmware lme2510_lg
41
42 will produce
43 dvb-usb-lme2510-lg.fw
44
45
46Other LG firmware can be extracted manually from US280D.sys
47only found in windows/system32/driver.
48
49dd if=US280D.sys ibs=1 skip=42616 count=3668 of=dvb-usb-lme2510-lg.fw
50
51for DM04 LME2510C (LG Tuner)
52---------------------------
53
54dd if=US280D.sys ibs=1 skip=35200 count=3850 of=dvb-usb-lme2510c-lg.fw
55
56---------------------------------------------------------------------
57
58Copy the firmware file(s) to /lib/firmware
diff --git a/Documentation/fb/viafb.txt b/Documentation/fb/viafb.txt
index f3e046a6a987..1a2e8aa3fbb1 100644
--- a/Documentation/fb/viafb.txt
+++ b/Documentation/fb/viafb.txt
@@ -197,6 +197,54 @@ Notes:
197 example, 197 example,
198 # fbset -depth 16 198 # fbset -depth 16
199 199
200
201[Configure viafb via /proc]
202---------------------------
203 The following files exist in /proc/viafb
204
205 supported_output_devices
206
207 This read-only file contains a full ',' seperated list containing all
208 output devices that could be available on your platform. It is likely
209 that not all of those have a connector on your hardware but it should
210 provide a good starting point to figure out which of those names match
211 a real connector.
212 Example:
213 # cat /proc/viafb/supported_output_devices
214
215 iga1/output_devices
216 iga2/output_devices
217
218 These two files are readable and writable. iga1 and iga2 are the two
219 independent units that produce the screen image. Those images can be
220 forwarded to one or more output devices. Reading those files is a way
221 to query which output devices are currently used by an iga.
222 Example:
223 # cat /proc/viafb/iga1/output_devices
224 If there are no output devices printed the output of this iga is lost.
225 This can happen for example if only one (the other) iga is used.
226 Writing to these files allows adjusting the output devices during
227 runtime. One can add new devices, remove existing ones or switch
228 between igas. Essentially you can write a ',' seperated list of device
229 names (or a single one) in the same format as the output to those
230 files. You can add a '+' or '-' as a prefix allowing simple addition
231 and removal of devices. So a prefix '+' adds the devices from your list
232 to the already existing ones, '-' removes the listed devices from the
233 existing ones and if no prefix is given it replaces all existing ones
234 with the listed ones. If you remove devices they are expected to turn
235 off. If you add devices that are already part of the other iga they are
236 removed there and added to the new one.
237 Examples:
238 Add CRT as output device to iga1
239 # echo +CRT > /proc/viafb/iga1/output_devices
240
241 Remove (turn off) DVP1 and LVDS1 as output devices of iga2
242 # echo -DVP1,LVDS1 > /proc/viafb/iga2/output_devices
243
244 Replace all iga1 output devices by CRT
245 # echo CRT > /proc/viafb/iga1/output_devices
246
247
200[Bootup with viafb]: 248[Bootup with viafb]:
201-------------------- 249--------------------
202 Add the following line to your grub.conf: 250 Add the following line to your grub.conf:
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index d2af87ba96e1..d8f36f984faa 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -98,7 +98,7 @@ Who: Pavel Machek <pavel@ucw.cz>
98--------------------------- 98---------------------------
99 99
100What: Video4Linux API 1 ioctls and from Video devices. 100What: Video4Linux API 1 ioctls and from Video devices.
101When: July 2009 101When: kernel 2.6.38
102Files: include/linux/videodev.h 102Files: include/linux/videodev.h
103Check: include/linux/videodev.h 103Check: include/linux/videodev.h
104Why: V4L1 AP1 was replaced by V4L2 API during migration from 2.4 to 2.6 104Why: V4L1 AP1 was replaced by V4L2 API during migration from 2.4 to 2.6
@@ -116,6 +116,21 @@ Who: Mauro Carvalho Chehab <mchehab@infradead.org>
116 116
117--------------------------- 117---------------------------
118 118
119What: Video4Linux obsolete drivers using V4L1 API
120When: kernel 2.6.38
121Files: drivers/staging/cpia/* drivers/staging/stradis/*
122Check: drivers/staging/cpia/cpia.c drivers/staging/stradis/stradis.c
123Why: There are some drivers still using V4L1 API, despite all efforts we've done
124 to migrate. Those drivers are for obsolete hardware that the old maintainer
125 didn't care (or not have the hardware anymore), and that no other developer
126 could find any hardware to buy. They probably have no practical usage today,
127 and people with such old hardware could probably keep using an older version
128 of the kernel. Those drivers will be moved to staging on 2.6.37 and, if nobody
129 care enough to port and test them with V4L2 API, they'll be removed on 2.6.38.
130Who: Mauro Carvalho Chehab <mchehab@infradead.org>
131
132---------------------------
133
119What: sys_sysctl 134What: sys_sysctl
120When: September 2010 135When: September 2010
121Option: CONFIG_SYSCTL_SYSCALL 136Option: CONFIG_SYSCTL_SYSCALL
@@ -470,29 +485,6 @@ When: April 2011
470Why: Superseded by xt_CT 485Why: Superseded by xt_CT
471Who: Netfilter developer team <netfilter-devel@vger.kernel.org> 486Who: Netfilter developer team <netfilter-devel@vger.kernel.org>
472 487
473---------------------------
474
475What: video4linux /dev/vtx teletext API support
476When: 2.6.35
477Files: drivers/media/video/saa5246a.c drivers/media/video/saa5249.c
478 include/linux/videotext.h
479Why: The vtx device nodes have been superseded by vbi device nodes
480 for many years. No applications exist that use the vtx support.
481 Of the two i2c drivers that actually support this API the saa5249
482 has been impossible to use for a year now and no known hardware
483 that supports this device exists. The saa5246a is theoretically
484 supported by the old mxb boards, but it never actually worked.
485
486 In summary: there is no hardware that can use this API and there
487 are no applications actually implementing this API.
488
489 The vtx support still reserves minors 192-223 and we would really
490 like to reuse those for upcoming new functionality. In the unlikely
491 event that new hardware appears that wants to use the functionality
492 provided by the vtx API, then that functionality should be build
493 around the sliced VBI API instead.
494Who: Hans Verkuil <hverkuil@xs4all.nl>
495
496---------------------------- 488----------------------------
497 489
498What: IRQF_DISABLED 490What: IRQF_DISABLED
@@ -526,6 +518,23 @@ Who: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
526 518
527---------------------------- 519----------------------------
528 520
521What: namespace cgroup (ns_cgroup)
522When: 2.6.38
523Why: The ns_cgroup leads to some problems:
524 * cgroup creation is out-of-control
525 * cgroup name can conflict when pids are looping
526 * it is not possible to have a single process handling
527 a lot of namespaces without falling in a exponential creation time
528 * we may want to create a namespace without creating a cgroup
529
530 The ns_cgroup is replaced by a compatibility flag 'clone_children',
531 where a newly created cgroup will copy the parent cgroup values.
532 The userspace has to manually create a cgroup and add a task to
533 the 'tasks' file.
534Who: Daniel Lezcano <daniel.lezcano@free.fr>
535
536----------------------------
537
529What: iwlwifi disable_hw_scan module parameters 538What: iwlwifi disable_hw_scan module parameters
530When: 2.6.40 539When: 2.6.40
531Why: Hareware scan is the prefer method for iwlwifi devices for 540Why: Hareware scan is the prefer method for iwlwifi devices for
diff --git a/Documentation/filesystems/00-INDEX b/Documentation/filesystems/00-INDEX
index 4303614b5add..8c624a18f67d 100644
--- a/Documentation/filesystems/00-INDEX
+++ b/Documentation/filesystems/00-INDEX
@@ -96,8 +96,6 @@ seq_file.txt
96 - how to use the seq_file API 96 - how to use the seq_file API
97sharedsubtree.txt 97sharedsubtree.txt
98 - a description of shared subtrees for namespaces. 98 - a description of shared subtrees for namespaces.
99smbfs.txt
100 - info on using filesystems with the SMB protocol (Win 3.11 and NT).
101spufs.txt 99spufs.txt
102 - info and mount options for the SPU filesystem used on Cell. 100 - info and mount options for the SPU filesystem used on Cell.
103sysfs-pci.txt 101sysfs-pci.txt
diff --git a/Documentation/filesystems/9p.txt b/Documentation/filesystems/9p.txt
index f9765e8cf086..b22abba78fed 100644
--- a/Documentation/filesystems/9p.txt
+++ b/Documentation/filesystems/9p.txt
@@ -111,7 +111,7 @@ OPTIONS
111 This can be used to share devices/named pipes/sockets between 111 This can be used to share devices/named pipes/sockets between
112 hosts. This functionality will be expanded in later versions. 112 hosts. This functionality will be expanded in later versions.
113 113
114 access there are three access modes. 114 access there are four access modes.
115 user = if a user tries to access a file on v9fs 115 user = if a user tries to access a file on v9fs
116 filesystem for the first time, v9fs sends an 116 filesystem for the first time, v9fs sends an
117 attach command (Tattach) for that user. 117 attach command (Tattach) for that user.
@@ -120,6 +120,8 @@ OPTIONS
120 the files on the mounted filesystem 120 the files on the mounted filesystem
121 any = v9fs does single attach and performs all 121 any = v9fs does single attach and performs all
122 operations as one user 122 operations as one user
123 client = ACL based access check on the 9p client
124 side for access validation
123 125
124 cachetag cache tag to use the specified persistent cache. 126 cachetag cache tag to use the specified persistent cache.
125 cache tags for existing cache sessions can be listed at 127 cache tags for existing cache sessions can be listed at
diff --git a/Documentation/filesystems/ext4.txt b/Documentation/filesystems/ext4.txt
index e1def1786e50..6ab9442d7eeb 100644
--- a/Documentation/filesystems/ext4.txt
+++ b/Documentation/filesystems/ext4.txt
@@ -353,6 +353,20 @@ noauto_da_alloc replacing existing files via patterns such as
353 system crashes before the delayed allocation 353 system crashes before the delayed allocation
354 blocks are forced to disk. 354 blocks are forced to disk.
355 355
356noinit_itable Do not initialize any uninitialized inode table
357 blocks in the background. This feature may be
358 used by installation CD's so that the install
359 process can complete as quickly as possible; the
360 inode table initialization process would then be
361 deferred until the next time the file system
362 is unmounted.
363
364init_itable=n The lazy itable init code will wait n times the
365 number of milliseconds it took to zero out the
366 previous block group's inode table. This
367 minimizes the impact on the systme performance
368 while file system's inode table is being initialized.
369
356discard Controls whether ext4 should issue discard/TRIM 370discard Controls whether ext4 should issue discard/TRIM
357nodiscard(*) commands to the underlying block device when 371nodiscard(*) commands to the underlying block device when
358 blocks are freed. This is useful for SSD devices 372 blocks are freed. This is useful for SSD devices
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
index a563b74c7aef..e73df2722ff3 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -136,6 +136,7 @@ Table 1-1: Process specific entries in /proc
136 statm Process memory status information 136 statm Process memory status information
137 status Process status in human readable form 137 status Process status in human readable form
138 wchan If CONFIG_KALLSYMS is set, a pre-decoded wchan 138 wchan If CONFIG_KALLSYMS is set, a pre-decoded wchan
139 pagemap Page table
139 stack Report full stack trace, enable via CONFIG_STACKTRACE 140 stack Report full stack trace, enable via CONFIG_STACKTRACE
140 smaps a extension based on maps, showing the memory consumption of 141 smaps a extension based on maps, showing the memory consumption of
141 each mapping 142 each mapping
@@ -370,6 +371,7 @@ Shared_Dirty: 0 kB
370Private_Clean: 0 kB 371Private_Clean: 0 kB
371Private_Dirty: 0 kB 372Private_Dirty: 0 kB
372Referenced: 892 kB 373Referenced: 892 kB
374Anonymous: 0 kB
373Swap: 0 kB 375Swap: 0 kB
374KernelPageSize: 4 kB 376KernelPageSize: 4 kB
375MMUPageSize: 4 kB 377MMUPageSize: 4 kB
@@ -378,9 +380,15 @@ The first of these lines shows the same information as is displayed for the
378mapping in /proc/PID/maps. The remaining lines show the size of the mapping 380mapping in /proc/PID/maps. The remaining lines show the size of the mapping
379(size), the amount of the mapping that is currently resident in RAM (RSS), the 381(size), the amount of the mapping that is currently resident in RAM (RSS), the
380process' proportional share of this mapping (PSS), the number of clean and 382process' proportional share of this mapping (PSS), the number of clean and
381dirty shared pages in the mapping, and the number of clean and dirty private 383dirty private pages in the mapping. Note that even a page which is part of a
382pages in the mapping. The "Referenced" indicates the amount of memory 384MAP_SHARED mapping, but has only a single pte mapped, i.e. is currently used
383currently marked as referenced or accessed. 385by only one process, is accounted as private and not as shared. "Referenced"
386indicates the amount of memory currently marked as referenced or accessed.
387"Anonymous" shows the amount of memory that does not belong to any file. Even
388a mapping associated with a file may contain anonymous pages: when MAP_PRIVATE
389and a page is modified, the file page is replaced by a private anonymous copy.
390"Swap" shows how much would-be-anonymous memory is also used, but out on
391swap.
384 392
385This file is only present if the CONFIG_MMU kernel configuration option is 393This file is only present if the CONFIG_MMU kernel configuration option is
386enabled. 394enabled.
@@ -397,6 +405,9 @@ To clear the bits for the file mapped pages associated with the process
397 > echo 3 > /proc/PID/clear_refs 405 > echo 3 > /proc/PID/clear_refs
398Any other value written to /proc/PID/clear_refs will have no effect. 406Any other value written to /proc/PID/clear_refs will have no effect.
399 407
408The /proc/pid/pagemap gives the PFN, which can be used to find the pageflags
409using /proc/kpageflags and number of times a page is mapped using
410/proc/kpagecount. For detailed explanation, see Documentation/vm/pagemap.txt.
400 411
4011.2 Kernel data 4121.2 Kernel data
402--------------- 413---------------
diff --git a/Documentation/filesystems/smbfs.txt b/Documentation/filesystems/smbfs.txt
deleted file mode 100644
index 194fb0decd2c..000000000000
--- a/Documentation/filesystems/smbfs.txt
+++ /dev/null
@@ -1,8 +0,0 @@
1Smbfs is a filesystem that implements the SMB protocol, which is the
2protocol used by Windows for Workgroups, Windows 95 and Windows NT.
3Smbfs was inspired by Samba, the program written by Andrew Tridgell
4that turns any Unix host into a file server for DOS or Windows clients.
5
6Smbfs is a SMB client, but uses parts of samba for its operation. For
7more info on samba, including documentation, please go to
8http://www.samba.org/ and then on to your nearest mirror.
diff --git a/Documentation/hwmon/it87 b/Documentation/hwmon/it87
index 8d08bf0d38ed..38425f0f2645 100644
--- a/Documentation/hwmon/it87
+++ b/Documentation/hwmon/it87
@@ -22,6 +22,10 @@ Supported chips:
22 Prefix: 'it8720' 22 Prefix: 'it8720'
23 Addresses scanned: from Super I/O config space (8 I/O ports) 23 Addresses scanned: from Super I/O config space (8 I/O ports)
24 Datasheet: Not publicly available 24 Datasheet: Not publicly available
25 * IT8721F/IT8758E
26 Prefix: 'it8721'
27 Addresses scanned: from Super I/O config space (8 I/O ports)
28 Datasheet: Not publicly available
25 * SiS950 [clone of IT8705F] 29 * SiS950 [clone of IT8705F]
26 Prefix: 'it87' 30 Prefix: 'it87'
27 Addresses scanned: from Super I/O config space (8 I/O ports) 31 Addresses scanned: from Super I/O config space (8 I/O ports)
@@ -67,7 +71,7 @@ Description
67----------- 71-----------
68 72
69This driver implements support for the IT8705F, IT8712F, IT8716F, 73This driver implements support for the IT8705F, IT8712F, IT8716F,
70IT8718F, IT8720F, IT8726F and SiS950 chips. 74IT8718F, IT8720F, IT8721F, IT8726F, IT8758E and SiS950 chips.
71 75
72These chips are 'Super I/O chips', supporting floppy disks, infrared ports, 76These chips are 'Super I/O chips', supporting floppy disks, infrared ports,
73joysticks and other miscellaneous stuff. For hardware monitoring, they 77joysticks and other miscellaneous stuff. For hardware monitoring, they
@@ -86,14 +90,15 @@ the driver won't notice and report changes in the VID value. The two
86upper VID bits share their pins with voltage inputs (in5 and in6) so you 90upper VID bits share their pins with voltage inputs (in5 and in6) so you
87can't have both on a given board. 91can't have both on a given board.
88 92
89The IT8716F, IT8718F, IT8720F and later IT8712F revisions have support for 93The IT8716F, IT8718F, IT8720F, IT8721F/IT8758E and later IT8712F revisions
902 additional fans. The additional fans are supported by the driver. 94have support for 2 additional fans. The additional fans are supported by the
95driver.
91 96
92The IT8716F, IT8718F and IT8720F, and late IT8712F and IT8705F also have 97The IT8716F, IT8718F, IT8720F and IT8721F/IT8758E, and late IT8712F and
93optional 16-bit tachometer counters for fans 1 to 3. This is better (no more 98IT8705F also have optional 16-bit tachometer counters for fans 1 to 3. This
94fan clock divider mess) but not compatible with the older chips and 99is better (no more fan clock divider mess) but not compatible with the older
95revisions. The 16-bit tachometer mode is enabled by the driver when one 100chips and revisions. The 16-bit tachometer mode is enabled by the driver when
96of the above chips is detected. 101one of the above chips is detected.
97 102
98The IT8726F is just bit enhanced IT8716F with additional hardware 103The IT8726F is just bit enhanced IT8716F with additional hardware
99for AMD power sequencing. Therefore the chip will appear as IT8716F 104for AMD power sequencing. Therefore the chip will appear as IT8716F
@@ -115,7 +120,12 @@ alarm is triggered if the voltage has crossed a programmable minimum or
115maximum limit. Note that minimum in this case always means 'closest to 120maximum limit. Note that minimum in this case always means 'closest to
116zero'; this is important for negative voltage measurements. All voltage 121zero'; this is important for negative voltage measurements. All voltage
117inputs can measure voltages between 0 and 4.08 volts, with a resolution of 122inputs can measure voltages between 0 and 4.08 volts, with a resolution of
1180.016 volt. The battery voltage in8 does not have limit registers. 1230.016 volt (except IT8721F/IT8758E: 0.012 volt.) The battery voltage in8 does
124not have limit registers.
125
126On the IT8721F/IT8758E, some voltage inputs are internal and scaled inside
127the chip (in7, in8 and optionally in3). The driver handles this transparently
128so user-space doesn't have to care.
119 129
120The VID lines (IT8712F/IT8716F/IT8718F/IT8720F) encode the core voltage value: 130The VID lines (IT8712F/IT8716F/IT8718F/IT8720F) encode the core voltage value:
121the voltage level your processor should work with. This is hardcoded by 131the voltage level your processor should work with. This is hardcoded by
diff --git a/Documentation/hwmon/lm85 b/Documentation/hwmon/lm85
index b98e0e0d1910..239258a63c81 100644
--- a/Documentation/hwmon/lm85
+++ b/Documentation/hwmon/lm85
@@ -14,6 +14,10 @@ Supported chips:
14 Prefix: 'adt7463' 14 Prefix: 'adt7463'
15 Addresses scanned: I2C 0x2c, 0x2d, 0x2e 15 Addresses scanned: I2C 0x2c, 0x2d, 0x2e
16 Datasheet: http://www.onsemi.com/PowerSolutions/product.do?id=ADT7463 16 Datasheet: http://www.onsemi.com/PowerSolutions/product.do?id=ADT7463
17 * Analog Devices ADT7468
18 Prefix: 'adt7468'
19 Addresses scanned: I2C 0x2c, 0x2d, 0x2e
20 Datasheet: http://www.onsemi.com/PowerSolutions/product.do?id=ADT7468
17 * SMSC EMC6D100, SMSC EMC6D101 21 * SMSC EMC6D100, SMSC EMC6D101
18 Prefix: 'emc6d100' 22 Prefix: 'emc6d100'
19 Addresses scanned: I2C 0x2c, 0x2d, 0x2e 23 Addresses scanned: I2C 0x2c, 0x2d, 0x2e
@@ -34,7 +38,7 @@ Description
34----------- 38-----------
35 39
36This driver implements support for the National Semiconductor LM85 and 40This driver implements support for the National Semiconductor LM85 and
37compatible chips including the Analog Devices ADM1027, ADT7463 and 41compatible chips including the Analog Devices ADM1027, ADT7463, ADT7468 and
38SMSC EMC6D10x chips family. 42SMSC EMC6D10x chips family.
39 43
40The LM85 uses the 2-wire interface compatible with the SMBUS 2.0 44The LM85 uses the 2-wire interface compatible with the SMBUS 2.0
@@ -87,14 +91,22 @@ To smooth the response of fans to changes in temperature, the LM85 has an
87optional filter for smoothing temperatures. The ADM1027 has the same 91optional filter for smoothing temperatures. The ADM1027 has the same
88config option but uses it to rate limit the changes to fan speed instead. 92config option but uses it to rate limit the changes to fan speed instead.
89 93
90The ADM1027 and ADT7463 have a 10-bit ADC and can therefore measure 94The ADM1027, ADT7463 and ADT7468 have a 10-bit ADC and can therefore
91temperatures with 0.25 degC resolution. They also provide an offset to the 95measure temperatures with 0.25 degC resolution. They also provide an offset
92temperature readings that is automatically applied during measurement. 96to the temperature readings that is automatically applied during
93This offset can be used to zero out any errors due to traces and placement. 97measurement. This offset can be used to zero out any errors due to traces
94The documentation says that the offset is in 0.25 degC steps, but in 98and placement. The documentation says that the offset is in 0.25 degC
95initial testing of the ADM1027 it was 1.00 degC steps. Analog Devices has 99steps, but in initial testing of the ADM1027 it was 1.00 degC steps. Analog
96confirmed this "bug". The ADT7463 is reported to work as described in the 100Devices has confirmed this "bug". The ADT7463 is reported to work as
97documentation. The current lm85 driver does not show the offset register. 101described in the documentation. The current lm85 driver does not show the
102offset register.
103
104The ADT7468 has a high-frequency PWM mode, where all PWM outputs are
105driven by a 22.5 kHz clock. This is a global mode, not per-PWM output,
106which means that setting any PWM frequency above 11.3 kHz will switch
107all 3 PWM outputs to a 22.5 kHz frequency. Conversely, setting any PWM
108frequency below 11.3 kHz will switch all 3 PWM outputs to a frequency
109between 10 and 100 Hz, which can then be tuned separately.
98 110
99See the vendor datasheets for more information. There is application note 111See the vendor datasheets for more information. There is application note
100from National (AN-1260) with some additional information about the LM85. 112from National (AN-1260) with some additional information about the LM85.
@@ -125,17 +137,17 @@ datasheet for a complete description of the differences. Other than
125identifying the chip, the driver behaves no differently with regard to 137identifying the chip, the driver behaves no differently with regard to
126these two chips. The LM85B is recommended for new designs. 138these two chips. The LM85B is recommended for new designs.
127 139
128The ADM1027 and ADT7463 chips have an optional SMBALERT output that can be 140The ADM1027, ADT7463 and ADT7468 chips have an optional SMBALERT output
129used to signal the chipset in case a limit is exceeded or the temperature 141that can be used to signal the chipset in case a limit is exceeded or the
130sensors fail. Individual sensor interrupts can be masked so they won't 142temperature sensors fail. Individual sensor interrupts can be masked so
131trigger SMBALERT. The SMBALERT output if configured replaces one of the other 143they won't trigger SMBALERT. The SMBALERT output if configured replaces one
132functions (PWM2 or IN0). This functionality is not implemented in current 144of the other functions (PWM2 or IN0). This functionality is not implemented
133driver. 145in current driver.
134 146
135The ADT7463 also has an optional THERM output/input which can be connected 147The ADT7463 and ADT7468 also have an optional THERM output/input which can
136to the processor PROC_HOT output. If available, the autofan control 148be connected to the processor PROC_HOT output. If available, the autofan
137dynamic Tmin feature can be enabled to keep the system temperature within 149control dynamic Tmin feature can be enabled to keep the system temperature
138spec (just?!) with the least possible fan noise. 150within spec (just?!) with the least possible fan noise.
139 151
140Configuration Notes 152Configuration Notes
141------------------- 153-------------------
@@ -201,8 +213,8 @@ the temperatures to compensate for systemic errors in the
201measurements. These features are not currently supported by the lm85 213measurements. These features are not currently supported by the lm85
202driver. 214driver.
203 215
204In addition to the ADM1027 features, the ADT7463 also has Tmin control 216In addition to the ADM1027 features, the ADT7463 and ADT7468 also have
205and THERM asserted counts. Automatic Tmin control acts to adjust the 217Tmin control and THERM asserted counts. Automatic Tmin control acts to
206Tmin value to maintain the measured temperature sensor at a specified 218adjust the Tmin value to maintain the measured temperature sensor at a
207temperature. There isn't much documentation on this feature in the 219specified temperature. There isn't much documentation on this feature in
208ADT7463 data sheet. This is not supported by current driver. 220the ADT7463 data sheet. This is not supported by current driver.
diff --git a/Documentation/hwmon/lm90 b/Documentation/hwmon/lm90
index 6a03dd4bcc94..fa475c0a48a3 100644
--- a/Documentation/hwmon/lm90
+++ b/Documentation/hwmon/lm90
@@ -63,8 +63,8 @@ Supported chips:
63 Datasheet: Publicly available at the Maxim website 63 Datasheet: Publicly available at the Maxim website
64 http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2578 64 http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2578
65 * Maxim MAX6659 65 * Maxim MAX6659
66 Prefix: 'max6657' 66 Prefix: 'max6659'
67 Addresses scanned: I2C 0x4c, 0x4d (unsupported 0x4e) 67 Addresses scanned: I2C 0x4c, 0x4d, 0x4e
68 Datasheet: Publicly available at the Maxim website 68 Datasheet: Publicly available at the Maxim website
69 http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2578 69 http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2578
70 * Maxim MAX6680 70 * Maxim MAX6680
@@ -84,6 +84,21 @@ Supported chips:
84 Addresses scanned: I2C 0x4c 84 Addresses scanned: I2C 0x4c
85 Datasheet: Publicly available at the Maxim website 85 Datasheet: Publicly available at the Maxim website
86 http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3500 86 http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3500
87 * Maxim MAX6695
88 Prefix: 'max6695'
89 Addresses scanned: I2C 0x18
90 Datasheet: Publicly available at the Maxim website
91 http://www.maxim-ic.com/datasheet/index.mvp/id/4199
92 * Maxim MAX6696
93 Prefix: 'max6695'
94 Addresses scanned: I2C 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b,
95 0x4c, 0x4d and 0x4e
96 Datasheet: Publicly available at the Maxim website
97 http://www.maxim-ic.com/datasheet/index.mvp/id/4199
98 * Winbond/Nuvoton W83L771W/G
99 Prefix: 'w83l771'
100 Addresses scanned: I2C 0x4c
101 Datasheet: No longer available
87 * Winbond/Nuvoton W83L771AWG/ASG 102 * Winbond/Nuvoton W83L771AWG/ASG
88 Prefix: 'w83l771' 103 Prefix: 'w83l771'
89 Addresses scanned: I2C 0x4c 104 Addresses scanned: I2C 0x4c
@@ -101,10 +116,11 @@ well as the temperature of up to one external diode. It is compatible
101with many other devices, many of which are supported by this driver. 116with many other devices, many of which are supported by this driver.
102 117
103Note that there is no easy way to differentiate between the MAX6657, 118Note that there is no easy way to differentiate between the MAX6657,
104MAX6658 and MAX6659 variants. The extra address and features of the 119MAX6658 and MAX6659 variants. The extra features of the MAX6659 are only
105MAX6659 are not supported by this driver. The MAX6680 and MAX6681 only 120supported by this driver if the chip is located at address 0x4d or 0x4e,
106differ in their pinout, therefore they obviously can't (and don't need to) 121or if the chip type is explicitly selected as max6659.
107be distinguished. 122The MAX6680 and MAX6681 only differ in their pinout, therefore they obviously
123can't (and don't need to) be distinguished.
108 124
109The specificity of this family of chipsets over the ADM1021/LM84 125The specificity of this family of chipsets over the ADM1021/LM84
110family is that it features critical limits with hysteresis, and an 126family is that it features critical limits with hysteresis, and an
@@ -151,11 +167,21 @@ MAX6680 and MAX6681:
151 * Selectable address 167 * Selectable address
152 * Remote sensor type selection 168 * Remote sensor type selection
153 169
170MAX6695 and MAX6696:
171 * Better local resolution
172 * Selectable address (max6696)
173 * Second critical temperature limit
174 * Two remote sensors
175
176W83L771W/G
177 * The G variant is lead-free, otherwise similar to the W.
178 * Filter and alert configuration register at 0xBF
179 * Moving average (depending on conversion rate)
180
154W83L771AWG/ASG 181W83L771AWG/ASG
182 * Successor of the W83L771W/G, same features.
155 * The AWG and ASG variants only differ in package format. 183 * The AWG and ASG variants only differ in package format.
156 * Filter and alert configuration register at 0xBF
157 * Diode ideality factor configuration (remote sensor) at 0xE3 184 * Diode ideality factor configuration (remote sensor) at 0xE3
158 * Moving average (depending on conversion rate)
159 185
160All temperature values are given in degrees Celsius. Resolution 186All temperature values are given in degrees Celsius. Resolution
161is 1.0 degree for the local temperature, 0.125 degree for the remote 187is 1.0 degree for the local temperature, 0.125 degree for the remote
diff --git a/Documentation/hwmon/pcf8591 b/Documentation/hwmon/pcf8591
index e76a7892f68e..ac020b3bb7b3 100644
--- a/Documentation/hwmon/pcf8591
+++ b/Documentation/hwmon/pcf8591
@@ -4,7 +4,7 @@ Kernel driver pcf8591
4Supported chips: 4Supported chips:
5 * Philips/NXP PCF8591 5 * Philips/NXP PCF8591
6 Prefix: 'pcf8591' 6 Prefix: 'pcf8591'
7 Addresses scanned: I2C 0x48 - 0x4f 7 Addresses scanned: none
8 Datasheet: Publicly available at the NXP website 8 Datasheet: Publicly available at the NXP website
9 http://www.nxp.com/pip/PCF8591_6.html 9 http://www.nxp.com/pip/PCF8591_6.html
10 10
@@ -58,18 +58,16 @@ Module parameters
58Accessing PCF8591 via /sys interface 58Accessing PCF8591 via /sys interface
59------------------------------------- 59-------------------------------------
60 60
61! Be careful ! 61The PCF8591 is plainly impossible to detect! Thus the driver won't even
62The PCF8591 is plainly impossible to detect! Stupid chip. 62try. You have to explicitly instantiate the device at the relevant
63So every chip with address in the interval [0x48..0x4f] is 63address (in the interval [0x48..0x4f]) either through platform data, or
64detected as PCF8591. If you have other chips in this address 64using the sysfs interface. See Documentation/i2c/instantiating-devices
65range, the workaround is to load this module after the one 65for details.
66for your others chips.
67 66
68On detection (i.e. insmod, modprobe et al.), directories are being 67Directories are being created for each instantiated PCF8591:
69created for each detected PCF8591:
70 68
71/sys/bus/i2c/devices/<0>-<1>/ 69/sys/bus/i2c/devices/<0>-<1>/
72where <0> is the bus the chip was detected on (e. g. i2c-0) 70where <0> is the bus the chip is connected to (e. g. i2c-0)
73and <1> the chip address ([48..4f]) 71and <1> the chip address ([48..4f])
74 72
75Inside these directories, there are such files: 73Inside these directories, there are such files:
diff --git a/Documentation/hwmon/sysfs-interface b/Documentation/hwmon/sysfs-interface
index 48ceabedf55d..645699010551 100644
--- a/Documentation/hwmon/sysfs-interface
+++ b/Documentation/hwmon/sysfs-interface
@@ -309,6 +309,20 @@ temp[1-*]_crit_hyst
309 from the critical value. 309 from the critical value.
310 RW 310 RW
311 311
312temp[1-*]_emergency
313 Temperature emergency max value, for chips supporting more than
314 two upper temperature limits. Must be equal or greater than
315 corresponding temp_crit values.
316 Unit: millidegree Celsius
317 RW
318
319temp[1-*]_emergency_hyst
320 Temperature hysteresis value for emergency limit.
321 Unit: millidegree Celsius
322 Must be reported as an absolute temperature, NOT a delta
323 from the emergency value.
324 RW
325
312temp[1-*]_lcrit Temperature critical min value, typically lower than 326temp[1-*]_lcrit Temperature critical min value, typically lower than
313 corresponding temp_min values. 327 corresponding temp_min values.
314 Unit: millidegree Celsius 328 Unit: millidegree Celsius
@@ -505,6 +519,7 @@ fan[1-*]_max_alarm
505temp[1-*]_min_alarm 519temp[1-*]_min_alarm
506temp[1-*]_max_alarm 520temp[1-*]_max_alarm
507temp[1-*]_crit_alarm 521temp[1-*]_crit_alarm
522temp[1-*]_emergency_alarm
508 Limit alarm 523 Limit alarm
509 0: no alarm 524 0: no alarm
510 1: alarm 525 1: alarm
diff --git a/Documentation/ioctl/ioctl-number.txt b/Documentation/ioctl/ioctl-number.txt
index 33223ff121d8..63ffd78824d8 100644
--- a/Documentation/ioctl/ioctl-number.txt
+++ b/Documentation/ioctl/ioctl-number.txt
@@ -259,7 +259,7 @@ Code Seq#(hex) Include File Comments
259't' 00-7F linux/if_ppp.h 259't' 00-7F linux/if_ppp.h
260't' 80-8F linux/isdn_ppp.h 260't' 80-8F linux/isdn_ppp.h
261't' 90 linux/toshiba.h 261't' 90 linux/toshiba.h
262'u' 00-1F linux/smb_fs.h 262'u' 00-1F linux/smb_fs.h gone
263'v' all linux/videodev.h conflict! 263'v' all linux/videodev.h conflict!
264'v' 00-1F linux/ext2_fs.h conflict! 264'v' 00-1F linux/ext2_fs.h conflict!
265'v' 00-1F linux/fs.h conflict! 265'v' 00-1F linux/fs.h conflict!
@@ -278,7 +278,6 @@ Code Seq#(hex) Include File Comments
278 <mailto:oe@port.de> 278 <mailto:oe@port.de>
279'z' 10-4F drivers/s390/crypto/zcrypt_api.h conflict! 279'z' 10-4F drivers/s390/crypto/zcrypt_api.h conflict!
2800x80 00-1F linux/fb.h 2800x80 00-1F linux/fb.h
2810x81 00-1F linux/videotext.h
2820x88 00-3F media/ovcamchip.h 2810x88 00-3F media/ovcamchip.h
2830x89 00-06 arch/x86/include/asm/sockios.h 2820x89 00-06 arch/x86/include/asm/sockios.h
2840x89 0B-DF linux/sockios.h 2830x89 0B-DF linux/sockios.h
diff --git a/Documentation/kbuild/kconfig-language.txt b/Documentation/kbuild/kconfig-language.txt
index b472e4e0ba67..2fe93ca7c77c 100644
--- a/Documentation/kbuild/kconfig-language.txt
+++ b/Documentation/kbuild/kconfig-language.txt
@@ -322,7 +322,8 @@ mainmenu:
322 "mainmenu" <prompt> 322 "mainmenu" <prompt>
323 323
324This sets the config program's title bar if the config program chooses 324This sets the config program's title bar if the config program chooses
325to use it. 325to use it. It should be placed at the top of the configuration, before any
326other statement.
326 327
327 328
328Kconfig hints 329Kconfig hints
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
index c787ae512120..0ef00bd6e54d 100644
--- a/Documentation/kbuild/makefiles.txt
+++ b/Documentation/kbuild/makefiles.txt
@@ -776,6 +776,13 @@ This will delete the directory debian, including all subdirectories.
776Kbuild will assume the directories to be in the same relative path as the 776Kbuild will assume the directories to be in the same relative path as the
777Makefile if no absolute path is specified (path does not start with '/'). 777Makefile if no absolute path is specified (path does not start with '/').
778 778
779To exclude certain files from make clean, use the $(no-clean-files) variable.
780This is only a special case used in the top level Kbuild file:
781
782 Example:
783 #Kbuild
784 no-clean-files := $(bounds-file) $(offsets-file)
785
779Usually kbuild descends down in subdirectories due to "obj-* := dir/", 786Usually kbuild descends down in subdirectories due to "obj-* := dir/",
780but in the architecture makefiles where the kbuild infrastructure 787but in the architecture makefiles where the kbuild infrastructure
781is not sufficient this sometimes needs to be explicit. 788is not sufficient this sometimes needs to be explicit.
diff --git a/Documentation/kbuild/modules.txt b/Documentation/kbuild/modules.txt
index 0767cf69c69e..3fb39e0116b4 100644
--- a/Documentation/kbuild/modules.txt
+++ b/Documentation/kbuild/modules.txt
@@ -1,215 +1,185 @@
1Building External Modules
1 2
2In this document you will find information about: 3This document describes how to build an out-of-tree kernel module.
3- how to build external modules
4- how to make your module use the kbuild infrastructure
5- how kbuild will install a kernel
6- how to install modules in a non-standard location
7 4
8=== Table of Contents 5=== Table of Contents
9 6
10 === 1 Introduction 7 === 1 Introduction
11 === 2 How to build external modules 8 === 2 How to Build External Modules
12 --- 2.1 Building external modules 9 --- 2.1 Command Syntax
13 --- 2.2 Available targets 10 --- 2.2 Options
14 --- 2.3 Available options 11 --- 2.3 Targets
15 --- 2.4 Preparing the kernel tree for module build 12 --- 2.4 Building Separate Files
16 --- 2.5 Building separate files for a module 13 === 3. Creating a Kbuild File for an External Module
17 === 3. Example commands 14 --- 3.1 Shared Makefile
18 === 4. Creating a kbuild file for an external module 15 --- 3.2 Separate Kbuild file and Makefile
19 === 5. Include files 16 --- 3.3 Binary Blobs
20 --- 5.1 How to include files from the kernel include dir 17 --- 3.4 Building Multiple Modules
21 --- 5.2 External modules using an include/ dir 18 === 4. Include Files
22 --- 5.3 External modules using several directories 19 --- 4.1 Kernel Includes
23 === 6. Module installation 20 --- 4.2 Single Subdirectory
24 --- 6.1 INSTALL_MOD_PATH 21 --- 4.3 Several Subdirectories
25 --- 6.2 INSTALL_MOD_DIR 22 === 5. Module Installation
26 === 7. Module versioning & Module.symvers 23 --- 5.1 INSTALL_MOD_PATH
27 --- 7.1 Symbols from the kernel (vmlinux + modules) 24 --- 5.2 INSTALL_MOD_DIR
28 --- 7.2 Symbols and external modules 25 === 6. Module Versioning
29 --- 7.3 Symbols from another external module 26 --- 6.1 Symbols From the Kernel (vmlinux + modules)
30 === 8. Tips & Tricks 27 --- 6.2 Symbols and External Modules
31 --- 8.1 Testing for CONFIG_FOO_BAR 28 --- 6.3 Symbols From Another External Module
29 === 7. Tips & Tricks
30 --- 7.1 Testing for CONFIG_FOO_BAR
32 31
33 32
34 33
35=== 1. Introduction 34=== 1. Introduction
36 35
37kbuild includes functionality for building modules both 36"kbuild" is the build system used by the Linux kernel. Modules must use
38within the kernel source tree and outside the kernel source tree. 37kbuild to stay compatible with changes in the build infrastructure and
39The latter is usually referred to as external or "out-of-tree" 38to pick up the right flags to "gcc." Functionality for building modules
40modules and is used both during development and for modules that 39both in-tree and out-of-tree is provided. The method for building
41are not planned to be included in the kernel tree. 40either is similar, and all modules are initially developed and built
41out-of-tree.
42 42
43What is covered within this file is mainly information to authors 43Covered in this document is information aimed at developers interested
44of modules. The author of an external module should supply 44in building out-of-tree (or "external") modules. The author of an
45a makefile that hides most of the complexity, so one only has to type 45external module should supply a makefile that hides most of the
46'make' to build the module. A complete example will be presented in 46complexity, so one only has to type "make" to build the module. This is
47chapter 4, "Creating a kbuild file for an external module". 47easily accomplished, and a complete example will be presented in
48section 3.
48 49
49 50
50=== 2. How to build external modules 51=== 2. How to Build External Modules
51 52
52kbuild offers functionality to build external modules, with the 53To build external modules, you must have a prebuilt kernel available
53prerequisite that there is a pre-built kernel available with full source. 54that contains the configuration and header files used in the build.
54A subset of the targets available when building the kernel is available 55Also, the kernel must have been built with modules enabled. If you are
55when building an external module. 56using a distribution kernel, there will be a package for the kernel you
57are running provided by your distribution.
56 58
57--- 2.1 Building external modules 59An alternative is to use the "make" target "modules_prepare." This will
60make sure the kernel contains the information required. The target
61exists solely as a simple way to prepare a kernel source tree for
62building external modules.
58 63
59 Use the following command to build an external module: 64NOTE: "modules_prepare" will not build Module.symvers even if
65CONFIG_MODVERSIONS is set; therefore, a full kernel build needs to be
66executed to make module versioning work.
60 67
61 make -C <path-to-kernel> M=`pwd` 68--- 2.1 Command Syntax
62 69
63 For the running kernel use: 70 The command to build an external module is:
64 71
65 make -C /lib/modules/`uname -r`/build M=`pwd` 72 $ make -C <path_to_kernel_src> M=$PWD
66 73
67 For the above command to succeed, the kernel must have been 74 The kbuild system knows that an external module is being built
68 built with modules enabled. 75 due to the "M=<dir>" option given in the command.
69 76
70 To install the modules that were just built: 77 To build against the running kernel use:
71 78
72 make -C <path-to-kernel> M=`pwd` modules_install 79 $ make -C /lib/modules/`uname -r`/build M=$PWD
73 80
74 More complex examples will be shown later, the above should 81 Then to install the module(s) just built, add the target
75 be enough to get you started. 82 "modules_install" to the command:
76 83
77--- 2.2 Available targets 84 $ make -C /lib/modules/`uname -r`/build M=$PWD modules_install
78 85
79 $KDIR refers to the path to the kernel source top-level directory 86--- 2.2 Options
80 87
81 make -C $KDIR M=`pwd` 88 ($KDIR refers to the path of the kernel source directory.)
82 Will build the module(s) located in current directory.
83 All output files will be located in the same directory
84 as the module source.
85 No attempts are made to update the kernel source, and it is
86 a precondition that a successful make has been executed
87 for the kernel.
88 89
89 make -C $KDIR M=`pwd` modules 90 make -C $KDIR M=$PWD
90 The modules target is implied when no target is given.
91 Same functionality as if no target was specified.
92 See description above.
93 91
94 make -C $KDIR M=`pwd` modules_install 92 -C $KDIR
95 Install the external module(s). 93 The directory where the kernel source is located.
96 Installation default is in /lib/modules/<kernel-version>/extra, 94 "make" will actually change to the specified directory
97 but may be prefixed with INSTALL_MOD_PATH - see separate 95 when executing and will change back when finished.
98 chapter.
99 96
100 make -C $KDIR M=`pwd` clean 97 M=$PWD
101 Remove all generated files for the module - the kernel 98 Informs kbuild that an external module is being built.
102 source directory is not modified. 99 The value given to "M" is the absolute path of the
100 directory where the external module (kbuild file) is
101 located.
103 102
104 make -C $KDIR M=`pwd` help 103--- 2.3 Targets
105 help will list the available target when building external
106 modules.
107 104
108--- 2.3 Available options: 105 When building an external module, only a subset of the "make"
106 targets are available.
109 107
110 $KDIR refers to the path to the kernel source top-level directory 108 make -C $KDIR M=$PWD [target]
111 109
112 make -C $KDIR 110 The default will build the module(s) located in the current
113 Used to specify where to find the kernel source. 111 directory, so a target does not need to be specified. All
114 '$KDIR' represent the directory where the kernel source is. 112 output files will also be generated in this directory. No
115 Make will actually change directory to the specified directory 113 attempts are made to update the kernel source, and it is a
116 when executed but change back when finished. 114 precondition that a successful "make" has been executed for the
115 kernel.
117 116
118 make -C $KDIR M=`pwd` 117 modules
119 M= is used to tell kbuild that an external module is 118 The default target for external modules. It has the
120 being built. 119 same functionality as if no target was specified. See
121 The option given to M= is the directory where the external 120 description above.
122 module (kbuild file) is located.
123 When an external module is being built only a subset of the
124 usual targets are available.
125 121
126 make -C $KDIR SUBDIRS=`pwd` 122 modules_install
127 Same as M=. The SUBDIRS= syntax is kept for backwards 123 Install the external module(s). The default location is
128 compatibility. 124 /lib/modules/<kernel_release>/extra/, but a prefix may
125 be added with INSTALL_MOD_PATH (discussed in section 5).
129 126
130--- 2.4 Preparing the kernel tree for module build 127 clean
128 Remove all generated files in the module directory only.
131 129
132 To make sure the kernel contains the information required to 130 help
133 build external modules the target 'modules_prepare' must be used. 131 List the available targets for external modules.
134 'modules_prepare' exists solely as a simple way to prepare
135 a kernel source tree for building external modules.
136 Note: modules_prepare will not build Module.symvers even if
137 CONFIG_MODVERSIONS is set. Therefore a full kernel build
138 needs to be executed to make module versioning work.
139 132
140--- 2.5 Building separate files for a module 133--- 2.4 Building Separate Files
141 It is possible to build single files which are part of a module.
142 This works equally well for the kernel, a module and even for
143 external modules.
144 Examples (module foo.ko, consist of bar.o, baz.o):
145 make -C $KDIR M=`pwd` bar.lst
146 make -C $KDIR M=`pwd` bar.o
147 make -C $KDIR M=`pwd` foo.ko
148 make -C $KDIR M=`pwd` /
149
150
151=== 3. Example commands
152
153This example shows the actual commands to be executed when building
154an external module for the currently running kernel.
155In the example below, the distribution is supposed to use the
156facility to locate output files for a kernel compile in a different
157directory than the kernel source - but the examples will also work
158when the source and the output files are mixed in the same directory.
159 134
160# Kernel source 135 It is possible to build single files that are part of a module.
161/lib/modules/<kernel-version>/source -> /usr/src/linux-<version> 136 This works equally well for the kernel, a module, and even for
162 137 external modules.
163# Output from kernel compile
164/lib/modules/<kernel-version>/build -> /usr/src/linux-<version>-up
165
166Change to the directory where the kbuild file is located and execute
167the following commands to build the module:
168 138
169 cd /home/user/src/module 139 Example (The module foo.ko, consist of bar.o and baz.o):
170 make -C /usr/src/`uname -r`/source \ 140 make -C $KDIR M=$PWD bar.lst
171 O=/lib/modules/`uname-r`/build \ 141 make -C $KDIR M=$PWD baz.o
172 M=`pwd` 142 make -C $KDIR M=$PWD foo.ko
143 make -C $KDIR M=$PWD /
173 144
174Then, to install the module use the following command:
175 145
176 make -C /usr/src/`uname -r`/source \ 146=== 3. Creating a Kbuild File for an External Module
177 O=/lib/modules/`uname-r`/build \
178 M=`pwd` \
179 modules_install
180 147
181If you look closely you will see that this is the same command as 148In the last section we saw the command to build a module for the
182listed before - with the directories spelled out. 149running kernel. The module is not actually built, however, because a
150build file is required. Contained in this file will be the name of
151the module(s) being built, along with the list of requisite source
152files. The file may be as simple as a single line:
183 153
184The above are rather long commands, and the following chapter 154 obj-m := <module_name>.o
185lists a few tricks to make it all easier.
186 155
156The kbuild system will build <module_name>.o from <module_name>.c,
157and, after linking, will result in the kernel module <module_name>.ko.
158The above line can be put in either a "Kbuild" file or a "Makefile."
159When the module is built from multiple sources, an additional line is
160needed listing the files:
187 161
188=== 4. Creating a kbuild file for an external module 162 <module_name>-y := <src1>.o <src2>.o ...
189 163
190kbuild is the build system for the kernel, and external modules 164NOTE: Further documentation describing the syntax used by kbuild is
191must use kbuild to stay compatible with changes in the build system 165located in Documentation/kbuild/makefiles.txt.
192and to pick up the right flags to gcc etc.
193 166
194The kbuild file used as input shall follow the syntax described 167The examples below demonstrate how to create a build file for the
195in Documentation/kbuild/makefiles.txt. This chapter will introduce a few 168module 8123.ko, which is built from the following files:
196more tricks to be used when dealing with external modules.
197 169
198In the following a Makefile will be created for a module with the
199following files:
200 8123_if.c 170 8123_if.c
201 8123_if.h 171 8123_if.h
202 8123_pci.c 172 8123_pci.c
203 8123_bin.o_shipped <= Binary blob 173 8123_bin.o_shipped <= Binary blob
204 174
205--- 4.1 Shared Makefile for module and kernel 175--- 3.1 Shared Makefile
206 176
207 An external module always includes a wrapper Makefile supporting 177 An external module always includes a wrapper makefile that
208 building the module using 'make' with no arguments. 178 supports building the module using "make" with no arguments.
209 The Makefile provided will most likely include additional 179 This target is not used by kbuild; it is only for convenience.
210 functionality such as test targets etc. and this part shall 180 Additional functionality, such as test targets, can be included
211 be filtered away from kbuild since it may impact kbuild if 181 but should be filtered out from kbuild due to possible name
212 name clashes occurs. 182 clashes.
213 183
214 Example 1: 184 Example 1:
215 --> filename: Makefile 185 --> filename: Makefile
@@ -219,11 +189,11 @@ following files:
219 8123-y := 8123_if.o 8123_pci.o 8123_bin.o 189 8123-y := 8123_if.o 8123_pci.o 8123_bin.o
220 190
221 else 191 else
222 # Normal Makefile 192 # normal makefile
193 KDIR ?= /lib/modules/`uname -r`/build
223 194
224 KERNELDIR := /lib/modules/`uname -r`/build 195 default:
225 all:: 196 $(MAKE) -C $(KDIR) M=$$PWD
226 $(MAKE) -C $(KERNELDIR) M=`pwd` $@
227 197
228 # Module specific targets 198 # Module specific targets
229 genbin: 199 genbin:
@@ -231,15 +201,20 @@ following files:
231 201
232 endif 202 endif
233 203
234 In example 1, the check for KERNELRELEASE is used to separate 204 The check for KERNELRELEASE is used to separate the two parts
235 the two parts of the Makefile. kbuild will only see the two 205 of the makefile. In the example, kbuild will only see the two
236 assignments whereas make will see everything except the two 206 assignments, whereas "make" will see everything except these
237 kbuild assignments. 207 two assignments. This is due to two passes made on the file:
208 the first pass is by the "make" instance run on the command
209 line; the second pass is by the kbuild system, which is
210 initiated by the parameterized "make" in the default target.
211
212--- 3.2 Separate Kbuild File and Makefile
238 213
239 In recent versions of the kernel, kbuild will look for a file named 214 In newer versions of the kernel, kbuild will first look for a
240 Kbuild and as second option look for a file named Makefile. 215 file named "Kbuild," and only if that is not found, will it
241 Utilising the Kbuild file makes us split up the Makefile in example 1 216 then look for a makefile. Utilizing a "Kbuild" file allows us
242 into two files as shown in example 2: 217 to split up the makefile from example 1 into two files:
243 218
244 Example 2: 219 Example 2:
245 --> filename: Kbuild 220 --> filename: Kbuild
@@ -247,20 +222,21 @@ following files:
247 8123-y := 8123_if.o 8123_pci.o 8123_bin.o 222 8123-y := 8123_if.o 8123_pci.o 8123_bin.o
248 223
249 --> filename: Makefile 224 --> filename: Makefile
250 KERNELDIR := /lib/modules/`uname -r`/build 225 KDIR ?= /lib/modules/`uname -r`/build
251 all:: 226
252 $(MAKE) -C $(KERNELDIR) M=`pwd` $@ 227 default:
228 $(MAKE) -C $(KDIR) M=$$PWD
253 229
254 # Module specific targets 230 # Module specific targets
255 genbin: 231 genbin:
256 echo "X" > 8123_bin.o_shipped 232 echo "X" > 8123_bin.o_shipped
257 233
234 The split in example 2 is questionable due to the simplicity of
235 each file; however, some external modules use makefiles
236 consisting of several hundred lines, and here it really pays
237 off to separate the kbuild part from the rest.
258 238
259 In example 2, we are down to two fairly simple files and for simple 239 The next example shows a backward compatible version.
260 files as used in this example the split is questionable. But some
261 external modules use Makefiles of several hundred lines and here it
262 really pays off to separate the kbuild part from the rest.
263 Example 3 shows a backward compatible version.
264 240
265 Example 3: 241 Example 3:
266 --> filename: Kbuild 242 --> filename: Kbuild
@@ -269,13 +245,15 @@ following files:
269 245
270 --> filename: Makefile 246 --> filename: Makefile
271 ifneq ($(KERNELRELEASE),) 247 ifneq ($(KERNELRELEASE),)
248 # kbuild part of makefile
272 include Kbuild 249 include Kbuild
250
273 else 251 else
274 # Normal Makefile 252 # normal makefile
253 KDIR ?= /lib/modules/`uname -r`/build
275 254
276 KERNELDIR := /lib/modules/`uname -r`/build 255 default:
277 all:: 256 $(MAKE) -C $(KDIR) M=$$PWD
278 $(MAKE) -C $(KERNELDIR) M=`pwd` $@
279 257
280 # Module specific targets 258 # Module specific targets
281 genbin: 259 genbin:
@@ -283,260 +261,271 @@ following files:
283 261
284 endif 262 endif
285 263
286 The trick here is to include the Kbuild file from Makefile, so 264 Here the "Kbuild" file is included from the makefile. This
287 if an older version of kbuild picks up the Makefile, the Kbuild 265 allows an older version of kbuild, which only knows of
288 file will be included. 266 makefiles, to be used when the "make" and kbuild parts are
267 split into separate files.
289 268
290--- 4.2 Binary blobs included in a module 269--- 3.3 Binary Blobs
291 270
292 Some external modules needs to include a .o as a blob. kbuild 271 Some external modules need to include an object file as a blob.
293 has support for this, but requires the blob file to be named 272 kbuild has support for this, but requires the blob file to be
294 <filename>_shipped. In our example the blob is named 273 named <filename>_shipped. When the kbuild rules kick in, a copy
295 8123_bin.o_shipped and when the kbuild rules kick in the file 274 of <filename>_shipped is created with _shipped stripped off,
296 8123_bin.o is created as a simple copy off the 8213_bin.o_shipped file 275 giving us <filename>. This shortened filename can be used in
297 with the _shipped part stripped of the filename. 276 the assignment to the module.
298 This allows the 8123_bin.o filename to be used in the assignment to 277
299 the module. 278 Throughout this section, 8123_bin.o_shipped has been used to
279 build the kernel module 8123.ko; it has been included as
280 8123_bin.o.
300 281
301 Example 4:
302 obj-m := 8123.o
303 8123-y := 8123_if.o 8123_pci.o 8123_bin.o 282 8123-y := 8123_if.o 8123_pci.o 8123_bin.o
304 283
305 In example 4, there is no distinction between the ordinary .c/.h files 284 Although there is no distinction between the ordinary source
306 and the binary file. But kbuild will pick up different rules to create 285 files and the binary file, kbuild will pick up different rules
307 the .o file. 286 when creating the object file for the module.
287
288--- 3.4 Building Multiple Modules
308 289
290 kbuild supports building multiple modules with a single build
291 file. For example, if you wanted to build two modules, foo.ko
292 and bar.ko, the kbuild lines would be:
309 293
310=== 5. Include files 294 obj-m := foo.o bar.o
295 foo-y := <foo_srcs>
296 bar-y := <bar_srcs>
311 297
312Include files are a necessity when a .c file uses something from other .c 298 It is that simple!
313files (not strictly in the sense of C, but if good programming practice is
314used). Any module that consists of more than one .c file will have a .h file
315for one of the .c files.
316 299
317- If the .h file only describes a module internal interface, then the .h file
318 shall be placed in the same directory as the .c files.
319- If the .h files describe an interface used by other parts of the kernel
320 located in different directories, the .h files shall be located in
321 include/linux/ or other include/ directories as appropriate.
322 300
323One exception for this rule is larger subsystems that have their own directory 301=== 4. Include Files
324under include/ such as include/scsi. Another exception is arch-specific
325.h files which are located under include/asm-$(ARCH)/*.
326 302
327External modules have a tendency to locate include files in a separate include/ 303Within the kernel, header files are kept in standard locations
328directory and therefore need to deal with this in their kbuild file. 304according to the following rule:
329 305
330--- 5.1 How to include files from the kernel include dir 306 * If the header file only describes the internal interface of a
307 module, then the file is placed in the same directory as the
308 source files.
309 * If the header file describes an interface used by other parts
310 of the kernel that are located in different directories, then
311 the file is placed in include/linux/.
331 312
332 When a module needs to include a file from include/linux/, then one 313 NOTE: There are two notable exceptions to this rule: larger
333 just uses: 314 subsystems have their own directory under include/, such as
315 include/scsi; and architecture specific headers are located
316 under arch/$(ARCH)/include/.
334 317
335 #include <linux/modules.h> 318--- 4.1 Kernel Includes
336 319
337 kbuild will make sure to add options to gcc so the relevant 320 To include a header file located under include/linux/, simply
338 directories are searched. 321 use:
339 Likewise for .h files placed in the same directory as the .c file.
340 322
341 #include "8123_if.h" 323 #include <linux/module.h>
342 324
343 will do the job. 325 kbuild will add options to "gcc" so the relevant directories
326 are searched.
344 327
345--- 5.2 External modules using an include/ dir 328--- 4.2 Single Subdirectory
346 329
347 External modules often locate their .h files in a separate include/ 330 External modules tend to place header files in a separate
348 directory although this is not usual kernel style. When an external 331 include/ directory where their source is located, although this
349 module uses an include/ dir then kbuild needs to be told so. 332 is not the usual kernel style. To inform kbuild of the
350 The trick here is to use either EXTRA_CFLAGS (take effect for all .c 333 directory, use either ccflags-y or CFLAGS_<filename>.o.
351 files) or CFLAGS_$F.o (take effect only for a single file).
352 334
353 In our example, if we move 8123_if.h to a subdirectory named include/ 335 Using the example from section 3, if we moved 8123_if.h to a
354 the resulting Kbuild file would look like: 336 subdirectory named include, the resulting kbuild file would
337 look like:
355 338
356 --> filename: Kbuild 339 --> filename: Kbuild
357 obj-m := 8123.o 340 obj-m := 8123.o
358 341
359 EXTRA_CFLAGS := -Iinclude 342 ccflags-y := -Iinclude
360 8123-y := 8123_if.o 8123_pci.o 8123_bin.o 343 8123-y := 8123_if.o 8123_pci.o 8123_bin.o
361 344
362 Note that in the assignment there is no space between -I and the path. 345 Note that in the assignment there is no space between -I and
363 This is a kbuild limitation: there must be no space present. 346 the path. This is a limitation of kbuild: there must be no
347 space present.
364 348
365--- 5.3 External modules using several directories 349--- 4.3 Several Subdirectories
366
367 If an external module does not follow the usual kernel style, but
368 decides to spread files over several directories, then kbuild can
369 handle this too.
370 350
351 kbuild can handle files that are spread over several directories.
371 Consider the following example: 352 Consider the following example:
372 353
373 | 354 .
374 +- src/complex_main.c 355 |__ src
375 | +- hal/hardwareif.c 356 | |__ complex_main.c
376 | +- hal/include/hardwareif.h 357 | |__ hal
377 +- include/complex.h 358 | |__ hardwareif.c
378 359 | |__ include
379 To build a single module named complex.ko, we then need the following 360 | |__ hardwareif.h
361 |__ include
362 |__ complex.h
363
364 To build the module complex.ko, we then need the following
380 kbuild file: 365 kbuild file:
381 366
382 Kbuild: 367 --> filename: Kbuild
383 obj-m := complex.o 368 obj-m := complex.o
384 complex-y := src/complex_main.o 369 complex-y := src/complex_main.o
385 complex-y += src/hal/hardwareif.o 370 complex-y += src/hal/hardwareif.o
386 371
387 EXTRA_CFLAGS := -I$(src)/include 372 ccflags-y := -I$(src)/include
388 EXTRA_CFLAGS += -I$(src)src/hal/include 373 ccflags-y += -I$(src)/src/hal/include
389 374
375 As you can see, kbuild knows how to handle object files located
376 in other directories. The trick is to specify the directory
377 relative to the kbuild file's location. That being said, this
378 is NOT recommended practice.
390 379
391 kbuild knows how to handle .o files located in another directory - 380 For the header files, kbuild must be explicitly told where to
392 although this is NOT recommended practice. The syntax is to specify 381 look. When kbuild executes, the current directory is always the
393 the directory relative to the directory where the Kbuild file is 382 root of the kernel tree (the argument to "-C") and therefore an
394 located. 383 absolute path is needed. $(src) provides the absolute path by
384 pointing to the directory where the currently executing kbuild
385 file is located.
395 386
396 To find the .h files, we have to explicitly tell kbuild where to look
397 for the .h files. When kbuild executes, the current directory is always
398 the root of the kernel tree (argument to -C) and therefore we have to
399 tell kbuild how to find the .h files using absolute paths.
400 $(src) will specify the absolute path to the directory where the
401 Kbuild file are located when being build as an external module.
402 Therefore -I$(src)/ is used to point out the directory of the Kbuild
403 file and any additional path are just appended.
404 387
405=== 6. Module installation 388=== 5. Module Installation
406 389
407Modules which are included in the kernel are installed in the directory: 390Modules which are included in the kernel are installed in the
391directory:
408 392
409 /lib/modules/$(KERNELRELEASE)/kernel 393 /lib/modules/$(KERNELRELEASE)/kernel/
410 394
411External modules are installed in the directory: 395And external modules are installed in:
412 396
413 /lib/modules/$(KERNELRELEASE)/extra 397 /lib/modules/$(KERNELRELEASE)/extra/
414 398
415--- 6.1 INSTALL_MOD_PATH 399--- 5.1 INSTALL_MOD_PATH
416 400
417 Above are the default directories, but as always, some level of 401 Above are the default directories but as always some level of
418 customization is possible. One can prefix the path using the variable 402 customization is possible. A prefix can be added to the
419 INSTALL_MOD_PATH: 403 installation path using the variable INSTALL_MOD_PATH:
420 404
421 $ make INSTALL_MOD_PATH=/frodo modules_install 405 $ make INSTALL_MOD_PATH=/frodo modules_install
422 => Install dir: /frodo/lib/modules/$(KERNELRELEASE)/kernel 406 => Install dir: /frodo/lib/modules/$(KERNELRELEASE)/kernel/
423
424 INSTALL_MOD_PATH may be set as an ordinary shell variable or as in the
425 example above, can be specified on the command line when calling make.
426 INSTALL_MOD_PATH has effect both when installing modules included in
427 the kernel as well as when installing external modules.
428 407
429--- 6.2 INSTALL_MOD_DIR 408 INSTALL_MOD_PATH may be set as an ordinary shell variable or,
409 as shown above, can be specified on the command line when
410 calling "make." This has effect when installing both in-tree
411 and out-of-tree modules.
430 412
431 When installing external modules they are by default installed to a 413--- 5.2 INSTALL_MOD_DIR
432 directory under /lib/modules/$(KERNELRELEASE)/extra, but one may wish
433 to locate modules for a specific functionality in a separate
434 directory. For this purpose, one can use INSTALL_MOD_DIR to specify an
435 alternative name to 'extra'.
436 414
437 $ make INSTALL_MOD_DIR=gandalf -C KERNELDIR \ 415 External modules are by default installed to a directory under
438 M=`pwd` modules_install 416 /lib/modules/$(KERNELRELEASE)/extra/, but you may wish to
439 => Install dir: /lib/modules/$(KERNELRELEASE)/gandalf 417 locate modules for a specific functionality in a separate
418 directory. For this purpose, use INSTALL_MOD_DIR to specify an
419 alternative name to "extra."
440 420
421 $ make INSTALL_MOD_DIR=gandalf -C $KDIR \
422 M=$PWD modules_install
423 => Install dir: /lib/modules/$(KERNELRELEASE)/gandalf/
441 424
442=== 7. Module versioning & Module.symvers
443 425
444Module versioning is enabled by the CONFIG_MODVERSIONS tag. 426=== 6. Module Versioning
445 427
446Module versioning is used as a simple ABI consistency check. The Module 428Module versioning is enabled by the CONFIG_MODVERSIONS tag, and is used
447versioning creates a CRC value of the full prototype for an exported symbol and 429as a simple ABI consistency check. A CRC value of the full prototype
448when a module is loaded/used then the CRC values contained in the kernel are 430for an exported symbol is created. When a module is loaded/used, the
449compared with similar values in the module. If they are not equal, then the 431CRC values contained in the kernel are compared with similar values in
450kernel refuses to load the module. 432the module; if they are not equal, the kernel refuses to load the
433module.
451 434
452Module.symvers contains a list of all exported symbols from a kernel build. 435Module.symvers contains a list of all exported symbols from a kernel
436build.
453 437
454--- 7.1 Symbols from the kernel (vmlinux + modules) 438--- 6.1 Symbols From the Kernel (vmlinux + modules)
455 439
456 During a kernel build, a file named Module.symvers will be generated. 440 During a kernel build, a file named Module.symvers will be
457 Module.symvers contains all exported symbols from the kernel and 441 generated. Module.symvers contains all exported symbols from
458 compiled modules. For each symbols, the corresponding CRC value 442 the kernel and compiled modules. For each symbol, the
459 is stored too. 443 corresponding CRC value is also stored.
460 444
461 The syntax of the Module.symvers file is: 445 The syntax of the Module.symvers file is:
462 <CRC> <Symbol> <module> 446 <CRC> <Symbol> <module>
463 Sample: 447
464 0x2d036834 scsi_remove_host drivers/scsi/scsi_mod 448 0x2d036834 scsi_remove_host drivers/scsi/scsi_mod
465 449
466 For a kernel build without CONFIG_MODVERSIONS enabled, the crc 450 For a kernel build without CONFIG_MODVERSIONS enabled, the CRC
467 would read: 0x00000000 451 would read 0x00000000.
468 452
469 Module.symvers serves two purposes: 453 Module.symvers serves two purposes:
470 1) It lists all exported symbols both from vmlinux and all modules 454 1) It lists all exported symbols from vmlinux and all modules.
471 2) It lists the CRC if CONFIG_MODVERSIONS is enabled 455 2) It lists the CRC if CONFIG_MODVERSIONS is enabled.
472 456
473--- 7.2 Symbols and external modules 457--- 6.2 Symbols and External Modules
474 458
475 When building an external module, the build system needs access to 459 When building an external module, the build system needs access
476 the symbols from the kernel to check if all external symbols are 460 to the symbols from the kernel to check if all external symbols
477 defined. This is done in the MODPOST step and to obtain all 461 are defined. This is done in the MODPOST step. modpost obtains
478 symbols, modpost reads Module.symvers from the kernel. 462 the symbols by reading Module.symvers from the kernel source
479 If a Module.symvers file is present in the directory where 463 tree. If a Module.symvers file is present in the directory
480 the external module is being built, this file will be read too. 464 where the external module is being built, this file will be
481 During the MODPOST step, a new Module.symvers file will be written 465 read too. During the MODPOST step, a new Module.symvers file
482 containing all exported symbols that were not defined in the kernel. 466 will be written containing all exported symbols that were not
483 467 defined in the kernel.
484--- 7.3 Symbols from another external module 468
485 469--- 6.3 Symbols From Another External Module
486 Sometimes, an external module uses exported symbols from another 470
487 external module. Kbuild needs to have full knowledge on all symbols 471 Sometimes, an external module uses exported symbols from
488 to avoid spitting out warnings about undefined symbols. 472 another external module. kbuild needs to have full knowledge of
489 Three solutions exist to let kbuild know all symbols of more than 473 all symbols to avoid spitting out warnings about undefined
490 one external module. 474 symbols. Three solutions exist for this situation.
491 The method with a top-level kbuild file is recommended but may be 475
492 impractical in certain situations. 476 NOTE: The method with a top-level kbuild file is recommended
493 477 but may be impractical in certain situations.
494 Use a top-level Kbuild file 478
495 If you have two modules: 'foo' and 'bar', and 'foo' needs 479 Use a top-level kbuild file
496 symbols from 'bar', then one can use a common top-level kbuild 480 If you have two modules, foo.ko and bar.ko, where
497 file so both modules are compiled in same build. 481 foo.ko needs symbols from bar.ko, you can use a
498 482 common top-level kbuild file so both modules are
499 Consider following directory layout: 483 compiled in the same build. Consider the following
500 ./foo/ <= contains the foo module 484 directory layout:
501 ./bar/ <= contains the bar module 485
502 The top-level Kbuild file would then look like: 486 ./foo/ <= contains foo.ko
503 487 ./bar/ <= contains bar.ko
504 #./Kbuild: (this file may also be named Makefile) 488
489 The top-level kbuild file would then look like:
490
491 #./Kbuild (or ./Makefile):
505 obj-y := foo/ bar/ 492 obj-y := foo/ bar/
506 493
507 Executing: 494 And executing
508 make -C $KDIR M=`pwd` 495
496 $ make -C $KDIR M=$PWD
509 497
510 will then do the expected and compile both modules with full 498 will then do the expected and compile both modules with
511 knowledge on symbols from both modules. 499 full knowledge of symbols from either module.
512 500
513 Use an extra Module.symvers file 501 Use an extra Module.symvers file
514 When an external module is built, a Module.symvers file is 502 When an external module is built, a Module.symvers file
515 generated containing all exported symbols which are not 503 is generated containing all exported symbols which are
516 defined in the kernel. 504 not defined in the kernel. To get access to symbols
517 To get access to symbols from module 'bar', one can copy the 505 from bar.ko, copy the Module.symvers file from the
518 Module.symvers file from the compilation of the 'bar' module 506 compilation of bar.ko to the directory where foo.ko is
519 to the directory where the 'foo' module is built. 507 built. During the module build, kbuild will read the
520 During the module build, kbuild will read the Module.symvers 508 Module.symvers file in the directory of the external
521 file in the directory of the external module and when the 509 module, and when the build is finished, a new
522 build is finished, a new Module.symvers file is created 510 Module.symvers file is created containing the sum of
523 containing the sum of all symbols defined and not part of the 511 all symbols defined and not part of the kernel.
524 kernel. 512
525 513 Use "make" variable KBUILD_EXTRA_SYMBOLS
526 Use make variable KBUILD_EXTRA_SYMBOLS in the Makefile 514 If it is impractical to copy Module.symvers from
527 If it is impractical to copy Module.symvers from another 515 another module, you can assign a space separated list
528 module, you can assign a space separated list of files to 516 of files to KBUILD_EXTRA_SYMBOLS in your build file.
529 KBUILD_EXTRA_SYMBOLS in your Makfile. These files will be 517 These files will be loaded by modpost during the
530 loaded by modpost during the initialisation of its symbol 518 initialization of its symbol tables.
531 tables. 519
532 520
533=== 8. Tips & Tricks 521=== 7. Tips & Tricks
534 522
535--- 8.1 Testing for CONFIG_FOO_BAR 523--- 7.1 Testing for CONFIG_FOO_BAR
536 524
537 Modules often need to check for certain CONFIG_ options to decide if 525 Modules often need to check for certain CONFIG_ options to
538 a specific feature shall be included in the module. When kbuild is used 526 decide if a specific feature is included in the module. In
539 this is done by referencing the CONFIG_ variable directly. 527 kbuild this is done by referencing the CONFIG_ variable
528 directly.
540 529
541 #fs/ext2/Makefile 530 #fs/ext2/Makefile
542 obj-$(CONFIG_EXT2_FS) += ext2.o 531 obj-$(CONFIG_EXT2_FS) += ext2.o
@@ -544,9 +533,9 @@ Module.symvers contains a list of all exported symbols from a kernel build.
544 ext2-y := balloc.o bitmap.o dir.o 533 ext2-y := balloc.o bitmap.o dir.o
545 ext2-$(CONFIG_EXT2_FS_XATTR) += xattr.o 534 ext2-$(CONFIG_EXT2_FS_XATTR) += xattr.o
546 535
547 External modules have traditionally used grep to check for specific 536 External modules have traditionally used "grep" to check for
548 CONFIG_ settings directly in .config. This usage is broken. 537 specific CONFIG_ settings directly in .config. This usage is
549 As introduced before, external modules shall use kbuild when building 538 broken. As introduced before, external modules should use
550 and therefore can use the same methods as in-kernel modules when 539 kbuild for building and can therefore use the same methods as
551 testing for CONFIG_ definitions. 540 in-tree modules when testing for CONFIG_ definitions.
552 541
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 4bc2f3c3da5b..ed45e9802aa8 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -2175,6 +2175,11 @@ and is between 256 and 4096 characters. It is defined in the file
2175 reset_devices [KNL] Force drivers to reset the underlying device 2175 reset_devices [KNL] Force drivers to reset the underlying device
2176 during initialization. 2176 during initialization.
2177 2177
2178 resource_alloc_from_bottom
2179 Allocate new resources from the beginning of available
2180 space, not the end. If you need to use this, please
2181 report a bug.
2182
2178 resume= [SWSUSP] 2183 resume= [SWSUSP]
2179 Specify the partition device for software suspend 2184 Specify the partition device for software suspend
2180 2185
diff --git a/Documentation/networking/phy.txt b/Documentation/networking/phy.txt
index 88bb71b46da4..9eb1ba52013d 100644
--- a/Documentation/networking/phy.txt
+++ b/Documentation/networking/phy.txt
@@ -177,18 +177,6 @@ Doing it all yourself
177 177
178 A convenience function to print out the PHY status neatly. 178 A convenience function to print out the PHY status neatly.
179 179
180 int phy_clear_interrupt(struct phy_device *phydev);
181 int phy_config_interrupt(struct phy_device *phydev, u32 interrupts);
182
183 Clear the PHY's interrupt, and configure which ones are allowed,
184 respectively. Currently only supports all on, or all off.
185
186 int phy_enable_interrupts(struct phy_device *phydev);
187 int phy_disable_interrupts(struct phy_device *phydev);
188
189 Functions which enable/disable PHY interrupts, clearing them
190 before and after, respectively.
191
192 int phy_start_interrupts(struct phy_device *phydev); 180 int phy_start_interrupts(struct phy_device *phydev);
193 int phy_stop_interrupts(struct phy_device *phydev); 181 int phy_stop_interrupts(struct phy_device *phydev);
194 182
@@ -213,12 +201,6 @@ Doing it all yourself
213 Fills the phydev structure with up-to-date information about the current 201 Fills the phydev structure with up-to-date information about the current
214 settings in the PHY. 202 settings in the PHY.
215 203
216 void phy_sanitize_settings(struct phy_device *phydev)
217
218 Resolves differences between currently desired settings, and
219 supported settings for the given PHY device. Does not make
220 the changes in the hardware, though.
221
222 int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); 204 int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd);
223 int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd); 205 int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd);
224 206
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt
index b606c2c4dd37..30289fab86eb 100644
--- a/Documentation/sysctl/vm.txt
+++ b/Documentation/sysctl/vm.txt
@@ -80,8 +80,10 @@ dirty_background_bytes
80Contains the amount of dirty memory at which the pdflush background writeback 80Contains the amount of dirty memory at which the pdflush background writeback
81daemon will start writeback. 81daemon will start writeback.
82 82
83If dirty_background_bytes is written, dirty_background_ratio becomes a function 83Note: dirty_background_bytes is the counterpart of dirty_background_ratio. Only
84of its value (dirty_background_bytes / the amount of dirtyable system memory). 84one of them may be specified at a time. When one sysctl is written it is
85immediately taken into account to evaluate the dirty memory limits and the
86other appears as 0 when read.
85 87
86============================================================== 88==============================================================
87 89
@@ -97,8 +99,10 @@ dirty_bytes
97Contains the amount of dirty memory at which a process generating disk writes 99Contains the amount of dirty memory at which a process generating disk writes
98will itself start writeback. 100will itself start writeback.
99 101
100If dirty_bytes is written, dirty_ratio becomes a function of its value 102Note: dirty_bytes is the counterpart of dirty_ratio. Only one of them may be
101(dirty_bytes / the amount of dirtyable system memory). 103specified at a time. When one sysctl is written it is immediately taken into
104account to evaluate the dirty memory limits and the other appears as 0 when
105read.
102 106
103Note: the minimum value allowed for dirty_bytes is two pages (in bytes); any 107Note: the minimum value allowed for dirty_bytes is two pages (in bytes); any
104value lower than this limit will be ignored and the old configuration will be 108value lower than this limit will be ignored and the old configuration will be
diff --git a/Documentation/video4linux/CARDLIST.cx88 b/Documentation/video4linux/CARDLIST.cx88
index f2510541373b..42517d9121de 100644
--- a/Documentation/video4linux/CARDLIST.cx88
+++ b/Documentation/video4linux/CARDLIST.cx88
@@ -83,3 +83,4 @@
83 82 -> WinFast DTV2000 H rev. J [107d:6f2b] 83 82 -> WinFast DTV2000 H rev. J [107d:6f2b]
84 83 -> Prof 7301 DVB-S/S2 [b034:3034] 84 83 -> Prof 7301 DVB-S/S2 [b034:3034]
85 84 -> Samsung SMT 7020 DVB-S [18ac:dc00,18ac:dccd] 85 84 -> Samsung SMT 7020 DVB-S [18ac:dc00,18ac:dccd]
86 85 -> Twinhan VP-1027 DVB-S [1822:0023]
diff --git a/Documentation/video4linux/CARDLIST.em28xx b/Documentation/video4linux/CARDLIST.em28xx
index 5c568757c301..ac2616a62fc3 100644
--- a/Documentation/video4linux/CARDLIST.em28xx
+++ b/Documentation/video4linux/CARDLIST.em28xx
@@ -31,6 +31,7 @@
31 30 -> Videology 20K14XUSB USB2.0 (em2820/em2840) 31 30 -> Videology 20K14XUSB USB2.0 (em2820/em2840)
32 31 -> Usbgear VD204v9 (em2821) 32 31 -> Usbgear VD204v9 (em2821)
33 32 -> Supercomp USB 2.0 TV (em2821) 33 32 -> Supercomp USB 2.0 TV (em2821)
34 33 -> Elgato Video Capture (em2860) [0fd9:0033]
34 34 -> Terratec Cinergy A Hybrid XS (em2860) [0ccd:004f] 35 34 -> Terratec Cinergy A Hybrid XS (em2860) [0ccd:004f]
35 35 -> Typhoon DVD Maker (em2860) 36 35 -> Typhoon DVD Maker (em2860)
36 36 -> NetGMBH Cam (em2860) 37 36 -> NetGMBH Cam (em2860)
@@ -45,7 +46,7 @@
45 45 -> Pinnacle PCTV DVB-T (em2870) 46 45 -> Pinnacle PCTV DVB-T (em2870)
46 46 -> Compro, VideoMate U3 (em2870) [185b:2870] 47 46 -> Compro, VideoMate U3 (em2870) [185b:2870]
47 47 -> KWorld DVB-T 305U (em2880) [eb1a:e305] 48 47 -> KWorld DVB-T 305U (em2880) [eb1a:e305]
48 48 -> KWorld DVB-T 310U (em2880) [eb1a:e310] 49 48 -> KWorld DVB-T 310U (em2880)
49 49 -> MSI DigiVox A/D (em2880) [eb1a:e310] 50 49 -> MSI DigiVox A/D (em2880) [eb1a:e310]
50 50 -> MSI DigiVox A/D II (em2880) [eb1a:e320] 51 50 -> MSI DigiVox A/D II (em2880) [eb1a:e320]
51 51 -> Terratec Hybrid XS Secam (em2880) [0ccd:004c] 52 51 -> Terratec Hybrid XS Secam (em2880) [0ccd:004c]
diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134
index 4000c29fcfb6..8d9afc7d8014 100644
--- a/Documentation/video4linux/CARDLIST.saa7134
+++ b/Documentation/video4linux/CARDLIST.saa7134
@@ -126,7 +126,7 @@
126125 -> Beholder BeholdTV 409 [0000:4090] 126125 -> Beholder BeholdTV 409 [0000:4090]
127126 -> Beholder BeholdTV 505 FM [5ace:5050] 127126 -> Beholder BeholdTV 505 FM [5ace:5050]
128127 -> Beholder BeholdTV 507 FM / BeholdTV 509 FM [5ace:5070,5ace:5090] 128127 -> Beholder BeholdTV 507 FM / BeholdTV 509 FM [5ace:5070,5ace:5090]
129128 -> Beholder BeholdTV Columbus TVFM [0000:5201] 129128 -> Beholder BeholdTV Columbus TV/FM [0000:5201]
130129 -> Beholder BeholdTV 607 FM [5ace:6070] 130129 -> Beholder BeholdTV 607 FM [5ace:6070]
131130 -> Beholder BeholdTV M6 [5ace:6190] 131130 -> Beholder BeholdTV M6 [5ace:6190]
132131 -> Twinhan Hybrid DTV-DVB 3056 PCI [1822:0022] 132131 -> Twinhan Hybrid DTV-DVB 3056 PCI [1822:0022]
diff --git a/Documentation/video4linux/bttv/MAKEDEV b/Documentation/video4linux/bttv/MAKEDEV
index 9d112f7fd5f7..093c0cd18042 100644
--- a/Documentation/video4linux/bttv/MAKEDEV
+++ b/Documentation/video4linux/bttv/MAKEDEV
@@ -19,7 +19,6 @@ function makedev () {
19echo "*** new device names ***" 19echo "*** new device names ***"
20makedev video 0 20makedev video 0
21makedev radio 64 21makedev radio 64
22makedev vtx 192
23makedev vbi 224 22makedev vbi 224
24 23
25#echo "*** old device names (for compatibility only) ***" 24#echo "*** old device names (for compatibility only) ***"
diff --git a/Documentation/video4linux/gspca.txt b/Documentation/video4linux/gspca.txt
index 56ba7bba7168..6a562eeeb4cd 100644
--- a/Documentation/video4linux/gspca.txt
+++ b/Documentation/video4linux/gspca.txt
@@ -302,12 +302,14 @@ sonixj 0c45:60fb Surfer NoName
302sonixj 0c45:60fc LG-LIC300 302sonixj 0c45:60fc LG-LIC300
303sonixj 0c45:60fe Microdia Audio 303sonixj 0c45:60fe Microdia Audio
304sonixj 0c45:6100 PC Camera (SN9C128) 304sonixj 0c45:6100 PC Camera (SN9C128)
305sonixj 0c45:6102 PC Camera (SN9C128)
305sonixj 0c45:610a PC Camera (SN9C128) 306sonixj 0c45:610a PC Camera (SN9C128)
306sonixj 0c45:610b PC Camera (SN9C128) 307sonixj 0c45:610b PC Camera (SN9C128)
307sonixj 0c45:610c PC Camera (SN9C128) 308sonixj 0c45:610c PC Camera (SN9C128)
308sonixj 0c45:610e PC Camera (SN9C128) 309sonixj 0c45:610e PC Camera (SN9C128)
309sonixj 0c45:6128 Microdia/Sonix SNP325 310sonixj 0c45:6128 Microdia/Sonix SNP325
310sonixj 0c45:612a Avant Camera 311sonixj 0c45:612a Avant Camera
312sonixj 0c45:612b Speed-Link REFLECT2
311sonixj 0c45:612c Typhoon Rasy Cam 1.3MPix 313sonixj 0c45:612c Typhoon Rasy Cam 1.3MPix
312sonixj 0c45:6130 Sonix Pccam 314sonixj 0c45:6130 Sonix Pccam
313sonixj 0c45:6138 Sn9c120 Mo4000 315sonixj 0c45:6138 Sn9c120 Mo4000
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt
index e831aaca66f8..f22f35c271f3 100644
--- a/Documentation/video4linux/v4l2-framework.txt
+++ b/Documentation/video4linux/v4l2-framework.txt
@@ -44,8 +44,8 @@ All drivers have the following structure:
44 44
452) A way of initializing and commanding sub-devices (if any). 452) A way of initializing and commanding sub-devices (if any).
46 46
473) Creating V4L2 device nodes (/dev/videoX, /dev/vbiX, /dev/radioX and 473) Creating V4L2 device nodes (/dev/videoX, /dev/vbiX and /dev/radioX)
48 /dev/vtxX) and keeping track of device-node specific data. 48 and keeping track of device-node specific data.
49 49
504) Filehandle-specific structs containing per-filehandle data; 504) Filehandle-specific structs containing per-filehandle data;
51 51
@@ -192,6 +192,11 @@ You also need a way to go from the low-level struct to v4l2_subdev. For the
192common i2c_client struct the i2c_set_clientdata() call is used to store a 192common i2c_client struct the i2c_set_clientdata() call is used to store a
193v4l2_subdev pointer, for other busses you may have to use other methods. 193v4l2_subdev pointer, for other busses you may have to use other methods.
194 194
195Bridges might also need to store per-subdev private data, such as a pointer to
196bridge-specific per-subdev private data. The v4l2_subdev structure provides
197host private data for that purpose that can be accessed with
198v4l2_get_subdev_hostdata() and v4l2_set_subdev_hostdata().
199
195From the bridge driver perspective you load the sub-device module and somehow 200From the bridge driver perspective you load the sub-device module and somehow
196obtain the v4l2_subdev pointer. For i2c devices this is easy: you call 201obtain the v4l2_subdev pointer. For i2c devices this is easy: you call
197i2c_get_clientdata(). For other busses something similar needs to be done. 202i2c_get_clientdata(). For other busses something similar needs to be done.
@@ -448,6 +453,10 @@ You should also set these fields:
448- ioctl_ops: if you use the v4l2_ioctl_ops to simplify ioctl maintenance 453- ioctl_ops: if you use the v4l2_ioctl_ops to simplify ioctl maintenance
449 (highly recommended to use this and it might become compulsory in the 454 (highly recommended to use this and it might become compulsory in the
450 future!), then set this to your v4l2_ioctl_ops struct. 455 future!), then set this to your v4l2_ioctl_ops struct.
456- lock: leave to NULL if you want to do all the locking in the driver.
457 Otherwise you give it a pointer to a struct mutex_lock and before any
458 of the v4l2_file_operations is called this lock will be taken by the
459 core and released afterwards.
451- parent: you only set this if v4l2_device was registered with NULL as 460- parent: you only set this if v4l2_device was registered with NULL as
452 the parent device struct. This only happens in cases where one hardware 461 the parent device struct. This only happens in cases where one hardware
453 device has multiple PCI devices that all share the same v4l2_device core. 462 device has multiple PCI devices that all share the same v4l2_device core.
@@ -464,6 +473,22 @@ If you use v4l2_ioctl_ops, then you should set either .unlocked_ioctl or
464The v4l2_file_operations struct is a subset of file_operations. The main 473The v4l2_file_operations struct is a subset of file_operations. The main
465difference is that the inode argument is omitted since it is never used. 474difference is that the inode argument is omitted since it is never used.
466 475
476v4l2_file_operations and locking
477--------------------------------
478
479You can set a pointer to a mutex_lock in struct video_device. Usually this
480will be either a top-level mutex or a mutex per device node. If you want
481finer-grained locking then you have to set it to NULL and do you own locking.
482
483If a lock is specified then all file operations will be serialized on that
484lock. If you use videobuf then you must pass the same lock to the videobuf
485queue initialize function: if videobuf has to wait for a frame to arrive, then
486it will temporarily unlock the lock and relock it afterwards. If your driver
487also waits in the code, then you should do the same to allow other processes
488to access the device node while the first process is waiting for something.
489
490The implementation of a hotplug disconnect should also take the lock before
491calling v4l2_device_disconnect.
467 492
468video_device registration 493video_device registration
469------------------------- 494-------------------------
@@ -483,7 +508,6 @@ types exist:
483VFL_TYPE_GRABBER: videoX for video input/output devices 508VFL_TYPE_GRABBER: videoX for video input/output devices
484VFL_TYPE_VBI: vbiX for vertical blank data (i.e. closed captions, teletext) 509VFL_TYPE_VBI: vbiX for vertical blank data (i.e. closed captions, teletext)
485VFL_TYPE_RADIO: radioX for radio tuners 510VFL_TYPE_RADIO: radioX for radio tuners
486VFL_TYPE_VTX: vtxX for teletext devices (deprecated, don't use)
487 511
488The last argument gives you a certain amount of control over the device 512The last argument gives you a certain amount of control over the device
489device node number used (i.e. the X in videoX). Normally you will pass -1 513device node number used (i.e. the X in videoX). Normally you will pass -1
@@ -547,9 +571,8 @@ from /dev).
547 571
548After video_unregister_device() returns no new opens can be done. However, 572After video_unregister_device() returns no new opens can be done. However,
549in the case of USB devices some application might still have one of these 573in the case of USB devices some application might still have one of these
550device nodes open. So after the unregister all file operations will return 574device nodes open. So after the unregister all file operations (except
551an error as well, except for the ioctl and unlocked_ioctl file operations: 575release, of course) will return an error as well.
552those will still be passed on since some buffer ioctls may still be needed.
553 576
554When the last user of the video device node exits, then the vdev->release() 577When the last user of the video device node exits, then the vdev->release()
555callback is called and you can do the final cleanup there. 578callback is called and you can do the final cleanup there.