aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/video4linux/CARDLIST.bttv4
-rw-r--r--Documentation/video4linux/CARDLIST.cx889
-rw-r--r--Documentation/video4linux/CARDLIST.saa71341
-rw-r--r--Documentation/video4linux/CARDLIST.tuner3
-rw-r--r--Documentation/video4linux/CQcam.txt203
-rw-r--r--Documentation/video4linux/Zoran23
-rw-r--r--Documentation/video4linux/bttv/CONTRIBUTORS8
-rw-r--r--Documentation/video4linux/cx2341x/fw-calling.txt69
-rw-r--r--Documentation/video4linux/cx2341x/fw-decoder-api.txt319
-rw-r--r--Documentation/video4linux/cx2341x/fw-dma.txt94
-rw-r--r--Documentation/video4linux/cx2341x/fw-encoder-api.txt694
-rw-r--r--Documentation/video4linux/cx2341x/fw-memory.txt141
-rw-r--r--Documentation/video4linux/cx2341x/fw-osd-api.txt342
-rw-r--r--Documentation/video4linux/cx2341x/fw-upload.txt49
-rw-r--r--Documentation/video4linux/cx88/hauppauge-wintv-cx88-ir.txt54
-rw-r--r--Documentation/video4linux/et61x251.txt52
-rw-r--r--Documentation/video4linux/ibmcam.txt168
-rw-r--r--Documentation/video4linux/ov511.txt32
-rw-r--r--Documentation/video4linux/sn9c102.txt78
-rw-r--r--Documentation/video4linux/v4lgrab.c192
-rw-r--r--Documentation/video4linux/w9968cf.txt162
-rw-r--r--Documentation/video4linux/zc0301.txt80
22 files changed, 2290 insertions, 487 deletions
diff --git a/Documentation/video4linux/CARDLIST.bttv b/Documentation/video4linux/CARDLIST.bttv
index b72706c58a44..4efa4645885f 100644
--- a/Documentation/video4linux/CARDLIST.bttv
+++ b/Documentation/video4linux/CARDLIST.bttv
@@ -87,7 +87,7 @@
87 86 -> Osprey 101/151 w/ svid 87 86 -> Osprey 101/151 w/ svid
88 87 -> Osprey 200/201/250/251 88 87 -> Osprey 200/201/250/251
89 88 -> Osprey 200/250 [0070:ff01] 89 88 -> Osprey 200/250 [0070:ff01]
90 89 -> Osprey 210/220 90 89 -> Osprey 210/220/230
91 90 -> Osprey 500 [0070:ff02] 91 90 -> Osprey 500 [0070:ff02]
92 91 -> Osprey 540 [0070:ff04] 92 91 -> Osprey 540 [0070:ff04]
93 92 -> Osprey 2000 [0070:ff03] 93 92 -> Osprey 2000 [0070:ff03]
@@ -111,7 +111,7 @@
111110 -> IVC-100 [ff00:a132] 111110 -> IVC-100 [ff00:a132]
112111 -> IVC-120G [ff00:a182,ff01:a182,ff02:a182,ff03:a182,ff04:a182,ff05:a182,ff06:a182,ff07:a182,ff08:a182,ff09:a182,ff0a:a182,ff0b:a182,ff0c:a182,ff0d:a182,ff0e:a182,ff0f:a182] 112111 -> IVC-120G [ff00:a182,ff01:a182,ff02:a182,ff03:a182,ff04:a182,ff05:a182,ff06:a182,ff07:a182,ff08:a182,ff09:a182,ff0a:a182,ff0b:a182,ff0c:a182,ff0d:a182,ff0e:a182,ff0f:a182]
113112 -> pcHDTV HD-2000 TV [7063:2000] 113112 -> pcHDTV HD-2000 TV [7063:2000]
114113 -> Twinhan DST + clones [11bd:0026,1822:0001,270f:fc00] 114113 -> Twinhan DST + clones [11bd:0026,1822:0001,270f:fc00,1822:0026]
115114 -> Winfast VC100 [107d:6607] 115114 -> Winfast VC100 [107d:6607]
116115 -> Teppro TEV-560/InterVision IV-560 116115 -> Teppro TEV-560/InterVision IV-560
117116 -> SIMUS GVC1100 [aa6a:82b2] 117116 -> SIMUS GVC1100 [aa6a:82b2]
diff --git a/Documentation/video4linux/CARDLIST.cx88 b/Documentation/video4linux/CARDLIST.cx88
index 3b39a91b24bd..6cb63ddf6163 100644
--- a/Documentation/video4linux/CARDLIST.cx88
+++ b/Documentation/video4linux/CARDLIST.cx88
@@ -15,7 +15,7 @@
15 14 -> KWorld/VStream XPert DVB-T [17de:08a6] 15 14 -> KWorld/VStream XPert DVB-T [17de:08a6]
16 15 -> DViCO FusionHDTV DVB-T1 [18ac:db00] 16 15 -> DViCO FusionHDTV DVB-T1 [18ac:db00]
17 16 -> KWorld LTV883RF 17 16 -> KWorld LTV883RF
18 17 -> DViCO FusionHDTV 3 Gold-Q [18ac:d810] 18 17 -> DViCO FusionHDTV 3 Gold-Q [18ac:d810,18ac:d800]
19 18 -> Hauppauge Nova-T DVB-T [0070:9002,0070:9001] 19 18 -> Hauppauge Nova-T DVB-T [0070:9002,0070:9001]
20 19 -> Conexant DVB-T reference design [14f1:0187] 20 19 -> Conexant DVB-T reference design [14f1:0187]
21 20 -> Provideo PV259 [1540:2580] 21 20 -> Provideo PV259 [1540:2580]
@@ -40,8 +40,13 @@
40 39 -> KWorld DVB-S 100 [17de:08b2] 40 39 -> KWorld DVB-S 100 [17de:08b2]
41 40 -> Hauppauge WinTV-HVR1100 DVB-T/Hybrid [0070:9400,0070:9402] 41 40 -> Hauppauge WinTV-HVR1100 DVB-T/Hybrid [0070:9400,0070:9402]
42 41 -> Hauppauge WinTV-HVR1100 DVB-T/Hybrid (Low Profile) [0070:9800,0070:9802] 42 41 -> Hauppauge WinTV-HVR1100 DVB-T/Hybrid (Low Profile) [0070:9800,0070:9802]
43 42 -> digitalnow DNTV Live! DVB-T Pro [1822:0025] 43 42 -> digitalnow DNTV Live! DVB-T Pro [1822:0025,1822:0019]
44 43 -> KWorld/VStream XPert DVB-T with cx22702 [17de:08a1] 44 43 -> KWorld/VStream XPert DVB-T with cx22702 [17de:08a1]
45 44 -> DViCO FusionHDTV DVB-T Dual Digital [18ac:db50,18ac:db54] 45 44 -> DViCO FusionHDTV DVB-T Dual Digital [18ac:db50,18ac:db54]
46 45 -> KWorld HardwareMpegTV XPert [17de:0840] 46 45 -> KWorld HardwareMpegTV XPert [17de:0840]
47 46 -> DViCO FusionHDTV DVB-T Hybrid [18ac:db40,18ac:db44] 47 46 -> DViCO FusionHDTV DVB-T Hybrid [18ac:db40,18ac:db44]
48 47 -> pcHDTV HD5500 HDTV [7063:5500]
49 48 -> Kworld MCE 200 Deluxe [17de:0841]
50 49 -> PixelView PlayTV P7000 [1554:4813]
51 50 -> NPG Tech Real TV FM Top 10 [14f1:0842]
52 51 -> WinFast DTV2000 H [107d:665e]
diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134
index bca50903233f..9068b669f5ee 100644
--- a/Documentation/video4linux/CARDLIST.saa7134
+++ b/Documentation/video4linux/CARDLIST.saa7134
@@ -93,3 +93,4 @@
93 92 -> AVerMedia A169 B1 [1461:6360] 93 92 -> AVerMedia A169 B1 [1461:6360]
94 93 -> Medion 7134 Bridge #2 [16be:0005] 94 93 -> Medion 7134 Bridge #2 [16be:0005]
95 94 -> LifeView FlyDVB-T Hybrid Cardbus [5168:3306,5168:3502] 95 94 -> LifeView FlyDVB-T Hybrid Cardbus [5168:3306,5168:3502]
96 95 -> LifeView FlyVIDEO3000 (NTSC) [5169:0138]
diff --git a/Documentation/video4linux/CARDLIST.tuner b/Documentation/video4linux/CARDLIST.tuner
index 1bcdac67dd8c..44134f04b82a 100644
--- a/Documentation/video4linux/CARDLIST.tuner
+++ b/Documentation/video4linux/CARDLIST.tuner
@@ -62,7 +62,7 @@ tuner=60 - Thomson DTT 761X (ATSC/NTSC)
62tuner=61 - Tena TNF9533-D/IF/TNF9533-B/DF 62tuner=61 - Tena TNF9533-D/IF/TNF9533-B/DF
63tuner=62 - Philips TEA5767HN FM Radio 63tuner=62 - Philips TEA5767HN FM Radio
64tuner=63 - Philips FMD1216ME MK3 Hybrid Tuner 64tuner=63 - Philips FMD1216ME MK3 Hybrid Tuner
65tuner=64 - LG TDVS-H062F/TUA6034 65tuner=64 - LG TDVS-H06xF
66tuner=65 - Ymec TVF66T5-B/DFF 66tuner=65 - Ymec TVF66T5-B/DFF
67tuner=66 - LG TALN series 67tuner=66 - LG TALN series
68tuner=67 - Philips TD1316 Hybrid Tuner 68tuner=67 - Philips TD1316 Hybrid Tuner
@@ -71,3 +71,4 @@ tuner=69 - Tena TNF 5335 and similar models
71tuner=70 - Samsung TCPN 2121P30A 71tuner=70 - Samsung TCPN 2121P30A
72tuner=71 - Xceive xc3028 72tuner=71 - Xceive xc3028
73tuner=72 - Thomson FE6600 73tuner=72 - Thomson FE6600
74tuner=73 - Samsung TCPG 6121P30A
diff --git a/Documentation/video4linux/CQcam.txt b/Documentation/video4linux/CQcam.txt
index 464e4cec94cb..ade8651e2443 100644
--- a/Documentation/video4linux/CQcam.txt
+++ b/Documentation/video4linux/CQcam.txt
@@ -185,207 +185,10 @@ this work is documented at the video4linux2 site listed below.
185 185
1869.0 --- A sample program using v4lgrabber, 1869.0 --- A sample program using v4lgrabber,
187 187
188This program is a simple image grabber that will copy a frame from the 188v4lgrab is a simple image grabber that will copy a frame from the
189first video device, /dev/video0 to standard output in portable pixmap 189first video device, /dev/video0 to standard output in portable pixmap
190format (.ppm) Using this like: 'v4lgrab | convert - c-qcam.jpg' 190format (.ppm) To produce .jpg output, you can use it like this:
191produced this picture of me at 191'v4lgrab | convert - c-qcam.jpg'
192 http://mug.sys.virginia.edu/~drf5n/extras/c-qcam.jpg
193
194-------------------- 8< ---------------- 8< -----------------------------
195
196/* Simple Video4Linux image grabber. */
197/*
198 * Video4Linux Driver Test/Example Framegrabbing Program
199 *
200 * Compile with:
201 * gcc -s -Wall -Wstrict-prototypes v4lgrab.c -o v4lgrab
202 * Use as:
203 * v4lgrab >image.ppm
204 *
205 * Copyright (C) 1998-05-03, Phil Blundell <philb@gnu.org>
206 * Copied from http://www.tazenda.demon.co.uk/phil/vgrabber.c
207 * with minor modifications (Dave Forrest, drf5n@virginia.edu).
208 *
209 */
210
211#include <unistd.h>
212#include <sys/types.h>
213#include <sys/stat.h>
214#include <fcntl.h>
215#include <stdio.h>
216#include <sys/ioctl.h>
217#include <stdlib.h>
218
219#include <linux/types.h>
220#include <linux/videodev.h>
221
222#define FILE "/dev/video0"
223
224/* Stole this from tvset.c */
225
226#define READ_VIDEO_PIXEL(buf, format, depth, r, g, b) \
227{ \
228 switch (format) \
229 { \
230 case VIDEO_PALETTE_GREY: \
231 switch (depth) \
232 { \
233 case 4: \
234 case 6: \
235 case 8: \
236 (r) = (g) = (b) = (*buf++ << 8);\
237 break; \
238 \
239 case 16: \
240 (r) = (g) = (b) = \
241 *((unsigned short *) buf); \
242 buf += 2; \
243 break; \
244 } \
245 break; \
246 \
247 \
248 case VIDEO_PALETTE_RGB565: \
249 { \
250 unsigned short tmp = *(unsigned short *)buf; \
251 (r) = tmp&0xF800; \
252 (g) = (tmp<<5)&0xFC00; \
253 (b) = (tmp<<11)&0xF800; \
254 buf += 2; \
255 } \
256 break; \
257 \
258 case VIDEO_PALETTE_RGB555: \
259 (r) = (buf[0]&0xF8)<<8; \
260 (g) = ((buf[0] << 5 | buf[1] >> 3)&0xF8)<<8; \
261 (b) = ((buf[1] << 2 ) & 0xF8)<<8; \
262 buf += 2; \
263 break; \
264 \
265 case VIDEO_PALETTE_RGB24: \
266 (r) = buf[0] << 8; (g) = buf[1] << 8; \
267 (b) = buf[2] << 8; \
268 buf += 3; \
269 break; \
270 \
271 default: \
272 fprintf(stderr, \
273 "Format %d not yet supported\n", \
274 format); \
275 } \
276}
277
278int get_brightness_adj(unsigned char *image, long size, int *brightness) {
279 long i, tot = 0;
280 for (i=0;i<size*3;i++)
281 tot += image[i];
282 *brightness = (128 - tot/(size*3))/3;
283 return !((tot/(size*3)) >= 126 && (tot/(size*3)) <= 130);
284}
285
286int main(int argc, char ** argv)
287{
288 int fd = open(FILE, O_RDONLY), f;
289 struct video_capability cap;
290 struct video_window win;
291 struct video_picture vpic;
292
293 unsigned char *buffer, *src;
294 int bpp = 24, r, g, b;
295 unsigned int i, src_depth;
296
297 if (fd < 0) {
298 perror(FILE);
299 exit(1);
300 }
301
302 if (ioctl(fd, VIDIOCGCAP, &cap) < 0) {
303 perror("VIDIOGCAP");
304 fprintf(stderr, "(" FILE " not a video4linux device?)\n");
305 close(fd);
306 exit(1);
307 }
308
309 if (ioctl(fd, VIDIOCGWIN, &win) < 0) {
310 perror("VIDIOCGWIN");
311 close(fd);
312 exit(1);
313 }
314
315 if (ioctl(fd, VIDIOCGPICT, &vpic) < 0) {
316 perror("VIDIOCGPICT");
317 close(fd);
318 exit(1);
319 }
320
321 if (cap.type & VID_TYPE_MONOCHROME) {
322 vpic.depth=8;
323 vpic.palette=VIDEO_PALETTE_GREY; /* 8bit grey */
324 if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) {
325 vpic.depth=6;
326 if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) {
327 vpic.depth=4;
328 if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) {
329 fprintf(stderr, "Unable to find a supported capture format.\n");
330 close(fd);
331 exit(1);
332 }
333 }
334 }
335 } else {
336 vpic.depth=24;
337 vpic.palette=VIDEO_PALETTE_RGB24;
338
339 if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) {
340 vpic.palette=VIDEO_PALETTE_RGB565;
341 vpic.depth=16;
342
343 if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) {
344 vpic.palette=VIDEO_PALETTE_RGB555;
345 vpic.depth=15;
346
347 if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) {
348 fprintf(stderr, "Unable to find a supported capture format.\n");
349 return -1;
350 }
351 }
352 }
353 }
354
355 buffer = malloc(win.width * win.height * bpp);
356 if (!buffer) {
357 fprintf(stderr, "Out of memory.\n");
358 exit(1);
359 }
360
361 do {
362 int newbright;
363 read(fd, buffer, win.width * win.height * bpp);
364 f = get_brightness_adj(buffer, win.width * win.height, &newbright);
365 if (f) {
366 vpic.brightness += (newbright << 8);
367 if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) {
368 perror("VIDIOSPICT");
369 break;
370 }
371 }
372 } while (f);
373
374 fprintf(stdout, "P6\n%d %d 255\n", win.width, win.height);
375
376 src = buffer;
377
378 for (i = 0; i < win.width * win.height; i++) {
379 READ_VIDEO_PIXEL(src, vpic.palette, src_depth, r, g, b);
380 fputc(r>>8, stdout);
381 fputc(g>>8, stdout);
382 fputc(b>>8, stdout);
383 }
384
385 close(fd);
386 return 0;
387}
388-------------------- 8< ---------------- 8< -----------------------------
389 192
390 193
39110.0 --- Other Information 19410.0 --- Other Information
diff --git a/Documentation/video4linux/Zoran b/Documentation/video4linux/Zoran
index be9f21b84555..040a2c841ae9 100644
--- a/Documentation/video4linux/Zoran
+++ b/Documentation/video4linux/Zoran
@@ -33,6 +33,21 @@ Inputs/outputs: Composite and S-video
33Norms: PAL, SECAM (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps) 33Norms: PAL, SECAM (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps)
34Card number: 7 34Card number: 7
35 35
36AverMedia 6 Eyes AVS6EYES:
37* Zoran zr36067 PCI controller
38* Zoran zr36060 MJPEG codec
39* Samsung ks0127 TV decoder
40* Conexant bt866 TV encoder
41Drivers to use: videodev, i2c-core, i2c-algo-bit,
42 videocodec, ks0127, bt866, zr36060, zr36067
43Inputs/outputs: Six physical inputs. 1-6 are composite,
44 1-2, 3-4, 5-6 doubles as S-video,
45 1-3 triples as component.
46 One composite output.
47Norms: PAL, SECAM (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps)
48Card number: 8
49Not autodetected, card=8 is necessary.
50
36Linux Media Labs LML33: 51Linux Media Labs LML33:
37* Zoran zr36067 PCI controller 52* Zoran zr36067 PCI controller
38* Zoran zr36060 MJPEG codec 53* Zoran zr36060 MJPEG codec
@@ -192,6 +207,10 @@ Micronas vpx3220a TV decoder
192was introduced in 1996, is used in the DC30 and DC30+ and 207was introduced in 1996, is used in the DC30 and DC30+ and
193can handle: PAL B/G/H/I, PAL N, PAL M, NTSC M, NTSC 44, PAL 60, SECAM,NTSC Comb 208can handle: PAL B/G/H/I, PAL N, PAL M, NTSC M, NTSC 44, PAL 60, SECAM,NTSC Comb
194 209
210Samsung ks0127 TV decoder
211is used in the AVS6EYES card and
212can handle: NTSC-M/N/44, PAL-M/N/B/G/H/I/D/K/L and SECAM
213
195=========================== 214===========================
196 215
1971.2 What the TV encoder can do an what not 2161.2 What the TV encoder can do an what not
@@ -221,6 +240,10 @@ ITT mse3000 TV encoder
221was introduced in 1991, is used in the DC10 old 240was introduced in 1991, is used in the DC10 old
222can generate: PAL , NTSC , SECAM 241can generate: PAL , NTSC , SECAM
223 242
243Conexant bt866 TV encoder
244is used in AVS6EYES, and
245can generate: NTSC/PAL, PAL­M, PAL­N
246
224The adv717x, should be able to produce PAL N. But you find nothing PAL N 247The adv717x, should be able to produce PAL N. But you find nothing PAL N
225specific in the registers. Seem that you have to reuse a other standard 248specific in the registers. Seem that you have to reuse a other standard
226to generate PAL N, maybe it would work if you use the PAL M settings. 249to generate PAL N, maybe it would work if you use the PAL M settings.
diff --git a/Documentation/video4linux/bttv/CONTRIBUTORS b/Documentation/video4linux/bttv/CONTRIBUTORS
index aef49db8847d..8aad6dd93d6b 100644
--- a/Documentation/video4linux/bttv/CONTRIBUTORS
+++ b/Documentation/video4linux/bttv/CONTRIBUTORS
@@ -1,4 +1,4 @@
1Contributors to bttv: 1Contributors to bttv:
2 2
3Michael Chu <mmchu@pobox.com> 3Michael Chu <mmchu@pobox.com>
4 AverMedia fix and more flexible card recognition 4 AverMedia fix and more flexible card recognition
@@ -8,8 +8,8 @@ Alan Cox <alan@redhat.com>
8 8
9Chris Kleitsch 9Chris Kleitsch
10 Hardware I2C 10 Hardware I2C
11 11
12Gerd Knorr <kraxel@cs.tu-berlin.de> 12Gerd Knorr <kraxel@cs.tu-berlin.de>
13 Radio card (ITT sound processor) 13 Radio card (ITT sound processor)
14 14
15bigfoot <bigfoot@net-way.net> 15bigfoot <bigfoot@net-way.net>
@@ -18,7 +18,7 @@ Ragnar Hojland Espinosa <ragnar@macula.net>
18 18
19 19
20+ many more (please mail me if you are missing in this list and would 20+ many more (please mail me if you are missing in this list and would
21 like to be mentioned) 21 like to be mentioned)
22 22
23 23
24 24
diff --git a/Documentation/video4linux/cx2341x/fw-calling.txt b/Documentation/video4linux/cx2341x/fw-calling.txt
new file mode 100644
index 000000000000..8d21181de537
--- /dev/null
+++ b/Documentation/video4linux/cx2341x/fw-calling.txt
@@ -0,0 +1,69 @@
1This page describes how to make calls to the firmware api.
2
3How to call
4===========
5
6The preferred calling convention is known as the firmware mailbox. The
7mailboxes are basically a fixed length array that serves as the call-stack.
8
9Firmware mailboxes can be located by searching the encoder and decoder memory
10for a 16 byte signature. That signature will be located on a 256-byte boundary.
11
12Signature:
130x78, 0x56, 0x34, 0x12, 0x12, 0x78, 0x56, 0x34,
140x34, 0x12, 0x78, 0x56, 0x56, 0x34, 0x12, 0x78
15
16The firmware implements 20 mailboxes of 20 32-bit words. The first 10 are
17reserved for API calls. The second 10 are used by the firmware for event
18notification.
19
20 Index Name
21 ----- ----
22 0 Flags
23 1 Command
24 2 Return value
25 3 Timeout
26 4-19 Parameter/Result
27
28
29The flags are defined in the following table. The direction is from the
30perspective of the firmware.
31
32 Bit Direction Purpose
33 --- --------- -------
34 2 O Firmware has processed the command.
35 1 I Driver has finished setting the parameters.
36 0 I Driver is using this mailbox.
37
38
39The command is a 32-bit enumerator. The API specifics may be found in the
40fw-*-api.txt documents.
41
42The return value is a 32-bit enumerator. Only two values are currently defined:
430=success and -1=command undefined.
44
45There are 16 parameters/results 32-bit fields. The driver populates these fields
46with values for all the parameters required by the call. The driver overwrites
47these fields with result values returned by the call. The API specifics may be
48found in the fw-*-api.txt documents.
49
50The timeout value protects the card from a hung driver thread. If the driver
51doesn't handle the completed call within the timeout specified, the firmware
52will reset that mailbox.
53
54To make an API call, the driver iterates over each mailbox looking for the
55first one available (bit 0 has been cleared). The driver sets that bit, fills
56in the command enumerator, the timeout value and any required parameters. The
57driver then sets the parameter ready bit (bit 1). The firmware scans the
58mailboxes for pending commands, processes them, sets the result code, populates
59the result value array with that call's return values and sets the call
60complete bit (bit 2). Once bit 2 is set, the driver should retrieve the results
61and clear all the flags. If the driver does not perform this task within the
62time set in the timeout register, the firmware will reset that mailbox.
63
64Event notifications are sent from the firmware to the host. The host tells the
65firmware which events it is interested in via an API call. That call tells the
66firmware which notification mailbox to use. The firmware signals the host via
67an interrupt. Only the 16 Results fields are used, the Flags, Command, Return
68value and Timeout words are not used.
69
diff --git a/Documentation/video4linux/cx2341x/fw-decoder-api.txt b/Documentation/video4linux/cx2341x/fw-decoder-api.txt
new file mode 100644
index 000000000000..9df4fb3ea0f2
--- /dev/null
+++ b/Documentation/video4linux/cx2341x/fw-decoder-api.txt
@@ -0,0 +1,319 @@
1Decoder firmware API description
2================================
3
4Note: this API is part of the decoder firmware, so it's cx23415 only.
5
6-------------------------------------------------------------------------------
7
8Name CX2341X_DEC_PING_FW
9Enum 0/0x00
10Description
11 This API call does nothing. It may be used to check if the firmware
12 is responding.
13
14-------------------------------------------------------------------------------
15
16Name CX2341X_DEC_START_PLAYBACK
17Enum 1/0x01
18Description
19 Begin or resume playback.
20Param[0]
21 0 based frame number in GOP to begin playback from.
22Param[1]
23 Specifies the number of muted audio frames to play before normal
24 audio resumes.
25
26-------------------------------------------------------------------------------
27
28Name CX2341X_DEC_STOP_PLAYBACK
29Enum 2/0x02
30Description
31 Ends playback and clears all decoder buffers. If PTS is not zero,
32 playback stops at specified PTS.
33Param[0]
34 Display 0=last frame, 1=black
35Param[1]
36 PTS low
37Param[2]
38 PTS high
39
40-------------------------------------------------------------------------------
41
42Name CX2341X_DEC_SET_PLAYBACK_SPEED
43Enum 3/0x03
44Description
45 Playback stream at speed other than normal. There are two modes of
46 operation:
47 Smooth: host transfers entire stream and firmware drops unused
48 frames.
49 Coarse: host drops frames based on indexing as required to achieve
50 desired speed.
51Param[0]
52 Bitmap:
53 0:7 0 normal
54 1 fast only "1.5 times"
55 n nX fast, 1/nX slow
56 30 Framedrop:
57 '0' during 1.5 times play, every other B frame is dropped
58 '1' during 1.5 times play, stream is unchanged (bitrate
59 must not exceed 8mbps)
60 31 Speed:
61 '0' slow
62 '1' fast
63Param[1]
64 Direction: 0=forward, 1=reverse
65Param[2]
66 Picture mask:
67 1=I frames
68 3=I, P frames
69 7=I, P, B frames
70Param[3]
71 B frames per GOP (for reverse play only)
72Param[4]
73 Mute audio: 0=disable, 1=enable
74Param[5]
75 Display 0=frame, 1=field
76Param[6]
77 Specifies the number of muted audio frames to play before normal audio
78 resumes.
79
80-------------------------------------------------------------------------------
81
82Name CX2341X_DEC_STEP_VIDEO
83Enum 5/0x05
84Description
85 Each call to this API steps the playback to the next unit defined below
86 in the current playback direction.
87Param[0]
88 0=frame, 1=top field, 2=bottom field
89
90-------------------------------------------------------------------------------
91
92Name CX2341X_DEC_SET_DMA_BLOCK_SIZE
93Enum 8/0x08
94Description
95 Set DMA transfer block size. Counterpart to API 0xC9
96Param[0]
97 DMA transfer block size in bytes. A different size may be specified
98 when issuing the DMA transfer command.
99
100-------------------------------------------------------------------------------
101
102Name CX2341X_DEC_GET_XFER_INFO
103Enum 9/0x09
104Description
105 This API call may be used to detect an end of stream condtion.
106Result[0]
107 Stream type
108Result[1]
109 Address offset
110Result[2]
111 Maximum bytes to transfer
112Result[3]
113 Buffer fullness
114
115-------------------------------------------------------------------------------
116
117Name CX2341X_DEC_GET_DMA_STATUS
118Enum 10/0x0A
119Description
120 Status of the last DMA transfer
121Result[0]
122 Bit 1 set means transfer complete
123 Bit 2 set means DMA error
124 Bit 3 set means linked list error
125Result[1]
126 DMA type: 0=MPEG, 1=OSD, 2=YUV
127
128-------------------------------------------------------------------------------
129
130Name CX2341X_DEC_SCHED_DMA_FROM_HOST
131Enum 11/0x0B
132Description
133 Setup DMA from host operation. Counterpart to API 0xCC
134Param[0]
135 Memory address of link list
136Param[1]
137 Total # of bytes to transfer
138Param[2]
139 DMA type (0=MPEG, 1=OSD, 2=YUV)
140
141-------------------------------------------------------------------------------
142
143Name CX2341X_DEC_PAUSE_PLAYBACK
144Enum 13/0x0D
145Description
146 Freeze playback immediately. In this mode, when internal buffers are
147 full, no more data will be accepted and data request IRQs will be
148 masked.
149Param[0]
150 Display: 0=last frame, 1=black
151
152-------------------------------------------------------------------------------
153
154Name CX2341X_DEC_HALT_FW
155Enum 14/0x0E
156Description
157 The firmware is halted and no further API calls are serviced until
158 the firmware is uploaded again.
159
160-------------------------------------------------------------------------------
161
162Name CX2341X_DEC_SET_STANDARD
163Enum 16/0x10
164Description
165 Selects display standard
166Param[0]
167 0=NTSC, 1=PAL
168
169-------------------------------------------------------------------------------
170
171Name CX2341X_DEC_GET_VERSION
172Enum 17/0x11
173Description
174 Returns decoder firmware version information
175Result[0]
176 Version bitmask:
177 Bits 0:15 build
178 Bits 16:23 minor
179 Bits 24:31 major
180
181-------------------------------------------------------------------------------
182
183Name CX2341X_DEC_SET_STREAM_INPUT
184Enum 20/0x14
185Description
186 Select decoder stream input port
187Param[0]
188 0=memory (default), 1=streaming
189
190-------------------------------------------------------------------------------
191
192Name CX2341X_DEC_GET_TIMING_INFO
193Enum 21/0x15
194Description
195 Returns timing information from start of playback
196Result[0]
197 Frame count by decode order
198Result[1]
199 Video PTS bits 0:31 by display order
200Result[2]
201 Video PTS bit 32 by display order
202Result[3]
203 SCR bits 0:31 by display order
204Result[4]
205 SCR bit 32 by display order
206
207-------------------------------------------------------------------------------
208
209Name CX2341X_DEC_SET_AUDIO_MODE
210Enum 22/0x16
211Description
212 Select audio mode
213Param[0]
214 Dual mono mode action
215Param[1]
216 Stereo mode action:
217 0=Stereo, 1=Left, 2=Right, 3=Mono, 4=Swap, -1=Unchanged
218
219-------------------------------------------------------------------------------
220
221Name CX2341X_DEC_SET_EVENT_NOTIFICATION
222Enum 23/0x17
223Description
224 Setup firmware to notify the host about a particular event.
225 Counterpart to API 0xD5
226Param[0]
227 Event: 0=Audio mode change between stereo and dual channel
228Param[1]
229 Notification 0=disabled, 1=enabled
230Param[2]
231 Interrupt bit
232Param[3]
233 Mailbox slot, -1 if no mailbox required.
234
235-------------------------------------------------------------------------------
236
237Name CX2341X_DEC_SET_DISPLAY_BUFFERS
238Enum 24/0x18
239Description
240 Number of display buffers. To decode all frames in reverse playback you
241 must use nine buffers.
242Param[0]
243 0=six buffers, 1=nine buffers
244
245-------------------------------------------------------------------------------
246
247Name CX2341X_DEC_EXTRACT_VBI
248Enum 25/0x19
249Description
250 Extracts VBI data
251Param[0]
252 0=extract from extension & user data, 1=extract from private packets
253Result[0]
254 VBI table location
255Result[1]
256 VBI table size
257
258-------------------------------------------------------------------------------
259
260Name CX2341X_DEC_SET_DECODER_SOURCE
261Enum 26/0x1A
262Description
263 Selects decoder source. Ensure that the parameters passed to this
264 API match the encoder settings.
265Param[0]
266 Mode: 0=MPEG from host, 1=YUV from encoder, 2=YUV from host
267Param[1]
268 YUV picture width
269Param[2]
270 YUV picture height
271Param[3]
272 Bitmap: see Param[0] of API 0xBD
273
274-------------------------------------------------------------------------------
275
276Name CX2341X_DEC_SET_AUDIO_OUTPUT
277Enum 27/0x1B
278Description
279 Select audio output format
280Param[0]
281 Bitmask:
282 0:1 Data size:
283 '00' 16 bit
284 '01' 20 bit
285 '10' 24 bit
286 2:7 Unused
287 8:9 Mode:
288 '00' 2 channels
289 '01' 4 channels
290 '10' 6 channels
291 '11' 6 channels with one line data mode
292 (for left justified MSB first mode, 20 bit only)
293 10:11 Unused
294 12:13 Channel format:
295 '00' right justified MSB first mode
296 '01' left justified MSB first mode
297 '10' I2S mode
298 14:15 Unused
299 16:21 Right justify bit count
300 22:31 Unused
301
302-------------------------------------------------------------------------------
303
304Name CX2341X_DEC_SET_AV_DELAY
305Enum 28/0x1C
306Description
307 Set audio/video delay in 90Khz ticks
308Param[0]
309 0=A/V in sync, negative=audio lags, positive=video lags
310
311-------------------------------------------------------------------------------
312
313Name CX2341X_DEC_SET_PREBUFFERING
314Enum 30/0x1E
315Description
316 Decoder prebuffering, when enabled up to 128KB are buffered for
317 streams <8mpbs or 640KB for streams >8mbps
318Param[0]
319 0=off, 1=on
diff --git a/Documentation/video4linux/cx2341x/fw-dma.txt b/Documentation/video4linux/cx2341x/fw-dma.txt
new file mode 100644
index 000000000000..8123e262d5b6
--- /dev/null
+++ b/Documentation/video4linux/cx2341x/fw-dma.txt
@@ -0,0 +1,94 @@
1This page describes the structures and procedures used by the cx2341x DMA
2engine.
3
4Introduction
5============
6
7The cx2341x PCI interface is busmaster capable. This means it has a DMA
8engine to efficiently transfer large volumes of data between the card and main
9memory without requiring help from a CPU. Like most hardware, it must operate
10on contiguous physical memory. This is difficult to come by in large quantities
11on virtual memory machines.
12
13Therefore, it also supports a technique called "scatter-gather". The card can
14transfer multiple buffers in one operation. Instead of allocating one large
15contiguous buffer, the driver can allocate several smaller buffers.
16
17In practice, I've seen the average transfer to be roughly 80K, but transfers
18above 128K were not uncommon, particularly at startup. The 128K figure is
19important, because that is the largest block that the kernel can normally
20allocate. Even still, 128K blocks are hard to come by, so the driver writer is
21urged to choose a smaller block size and learn the scatter-gather technique.
22
23Mailbox #10 is reserved for DMA transfer information.
24
25Flow
26====
27
28This section describes, in general, the order of events when handling DMA
29transfers. Detailed information follows this section.
30
31- The card raises the Encoder interrupt.
32- The driver reads the transfer type, offset and size from Mailbox #10.
33- The driver constructs the scatter-gather array from enough free dma buffers
34 to cover the size.
35- The driver schedules the DMA transfer via the ScheduleDMAtoHost API call.
36- The card raises the DMA Complete interrupt.
37- The driver checks the DMA status register for any errors.
38- The driver post-processes the newly transferred buffers.
39
40NOTE! It is possible that the Encoder and DMA Complete interrupts get raised
41simultaneously. (End of the last, start of the next, etc.)
42
43Mailbox #10
44===========
45
46The Flags, Command, Return Value and Timeout fields are ignored.
47
48Name: Mailbox #10
49Results[0]: Type: 0: MPEG.
50Results[1]: Offset: The position relative to the card's memory space.
51Results[2]: Size: The exact number of bytes to transfer.
52
53My speculation is that since the StartCapture API has a capture type of "RAW"
54available, that the type field will have other values that correspond to YUV
55and PCM data.
56
57Scatter-Gather Array
58====================
59
60The scatter-gather array is a contiguously allocated block of memory that
61tells the card the source and destination of each data-block to transfer.
62Card "addresses" are derived from the offset supplied by Mailbox #10. Host
63addresses are the physical memory location of the target DMA buffer.
64
65Each S-G array element is a struct of three 32-bit words. The first word is
66the source address, the second is the destination address. Both take up the
67entire 32 bits. The lowest 16 bits of the third word is the transfer byte
68count. The high-bit of the third word is the "last" flag. The last-flag tells
69the card to raise the DMA_DONE interrupt. From hard personal experience, if
70you forget to set this bit, the card will still "work" but the stream will
71most likely get corrupted.
72
73The transfer count must be a multiple of 256. Therefore, the driver will need
74to track how much data in the target buffer is valid and deal with it
75accordingly.
76
77Array Element:
78
79- 32-bit Source Address
80- 32-bit Destination Address
81- 16-bit reserved (high bit is the last flag)
82- 16-bit byte count
83
84DMA Transfer Status
85===================
86
87Register 0x0004 holds the DMA Transfer Status:
88
89Bit
904 Scatter-Gather array error
913 DMA write error
922 DMA read error
931 write completed
940 read completed
diff --git a/Documentation/video4linux/cx2341x/fw-encoder-api.txt b/Documentation/video4linux/cx2341x/fw-encoder-api.txt
new file mode 100644
index 000000000000..001c68644b08
--- /dev/null
+++ b/Documentation/video4linux/cx2341x/fw-encoder-api.txt
@@ -0,0 +1,694 @@
1Encoder firmware API description
2================================
3
4-------------------------------------------------------------------------------
5
6Name CX2341X_ENC_PING_FW
7Enum 128/0x80
8Description
9 Does nothing. Can be used to check if the firmware is responding.
10
11-------------------------------------------------------------------------------
12
13Name CX2341X_ENC_START_CAPTURE
14Enum 129/0x81
15Description
16 Commences the capture of video, audio and/or VBI data. All encoding
17 parameters must be initialized prior to this API call. Captures frames
18 continuously or until a predefined number of frames have been captured.
19Param[0]
20 Capture stream type:
21 0=MPEG
22 1=Raw
23 2=Raw passthrough
24 3=VBI
25
26Param[1]
27 Bitmask:
28 Bit 0 when set, captures YUV
29 Bit 1 when set, captures PCM audio
30 Bit 2 when set, captures VBI (same as param[0]=3)
31 Bit 3 when set, the capture destination is the decoder
32 (same as param[0]=2)
33 Bit 4 when set, the capture destination is the host
34 Note: this parameter is only meaningful for RAW capture type.
35
36-------------------------------------------------------------------------------
37
38Name CX2341X_ENC_STOP_CAPTURE
39Enum 130/0x82
40Description
41 Ends a capture in progress
42Param[0]
43 0=stop at end of GOP (generates IRQ)
44 1=stop immediate (no IRQ)
45Param[1]
46 Stream type to stop, see param[0] of API 0x81
47Param[2]
48 Subtype, see param[1] of API 0x81
49
50-------------------------------------------------------------------------------
51
52Name CX2341X_ENC_SET_AUDIO_ID
53Enum 137/0x89
54Description
55 Assigns the transport stream ID of the encoded audio stream
56Param[0]
57 Audio Stream ID
58
59-------------------------------------------------------------------------------
60
61Name CX2341X_ENC_SET_VIDEO_ID
62Enum 139/0x8B
63Description
64 Set video transport stream ID
65Param[0]
66 Video stream ID
67
68-------------------------------------------------------------------------------
69
70Name CX2341X_ENC_SET_PCR_ID
71Enum 141/0x8D
72Description
73 Assigns the transport stream ID for PCR packets
74Param[0]
75 PCR Stream ID
76
77-------------------------------------------------------------------------------
78
79Name CX2341X_ENC_SET_FRAME_RATE
80Enum 143/0x8F
81Description
82 Set video frames per second. Change occurs at start of new GOP.
83Param[0]
84 0=30fps
85 1=25fps
86
87-------------------------------------------------------------------------------
88
89Name CX2341X_ENC_SET_FRAME_SIZE
90Enum 145/0x91
91Description
92 Select video stream encoding resolution.
93Param[0]
94 Height in lines. Default 480
95Param[1]
96 Width in pixels. Default 720
97
98-------------------------------------------------------------------------------
99
100Name CX2341X_ENC_SET_BIT_RATE
101Enum 149/0x95
102Description
103 Assign average video stream bitrate. Note on the last three params:
104 Param[3] and [4] seem to be always 0, param [5] doesn't seem to be used.
105Param[0]
106 0=variable bitrate, 1=constant bitrate
107Param[1]
108 bitrate in bits per second
109Param[2]
110 peak bitrate in bits per second, divided by 400
111Param[3]
112 Mux bitrate in bits per second, divided by 400. May be 0 (default).
113Param[4]
114 Rate Control VBR Padding
115Param[5]
116 VBV Buffer used by encoder
117
118-------------------------------------------------------------------------------
119
120Name CX2341X_ENC_SET_GOP_PROPERTIES
121Enum 151/0x97
122Description
123 Setup the GOP structure
124Param[0]
125 GOP size (maximum is 34)
126Param[1]
127 Number of B frames between the I and P frame, plus 1.
128 For example: IBBPBBPBBPBB --> GOP size: 12, number of B frames: 2+1 = 3
129 Note that GOP size must be a multiple of (B-frames + 1).
130
131-------------------------------------------------------------------------------
132
133Name CX2341X_ENC_SET_ASPECT_RATIO
134Enum 153/0x99
135Description
136 Sets the encoding aspect ratio. Changes in the aspect ratio take effect
137 at the start of the next GOP.
138Param[0]
139 '0000' forbidden
140 '0001' 1:1 square
141 '0010' 4:3
142 '0011' 16:9
143 '0100' 2.21:1
144 '0101' reserved
145 ....
146 '1111' reserved
147
148-------------------------------------------------------------------------------
149
150Name CX2341X_ENC_SET_DNR_FILTER_MODE
151Enum 155/0x9B
152Description
153 Assign Dynamic Noise Reduction operating mode
154Param[0]
155 Bit0: Spatial filter, set=auto, clear=manual
156 Bit1: Temporal filter, set=auto, clear=manual
157Param[1]
158 Median filter:
159 0=Disabled
160 1=Horizontal
161 2=Vertical
162 3=Horiz/Vert
163 4=Diagonal
164
165-------------------------------------------------------------------------------
166
167Name CX2341X_ENC_SET_DNR_FILTER_PROPS
168Enum 157/0x9D
169Description
170 These Dynamic Noise Reduction filter values are only meaningful when
171 the respective filter is set to "manual" (See API 0x9B)
172Param[0]
173 Spatial filter: default 0, range 0:15
174Param[1]
175 Temporal filter: default 0, range 0:31
176
177-------------------------------------------------------------------------------
178
179Name CX2341X_ENC_SET_CORING_LEVELS
180Enum 159/0x9F
181Description
182 Assign Dynamic Noise Reduction median filter properties.
183Param[0]
184 Threshold above which the luminance median filter is enabled.
185 Default: 0, range 0:255
186Param[1]
187 Threshold below which the luminance median filter is enabled.
188 Default: 255, range 0:255
189Param[2]
190 Threshold above which the chrominance median filter is enabled.
191 Default: 0, range 0:255
192Param[3]
193 Threshold below which the chrominance median filter is enabled.
194 Default: 255, range 0:255
195
196-------------------------------------------------------------------------------
197
198Name CX2341X_ENC_SET_SPATIAL_FILTER_TYPE
199Enum 161/0xA1
200Description
201 Assign spatial prefilter parameters
202Param[0]
203 Luminance filter
204 0=Off
205 1=1D Horizontal
206 2=1D Vertical
207 3=2D H/V Separable (default)
208 4=2D Symmetric non-separable
209Param[1]
210 Chrominance filter
211 0=Off
212 1=1D Horizontal (default)
213
214-------------------------------------------------------------------------------
215
216Name CX2341X_ENC_SET_3_2_PULLDOWN
217Enum 177/0xB1
218Description
219 3:2 pulldown properties
220Param[0]
221 0=enabled
222 1=disabled
223
224-------------------------------------------------------------------------------
225
226Name CX2341X_ENC_SET_VBI_LINE
227Enum 183/0xB7
228Description
229 Selects VBI line number.
230Param[0]
231 Bits 0:4 line number
232 Bit 31 0=top_field, 1=bottom_field
233 Bits 0:31 all set specifies "all lines"
234Param[1]
235 VBI line information features: 0=disabled, 1=enabled
236Param[2]
237 Slicing: 0=None, 1=Closed Caption
238 Almost certainly not implemented. Set to 0.
239Param[3]
240 Luminance samples in this line.
241 Almost certainly not implemented. Set to 0.
242Param[4]
243 Chrominance samples in this line
244 Almost certainly not implemented. Set to 0.
245
246-------------------------------------------------------------------------------
247
248Name CX2341X_ENC_SET_STREAM_TYPE
249Enum 185/0xB9
250Description
251 Assign stream type
252 Note: Transport stream is not working in recent firmwares.
253 And in older firmwares the timestamps in the TS seem to be
254 unreliable.
255Param[0]
256 0=Program stream
257 1=Transport stream
258 2=MPEG1 stream
259 3=PES A/V stream
260 5=PES Video stream
261 7=PES Audio stream
262 10=DVD stream
263 11=VCD stream
264 12=SVCD stream
265 13=DVD_S1 stream
266 14=DVD_S2 stream
267
268-------------------------------------------------------------------------------
269
270Name CX2341X_ENC_SET_OUTPUT_PORT
271Enum 187/0xBB
272Description
273 Assign stream output port. Normally 0 when the data is copied through
274 the PCI bus (DMA), and 1 when the data is streamed to another chip
275 (pvrusb and cx88-blackbird).
276Param[0]
277 0=Memory (default)
278 1=Streaming
279 2=Serial
280Param[1]
281 Unknown, but leaving this to 0 seems to work best. Indications are that
282 this might have to do with USB support, although passing anything but 0
283 onl breaks things.
284
285-------------------------------------------------------------------------------
286
287Name CX2341X_ENC_SET_AUDIO_PROPERTIES
288Enum 189/0xBD
289Description
290 Set audio stream properties, may be called while encoding is in progress.
291 Note: all bitfields are consistent with ISO11172 documentation except
292 bits 2:3 which ISO docs define as:
293 '11' Layer I
294 '10' Layer II
295 '01' Layer III
296 '00' Undefined
297 This discrepancy may indicate a possible error in the documentation.
298 Testing indicated that only Layer II is actually working, and that
299 the minimum bitrate should be 192 kbps.
300Param[0]
301 Bitmask:
302 0:1 '00' 44.1Khz
303 '01' 48Khz
304 '10' 32Khz
305 '11' reserved
306
307 2:3 '01'=Layer I
308 '10'=Layer II
309
310 4:7 Bitrate:
311 Index | Layer I | Layer II
312 ------+-------------+------------
313 '0000' | free format | free format
314 '0001' | 32 kbit/s | 32 kbit/s
315 '0010' | 64 kbit/s | 48 kbit/s
316 '0011' | 96 kbit/s | 56 kbit/s
317 '0100' | 128 kbit/s | 64 kbit/s
318 '0101' | 160 kbit/s | 80 kbit/s
319 '0110' | 192 kbit/s | 96 kbit/s
320 '0111' | 224 kbit/s | 112 kbit/s
321 '1000' | 256 kbit/s | 128 kbit/s
322 '1001' | 288 kbit/s | 160 kbit/s
323 '1010' | 320 kbit/s | 192 kbit/s
324 '1011' | 352 kbit/s | 224 kbit/s
325 '1100' | 384 kbit/s | 256 kbit/s
326 '1101' | 416 kbit/s | 320 kbit/s
327 '1110' | 448 kbit/s | 384 kbit/s
328 Note: For Layer II, not all combinations of total bitrate
329 and mode are allowed. See ISO11172-3 3-Annex B, Table 3-B.2
330
331 8:9 '00'=Stereo
332 '01'=JointStereo
333 '10'=Dual
334 '11'=Mono
335 Note: testing seems to indicate that Mono and possibly
336 JointStereo are not working (default to stereo).
337 Dual does work, though.
338
339 10:11 Mode Extension used in joint_stereo mode.
340 In Layer I and II they indicate which subbands are in
341 intensity_stereo. All other subbands are coded in stereo.
342 '00' subbands 4-31 in intensity_stereo, bound==4
343 '01' subbands 8-31 in intensity_stereo, bound==8
344 '10' subbands 12-31 in intensity_stereo, bound==12
345 '11' subbands 16-31 in intensity_stereo, bound==16
346
347 12:13 Emphasis:
348 '00' None
349 '01' 50/15uS
350 '10' reserved
351 '11' CCITT J.17
352
353 14 CRC:
354 '0' off
355 '1' on
356
357 15 Copyright:
358 '0' off
359 '1' on
360
361 16 Generation:
362 '0' copy
363 '1' original
364
365-------------------------------------------------------------------------------
366
367Name CX2341X_ENC_HALT_FW
368Enum 195/0xC3
369Description
370 The firmware is halted and no further API calls are serviced until the
371 firmware is uploaded again.
372
373-------------------------------------------------------------------------------
374
375Name CX2341X_ENC_GET_VERSION
376Enum 196/0xC4
377Description
378 Returns the version of the encoder firmware.
379Result[0]
380 Version bitmask:
381 Bits 0:15 build
382 Bits 16:23 minor
383 Bits 24:31 major
384
385-------------------------------------------------------------------------------
386
387Name CX2341X_ENC_SET_GOP_CLOSURE
388Enum 197/0xC5
389Description
390 Assigns the GOP open/close property.
391Param[0]
392 0=Open
393 1=Closed
394
395-------------------------------------------------------------------------------
396
397Name CX2341X_ENC_GET_SEQ_END
398Enum 198/0xC6
399Description
400 Obtains the sequence end code of the encoder's buffer. When a capture
401 is started a number of interrupts are still generated, the last of
402 which will have Result[0] set to 1 and Result[1] will contain the size
403 of the buffer.
404Result[0]
405 State of the transfer (1 if last buffer)
406Result[1]
407 If Result[0] is 1, this contains the size of the last buffer, undefined
408 otherwise.
409
410-------------------------------------------------------------------------------
411
412Name CX2341X_ENC_SET_PGM_INDEX_INFO
413Enum 199/0xC7
414Description
415 Sets the Program Index Information.
416Param[0]
417 Picture Mask:
418 0=No index capture
419 1=I frames
420 3=I,P frames
421 7=I,P,B frames
422Param[1]
423 Elements requested (up to 400)
424Result[0]
425 Offset in SDF memory of the table.
426Result[1]
427 Number of allocated elements up to a maximum of Param[1]
428
429-------------------------------------------------------------------------------
430
431Name CX2341X_ENC_SET_VBI_CONFIG
432Enum 200/0xC8
433Description
434 Configure VBI settings
435Param[0]
436 Bitmap:
437 0 Mode '0' Sliced, '1' Raw
438 1:3 Insertion:
439 '000' insert in extension & user data
440 '001' insert in private packets
441 '010' separate stream and user data
442 '111' separate stream and private data
443 8:15 Stream ID (normally 0xBD)
444Param[1]
445 Frames per interrupt (max 8). Only valid in raw mode.
446Param[2]
447 Total raw VBI frames. Only valid in raw mode.
448Param[3]
449 Start codes
450Param[4]
451 Stop codes
452Param[5]
453 Lines per frame
454Param[6]
455 Byte per line
456Result[0]
457 Observed frames per interrupt in raw mode only. Rage 1 to Param[1]
458Result[1]
459 Observed number of frames in raw mode. Range 1 to Param[2]
460Result[2]
461 Memory offset to start or raw VBI data
462
463-------------------------------------------------------------------------------
464
465Name CX2341X_ENC_SET_DMA_BLOCK_SIZE
466Enum 201/0xC9
467Description
468 Set DMA transfer block size
469Param[0]
470 DMA transfer block size in bytes or frames. When unit is bytes,
471 supported block sizes are 2^7, 2^8 and 2^9 bytes.
472Param[1]
473 Unit: 0=bytes, 1=frames
474
475-------------------------------------------------------------------------------
476
477Name CX2341X_ENC_GET_PREV_DMA_INFO_MB_10
478Enum 202/0xCA
479Description
480 Returns information on the previous DMA transfer in conjunction with
481 bit 27 of the interrupt mask. Uses mailbox 10.
482Result[0]
483 Type of stream
484Result[1]
485 Address Offset
486Result[2]
487 Maximum size of transfer
488
489-------------------------------------------------------------------------------
490
491Name CX2341X_ENC_GET_PREV_DMA_INFO_MB_9
492Enum 203/0xCB
493Description
494 Returns information on the previous DMA transfer in conjunction with
495 bit 27 of the interrupt mask. Uses mailbox 9.
496Result[0]
497 Status bits:
498 Bit 0 set indicates transfer complete
499 Bit 2 set indicates transfer error
500 Bit 4 set indicates linked list error
501Result[1]
502 DMA type
503Result[2]
504 Presentation Time Stamp bits 0..31
505Result[3]
506 Presentation Time Stamp bit 32
507
508-------------------------------------------------------------------------------
509
510Name CX2341X_ENC_SCHED_DMA_TO_HOST
511Enum 204/0xCC
512Description
513 Setup DMA to host operation
514Param[0]
515 Memory address of link list
516Param[1]
517 Length of link list (wtf: what units ???)
518Param[2]
519 DMA type (0=MPEG)
520
521-------------------------------------------------------------------------------
522
523Name CX2341X_ENC_INITIALIZE_INPUT
524Enum 205/0xCD
525Description
526 Initializes the video input
527
528-------------------------------------------------------------------------------
529
530Name CX2341X_ENC_SET_FRAME_DROP_RATE
531Enum 208/0xD0
532Description
533 For each frame captured, skip specified number of frames.
534Param[0]
535 Number of frames to skip
536
537-------------------------------------------------------------------------------
538
539Name CX2341X_ENC_PAUSE_ENCODER
540Enum 210/0xD2
541Description
542 During a pause condition, all frames are dropped instead of being encoded.
543Param[0]
544 0=Pause encoding
545 1=Continue encoding
546
547-------------------------------------------------------------------------------
548
549Name CX2341X_ENC_REFRESH_INPUT
550Enum 211/0xD3
551Description
552 Refreshes the video input
553
554-------------------------------------------------------------------------------
555
556Name CX2341X_ENC_SET_COPYRIGHT
557Enum 212/0xD4
558Description
559 Sets stream copyright property
560Param[0]
561 0=Stream is not copyrighted
562 1=Stream is copyrighted
563
564-------------------------------------------------------------------------------
565
566Name CX2341X_ENC_SET_EVENT_NOTIFICATION
567Enum 213/0xD5
568Description
569 Setup firmware to notify the host about a particular event. Host must
570 unmask the interrupt bit.
571Param[0]
572 Event (0=refresh encoder input)
573Param[1]
574 Notification 0=disabled 1=enabled
575Param[2]
576 Interrupt bit
577Param[3]
578 Mailbox slot, -1 if no mailbox required.
579
580-------------------------------------------------------------------------------
581
582Name CX2341X_ENC_SET_NUM_VSYNC_LINES
583Enum 214/0xD6
584Description
585 Depending on the analog video decoder used, this assigns the number
586 of lines for field 1 and 2.
587Param[0]
588 Field 1 number of lines:
589 0x00EF for SAA7114
590 0x00F0 for SAA7115
591 0x0105 for Micronas
592Param[1]
593 Field 2 number of lines:
594 0x00EF for SAA7114
595 0x00F0 for SAA7115
596 0x0106 for Micronas
597
598-------------------------------------------------------------------------------
599
600Name CX2341X_ENC_SET_PLACEHOLDER
601Enum 215/0xD7
602Description
603 Provides a mechanism of inserting custom user data in the MPEG stream.
604Param[0]
605 0=extension & user data
606 1=private packet with stream ID 0xBD
607Param[1]
608 Rate at which to insert data, in units of frames (for private packet)
609 or GOPs (for ext. & user data)
610Param[2]
611 Number of data DWORDs (below) to insert
612Param[3]
613 Custom data 0
614Param[4]
615 Custom data 1
616Param[5]
617 Custom data 2
618Param[6]
619 Custom data 3
620Param[7]
621 Custom data 4
622Param[8]
623 Custom data 5
624Param[9]
625 Custom data 6
626Param[10]
627 Custom data 7
628Param[11]
629 Custom data 8
630
631-------------------------------------------------------------------------------
632
633Name CX2341X_ENC_MUTE_VIDEO
634Enum 217/0xD9
635Description
636 Video muting
637Param[0]
638 Bit usage:
639 0 '0'=video not muted
640 '1'=video muted, creates frames with the YUV color defined below
641 1:7 Unused
642 8:15 V chrominance information
643 16:23 U chrominance information
644 24:31 Y luminance information
645
646-------------------------------------------------------------------------------
647
648Name CX2341X_ENC_MUTE_AUDIO
649Enum 218/0xDA
650Description
651 Audio muting
652Param[0]
653 0=audio not muted
654 1=audio muted (produces silent mpeg audio stream)
655
656-------------------------------------------------------------------------------
657
658Name CX2341X_ENC_UNKNOWN
659Enum 219/0xDB
660Description
661 Unknown API, it's used by Hauppauge though.
662Param[0]
663 0 This is the value Hauppauge uses, Unknown what it means.
664
665-------------------------------------------------------------------------------
666
667Name CX2341X_ENC_MISC
668Enum 220/0xDC
669Description
670 Miscellaneous actions. Not known for 100% what it does. It's really a
671 sort of ioctl call. The first parameter is a command number, the second
672 the value.
673Param[0]
674 Command number:
675 1=set initial SCR value when starting encoding.
676 2=set quality mode (apparently some test setting).
677 3=setup advanced VIM protection handling (supposedly only for the cx23416
678 for raw YUV).
679 Actually it looks like this should be 0 for saa7114/5 based card and 1
680 for cx25840 based cards.
681 4=generate artificial PTS timestamps
682 5=USB flush mode
683 6=something to do with the quantization matrix
684 7=set navigation pack insertion for DVD
685 8=enable scene change detection (seems to be a failure)
686 9=set history parameters of the video input module
687 10=set input field order of VIM
688 11=set quantization matrix
689 12=reset audio interface
690 13=set audio volume delay
691 14=set audio delay
692
693Param[1]
694 Command value.
diff --git a/Documentation/video4linux/cx2341x/fw-memory.txt b/Documentation/video4linux/cx2341x/fw-memory.txt
new file mode 100644
index 000000000000..ef0aad3f88fc
--- /dev/null
+++ b/Documentation/video4linux/cx2341x/fw-memory.txt
@@ -0,0 +1,141 @@
1This document describes the cx2341x memory map and documents some of the register
2space.
3
4Warning! This information was figured out from searching through the memory and
5registers, this information may not be correct and is certainly not complete, and
6was not derived from anything more than searching through the memory space with
7commands like:
8
9 ivtvctl -O min=0x02000000,max=0x020000ff
10
11So take this as is, I'm always searching for more stuff, it's a large
12register space :-).
13
14Memory Map
15==========
16
17The cx2341x exposes its entire 64M memory space to the PCI host via the PCI BAR0
18(Base Address Register 0). The addresses here are offsets relative to the
19address held in BAR0.
20
210x00000000-0x00ffffff Encoder memory space
220x00000000-0x0003ffff Encode.rom
23 ???-??? MPEG buffer(s)
24 ???-??? Raw video capture buffer(s)
25 ???-??? Raw audio capture buffer(s)
26 ???-??? Display buffers (6 or 9)
27
280x01000000-0x01ffffff Decoder memory space
290x01000000-0x0103ffff Decode.rom
30 ???-??? MPEG buffers(s)
310x0114b000-0x0115afff Audio.rom (deprecated?)
32
330x02000000-0x0200ffff Register Space
34
35Registers
36=========
37
38The registers occupy the 64k space starting at the 0x02000000 offset from BAR0.
39All of these registers are 32 bits wide.
40
41DMA Registers 0x000-0xff:
42
43 0x00 - Control:
44 0=reset/cancel, 1=read, 2=write, 4=stop
45 0x04 - DMA status:
46 1=read busy, 2=write busy, 4=read error, 8=write error, 16=link list error
47 0x08 - pci DMA pointer for read link list
48 0x0c - pci DMA pointer for write link list
49 0x10 - read/write DMA enable:
50 1=read enable, 2=write enable
51 0x14 - always 0xffffffff, if set any lower instability occurs, 0x00 crashes
52 0x18 - ??
53 0x1c - always 0x20 or 32, smaller values slow down DMA transactions
54 0x20 - always value of 0x780a010a
55 0x24-0x3c - usually just random values???
56 0x40 - Interrupt status
57 0x44 - Write a bit here and shows up in Interrupt status 0x40
58 0x48 - Interrupt Mask
59 0x4C - always value of 0xfffdffff,
60 if changed to 0xffffffff DMA write interrupts break.
61 0x50 - always 0xffffffff
62 0x54 - always 0xffffffff (0x4c, 0x50, 0x54 seem like interrupt masks, are
63 3 processors on chip, Java ones, VPU, SPU, APU, maybe these are the
64 interrupt masks???).
65 0x60-0x7C - random values
66 0x80 - first write linked list reg, for Encoder Memory addr
67 0x84 - first write linked list reg, for pci memory addr
68 0x88 - first write linked list reg, for length of buffer in memory addr
69 (|0x80000000 or this for last link)
70 0x8c-0xcc - rest of write linked list reg, 8 sets of 3 total, DMA goes here
71 from linked list addr in reg 0x0c, firmware must push through or
72 something.
73 0xe0 - first (and only) read linked list reg, for pci memory addr
74 0xe4 - first (and only) read linked list reg, for Decoder memory addr
75 0xe8 - first (and only) read linked list reg, for length of buffer
76 0xec-0xff - Nothing seems to be in these registers, 0xec-f4 are 0x00000000.
77
78Memory locations for Encoder Buffers 0x700-0x7ff:
79
80These registers show offsets of memory locations pertaining to each
81buffer area used for encoding, have to shift them by <<1 first.
82
830x07F8: Encoder SDRAM refresh
840x07FC: Encoder SDRAM pre-charge
85
86Memory locations for Decoder Buffers 0x800-0x8ff:
87
88These registers show offsets of memory locations pertaining to each
89buffer area used for decoding, have to shift them by <<1 first.
90
910x08F8: Decoder SDRAM refresh
920x08FC: Decoder SDRAM pre-charge
93
94Other memory locations:
95
960x2800: Video Display Module control
970x2D00: AO (audio output?) control
980x2D24: Bytes Flushed
990x7000: LSB I2C write clock bit (inverted)
1000x7004: LSB I2C write data bit (inverted)
1010x7008: LSB I2C read clock bit
1020x700c: LSB I2C read data bit
1030x9008: GPIO get input state
1040x900c: GPIO set output state
1050x9020: GPIO direction (Bit7 (GPIO 0..7) - 0:input, 1:output)
1060x9050: SPU control
1070x9054: Reset HW blocks
1080x9058: VPU control
1090xA018: Bit6: interrupt pending?
1100xA064: APU command
111
112
113Interrupt Status Register
114=========================
115
116The definition of the bits in the interrupt status register 0x0040, and the
117interrupt mask 0x0048. If a bit is cleared in the mask, then we want our ISR to
118execute.
119
120Bit
12131 Encoder Start Capture
12230 Encoder EOS
12329 Encoder VBI capture
12428 Encoder Video Input Module reset event
12527 Encoder DMA complete
12626
12725 Decoder copy protect detection event
12824 Decoder audio mode change detection event
12923
13022 Decoder data request
13121 Decoder I-Frame? done
13220 Decoder DMA complete
13319 Decoder VBI re-insertion
13418 Decoder DMA err (linked-list bad)
135
136Missing
137Encoder API call completed
138Decoder API call completed
139Encoder API post(?)
140Decoder API post(?)
141Decoder VTRACE event
diff --git a/Documentation/video4linux/cx2341x/fw-osd-api.txt b/Documentation/video4linux/cx2341x/fw-osd-api.txt
new file mode 100644
index 000000000000..da98ae30a37a
--- /dev/null
+++ b/Documentation/video4linux/cx2341x/fw-osd-api.txt
@@ -0,0 +1,342 @@
1OSD firmware API description
2============================
3
4Note: this API is part of the decoder firmware, so it's cx23415 only.
5
6-------------------------------------------------------------------------------
7
8Name CX2341X_OSD_GET_FRAMEBUFFER
9Enum 65/0x41
10Description
11 Return base and length of contiguous OSD memory.
12Result[0]
13 OSD base address
14Result[1]
15 OSD length
16
17-------------------------------------------------------------------------------
18
19Name CX2341X_OSD_GET_PIXEL_FORMAT
20Enum 66/0x42
21Description
22 Query OSD format
23Result[0]
24 0=8bit index, 4=AlphaRGB 8:8:8:8
25
26-------------------------------------------------------------------------------
27
28Name CX2341X_OSD_SET_PIXEL_FORMAT
29Enum 67/0x43
30Description
31 Assign pixel format
32Param[0]
33 0=8bit index, 4=AlphaRGB 8:8:8:8
34
35-------------------------------------------------------------------------------
36
37Name CX2341X_OSD_GET_STATE
38Enum 68/0x44
39Description
40 Query OSD state
41Result[0]
42 Bit 0 0=off, 1=on
43 Bits 1:2 alpha control
44 Bits 3:5 pixel format
45
46-------------------------------------------------------------------------------
47
48Name CX2341X_OSD_SET_STATE
49Enum 69/0x45
50Description
51 OSD switch
52Param[0]
53 0=off, 1=on
54
55-------------------------------------------------------------------------------
56
57Name CX2341X_OSD_GET_OSD_COORDS
58Enum 70/0x46
59Description
60 Retrieve coordinates of OSD area blended with video
61Result[0]
62 OSD buffer address
63Result[1]
64 Stride in pixels
65Result[2]
66 Lines in OSD buffer
67Result[3]
68 Horizontal offset in buffer
69Result[4]
70 Vertical offset in buffer
71
72-------------------------------------------------------------------------------
73
74Name CX2341X_OSD_SET_OSD_COORDS
75Enum 71/0x47
76Description
77 Assign the coordinates of the OSD area to blend with video
78Param[0]
79 buffer address
80Param[1]
81 buffer stride in pixels
82Param[2]
83 lines in buffer
84Param[3]
85 horizontal offset
86Param[4]
87 vertical offset
88
89-------------------------------------------------------------------------------
90
91Name CX2341X_OSD_GET_SCREEN_COORDS
92Enum 72/0x48
93Description
94 Retrieve OSD screen area coordinates
95Result[0]
96 top left horizontal offset
97Result[1]
98 top left vertical offset
99Result[2]
100 bottom right hotizontal offset
101Result[3]
102 bottom right vertical offset
103
104-------------------------------------------------------------------------------
105
106Name CX2341X_OSD_SET_SCREEN_COORDS
107Enum 73/0x49
108Description
109 Assign the coordinates of the screen area to blend with video
110Param[0]
111 top left horizontal offset
112Param[1]
113 top left vertical offset
114Param[2]
115 bottom left horizontal offset
116Param[3]
117 bottom left vertical offset
118
119-------------------------------------------------------------------------------
120
121Name CX2341X_OSD_GET_GLOBAL_ALPHA
122Enum 74/0x4A
123Description
124 Retrieve OSD global alpha
125Result[0]
126 global alpha: 0=off, 1=on
127Result[1]
128 bits 0:7 global alpha
129
130-------------------------------------------------------------------------------
131
132Name CX2341X_OSD_SET_GLOBAL_ALPHA
133Enum 75/0x4B
134Description
135 Update global alpha
136Param[0]
137 global alpha: 0=off, 1=on
138Param[1]
139 global alpha (8 bits)
140Param[2]
141 local alpha: 0=on, 1=off
142
143-------------------------------------------------------------------------------
144
145Name CX2341X_OSD_SET_BLEND_COORDS
146Enum 78/0x4C
147Description
148 Move start of blending area within display buffer
149Param[0]
150 horizontal offset in buffer
151Param[1]
152 vertical offset in buffer
153
154-------------------------------------------------------------------------------
155
156Name CX2341X_OSD_GET_FLICKER_STATE
157Enum 79/0x4F
158Description
159 Retrieve flicker reduction module state
160Result[0]
161 flicker state: 0=off, 1=on
162
163-------------------------------------------------------------------------------
164
165Name CX2341X_OSD_SET_FLICKER_STATE
166Enum 80/0x50
167Description
168 Set flicker reduction module state
169Param[0]
170 State: 0=off, 1=on
171
172-------------------------------------------------------------------------------
173
174Name CX2341X_OSD_BLT_COPY
175Enum 82/0x52
176Description
177 BLT copy
178Param[0]
179'0000' zero
180'0001' ~destination AND ~source
181'0010' ~destination AND source
182'0011' ~destination
183'0100' destination AND ~source
184'0101' ~source
185'0110' destination XOR source
186'0111' ~destination OR ~source
187'1000' ~destination AND ~source
188'1001' destination XNOR source
189'1010' source
190'1011' ~destination OR source
191'1100' destination
192'1101' destination OR ~source
193'1110' destination OR source
194'1111' one
195
196Param[1]
197 Resulting alpha blending
198 '01' source_alpha
199 '10' destination_alpha
200 '11' source_alpha*destination_alpha+1
201 (zero if both source and destination alpha are zero)
202Param[2]
203 '00' output_pixel = source_pixel
204
205 '01' if source_alpha=0:
206 output_pixel = destination_pixel
207 if 256 > source_alpha > 1:
208 output_pixel = ((source_alpha + 1)*source_pixel +
209 (255 - source_alpha)*destination_pixel)/256
210
211 '10' if destination_alpha=0:
212 output_pixel = source_pixel
213 if 255 > destination_alpha > 0:
214 output_pixel = ((255 - destination_alpha)*source_pixel +
215 (destination_alpha + 1)*destination_pixel)/256
216
217 '11' if source_alpha=0:
218 source_temp = 0
219 if source_alpha=255:
220 source_temp = source_pixel*256
221 if 255 > source_alpha > 0:
222 source_temp = source_pixel*(source_alpha + 1)
223 if destination_alpha=0:
224 destination_temp = 0
225 if destination_alpha=255:
226 destination_temp = destination_pixel*256
227 if 255 > destination_alpha > 0:
228 destination_temp = destination_pixel*(destination_alpha + 1)
229 output_pixel = (source_temp + destination_temp)/256
230Param[3]
231 width
232Param[4]
233 height
234Param[5]
235 destination pixel mask
236Param[6]
237 destination rectangle start address
238Param[7]
239 destination stride in dwords
240Param[8]
241 source stride in dwords
242Param[9]
243 source rectangle start address
244
245-------------------------------------------------------------------------------
246
247Name CX2341X_OSD_BLT_FILL
248Enum 83/0x53
249Description
250 BLT fill color
251Param[0]
252 Same as Param[0] on API 0x52
253Param[1]
254 Same as Param[1] on API 0x52
255Param[2]
256 Same as Param[2] on API 0x52
257Param[3]
258 width
259Param[4]
260 height
261Param[5]
262 destination pixel mask
263Param[6]
264 destination rectangle start address
265Param[7]
266 destination stride in dwords
267Param[8]
268 color fill value
269
270-------------------------------------------------------------------------------
271
272Name CX2341X_OSD_BLT_TEXT
273Enum 84/0x54
274Description
275 BLT for 8 bit alpha text source
276Param[0]
277 Same as Param[0] on API 0x52
278Param[1]
279 Same as Param[1] on API 0x52
280Param[2]
281 Same as Param[2] on API 0x52
282Param[3]
283 width
284Param[4]
285 height
286Param[5]
287 destination pixel mask
288Param[6]
289 destination rectangle start address
290Param[7]
291 destination stride in dwords
292Param[8]
293 source stride in dwords
294Param[9]
295 source rectangle start address
296Param[10]
297 color fill value
298
299-------------------------------------------------------------------------------
300
301Name CX2341X_OSD_SET_FRAMEBUFFER_WINDOW
302Enum 86/0x56
303Description
304 Positions the main output window on the screen. The coordinates must be
305 such that the entire window fits on the screen.
306Param[0]
307 window width
308Param[1]
309 window height
310Param[2]
311 top left window corner horizontal offset
312Param[3]
313 top left window corner vertical offset
314
315-------------------------------------------------------------------------------
316
317Name CX2341X_OSD_SET_CHROMA_KEY
318Enum 96/0x60
319Description
320 Chroma key switch and color
321Param[0]
322 state: 0=off, 1=on
323Param[1]
324 color
325
326-------------------------------------------------------------------------------
327
328Name CX2341X_OSD_GET_ALPHA_CONTENT_INDEX
329Enum 97/0x61
330Description
331 Retrieve alpha content index
332Result[0]
333 alpha content index, Range 0:15
334
335-------------------------------------------------------------------------------
336
337Name CX2341X_OSD_SET_ALPHA_CONTENT_INDEX
338Enum 98/0x62
339Description
340 Assign alpha content index
341Param[0]
342 alpha content index, range 0:15
diff --git a/Documentation/video4linux/cx2341x/fw-upload.txt b/Documentation/video4linux/cx2341x/fw-upload.txt
new file mode 100644
index 000000000000..60c502ce3215
--- /dev/null
+++ b/Documentation/video4linux/cx2341x/fw-upload.txt
@@ -0,0 +1,49 @@
1This document describes how to upload the cx2341x firmware to the card.
2
3How to find
4===========
5
6See the web pages of the various projects that uses this chip for information
7on how to obtain the firmware.
8
9The firmware stored in a Windows driver can be detected as follows:
10
11- Each firmware image is 256k bytes.
12- The 1st 32-bit word of the Encoder image is 0x0000da7
13- The 1st 32-bit word of the Decoder image is 0x00003a7
14- The 2nd 32-bit word of both images is 0xaa55bb66
15
16How to load
17===========
18
19- Issue the FWapi command to stop the encoder if it is running. Wait for the
20 command to complete.
21- Issue the FWapi command to stop the decoder if it is running. Wait for the
22 command to complete.
23- Issue the I2C command to the digitizer to stop emitting VSYNC events.
24- Issue the FWapi command to halt the encoder's firmware.
25- Sleep for 10ms.
26- Issue the FWapi command to halt the decoder's firmware.
27- Sleep for 10ms.
28- Write 0x00000000 to register 0x2800 to stop the Video Display Module.
29- Write 0x00000005 to register 0x2D00 to stop the AO (audio output?).
30- Write 0x00000000 to register 0xA064 to ping? the APU.
31- Write 0xFFFFFFFE to register 0x9058 to stop the VPU.
32- Write 0xFFFFFFFF to register 0x9054 to reset the HW blocks.
33- Write 0x00000001 to register 0x9050 to stop the SPU.
34- Sleep for 10ms.
35- Write 0x0000001A to register 0x07FC to init the Encoder SDRAM's pre-charge.
36- Write 0x80000640 to register 0x07F8 to init the Encoder SDRAM's refresh to 1us.
37- Write 0x0000001A to register 0x08FC to init the Decoder SDRAM's pre-charge.
38- Write 0x80000640 to register 0x08F8 to init the Decoder SDRAM's refresh to 1us.
39- Sleep for 512ms. (600ms is recommended)
40- Transfer the encoder's firmware image to offset 0 in Encoder memory space.
41- Transfer the decoder's firmware image to offset 0 in Decoder memory space.
42- Use a read-modify-write operation to Clear bit 0 of register 0x9050 to
43 re-enable the SPU.
44- Sleep for 1 second.
45- Use a read-modify-write operation to Clear bits 3 and 0 of register 0x9058
46 to re-enable the VPU.
47- Sleep for 1 second.
48- Issue status API commands to both firmware images to verify.
49
diff --git a/Documentation/video4linux/cx88/hauppauge-wintv-cx88-ir.txt b/Documentation/video4linux/cx88/hauppauge-wintv-cx88-ir.txt
new file mode 100644
index 000000000000..93fec32a1188
--- /dev/null
+++ b/Documentation/video4linux/cx88/hauppauge-wintv-cx88-ir.txt
@@ -0,0 +1,54 @@
1The controls for the mux are GPIO [0,1] for source, and GPIO 2 for muting.
2
3GPIO0 GPIO1
4 0 0 TV Audio
5 1 0 FM radio
6 0 1 Line-In
7 1 1 Mono tuner bypass or CD passthru (tuner specific)
8
9GPIO 16(i believe) is tied to the IR port (if present).
10
11------------------------------------------------------------------------------------
12
13>From the data sheet:
14 Register 24'h20004 PCI Interrupt Status
15 bit [18] IR_SMP_INT Set when 32 input samples have been collected over
16 gpio[16] pin into GP_SAMPLE register.
17
18What's missing from the data sheet:
19
20Setup 4KHz sampling rate (roughly 2x oversampled; good enough for our RC5
21compat remote)
22set register 0x35C050 to 0xa80a80
23
24enable sampling
25set register 0x35C054 to 0x5
26
27Of course, enable the IRQ bit 18 in the interrupt mask register .(and
28provide for a handler)
29
30GP_SAMPLE register is at 0x35C058
31
32Bits are then right shifted into the GP_SAMPLE register at the specified
33rate; you get an interrupt when a full DWORD is recieved.
34You need to recover the actual RC5 bits out of the (oversampled) IR sensor
35bits. (Hint: look for the 0/1and 1/0 crossings of the RC5 bi-phase data) An
36actual raw RC5 code will span 2-3 DWORDS, depending on the actual alignment.
37
38I'm pretty sure when no IR signal is present the receiver is always in a
39marking state(1); but stray light, etc can cause intermittent noise values
40as well. Remember, this is a free running sample of the IR receiver state
41over time, so don't assume any sample starts at any particular place.
42
43http://www.atmel.com/dyn/resources/prod_documents/doc2817.pdf
44This data sheet (google search) seems to have a lovely description of the
45RC5 basics
46
47http://users.pandora.be/nenya/electronics/rc5/ and more data
48
49http://www.ee.washington.edu/circuit_archive/text/ir_decode.txt
50and even a reference to how to decode a bi-phase data stream.
51
52http://www.xs4all.nl/~sbp/knowledge/ir/rc5.htm
53still more info
54
diff --git a/Documentation/video4linux/et61x251.txt b/Documentation/video4linux/et61x251.txt
index 29340282ab5f..cd584f20a997 100644
--- a/Documentation/video4linux/et61x251.txt
+++ b/Documentation/video4linux/et61x251.txt
@@ -1,9 +1,9 @@
1 1
2 ET61X[12]51 PC Camera Controllers 2 ET61X[12]51 PC Camera Controllers
3 Driver for Linux 3 Driver for Linux
4 ================================= 4 =================================
5 5
6 - Documentation - 6 - Documentation -
7 7
8 8
9Index 9Index
@@ -156,46 +156,46 @@ Name: video_nr
156Type: short array (min = 0, max = 64) 156Type: short array (min = 0, max = 64)
157Syntax: <-1|n[,...]> 157Syntax: <-1|n[,...]>
158Description: Specify V4L2 minor mode number: 158Description: Specify V4L2 minor mode number:
159 -1 = use next available 159 -1 = use next available
160 n = use minor number n 160 n = use minor number n
161 You can specify up to 64 cameras this way. 161 You can specify up to 64 cameras this way.
162 For example: 162 For example:
163 video_nr=-1,2,-1 would assign minor number 2 to the second 163 video_nr=-1,2,-1 would assign minor number 2 to the second
164 registered camera and use auto for the first one and for every 164 registered camera and use auto for the first one and for every
165 other camera. 165 other camera.
166Default: -1 166Default: -1
167------------------------------------------------------------------------------- 167-------------------------------------------------------------------------------
168Name: force_munmap 168Name: force_munmap
169Type: bool array (min = 0, max = 64) 169Type: bool array (min = 0, max = 64)
170Syntax: <0|1[,...]> 170Syntax: <0|1[,...]>
171Description: Force the application to unmap previously mapped buffer memory 171Description: Force the application to unmap previously mapped buffer memory
172 before calling any VIDIOC_S_CROP or VIDIOC_S_FMT ioctl's. Not 172 before calling any VIDIOC_S_CROP or VIDIOC_S_FMT ioctl's. Not
173 all the applications support this feature. This parameter is 173 all the applications support this feature. This parameter is
174 specific for each detected camera. 174 specific for each detected camera.
175 0 = do not force memory unmapping 175 0 = do not force memory unmapping
176 1 = force memory unmapping (save memory) 176 1 = force memory unmapping (save memory)
177Default: 0 177Default: 0
178------------------------------------------------------------------------------- 178-------------------------------------------------------------------------------
179Name: frame_timeout 179Name: frame_timeout
180Type: uint array (min = 0, max = 64) 180Type: uint array (min = 0, max = 64)
181Syntax: <n[,...]> 181Syntax: <n[,...]>
182Description: Timeout for a video frame in seconds. This parameter is 182Description: Timeout for a video frame in seconds. This parameter is
183 specific for each detected camera. This parameter can be 183 specific for each detected camera. This parameter can be
184 changed at runtime thanks to the /sys filesystem interface. 184 changed at runtime thanks to the /sys filesystem interface.
185Default: 2 185Default: 2
186------------------------------------------------------------------------------- 186-------------------------------------------------------------------------------
187Name: debug 187Name: debug
188Type: ushort 188Type: ushort
189Syntax: <n> 189Syntax: <n>
190Description: Debugging information level, from 0 to 3: 190Description: Debugging information level, from 0 to 3:
191 0 = none (use carefully) 191 0 = none (use carefully)
192 1 = critical errors 192 1 = critical errors
193 2 = significant informations 193 2 = significant informations
194 3 = more verbose messages 194 3 = more verbose messages
195 Level 3 is useful for testing only, when only one device 195 Level 3 is useful for testing only, when only one device
196 is used at the same time. It also shows some more informations 196 is used at the same time. It also shows some more informations
197 about the hardware being detected. This module parameter can be 197 about the hardware being detected. This module parameter can be
198 changed at runtime thanks to the /sys filesystem interface. 198 changed at runtime thanks to the /sys filesystem interface.
199Default: 2 199Default: 2
200------------------------------------------------------------------------------- 200-------------------------------------------------------------------------------
201 201
diff --git a/Documentation/video4linux/ibmcam.txt b/Documentation/video4linux/ibmcam.txt
index 4a40a2e99451..397a94eb77b8 100644
--- a/Documentation/video4linux/ibmcam.txt
+++ b/Documentation/video4linux/ibmcam.txt
@@ -21,7 +21,7 @@ Internal interface: Video For Linux (V4L)
21Supported controls: 21Supported controls:
22- by V4L: Contrast, Brightness, Color, Hue 22- by V4L: Contrast, Brightness, Color, Hue
23- by driver options: frame rate, lighting conditions, video format, 23- by driver options: frame rate, lighting conditions, video format,
24 default picture settings, sharpness. 24 default picture settings, sharpness.
25 25
26SUPPORTED CAMERAS: 26SUPPORTED CAMERAS:
27 27
@@ -191,66 +191,66 @@ init_model2_sat Integer 0..255 [0x34] init_model2_sat=65
191init_model2_yb Integer 0..255 [0xa0] init_model2_yb=200 191init_model2_yb Integer 0..255 [0xa0] init_model2_yb=200
192 192
193debug You don't need this option unless you are a developer. 193debug You don't need this option unless you are a developer.
194 If you are a developer then you will see in the code 194 If you are a developer then you will see in the code
195 what values do what. 0=off. 195 what values do what. 0=off.
196 196
197flags This is a bit mask, and you can combine any number of 197flags This is a bit mask, and you can combine any number of
198 bits to produce what you want. Usually you don't want 198 bits to produce what you want. Usually you don't want
199 any of extra features this option provides: 199 any of extra features this option provides:
200 200
201 FLAGS_RETRY_VIDIOCSYNC 1 This bit allows to retry failed 201 FLAGS_RETRY_VIDIOCSYNC 1 This bit allows to retry failed
202 VIDIOCSYNC ioctls without failing. 202 VIDIOCSYNC ioctls without failing.
203 Will work with xawtv, will not 203 Will work with xawtv, will not
204 with xrealproducer. Default is 204 with xrealproducer. Default is
205 not set. 205 not set.
206 FLAGS_MONOCHROME 2 Activates monochrome (b/w) mode. 206 FLAGS_MONOCHROME 2 Activates monochrome (b/w) mode.
207 FLAGS_DISPLAY_HINTS 4 Shows colored pixels which have 207 FLAGS_DISPLAY_HINTS 4 Shows colored pixels which have
208 magic meaning to developers. 208 magic meaning to developers.
209 FLAGS_OVERLAY_STATS 8 Shows tiny numbers on screen, 209 FLAGS_OVERLAY_STATS 8 Shows tiny numbers on screen,
210 useful only for debugging. 210 useful only for debugging.
211 FLAGS_FORCE_TESTPATTERN 16 Shows blue screen with numbers. 211 FLAGS_FORCE_TESTPATTERN 16 Shows blue screen with numbers.
212 FLAGS_SEPARATE_FRAMES 32 Shows each frame separately, as 212 FLAGS_SEPARATE_FRAMES 32 Shows each frame separately, as
213 it was received from the camera. 213 it was received from the camera.
214 Default (not set) is to mix the 214 Default (not set) is to mix the
215 preceding frame in to compensate 215 preceding frame in to compensate
216 for occasional loss of Isoc data 216 for occasional loss of Isoc data
217 on high frame rates. 217 on high frame rates.
218 FLAGS_CLEAN_FRAMES 64 Forces "cleanup" of each frame 218 FLAGS_CLEAN_FRAMES 64 Forces "cleanup" of each frame
219 prior to use; relevant only if 219 prior to use; relevant only if
220 FLAGS_SEPARATE_FRAMES is set. 220 FLAGS_SEPARATE_FRAMES is set.
221 Default is not to clean frames, 221 Default is not to clean frames,
222 this is a little faster but may 222 this is a little faster but may
223 produce flicker if frame rate is 223 produce flicker if frame rate is
224 too high and Isoc data gets lost. 224 too high and Isoc data gets lost.
225 FLAGS_NO_DECODING 128 This flag turns the video stream 225 FLAGS_NO_DECODING 128 This flag turns the video stream
226 decoder off, and dumps the raw 226 decoder off, and dumps the raw
227 Isoc data from the camera into 227 Isoc data from the camera into
228 the reading process. Useful to 228 the reading process. Useful to
229 developers, but not to users. 229 developers, but not to users.
230 230
231framerate This setting controls frame rate of the camera. This is 231framerate This setting controls frame rate of the camera. This is
232 an approximate setting (in terms of "worst" ... "best") 232 an approximate setting (in terms of "worst" ... "best")
233 because camera changes frame rate depending on amount 233 because camera changes frame rate depending on amount
234 of light available. Setting 0 is slowest, 6 is fastest. 234 of light available. Setting 0 is slowest, 6 is fastest.
235 Beware - fast settings are very demanding and may not 235 Beware - fast settings are very demanding and may not
236 work well with all video sizes. Be conservative. 236 work well with all video sizes. Be conservative.
237 237
238hue_correction This highly optional setting allows to adjust the 238hue_correction This highly optional setting allows to adjust the
239 hue of the image in a way slightly different from 239 hue of the image in a way slightly different from
240 what usual "hue" control does. Both controls affect 240 what usual "hue" control does. Both controls affect
241 YUV colorspace: regular "hue" control adjusts only 241 YUV colorspace: regular "hue" control adjusts only
242 U component, and this "hue_correction" option similarly 242 U component, and this "hue_correction" option similarly
243 adjusts only V component. However usually it is enough 243 adjusts only V component. However usually it is enough
244 to tweak only U or V to compensate for colored light or 244 to tweak only U or V to compensate for colored light or
245 color temperature; this option simply allows more 245 color temperature; this option simply allows more
246 complicated correction when and if it is necessary. 246 complicated correction when and if it is necessary.
247 247
248init_brightness These settings specify _initial_ values which will be 248init_brightness These settings specify _initial_ values which will be
249init_contrast used to set up the camera. If your V4L application has 249init_contrast used to set up the camera. If your V4L application has
250init_color its own controls to adjust the picture then these 250init_color its own controls to adjust the picture then these
251init_hue controls will be used too. These options allow you to 251init_hue controls will be used too. These options allow you to
252 preconfigure the camera when it gets connected, before 252 preconfigure the camera when it gets connected, before
253 any V4L application connects to it. Good for webcams. 253 any V4L application connects to it. Good for webcams.
254 254
255init_model2_rg These initial settings alter color balance of the 255init_model2_rg These initial settings alter color balance of the
256init_model2_rg2 camera on hardware level. All four settings may be used 256init_model2_rg2 camera on hardware level. All four settings may be used
@@ -258,47 +258,47 @@ init_model2_sat to tune the camera to specific lighting conditions. These
258init_model2_yb settings only apply to Model 2 cameras. 258init_model2_yb settings only apply to Model 2 cameras.
259 259
260lighting This option selects one of three hardware-defined 260lighting This option selects one of three hardware-defined
261 photosensitivity settings of the camera. 0=bright light, 261 photosensitivity settings of the camera. 0=bright light,
262 1=Medium (default), 2=Low light. This setting affects 262 1=Medium (default), 2=Low light. This setting affects
263 frame rate: the dimmer the lighting the lower the frame 263 frame rate: the dimmer the lighting the lower the frame
264 rate (because longer exposition time is needed). The 264 rate (because longer exposition time is needed). The
265 Model 2 cameras allow values more than 2 for this option, 265 Model 2 cameras allow values more than 2 for this option,
266 thus enabling extremely high sensitivity at cost of frame 266 thus enabling extremely high sensitivity at cost of frame
267 rate, color saturation and imaging sensor noise. 267 rate, color saturation and imaging sensor noise.
268 268
269sharpness This option controls smoothing (noise reduction) 269sharpness This option controls smoothing (noise reduction)
270 made by camera. Setting 0 is most smooth, setting 6 270 made by camera. Setting 0 is most smooth, setting 6
271 is most sharp. Be aware that CMOS sensor used in the 271 is most sharp. Be aware that CMOS sensor used in the
272 camera is pretty noisy, so if you choose 6 you will 272 camera is pretty noisy, so if you choose 6 you will
273 be greeted with "snowy" image. Default is 4. Model 2 273 be greeted with "snowy" image. Default is 4. Model 2
274 cameras do not support this feature. 274 cameras do not support this feature.
275 275
276size This setting chooses one of several image sizes that are 276size This setting chooses one of several image sizes that are
277 supported by this driver. Cameras may support more, but 277 supported by this driver. Cameras may support more, but
278 it's difficult to reverse-engineer all formats. 278 it's difficult to reverse-engineer all formats.
279 Following video sizes are supported: 279 Following video sizes are supported:
280 280
281 size=0 128x96 (Model 1 only) 281 size=0 128x96 (Model 1 only)
282 size=1 160x120 282 size=1 160x120
283 size=2 176x144 283 size=2 176x144
284 size=3 320x240 (Model 2 only) 284 size=3 320x240 (Model 2 only)
285 size=4 352x240 (Model 2 only) 285 size=4 352x240 (Model 2 only)
286 size=5 352x288 286 size=5 352x288
287 size=6 640x480 (Model 3 only) 287 size=6 640x480 (Model 3 only)
288 288
289 The 352x288 is the native size of the Model 1 sensor 289 The 352x288 is the native size of the Model 1 sensor
290 array, so it's the best resolution the camera can 290 array, so it's the best resolution the camera can
291 yield. The best resolution of Model 2 is 176x144, and 291 yield. The best resolution of Model 2 is 176x144, and
292 larger images are produced by stretching the bitmap. 292 larger images are produced by stretching the bitmap.
293 Model 3 has sensor with 640x480 grid, and it works too, 293 Model 3 has sensor with 640x480 grid, and it works too,
294 but the frame rate will be exceptionally low (1-2 FPS); 294 but the frame rate will be exceptionally low (1-2 FPS);
295 it may be still OK for some applications, like security. 295 it may be still OK for some applications, like security.
296 Choose the image size you need. The smaller image can 296 Choose the image size you need. The smaller image can
297 support faster frame rate. Default is 352x288. 297 support faster frame rate. Default is 352x288.
298 298
299For more information and the Troubleshooting FAQ visit this URL: 299For more information and the Troubleshooting FAQ visit this URL:
300 300
301 http://www.linux-usb.org/ibmcam/ 301 http://www.linux-usb.org/ibmcam/
302 302
303WHAT NEEDS TO BE DONE: 303WHAT NEEDS TO BE DONE:
304 304
diff --git a/Documentation/video4linux/ov511.txt b/Documentation/video4linux/ov511.txt
index 142741e3c578..79af610d4ba5 100644
--- a/Documentation/video4linux/ov511.txt
+++ b/Documentation/video4linux/ov511.txt
@@ -81,7 +81,7 @@ MODULE PARAMETERS:
81 TYPE: integer (Boolean) 81 TYPE: integer (Boolean)
82 DEFAULT: 1 82 DEFAULT: 1
83 DESC: Brightness is normally under automatic control and can't be set 83 DESC: Brightness is normally under automatic control and can't be set
84 manually by the video app. Set to 0 for manual control. 84 manually by the video app. Set to 0 for manual control.
85 85
86 NAME: autogain 86 NAME: autogain
87 TYPE: integer (Boolean) 87 TYPE: integer (Boolean)
@@ -97,13 +97,13 @@ MODULE PARAMETERS:
97 TYPE: integer (0-6) 97 TYPE: integer (0-6)
98 DEFAULT: 3 98 DEFAULT: 3
99 DESC: Sets the threshold for printing debug messages. The higher the value, 99 DESC: Sets the threshold for printing debug messages. The higher the value,
100 the more is printed. The levels are cumulative, and are as follows: 100 the more is printed. The levels are cumulative, and are as follows:
101 0=no debug messages 101 0=no debug messages
102 1=init/detection/unload and other significant messages 102 1=init/detection/unload and other significant messages
103 2=some warning messages 103 2=some warning messages
104 3=config/control function calls 104 3=config/control function calls
105 4=most function calls and data parsing messages 105 4=most function calls and data parsing messages
106 5=highly repetitive mesgs 106 5=highly repetitive mesgs
107 107
108 NAME: snapshot 108 NAME: snapshot
109 TYPE: integer (Boolean) 109 TYPE: integer (Boolean)
@@ -116,24 +116,24 @@ MODULE PARAMETERS:
116 TYPE: integer (1-4 for OV511, 1-31 for OV511+) 116 TYPE: integer (1-4 for OV511, 1-31 for OV511+)
117 DEFAULT: 1 117 DEFAULT: 1
118 DESC: Number of cameras allowed to stream simultaneously on a single bus. 118 DESC: Number of cameras allowed to stream simultaneously on a single bus.
119 Values higher than 1 reduce the data rate of each camera, allowing two 119 Values higher than 1 reduce the data rate of each camera, allowing two
120 or more to be used at once. If you have a complicated setup involving 120 or more to be used at once. If you have a complicated setup involving
121 both OV511 and OV511+ cameras, trial-and-error may be necessary for 121 both OV511 and OV511+ cameras, trial-and-error may be necessary for
122 finding the optimum setting. 122 finding the optimum setting.
123 123
124 NAME: compress 124 NAME: compress
125 TYPE: integer (Boolean) 125 TYPE: integer (Boolean)
126 DEFAULT: 0 126 DEFAULT: 0
127 DESC: Set this to 1 to turn on the camera's compression engine. This can 127 DESC: Set this to 1 to turn on the camera's compression engine. This can
128 potentially increase the frame rate at the expense of quality, if you 128 potentially increase the frame rate at the expense of quality, if you
129 have a fast CPU. You must load the proper compression module for your 129 have a fast CPU. You must load the proper compression module for your
130 camera before starting your application (ov511_decomp or ov518_decomp). 130 camera before starting your application (ov511_decomp or ov518_decomp).
131 131
132 NAME: testpat 132 NAME: testpat
133 TYPE: integer (Boolean) 133 TYPE: integer (Boolean)
134 DEFAULT: 0 134 DEFAULT: 0
135 DESC: This configures the camera's sensor to transmit a colored test-pattern 135 DESC: This configures the camera's sensor to transmit a colored test-pattern
136 instead of an image. This does not work correctly yet. 136 instead of an image. This does not work correctly yet.
137 137
138 NAME: dumppix 138 NAME: dumppix
139 TYPE: integer (0-2) 139 TYPE: integer (0-2)
diff --git a/Documentation/video4linux/sn9c102.txt b/Documentation/video4linux/sn9c102.txt
index 142920bc011f..1d20895b4354 100644
--- a/Documentation/video4linux/sn9c102.txt
+++ b/Documentation/video4linux/sn9c102.txt
@@ -1,9 +1,9 @@
1 1
2 SN9C10x PC Camera Controllers 2 SN9C10x PC Camera Controllers
3 Driver for Linux 3 Driver for Linux
4 ============================= 4 =============================
5 5
6 - Documentation - 6 - Documentation -
7 7
8 8
9Index 9Index
@@ -176,46 +176,46 @@ Name: video_nr
176Type: short array (min = 0, max = 64) 176Type: short array (min = 0, max = 64)
177Syntax: <-1|n[,...]> 177Syntax: <-1|n[,...]>
178Description: Specify V4L2 minor mode number: 178Description: Specify V4L2 minor mode number:
179 -1 = use next available 179 -1 = use next available
180 n = use minor number n 180 n = use minor number n
181 You can specify up to 64 cameras this way. 181 You can specify up to 64 cameras this way.
182 For example: 182 For example:
183 video_nr=-1,2,-1 would assign minor number 2 to the second 183 video_nr=-1,2,-1 would assign minor number 2 to the second
184 recognized camera and use auto for the first one and for every 184 recognized camera and use auto for the first one and for every
185 other camera. 185 other camera.
186Default: -1 186Default: -1
187------------------------------------------------------------------------------- 187-------------------------------------------------------------------------------
188Name: force_munmap 188Name: force_munmap
189Type: bool array (min = 0, max = 64) 189Type: bool array (min = 0, max = 64)
190Syntax: <0|1[,...]> 190Syntax: <0|1[,...]>
191Description: Force the application to unmap previously mapped buffer memory 191Description: Force the application to unmap previously mapped buffer memory
192 before calling any VIDIOC_S_CROP or VIDIOC_S_FMT ioctl's. Not 192 before calling any VIDIOC_S_CROP or VIDIOC_S_FMT ioctl's. Not
193 all the applications support this feature. This parameter is 193 all the applications support this feature. This parameter is
194 specific for each detected camera. 194 specific for each detected camera.
195 0 = do not force memory unmapping 195 0 = do not force memory unmapping
196 1 = force memory unmapping (save memory) 196 1 = force memory unmapping (save memory)
197Default: 0 197Default: 0
198------------------------------------------------------------------------------- 198-------------------------------------------------------------------------------
199Name: frame_timeout 199Name: frame_timeout
200Type: uint array (min = 0, max = 64) 200Type: uint array (min = 0, max = 64)
201Syntax: <n[,...]> 201Syntax: <n[,...]>
202Description: Timeout for a video frame in seconds. This parameter is 202Description: Timeout for a video frame in seconds. This parameter is
203 specific for each detected camera. This parameter can be 203 specific for each detected camera. This parameter can be
204 changed at runtime thanks to the /sys filesystem interface. 204 changed at runtime thanks to the /sys filesystem interface.
205Default: 2 205Default: 2
206------------------------------------------------------------------------------- 206-------------------------------------------------------------------------------
207Name: debug 207Name: debug
208Type: ushort 208Type: ushort
209Syntax: <n> 209Syntax: <n>
210Description: Debugging information level, from 0 to 3: 210Description: Debugging information level, from 0 to 3:
211 0 = none (use carefully) 211 0 = none (use carefully)
212 1 = critical errors 212 1 = critical errors
213 2 = significant informations 213 2 = significant informations
214 3 = more verbose messages 214 3 = more verbose messages
215 Level 3 is useful for testing only, when only one device 215 Level 3 is useful for testing only, when only one device
216 is used. It also shows some more informations about the 216 is used. It also shows some more informations about the
217 hardware being detected. This parameter can be changed at 217 hardware being detected. This parameter can be changed at
218 runtime thanks to the /sys filesystem interface. 218 runtime thanks to the /sys filesystem interface.
219Default: 2 219Default: 2
220------------------------------------------------------------------------------- 220-------------------------------------------------------------------------------
221 221
@@ -280,24 +280,24 @@ Byte # Value Description
2800x04 0xC4 Frame synchronisation pattern. 2800x04 0xC4 Frame synchronisation pattern.
2810x05 0x96 Frame synchronisation pattern. 2810x05 0x96 Frame synchronisation pattern.
2820x06 0xXX Unknown meaning. The exact value depends on the chip; 2820x06 0xXX Unknown meaning. The exact value depends on the chip;
283 possible values are 0x00, 0x01 and 0x20. 283 possible values are 0x00, 0x01 and 0x20.
2840x07 0xXX Variable value, whose bits are ff00uzzc, where ff is a 2840x07 0xXX Variable value, whose bits are ff00uzzc, where ff is a
285 frame counter, u is unknown, zz is a size indicator 285 frame counter, u is unknown, zz is a size indicator
286 (00 = VGA, 01 = SIF, 10 = QSIF) and c stands for 286 (00 = VGA, 01 = SIF, 10 = QSIF) and c stands for
287 "compression enabled" (1 = yes, 0 = no). 287 "compression enabled" (1 = yes, 0 = no).
2880x08 0xXX Brightness sum inside Auto-Exposure area (low-byte). 2880x08 0xXX Brightness sum inside Auto-Exposure area (low-byte).
2890x09 0xXX Brightness sum inside Auto-Exposure area (high-byte). 2890x09 0xXX Brightness sum inside Auto-Exposure area (high-byte).
290 For a pure white image, this number will be equal to 500 290 For a pure white image, this number will be equal to 500
291 times the area of the specified AE area. For images 291 times the area of the specified AE area. For images
292 that are not pure white, the value scales down according 292 that are not pure white, the value scales down according
293 to relative whiteness. 293 to relative whiteness.
2940x0A 0xXX Brightness sum outside Auto-Exposure area (low-byte). 2940x0A 0xXX Brightness sum outside Auto-Exposure area (low-byte).
2950x0B 0xXX Brightness sum outside Auto-Exposure area (high-byte). 2950x0B 0xXX Brightness sum outside Auto-Exposure area (high-byte).
296 For a pure white image, this number will be equal to 125 296 For a pure white image, this number will be equal to 125
297 times the area outside of the specified AE area. For 297 times the area outside of the specified AE area. For
298 images that are not pure white, the value scales down 298 images that are not pure white, the value scales down
299 according to relative whiteness. 299 according to relative whiteness.
300 according to relative whiteness. 300 according to relative whiteness.
301 301
302The following bytes are used by the SN9C103 bridge only: 302The following bytes are used by the SN9C103 bridge only:
303 303
diff --git a/Documentation/video4linux/v4lgrab.c b/Documentation/video4linux/v4lgrab.c
new file mode 100644
index 000000000000..079b628481cf
--- /dev/null
+++ b/Documentation/video4linux/v4lgrab.c
@@ -0,0 +1,192 @@
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
16#include <unistd.h>
17#include <sys/types.h>
18#include <sys/stat.h>
19#include <fcntl.h>
20#include <stdio.h>
21#include <sys/ioctl.h>
22#include <stdlib.h>
23
24#include <linux/types.h>
25#include <linux/videodev.h>
26
27#define FILE "/dev/video0"
28
29/* Stole this from tvset.c */
30
31#define READ_VIDEO_PIXEL(buf, format, depth, r, g, b) \
32{ \
33 switch (format) \
34 { \
35 case VIDEO_PALETTE_GREY: \
36 switch (depth) \
37 { \
38 case 4: \
39 case 6: \
40 case 8: \
41 (r) = (g) = (b) = (*buf++ << 8);\
42 break; \
43 \
44 case 16: \
45 (r) = (g) = (b) = \
46 *((unsigned short *) buf); \
47 buf += 2; \
48 break; \
49 } \
50 break; \
51 \
52 \
53 case VIDEO_PALETTE_RGB565: \
54 { \
55 unsigned short tmp = *(unsigned short *)buf; \
56 (r) = tmp&0xF800; \
57 (g) = (tmp<<5)&0xFC00; \
58 (b) = (tmp<<11)&0xF800; \
59 buf += 2; \
60 } \
61 break; \
62 \
63 case VIDEO_PALETTE_RGB555: \
64 (r) = (buf[0]&0xF8)<<8; \
65 (g) = ((buf[0] << 5 | buf[1] >> 3)&0xF8)<<8; \
66 (b) = ((buf[1] << 2 ) & 0xF8)<<8; \
67 buf += 2; \
68 break; \
69 \
70 case VIDEO_PALETTE_RGB24: \
71 (r) = buf[0] << 8; (g) = buf[1] << 8; \
72 (b) = buf[2] << 8; \
73 buf += 3; \
74 break; \
75 \
76 default: \
77 fprintf(stderr, \
78 "Format %d not yet supported\n", \
79 format); \
80 } \
81}
82
83int get_brightness_adj(unsigned char *image, long size, int *brightness) {
84 long i, tot = 0;
85 for (i=0;i<size*3;i++)
86 tot += image[i];
87 *brightness = (128 - tot/(size*3))/3;
88 return !((tot/(size*3)) >= 126 && (tot/(size*3)) <= 130);
89}
90
91int main(int argc, char ** argv)
92{
93 int fd = open(FILE, O_RDONLY), f;
94 struct video_capability cap;
95 struct video_window win;
96 struct video_picture vpic;
97
98 unsigned char *buffer, *src;
99 int bpp = 24, r, g, b;
100 unsigned int i, src_depth;
101
102 if (fd < 0) {
103 perror(FILE);
104 exit(1);
105 }
106
107 if (ioctl(fd, VIDIOCGCAP, &cap) < 0) {
108 perror("VIDIOGCAP");
109 fprintf(stderr, "(" FILE " not a video4linux device?)\n");
110 close(fd);
111 exit(1);
112 }
113
114 if (ioctl(fd, VIDIOCGWIN, &win) < 0) {
115 perror("VIDIOCGWIN");
116 close(fd);
117 exit(1);
118 }
119
120 if (ioctl(fd, VIDIOCGPICT, &vpic) < 0) {
121 perror("VIDIOCGPICT");
122 close(fd);
123 exit(1);
124 }
125
126 if (cap.type & VID_TYPE_MONOCHROME) {
127 vpic.depth=8;
128 vpic.palette=VIDEO_PALETTE_GREY; /* 8bit grey */
129 if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) {
130 vpic.depth=6;
131 if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) {
132 vpic.depth=4;
133 if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) {
134 fprintf(stderr, "Unable to find a supported capture format.\n");
135 close(fd);
136 exit(1);
137 }
138 }
139 }
140 } else {
141 vpic.depth=24;
142 vpic.palette=VIDEO_PALETTE_RGB24;
143
144 if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) {
145 vpic.palette=VIDEO_PALETTE_RGB565;
146 vpic.depth=16;
147
148 if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) {
149 vpic.palette=VIDEO_PALETTE_RGB555;
150 vpic.depth=15;
151
152 if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) {
153 fprintf(stderr, "Unable to find a supported capture format.\n");
154 return -1;
155 }
156 }
157 }
158 }
159
160 buffer = malloc(win.width * win.height * bpp);
161 if (!buffer) {
162 fprintf(stderr, "Out of memory.\n");
163 exit(1);
164 }
165
166 do {
167 int newbright;
168 read(fd, buffer, win.width * win.height * bpp);
169 f = get_brightness_adj(buffer, win.width * win.height, &newbright);
170 if (f) {
171 vpic.brightness += (newbright << 8);
172 if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) {
173 perror("VIDIOSPICT");
174 break;
175 }
176 }
177 } while (f);
178
179 fprintf(stdout, "P6\n%d %d 255\n", win.width, win.height);
180
181 src = buffer;
182
183 for (i = 0; i < win.width * win.height; i++) {
184 READ_VIDEO_PIXEL(src, vpic.palette, src_depth, r, g, b);
185 fputc(r>>8, stdout);
186 fputc(g>>8, stdout);
187 fputc(b>>8, stdout);
188 }
189
190 close(fd);
191 return 0;
192}
diff --git a/Documentation/video4linux/w9968cf.txt b/Documentation/video4linux/w9968cf.txt
index 3b704f2aae6d..0d53ce774b01 100644
--- a/Documentation/video4linux/w9968cf.txt
+++ b/Documentation/video4linux/w9968cf.txt
@@ -1,9 +1,9 @@
1 1
2 W996[87]CF JPEG USB Dual Mode Camera Chip 2 W996[87]CF JPEG USB Dual Mode Camera Chip
3 Driver for Linux 2.6 (basic version) 3 Driver for Linux 2.6 (basic version)
4 ========================================= 4 =========================================
5 5
6 - Documentation - 6 - Documentation -
7 7
8 8
9Index 9Index
@@ -188,57 +188,57 @@ Name: ovmod_load
188Type: bool 188Type: bool
189Syntax: <0|1> 189Syntax: <0|1>
190Description: Automatic 'ovcamchip' module loading: 0 disabled, 1 enabled. 190Description: Automatic 'ovcamchip' module loading: 0 disabled, 1 enabled.
191 If enabled, 'insmod' searches for the required 'ovcamchip' 191 If enabled, 'insmod' searches for the required 'ovcamchip'
192 module in the system, according to its configuration, and 192 module in the system, according to its configuration, and
193 loads that module automatically. This action is performed as 193 loads that module automatically. This action is performed as
194 once soon as the 'w9968cf' module is loaded into memory. 194 once soon as the 'w9968cf' module is loaded into memory.
195Default: 1 195Default: 1
196Note: The kernel must be compiled with the CONFIG_KMOD option 196Note: The kernel must be compiled with the CONFIG_KMOD option
197 enabled for the 'ovcamchip' module to be loaded and for 197 enabled for the 'ovcamchip' module to be loaded and for
198 this parameter to be present. 198 this parameter to be present.
199------------------------------------------------------------------------------- 199-------------------------------------------------------------------------------
200Name: simcams 200Name: simcams
201Type: int 201Type: int
202Syntax: <n> 202Syntax: <n>
203Description: Number of cameras allowed to stream simultaneously. 203Description: Number of cameras allowed to stream simultaneously.
204 n may vary from 0 to 32. 204 n may vary from 0 to 32.
205Default: 32 205Default: 32
206------------------------------------------------------------------------------- 206-------------------------------------------------------------------------------
207Name: video_nr 207Name: video_nr
208Type: int array (min = 0, max = 32) 208Type: int array (min = 0, max = 32)
209Syntax: <-1|n[,...]> 209Syntax: <-1|n[,...]>
210Description: Specify V4L minor mode number. 210Description: Specify V4L minor mode number.
211 -1 = use next available 211 -1 = use next available
212 n = use minor number n 212 n = use minor number n
213 You can specify up to 32 cameras this way. 213 You can specify up to 32 cameras this way.
214 For example: 214 For example:
215 video_nr=-1,2,-1 would assign minor number 2 to the second 215 video_nr=-1,2,-1 would assign minor number 2 to the second
216 recognized camera and use auto for the first one and for every 216 recognized camera and use auto for the first one and for every
217 other camera. 217 other camera.
218Default: -1 218Default: -1
219------------------------------------------------------------------------------- 219-------------------------------------------------------------------------------
220Name: packet_size 220Name: packet_size
221Type: int array (min = 0, max = 32) 221Type: int array (min = 0, max = 32)
222Syntax: <n[,...]> 222Syntax: <n[,...]>
223Description: Specify the maximum data payload size in bytes for alternate 223Description: Specify the maximum data payload size in bytes for alternate
224 settings, for each device. n is scaled between 63 and 1023. 224 settings, for each device. n is scaled between 63 and 1023.
225Default: 1023 225Default: 1023
226------------------------------------------------------------------------------- 226-------------------------------------------------------------------------------
227Name: max_buffers 227Name: max_buffers
228Type: int array (min = 0, max = 32) 228Type: int array (min = 0, max = 32)
229Syntax: <n[,...]> 229Syntax: <n[,...]>
230Description: For advanced users. 230Description: For advanced users.
231 Specify the maximum number of video frame buffers to allocate 231 Specify the maximum number of video frame buffers to allocate
232 for each device, from 2 to 32. 232 for each device, from 2 to 32.
233Default: 2 233Default: 2
234------------------------------------------------------------------------------- 234-------------------------------------------------------------------------------
235Name: double_buffer 235Name: double_buffer
236Type: bool array (min = 0, max = 32) 236Type: bool array (min = 0, max = 32)
237Syntax: <0|1[,...]> 237Syntax: <0|1[,...]>
238Description: Hardware double buffering: 0 disabled, 1 enabled. 238Description: Hardware double buffering: 0 disabled, 1 enabled.
239 It should be enabled if you want smooth video output: if you 239 It should be enabled if you want smooth video output: if you
240 obtain out of sync. video, disable it, or try to 240 obtain out of sync. video, disable it, or try to
241 decrease the 'clockdiv' module parameter value. 241 decrease the 'clockdiv' module parameter value.
242Default: 1 for every device. 242Default: 1 for every device.
243------------------------------------------------------------------------------- 243-------------------------------------------------------------------------------
244Name: clamping 244Name: clamping
@@ -251,9 +251,9 @@ Name: filter_type
251Type: int array (min = 0, max = 32) 251Type: int array (min = 0, max = 32)
252Syntax: <0|1|2[,...]> 252Syntax: <0|1|2[,...]>
253Description: Video filter type. 253Description: Video filter type.
254 0 none, 1 (1-2-1) 3-tap filter, 2 (2-3-6-3-2) 5-tap filter. 254 0 none, 1 (1-2-1) 3-tap filter, 2 (2-3-6-3-2) 5-tap filter.
255 The filter is used to reduce noise and aliasing artifacts 255 The filter is used to reduce noise and aliasing artifacts
256 produced by the CCD or CMOS image sensor. 256 produced by the CCD or CMOS image sensor.
257Default: 0 for every device. 257Default: 0 for every device.
258------------------------------------------------------------------------------- 258-------------------------------------------------------------------------------
259Name: largeview 259Name: largeview
@@ -266,9 +266,9 @@ Name: upscaling
266Type: bool array (min = 0, max = 32) 266Type: bool array (min = 0, max = 32)
267Syntax: <0|1[,...]> 267Syntax: <0|1[,...]>
268Description: Software scaling (for non-compressed video only): 268Description: Software scaling (for non-compressed video only):
269 0 disabled, 1 enabled. 269 0 disabled, 1 enabled.
270 Disable it if you have a slow CPU or you don't have enough 270 Disable it if you have a slow CPU or you don't have enough
271 memory. 271 memory.
272Default: 0 for every device. 272Default: 0 for every device.
273Note: If 'w9968cf-vpp' is not present, this parameter is set to 0. 273Note: If 'w9968cf-vpp' is not present, this parameter is set to 0.
274------------------------------------------------------------------------------- 274-------------------------------------------------------------------------------
@@ -276,36 +276,36 @@ Name: decompression
276Type: int array (min = 0, max = 32) 276Type: int array (min = 0, max = 32)
277Syntax: <0|1|2[,...]> 277Syntax: <0|1|2[,...]>
278Description: Software video decompression: 278Description: Software video decompression:
279 0 = disables decompression 279 0 = disables decompression
280 (doesn't allow formats needing decompression). 280 (doesn't allow formats needing decompression).
281 1 = forces decompression 281 1 = forces decompression
282 (allows formats needing decompression only). 282 (allows formats needing decompression only).
283 2 = allows any permitted formats. 283 2 = allows any permitted formats.
284 Formats supporting (de)compressed video are YUV422P and 284 Formats supporting (de)compressed video are YUV422P and
285 YUV420P/YUV420 in any resolutions where width and height are 285 YUV420P/YUV420 in any resolutions where width and height are
286 multiples of 16. 286 multiples of 16.
287Default: 2 for every device. 287Default: 2 for every device.
288Note: If 'w9968cf-vpp' is not present, forcing decompression is not 288Note: If 'w9968cf-vpp' is not present, forcing decompression is not
289 allowed; in this case this parameter is set to 2. 289 allowed; in this case this parameter is set to 2.
290------------------------------------------------------------------------------- 290-------------------------------------------------------------------------------
291Name: force_palette 291Name: force_palette
292Type: int array (min = 0, max = 32) 292Type: int array (min = 0, max = 32)
293Syntax: <0|9|10|13|15|8|7|1|6|3|4|5[,...]> 293Syntax: <0|9|10|13|15|8|7|1|6|3|4|5[,...]>
294Description: Force picture palette. 294Description: Force picture palette.
295 In order: 295 In order:
296 0 = Off - allows any of the following formats: 296 0 = Off - allows any of the following formats:
297 9 = UYVY 16 bpp - Original video, compression disabled 297 9 = UYVY 16 bpp - Original video, compression disabled
298 10 = YUV420 12 bpp - Original video, compression enabled 298 10 = YUV420 12 bpp - Original video, compression enabled
299 13 = YUV422P 16 bpp - Original video, compression enabled 299 13 = YUV422P 16 bpp - Original video, compression enabled
300 15 = YUV420P 12 bpp - Original video, compression enabled 300 15 = YUV420P 12 bpp - Original video, compression enabled
301 8 = YUVY 16 bpp - Software conversion from UYVY 301 8 = YUVY 16 bpp - Software conversion from UYVY
302 7 = YUV422 16 bpp - Software conversion from UYVY 302 7 = YUV422 16 bpp - Software conversion from UYVY
303 1 = GREY 8 bpp - Software conversion from UYVY 303 1 = GREY 8 bpp - Software conversion from UYVY
304 6 = RGB555 16 bpp - Software conversion from UYVY 304 6 = RGB555 16 bpp - Software conversion from UYVY
305 3 = RGB565 16 bpp - Software conversion from UYVY 305 3 = RGB565 16 bpp - Software conversion from UYVY
306 4 = RGB24 24 bpp - Software conversion from UYVY 306 4 = RGB24 24 bpp - Software conversion from UYVY
307 5 = RGB32 32 bpp - Software conversion from UYVY 307 5 = RGB32 32 bpp - Software conversion from UYVY
308 When not 0, this parameter will override 'decompression'. 308 When not 0, this parameter will override 'decompression'.
309Default: 0 for every device. Initial palette is 9 (UYVY). 309Default: 0 for every device. Initial palette is 9 (UYVY).
310Note: If 'w9968cf-vpp' is not present, this parameter is set to 9. 310Note: If 'w9968cf-vpp' is not present, this parameter is set to 9.
311------------------------------------------------------------------------------- 311-------------------------------------------------------------------------------
@@ -313,77 +313,77 @@ Name: force_rgb
313Type: bool array (min = 0, max = 32) 313Type: bool array (min = 0, max = 32)
314Syntax: <0|1[,...]> 314Syntax: <0|1[,...]>
315Description: Read RGB video data instead of BGR: 315Description: Read RGB video data instead of BGR:
316 1 = use RGB component ordering. 316 1 = use RGB component ordering.
317 0 = use BGR component ordering. 317 0 = use BGR component ordering.
318 This parameter has effect when using RGBX palettes only. 318 This parameter has effect when using RGBX palettes only.
319Default: 0 for every device. 319Default: 0 for every device.
320------------------------------------------------------------------------------- 320-------------------------------------------------------------------------------
321Name: autobright 321Name: autobright
322Type: bool array (min = 0, max = 32) 322Type: bool array (min = 0, max = 32)
323Syntax: <0|1[,...]> 323Syntax: <0|1[,...]>
324Description: Image sensor automatically changes brightness: 324Description: Image sensor automatically changes brightness:
325 0 = no, 1 = yes 325 0 = no, 1 = yes
326Default: 0 for every device. 326Default: 0 for every device.
327------------------------------------------------------------------------------- 327-------------------------------------------------------------------------------
328Name: autoexp 328Name: autoexp
329Type: bool array (min = 0, max = 32) 329Type: bool array (min = 0, max = 32)
330Syntax: <0|1[,...]> 330Syntax: <0|1[,...]>
331Description: Image sensor automatically changes exposure: 331Description: Image sensor automatically changes exposure:
332 0 = no, 1 = yes 332 0 = no, 1 = yes
333Default: 1 for every device. 333Default: 1 for every device.
334------------------------------------------------------------------------------- 334-------------------------------------------------------------------------------
335Name: lightfreq 335Name: lightfreq
336Type: int array (min = 0, max = 32) 336Type: int array (min = 0, max = 32)
337Syntax: <50|60[,...]> 337Syntax: <50|60[,...]>
338Description: Light frequency in Hz: 338Description: Light frequency in Hz:
339 50 for European and Asian lighting, 60 for American lighting. 339 50 for European and Asian lighting, 60 for American lighting.
340Default: 50 for every device. 340Default: 50 for every device.
341------------------------------------------------------------------------------- 341-------------------------------------------------------------------------------
342Name: bandingfilter 342Name: bandingfilter
343Type: bool array (min = 0, max = 32) 343Type: bool array (min = 0, max = 32)
344Syntax: <0|1[,...]> 344Syntax: <0|1[,...]>
345Description: Banding filter to reduce effects of fluorescent 345Description: Banding filter to reduce effects of fluorescent
346 lighting: 346 lighting:
347 0 disabled, 1 enabled. 347 0 disabled, 1 enabled.
348 This filter tries to reduce the pattern of horizontal 348 This filter tries to reduce the pattern of horizontal
349 light/dark bands caused by some (usually fluorescent) lighting. 349 light/dark bands caused by some (usually fluorescent) lighting.
350Default: 0 for every device. 350Default: 0 for every device.
351------------------------------------------------------------------------------- 351-------------------------------------------------------------------------------
352Name: clockdiv 352Name: clockdiv
353Type: int array (min = 0, max = 32) 353Type: int array (min = 0, max = 32)
354Syntax: <-1|n[,...]> 354Syntax: <-1|n[,...]>
355Description: Force pixel clock divisor to a specific value (for experts): 355Description: Force pixel clock divisor to a specific value (for experts):
356 n may vary from 0 to 127. 356 n may vary from 0 to 127.
357 -1 for automatic value. 357 -1 for automatic value.
358 See also the 'double_buffer' module parameter. 358 See also the 'double_buffer' module parameter.
359Default: -1 for every device. 359Default: -1 for every device.
360------------------------------------------------------------------------------- 360-------------------------------------------------------------------------------
361Name: backlight 361Name: backlight
362Type: bool array (min = 0, max = 32) 362Type: bool array (min = 0, max = 32)
363Syntax: <0|1[,...]> 363Syntax: <0|1[,...]>
364Description: Objects are lit from behind: 364Description: Objects are lit from behind:
365 0 = no, 1 = yes 365 0 = no, 1 = yes
366Default: 0 for every device. 366Default: 0 for every device.
367------------------------------------------------------------------------------- 367-------------------------------------------------------------------------------
368Name: mirror 368Name: mirror
369Type: bool array (min = 0, max = 32) 369Type: bool array (min = 0, max = 32)
370Syntax: <0|1[,...]> 370Syntax: <0|1[,...]>
371Description: Reverse image horizontally: 371Description: Reverse image horizontally:
372 0 = no, 1 = yes 372 0 = no, 1 = yes
373Default: 0 for every device. 373Default: 0 for every device.
374------------------------------------------------------------------------------- 374-------------------------------------------------------------------------------
375Name: monochrome 375Name: monochrome
376Type: bool array (min = 0, max = 32) 376Type: bool array (min = 0, max = 32)
377Syntax: <0|1[,...]> 377Syntax: <0|1[,...]>
378Description: The image sensor is monochrome: 378Description: The image sensor is monochrome:
379 0 = no, 1 = yes 379 0 = no, 1 = yes
380Default: 0 for every device. 380Default: 0 for every device.
381------------------------------------------------------------------------------- 381-------------------------------------------------------------------------------
382Name: brightness 382Name: brightness
383Type: long array (min = 0, max = 32) 383Type: long array (min = 0, max = 32)
384Syntax: <n[,...]> 384Syntax: <n[,...]>
385Description: Set picture brightness (0-65535). 385Description: Set picture brightness (0-65535).
386 This parameter has no effect if 'autobright' is enabled. 386 This parameter has no effect if 'autobright' is enabled.
387Default: 31000 for every device. 387Default: 31000 for every device.
388------------------------------------------------------------------------------- 388-------------------------------------------------------------------------------
389Name: hue 389Name: hue
@@ -414,23 +414,23 @@ Name: debug
414Type: int 414Type: int
415Syntax: <n> 415Syntax: <n>
416Description: Debugging information level, from 0 to 6: 416Description: Debugging information level, from 0 to 6:
417 0 = none (use carefully) 417 0 = none (use carefully)
418 1 = critical errors 418 1 = critical errors
419 2 = significant informations 419 2 = significant informations
420 3 = configuration or general messages 420 3 = configuration or general messages
421 4 = warnings 421 4 = warnings
422 5 = called functions 422 5 = called functions
423 6 = function internals 423 6 = function internals
424 Level 5 and 6 are useful for testing only, when only one 424 Level 5 and 6 are useful for testing only, when only one
425 device is used. 425 device is used.
426Default: 2 426Default: 2
427------------------------------------------------------------------------------- 427-------------------------------------------------------------------------------
428Name: specific_debug 428Name: specific_debug
429Type: bool 429Type: bool
430Syntax: <0|1> 430Syntax: <0|1>
431Description: Enable or disable specific debugging messages: 431Description: Enable or disable specific debugging messages:
432 0 = print messages concerning every level <= 'debug' level. 432 0 = print messages concerning every level <= 'debug' level.
433 1 = print messages concerning the level indicated by 'debug'. 433 1 = print messages concerning the level indicated by 'debug'.
434Default: 0 434Default: 0
435------------------------------------------------------------------------------- 435-------------------------------------------------------------------------------
436 436
diff --git a/Documentation/video4linux/zc0301.txt b/Documentation/video4linux/zc0301.txt
index f55262c6733b..f406f5e80046 100644
--- a/Documentation/video4linux/zc0301.txt
+++ b/Documentation/video4linux/zc0301.txt
@@ -1,9 +1,9 @@
1 1
2 ZC0301 Image Processor and Control Chip 2 ZC0301 and ZC0301P Image Processor and Control Chip
3 Driver for Linux 3 Driver for Linux
4 ======================================= 4 ===================================================
5 5
6 - Documentation - 6 - Documentation -
7 7
8 8
9Index 9Index
@@ -51,13 +51,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
51 51
524. Overview and features 524. Overview and features
53======================== 53========================
54This driver supports the video interface of the devices mounting the ZC0301 54This driver supports the video interface of the devices mounting the ZC0301 or
55Image Processor and Control Chip. 55ZC0301P Image Processors and Control Chips.
56 56
57The driver relies on the Video4Linux2 and USB core modules. It has been 57The driver relies on the Video4Linux2 and USB core modules. It has been
58designed to run properly on SMP systems as well. 58designed to run properly on SMP systems as well.
59 59
60The latest version of the ZC0301 driver can be found at the following URL: 60The latest version of the ZC0301[P] driver can be found at the following URL:
61http://www.linux-projects.org/ 61http://www.linux-projects.org/
62 62
63Some of the features of the driver are: 63Some of the features of the driver are:
@@ -117,7 +117,7 @@ supported by the USB Audio driver thanks to the ALSA API:
117 117
118And finally: 118And finally:
119 119
120 # USB Multimedia devices 120 # V4L USB devices
121 # 121 #
122 CONFIG_USB_ZC0301=m 122 CONFIG_USB_ZC0301=m
123 123
@@ -146,46 +146,46 @@ Name: video_nr
146Type: short array (min = 0, max = 64) 146Type: short array (min = 0, max = 64)
147Syntax: <-1|n[,...]> 147Syntax: <-1|n[,...]>
148Description: Specify V4L2 minor mode number: 148Description: Specify V4L2 minor mode number:
149 -1 = use next available 149 -1 = use next available
150 n = use minor number n 150 n = use minor number n
151 You can specify up to 64 cameras this way. 151 You can specify up to 64 cameras this way.
152 For example: 152 For example:
153 video_nr=-1,2,-1 would assign minor number 2 to the second 153 video_nr=-1,2,-1 would assign minor number 2 to the second
154 registered camera and use auto for the first one and for every 154 registered camera and use auto for the first one and for every
155 other camera. 155 other camera.
156Default: -1 156Default: -1
157------------------------------------------------------------------------------- 157-------------------------------------------------------------------------------
158Name: force_munmap 158Name: force_munmap
159Type: bool array (min = 0, max = 64) 159Type: bool array (min = 0, max = 64)
160Syntax: <0|1[,...]> 160Syntax: <0|1[,...]>
161Description: Force the application to unmap previously mapped buffer memory 161Description: Force the application to unmap previously mapped buffer memory
162 before calling any VIDIOC_S_CROP or VIDIOC_S_FMT ioctl's. Not 162 before calling any VIDIOC_S_CROP or VIDIOC_S_FMT ioctl's. Not
163 all the applications support this feature. This parameter is 163 all the applications support this feature. This parameter is
164 specific for each detected camera. 164 specific for each detected camera.
165 0 = do not force memory unmapping 165 0 = do not force memory unmapping
166 1 = force memory unmapping (save memory) 166 1 = force memory unmapping (save memory)
167Default: 0 167Default: 0
168------------------------------------------------------------------------------- 168-------------------------------------------------------------------------------
169Name: frame_timeout 169Name: frame_timeout
170Type: uint array (min = 0, max = 64) 170Type: uint array (min = 0, max = 64)
171Syntax: <n[,...]> 171Syntax: <n[,...]>
172Description: Timeout for a video frame in seconds. This parameter is 172Description: Timeout for a video frame in seconds. This parameter is
173 specific for each detected camera. This parameter can be 173 specific for each detected camera. This parameter can be
174 changed at runtime thanks to the /sys filesystem interface. 174 changed at runtime thanks to the /sys filesystem interface.
175Default: 2 175Default: 2
176------------------------------------------------------------------------------- 176-------------------------------------------------------------------------------
177Name: debug 177Name: debug
178Type: ushort 178Type: ushort
179Syntax: <n> 179Syntax: <n>
180Description: Debugging information level, from 0 to 3: 180Description: Debugging information level, from 0 to 3:
181 0 = none (use carefully) 181 0 = none (use carefully)
182 1 = critical errors 182 1 = critical errors
183 2 = significant informations 183 2 = significant informations
184 3 = more verbose messages 184 3 = more verbose messages
185 Level 3 is useful for testing only, when only one device 185 Level 3 is useful for testing only, when only one device
186 is used at the same time. It also shows some more informations 186 is used at the same time. It also shows some more informations
187 about the hardware being detected. This module parameter can be 187 about the hardware being detected. This module parameter can be
188 changed at runtime thanks to the /sys filesystem interface. 188 changed at runtime thanks to the /sys filesystem interface.
189Default: 2 189Default: 2
190------------------------------------------------------------------------------- 190-------------------------------------------------------------------------------
191 191
@@ -204,11 +204,25 @@ Vendor ID Product ID
2040x041e 0x4017 2040x041e 0x4017
2050x041e 0x401c 2050x041e 0x401c
2060x041e 0x401e 2060x041e 0x401e
2070x041e 0x401f
2080x041e 0x4022
2070x041e 0x4034 2090x041e 0x4034
2080x041e 0x4035 2100x041e 0x4035
2110x041e 0x4036
2120x041e 0x403a
2130x0458 0x7007
2140x0458 0x700C
2150x0458 0x700f
2160x046d 0x08ae
2170x055f 0xd003
2180x055f 0xd004
2090x046d 0x08ae 2190x046d 0x08ae
2100x0ac8 0x0301 2200x0ac8 0x0301
2210x0ac8 0x301b
2220x0ac8 0x303b
2230x10fd 0x0128
2110x10fd 0x8050 2240x10fd 0x8050
2250x10fd 0x804e
212 226
213The list above does not imply that all those devices work with this driver: up 227The list above does not imply that all those devices work with this driver: up
214until now only the ones that mount the following image sensors are supported; 228until now only the ones that mount the following image sensors are supported;
@@ -217,6 +231,7 @@ kernel messages will always tell you whether this is the case:
217Model Manufacturer 231Model Manufacturer
218----- ------------ 232----- ------------
219PAS202BCB PixArt Imaging, Inc. 233PAS202BCB PixArt Imaging, Inc.
234PB-0330 Photobit Corporation
220 235
221 236
2229. Notes for V4L2 application developers 2379. Notes for V4L2 application developers
@@ -250,5 +265,6 @@ the fingerprint is: '88E8 F32F 7244 68BA 3958 5D40 99DA 5D2A FCE6 35A4'.
250 been taken from the documentation of the ZC030x Video4Linux1 driver written 265 been taken from the documentation of the ZC030x Video4Linux1 driver written
251 by Andrew Birkett <andy@nobugs.org>; 266 by Andrew Birkett <andy@nobugs.org>;
252- The initialization values of the ZC0301 controller connected to the PAS202BCB 267- The initialization values of the ZC0301 controller connected to the PAS202BCB
253 image sensor have been taken from the SPCA5XX driver maintained by 268 and PB-0330 image sensors have been taken from the SPCA5XX driver maintained
254 Michel Xhaard <mxhaard@magic.fr>. 269 by Michel Xhaard <mxhaard@magic.fr>;
270- Stanislav Lechev donated one camera.