aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/video4linux
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /Documentation/video4linux
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'Documentation/video4linux')
-rw-r--r--Documentation/video4linux/CARDLIST.cx881
-rw-r--r--Documentation/video4linux/CARDLIST.em28xx11
-rw-r--r--Documentation/video4linux/CARDLIST.saa71344
-rw-r--r--Documentation/video4linux/Makefile8
-rw-r--r--Documentation/video4linux/README.cpia191
-rw-r--r--Documentation/video4linux/README.ivtv3
-rw-r--r--Documentation/video4linux/README.pvrusb22
-rw-r--r--Documentation/video4linux/Zoran75
-rw-r--r--Documentation/video4linux/bttv/Cards4
-rw-r--r--Documentation/video4linux/bttv/Insmod-options2
-rw-r--r--Documentation/video4linux/bttv/MAKEDEV1
-rw-r--r--Documentation/video4linux/bttv/README2
-rw-r--r--Documentation/video4linux/bttv/README.freeze2
-rw-r--r--Documentation/video4linux/bttv/Sound-FAQ4
-rw-r--r--Documentation/video4linux/et61x251.txt4
-rw-r--r--Documentation/video4linux/gspca.txt14
-rw-r--r--Documentation/video4linux/meye.txt10
-rw-r--r--Documentation/video4linux/omap3isp.txt278
-rw-r--r--Documentation/video4linux/pxa_camera.txt8
-rw-r--r--Documentation/video4linux/sh_mobile_ceu_camera.txt6
-rw-r--r--Documentation/video4linux/sn9c102.txt4
-rw-r--r--Documentation/video4linux/uvcvideo.txt239
-rw-r--r--Documentation/video4linux/v4l2-controls.txt12
-rw-r--r--Documentation/video4linux/v4l2-framework.txt304
-rw-r--r--Documentation/video4linux/v4lgrab.c201
-rw-r--r--Documentation/video4linux/videobuf7
-rw-r--r--Documentation/video4linux/w9968cf.txt2
-rw-r--r--Documentation/video4linux/zc0301.txt6
28 files changed, 840 insertions, 565 deletions
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..9aae449440dc 100644
--- a/Documentation/video4linux/CARDLIST.em28xx
+++ b/Documentation/video4linux/CARDLIST.em28xx
@@ -1,5 +1,5 @@
1 0 -> Unknown EM2800 video grabber (em2800) [eb1a:2800] 1 0 -> Unknown EM2800 video grabber (em2800) [eb1a:2800]
2 1 -> Unknown EM2750/28xx video grabber (em2820/em2840) [eb1a:2710,eb1a:2820,eb1a:2821,eb1a:2860,eb1a:2861,eb1a:2862,eb1a:2863,eb1a:2870,eb1a:2881,eb1a:2883,eb1a:2868] 2 1 -> Unknown EM2750/28xx video grabber (em2820/em2840) [eb1a:2710,eb1a:2820,eb1a:2821,eb1a:2860,eb1a:2861,eb1a:2862,eb1a:2863,eb1a:2870,eb1a:2881,eb1a:2883,eb1a:2868,eb1a:2875]
3 2 -> Terratec Cinergy 250 USB (em2820/em2840) [0ccd:0036] 3 2 -> Terratec Cinergy 250 USB (em2820/em2840) [0ccd:0036]
4 3 -> Pinnacle PCTV USB 2 (em2820/em2840) [2304:0208] 4 3 -> Pinnacle PCTV USB 2 (em2820/em2840) [2304:0208]
5 4 -> Hauppauge WinTV USB 2 (em2820/em2840) [2040:4200,2040:4201] 5 4 -> Hauppauge WinTV USB 2 (em2820/em2840) [2040:4200,2040:4201]
@@ -9,7 +9,7 @@
9 8 -> Kworld USB2800 (em2800) 9 8 -> Kworld USB2800 (em2800)
10 9 -> Pinnacle Dazzle DVC 90/100/101/107 / Kaiser Baas Video to DVD maker (em2820/em2840) [1b80:e302,1b80:e304,2304:0207,2304:021a] 10 9 -> Pinnacle Dazzle DVC 90/100/101/107 / Kaiser Baas Video to DVD maker (em2820/em2840) [1b80:e302,1b80:e304,2304:0207,2304:021a]
11 10 -> Hauppauge WinTV HVR 900 (em2880) [2040:6500] 11 10 -> Hauppauge WinTV HVR 900 (em2880) [2040:6500]
12 11 -> Terratec Hybrid XS (em2880) [0ccd:0042] 12 11 -> Terratec Hybrid XS (em2880)
13 12 -> Kworld PVR TV 2800 RF (em2820/em2840) 13 12 -> Kworld PVR TV 2800 RF (em2820/em2840)
14 13 -> Terratec Prodigy XS (em2880) [0ccd:0047] 14 13 -> Terratec Prodigy XS (em2880) [0ccd:0047]
15 14 -> SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0 (em2820/em2840) 15 14 -> SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0 (em2820/em2840)
@@ -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,15 +46,15 @@
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]
52 52 -> DNT DA2 Hybrid (em2881) 53 52 -> DNT DA2 Hybrid (em2881)
53 53 -> Pinnacle Hybrid Pro (em2881) 54 53 -> Pinnacle Hybrid Pro (em2881)
54 54 -> Kworld VS-DVB-T 323UR (em2882) [eb1a:e323] 55 54 -> Kworld VS-DVB-T 323UR (em2882) [eb1a:e323]
55 55 -> Terratec Hybrid XS (em2882) (em2882) [0ccd:005e] 56 55 -> Terratec Cinnergy Hybrid T USB XS (em2882) (em2882) [0ccd:005e,0ccd:0042]
56 56 -> Pinnacle Hybrid Pro (2) (em2882) [2304:0226] 57 56 -> Pinnacle Hybrid Pro (330e) (em2882) [2304:0226]
57 57 -> Kworld PlusTV HD Hybrid 330 (em2883) [eb1a:a316] 58 57 -> Kworld PlusTV HD Hybrid 330 (em2883) [eb1a:a316]
58 58 -> Compro VideoMate ForYou/Stereo (em2820/em2840) [185b:2041] 59 58 -> Compro VideoMate ForYou/Stereo (em2820/em2840) [185b:2041]
59 60 -> Hauppauge WinTV HVR 850 (em2883) [2040:651f] 60 60 -> Hauppauge WinTV HVR 850 (em2883) [2040:651f]
diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134
index 4000c29fcfb6..6b4c72d8862d 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]
@@ -180,3 +180,5 @@
180179 -> Beholder BeholdTV A7 [5ace:7090] 180179 -> Beholder BeholdTV A7 [5ace:7090]
181180 -> Avermedia PCI M733A [1461:4155,1461:4255] 181180 -> Avermedia PCI M733A [1461:4155,1461:4255]
182181 -> TechoTrend TT-budget T-3000 [13c2:2804] 182181 -> TechoTrend TT-budget T-3000 [13c2:2804]
183182 -> Kworld PCI SBTVD/ISDB-T Full-Seg Hybrid [17de:b136]
184183 -> Compro VideoMate Vista M1F [185b:c900]
diff --git a/Documentation/video4linux/Makefile b/Documentation/video4linux/Makefile
deleted file mode 100644
index 1ed0e98d057d..000000000000
--- a/Documentation/video4linux/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
1# kbuild trick to avoid linker error. Can be omitted if a module is built.
2obj- := dummy.o
3
4# List of programs to build
5hostprogs-y := v4lgrab
6
7# Tell kbuild to always build the programs
8always := $(hostprogs-y)
diff --git a/Documentation/video4linux/README.cpia b/Documentation/video4linux/README.cpia
deleted file mode 100644
index 8a747fee661f..000000000000
--- a/Documentation/video4linux/README.cpia
+++ /dev/null
@@ -1,191 +0,0 @@
1This is a driver for the CPiA PPC2 driven parallel connected
2Camera. For example the Creative WebcamII is CPiA driven.
3
4 ) [1]Peter Pregler, Linz 2000, published under the [2]GNU GPL
5
6---------------------------------------------------------------------------
7
8USAGE:
9
10General:
11========
12
131) Make sure you have created the video devices (/dev/video*):
14
15- if you have a recent MAKEDEV do a 'cd /dev;./MAKEDEV video'
16- otherwise do a:
17
18cd /dev
19mknod video0 c 81 0
20ln -s video0 video
21
222) Compile the kernel (see below for the list of options to use),
23 configure your parport and reboot.
24
253) If all worked well you should get messages similar
26 to the following (your versions may be different) on the console:
27
28V4L-Driver for Vision CPiA based cameras v0.7.4
29parport0: read2 timeout.
30parport0: Multimedia device, VLSI Vision Ltd PPC2
31Parallel port driver for Vision CPiA based camera
32 CPIA Version: 1.20 (2.0)
33 CPIA PnP-ID: 0553:0002:0100
34 VP-Version: 1.0 0100
35 1 camera(s) found
36
37
38As modules:
39===========
40
41Make sure you have selected the following kernel options (you can
42select all stuff as modules):
43
44The cpia-stuff is in the section 'Character devices -> Video For Linux'.
45
46CONFIG_PARPORT=m
47CONFIG_PARPORT_PC=m
48CONFIG_PARPORT_PC_FIFO=y
49CONFIG_PARPORT_1284=y
50CONFIG_VIDEO_DEV=m
51CONFIG_VIDEO_CPIA=m
52CONFIG_VIDEO_CPIA_PP=m
53
54For autoloading of all those modules you need to tell module-init-tools
55some stuff. Add the following line to your module-init-tools config-file
56(e.g. /etc/modprobe.conf or wherever your distribution does store that
57stuff):
58
59options parport_pc io=0x378 irq=7 dma=3
60alias char-major-81 cpia_pp
61
62The first line tells the dma/irq channels to use. Those _must_ match
63the settings of your BIOS. Do NOT simply use the values above. See
64Documentation/parport.txt for more information about this. The second
65line associates the video-device file with the driver. Of cause you
66can also load the modules once upon boot (usually done in /etc/modules).
67
68Linked into the kernel:
69=======================
70
71Make sure you have selected the following kernel options. Note that
72you cannot compile the parport-stuff as modules and the cpia-driver
73statically (the other way round is okay though).
74
75The cpia-stuff is in the section 'Character devices -> Video For Linux'.
76
77CONFIG_PARPORT=y
78CONFIG_PARPORT_PC=y
79CONFIG_PARPORT_PC_FIFO=y
80CONFIG_PARPORT_1284=y
81CONFIG_VIDEO_DEV=y
82CONFIG_VIDEO_CPIA=y
83CONFIG_VIDEO_CPIA_PP=y
84
85To use DMA/irq you will need to tell the kernel upon boot time the
86hardware configuration of the parport. You can give the boot-parameter
87at the LILO-prompt or specify it in lilo.conf. I use the following
88append-line in lilo.conf:
89
90 append="parport=0x378,7,3"
91
92See Documentation/parport.txt for more information about the
93configuration of the parport and the values given above. Do not simply
94use the values given above.
95
96---------------------------------------------------------------------------
97FEATURES:
98
99- mmap/read v4l-interface (but no overlay)
100- image formats: CIF/QCIF, SIF/QSIF, various others used by isabel;
101 note: all sizes except CIF/QCIF are implemented by clipping, i.e.
102 pixels are not uploaded from the camera
103- palettes: VIDEO_PALETTE_GRAY, VIDEO_PALETTE_RGB565, VIDEO_PALETTE_RGB555,
104 VIDEO_PALETTE_RGB24, VIDEO_PALETTE_RGB32, VIDEO_PALETTE_YUYV,
105 VIDEO_PALETTE_UYVY, VIDEO_PALETTE_YUV422
106- state information (color balance, exposure, ...) is preserved between
107 device opens
108- complete control over camera via proc-interface (_all_ camera settings are
109 supported), there is also a python-gtk application available for this [3]
110- works under SMP (but the driver is completely serialized and synchronous)
111 so you get no benefit from SMP, but at least it does not crash your box
112- might work for non-Intel architecture, let us know about this
113
114---------------------------------------------------------------------------
115TESTED APPLICATIONS:
116
117- a simple test application based on Xt is available at [3]
118- another test-application based on gqcam-0.4 (uses GTK)
119- gqcam-0.6 should work
120- xawtv-3.x (also the webcam software)
121- xawtv-2.46
122- w3cam (cgi-interface and vidcat, e.g. you may try out 'vidcat |xv
123 -maxpect -root -quit +noresetroot -rmode 5 -')
124- vic, the MBONE video conferencing tool (version 2.8ucl4-1)
125- isabel 3R4beta (barely working, but AFAICT all the problems are on
126 their side)
127- camserv-0.40
128
129See [3] for pointers to v4l-applications.
130
131---------------------------------------------------------------------------
132KNOWN PROBLEMS:
133
134- some applications do not handle the image format correctly, you will
135 see strange horizontal stripes instead of a nice picture -> make sure
136 your application does use a supported image size or queries the driver
137 for the actually used size (reason behind this: the camera cannot
138 provide any image format, so if size NxM is requested the driver will
139 use a format to the closest fitting N1xM1, the application should now
140 query for this granted size, most applications do not).
141- all the todo ;)
142- if there is not enough light and the picture is too dark try to
143 adjust the SetSensorFPS setting, automatic frame rate adjustment
144 has its price
145- do not try out isabel 3R4beta (built 135), you will be disappointed
146
147---------------------------------------------------------------------------
148TODO:
149
150- multiple camera support (struct camera or something) - This should work,
151 but hasn't been tested yet.
152- architecture independence?
153- SMP-safe asynchronous mmap interface
154- nibble mode for old parport interfaces
155- streaming capture, this should give a performance gain
156
157---------------------------------------------------------------------------
158IMPLEMENTATION NOTES:
159
160The camera can act in two modes, streaming or grabbing. Right now a
161polling grab-scheme is used. Maybe interrupt driven streaming will be
162used for a asynchronous mmap interface in the next major release of the
163driver. This might give a better frame rate.
164
165---------------------------------------------------------------------------
166THANKS (in no particular order):
167
168- Scott J. Bertin <sbertin@mindspring.com> for cleanups, the proc-filesystem
169 and much more
170- Henry Bruce <whb@vvl.co.uk> for providing developers information about
171 the CPiA chip, I wish all companies would treat Linux as seriously
172- Karoly Erdei <Karoly.Erdei@risc.uni-linz.ac.at> and RISC-Linz for being
173 my boss ;) resp. my employer and for providing me the hardware and
174 allow me to devote some working time to this project
175- Manuel J. Petit de Gabriel <mpetit@dit.upm.es> for providing help
176 with Isabel (http://isabel.dit.upm.es/)
177- Bas Huisman <bhuism@cs.utwente.nl> for writing the initial parport code
178- Jarl Totland <Jarl.Totland@bdc.no> for setting up the mailing list
179 and maintaining the web-server[3]
180- Chris Whiteford <Chris@informinteractive.com> for fixes related to the
181 1.02 firmware
182- special kudos to all the tester whose machines crashed and/or
183 will crash. :)
184
185---------------------------------------------------------------------------
186REFERENCES
187
188 1. http://www.risc.uni-linz.ac.at/
189 mailto:Peter_Pregler@email.com
190 2. see the file COPYING in the top directory of the kernel tree
191 3. http://webcam.sourceforge.net/
diff --git a/Documentation/video4linux/README.ivtv b/Documentation/video4linux/README.ivtv
index 42b06686eb78..2579b5b709ed 100644
--- a/Documentation/video4linux/README.ivtv
+++ b/Documentation/video4linux/README.ivtv
@@ -36,8 +36,7 @@ Additional features for the PVR-350 (CX23415 based):
36 * Provides comprehensive OSD (On Screen Display: ie. graphics overlaying the 36 * Provides comprehensive OSD (On Screen Display: ie. graphics overlaying the
37 video signal) 37 video signal)
38 * Provides a framebuffer (allowing X applications to appear on the video 38 * Provides a framebuffer (allowing X applications to appear on the video
39 device) (this framebuffer is not yet part of the kernel. In the meantime it 39 device)
40 is available from www.ivtvdriver.org).
41 * Supports raw YUV output. 40 * Supports raw YUV output.
42 41
43IMPORTANT: In case of problems first read this page: 42IMPORTANT: In case of problems first read this page:
diff --git a/Documentation/video4linux/README.pvrusb2 b/Documentation/video4linux/README.pvrusb2
index a747200fe67c..2137b589276b 100644
--- a/Documentation/video4linux/README.pvrusb2
+++ b/Documentation/video4linux/README.pvrusb2
@@ -172,7 +172,7 @@ Source file list / functional overview:
172 to provide a streaming API usable by a read() system call style of 172 to provide a streaming API usable by a read() system call style of
173 I/O. Right now this is the only layer on top of pvrusb2-io.[ch], 173 I/O. Right now this is the only layer on top of pvrusb2-io.[ch],
174 however the underlying architecture here was intended to allow for 174 however the underlying architecture here was intended to allow for
175 other styles of I/O to be implemented with additonal modules, like 175 other styles of I/O to be implemented with additional modules, like
176 mmap()'ed buffers or something even more exotic. 176 mmap()'ed buffers or something even more exotic.
177 177
178 pvrusb2-main.c - This is the top level of the driver. Module level 178 pvrusb2-main.c - This is the top level of the driver. Module level
diff --git a/Documentation/video4linux/Zoran b/Documentation/video4linux/Zoran
index 00e3f9267814..9ed629d4874b 100644
--- a/Documentation/video4linux/Zoran
+++ b/Documentation/video4linux/Zoran
@@ -130,7 +130,6 @@ Card number: 4
130 130
131Note: No module for the mse3000 is available yet 131Note: No module for the mse3000 is available yet
132Note: No module for the vpx3224 is available yet 132Note: No module for the vpx3224 is available yet
133Note: use encoder=X or decoder=X for non-default i2c chips (see i2c-id.h)
134 133
135=========================== 134===========================
136 135
@@ -322,76 +321,11 @@ your IRQs and make sure the card has its own interrupts.
322 321
3234. Programming interface 3224. Programming interface
324 323
325This driver conforms to video4linux and video4linux2, both can be used to 324This driver conforms to video4linux2. Support for V4L1 and for the custom
326use the driver. Since video4linux didn't provide adequate calls to fully 325zoran ioctls has been removed in kernel 2.6.38.
327use the cards' features, we've introduced several programming extensions,
328which are currently officially accepted in the 2.4.x branch of the kernel.
329These extensions are known as the v4l/mjpeg extensions. See zoran.h for
330details (structs/ioctls).
331
332Information - video4linux:
333http://linux.bytesex.org/v4l2/API.html
334Documentation/video4linux/API.html
335/usr/include/linux/videodev.h
336
337Information - video4linux/mjpeg extensions:
338./zoran.h
339(also see below)
340
341Information - video4linux2:
342http://linuxtv.org
343http://v4l2spec.bytesex.org/
344/usr/include/linux/videodev2.h
345
346More information on the video4linux/mjpeg extensions, by Serguei
347Miridonovi and Rainer Johanni:
348--
349The ioctls for that interface are as follows:
350
351BUZIOC_G_PARAMS
352BUZIOC_S_PARAMS
353
354Get and set the parameters of the buz. The user should always do a
355BUZIOC_G_PARAMS (with a struct buz_params) to obtain the default
356settings, change what he likes and then make a BUZIOC_S_PARAMS call.
357
358BUZIOC_REQBUFS
359
360Before being able to capture/playback, the user has to request
361the buffers he is wanting to use. Fill the structure
362zoran_requestbuffers with the size (recommended: 256*1024) and
363the number (recommended 32 up to 256). There are no such restrictions
364as for the Video for Linux buffers, you should LEAVE SUFFICIENT
365MEMORY for your system however, else strange things will happen ....
366On return, the zoran_requestbuffers structure contains number and
367size of the actually allocated buffers.
368You should use these numbers for doing a mmap of the buffers
369into the user space.
370The BUZIOC_REQBUFS ioctl also makes it happen, that the next mmap
371maps the MJPEG buffer instead of the V4L buffers.
372
373BUZIOC_QBUF_CAPT
374BUZIOC_QBUF_PLAY
375
376Queue a buffer for capture or playback. The first call also starts
377streaming capture. When streaming capture is going on, you may
378only queue further buffers or issue syncs until streaming
379capture is switched off again with a argument of -1 to
380a BUZIOC_QBUF_CAPT/BUZIOC_QBUF_PLAY ioctl.
381
382BUZIOC_SYNC
383
384Issue this ioctl when all buffers are queued. This ioctl will
385block until the first buffer becomes free for saving its
386data to disk (after BUZIOC_QBUF_CAPT) or for reuse (after BUZIOC_QBUF_PLAY).
387
388BUZIOC_G_STATUS
389
390Get the status of the input lines (video source connected/norm).
391 326
392For programming example, please, look at lavrec.c and lavplay.c code in 327For programming example, please, look at lavrec.c and lavplay.c code in
393lavtools-1.2p2 package (URL: http://www.cicese.mx/) 328the MJPEG-tools (http://mjpeg.sf.net/).
394and the 'examples' directory in the original Buz driver distribution.
395 329
396Additional notes for software developers: 330Additional notes for software developers:
397 331
@@ -402,9 +336,6 @@ Additional notes for software developers:
402 standard is "more constant" for current country than geometry 336 standard is "more constant" for current country than geometry
403 settings of a variety of TV capture cards which may work in ITU or 337 settings of a variety of TV capture cards which may work in ITU or
404 square pixel format. 338 square pixel format.
405--
406Please note that lavplay/lavrec are also included in the MJPEG-tools
407(http://mjpeg.sf.net/).
408 339
409=========================== 340===========================
410 341
diff --git a/Documentation/video4linux/bttv/Cards b/Documentation/video4linux/bttv/Cards
index 12217fc49725..db833ced2cb8 100644
--- a/Documentation/video4linux/bttv/Cards
+++ b/Documentation/video4linux/bttv/Cards
@@ -464,10 +464,6 @@ Siemens
464------- 464-------
465 Multimedia eXtension Board (MXB) (SAA7146, SAA7111) 465 Multimedia eXtension Board (MXB) (SAA7146, SAA7111)
466 466
467Stradis
468-------
469 SDM275,SDM250,SDM026,SDM025 (SAA7146, IBMMPEG2): MPEG2 decoder only
470
471Powercolor 467Powercolor
472---------- 468----------
473 MTV878 469 MTV878
diff --git a/Documentation/video4linux/bttv/Insmod-options b/Documentation/video4linux/bttv/Insmod-options
index bbe3ed667d91..14c065fa23ef 100644
--- a/Documentation/video4linux/bttv/Insmod-options
+++ b/Documentation/video4linux/bttv/Insmod-options
@@ -1,5 +1,5 @@
1 1
2Note: "modinfo <module>" prints various informations about a kernel 2Note: "modinfo <module>" prints various information about a kernel
3module, among them a complete and up-to-date list of insmod options. 3module, among them a complete and up-to-date list of insmod options.
4This list tends to be outdated because it is updated manually ... 4This list tends to be outdated because it is updated manually ...
5 5
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/bttv/README b/Documentation/video4linux/bttv/README
index 3a367cdb664e..7cbf4fb6cf31 100644
--- a/Documentation/video4linux/bttv/README
+++ b/Documentation/video4linux/bttv/README
@@ -70,7 +70,7 @@ If you have trouble with some specific TV card, try to ask there
70instead of mailing me directly. The chance that someone with the 70instead of mailing me directly. The chance that someone with the
71same card listens there is much higher... 71same card listens there is much higher...
72 72
73For problems with sound: There are alot of different systems used 73For problems with sound: There are a lot of different systems used
74for TV sound all over the world. And there are also different chips 74for TV sound all over the world. And there are also different chips
75which decode the audio signal. Reports about sound problems ("stereo 75which decode the audio signal. Reports about sound problems ("stereo
76does'nt work") are pretty useless unless you include some details 76does'nt work") are pretty useless unless you include some details
diff --git a/Documentation/video4linux/bttv/README.freeze b/Documentation/video4linux/bttv/README.freeze
index 4259dccc8287..5eddfa076cfb 100644
--- a/Documentation/video4linux/bttv/README.freeze
+++ b/Documentation/video4linux/bttv/README.freeze
@@ -33,7 +33,7 @@ state is stuck.
33 33
34I've seen reports that bttv 0.7.x crashes whereas 0.8.x works rock solid 34I've seen reports that bttv 0.7.x crashes whereas 0.8.x works rock solid
35for some people. Thus probably a small buglet left somewhere in bttv 35for some people. Thus probably a small buglet left somewhere in bttv
360.7.x. I have no idea where exactly, it works stable for me and alot of 360.7.x. I have no idea where exactly, it works stable for me and a lot of
37other people. But in case you have problems with the 0.7.x versions you 37other people. But in case you have problems with the 0.7.x versions you
38can give 0.8.x a try ... 38can give 0.8.x a try ...
39 39
diff --git a/Documentation/video4linux/bttv/Sound-FAQ b/Documentation/video4linux/bttv/Sound-FAQ
index 1e6328f91083..395f6c6fdd98 100644
--- a/Documentation/video4linux/bttv/Sound-FAQ
+++ b/Documentation/video4linux/bttv/Sound-FAQ
@@ -2,13 +2,13 @@
2bttv and sound mini howto 2bttv and sound mini howto
3========================= 3=========================
4 4
5There are alot of different bt848/849/878/879 based boards available. 5There are a lot of different bt848/849/878/879 based boards available.
6Making video work often is not a big deal, because this is handled 6Making video work often is not a big deal, because this is handled
7completely by the bt8xx chip, which is common on all boards. But 7completely by the bt8xx chip, which is common on all boards. But
8sound is handled in slightly different ways on each board. 8sound is handled in slightly different ways on each board.
9 9
10To handle the grabber boards correctly, there is a array tvcards[] in 10To handle the grabber boards correctly, there is a array tvcards[] in
11bttv-cards.c, which holds the informations required for each board. 11bttv-cards.c, which holds the information required for each board.
12Sound will work only, if the correct entry is used (for video it often 12Sound will work only, if the correct entry is used (for video it often
13makes no difference). The bttv driver prints a line to the kernel 13makes no difference). The bttv driver prints a line to the kernel
14log, telling which card type is used. Like this one: 14log, telling which card type is used. Like this one:
diff --git a/Documentation/video4linux/et61x251.txt b/Documentation/video4linux/et61x251.txt
index 1247566c4de3..e0cdae491858 100644
--- a/Documentation/video4linux/et61x251.txt
+++ b/Documentation/video4linux/et61x251.txt
@@ -191,10 +191,10 @@ Syntax: <n>
191Description: Debugging information level, from 0 to 3: 191Description: Debugging information level, from 0 to 3:
192 0 = none (use carefully) 192 0 = none (use carefully)
193 1 = critical errors 193 1 = critical errors
194 2 = significant informations 194 2 = significant information
195 3 = more verbose messages 195 3 = more verbose messages
196 Level 3 is useful for testing only, when only one device 196 Level 3 is useful for testing only, when only one device
197 is used at the same time. It also shows some more informations 197 is used at the same time. It also shows some more information
198 about the hardware being detected. This module parameter can be 198 about the hardware being detected. This module parameter can be
199 changed at runtime thanks to the /sys filesystem interface. 199 changed at runtime thanks to the /sys filesystem interface.
200Default: 2 200Default: 2
diff --git a/Documentation/video4linux/gspca.txt b/Documentation/video4linux/gspca.txt
index 56ba7bba7168..5bfa9a777d26 100644
--- a/Documentation/video4linux/gspca.txt
+++ b/Documentation/video4linux/gspca.txt
@@ -103,6 +103,7 @@ spca561 046d:092d Logitech QC Elch2
103spca561 046d:092e Logitech QC Elch2 103spca561 046d:092e Logitech QC Elch2
104spca561 046d:092f Logitech QuickCam Express Plus 104spca561 046d:092f Logitech QuickCam Express Plus
105sunplus 046d:0960 Logitech ClickSmart 420 105sunplus 046d:0960 Logitech ClickSmart 420
106nw80x 046d:d001 Logitech QuickCam Pro (dark focus ring)
106sunplus 0471:0322 Philips DMVC1300K 107sunplus 0471:0322 Philips DMVC1300K
107zc3xx 0471:0325 Philips SPC 200 NC 108zc3xx 0471:0325 Philips SPC 200 NC
108zc3xx 0471:0326 Philips SPC 300 NC 109zc3xx 0471:0326 Philips SPC 300 NC
@@ -150,10 +151,12 @@ sunplus 04fc:5330 Digitrex 2110
150sunplus 04fc:5360 Sunplus Generic 151sunplus 04fc:5360 Sunplus Generic
151spca500 04fc:7333 PalmPixDC85 152spca500 04fc:7333 PalmPixDC85
152sunplus 04fc:ffff Pure DigitalDakota 153sunplus 04fc:ffff Pure DigitalDakota
154nw80x 0502:d001 DVC V6
153spca501 0506:00df 3Com HomeConnect Lite 155spca501 0506:00df 3Com HomeConnect Lite
154sunplus 052b:1507 Megapixel 5 Pretec DC-1007 156sunplus 052b:1507 Megapixel 5 Pretec DC-1007
155sunplus 052b:1513 Megapix V4 157sunplus 052b:1513 Megapix V4
156sunplus 052b:1803 MegaImage VI 158sunplus 052b:1803 MegaImage VI
159nw80x 052b:d001 EZCam Pro p35u
157tv8532 0545:808b Veo Stingray 160tv8532 0545:808b Veo Stingray
158tv8532 0545:8333 Veo Stingray 161tv8532 0545:8333 Veo Stingray
159sunplus 0546:3155 Polaroid PDC3070 162sunplus 0546:3155 Polaroid PDC3070
@@ -177,6 +180,7 @@ sunplus 055f:c530 Mustek Gsmart LCD 3
177sunplus 055f:c540 Gsmart D30 180sunplus 055f:c540 Gsmart D30
178sunplus 055f:c630 Mustek MDC4000 181sunplus 055f:c630 Mustek MDC4000
179sunplus 055f:c650 Mustek MDC5500Z 182sunplus 055f:c650 Mustek MDC5500Z
183nw80x 055f:d001 Mustek Wcam 300 mini
180zc3xx 055f:d003 Mustek WCam300A 184zc3xx 055f:d003 Mustek WCam300A
181zc3xx 055f:d004 Mustek WCam300 AN 185zc3xx 055f:d004 Mustek WCam300 AN
182conex 0572:0041 Creative Notebook cx11646 186conex 0572:0041 Creative Notebook cx11646
@@ -195,14 +199,20 @@ gl860 05e3:0503 Genesys Logic PC Camera
195gl860 05e3:f191 Genesys Logic PC Camera 199gl860 05e3:f191 Genesys Logic PC Camera
196spca561 060b:a001 Maxell Compact Pc PM3 200spca561 060b:a001 Maxell Compact Pc PM3
197zc3xx 0698:2003 CTX M730V built in 201zc3xx 0698:2003 CTX M730V built in
202nw80x 06a5:0000 Typhoon Webcam 100 USB
203nw80x 06a5:d001 Divio based webcams
204nw80x 06a5:d800 Divio Chicony TwinkleCam, Trust SpaceCam
198spca500 06bd:0404 Agfa CL20 205spca500 06bd:0404 Agfa CL20
199spca500 06be:0800 Optimedia 206spca500 06be:0800 Optimedia
207nw80x 06be:d001 EZCam Pro p35u
200sunplus 06d6:0031 Trust 610 LCD PowerC@m Zoom 208sunplus 06d6:0031 Trust 610 LCD PowerC@m Zoom
201spca506 06e1:a190 ADS Instant VCD 209spca506 06e1:a190 ADS Instant VCD
210ov534 06f8:3002 Hercules Blog Webcam
202ov534_9 06f8:3003 Hercules Dualpix HD Weblog 211ov534_9 06f8:3003 Hercules Dualpix HD Weblog
203sonixj 06f8:3004 Hercules Classic Silver 212sonixj 06f8:3004 Hercules Classic Silver
204sonixj 06f8:3008 Hercules Deluxe Optical Glass 213sonixj 06f8:3008 Hercules Deluxe Optical Glass
205pac7302 06f8:3009 Hercules Classic Link 214pac7302 06f8:3009 Hercules Classic Link
215nw80x 0728:d001 AVerMedia Camguard
206spca508 0733:0110 ViewQuest VQ110 216spca508 0733:0110 ViewQuest VQ110
207spca501 0733:0401 Intel Create and Share 217spca501 0733:0401 Intel Create and Share
208spca501 0733:0402 ViewQuest M318B 218spca501 0733:0402 ViewQuest M318B
@@ -265,6 +275,7 @@ pac7302 093a:2629 Genious iSlim 300
265pac7302 093a:262a Webcam 300k 275pac7302 093a:262a Webcam 300k
266pac7302 093a:262c Philips SPC 230 NC 276pac7302 093a:262c Philips SPC 230 NC
267jeilinj 0979:0280 Sakar 57379 277jeilinj 0979:0280 Sakar 57379
278jeilinj 0979:0280 Sportscam DV15
268zc3xx 0ac8:0302 Z-star Vimicro zc0302 279zc3xx 0ac8:0302 Z-star Vimicro zc0302
269vc032x 0ac8:0321 Vimicro generic vc0321 280vc032x 0ac8:0321 Vimicro generic vc0321
270vc032x 0ac8:0323 Vimicro Vc0323 281vc032x 0ac8:0323 Vimicro Vc0323
@@ -302,12 +313,14 @@ sonixj 0c45:60fb Surfer NoName
302sonixj 0c45:60fc LG-LIC300 313sonixj 0c45:60fc LG-LIC300
303sonixj 0c45:60fe Microdia Audio 314sonixj 0c45:60fe Microdia Audio
304sonixj 0c45:6100 PC Camera (SN9C128) 315sonixj 0c45:6100 PC Camera (SN9C128)
316sonixj 0c45:6102 PC Camera (SN9C128)
305sonixj 0c45:610a PC Camera (SN9C128) 317sonixj 0c45:610a PC Camera (SN9C128)
306sonixj 0c45:610b PC Camera (SN9C128) 318sonixj 0c45:610b PC Camera (SN9C128)
307sonixj 0c45:610c PC Camera (SN9C128) 319sonixj 0c45:610c PC Camera (SN9C128)
308sonixj 0c45:610e PC Camera (SN9C128) 320sonixj 0c45:610e PC Camera (SN9C128)
309sonixj 0c45:6128 Microdia/Sonix SNP325 321sonixj 0c45:6128 Microdia/Sonix SNP325
310sonixj 0c45:612a Avant Camera 322sonixj 0c45:612a Avant Camera
323sonixj 0c45:612b Speed-Link REFLECT2
311sonixj 0c45:612c Typhoon Rasy Cam 1.3MPix 324sonixj 0c45:612c Typhoon Rasy Cam 1.3MPix
312sonixj 0c45:6130 Sonix Pccam 325sonixj 0c45:6130 Sonix Pccam
313sonixj 0c45:6138 Sn9c120 Mo4000 326sonixj 0c45:6138 Sn9c120 Mo4000
@@ -364,6 +377,7 @@ t613 17a1:0128 TASCORP JPEG Webcam, NGS Cyclops
364vc032x 17ef:4802 Lenovo Vc0323+MI1310_SOC 377vc032x 17ef:4802 Lenovo Vc0323+MI1310_SOC
365pac207 2001:f115 D-Link DSB-C120 378pac207 2001:f115 D-Link DSB-C120
366sq905c 2770:9050 Disney pix micro (CIF) 379sq905c 2770:9050 Disney pix micro (CIF)
380sq905c 2770:9051 Lego Bionicle
367sq905c 2770:9052 Disney pix micro 2 (VGA) 381sq905c 2770:9052 Disney pix micro 2 (VGA)
368sq905c 2770:905c All 11 known cameras with this ID 382sq905c 2770:905c All 11 known cameras with this ID
369sq905 2770:9120 All 24 known cameras with this ID 383sq905 2770:9120 All 24 known cameras with this ID
diff --git a/Documentation/video4linux/meye.txt b/Documentation/video4linux/meye.txt
index bf3af5fe558f..34e2842c70ae 100644
--- a/Documentation/video4linux/meye.txt
+++ b/Documentation/video4linux/meye.txt
@@ -45,8 +45,6 @@ module argument syntax (<param>=<value> when passing the option to the
45module or meye.<param>=<value> on the kernel boot line when meye is 45module or meye.<param>=<value> on the kernel boot line when meye is
46statically linked into the kernel). Those options are: 46statically linked into the kernel). Those options are:
47 47
48 forcev4l1: force use of V4L1 API instead of V4L2
49
50 gbuffers: number of capture buffers, default is 2 (32 max) 48 gbuffers: number of capture buffers, default is 2 (32 max)
51 49
52 gbufsize: size of each capture buffer, default is 614400 50 gbufsize: size of each capture buffer, default is 614400
@@ -79,9 +77,8 @@ Usage:
79Private API: 77Private API:
80------------ 78------------
81 79
82 The driver supports frame grabbing with the video4linux API 80 The driver supports frame grabbing with the video4linux API,
83 (either v4l1 or v4l2), so all video4linux tools (like xawtv) 81 so all video4linux tools (like xawtv) should work with this driver.
84 should work with this driver.
85 82
86 Besides the video4linux interface, the driver has a private interface 83 Besides the video4linux interface, the driver has a private interface
87 for accessing the Motion Eye extended parameters (camera sharpness, 84 for accessing the Motion Eye extended parameters (camera sharpness,
@@ -123,7 +120,4 @@ Private API:
123Bugs / Todo: 120Bugs / Todo:
124------------ 121------------
125 122
126 - the driver could be much cleaned up by removing the v4l1 support.
127 However, this means all v4l1-only applications will stop working.
128
129 - 'motioneye' still uses the meye private v4l1 API extensions. 123 - 'motioneye' still uses the meye private v4l1 API extensions.
diff --git a/Documentation/video4linux/omap3isp.txt b/Documentation/video4linux/omap3isp.txt
new file mode 100644
index 000000000000..69be2c782b98
--- /dev/null
+++ b/Documentation/video4linux/omap3isp.txt
@@ -0,0 +1,278 @@
1OMAP 3 Image Signal Processor (ISP) driver
2
3Copyright (C) 2010 Nokia Corporation
4Copyright (C) 2009 Texas Instruments, Inc.
5
6Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
7 Sakari Ailus <sakari.ailus@iki.fi>
8 David Cohen <dacohen@gmail.com>
9
10
11Introduction
12============
13
14This file documents the Texas Instruments OMAP 3 Image Signal Processor (ISP)
15driver located under drivers/media/video/omap3isp. The original driver was
16written by Texas Instruments but since that it has been rewritten (twice) at
17Nokia.
18
19The driver has been successfully used on the following versions of OMAP 3:
20
21 3430
22 3530
23 3630
24
25The driver implements V4L2, Media controller and v4l2_subdev interfaces.
26Sensor, lens and flash drivers using the v4l2_subdev interface in the kernel
27are supported.
28
29
30Split to subdevs
31================
32
33The OMAP 3 ISP is split into V4L2 subdevs, each of the blocks inside the ISP
34having one subdev to represent it. Each of the subdevs provide a V4L2 subdev
35interface to userspace.
36
37 OMAP3 ISP CCP2
38 OMAP3 ISP CSI2a
39 OMAP3 ISP CCDC
40 OMAP3 ISP preview
41 OMAP3 ISP resizer
42 OMAP3 ISP AEWB
43 OMAP3 ISP AF
44 OMAP3 ISP histogram
45
46Each possible link in the ISP is modelled by a link in the Media controller
47interface. For an example program see [2].
48
49
50Controlling the OMAP 3 ISP
51==========================
52
53In general, the settings given to the OMAP 3 ISP take effect at the beginning
54of the following frame. This is done when the module becomes idle during the
55vertical blanking period on the sensor. In memory-to-memory operation the pipe
56is run one frame at a time. Applying the settings is done between the frames.
57
58All the blocks in the ISP, excluding the CSI-2 and possibly the CCP2 receiver,
59insist on receiving complete frames. Sensors must thus never send the ISP
60partial frames.
61
62Autoidle does have issues with some ISP blocks on the 3430, at least.
63Autoidle is only enabled on 3630 when the omap3isp module parameter autoidle
64is non-zero.
65
66
67Events
68======
69
70The OMAP 3 ISP driver does support the V4L2 event interface on CCDC and
71statistics (AEWB, AF and histogram) subdevs.
72
73The CCDC subdev produces V4L2_EVENT_OMAP3ISP_HS_VS type event on HS_VS
74interrupt which is used to signal frame start. The event is triggered exactly
75when the reception of the first line of the frame starts in the CCDC module.
76The event can be subscribed on the CCDC subdev.
77
78(When using parallel interface one must pay account to correct configuration
79of the VS signal polarity. This is automatically correct when using the serial
80receivers.)
81
82Each of the statistics subdevs is able to produce events. An event is
83generated whenever a statistics buffer can be dequeued by a user space
84application using the VIDIOC_OMAP3ISP_STAT_REQ IOCTL. The events available
85are:
86
87 V4L2_EVENT_OMAP3ISP_AEWB
88 V4L2_EVENT_OMAP3ISP_AF
89 V4L2_EVENT_OMAP3ISP_HIST
90
91The type of the event data is struct omap3isp_stat_event_status for these
92ioctls. If there is an error calculating the statistics, there will be an
93event as usual, but no related statistics buffer. In this case
94omap3isp_stat_event_status.buf_err is set to non-zero.
95
96
97Private IOCTLs
98==============
99
100The OMAP 3 ISP driver supports standard V4L2 IOCTLs and controls where
101possible and practical. Much of the functions provided by the ISP, however,
102does not fall under the standard IOCTLs --- gamma tables and configuration of
103statistics collection are examples of such.
104
105In general, there is a private ioctl for configuring each of the blocks
106containing hardware-dependent functions.
107
108The following private IOCTLs are supported:
109
110 VIDIOC_OMAP3ISP_CCDC_CFG
111 VIDIOC_OMAP3ISP_PRV_CFG
112 VIDIOC_OMAP3ISP_AEWB_CFG
113 VIDIOC_OMAP3ISP_HIST_CFG
114 VIDIOC_OMAP3ISP_AF_CFG
115 VIDIOC_OMAP3ISP_STAT_REQ
116 VIDIOC_OMAP3ISP_STAT_EN
117
118The parameter structures used by these ioctls are described in
119include/linux/omap3isp.h. The detailed functions of the ISP itself related to
120a given ISP block is described in the Technical Reference Manuals (TRMs) ---
121see the end of the document for those.
122
123While it is possible to use the ISP driver without any use of these private
124IOCTLs it is not possible to obtain optimal image quality this way. The AEWB,
125AF and histogram modules cannot be used without configuring them using the
126appropriate private IOCTLs.
127
128
129CCDC and preview block IOCTLs
130=============================
131
132The VIDIOC_OMAP3ISP_CCDC_CFG and VIDIOC_OMAP3ISP_PRV_CFG IOCTLs are used to
133configure, enable and disable functions in the CCDC and preview blocks,
134respectively. Both IOCTLs control several functions in the blocks they
135control. VIDIOC_OMAP3ISP_CCDC_CFG IOCTL accepts a pointer to struct
136omap3isp_ccdc_update_config as its argument. Similarly VIDIOC_OMAP3ISP_PRV_CFG
137accepts a pointer to struct omap3isp_prev_update_config. The definition of
138both structures is available in [1].
139
140The update field in the structures tells whether to update the configuration
141for the specific function and the flag tells whether to enable or disable the
142function.
143
144The update and flag bit masks accept the following values. Each separate
145functions in the CCDC and preview blocks is associated with a flag (either
146disable or enable; part of the flag field in the structure) and a pointer to
147configuration data for the function.
148
149Valid values for the update and flag fields are listed here for
150VIDIOC_OMAP3ISP_CCDC_CFG. Values may be or'ed to configure more than one
151function in the same IOCTL call.
152
153 OMAP3ISP_CCDC_ALAW
154 OMAP3ISP_CCDC_LPF
155 OMAP3ISP_CCDC_BLCLAMP
156 OMAP3ISP_CCDC_BCOMP
157 OMAP3ISP_CCDC_FPC
158 OMAP3ISP_CCDC_CULL
159 OMAP3ISP_CCDC_CONFIG_LSC
160 OMAP3ISP_CCDC_TBL_LSC
161
162The corresponding values for the VIDIOC_OMAP3ISP_PRV_CFG are here:
163
164 OMAP3ISP_PREV_LUMAENH
165 OMAP3ISP_PREV_INVALAW
166 OMAP3ISP_PREV_HRZ_MED
167 OMAP3ISP_PREV_CFA
168 OMAP3ISP_PREV_CHROMA_SUPP
169 OMAP3ISP_PREV_WB
170 OMAP3ISP_PREV_BLKADJ
171 OMAP3ISP_PREV_RGB2RGB
172 OMAP3ISP_PREV_COLOR_CONV
173 OMAP3ISP_PREV_YC_LIMIT
174 OMAP3ISP_PREV_DEFECT_COR
175 OMAP3ISP_PREV_GAMMABYPASS
176 OMAP3ISP_PREV_DRK_FRM_CAPTURE
177 OMAP3ISP_PREV_DRK_FRM_SUBTRACT
178 OMAP3ISP_PREV_LENS_SHADING
179 OMAP3ISP_PREV_NF
180 OMAP3ISP_PREV_GAMMA
181
182The associated configuration pointer for the function may not be NULL when
183enabling the function. When disabling a function the configuration pointer is
184ignored.
185
186
187Statistic blocks IOCTLs
188=======================
189
190The statistics subdevs do offer more dynamic configuration options than the
191other subdevs. They can be enabled, disable and reconfigured when the pipeline
192is in streaming state.
193
194The statistics blocks always get the input image data from the CCDC (as the
195histogram memory read isn't implemented). The statistics are dequeueable by
196the user from the statistics subdev nodes using private IOCTLs.
197
198The private IOCTLs offered by the AEWB, AF and histogram subdevs are heavily
199reflected by the register level interface offered by the ISP hardware. There
200are aspects that are purely related to the driver implementation and these are
201discussed next.
202
203VIDIOC_OMAP3ISP_STAT_EN
204-----------------------
205
206This private IOCTL enables/disables a statistic module. If this request is
207done before streaming, it will take effect as soon as the pipeline starts to
208stream. If the pipeline is already streaming, it will take effect as soon as
209the CCDC becomes idle.
210
211VIDIOC_OMAP3ISP_AEWB_CFG, VIDIOC_OMAP3ISP_HIST_CFG and VIDIOC_OMAP3ISP_AF_CFG
212-----------------------------------------------------------------------------
213
214Those IOCTLs are used to configure the modules. They require user applications
215to have an in-depth knowledge of the hardware. Most of the fields explanation
216can be found on OMAP's TRMs. The two following fields common to all the above
217configure private IOCTLs require explanation for better understanding as they
218are not part of the TRM.
219
220omap3isp_[h3a_af/h3a_aewb/hist]_config.buf_size:
221
222The modules handle their buffers internally. The necessary buffer size for the
223module's data output depends on the requested configuration. Although the
224driver supports reconfiguration while streaming, it does not support a
225reconfiguration which requires bigger buffer size than what is already
226internally allocated if the module is enabled. It will return -EBUSY on this
227case. In order to avoid such condition, either disable/reconfigure/enable the
228module or request the necessary buffer size during the first configuration
229while the module is disabled.
230
231The internal buffer size allocation considers the requested configuration's
232minimum buffer size and the value set on buf_size field. If buf_size field is
233out of [minimum, maximum] buffer size range, it's clamped to fit in there.
234The driver then selects the biggest value. The corrected buf_size value is
235written back to user application.
236
237omap3isp_[h3a_af/h3a_aewb/hist]_config.config_counter:
238
239As the configuration doesn't take effect synchronously to the request, the
240driver must provide a way to track this information to provide more accurate
241data. After a configuration is requested, the config_counter returned to user
242space application will be an unique value associated to that request. When
243user application receives an event for buffer availability or when a new
244buffer is requested, this config_counter is used to match a buffer data and a
245configuration.
246
247VIDIOC_OMAP3ISP_STAT_REQ
248------------------------
249
250Send to user space the oldest data available in the internal buffer queue and
251discards such buffer afterwards. The field omap3isp_stat_data.frame_number
252matches with the video buffer's field_count.
253
254
255Technical reference manuals (TRMs) and other documentation
256==========================================================
257
258OMAP 3430 TRM:
259<URL:http://focus.ti.com/pdfs/wtbu/OMAP34xx_ES3.1.x_PUBLIC_TRM_vZM.zip>
260Referenced 2011-03-05.
261
262OMAP 35xx TRM:
263<URL:http://www.ti.com/litv/pdf/spruf98o> Referenced 2011-03-05.
264
265OMAP 3630 TRM:
266<URL:http://focus.ti.com/pdfs/wtbu/OMAP36xx_ES1.x_PUBLIC_TRM_vQ.zip>
267Referenced 2011-03-05.
268
269DM 3730 TRM:
270<URL:http://www.ti.com/litv/pdf/sprugn4h> Referenced 2011-03-06.
271
272
273References
274==========
275
276[1] include/linux/omap3isp.h
277
278[2] http://git.ideasonboard.org/?p=media-ctl.git;a=summary
diff --git a/Documentation/video4linux/pxa_camera.txt b/Documentation/video4linux/pxa_camera.txt
index 4f6d0ca01956..51ed1578b0e8 100644
--- a/Documentation/video4linux/pxa_camera.txt
+++ b/Documentation/video4linux/pxa_camera.txt
@@ -84,12 +84,12 @@ DMA usage
84 transfer is not started. On "End Of Frame" interrupt, the irq handler 84 transfer is not started. On "End Of Frame" interrupt, the irq handler
85 starts the DMA chain. 85 starts the DMA chain.
86 - capture of one videobuffer 86 - capture of one videobuffer
87 The DMA chain starts transfering data into videobuffer RAM pages. 87 The DMA chain starts transferring data into videobuffer RAM pages.
88 When all pages are transfered, the DMA irq is raised on "ENDINTR" status 88 When all pages are transferred, the DMA irq is raised on "ENDINTR" status
89 - finishing one videobuffer 89 - finishing one videobuffer
90 The DMA irq handler marks the videobuffer as "done", and removes it from 90 The DMA irq handler marks the videobuffer as "done", and removes it from
91 the active running queue 91 the active running queue
92 Meanwhile, the next videobuffer (if there is one), is transfered by DMA 92 Meanwhile, the next videobuffer (if there is one), is transferred by DMA
93 - finishing the last videobuffer 93 - finishing the last videobuffer
94 On the DMA irq of the last videobuffer, the QCI is stopped. 94 On the DMA irq of the last videobuffer, the QCI is stopped.
95 95
@@ -101,7 +101,7 @@ DMA usage
101 101
102 This structure is pointed by dma->sg_cpu. 102 This structure is pointed by dma->sg_cpu.
103 The descriptors are used as follows : 103 The descriptors are used as follows :
104 - desc-sg[i]: i-th descriptor, transfering the i-th sg 104 - desc-sg[i]: i-th descriptor, transferring the i-th sg
105 element to the video buffer scatter gather 105 element to the video buffer scatter gather
106 - finisher: has ddadr=DADDR_STOP, dcmd=ENDIRQEN 106 - finisher: has ddadr=DADDR_STOP, dcmd=ENDIRQEN
107 - linker: has ddadr= desc-sg[0] of next video buffer, dcmd=0 107 - linker: has ddadr= desc-sg[0] of next video buffer, dcmd=0
diff --git a/Documentation/video4linux/sh_mobile_ceu_camera.txt b/Documentation/video4linux/sh_mobile_ceu_camera.txt
index cb47e723af74..1e96ce6e2d2f 100644
--- a/Documentation/video4linux/sh_mobile_ceu_camera.txt
+++ b/Documentation/video4linux/sh_mobile_ceu_camera.txt
@@ -37,7 +37,7 @@ Generic scaling / cropping scheme
37-1'- 37-1'-
38 38
39In the above chart minuses and slashes represent "real" data amounts, points and 39In the above chart minuses and slashes represent "real" data amounts, points and
40accents represent "useful" data, basically, CEU scaled amd cropped output, 40accents represent "useful" data, basically, CEU scaled and cropped output,
41mapped back onto the client's source plane. 41mapped back onto the client's source plane.
42 42
43Such a configuration can be produced by user requests: 43Such a configuration can be produced by user requests:
@@ -65,7 +65,7 @@ Do not touch input rectangle - it is already optimal.
65 65
661. Calculate current sensor scales: 661. Calculate current sensor scales:
67 67
68 scale_s = ((3') - (3)) / ((2') - (2)) 68 scale_s = ((2') - (2)) / ((3') - (3))
69 69
702. Calculate "effective" input crop (sensor subwindow) - CEU crop scaled back at 702. Calculate "effective" input crop (sensor subwindow) - CEU crop scaled back at
71current sensor scales onto input window - this is user S_CROP: 71current sensor scales onto input window - this is user S_CROP:
@@ -80,7 +80,7 @@ window:
804. Calculate sensor output window by applying combined scales to real input 804. Calculate sensor output window by applying combined scales to real input
81window: 81window:
82 82
83 width_s_out = ((2') - (2)) / scale_comb 83 width_s_out = ((7') - (7)) = ((2') - (2)) / scale_comb
84 84
855. Apply iterative sensor S_FMT for sensor output window. 855. Apply iterative sensor S_FMT for sensor output window.
86 86
diff --git a/Documentation/video4linux/sn9c102.txt b/Documentation/video4linux/sn9c102.txt
index 73de4050d637..b4f67040403a 100644
--- a/Documentation/video4linux/sn9c102.txt
+++ b/Documentation/video4linux/sn9c102.txt
@@ -214,10 +214,10 @@ Syntax: <n>
214Description: Debugging information level, from 0 to 3: 214Description: Debugging information level, from 0 to 3:
215 0 = none (use carefully) 215 0 = none (use carefully)
216 1 = critical errors 216 1 = critical errors
217 2 = significant informations 217 2 = significant information
218 3 = more verbose messages 218 3 = more verbose messages
219 Level 3 is useful for testing only. It also shows some more 219 Level 3 is useful for testing only. It also shows some more
220 informations about the hardware being detected. 220 information about the hardware being detected.
221 This parameter can be changed at runtime thanks to the /sys 221 This parameter can be changed at runtime thanks to the /sys
222 filesystem interface. 222 filesystem interface.
223Default: 2 223Default: 2
diff --git a/Documentation/video4linux/uvcvideo.txt b/Documentation/video4linux/uvcvideo.txt
new file mode 100644
index 000000000000..848d620dcc5c
--- /dev/null
+++ b/Documentation/video4linux/uvcvideo.txt
@@ -0,0 +1,239 @@
1Linux USB Video Class (UVC) driver
2==================================
3
4This file documents some driver-specific aspects of the UVC driver, such as
5driver-specific ioctls and implementation notes.
6
7Questions and remarks can be sent to the Linux UVC development mailing list at
8linux-uvc-devel@lists.berlios.de.
9
10
11Extension Unit (XU) support
12---------------------------
13
141. Introduction
15
16The UVC specification allows for vendor-specific extensions through extension
17units (XUs). The Linux UVC driver supports extension unit controls (XU controls)
18through two separate mechanisms:
19
20 - through mappings of XU controls to V4L2 controls
21 - through a driver-specific ioctl interface
22
23The first one allows generic V4L2 applications to use XU controls by mapping
24certain XU controls onto V4L2 controls, which then show up during ordinary
25control enumeration.
26
27The second mechanism requires uvcvideo-specific knowledge for the application to
28access XU controls but exposes the entire UVC XU concept to user space for
29maximum flexibility.
30
31Both mechanisms complement each other and are described in more detail below.
32
33
342. Control mappings
35
36The UVC driver provides an API for user space applications to define so-called
37control mappings at runtime. These allow for individual XU controls or byte
38ranges thereof to be mapped to new V4L2 controls. Such controls appear and
39function exactly like normal V4L2 controls (i.e. the stock controls, such as
40brightness, contrast, etc.). However, reading or writing of such a V4L2 controls
41triggers a read or write of the associated XU control.
42
43The ioctl used to create these control mappings is called UVCIOC_CTRL_MAP.
44Previous driver versions (before 0.2.0) required another ioctl to be used
45beforehand (UVCIOC_CTRL_ADD) to pass XU control information to the UVC driver.
46This is no longer necessary as newer uvcvideo versions query the information
47directly from the device.
48
49For details on the UVCIOC_CTRL_MAP ioctl please refer to the section titled
50"IOCTL reference" below.
51
52
533. Driver specific XU control interface
54
55For applications that need to access XU controls directly, e.g. for testing
56purposes, firmware upload, or accessing binary controls, a second mechanism to
57access XU controls is provided in the form of a driver-specific ioctl, namely
58UVCIOC_CTRL_QUERY.
59
60A call to this ioctl allows applications to send queries to the UVC driver that
61directly map to the low-level UVC control requests.
62
63In order to make such a request the UVC unit ID of the control's extension unit
64and the control selector need to be known. This information either needs to be
65hardcoded in the application or queried using other ways such as by parsing the
66UVC descriptor or, if available, using the media controller API to enumerate a
67device's entities.
68
69Unless the control size is already known it is necessary to first make a
70UVC_GET_LEN requests in order to be able to allocate a sufficiently large buffer
71and set the buffer size to the correct value. Similarly, to find out whether
72UVC_GET_CUR or UVC_SET_CUR are valid requests for a given control, a
73UVC_GET_INFO request should be made. The bits 0 (GET supported) and 1 (SET
74supported) of the resulting byte indicate which requests are valid.
75
76With the addition of the UVCIOC_CTRL_QUERY ioctl the UVCIOC_CTRL_GET and
77UVCIOC_CTRL_SET ioctls have become obsolete since their functionality is a
78subset of the former ioctl. For the time being they are still supported but
79application developers are encouraged to use UVCIOC_CTRL_QUERY instead.
80
81For details on the UVCIOC_CTRL_QUERY ioctl please refer to the section titled
82"IOCTL reference" below.
83
84
854. Security
86
87The API doesn't currently provide a fine-grained access control facility. The
88UVCIOC_CTRL_ADD and UVCIOC_CTRL_MAP ioctls require super user permissions.
89
90Suggestions on how to improve this are welcome.
91
92
935. Debugging
94
95In order to debug problems related to XU controls or controls in general it is
96recommended to enable the UVC_TRACE_CONTROL bit in the module parameter 'trace'.
97This causes extra output to be written into the system log.
98
99
1006. IOCTL reference
101
102---- UVCIOC_CTRL_MAP - Map a UVC control to a V4L2 control ----
103
104Argument: struct uvc_xu_control_mapping
105
106Description:
107 This ioctl creates a mapping between a UVC control or part of a UVC
108 control and a V4L2 control. Once mappings are defined, userspace
109 applications can access vendor-defined UVC control through the V4L2
110 control API.
111
112 To create a mapping, applications fill the uvc_xu_control_mapping
113 structure with information about an existing UVC control defined with
114 UVCIOC_CTRL_ADD and a new V4L2 control.
115
116 A UVC control can be mapped to several V4L2 controls. For instance,
117 a UVC pan/tilt control could be mapped to separate pan and tilt V4L2
118 controls. The UVC control is divided into non overlapping fields using
119 the 'size' and 'offset' fields and are then independantly mapped to
120 V4L2 control.
121
122 For signed integer V4L2 controls the data_type field should be set to
123 UVC_CTRL_DATA_TYPE_SIGNED. Other values are currently ignored.
124
125Return value:
126 On success 0 is returned. On error -1 is returned and errno is set
127 appropriately.
128
129 ENOMEM
130 Not enough memory to perform the operation.
131 EPERM
132 Insufficient privileges (super user privileges are required).
133 EINVAL
134 No such UVC control.
135 EOVERFLOW
136 The requested offset and size would overflow the UVC control.
137 EEXIST
138 Mapping already exists.
139
140Data types:
141 * struct uvc_xu_control_mapping
142
143 __u32 id V4L2 control identifier
144 __u8 name[32] V4L2 control name
145 __u8 entity[16] UVC extension unit GUID
146 __u8 selector UVC control selector
147 __u8 size V4L2 control size (in bits)
148 __u8 offset V4L2 control offset (in bits)
149 enum v4l2_ctrl_type
150 v4l2_type V4L2 control type
151 enum uvc_control_data_type
152 data_type UVC control data type
153 struct uvc_menu_info
154 *menu_info Array of menu entries (for menu controls only)
155 __u32 menu_count Number of menu entries (for menu controls only)
156
157 * struct uvc_menu_info
158
159 __u32 value Menu entry value used by the device
160 __u8 name[32] Menu entry name
161
162
163 * enum uvc_control_data_type
164
165 UVC_CTRL_DATA_TYPE_RAW Raw control (byte array)
166 UVC_CTRL_DATA_TYPE_SIGNED Signed integer
167 UVC_CTRL_DATA_TYPE_UNSIGNED Unsigned integer
168 UVC_CTRL_DATA_TYPE_BOOLEAN Boolean
169 UVC_CTRL_DATA_TYPE_ENUM Enumeration
170 UVC_CTRL_DATA_TYPE_BITMASK Bitmask
171
172
173---- UVCIOC_CTRL_QUERY - Query a UVC XU control ----
174
175Argument: struct uvc_xu_control_query
176
177Description:
178 This ioctl queries a UVC XU control identified by its extension unit ID
179 and control selector.
180
181 There are a number of different queries available that closely
182 correspond to the low-level control requests described in the UVC
183 specification. These requests are:
184
185 UVC_GET_CUR
186 Obtain the current value of the control.
187 UVC_GET_MIN
188 Obtain the minimum value of the control.
189 UVC_GET_MAX
190 Obtain the maximum value of the control.
191 UVC_GET_DEF
192 Obtain the default value of the control.
193 UVC_GET_RES
194 Query the resolution of the control, i.e. the step size of the
195 allowed control values.
196 UVC_GET_LEN
197 Query the size of the control in bytes.
198 UVC_GET_INFO
199 Query the control information bitmap, which indicates whether
200 get/set requests are supported.
201 UVC_SET_CUR
202 Update the value of the control.
203
204 Applications must set the 'size' field to the correct length for the
205 control. Exceptions are the UVC_GET_LEN and UVC_GET_INFO queries, for
206 which the size must be set to 2 and 1, respectively. The 'data' field
207 must point to a valid writable buffer big enough to hold the indicated
208 number of data bytes.
209
210 Data is copied directly from the device without any driver-side
211 processing. Applications are responsible for data buffer formatting,
212 including little-endian/big-endian conversion. This is particularly
213 important for the result of the UVC_GET_LEN requests, which is always
214 returned as a little-endian 16-bit integer by the device.
215
216Return value:
217 On success 0 is returned. On error -1 is returned and errno is set
218 appropriately.
219
220 ENOENT
221 The device does not support the given control or the specified
222 extension unit could not be found.
223 ENOBUFS
224 The specified buffer size is incorrect (too big or too small).
225 EINVAL
226 An invalid request code was passed.
227 EBADRQC
228 The given request is not supported by the given control.
229 EFAULT
230 The data pointer references an inaccessible memory area.
231
232Data types:
233 * struct uvc_xu_control_query
234
235 __u8 unit Extension unit ID
236 __u8 selector Control selector
237 __u8 query Request code to send to the device
238 __u16 size Control data size (in bytes)
239 __u8 *data Control value
diff --git a/Documentation/video4linux/v4l2-controls.txt b/Documentation/video4linux/v4l2-controls.txt
index 8773778d23fc..881e7f44491b 100644
--- a/Documentation/video4linux/v4l2-controls.txt
+++ b/Documentation/video4linux/v4l2-controls.txt
@@ -285,6 +285,9 @@ implement g_volatile_ctrl like this:
285The 'new value' union is not used in g_volatile_ctrl. In general controls 285The 'new value' union is not used in g_volatile_ctrl. In general controls
286that need to implement g_volatile_ctrl are read-only controls. 286that need to implement g_volatile_ctrl are read-only controls.
287 287
288Note that if one or more controls in a control cluster are marked as volatile,
289then all the controls in the cluster are seen as volatile.
290
288To mark a control as volatile you have to set the is_volatile flag: 291To mark a control as volatile you have to set the is_volatile flag:
289 292
290 ctrl = v4l2_ctrl_new_std(&sd->ctrl_handler, ...); 293 ctrl = v4l2_ctrl_new_std(&sd->ctrl_handler, ...);
@@ -462,6 +465,15 @@ pointer to the v4l2_ctrl_ops struct that is used for that cluster.
462Obviously, all controls in the cluster array must be initialized to either 465Obviously, all controls in the cluster array must be initialized to either
463a valid control or to NULL. 466a valid control or to NULL.
464 467
468In rare cases you might want to know which controls of a cluster actually
469were set explicitly by the user. For this you can check the 'is_new' flag of
470each control. For example, in the case of a volume/mute cluster the 'is_new'
471flag of the mute control would be set if the user called VIDIOC_S_CTRL for
472mute only. If the user would call VIDIOC_S_EXT_CTRLS for both mute and volume
473controls, then the 'is_new' flag would be 1 for both controls.
474
475The 'is_new' flag is always 1 when called from v4l2_ctrl_handler_setup().
476
465 477
466VIDIOC_LOG_STATUS Support 478VIDIOC_LOG_STATUS Support
467========================= 479=========================
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt
index e831aaca66f8..cf21f7aae976 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
@@ -71,6 +71,10 @@ sub-device instances, the video_device struct stores V4L2 device node data
71and in the future a v4l2_fh struct will keep track of filehandle instances 71and in the future a v4l2_fh struct will keep track of filehandle instances
72(this is not yet implemented). 72(this is not yet implemented).
73 73
74The V4L2 framework also optionally integrates with the media framework. If a
75driver sets the struct v4l2_device mdev field, sub-devices and video nodes
76will automatically appear in the media framework as entities.
77
74 78
75struct v4l2_device 79struct v4l2_device
76------------------ 80------------------
@@ -83,11 +87,20 @@ You must register the device instance:
83 87
84 v4l2_device_register(struct device *dev, struct v4l2_device *v4l2_dev); 88 v4l2_device_register(struct device *dev, struct v4l2_device *v4l2_dev);
85 89
86Registration will initialize the v4l2_device struct and link dev->driver_data 90Registration will initialize the v4l2_device struct. If the dev->driver_data
87to v4l2_dev. If v4l2_dev->name is empty then it will be set to a value derived 91field is NULL, it will be linked to v4l2_dev.
88from dev (driver name followed by the bus_id, to be precise). If you set it 92
89up before calling v4l2_device_register then it will be untouched. If dev is 93Drivers that want integration with the media device framework need to set
90NULL, then you *must* setup v4l2_dev->name before calling v4l2_device_register. 94dev->driver_data manually to point to the driver-specific device structure
95that embed the struct v4l2_device instance. This is achieved by a
96dev_set_drvdata() call before registering the V4L2 device instance. They must
97also set the struct v4l2_device mdev field to point to a properly initialized
98and registered media_device instance.
99
100If v4l2_dev->name is empty then it will be set to a value derived from dev
101(driver name followed by the bus_id, to be precise). If you set it up before
102calling v4l2_device_register then it will be untouched. If dev is NULL, then
103you *must* setup v4l2_dev->name before calling v4l2_device_register.
91 104
92You can use v4l2_device_set_name() to set the name based on a driver name and 105You can use v4l2_device_set_name() to set the name based on a driver name and
93a driver-global atomic_t instance. This will generate names like ivtv0, ivtv1, 106a driver-global atomic_t instance. This will generate names like ivtv0, ivtv1,
@@ -108,6 +121,7 @@ You unregister with:
108 121
109 v4l2_device_unregister(struct v4l2_device *v4l2_dev); 122 v4l2_device_unregister(struct v4l2_device *v4l2_dev);
110 123
124If the dev->driver_data field points to v4l2_dev, it will be reset to NULL.
111Unregistering will also automatically unregister all subdevs from the device. 125Unregistering will also automatically unregister all subdevs from the device.
112 126
113If you have a hotpluggable device (e.g. a USB device), then when a disconnect 127If you have a hotpluggable device (e.g. a USB device), then when a disconnect
@@ -167,6 +181,21 @@ static int __devinit drv_probe(struct pci_dev *pdev,
167 state->instance = atomic_inc_return(&drv_instance) - 1; 181 state->instance = atomic_inc_return(&drv_instance) - 1;
168} 182}
169 183
184If you have multiple device nodes then it can be difficult to know when it is
185safe to unregister v4l2_device. For this purpose v4l2_device has refcounting
186support. The refcount is increased whenever video_register_device is called and
187it is decreased whenever that device node is released. When the refcount reaches
188zero, then the v4l2_device release() callback is called. You can do your final
189cleanup there.
190
191If other device nodes (e.g. ALSA) are created, then you can increase and
192decrease the refcount manually as well by calling:
193
194void v4l2_device_get(struct v4l2_device *v4l2_dev);
195
196or:
197
198int v4l2_device_put(struct v4l2_device *v4l2_dev);
170 199
171struct v4l2_subdev 200struct v4l2_subdev
172------------------ 201------------------
@@ -192,6 +221,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 221common 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. 222v4l2_subdev pointer, for other busses you may have to use other methods.
194 223
224Bridges might also need to store per-subdev private data, such as a pointer to
225bridge-specific per-subdev private data. The v4l2_subdev structure provides
226host private data for that purpose that can be accessed with
227v4l2_get_subdev_hostdata() and v4l2_set_subdev_hostdata().
228
195From the bridge driver perspective you load the sub-device module and somehow 229From 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 230obtain the v4l2_subdev pointer. For i2c devices this is easy: you call
197i2c_get_clientdata(). For other busses something similar needs to be done. 231i2c_get_clientdata(). For other busses something similar needs to be done.
@@ -249,6 +283,26 @@ A sub-device driver initializes the v4l2_subdev struct using:
249Afterwards you need to initialize subdev->name with a unique name and set the 283Afterwards you need to initialize subdev->name with a unique name and set the
250module owner. This is done for you if you use the i2c helper functions. 284module owner. This is done for you if you use the i2c helper functions.
251 285
286If integration with the media framework is needed, you must initialize the
287media_entity struct embedded in the v4l2_subdev struct (entity field) by
288calling media_entity_init():
289
290 struct media_pad *pads = &my_sd->pads;
291 int err;
292
293 err = media_entity_init(&sd->entity, npads, pads, 0);
294
295The pads array must have been previously initialized. There is no need to
296manually set the struct media_entity type and name fields, but the revision
297field must be initialized if needed.
298
299A reference to the entity will be automatically acquired/released when the
300subdev device node (if any) is opened/closed.
301
302Don't forget to cleanup the media entity before the sub-device is destroyed:
303
304 media_entity_cleanup(&sd->entity);
305
252A device (bridge) driver needs to register the v4l2_subdev with the 306A device (bridge) driver needs to register the v4l2_subdev with the
253v4l2_device: 307v4l2_device:
254 308
@@ -258,6 +312,9 @@ This can fail if the subdev module disappeared before it could be registered.
258After this function was called successfully the subdev->dev field points to 312After this function was called successfully the subdev->dev field points to
259the v4l2_device. 313the v4l2_device.
260 314
315If the v4l2_device parent device has a non-NULL mdev field, the sub-device
316entity will be automatically registered with the media device.
317
261You can unregister a sub-device using: 318You can unregister a sub-device using:
262 319
263 v4l2_device_unregister_subdev(sd); 320 v4l2_device_unregister_subdev(sd);
@@ -286,7 +343,7 @@ ignored. If you want to check for errors use this:
286 err = v4l2_device_call_until_err(v4l2_dev, 0, core, g_chip_ident, &chip); 343 err = v4l2_device_call_until_err(v4l2_dev, 0, core, g_chip_ident, &chip);
287 344
288Any error except -ENOIOCTLCMD will exit the loop with that error. If no 345Any error except -ENOIOCTLCMD will exit the loop with that error. If no
289errors (except -ENOIOCTLCMD) occured, then 0 is returned. 346errors (except -ENOIOCTLCMD) occurred, then 0 is returned.
290 347
291The second argument to both calls is a group ID. If 0, then all subdevs are 348The second argument to both calls is a group ID. If 0, then all subdevs are
292called. If non-zero, then only those whose group ID match that value will 349called. If non-zero, then only those whose group ID match that value will
@@ -314,6 +371,61 @@ controlled through GPIO pins. This distinction is only relevant when setting
314up the device, but once the subdev is registered it is completely transparent. 371up the device, but once the subdev is registered it is completely transparent.
315 372
316 373
374V4L2 sub-device userspace API
375-----------------------------
376
377Beside exposing a kernel API through the v4l2_subdev_ops structure, V4L2
378sub-devices can also be controlled directly by userspace applications.
379
380Device nodes named v4l-subdevX can be created in /dev to access sub-devices
381directly. If a sub-device supports direct userspace configuration it must set
382the V4L2_SUBDEV_FL_HAS_DEVNODE flag before being registered.
383
384After registering sub-devices, the v4l2_device driver can create device nodes
385for all registered sub-devices marked with V4L2_SUBDEV_FL_HAS_DEVNODE by calling
386v4l2_device_register_subdev_nodes(). Those device nodes will be automatically
387removed when sub-devices are unregistered.
388
389The device node handles a subset of the V4L2 API.
390
391VIDIOC_QUERYCTRL
392VIDIOC_QUERYMENU
393VIDIOC_G_CTRL
394VIDIOC_S_CTRL
395VIDIOC_G_EXT_CTRLS
396VIDIOC_S_EXT_CTRLS
397VIDIOC_TRY_EXT_CTRLS
398
399 The controls ioctls are identical to the ones defined in V4L2. They
400 behave identically, with the only exception that they deal only with
401 controls implemented in the sub-device. Depending on the driver, those
402 controls can be also be accessed through one (or several) V4L2 device
403 nodes.
404
405VIDIOC_DQEVENT
406VIDIOC_SUBSCRIBE_EVENT
407VIDIOC_UNSUBSCRIBE_EVENT
408
409 The events ioctls are identical to the ones defined in V4L2. They
410 behave identically, with the only exception that they deal only with
411 events generated by the sub-device. Depending on the driver, those
412 events can also be reported by one (or several) V4L2 device nodes.
413
414 Sub-device drivers that want to use events need to set the
415 V4L2_SUBDEV_USES_EVENTS v4l2_subdev::flags and initialize
416 v4l2_subdev::nevents to events queue depth before registering the
417 sub-device. After registration events can be queued as usual on the
418 v4l2_subdev::devnode device node.
419
420 To properly support events, the poll() file operation is also
421 implemented.
422
423Private ioctls
424
425 All ioctls not in the above list are passed directly to the sub-device
426 driver through the core::ioctl operation.
427
428
317I2C sub-device drivers 429I2C sub-device drivers
318---------------------- 430----------------------
319 431
@@ -448,6 +560,14 @@ You should also set these fields:
448- ioctl_ops: if you use the v4l2_ioctl_ops to simplify ioctl maintenance 560- 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 561 (highly recommended to use this and it might become compulsory in the
450 future!), then set this to your v4l2_ioctl_ops struct. 562 future!), then set this to your v4l2_ioctl_ops struct.
563- lock: leave to NULL if you want to do all the locking in the driver.
564 Otherwise you give it a pointer to a struct mutex_lock and before any
565 of the v4l2_file_operations is called this lock will be taken by the
566 core and released afterwards.
567- prio: keeps track of the priorities. Used to implement VIDIOC_G/S_PRIORITY.
568 If left to NULL, then it will use the struct v4l2_prio_state in v4l2_device.
569 If you want to have a separate priority state per (group of) device node(s),
570 then you can point it to your own struct v4l2_prio_state.
451- parent: you only set this if v4l2_device was registered with NULL as 571- 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 572 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. 573 device has multiple PCI devices that all share the same v4l2_device core.
@@ -457,13 +577,50 @@ You should also set these fields:
457 (cx8802). Since the v4l2_device cannot be associated with a particular 577 (cx8802). Since the v4l2_device cannot be associated with a particular
458 PCI device it is setup without a parent device. But when the struct 578 PCI device it is setup without a parent device. But when the struct
459 video_device is setup you do know which parent PCI device to use. 579 video_device is setup you do know which parent PCI device to use.
580- flags: optional. Set to V4L2_FL_USE_FH_PRIO if you want to let the framework
581 handle the VIDIOC_G/S_PRIORITY ioctls. This requires that you use struct
582 v4l2_fh. Eventually this flag will disappear once all drivers use the core
583 priority handling. But for now it has to be set explicitly.
584
585If you use v4l2_ioctl_ops, then you should set .unlocked_ioctl to video_ioctl2
586in your v4l2_file_operations struct.
460 587
461If you use v4l2_ioctl_ops, then you should set either .unlocked_ioctl or 588Do not use .ioctl! This is deprecated and will go away in the future.
462.ioctl to video_ioctl2 in your v4l2_file_operations struct.
463 589
464The v4l2_file_operations struct is a subset of file_operations. The main 590The 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. 591difference is that the inode argument is omitted since it is never used.
466 592
593If integration with the media framework is needed, you must initialize the
594media_entity struct embedded in the video_device struct (entity field) by
595calling media_entity_init():
596
597 struct media_pad *pad = &my_vdev->pad;
598 int err;
599
600 err = media_entity_init(&vdev->entity, 1, pad, 0);
601
602The pads array must have been previously initialized. There is no need to
603manually set the struct media_entity type and name fields.
604
605A reference to the entity will be automatically acquired/released when the
606video device is opened/closed.
607
608v4l2_file_operations and locking
609--------------------------------
610
611You can set a pointer to a mutex_lock in struct video_device. Usually this
612will be either a top-level mutex or a mutex per device node. If you want
613finer-grained locking then you have to set it to NULL and do you own locking.
614
615If a lock is specified then all file operations will be serialized on that
616lock. If you use videobuf then you must pass the same lock to the videobuf
617queue initialize function: if videobuf has to wait for a frame to arrive, then
618it will temporarily unlock the lock and relock it afterwards. If your driver
619also waits in the code, then you should do the same to allow other processes
620to access the device node while the first process is waiting for something.
621
622The implementation of a hotplug disconnect should also take the lock before
623calling v4l2_device_disconnect.
467 624
468video_device registration 625video_device registration
469------------------------- 626-------------------------
@@ -477,13 +634,15 @@ for you.
477 return err; 634 return err;
478 } 635 }
479 636
637If the v4l2_device parent device has a non-NULL mdev field, the video device
638entity will be automatically registered with the media device.
639
480Which device is registered depends on the type argument. The following 640Which device is registered depends on the type argument. The following
481types exist: 641types exist:
482 642
483VFL_TYPE_GRABBER: videoX for video input/output devices 643VFL_TYPE_GRABBER: videoX for video input/output devices
484VFL_TYPE_VBI: vbiX for vertical blank data (i.e. closed captions, teletext) 644VFL_TYPE_VBI: vbiX for vertical blank data (i.e. closed captions, teletext)
485VFL_TYPE_RADIO: radioX for radio tuners 645VFL_TYPE_RADIO: radioX for radio tuners
486VFL_TYPE_VTX: vtxX for teletext devices (deprecated, don't use)
487 646
488The last argument gives you a certain amount of control over the device 647The 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 648device node number used (i.e. the X in videoX). Normally you will pass -1
@@ -547,13 +706,19 @@ from /dev).
547 706
548After video_unregister_device() returns no new opens can be done. However, 707After 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 708in 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 709device nodes open. So after the unregister all file operations (except
551an error as well, except for the ioctl and unlocked_ioctl file operations: 710release, of course) will return an error as well.
552those will still be passed on since some buffer ioctls may still be needed.
553 711
554When the last user of the video device node exits, then the vdev->release() 712When the last user of the video device node exits, then the vdev->release()
555callback is called and you can do the final cleanup there. 713callback is called and you can do the final cleanup there.
556 714
715Don't forget to cleanup the media entity associated with the video device if
716it has been initialized:
717
718 media_entity_cleanup(&vdev->entity);
719
720This can be done from the release callback.
721
557 722
558video_device helper functions 723video_device helper functions
559----------------------------- 724-----------------------------
@@ -613,39 +778,25 @@ struct v4l2_fh
613-------------- 778--------------
614 779
615struct v4l2_fh provides a way to easily keep file handle specific data 780struct v4l2_fh provides a way to easily keep file handle specific data
616that is used by the V4L2 framework. Using v4l2_fh is optional for 781that is used by the V4L2 framework. New drivers must use struct v4l2_fh
617drivers. 782since it is also used to implement priority handling (VIDIOC_G/S_PRIORITY)
783if the video_device flag V4L2_FL_USE_FH_PRIO is also set.
618 784
619The users of v4l2_fh (in the V4L2 framework, not the driver) know 785The users of v4l2_fh (in the V4L2 framework, not the driver) know
620whether a driver uses v4l2_fh as its file->private_data pointer by 786whether a driver uses v4l2_fh as its file->private_data pointer by
621testing the V4L2_FL_USES_V4L2_FH bit in video_device->flags. 787testing the V4L2_FL_USES_V4L2_FH bit in video_device->flags. This bit is
622 788set whenever v4l2_fh_init() is called.
623Useful functions:
624
625- v4l2_fh_init()
626
627 Initialise the file handle. This *MUST* be performed in the driver's
628 v4l2_file_operations->open() handler.
629
630- v4l2_fh_add()
631
632 Add a v4l2_fh to video_device file handle list. May be called after
633 initialising the file handle.
634
635- v4l2_fh_del()
636
637 Unassociate the file handle from video_device(). The file handle
638 exit function may now be called.
639 789
640- v4l2_fh_exit() 790struct v4l2_fh is allocated as a part of the driver's own file handle
791structure and file->private_data is set to it in the driver's open
792function by the driver.
641 793
642 Uninitialise the file handle. After uninitialisation the v4l2_fh 794In many cases the struct v4l2_fh will be embedded in a larger structure.
643 memory can be freed. 795In that case you should call v4l2_fh_init+v4l2_fh_add in open() and
796v4l2_fh_del+v4l2_fh_exit in release().
644 797
645struct v4l2_fh is allocated as a part of the driver's own file handle 798Drivers can extract their own file handle structure by using the container_of
646structure and is set to file->private_data in the driver's open 799macro. Example:
647function by the driver. Drivers can extract their own file handle
648structure by using the container_of macro. Example:
649 800
650struct my_fh { 801struct my_fh {
651 int blah; 802 int blah;
@@ -662,15 +813,21 @@ int my_open(struct file *file)
662 813
663 ... 814 ...
664 815
816 my_fh = kzalloc(sizeof(*my_fh), GFP_KERNEL);
817
818 ...
819
665 ret = v4l2_fh_init(&my_fh->fh, vfd); 820 ret = v4l2_fh_init(&my_fh->fh, vfd);
666 if (ret) 821 if (ret) {
822 kfree(my_fh);
667 return ret; 823 return ret;
824 }
668 825
669 v4l2_fh_add(&my_fh->fh); 826 ...
670 827
671 file->private_data = &my_fh->fh; 828 file->private_data = &my_fh->fh;
672 829 v4l2_fh_add(&my_fh->fh);
673 ... 830 return 0;
674} 831}
675 832
676int my_release(struct file *file) 833int my_release(struct file *file)
@@ -679,8 +836,65 @@ int my_release(struct file *file)
679 struct my_fh *my_fh = container_of(fh, struct my_fh, fh); 836 struct my_fh *my_fh = container_of(fh, struct my_fh, fh);
680 837
681 ... 838 ...
839 v4l2_fh_del(&my_fh->fh);
840 v4l2_fh_exit(&my_fh->fh);
841 kfree(my_fh);
842 return 0;
682} 843}
683 844
845Below is a short description of the v4l2_fh functions used:
846
847int v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev)
848
849 Initialise the file handle. This *MUST* be performed in the driver's
850 v4l2_file_operations->open() handler.
851
852void v4l2_fh_add(struct v4l2_fh *fh)
853
854 Add a v4l2_fh to video_device file handle list. Must be called once the
855 file handle is completely initialized.
856
857void v4l2_fh_del(struct v4l2_fh *fh)
858
859 Unassociate the file handle from video_device(). The file handle
860 exit function may now be called.
861
862void v4l2_fh_exit(struct v4l2_fh *fh)
863
864 Uninitialise the file handle. After uninitialisation the v4l2_fh
865 memory can be freed.
866
867
868If struct v4l2_fh is not embedded, then you can use these helper functions:
869
870int v4l2_fh_open(struct file *filp)
871
872 This allocates a struct v4l2_fh, initializes it and adds it to the struct
873 video_device associated with the file struct.
874
875int v4l2_fh_release(struct file *filp)
876
877 This deletes it from the struct video_device associated with the file
878 struct, uninitialised the v4l2_fh and frees it.
879
880These two functions can be plugged into the v4l2_file_operation's open() and
881release() ops.
882
883
884Several drivers need to do something when the first file handle is opened and
885when the last file handle closes. Two helper functions were added to check
886whether the v4l2_fh struct is the only open filehandle of the associated
887device node:
888
889int v4l2_fh_is_singular(struct v4l2_fh *fh)
890
891 Returns 1 if the file handle is the only open file handle, else 0.
892
893int v4l2_fh_is_singular_file(struct file *filp)
894
895 Same, but it calls v4l2_fh_is_singular with filp->private_data.
896
897
684V4L2 events 898V4L2 events
685----------- 899-----------
686 900
diff --git a/Documentation/video4linux/v4lgrab.c b/Documentation/video4linux/v4lgrab.c
deleted file mode 100644
index c8ded175796e..000000000000
--- a/Documentation/video4linux/v4lgrab.c
+++ /dev/null
@@ -1,201 +0,0 @@
1/* Simple Video4Linux image grabber. */
2/*
3 * Video4Linux Driver Test/Example Framegrabbing Program
4 *
5 * Compile with:
6 * gcc -s -Wall -Wstrict-prototypes v4lgrab.c -o v4lgrab
7 * Use as:
8 * v4lgrab >image.ppm
9 *
10 * Copyright (C) 1998-05-03, Phil Blundell <philb@gnu.org>
11 * Copied from http://www.tazenda.demon.co.uk/phil/vgrabber.c
12 * with minor modifications (Dave Forrest, drf5n@virginia.edu).
13 *
14 *
15 * For some cameras you may need to pre-load libv4l to perform
16 * the necessary decompression, e.g.:
17 *
18 * export LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so
19 * ./v4lgrab >image.ppm
20 *
21 * see http://hansdegoede.livejournal.com/3636.html for details.
22 *
23 */
24
25#include <unistd.h>
26#include <sys/types.h>
27#include <sys/stat.h>
28#include <fcntl.h>
29#include <stdio.h>
30#include <sys/ioctl.h>
31#include <stdlib.h>
32
33#include <linux/types.h>
34#include <linux/videodev.h>
35
36#define VIDEO_DEV "/dev/video0"
37
38/* Stole this from tvset.c */
39
40#define READ_VIDEO_PIXEL(buf, format, depth, r, g, b) \
41{ \
42 switch (format) \
43 { \
44 case VIDEO_PALETTE_GREY: \
45 switch (depth) \
46 { \
47 case 4: \
48 case 6: \
49 case 8: \
50 (r) = (g) = (b) = (*buf++ << 8);\
51 break; \
52 \
53 case 16: \
54 (r) = (g) = (b) = \
55 *((unsigned short *) buf); \
56 buf += 2; \
57 break; \
58 } \
59 break; \
60 \
61 \
62 case VIDEO_PALETTE_RGB565: \
63 { \
64 unsigned short tmp = *(unsigned short *)buf; \
65 (r) = tmp&0xF800; \
66 (g) = (tmp<<5)&0xFC00; \
67 (b) = (tmp<<11)&0xF800; \
68 buf += 2; \
69 } \
70 break; \
71 \
72 case VIDEO_PALETTE_RGB555: \
73 (r) = (buf[0]&0xF8)<<8; \
74 (g) = ((buf[0] << 5 | buf[1] >> 3)&0xF8)<<8; \
75 (b) = ((buf[1] << 2 ) & 0xF8)<<8; \
76 buf += 2; \
77 break; \
78 \
79 case VIDEO_PALETTE_RGB24: \
80 (r) = buf[0] << 8; (g) = buf[1] << 8; \
81 (b) = buf[2] << 8; \
82 buf += 3; \
83 break; \
84 \
85 default: \
86 fprintf(stderr, \
87 "Format %d not yet supported\n", \
88 format); \
89 } \
90}
91
92static int get_brightness_adj(unsigned char *image, long size, int *brightness) {
93 long i, tot = 0;
94 for (i=0;i<size*3;i++)
95 tot += image[i];
96 *brightness = (128 - tot/(size*3))/3;
97 return !((tot/(size*3)) >= 126 && (tot/(size*3)) <= 130);
98}
99
100int main(int argc, char ** argv)
101{
102 int fd = open(VIDEO_DEV, O_RDONLY), f;
103 struct video_capability cap;
104 struct video_window win;
105 struct video_picture vpic;
106
107 unsigned char *buffer, *src;
108 int bpp = 24, r = 0, g = 0, b = 0;
109 unsigned int i, src_depth = 16;
110
111 if (fd < 0) {
112 perror(VIDEO_DEV);
113 exit(1);
114 }
115
116 if (ioctl(fd, VIDIOCGCAP, &cap) < 0) {
117 perror("VIDIOGCAP");
118 fprintf(stderr, "(" VIDEO_DEV " not a video4linux device?)\n");
119 close(fd);
120 exit(1);
121 }
122
123 if (ioctl(fd, VIDIOCGWIN, &win) < 0) {
124 perror("VIDIOCGWIN");
125 close(fd);
126 exit(1);
127 }
128
129 if (ioctl(fd, VIDIOCGPICT, &vpic) < 0) {
130 perror("VIDIOCGPICT");
131 close(fd);
132 exit(1);
133 }
134
135 if (cap.type & VID_TYPE_MONOCHROME) {
136 vpic.depth=8;
137 vpic.palette=VIDEO_PALETTE_GREY; /* 8bit grey */
138 if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) {
139 vpic.depth=6;
140 if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) {
141 vpic.depth=4;
142 if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) {
143 fprintf(stderr, "Unable to find a supported capture format.\n");
144 close(fd);
145 exit(1);
146 }
147 }
148 }
149 } else {
150 vpic.depth=24;
151 vpic.palette=VIDEO_PALETTE_RGB24;
152
153 if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) {
154 vpic.palette=VIDEO_PALETTE_RGB565;
155 vpic.depth=16;
156
157 if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) {
158 vpic.palette=VIDEO_PALETTE_RGB555;
159 vpic.depth=15;
160
161 if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) {
162 fprintf(stderr, "Unable to find a supported capture format.\n");
163 return -1;
164 }
165 }
166 }
167 }
168
169 buffer = malloc(win.width * win.height * bpp);
170 if (!buffer) {
171 fprintf(stderr, "Out of memory.\n");
172 exit(1);
173 }
174
175 do {
176 int newbright;
177 read(fd, buffer, win.width * win.height * bpp);
178 f = get_brightness_adj(buffer, win.width * win.height, &newbright);
179 if (f) {
180 vpic.brightness += (newbright << 8);
181 if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) {
182 perror("VIDIOSPICT");
183 break;
184 }
185 }
186 } while (f);
187
188 fprintf(stdout, "P6\n%d %d 255\n", win.width, win.height);
189
190 src = buffer;
191
192 for (i = 0; i < win.width * win.height; i++) {
193 READ_VIDEO_PIXEL(src, vpic.palette, src_depth, r, g, b);
194 fputc(r>>8, stdout);
195 fputc(g>>8, stdout);
196 fputc(b>>8, stdout);
197 }
198
199 close(fd);
200 return 0;
201}
diff --git a/Documentation/video4linux/videobuf b/Documentation/video4linux/videobuf
index 17a1f9abf260..1d00d7f15b8f 100644
--- a/Documentation/video4linux/videobuf
+++ b/Documentation/video4linux/videobuf
@@ -247,8 +247,6 @@ calls. The relevant helper functions are:
247 int nonblocking); 247 int nonblocking);
248 int videobuf_streamon(struct videobuf_queue *q); 248 int videobuf_streamon(struct videobuf_queue *q);
249 int videobuf_streamoff(struct videobuf_queue *q); 249 int videobuf_streamoff(struct videobuf_queue *q);
250 int videobuf_cgmbuf(struct videobuf_queue *q, struct video_mbuf *mbuf,
251 int count);
252 250
253So, for example, a VIDIOC_REQBUFS call turns into a call to the driver's 251So, for example, a VIDIOC_REQBUFS call turns into a call to the driver's
254vidioc_reqbufs() callback which, in turn, usually only needs to locate the 252vidioc_reqbufs() callback which, in turn, usually only needs to locate the
@@ -258,10 +256,7 @@ boilerplate in a lot of V4L2 drivers.
258 256
259The vidioc_streamon() and vidioc_streamoff() functions will be a bit more 257The vidioc_streamon() and vidioc_streamoff() functions will be a bit more
260complex, of course, since they will also need to deal with starting and 258complex, of course, since they will also need to deal with starting and
261stopping the capture engine. videobuf_cgmbuf(), called from the driver's 259stopping the capture engine.
262vidiocgmbuf() function, only exists if the V4L1 compatibility module has
263been selected with CONFIG_VIDEO_V4L1_COMPAT, so its use must be surrounded
264with #ifdef directives.
265 260
266Buffer allocation 261Buffer allocation
267 262
diff --git a/Documentation/video4linux/w9968cf.txt b/Documentation/video4linux/w9968cf.txt
index 05138e8aea07..9649450f3b90 100644
--- a/Documentation/video4linux/w9968cf.txt
+++ b/Documentation/video4linux/w9968cf.txt
@@ -413,7 +413,7 @@ Syntax: <n>
413Description: Debugging information level, from 0 to 6: 413Description: Debugging information level, from 0 to 6:
414 0 = none (use carefully) 414 0 = none (use carefully)
415 1 = critical errors 415 1 = critical errors
416 2 = significant informations 416 2 = significant information
417 3 = configuration or general messages 417 3 = configuration or general messages
418 4 = warnings 418 4 = warnings
419 5 = called functions 419 5 = called functions
diff --git a/Documentation/video4linux/zc0301.txt b/Documentation/video4linux/zc0301.txt
index befdfdacdc5b..b41c83cf09f4 100644
--- a/Documentation/video4linux/zc0301.txt
+++ b/Documentation/video4linux/zc0301.txt
@@ -181,10 +181,10 @@ Syntax: <n>
181Description: Debugging information level, from 0 to 3: 181Description: Debugging information level, from 0 to 3:
182 0 = none (use carefully) 182 0 = none (use carefully)
183 1 = critical errors 183 1 = critical errors
184 2 = significant informations 184 2 = significant information
185 3 = more verbose messages 185 3 = more verbose messages
186 Level 3 is useful for testing only, when only one device 186 Level 3 is useful for testing only, when only one device
187 is used at the same time. It also shows some more informations 187 is used at the same time. It also shows some information
188 about the hardware being detected. This module parameter can be 188 about the hardware being detected. This module parameter can be
189 changed at runtime thanks to the /sys filesystem interface. 189 changed at runtime thanks to the /sys filesystem interface.
190Default: 2 190Default: 2
@@ -261,7 +261,7 @@ the fingerprint is: '88E8 F32F 7244 68BA 3958 5D40 99DA 5D2A FCE6 35A4'.
261 261
26211. Credits 26211. Credits
263=========== 263===========
264- Informations about the chip internals needed to enable the I2C protocol have 264- Information about the chip internals needed to enable the I2C protocol have
265 been taken from the documentation of the ZC030x Video4Linux1 driver written 265 been taken from the documentation of the ZC030x Video4Linux1 driver written
266 by Andrew Birkett <andy@nobugs.org>; 266 by Andrew Birkett <andy@nobugs.org>;
267- The initialization values of the ZC0301 controller connected to the PAS202BCB 267- The initialization values of the ZC0301 controller connected to the PAS202BCB