aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/video4linux
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/video4linux')
-rw-r--r--Documentation/video4linux/CARDLIST.bttv2
-rw-r--r--Documentation/video4linux/CARDLIST.saa71343
-rw-r--r--Documentation/video4linux/CQcam.txt6
-rw-r--r--Documentation/video4linux/Zoran4
-rw-r--r--Documentation/video4linux/cx2341x/fw-decoder-api.txt58
-rw-r--r--Documentation/video4linux/cx2341x/fw-decoder-regs.txt815
-rw-r--r--Documentation/video4linux/cx2341x/fw-dma.txt16
-rw-r--r--Documentation/video4linux/cx2341x/fw-encoder-api.txt52
-rw-r--r--Documentation/video4linux/cx2341x/fw-memory.txt10
-rw-r--r--Documentation/video4linux/et61x251.txt7
-rw-r--r--Documentation/video4linux/sn9c102.txt246
-rw-r--r--Documentation/video4linux/zc0301.txt10
12 files changed, 1048 insertions, 181 deletions
diff --git a/Documentation/video4linux/CARDLIST.bttv b/Documentation/video4linux/CARDLIST.bttv
index 4efa4645885f..fc2fe9bc6713 100644
--- a/Documentation/video4linux/CARDLIST.bttv
+++ b/Documentation/video4linux/CARDLIST.bttv
@@ -126,7 +126,7 @@
126125 -> MATRIX Vision Sigma-SQ 126125 -> MATRIX Vision Sigma-SQ
127126 -> MATRIX Vision Sigma-SLC 127126 -> MATRIX Vision Sigma-SLC
128127 -> APAC Viewcomp 878(AMAX) 128127 -> APAC Viewcomp 878(AMAX)
129128 -> DViCO FusionHDTV DVB-T Lite [18ac:db10] 129128 -> DViCO FusionHDTV DVB-T Lite [18ac:db10,18ac:db11]
130129 -> V-Gear MyVCD 130129 -> V-Gear MyVCD
131130 -> Super TV Tuner 131130 -> Super TV Tuner
132131 -> Tibet Systems 'Progress DVR' CS16 132131 -> Tibet Systems 'Progress DVR' CS16
diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134
index f6201cc37ec5..a12246a9bf23 100644
--- a/Documentation/video4linux/CARDLIST.saa7134
+++ b/Documentation/video4linux/CARDLIST.saa7134
@@ -104,3 +104,6 @@
104103 -> Compro Videomate DVB-T200A 104103 -> Compro Videomate DVB-T200A
105104 -> Hauppauge WinTV-HVR1110 DVB-T/Hybrid [0070:6701] 105104 -> Hauppauge WinTV-HVR1110 DVB-T/Hybrid [0070:6701]
106105 -> Terratec Cinergy HT PCMCIA [153b:1172] 106105 -> Terratec Cinergy HT PCMCIA [153b:1172]
107106 -> Encore ENLTV [1131:2342,1131:2341,3016:2344]
108107 -> Encore ENLTV-FM [1131:230f]
109108 -> Terratec Cinergy HT PCI [153b:1175]
diff --git a/Documentation/video4linux/CQcam.txt b/Documentation/video4linux/CQcam.txt
index ade8651e2443..04986efb731c 100644
--- a/Documentation/video4linux/CQcam.txt
+++ b/Documentation/video4linux/CQcam.txt
@@ -197,10 +197,10 @@ Use the ../../Maintainers file, particularly the VIDEO FOR LINUX and PARALLEL
197PORT SUPPORT sections 197PORT SUPPORT sections
198 198
199The video4linux page: 199The video4linux page:
200 http://roadrunner.swansea.linux.org.uk/v4l.shtml 200 http://linuxtv.org
201 201
202The video4linux2 page: 202The V4L2 API spec:
203 http://millennium.diads.com/bdirks/v4l2.htm 203 http://v4l2spec.bytesex.org/
204 204
205Some web pages about the quickcams: 205Some web pages about the quickcams:
206 http://www.dkfz-heidelberg.de/Macromol/wedemann/mini-HOWTO-cqcam.html 206 http://www.dkfz-heidelberg.de/Macromol/wedemann/mini-HOWTO-cqcam.html
diff --git a/Documentation/video4linux/Zoran b/Documentation/video4linux/Zoran
index deb218f77adb..85c575ac4fb9 100644
--- a/Documentation/video4linux/Zoran
+++ b/Documentation/video4linux/Zoran
@@ -339,9 +339,9 @@ Information - video4linux/mjpeg extensions:
339(also see below) 339(also see below)
340 340
341Information - video4linux2: 341Information - video4linux2:
342http://www.thedirks.org/v4l2/ 342http://linuxtv.org
343http://v4l2spec.bytesex.org/
343/usr/include/linux/videodev2.h 344/usr/include/linux/videodev2.h
344http://www.bytesex.org/v4l/
345 345
346More information on the video4linux/mjpeg extensions, by Serguei 346More information on the video4linux/mjpeg extensions, by Serguei
347Miridonovi and Rainer Johanni: 347Miridonovi and Rainer Johanni:
diff --git a/Documentation/video4linux/cx2341x/fw-decoder-api.txt b/Documentation/video4linux/cx2341x/fw-decoder-api.txt
index 78bf5f21e513..8c317b7a4fc9 100644
--- a/Documentation/video4linux/cx2341x/fw-decoder-api.txt
+++ b/Documentation/video4linux/cx2341x/fw-decoder-api.txt
@@ -21,7 +21,7 @@ Param[0]
21 0 based frame number in GOP to begin playback from. 21 0 based frame number in GOP to begin playback from.
22Param[1] 22Param[1]
23 Specifies the number of muted audio frames to play before normal 23 Specifies the number of muted audio frames to play before normal
24 audio resumes. 24 audio resumes. (This is not implemented in the firmware, leave at 0)
25 25
26------------------------------------------------------------------------------- 26-------------------------------------------------------------------------------
27 27
@@ -32,6 +32,10 @@ Description
32 playback stops at specified PTS. 32 playback stops at specified PTS.
33Param[0] 33Param[0]
34 Display 0=last frame, 1=black 34 Display 0=last frame, 1=black
35 Note: this takes effect immediately, so if you want to wait for a PTS,
36 then use '0', otherwise the screen goes to black at once.
37 You can call this later (even if there is no playback) with a 1 value
38 to set the screen to black.
35Param[1] 39Param[1]
36 PTS low 40 PTS low
37Param[2] 41Param[2]
@@ -60,8 +64,12 @@ Param[0]
60 31 Speed: 64 31 Speed:
61 '0' slow 65 '0' slow
62 '1' fast 66 '1' fast
67 Note: n is limited to 2. Anything higher does not result in
68 faster playback. Instead the host should start dropping frames.
63Param[1] 69Param[1]
64 Direction: 0=forward, 1=reverse 70 Direction: 0=forward, 1=reverse
71 Note: to make reverse playback work you have to write full GOPs in
72 reverse order.
65Param[2] 73Param[2]
66 Picture mask: 74 Picture mask:
67 1=I frames 75 1=I frames
@@ -69,13 +77,16 @@ Param[2]
69 7=I, P, B frames 77 7=I, P, B frames
70Param[3] 78Param[3]
71 B frames per GOP (for reverse play only) 79 B frames per GOP (for reverse play only)
80 Note: for reverse playback the Picture Mask should be set to I or I, P.
81 Adding B frames to the mask will result in corrupt video. This field
82 has to be set to the correct value in order to keep the timing correct.
72Param[4] 83Param[4]
73 Mute audio: 0=disable, 1=enable 84 Mute audio: 0=disable, 1=enable
74Param[5] 85Param[5]
75 Display 0=frame, 1=field 86 Display 0=frame, 1=field
76Param[6] 87Param[6]
77 Specifies the number of muted audio frames to play before normal audio 88 Specifies the number of muted audio frames to play before normal audio
78 resumes. 89 resumes. (Not implemented in the firmware, leave at 0)
79 90
80------------------------------------------------------------------------------- 91-------------------------------------------------------------------------------
81 92
@@ -212,6 +223,7 @@ Description
212 Select audio mode 223 Select audio mode
213Param[0] 224Param[0]
214 Dual mono mode action 225 Dual mono mode action
226 0=Stereo, 1=Left, 2=Right, 3=Mono, 4=Swap, -1=Unchanged
215Param[1] 227Param[1]
216 Stereo mode action: 228 Stereo mode action:
217 0=Stereo, 1=Left, 2=Right, 3=Mono, 4=Swap, -1=Unchanged 229 0=Stereo, 1=Left, 2=Right, 3=Mono, 4=Swap, -1=Unchanged
@@ -224,7 +236,10 @@ Description
224 Setup firmware to notify the host about a particular event. 236 Setup firmware to notify the host about a particular event.
225 Counterpart to API 0xD5 237 Counterpart to API 0xD5
226Param[0] 238Param[0]
227 Event: 0=Audio mode change between stereo and dual channel 239 Event: 0=Audio mode change between mono, (joint) stereo and dual channel.
240 Event: 3=Decoder started
241 Event: 4=Unknown: goes off 10-15 times per second while decoding.
242 Event: 5=Some sync event: goes off once per frame.
228Param[1] 243Param[1]
229 Notification 0=disabled, 1=enabled 244 Notification 0=disabled, 1=enabled
230Param[2] 245Param[2]
@@ -273,43 +288,6 @@ Param[3]
273 288
274------------------------------------------------------------------------------- 289-------------------------------------------------------------------------------
275 290
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 291Name CX2341X_DEC_SET_PREBUFFERING
314Enum 30/0x1E 292Enum 30/0x1E
315Description 293Description
diff --git a/Documentation/video4linux/cx2341x/fw-decoder-regs.txt b/Documentation/video4linux/cx2341x/fw-decoder-regs.txt
new file mode 100644
index 000000000000..db2366c634e8
--- /dev/null
+++ b/Documentation/video4linux/cx2341x/fw-decoder-regs.txt
@@ -0,0 +1,815 @@
1PVR350 Video decoder registers 0x02002800 -> 0x02002B00
2=======================================================
3
4This list has been worked out through trial and error. There will be mistakes
5and omissions. Some registers have no obvious effect so it's hard to say what
6they do, while others interact with each other, or require a certain load
7sequence. Horizontal filter setup is one example, with six registers working
8in unison and requiring a certain load sequence to correctly configure. The
9indexed colour palette is much easier to set at just two registers, but again
10it requires a certain load sequence.
11
12Some registers are fussy about what they are set to. Load in a bad value & the
13decoder will fail. A firmware reload will often recover, but sometimes a reset
14is required. For registers containing size information, setting them to 0 is
15generally a bad idea. For other control registers i.e. 2878, you'll only find
16out what values are bad when it hangs.
17
18--------------------------------------------------------------------------------
192800
20 bit 0
21 Decoder enable
22 0 = disable
23 1 = enable
24--------------------------------------------------------------------------------
252804
26 bits 0:31
27 Decoder horizontal Y alias register 1
28---------------
292808
30 bits 0:31
31 Decoder horizontal Y alias register 2
32---------------
33280C
34 bits 0:31
35 Decoder horizontal Y alias register 3
36---------------
372810
38 bits 0:31
39 Decoder horizontal Y alias register 4
40---------------
412814
42 bits 0:31
43 Decoder horizontal Y alias register 5
44---------------
452818
46 bits 0:31
47 Decoder horizontal Y alias trigger
48
49 These six registers control the horizontal aliasing filter for the Y plane.
50 The first five registers must all be loaded before accessing the trigger
51 (2818), as this register actually clocks the data through for the first
52 five.
53
54 To correctly program set the filter, this whole procedure must be done 16
55 times. The actual register contents are copied from a lookup-table in the
56 firmware which contains 4 different filter settings.
57
58--------------------------------------------------------------------------------
59281C
60 bits 0:31
61 Decoder horizontal UV alias register 1
62---------------
632820
64 bits 0:31
65 Decoder horizontal UV alias register 2
66---------------
672824
68 bits 0:31
69 Decoder horizontal UV alias register 3
70---------------
712828
72 bits 0:31
73 Decoder horizontal UV alias register 4
74---------------
75282C
76 bits 0:31
77 Decoder horizontal UV alias register 5
78---------------
792830
80 bits 0:31
81 Decoder horizontal UV alias trigger
82
83 These six registers control the horizontal aliasing for the UV plane.
84 Operation is the same as the Y filter, with 2830 being the trigger
85 register.
86
87--------------------------------------------------------------------------------
882834
89 bits 0:15
90 Decoder Y source width in pixels
91
92 bits 16:31
93 Decoder Y destination width in pixels
94---------------
952838
96 bits 0:15
97 Decoder UV source width in pixels
98
99 bits 16:31
100 Decoder UV destination width in pixels
101
102 NOTE: For both registers, the resulting image must be fully visible on
103 screen. If the image exceeds the right edge both the source and destination
104 size must be adjusted to reflect the visible portion. For the source width,
105 you must take into account the scaling when calculating the new value.
106--------------------------------------------------------------------------------
107
108283C
109 bits 0:31
110 Decoder Y horizontal scaling
111 Normally = Reg 2854 >> 2
112---------------
1132840
114 bits 0:31
115 Decoder ?? unknown - horizontal scaling
116 Usually 0x00080514
117---------------
1182844
119 bits 0:31
120 Decoder UV horizontal scaling
121 Normally = Reg 2854 >> 2
122---------------
1232848
124 bits 0:31
125 Decoder ?? unknown - horizontal scaling
126 Usually 0x00100514
127---------------
128284C
129 bits 0:31
130 Decoder ?? unknown - Y plane
131 Usually 0x00200020
132---------------
1332850
134 bits 0:31
135 Decoder ?? unknown - UV plane
136 Usually 0x00200020
137---------------
1382854
139 bits 0:31
140 Decoder 'master' value for horizontal scaling
141---------------
1422858
143 bits 0:31
144 Decoder ?? unknown
145 Usually 0
146---------------
147285C
148 bits 0:31
149 Decoder ?? unknown
150 Normally = Reg 2854 >> 1
151---------------
1522860
153 bits 0:31
154 Decoder ?? unknown
155 Usually 0
156---------------
1572864
158 bits 0:31
159 Decoder ?? unknown
160 Normally = Reg 2854 >> 1
161---------------
1622868
163 bits 0:31
164 Decoder ?? unknown
165 Usually 0
166
167 Most of these registers either control horizontal scaling, or appear linked
168 to it in some way. Register 2854 contains the 'master' value & the other
169 registers can be calculated from that one. You must also remember to
170 correctly set the divider in Reg 2874.
171
172 To enlarge:
173 Reg 2854 = (source_width * 0x00200000) / destination_width
174 Reg 2874 = No divide
175
176 To reduce from full size down to half size:
177 Reg 2854 = (source_width/2 * 0x00200000) / destination width
178 Reg 2874 = Divide by 2
179
180 To reduce from half size down to quarter size:
181 Reg 2854 = (source_width/4 * 0x00200000) / destination width
182 Reg 2874 = Divide by 4
183
184 The result is always rounded up.
185
186--------------------------------------------------------------------------------
187286C
188 bits 0:15
189 Decoder horizontal Y buffer offset
190
191 bits 15:31
192 Decoder horizontal UV buffer offset
193
194 Offset into the video image buffer. If the offset is gradually incremented,
195 the on screen image will move left & wrap around higher up on the right.
196
197--------------------------------------------------------------------------------
1982870
199 bits 0:15
200 Decoder horizontal Y output offset
201
202 bits 16:31
203 Decoder horizontal UV output offset
204
205 Offsets the actual video output. Controls output alignment of the Y & UV
206 planes. The higher the value, the greater the shift to the left. Use
207 reg 2890 to move the image right.
208
209--------------------------------------------------------------------------------
2102874
211 bits 0:1
212 Decoder horizontal Y output size divider
213 00 = No divide
214 01 = Divide by 2
215 10 = Divide by 3
216
217 bits 4:5
218 Decoder horizontal UV output size divider
219 00 = No divide
220 01 = Divide by 2
221 10 = Divide by 3
222
223 bit 8
224 Decoder ?? unknown
225 0 = Normal
226 1 = Affects video output levels
227
228 bit 16
229 Decoder ?? unknown
230 0 = Normal
231 1 = Disable horizontal filter
232
233--------------------------------------------------------------------------------
2342878
235 bit 0
236 ?? unknown
237
238 bit 1
239 osd on/off
240 0 = osd off
241 1 = osd on
242
243 bit 2
244 Decoder + osd video timing
245 0 = NTSC
246 1 = PAL
247
248 bits 3:4
249 ?? unknown
250
251 bit 5
252 Decoder + osd
253 Swaps upper & lower fields
254
255--------------------------------------------------------------------------------
256287C
257 bits 0:10
258 Decoder & osd ?? unknown
259 Moves entire screen horizontally. Starts at 0x005 with the screen
260 shifted heavily to the right. Incrementing in steps of 0x004 will
261 gradually shift the screen to the left.
262
263 bits 11:31
264 ?? unknown
265
266 Normally contents are 0x00101111 (NTSC) or 0x1010111d (PAL)
267
268--------------------------------------------------------------------------------
2692880 -------- ?? unknown
2702884 -------- ?? unknown
271--------------------------------------------------------------------------------
2722888
273 bit 0
274 Decoder + osd ?? unknown
275 0 = Normal
276 1 = Misaligned fields (Correctable through 289C & 28A4)
277
278 bit 4
279 ?? unknown
280
281 bit 8
282 ?? unknown
283
284 Warning: Bad values will require a firmware reload to recover.
285 Known to be bad are 0x000,0x011,0x100,0x111
286--------------------------------------------------------------------------------
287288C
288 bits 0:15
289 osd ?? unknown
290 Appears to affect the osd position stability. The higher the value the
291 more unstable it becomes. Decoder output remains stable.
292
293 bits 16:31
294 osd ?? unknown
295 Same as bits 0:15
296
297--------------------------------------------------------------------------------
2982890
299 bits 0:11
300 Decoder output horizontal offset.
301
302 Horizontal offset moves the video image right. A small left shift is
303 possible, but it's better to use reg 2870 for that due to its greater
304 range.
305
306 NOTE: Video corruption will occur if video window is shifted off the right
307 edge. To avoid this read the notes for 2834 & 2838.
308--------------------------------------------------------------------------------
3092894
310 bits 0:23
311 Decoder output video surround colour.
312
313 Contains the colour (in yuv) used to fill the screen when the video is
314 running in a window.
315--------------------------------------------------------------------------------
3162898
317 bits 0:23
318 Decoder video window colour
319 Contains the colour (in yuv) used to fill the video window when the
320 video is turned off.
321
322 bit 24
323 Decoder video output
324 0 = Video on
325 1 = Video off
326
327 bit 28
328 Decoder plane order
329 0 = Y,UV
330 1 = UV,Y
331
332 bit 29
333 Decoder second plane byte order
334 0 = Normal (UV)
335 1 = Swapped (VU)
336
337 In normal usage, the first plane is Y & the second plane is UV. Though the
338 order of the planes can be swapped, only the byte order of the second plane
339 can be swapped. This isn't much use for the Y plane, but can be useful for
340 the UV plane.
341
342--------------------------------------------------------------------------------
343289C
344 bits 0:15
345 Decoder vertical field offset 1
346
347 bits 16:31
348 Decoder vertical field offset 2
349
350 Controls field output vertical alignment. The higher the number, the lower
351 the image on screen. Known starting values are 0x011E0017 (NTSC) &
352 0x01500017 (PAL)
353--------------------------------------------------------------------------------
35428A0
355 bits 0:15
356 Decoder & osd width in pixels
357
358 bits 16:31
359 Decoder & osd height in pixels
360
361 All output from the decoder & osd are disabled beyond this area. Decoder
362 output will simply go black outside of this region. If the osd tries to
363 exceed this area it will become corrupt.
364--------------------------------------------------------------------------------
36528A4
366 bits 0:11
367 osd left shift.
368
369 Has a range of 0x770->0x7FF. With the exception of 0, any value outside of
370 this range corrupts the osd.
371--------------------------------------------------------------------------------
37228A8
373 bits 0:15
374 osd vertical field offset 1
375
376 bits 16:31
377 osd vertical field offset 2
378
379 Controls field output vertical alignment. The higher the number, the lower
380 the image on screen. Known starting values are 0x011E0017 (NTSC) &
381 0x01500017 (PAL)
382--------------------------------------------------------------------------------
38328AC -------- ?? unknown
384 |
385 V
38628BC -------- ?? unknown
387--------------------------------------------------------------------------------
38828C0
389 bit 0
390 Current output field
391 0 = first field
392 1 = second field
393
394 bits 16:31
395 Current scanline
396 The scanline counts from the top line of the first field
397 through to the last line of the second field.
398--------------------------------------------------------------------------------
39928C4 -------- ?? unknown
400 |
401 V
40228F8 -------- ?? unknown
403--------------------------------------------------------------------------------
40428FC
405 bit 0
406 ?? unknown
407 0 = Normal
408 1 = Breaks decoder & osd output
409--------------------------------------------------------------------------------
4102900
411 bits 0:31
412 Decoder vertical Y alias register 1
413---------------
4142904
415 bits 0:31
416 Decoder vertical Y alias register 2
417---------------
4182908
419 bits 0:31
420 Decoder vertical Y alias trigger
421
422 These three registers control the vertical aliasing filter for the Y plane.
423 Operation is similar to the horizontal Y filter (2804). The only real
424 difference is that there are only two registers to set before accessing
425 the trigger register (2908). As for the horizontal filter, the values are
426 taken from a lookup table in the firmware, and the procedure must be
427 repeated 16 times to fully program the filter.
428--------------------------------------------------------------------------------
429290C
430 bits 0:31
431 Decoder vertical UV alias register 1
432---------------
4332910
434 bits 0:31
435 Decoder vertical UV alias register 2
436---------------
4372914
438 bits 0:31
439 Decoder vertical UV alias trigger
440
441 These three registers control the vertical aliasing filter for the UV
442 plane. Operation is the same as the Y filter, with 2914 being the trigger.
443--------------------------------------------------------------------------------
4442918
445 bits 0:15
446 Decoder Y source height in pixels
447
448 bits 16:31
449 Decoder Y destination height in pixels
450---------------
451291C
452 bits 0:15
453 Decoder UV source height in pixels divided by 2
454
455 bits 16:31
456 Decoder UV destination height in pixels
457
458 NOTE: For both registers, the resulting image must be fully visible on
459 screen. If the image exceeds the bottom edge both the source and
460 destination size must be adjusted to reflect the visible portion. For the
461 source height, you must take into account the scaling when calculating the
462 new value.
463--------------------------------------------------------------------------------
4642920
465 bits 0:31
466 Decoder Y vertical scaling
467 Normally = Reg 2930 >> 2
468---------------
4692924
470 bits 0:31
471 Decoder Y vertical scaling
472 Normally = Reg 2920 + 0x514
473---------------
4742928
475 bits 0:31
476 Decoder UV vertical scaling
477 When enlarging = Reg 2930 >> 2
478 When reducing = Reg 2930 >> 3
479---------------
480292C
481 bits 0:31
482 Decoder UV vertical scaling
483 Normally = Reg 2928 + 0x514
484---------------
4852930
486 bits 0:31
487 Decoder 'master' value for vertical scaling
488---------------
4892934
490 bits 0:31
491 Decoder ?? unknown - Y vertical scaling
492---------------
4932938
494 bits 0:31
495 Decoder Y vertical scaling
496 Normally = Reg 2930
497---------------
498293C
499 bits 0:31
500 Decoder ?? unknown - Y vertical scaling
501---------------
5022940
503 bits 0:31
504 Decoder UV vertical scaling
505 When enlarging = Reg 2930 >> 1
506 When reducing = Reg 2930
507---------------
5082944
509 bits 0:31
510 Decoder ?? unknown - UV vertical scaling
511---------------
5122948
513 bits 0:31
514 Decoder UV vertical scaling
515 Normally = Reg 2940
516---------------
517294C
518 bits 0:31
519 Decoder ?? unknown - UV vertical scaling
520
521 Most of these registers either control vertical scaling, or appear linked
522 to it in some way. Register 2930 contains the 'master' value & all other
523 registers can be calculated from that one. You must also remember to
524 correctly set the divider in Reg 296C
525
526 To enlarge:
527 Reg 2930 = (source_height * 0x00200000) / destination_height
528 Reg 296C = No divide
529
530 To reduce from full size down to half size:
531 Reg 2930 = (source_height/2 * 0x00200000) / destination height
532 Reg 296C = Divide by 2
533
534 To reduce from half down to quarter.
535 Reg 2930 = (source_height/4 * 0x00200000) / destination height
536 Reg 296C = Divide by 4
537
538--------------------------------------------------------------------------------
5392950
540 bits 0:15
541 Decoder Y line index into display buffer, first field
542
543 bits 16:31
544 Decoder Y vertical line skip, first field
545--------------------------------------------------------------------------------
5462954
547 bits 0:15
548 Decoder Y line index into display buffer, second field
549
550 bits 16:31
551 Decoder Y vertical line skip, second field
552--------------------------------------------------------------------------------
5532958
554 bits 0:15
555 Decoder UV line index into display buffer, first field
556
557 bits 16:31
558 Decoder UV vertical line skip, first field
559--------------------------------------------------------------------------------
560295C
561 bits 0:15
562 Decoder UV line index into display buffer, second field
563
564 bits 16:31
565 Decoder UV vertical line skip, second field
566--------------------------------------------------------------------------------
5672960
568 bits 0:15
569 Decoder destination height minus 1
570
571 bits 16:31
572 Decoder destination height divided by 2
573--------------------------------------------------------------------------------
5742964
575 bits 0:15
576 Decoder Y vertical offset, second field
577
578 bits 16:31
579 Decoder Y vertical offset, first field
580
581 These two registers shift the Y plane up. The higher the number, the
582 greater the shift.
583--------------------------------------------------------------------------------
5842968
585 bits 0:15
586 Decoder UV vertical offset, second field
587
588 bits 16:31
589 Decoder UV vertical offset, first field
590
591 These two registers shift the UV plane up. The higher the number, the
592 greater the shift.
593--------------------------------------------------------------------------------
594296C
595 bits 0:1
596 Decoder vertical Y output size divider
597 00 = No divide
598 01 = Divide by 2
599 10 = Divide by 4
600
601 bits 8:9
602 Decoder vertical UV output size divider
603 00 = No divide
604 01 = Divide by 2
605 10 = Divide by 4
606--------------------------------------------------------------------------------
6072970
608 bit 0
609 Decoder ?? unknown
610 0 = Normal
611 1 = Affect video output levels
612
613 bit 16
614 Decoder ?? unknown
615 0 = Normal
616 1 = Disable vertical filter
617
618--------------------------------------------------------------------------------
6192974 -------- ?? unknown
620 |
621 V
62229EF -------- ?? unknown
623--------------------------------------------------------------------------------
6242A00
625 bits 0:2
626 osd colour mode
627 001 = 16 bit (565)
628 010 = 15 bit (555)
629 011 = 12 bit (444)
630 100 = 32 bit (8888)
631 101 = 8 bit indexed
632
633 bits 4:5
634 osd display bpp
635 01 = 8 bit
636 10 = 16 bit
637 11 = 32 bit
638
639 bit 8
640 osd global alpha
641 0 = Off
642 1 = On
643
644 bit 9
645 osd local alpha
646 0 = Off
647 1 = On
648
649 bit 10
650 osd colour key
651 0 = Off
652 1 = On
653
654 bit 11
655 osd ?? unknown
656 Must be 1
657
658 bit 13
659 osd colour space
660 0 = ARGB
661 1 = AYVU
662
663 bits 16:31
664 osd ?? unknown
665 Must be 0x001B (some kind of buffer pointer ?)
666
667 When the bits-per-pixel is set to 8, the colour mode is ignored and
668 assumed to be 8 bit indexed. For 16 & 32 bits-per-pixel the colour depth
669 is honoured, and when using a colour depth that requires fewer bytes than
670 allocated the extra bytes are used as padding. So for a 32 bpp with 8 bit
671 index colour, there are 3 padding bytes per pixel. It's also possible to
672 select 16bpp with a 32 bit colour mode. This results in the pixel width
673 being doubled, but the color key will not work as expected in this mode.
674
675 Colour key is as it suggests. You designate a colour which will become
676 completely transparent. When using 565, 555 or 444 colour modes, the
677 colour key is always 16 bits wide. The colour to key on is set in Reg 2A18.
678
679 Local alpha is a per-pixel 256 step transparency, with 0 being transparent
680 and 255 being solid. This is only available in 32 bit & 8 bit indexed
681 colour modes.
682
683 Global alpha is a 256 step transparency that applies to the entire osd,
684 with 0 being transparent & 255 being solid.
685
686 It's possible to combine colour key, local alpha & global alpha.
687--------------------------------------------------------------------------------
6882A04
689 bits 0:15
690 osd x coord for left edge
691
692 bits 16:31
693 osd y coord for top edge
694---------------
6952A08
696 bits 0:15
697 osd x coord for right edge
698
699 bits 16:31
700 osd y coord for bottom edge
701
702 For both registers, (0,0) = top left corner of the display area. These
703 registers do not control the osd size, only where it's positioned & how
704 much is visible. The visible osd area cannot exceed the right edge of the
705 display, otherwise the osd will become corrupt. See reg 2A10 for
706 setting osd width.
707--------------------------------------------------------------------------------
7082A0C
709 bits 0:31
710 osd buffer index
711
712 An index into the osd buffer. Slowly incrementing this moves the osd left,
713 wrapping around onto the right edge
714--------------------------------------------------------------------------------
7152A10
716 bits 0:11
717 osd buffer 32 bit word width
718
719 Contains the width of the osd measured in 32 bit words. This means that all
720 colour modes are restricted to a byte width which is divisible by 4.
721--------------------------------------------------------------------------------
7222A14
723 bits 0:15
724 osd height in pixels
725
726 bits 16:32
727 osd line index into buffer
728 osd will start displaying from this line.
729--------------------------------------------------------------------------------
7302A18
731 bits 0:31
732 osd colour key
733
734 Contains the colour value which will be transparent.
735--------------------------------------------------------------------------------
7362A1C
737 bits 0:7
738 osd global alpha
739
740 Contains the global alpha value (equiv ivtvfbctl --alpha XX)
741--------------------------------------------------------------------------------
7422A20 -------- ?? unknown
743 |
744 V
7452A2C -------- ?? unknown
746--------------------------------------------------------------------------------
7472A30
748 bits 0:7
749 osd colour to change in indexed palette
750---------------
7512A34
752 bits 0:31
753 osd colour for indexed palette
754
755 To set the new palette, first load the index of the colour to change into
756 2A30, then load the new colour into 2A34. The full palette is 256 colours,
757 so the index range is 0x00-0xFF
758--------------------------------------------------------------------------------
7592A38 -------- ?? unknown
7602A3C -------- ?? unknown
761--------------------------------------------------------------------------------
7622A40
763 bits 0:31
764 osd ?? unknown
765
766 Affects overall brightness, wrapping around to black
767--------------------------------------------------------------------------------
7682A44
769 bits 0:31
770 osd ?? unknown
771
772 Green tint
773--------------------------------------------------------------------------------
7742A48
775 bits 0:31
776 osd ?? unknown
777
778 Red tint
779--------------------------------------------------------------------------------
7802A4C
781 bits 0:31
782 osd ?? unknown
783
784 Affects overall brightness, wrapping around to black
785--------------------------------------------------------------------------------
7862A50
787 bits 0:31
788 osd ?? unknown
789
790 Colour shift
791--------------------------------------------------------------------------------
7922A54
793 bits 0:31
794 osd ?? unknown
795
796 Colour shift
797--------------------------------------------------------------------------------
7982A58 -------- ?? unknown
799 |
800 V
8012AFC -------- ?? unknown
802--------------------------------------------------------------------------------
8032B00
804 bit 0
805 osd filter control
806 0 = filter off
807 1 = filter on
808
809 bits 1:4
810 osd ?? unknown
811
812--------------------------------------------------------------------------------
813
814v0.3 - 2 February 2007 - Ian Armstrong (ian@iarmst.demon.co.uk)
815
diff --git a/Documentation/video4linux/cx2341x/fw-dma.txt b/Documentation/video4linux/cx2341x/fw-dma.txt
index 8123e262d5b6..be52b6fd1e9a 100644
--- a/Documentation/video4linux/cx2341x/fw-dma.txt
+++ b/Documentation/video4linux/cx2341x/fw-dma.txt
@@ -22,6 +22,8 @@ urged to choose a smaller block size and learn the scatter-gather technique.
22 22
23Mailbox #10 is reserved for DMA transfer information. 23Mailbox #10 is reserved for DMA transfer information.
24 24
25Note: the hardware expects little-endian data ('intel format').
26
25Flow 27Flow
26==== 28====
27 29
@@ -64,7 +66,7 @@ addresses are the physical memory location of the target DMA buffer.
64 66
65Each S-G array element is a struct of three 32-bit words. The first word is 67Each 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 68the 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 69entire 32 bits. The lowest 18 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 70count. 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 71the 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 72you forget to set this bit, the card will still "work" but the stream will
@@ -78,8 +80,8 @@ Array Element:
78 80
79- 32-bit Source Address 81- 32-bit Source Address
80- 32-bit Destination Address 82- 32-bit Destination Address
81- 16-bit reserved (high bit is the last flag) 83- 14-bit reserved (high bit is the last flag)
82- 16-bit byte count 84- 18-bit byte count
83 85
84DMA Transfer Status 86DMA Transfer Status
85=================== 87===================
@@ -87,8 +89,8 @@ DMA Transfer Status
87Register 0x0004 holds the DMA Transfer Status: 89Register 0x0004 holds the DMA Transfer Status:
88 90
89Bit 91Bit
904 Scatter-Gather array error
913 DMA write error
922 DMA read error
931 write completed
940 read completed 920 read completed
931 write completed
942 DMA read error
953 DMA write error
964 Scatter-Gather array error
diff --git a/Documentation/video4linux/cx2341x/fw-encoder-api.txt b/Documentation/video4linux/cx2341x/fw-encoder-api.txt
index 15df0df57ddd..242104ce5b61 100644
--- a/Documentation/video4linux/cx2341x/fw-encoder-api.txt
+++ b/Documentation/video4linux/cx2341x/fw-encoder-api.txt
@@ -213,16 +213,6 @@ Param[1]
213 213
214------------------------------------------------------------------------------- 214-------------------------------------------------------------------------------
215 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 216Name CX2341X_ENC_SET_VBI_LINE
227Enum 183/0xB7 217Enum 183/0xB7
228Description 218Description
@@ -332,9 +322,7 @@ Param[0]
332 '01'=JointStereo 322 '01'=JointStereo
333 '10'=Dual 323 '10'=Dual
334 '11'=Mono 324 '11'=Mono
335 Note: testing seems to indicate that Mono and possibly 325 Note: the cx23415 cannot decode Joint Stereo properly.
336 JointStereo are not working (default to stereo).
337 Dual does work, though.
338 326
339 10:11 Mode Extension used in joint_stereo mode. 327 10:11 Mode Extension used in joint_stereo mode.
340 In Layer I and II they indicate which subbands are in 328 In Layer I and II they indicate which subbands are in
@@ -413,16 +401,34 @@ Name CX2341X_ENC_SET_PGM_INDEX_INFO
413Enum 199/0xC7 401Enum 199/0xC7
414Description 402Description
415 Sets the Program Index Information. 403 Sets the Program Index Information.
404 The information is stored as follows:
405
406 struct info {
407 u32 length; // Length of this frame
408 u32 offset_low; // Offset in the file of the
409 u32 offset_high; // start of this frame
410 u32 mask1; // Bits 0-1 are the type mask:
411 // 1=I, 2=P, 4=B
412 u32 pts; // The PTS of the frame
413 u32 mask2; // Bit 0 is bit 32 of the pts.
414 };
415 u32 table_ptr;
416 struct info index[400];
417
418 The table_ptr is the encoder memory address in the table were
419 *new* entries will be written. Note that this is a ringbuffer,
420 so the table_ptr will wraparound.
416Param[0] 421Param[0]
417 Picture Mask: 422 Picture Mask:
418 0=No index capture 423 0=No index capture
419 1=I frames 424 1=I frames
420 3=I,P frames 425 3=I,P frames
421 7=I,P,B frames 426 7=I,P,B frames
427 (Seems to be ignored, it always indexes I, P and B frames)
422Param[1] 428Param[1]
423 Elements requested (up to 400) 429 Elements requested (up to 400)
424Result[0] 430Result[0]
425 Offset in SDF memory of the table. 431 Offset in the encoder memory of the start of the table.
426Result[1] 432Result[1]
427 Number of allocated elements up to a maximum of Param[1] 433 Number of allocated elements up to a maximum of Param[1]
428 434
@@ -492,12 +498,14 @@ Name CX2341X_ENC_GET_PREV_DMA_INFO_MB_9
492Enum 203/0xCB 498Enum 203/0xCB
493Description 499Description
494 Returns information on the previous DMA transfer in conjunction with 500 Returns information on the previous DMA transfer in conjunction with
495 bit 27 of the interrupt mask. Uses mailbox 9. 501 bit 27 or 18 of the interrupt mask. Uses mailbox 9.
496Result[0] 502Result[0]
497 Status bits: 503 Status bits:
498 Bit 0 set indicates transfer complete 504 0 read completed
499 Bit 2 set indicates transfer error 505 1 write completed
500 Bit 4 set indicates linked list error 506 2 DMA read error
507 3 DMA write error
508 4 Scatter-Gather array error
501Result[1] 509Result[1]
502 DMA type 510 DMA type
503Result[2] 511Result[2]
@@ -672,7 +680,7 @@ Description
672 the value. 680 the value.
673Param[0] 681Param[0]
674 Command number: 682 Command number:
675 1=set initial SCR value when starting encoding. 683 1=set initial SCR value when starting encoding (works).
676 2=set quality mode (apparently some test setting). 684 2=set quality mode (apparently some test setting).
677 3=setup advanced VIM protection handling (supposedly only for the cx23416 685 3=setup advanced VIM protection handling (supposedly only for the cx23416
678 for raw YUV). 686 for raw YUV).
@@ -681,7 +689,11 @@ Param[0]
681 4=generate artificial PTS timestamps 689 4=generate artificial PTS timestamps
682 5=USB flush mode 690 5=USB flush mode
683 6=something to do with the quantization matrix 691 6=something to do with the quantization matrix
684 7=set navigation pack insertion for DVD 692 7=set navigation pack insertion for DVD: adds 0xbf (private stream 2)
693 packets to the MPEG. The size of these packets is 2048 bytes (including
694 the header of 6 bytes: 0x000001bf + length). The payload is zeroed and
695 it is up to the application to fill them in. These packets are apparently
696 inserted every four frames.
685 8=enable scene change detection (seems to be a failure) 697 8=enable scene change detection (seems to be a failure)
686 9=set history parameters of the video input module 698 9=set history parameters of the video input module
687 10=set input field order of VIM 699 10=set input field order of VIM
diff --git a/Documentation/video4linux/cx2341x/fw-memory.txt b/Documentation/video4linux/cx2341x/fw-memory.txt
index ef0aad3f88fc..9d736fe8de66 100644
--- a/Documentation/video4linux/cx2341x/fw-memory.txt
+++ b/Documentation/video4linux/cx2341x/fw-memory.txt
@@ -1,6 +1,8 @@
1This document describes the cx2341x memory map and documents some of the register 1This document describes the cx2341x memory map and documents some of the register
2space. 2space.
3 3
4Note: the memory long words are little-endian ('intel format').
5
4Warning! This information was figured out from searching through the memory and 6Warning! This information was figured out from searching through the memory and
5registers, this information may not be correct and is certainly not complete, and 7registers, 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 8was not derived from anything more than searching through the memory space with
@@ -67,7 +69,7 @@ DMA Registers 0x000-0xff:
67 0x84 - first write linked list reg, for pci memory addr 69 0x84 - first write linked list reg, for pci memory addr
68 0x88 - first write linked list reg, for length of buffer in memory addr 70 0x88 - first write linked list reg, for length of buffer in memory addr
69 (|0x80000000 or this for last link) 71 (|0x80000000 or this for last link)
70 0x8c-0xcc - rest of write linked list reg, 8 sets of 3 total, DMA goes here 72 0x8c-0xdc - 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 73 from linked list addr in reg 0x0c, firmware must push through or
72 something. 74 something.
73 0xe0 - first (and only) read linked list reg, for pci memory addr 75 0xe0 - first (and only) read linked list reg, for pci memory addr
@@ -123,12 +125,8 @@ Bit
12329 Encoder VBI capture 12529 Encoder VBI capture
12428 Encoder Video Input Module reset event 12628 Encoder Video Input Module reset event
12527 Encoder DMA complete 12727 Encoder DMA complete
12626 12824 Decoder audio mode change detection event (through event notification)
12725 Decoder copy protect detection event
12824 Decoder audio mode change detection event
12923
13022 Decoder data request 12922 Decoder data request
13121 Decoder I-Frame? done
13220 Decoder DMA complete 13020 Decoder DMA complete
13319 Decoder VBI re-insertion 13119 Decoder VBI re-insertion
13418 Decoder DMA err (linked-list bad) 13218 Decoder DMA err (linked-list bad)
diff --git a/Documentation/video4linux/et61x251.txt b/Documentation/video4linux/et61x251.txt
index 1bdee8f85b9a..1247566c4de3 100644
--- a/Documentation/video4linux/et61x251.txt
+++ b/Documentation/video4linux/et61x251.txt
@@ -23,7 +23,7 @@ Index
23 23
241. Copyright 241. Copyright
25============ 25============
26Copyright (C) 2006 by Luca Risolia <luca.risolia@studio.unibo.it> 26Copyright (C) 2006-2007 by Luca Risolia <luca.risolia@studio.unibo.it>
27 27
28 28
292. Disclaimer 292. Disclaimer
@@ -135,8 +135,9 @@ And finally:
1356. Module loading 1356. Module loading
136================= 136=================
137To use the driver, it is necessary to load the "et61x251" module into memory 137To use the driver, it is necessary to load the "et61x251" module into memory
138after every other module required: "videodev", "usbcore" and, depending on 138after every other module required: "videodev", "v4l2_common", "compat_ioctl32",
139the USB host controller you have, "ehci-hcd", "uhci-hcd" or "ohci-hcd". 139"usbcore" and, depending on the USB host controller you have, "ehci-hcd",
140"uhci-hcd" or "ohci-hcd".
140 141
141Loading can be done as shown below: 142Loading can be done as shown below:
142 143
diff --git a/Documentation/video4linux/sn9c102.txt b/Documentation/video4linux/sn9c102.txt
index 8cda472db36d..2913da3d0878 100644
--- a/Documentation/video4linux/sn9c102.txt
+++ b/Documentation/video4linux/sn9c102.txt
@@ -1,5 +1,5 @@
1 1
2 SN9C10x PC Camera Controllers 2 SN9C1xx PC Camera Controllers
3 Driver for Linux 3 Driver for Linux
4 ============================= 4 =============================
5 5
@@ -53,20 +53,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
53 53
544. Overview and features 544. Overview and features
55======================== 55========================
56This driver attempts to support the video interface of the devices mounting the 56This driver attempts to support the video interface of the devices assembling
57SONiX SN9C101, SN9C102 and SN9C103 PC Camera Controllers. 57the SONiX SN9C101, SN9C102, SN9C103, SN9C105 and SN9C120 PC Camera Controllers
58 58("SN9C1xx" from now on).
59It's worth to note that SONiX has never collaborated with the author during the
60development of this project, despite several requests for enough detailed
61specifications of the register tables, compression engine and video data format
62of the above chips. Nevertheless, these informations are no longer necessary,
63because all the aspects related to these chips are known and have been
64described in detail in this documentation.
65 59
66The driver relies on the Video4Linux2 and USB core modules. It has been 60The driver relies on the Video4Linux2 and USB core modules. It has been
67designed to run properly on SMP systems as well. 61designed to run properly on SMP systems as well.
68 62
69The latest version of the SN9C10x driver can be found at the following URL: 63The latest version of the SN9C1xx driver can be found at the following URL:
70http://www.linux-projects.org/ 64http://www.linux-projects.org/
71 65
72Some of the features of the driver are: 66Some of the features of the driver are:
@@ -85,11 +79,11 @@ Some of the features of the driver are:
85 high compression quality (see also "Notes for V4L2 application developers" 79 high compression quality (see also "Notes for V4L2 application developers"
86 and "Video frame formats" paragraphs); 80 and "Video frame formats" paragraphs);
87- full support for the capabilities of many of the possible image sensors that 81- full support for the capabilities of many of the possible image sensors that
88 can be connected to the SN9C10x bridges, including, for instance, red, green, 82 can be connected to the SN9C1xx bridges, including, for instance, red, green,
89 blue and global gain adjustments and exposure (see "Supported devices" 83 blue and global gain adjustments and exposure (see "Supported devices"
90 paragraph for details); 84 paragraph for details);
91- use of default color settings for sunlight conditions; 85- use of default color settings for sunlight conditions;
92- dynamic I/O interface for both SN9C10x and image sensor control and 86- dynamic I/O interface for both SN9C1xx and image sensor control and
93 monitoring (see "Optional device control through 'sysfs'" paragraph); 87 monitoring (see "Optional device control through 'sysfs'" paragraph);
94- dynamic driver control thanks to various module parameters (see "Module 88- dynamic driver control thanks to various module parameters (see "Module
95 parameters" paragraph); 89 parameters" paragraph);
@@ -130,8 +124,8 @@ necessary:
130 CONFIG_USB_UHCI_HCD=m 124 CONFIG_USB_UHCI_HCD=m
131 CONFIG_USB_OHCI_HCD=m 125 CONFIG_USB_OHCI_HCD=m
132 126
133The SN9C103 controller also provides a built-in microphone interface. It is 127The SN9C103, SN9c105 and SN9C120 controllers also provide a built-in microphone
134supported by the USB Audio driver thanks to the ALSA API: 128interface. It is supported by the USB Audio driver thanks to the ALSA API:
135 129
136 # Sound 130 # Sound
137 # 131 #
@@ -155,18 +149,27 @@ And finally:
1556. Module loading 1496. Module loading
156================= 150=================
157To use the driver, it is necessary to load the "sn9c102" module into memory 151To use the driver, it is necessary to load the "sn9c102" module into memory
158after every other module required: "videodev", "usbcore" and, depending on 152after every other module required: "videodev", "v4l2_common", "compat_ioctl32",
159the USB host controller you have, "ehci-hcd", "uhci-hcd" or "ohci-hcd". 153"usbcore" and, depending on the USB host controller you have, "ehci-hcd",
154"uhci-hcd" or "ohci-hcd".
160 155
161Loading can be done as shown below: 156Loading can be done as shown below:
162 157
163 [root@localhost home]# modprobe sn9c102 158 [root@localhost home]# modprobe sn9c102
164 159
165At this point the devices should be recognized. You can invoke "dmesg" to 160Note that the module is called "sn9c102" for historic reasons, althought it
166analyze kernel messages and verify that the loading process has gone well: 161does not just support the SN9C102.
162
163At this point all the devices supported by the driver and connected to the USB
164ports should be recognized. You can invoke "dmesg" to analyze kernel messages
165and verify that the loading process has gone well:
167 166
168 [user@localhost home]$ dmesg 167 [user@localhost home]$ dmesg
169 168
169or, to isolate all the kernel messages generated by the driver:
170
171 [user@localhost home]$ dmesg | grep sn9c102
172
170 173
1717. Module parameters 1747. Module parameters
172==================== 175====================
@@ -198,10 +201,11 @@ Default: 0
198------------------------------------------------------------------------------- 201-------------------------------------------------------------------------------
199Name: frame_timeout 202Name: frame_timeout
200Type: uint array (min = 0, max = 64) 203Type: uint array (min = 0, max = 64)
201Syntax: <n[,...]> 204Syntax: <0|n[,...]>
202Description: Timeout for a video frame in seconds. This parameter is 205Description: Timeout for a video frame in seconds before returning an I/O
203 specific for each detected camera. This parameter can be 206 error; 0 for infinity. This parameter is specific for each
204 changed at runtime thanks to the /sys filesystem interface. 207 detected camera and can be changed at runtime thanks to the
208 /sys filesystem interface.
205Default: 2 209Default: 2
206------------------------------------------------------------------------------- 210-------------------------------------------------------------------------------
207Name: debug 211Name: debug
@@ -223,20 +227,21 @@ Default: 2
2238. Optional device control through "sysfs" [1] 2278. Optional device control through "sysfs" [1]
224========================================== 228==========================================
225If the kernel has been compiled with the CONFIG_VIDEO_ADV_DEBUG option enabled, 229If the kernel has been compiled with the CONFIG_VIDEO_ADV_DEBUG option enabled,
226it is possible to read and write both the SN9C10x and the image sensor 230it is possible to read and write both the SN9C1xx and the image sensor
227registers by using the "sysfs" filesystem interface. 231registers by using the "sysfs" filesystem interface.
228 232
229Every time a supported device is recognized, a write-only file named "green" is 233Every time a supported device is recognized, a write-only file named "green" is
230created in the /sys/class/video4linux/videoX directory. You can set the green 234created in the /sys/class/video4linux/videoX directory. You can set the green
231channel's gain by writing the desired value to it. The value may range from 0 235channel's gain by writing the desired value to it. The value may range from 0
232to 15 for SN9C101 or SN9C102 bridges, from 0 to 127 for SN9C103 bridges. 236to 15 for the SN9C101 or SN9C102 bridges, from 0 to 127 for the SN9C103,
233Similarly, only for SN9C103 controllers, blue and red gain control files are 237SN9C105 and SN9C120 bridges.
234available in the same directory, for which accepted values may range from 0 to 238Similarly, only for the SN9C103, SN9C105 and SN9120 controllers, blue and red
235127. 239gain control files are available in the same directory, for which accepted
240values may range from 0 to 127.
236 241
237There are other four entries in the directory above for each registered camera: 242There are other four entries in the directory above for each registered camera:
238"reg", "val", "i2c_reg" and "i2c_val". The first two files control the 243"reg", "val", "i2c_reg" and "i2c_val". The first two files control the
239SN9C10x bridge, while the other two control the sensor chip. "reg" and 244SN9C1xx bridge, while the other two control the sensor chip. "reg" and
240"i2c_reg" hold the values of the current register index where the following 245"i2c_reg" hold the values of the current register index where the following
241reading/writing operations are addressed at through "val" and "i2c_val". Their 246reading/writing operations are addressed at through "val" and "i2c_val". Their
242use is not intended for end-users. Note that "i2c_reg" and "i2c_val" will not 247use is not intended for end-users. Note that "i2c_reg" and "i2c_val" will not
@@ -259,61 +264,84 @@ Now let's set the green gain's register of the SN9C101 or SN9C102 chips to 2:
259 [root@localhost #] echo 0x11 > reg 264 [root@localhost #] echo 0x11 > reg
260 [root@localhost #] echo 2 > val 265 [root@localhost #] echo 2 > val
261 266
262Note that the SN9C10x always returns 0 when some of its registers are read. 267Note that the SN9C1xx always returns 0 when some of its registers are read.
263To avoid race conditions, all the I/O accesses to the above files are 268To avoid race conditions, all the I/O accesses to the above files are
264serialized. 269serialized.
265
266The sysfs interface also provides the "frame_header" entry, which exports the 270The sysfs interface also provides the "frame_header" entry, which exports the
267frame header of the most recent requested and captured video frame. The header 271frame header of the most recent requested and captured video frame. The header
268is always 18-bytes long and is appended to every video frame by the SN9C10x 272is always 18-bytes long and is appended to every video frame by the SN9C1xx
269controllers. As an example, this additional information can be used by the user 273controllers. As an example, this additional information can be used by the user
270application for implementing auto-exposure features via software. 274application for implementing auto-exposure features via software.
271 275
272The following table describes the frame header: 276The following table describes the frame header exported by the SN9C101 and
273 277SN9C102:
274Byte # Value Description 278
275------ ----- ----------- 279Byte # Value or bits Description
2760x00 0xFF Frame synchronisation pattern. 280------ ------------- -----------
2770x01 0xFF Frame synchronisation pattern. 2810x00 0xFF Frame synchronisation pattern
2780x02 0x00 Frame synchronisation pattern. 2820x01 0xFF Frame synchronisation pattern
2790x03 0xC4 Frame synchronisation pattern. 2830x02 0x00 Frame synchronisation pattern
2800x04 0xC4 Frame synchronisation pattern. 2840x03 0xC4 Frame synchronisation pattern
2810x05 0x96 Frame synchronisation pattern. 2850x04 0xC4 Frame synchronisation pattern
2820x06 0xXX Unknown meaning. The exact value depends on the chip; 2860x05 0x96 Frame synchronisation pattern
283 possible values are 0x00, 0x01 and 0x20. 2870x06 [3:0] Read channel gain control = (1+R_GAIN/8)
2840x07 0xXX Variable value, whose bits are ff00uzzc, where ff is a 288 [7:4] Blue channel gain control = (1+B_GAIN/8)
285 frame counter, u is unknown, zz is a size indicator 2890x07 [ 0 ] Compression mode. 0=No compression, 1=Compression enabled
286 (00 = VGA, 01 = SIF, 10 = QSIF) and c stands for 290 [2:1] Maximum scale factor for compression
287 "compression enabled" (1 = yes, 0 = no). 291 [ 3 ] 1 = USB fifo(2K bytes) is full
2880x08 0xXX Brightness sum inside Auto-Exposure area (low-byte). 292 [ 4 ] 1 = Digital gain is finish
2890x09 0xXX Brightness sum inside Auto-Exposure area (high-byte). 293 [ 5 ] 1 = Exposure is finish
290 For a pure white image, this number will be equal to 500 294 [7:6] Frame index
291 times the area of the specified AE area. For images 2950x08 [7:0] Y sum inside Auto-Exposure area (low-byte)
292 that are not pure white, the value scales down according 2960x09 [7:0] Y sum inside Auto-Exposure area (high-byte)
293 to relative whiteness. 297 where Y sum = (R/4 + 5G/16 + B/8) / 32
2940x0A 0xXX Brightness sum outside Auto-Exposure area (low-byte). 2980x0A [7:0] Y sum outside Auto-Exposure area (low-byte)
2950x0B 0xXX Brightness sum outside Auto-Exposure area (high-byte). 2990x0B [7:0] Y sum outside Auto-Exposure area (high-byte)
296 For a pure white image, this number will be equal to 125 300 where Y sum = (R/4 + 5G/16 + B/8) / 128
297 times the area outside of the specified AE area. For 3010x0C 0xXX Not used
298 images that are not pure white, the value scales down 3020x0D 0xXX Not used
299 according to relative whiteness. 3030x0E 0xXX Not used
300 according to relative whiteness. 3040x0F 0xXX Not used
301 3050x10 0xXX Not used
302The following bytes are used by the SN9C103 bridge only: 3060x11 0xXX Not used
303 307
3040x0C 0xXX Unknown meaning 308The following table describes the frame header exported by the SN9C103:
3050x0D 0xXX Unknown meaning 309
3060x0E 0xXX Unknown meaning 310Byte # Value or bits Description
3070x0F 0xXX Unknown meaning 311------ ------------- -----------
3080x10 0xXX Unknown meaning 3120x00 0xFF Frame synchronisation pattern
3090x11 0xXX Unknown meaning 3130x01 0xFF Frame synchronisation pattern
3140x02 0x00 Frame synchronisation pattern
3150x03 0xC4 Frame synchronisation pattern
3160x04 0xC4 Frame synchronisation pattern
3170x05 0x96 Frame synchronisation pattern
3180x06 [6:0] Read channel gain control = (1/2+R_GAIN/64)
3190x07 [6:0] Blue channel gain control = (1/2+B_GAIN/64)
320 [7:4]
3210x08 [ 0 ] Compression mode. 0=No compression, 1=Compression enabled
322 [2:1] Maximum scale factor for compression
323 [ 3 ] 1 = USB fifo(2K bytes) is full
324 [ 4 ] 1 = Digital gain is finish
325 [ 5 ] 1 = Exposure is finish
326 [7:6] Frame index
3270x09 [7:0] Y sum inside Auto-Exposure area (low-byte)
3280x0A [7:0] Y sum inside Auto-Exposure area (high-byte)
329 where Y sum = (R/4 + 5G/16 + B/8) / 32
3300x0B [7:0] Y sum outside Auto-Exposure area (low-byte)
3310x0C [7:0] Y sum outside Auto-Exposure area (high-byte)
332 where Y sum = (R/4 + 5G/16 + B/8) / 128
3330x0D [1:0] Audio frame number
334 [ 2 ] 1 = Audio is recording
3350x0E [7:0] Audio summation (low-byte)
3360x0F [7:0] Audio summation (high-byte)
3370x10 [7:0] Audio sample count
3380x11 [7:0] Audio peak data in audio frame
310 339
311The AE area (sx, sy, ex, ey) in the active window can be set by programming the 340The AE area (sx, sy, ex, ey) in the active window can be set by programming the
312registers 0x1c, 0x1d, 0x1e and 0x1f of the SN9C10x controllers, where one unit 341registers 0x1c, 0x1d, 0x1e and 0x1f of the SN9C1xx controllers, where one unit
313corresponds to 32 pixels. 342corresponds to 32 pixels.
314 343
315[1] Part of the meaning of the frame header has been documented by Bertrik 344[1] The frame headers exported by the SN9C105 and SN9C120 are not described.
316 Sikken.
317 345
318 346
3199. Supported devices 3479. Supported devices
@@ -323,15 +351,19 @@ here. They have never collaborated with the author, so no advertising.
323 351
324From the point of view of a driver, what unambiguously identify a device are 352From the point of view of a driver, what unambiguously identify a device are
325its vendor and product USB identifiers. Below is a list of known identifiers of 353its vendor and product USB identifiers. Below is a list of known identifiers of
326devices mounting the SN9C10x PC camera controllers: 354devices assembling the SN9C1xx PC camera controllers:
327 355
328Vendor ID Product ID 356Vendor ID Product ID
329--------- ---------- 357--------- ----------
3580x0471 0x0327
3590x0471 0x0328
3300x0c45 0x6001 3600x0c45 0x6001
3310x0c45 0x6005 3610x0c45 0x6005
3320x0c45 0x6007 3620x0c45 0x6007
3330x0c45 0x6009 3630x0c45 0x6009
3340x0c45 0x600d 3640x0c45 0x600d
3650x0c45 0x6011
3660x0c45 0x6019
3350x0c45 0x6024 3670x0c45 0x6024
3360x0c45 0x6025 3680x0c45 0x6025
3370x0c45 0x6028 3690x0c45 0x6028
@@ -342,6 +374,7 @@ Vendor ID Product ID
3420x0c45 0x602d 3740x0c45 0x602d
3430x0c45 0x602e 3750x0c45 0x602e
3440x0c45 0x6030 3760x0c45 0x6030
3770x0c45 0x603f
3450x0c45 0x6080 3780x0c45 0x6080
3460x0c45 0x6082 3790x0c45 0x6082
3470x0c45 0x6083 3800x0c45 0x6083
@@ -368,24 +401,40 @@ Vendor ID Product ID
3680x0c45 0x60bb 4010x0c45 0x60bb
3690x0c45 0x60bc 4020x0c45 0x60bc
3700x0c45 0x60be 4030x0c45 0x60be
4040x0c45 0x60c0
4050x0c45 0x60c8
4060x0c45 0x60cc
4070x0c45 0x60ea
4080x0c45 0x60ec
4090x0c45 0x60fa
4100x0c45 0x60fb
4110x0c45 0x60fc
4120x0c45 0x60fe
4130x0c45 0x6130
4140x0c45 0x613a
4150x0c45 0x613b
4160x0c45 0x613c
4170x0c45 0x613e
371 418
372The list above does not imply that all those devices work with this driver: up 419The list above does not imply that all those devices work with this driver: up
373until now only the ones that mount the following image sensors are supported; 420until now only the ones that assemble the following image sensors are
374kernel messages will always tell you whether this is the case: 421supported; kernel messages will always tell you whether this is the case (see
422"Module loading" paragraph):
375 423
376Model Manufacturer 424Model Manufacturer
377----- ------------ 425----- ------------
378HV7131D Hynix Semiconductor, Inc. 426HV7131D Hynix Semiconductor, Inc.
379MI-0343 Micron Technology, Inc. 427MI-0343 Micron Technology, Inc.
380OV7630 OmniVision Technologies, Inc. 428OV7630 OmniVision Technologies, Inc.
429OV7660 OmniVision Technologies, Inc.
381PAS106B PixArt Imaging, Inc. 430PAS106B PixArt Imaging, Inc.
382PAS202BCA PixArt Imaging, Inc. 431PAS202BCA PixArt Imaging, Inc.
383PAS202BCB PixArt Imaging, Inc. 432PAS202BCB PixArt Imaging, Inc.
384TAS5110C1B Taiwan Advanced Sensor Corporation 433TAS5110C1B Taiwan Advanced Sensor Corporation
385TAS5130D1B Taiwan Advanced Sensor Corporation 434TAS5130D1B Taiwan Advanced Sensor Corporation
386 435
387All the available control settings of each image sensor are supported through 436Some of the available control settings of each image sensor are supported
388the V4L2 interface. 437through the V4L2 interface.
389 438
390Donations of new models for further testing and support would be much 439Donations of new models for further testing and support would be much
391appreciated. Non-available hardware will not be supported by the author of this 440appreciated. Non-available hardware will not be supported by the author of this
@@ -429,12 +478,15 @@ supplied by this driver).
429 478
43011. Video frame formats [1] 47911. Video frame formats [1]
431======================= 480=======================
432The SN9C10x PC Camera Controllers can send images in two possible video 481The SN9C1xx PC Camera Controllers can send images in two possible video
433formats over the USB: either native "Sequential RGB Bayer" or Huffman 482formats over the USB: either native "Sequential RGB Bayer" or compressed.
434compressed. The latter is used to achieve high frame rates. The current video 483The compression is used to achieve high frame rates. With regard to the
435format may be selected or queried from the user application by calling the 484SN9C101, SN9C102 and SN9C103, the compression is based on the Huffman encoding
436VIDIOC_S_FMT or VIDIOC_G_FMT ioctl's, as described in the V4L2 API 485algorithm described below, while the SN9C105 and SN9C120 the compression is
437specifications. 486based on the JPEG standard.
487The current video format may be selected or queried from the user application
488by calling the VIDIOC_S_FMT or VIDIOC_G_FMT ioctl's, as described in the V4L2
489API specifications.
438 490
439The name "Sequential Bayer" indicates the organization of the red, green and 491The name "Sequential Bayer" indicates the organization of the red, green and
440blue pixels in one video frame. Each pixel is associated with a 8-bit long 492blue pixels in one video frame. Each pixel is associated with a 8-bit long
@@ -447,14 +499,14 @@ G[m] R[m+1] G[m+2] R[m+2] ... G[2m-2] R[2m-1]
447... G[n(m-2)] R[n(m-1)] 499... G[n(m-2)] R[n(m-1)]
448 500
449The above matrix also represents the sequential or progressive read-out mode of 501The above matrix also represents the sequential or progressive read-out mode of
450the (n, m) Bayer color filter array used in many CCD/CMOS image sensors. 502the (n, m) Bayer color filter array used in many CCD or CMOS image sensors.
451 503
452One compressed video frame consists of a bitstream that encodes for every R, G, 504The Huffman compressed video frame consists of a bitstream that encodes for
453or B pixel the difference between the value of the pixel itself and some 505every R, G, or B pixel the difference between the value of the pixel itself and
454reference pixel value. Pixels are organised in the Bayer pattern and the Bayer 506some reference pixel value. Pixels are organised in the Bayer pattern and the
455sub-pixels are tracked individually and alternatingly. For example, in the 507Bayer sub-pixels are tracked individually and alternatingly. For example, in
456first line values for the B and G1 pixels are alternatingly encoded, while in 508the first line values for the B and G1 pixels are alternatingly encoded, while
457the second line values for the G2 and R pixels are alternatingly encoded. 509in the second line values for the G2 and R pixels are alternatingly encoded.
458 510
459The pixel reference value is calculated as follows: 511The pixel reference value is calculated as follows:
460- the 4 top left pixels are encoded in raw uncompressed 8-bit format; 512- the 4 top left pixels are encoded in raw uncompressed 8-bit format;
@@ -470,8 +522,9 @@ The pixel reference value is calculated as follows:
470 decoding. 522 decoding.
471 523
472The algorithm purely describes the conversion from compressed Bayer code used 524The algorithm purely describes the conversion from compressed Bayer code used
473in the SN9C10x chips to uncompressed Bayer. Additional steps are required to 525in the SN9C101, SN9C102 and SN9C103 chips to uncompressed Bayer. Additional
474convert this to a color image (i.e. a color interpolation algorithm). 526steps are required to convert this to a color image (i.e. a color interpolation
527algorithm).
475 528
476The following Huffman codes have been found: 529The following Huffman codes have been found:
4770: +0 (relative to reference pixel value) 5300: +0 (relative to reference pixel value)
@@ -506,13 +559,18 @@ order):
506- Philippe Coval for having helped testing the PAS202BCA image sensor; 559- Philippe Coval for having helped testing the PAS202BCA image sensor;
507- Joao Rodrigo Fuzaro, Joao Limirio, Claudio Filho and Caio Begotti for the 560- Joao Rodrigo Fuzaro, Joao Limirio, Claudio Filho and Caio Begotti for the
508 donation of a webcam; 561 donation of a webcam;
562- Dennis Heitmann for the donation of a webcam;
509- Jon Hollstrom for the donation of a webcam; 563- Jon Hollstrom for the donation of a webcam;
564- Nick McGill for the donation of a webcam;
510- Carlos Eduardo Medaglia Dyonisio, who added the support for the PAS202BCB 565- Carlos Eduardo Medaglia Dyonisio, who added the support for the PAS202BCB
511 image sensor; 566 image sensor;
512- Stefano Mozzi, who donated 45 EU; 567- Stefano Mozzi, who donated 45 EU;
513- Andrew Pearce for the donation of a webcam; 568- Andrew Pearce for the donation of a webcam;
569- John Pullan for the donation of a webcam;
514- Bertrik Sikken, who reverse-engineered and documented the Huffman compression 570- Bertrik Sikken, who reverse-engineered and documented the Huffman compression
515 algorithm used in the SN9C10x controllers and implemented the first decoder; 571 algorithm used in the SN9C101, SN9C102 and SN9C103 controllers and
572 implemented the first decoder;
516- Mizuno Takafumi for the donation of a webcam; 573- Mizuno Takafumi for the donation of a webcam;
517- an "anonymous" donator (who didn't want his name to be revealed) for the 574- an "anonymous" donator (who didn't want his name to be revealed) for the
518 donation of a webcam. 575 donation of a webcam.
576- an anonymous donator for the donation of four webcams.
diff --git a/Documentation/video4linux/zc0301.txt b/Documentation/video4linux/zc0301.txt
index f406f5e80046..befdfdacdc5b 100644
--- a/Documentation/video4linux/zc0301.txt
+++ b/Documentation/video4linux/zc0301.txt
@@ -23,7 +23,7 @@ Index
23 23
241. Copyright 241. Copyright
25============ 25============
26Copyright (C) 2006 by Luca Risolia <luca.risolia@studio.unibo.it> 26Copyright (C) 2006-2007 by Luca Risolia <luca.risolia@studio.unibo.it>
27 27
28 28
292. Disclaimer 292. Disclaimer
@@ -125,8 +125,9 @@ And finally:
1256. Module loading 1256. Module loading
126================= 126=================
127To use the driver, it is necessary to load the "zc0301" module into memory 127To use the driver, it is necessary to load the "zc0301" module into memory
128after every other module required: "videodev", "usbcore" and, depending on 128after every other module required: "videodev", "v4l2_common", "compat_ioctl32",
129the USB host controller you have, "ehci-hcd", "uhci-hcd" or "ohci-hcd". 129"usbcore" and, depending on the USB host controller you have, "ehci-hcd",
130"uhci-hcd" or "ohci-hcd".
130 131
131Loading can be done as shown below: 132Loading can be done as shown below:
132 133
@@ -211,12 +212,11 @@ Vendor ID Product ID
2110x041e 0x4036 2120x041e 0x4036
2120x041e 0x403a 2130x041e 0x403a
2130x0458 0x7007 2140x0458 0x7007
2140x0458 0x700C 2150x0458 0x700c
2150x0458 0x700f 2160x0458 0x700f
2160x046d 0x08ae 2170x046d 0x08ae
2170x055f 0xd003 2180x055f 0xd003
2180x055f 0xd004 2190x055f 0xd004
2190x046d 0x08ae
2200x0ac8 0x0301 2200x0ac8 0x0301
2210x0ac8 0x301b 2210x0ac8 0x301b
2220x0ac8 0x303b 2220x0ac8 0x303b