aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/video4linux
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /Documentation/video4linux
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'Documentation/video4linux')
-rw-r--r--Documentation/video4linux/CARDLIST.cx238853
-rw-r--r--Documentation/video4linux/CARDLIST.cx881
-rw-r--r--Documentation/video4linux/CARDLIST.em28xx3
-rw-r--r--Documentation/video4linux/CARDLIST.saa71343
-rw-r--r--Documentation/video4linux/CARDLIST.tuner1
-rw-r--r--Documentation/video4linux/README.tlg230047
-rw-r--r--Documentation/video4linux/gspca.txt70
-rw-r--r--Documentation/video4linux/sh_mobile_ceu_camera.txt157
-rw-r--r--Documentation/video4linux/si4713.txt2
-rw-r--r--Documentation/video4linux/v4l2-framework.txt122
-rw-r--r--Documentation/video4linux/videobuf360
-rw-r--r--Documentation/video4linux/zr364xx.txt1
12 files changed, 649 insertions, 121 deletions
diff --git a/Documentation/video4linux/CARDLIST.cx23885 b/Documentation/video4linux/CARDLIST.cx23885
index 5f33d8486102..16ca030e1185 100644
--- a/Documentation/video4linux/CARDLIST.cx23885
+++ b/Documentation/video4linux/CARDLIST.cx23885
@@ -24,3 +24,6 @@
24 23 -> Magic-Pro ProHDTV Extreme 2 [14f1:8657] 24 23 -> Magic-Pro ProHDTV Extreme 2 [14f1:8657]
25 24 -> Hauppauge WinTV-HVR1850 [0070:8541] 25 24 -> Hauppauge WinTV-HVR1850 [0070:8541]
26 25 -> Compro VideoMate E800 [1858:e800] 26 25 -> Compro VideoMate E800 [1858:e800]
27 26 -> Hauppauge WinTV-HVR1290 [0070:8551]
28 27 -> Mygica X8558 PRO DMB-TH [14f1:8578]
29 28 -> LEADTEK WinFast PxTV1200 [107d:6f22]
diff --git a/Documentation/video4linux/CARDLIST.cx88 b/Documentation/video4linux/CARDLIST.cx88
index 3385f8b094a5..7ec3c4e4b60f 100644
--- a/Documentation/video4linux/CARDLIST.cx88
+++ b/Documentation/video4linux/CARDLIST.cx88
@@ -81,3 +81,4 @@
81 80 -> Hauppauge WinTV-IR Only [0070:9290] 81 80 -> Hauppauge WinTV-IR Only [0070:9290]
82 81 -> Leadtek WinFast DTV1800 Hybrid [107d:6654] 82 81 -> Leadtek WinFast DTV1800 Hybrid [107d:6654]
83 82 -> WinFast DTV2000 H rev. J [107d:6f2b] 83 82 -> WinFast DTV2000 H rev. J [107d:6f2b]
84 83 -> Prof 7301 DVB-S/S2 [b034:3034]
diff --git a/Documentation/video4linux/CARDLIST.em28xx b/Documentation/video4linux/CARDLIST.em28xx
index b8afef4c0e01..0c166ff003a0 100644
--- a/Documentation/video4linux/CARDLIST.em28xx
+++ b/Documentation/video4linux/CARDLIST.em28xx
@@ -1,5 +1,5 @@
1 0 -> Unknown EM2800 video grabber (em2800) [eb1a:2800] 1 0 -> Unknown EM2800 video grabber (em2800) [eb1a:2800]
2 1 -> Unknown EM2750/28xx video grabber (em2820/em2840) [eb1a:2710,eb1a:2820,eb1a:2821,eb1a:2860,eb1a:2861,eb1a:2870,eb1a:2881,eb1a:2883,eb1a:2868] 2 1 -> Unknown EM2750/28xx video grabber (em2820/em2840) [eb1a:2710,eb1a:2820,eb1a:2821,eb1a:2860,eb1a:2861,eb1a:2862,eb1a:2870,eb1a:2881,eb1a:2883,eb1a:2868]
3 2 -> Terratec Cinergy 250 USB (em2820/em2840) [0ccd:0036] 3 2 -> Terratec Cinergy 250 USB (em2820/em2840) [0ccd:0036]
4 3 -> Pinnacle PCTV USB 2 (em2820/em2840) [2304:0208] 4 3 -> Pinnacle PCTV USB 2 (em2820/em2840) [2304:0208]
5 4 -> Hauppauge WinTV USB 2 (em2820/em2840) [2040:4200,2040:4201] 5 4 -> Hauppauge WinTV USB 2 (em2820/em2840) [2040:4200,2040:4201]
@@ -69,3 +69,4 @@
69 71 -> Silvercrest Webcam 1.3mpix (em2820/em2840) 69 71 -> Silvercrest Webcam 1.3mpix (em2820/em2840)
70 72 -> Gadmei UTV330+ (em2861) 70 72 -> Gadmei UTV330+ (em2861)
71 73 -> Reddo DVB-C USB TV Box (em2870) 71 73 -> Reddo DVB-C USB TV Box (em2870)
72 74 -> Actionmaster/LinXcel/Digitus VC211A (em2800)
diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134
index 2620d60341ee..b4a767060ed7 100644
--- a/Documentation/video4linux/CARDLIST.saa7134
+++ b/Documentation/video4linux/CARDLIST.saa7134
@@ -172,3 +172,6 @@
172171 -> Beholder BeholdTV X7 [5ace:7595] 172171 -> Beholder BeholdTV X7 [5ace:7595]
173172 -> RoverMedia TV Link Pro FM [19d1:0138] 173172 -> RoverMedia TV Link Pro FM [19d1:0138]
174173 -> Zolid Hybrid TV Tuner PCI [1131:2004] 174173 -> Zolid Hybrid TV Tuner PCI [1131:2004]
175174 -> Asus Europa Hybrid OEM [1043:4847]
176175 -> Leadtek Winfast DTV1000S [107d:6655]
177176 -> Beholder BeholdTV 505 RDS [0000:5051]
diff --git a/Documentation/video4linux/CARDLIST.tuner b/Documentation/video4linux/CARDLIST.tuner
index e0d298fe8830..9b2e0dd6017e 100644
--- a/Documentation/video4linux/CARDLIST.tuner
+++ b/Documentation/video4linux/CARDLIST.tuner
@@ -81,3 +81,4 @@ tuner=80 - Philips FQ1216LME MK3 PAL/SECAM w/active loopthrough
81tuner=81 - Partsnic (Daewoo) PTI-5NF05 81tuner=81 - Partsnic (Daewoo) PTI-5NF05
82tuner=82 - Philips CU1216L 82tuner=82 - Philips CU1216L
83tuner=83 - NXP TDA18271 83tuner=83 - NXP TDA18271
84tuner=84 - Sony BTF-Pxn01Z
diff --git a/Documentation/video4linux/README.tlg2300 b/Documentation/video4linux/README.tlg2300
new file mode 100644
index 000000000000..416ccb93d8c9
--- /dev/null
+++ b/Documentation/video4linux/README.tlg2300
@@ -0,0 +1,47 @@
1tlg2300 release notes
2====================
3
4This is a v4l2/dvb device driver for the tlg2300 chip.
5
6
7current status
8==============
9
10video
11 - support mmap and read().(no overlay)
12
13audio
14 - The driver will register a ALSA card for the audio input.
15
16vbi
17 - Works for almost TV norms.
18
19dvb-t
20 - works for DVB-T
21
22FM
23 - Works for radio.
24
25---------------------------------------------------------------------------
26TESTED APPLICATIONS:
27
28-VLC1.0.4 test the video and dvb. The GUI is friendly to use.
29
30-Mplayer test the video.
31
32-Mplayer test the FM. The mplayer should be compiled with --enable-radio and
33 --enable-radio-capture.
34 The command runs as this(The alsa audio registers to card 1):
35 #mplayer radio://103.7/capture/ -radio adevice=hw=1,0:arate=48000 \
36 -rawaudio rate=48000:channels=2
37
38---------------------------------------------------------------------------
39KNOWN PROBLEMS:
40about preemphasis:
41 You can set the preemphasis for radio by the following command:
42 #v4l2-ctl -d /dev/radio0 --set-ctrl=pre_emphasis_settings=1
43
44 "pre_emphasis_settings=1" means that you select the 50us. If you want
45 to select the 75us, please use "pre_emphasis_settings=2"
46
47
diff --git a/Documentation/video4linux/gspca.txt b/Documentation/video4linux/gspca.txt
index 3f61825be499..181b9e6fd984 100644
--- a/Documentation/video4linux/gspca.txt
+++ b/Documentation/video4linux/gspca.txt
@@ -6,11 +6,13 @@ The modules are:
6 6
7xxxx vend:prod 7xxxx vend:prod
8---- 8----
9spca501 0000:0000 MystFromOri Unknow Camera 9spca501 0000:0000 MystFromOri Unknown Camera
10spca508 0130:0130 Clone Digital Webcam 11043
10m5602 0402:5602 ALi Video Camera Controller 11m5602 0402:5602 ALi Video Camera Controller
11spca501 040a:0002 Kodak DVC-325 12spca501 040a:0002 Kodak DVC-325
12spca500 040a:0300 Kodak EZ200 13spca500 040a:0300 Kodak EZ200
13zc3xx 041e:041e Creative WebCam Live! 14zc3xx 041e:041e Creative WebCam Live!
15ov519 041e:4003 Video Blaster WebCam Go Plus
14spca500 041e:400a Creative PC-CAM 300 16spca500 041e:400a Creative PC-CAM 300
15sunplus 041e:400b Creative PC-CAM 600 17sunplus 041e:400b Creative PC-CAM 600
16sunplus 041e:4012 PC-Cam350 18sunplus 041e:4012 PC-Cam350
@@ -37,8 +39,10 @@ ov519 041e:405f Creative Live! VISTA VF0330
37ov519 041e:4060 Creative Live! VISTA VF0350 39ov519 041e:4060 Creative Live! VISTA VF0350
38ov519 041e:4061 Creative Live! VISTA VF0400 40ov519 041e:4061 Creative Live! VISTA VF0400
39ov519 041e:4064 Creative Live! VISTA VF0420 41ov519 041e:4064 Creative Live! VISTA VF0420
42ov519 041e:4067 Creative Live! Cam Video IM (VF0350)
40ov519 041e:4068 Creative Live! VISTA VF0470 43ov519 041e:4068 Creative Live! VISTA VF0470
41spca561 0458:7004 Genius VideoCAM Express V2 44spca561 0458:7004 Genius VideoCAM Express V2
45sn9c2028 0458:7005 Genius Smart 300, version 2
42sunplus 0458:7006 Genius Dsc 1.3 Smart 46sunplus 0458:7006 Genius Dsc 1.3 Smart
43zc3xx 0458:7007 Genius VideoCam V2 47zc3xx 0458:7007 Genius VideoCam V2
44zc3xx 0458:700c Genius VideoCam V3 48zc3xx 0458:700c Genius VideoCam V3
@@ -68,12 +72,12 @@ zc3xx 046d:08a3 Logitech QC Chat
68zc3xx 046d:08a6 Logitech QCim 72zc3xx 046d:08a6 Logitech QCim
69zc3xx 046d:08a7 Logitech QuickCam Image 73zc3xx 046d:08a7 Logitech QuickCam Image
70zc3xx 046d:08a9 Logitech Notebook Deluxe 74zc3xx 046d:08a9 Logitech Notebook Deluxe
71zc3xx 046d:08aa Labtec Webcam Notebook 75zc3xx 046d:08aa Labtec Webcam Notebook
72zc3xx 046d:08ac Logitech QuickCam Cool 76zc3xx 046d:08ac Logitech QuickCam Cool
73zc3xx 046d:08ad Logitech QCCommunicate STX 77zc3xx 046d:08ad Logitech QCCommunicate STX
74zc3xx 046d:08ae Logitech QuickCam for Notebooks 78zc3xx 046d:08ae Logitech QuickCam for Notebooks
75zc3xx 046d:08af Logitech QuickCam Cool 79zc3xx 046d:08af Logitech QuickCam Cool
76zc3xx 046d:08b9 Logitech QC IM ??? 80zc3xx 046d:08b9 Logitech QuickCam Express
77zc3xx 046d:08d7 Logitech QCam STX 81zc3xx 046d:08d7 Logitech QCam STX
78zc3xx 046d:08d9 Logitech QuickCam IM/Connect 82zc3xx 046d:08d9 Logitech QuickCam IM/Connect
79zc3xx 046d:08d8 Logitech Notebook Deluxe 83zc3xx 046d:08d8 Logitech Notebook Deluxe
@@ -82,7 +86,7 @@ zc3xx 046d:08dd Logitech QuickCam for Notebooks
82spca500 046d:0900 Logitech Inc. ClickSmart 310 86spca500 046d:0900 Logitech Inc. ClickSmart 310
83spca500 046d:0901 Logitech Inc. ClickSmart 510 87spca500 046d:0901 Logitech Inc. ClickSmart 510
84sunplus 046d:0905 Logitech ClickSmart 820 88sunplus 046d:0905 Logitech ClickSmart 820
85tv8532 046d:0920 QC Express 89tv8532 046d:0920 Logitech QuickCam Express
86tv8532 046d:0921 Labtec Webcam 90tv8532 046d:0921 Labtec Webcam
87spca561 046d:0928 Logitech QC Express Etch2 91spca561 046d:0928 Logitech QC Express Etch2
88spca561 046d:0929 Labtec Webcam Elch2 92spca561 046d:0929 Labtec Webcam Elch2
@@ -91,7 +95,7 @@ spca561 046d:092b Labtec Webcam Plus
91spca561 046d:092c Logitech QC chat Elch2 95spca561 046d:092c Logitech QC chat Elch2
92spca561 046d:092d Logitech QC Elch2 96spca561 046d:092d Logitech QC Elch2
93spca561 046d:092e Logitech QC Elch2 97spca561 046d:092e Logitech QC Elch2
94spca561 046d:092f Logitech QuickCam Express Plus 98spca561 046d:092f Logitech QuickCam Express Plus
95sunplus 046d:0960 Logitech ClickSmart 420 99sunplus 046d:0960 Logitech ClickSmart 420
96sunplus 0471:0322 Philips DMVC1300K 100sunplus 0471:0322 Philips DMVC1300K
97zc3xx 0471:0325 Philips SPC 200 NC 101zc3xx 0471:0325 Philips SPC 200 NC
@@ -106,6 +110,7 @@ sunplus 04a5:3003 Benq DC 1300
106sunplus 04a5:3008 Benq DC 1500 110sunplus 04a5:3008 Benq DC 1500
107sunplus 04a5:300a Benq DC 3410 111sunplus 04a5:300a Benq DC 3410
108spca500 04a5:300c Benq DC 1016 112spca500 04a5:300c Benq DC 1016
113benq 04a5:3035 Benq DC E300
109finepix 04cb:0104 Fujifilm FinePix 4800 114finepix 04cb:0104 Fujifilm FinePix 4800
110finepix 04cb:0109 Fujifilm FinePix A202 115finepix 04cb:0109 Fujifilm FinePix A202
111finepix 04cb:010b Fujifilm FinePix A203 116finepix 04cb:010b Fujifilm FinePix A203
@@ -139,6 +144,7 @@ sunplus 04fc:5360 Sunplus Generic
139spca500 04fc:7333 PalmPixDC85 144spca500 04fc:7333 PalmPixDC85
140sunplus 04fc:ffff Pure DigitalDakota 145sunplus 04fc:ffff Pure DigitalDakota
141spca501 0506:00df 3Com HomeConnect Lite 146spca501 0506:00df 3Com HomeConnect Lite
147sunplus 052b:1507 Megapixel 5 Pretec DC-1007
142sunplus 052b:1513 Megapix V4 148sunplus 052b:1513 Megapix V4
143sunplus 052b:1803 MegaImage VI 149sunplus 052b:1803 MegaImage VI
144tv8532 0545:808b Veo Stingray 150tv8532 0545:808b Veo Stingray
@@ -148,6 +154,7 @@ sunplus 0546:3191 Polaroid Ion 80
148sunplus 0546:3273 Polaroid PDC2030 154sunplus 0546:3273 Polaroid PDC2030
149ov519 054c:0154 Sonny toy4 155ov519 054c:0154 Sonny toy4
150ov519 054c:0155 Sonny toy5 156ov519 054c:0155 Sonny toy5
157cpia1 0553:0002 CPIA CPiA (version1) based cameras
151zc3xx 055f:c005 Mustek Wcam300A 158zc3xx 055f:c005 Mustek Wcam300A
152spca500 055f:c200 Mustek Gsmart 300 159spca500 055f:c200 Mustek Gsmart 300
153sunplus 055f:c211 Kowa Bs888e Microcamera 160sunplus 055f:c211 Kowa Bs888e Microcamera
@@ -166,10 +173,14 @@ sunplus 055f:c650 Mustek MDC5500Z
166zc3xx 055f:d003 Mustek WCam300A 173zc3xx 055f:d003 Mustek WCam300A
167zc3xx 055f:d004 Mustek WCam300 AN 174zc3xx 055f:d004 Mustek WCam300 AN
168conex 0572:0041 Creative Notebook cx11646 175conex 0572:0041 Creative Notebook cx11646
176ov519 05a9:0511 Video Blaster WebCam 3/WebCam Plus, D-Link USB Digital Video Camera
177ov519 05a9:0518 Creative WebCam
169ov519 05a9:0519 OV519 Microphone 178ov519 05a9:0519 OV519 Microphone
170ov519 05a9:0530 OmniVision 179ov519 05a9:0530 OmniVision
180ov519 05a9:2800 OmniVision SuperCAM
171ov519 05a9:4519 Webcam Classic 181ov519 05a9:4519 Webcam Classic
172ov519 05a9:8519 OmniVision 182ov519 05a9:8519 OmniVision
183ov519 05a9:a511 D-Link USB Digital Video Camera
173ov519 05a9:a518 D-Link DSB-C310 Webcam 184ov519 05a9:a518 D-Link DSB-C310 Webcam
174sunplus 05da:1018 Digital Dream Enigma 1.3 185sunplus 05da:1018 Digital Dream Enigma 1.3
175stk014 05e1:0893 Syntek DV4000 186stk014 05e1:0893 Syntek DV4000
@@ -181,13 +192,11 @@ spca500 06bd:0404 Agfa CL20
181spca500 06be:0800 Optimedia 192spca500 06be:0800 Optimedia
182sunplus 06d6:0031 Trust 610 LCD PowerC@m Zoom 193sunplus 06d6:0031 Trust 610 LCD PowerC@m Zoom
183spca506 06e1:a190 ADS Instant VCD 194spca506 06e1:a190 ADS Instant VCD
184ov534 06f8:3002 Hercules Blog Webcam 195ov534_9 06f8:3003 Hercules Dualpix HD Weblog
185ov534 06f8:3003 Hercules Dualpix HD Weblog
186sonixj 06f8:3004 Hercules Classic Silver 196sonixj 06f8:3004 Hercules Classic Silver
187sonixj 06f8:3008 Hercules Deluxe Optical Glass 197sonixj 06f8:3008 Hercules Deluxe Optical Glass
188pac7311 06f8:3009 Hercules Classic Link 198pac7302 06f8:3009 Hercules Classic Link
189spca508 0733:0110 ViewQuest VQ110 199spca508 0733:0110 ViewQuest VQ110
190spca508 0130:0130 Clone Digital Webcam 11043
191spca501 0733:0401 Intel Create and Share 200spca501 0733:0401 Intel Create and Share
192spca501 0733:0402 ViewQuest M318B 201spca501 0733:0402 ViewQuest M318B
193spca505 0733:0430 Intel PC Camera Pro 202spca505 0733:0430 Intel PC Camera Pro
@@ -198,10 +207,13 @@ sunplus 0733:2221 Mercury Digital Pro 3.1p
198sunplus 0733:3261 Concord 3045 spca536a 207sunplus 0733:3261 Concord 3045 spca536a
199sunplus 0733:3281 Cyberpix S550V 208sunplus 0733:3281 Cyberpix S550V
200spca506 0734:043b 3DeMon USB Capture aka 209spca506 0734:043b 3DeMon USB Capture aka
210cpia1 0813:0001 QX3 camera
211ov519 0813:0002 Dual Mode USB Camera Plus
201spca500 084d:0003 D-Link DSC-350 212spca500 084d:0003 D-Link DSC-350
202spca500 08ca:0103 Aiptek PocketDV 213spca500 08ca:0103 Aiptek PocketDV
203sunplus 08ca:0104 Aiptek PocketDVII 1.3 214sunplus 08ca:0104 Aiptek PocketDVII 1.3
204sunplus 08ca:0106 Aiptek Pocket DV3100+ 215sunplus 08ca:0106 Aiptek Pocket DV3100+
216mr97310a 08ca:0110 Trust Spyc@m 100
205mr97310a 08ca:0111 Aiptek PenCam VGA+ 217mr97310a 08ca:0111 Aiptek PenCam VGA+
206sunplus 08ca:2008 Aiptek Mini PenCam 2 M 218sunplus 08ca:2008 Aiptek Mini PenCam 2 M
207sunplus 08ca:2010 Aiptek PocketCam 3M 219sunplus 08ca:2010 Aiptek PocketCam 3M
@@ -217,12 +229,13 @@ sunplus 08ca:2050 Medion MD 41437
217sunplus 08ca:2060 Aiptek PocketDV5300 229sunplus 08ca:2060 Aiptek PocketDV5300
218tv8532 0923:010f ICM532 cams 230tv8532 0923:010f ICM532 cams
219mars 093a:050f Mars-Semi Pc-Camera 231mars 093a:050f Mars-Semi Pc-Camera
220mr97310a 093a:010f Sakar Digital no. 77379 232mr97310a 093a:010e All known CIF cams with this ID
233mr97310a 093a:010f All known VGA cams with this ID
221pac207 093a:2460 Qtec Webcam 100 234pac207 093a:2460 Qtec Webcam 100
222pac207 093a:2461 HP Webcam 235pac207 093a:2461 HP Webcam
223pac207 093a:2463 Philips SPC 220 NC 236pac207 093a:2463 Philips SPC 220 NC
224pac207 093a:2464 Labtec Webcam 1200 237pac207 093a:2464 Labtec Webcam 1200
225pac207 093a:2468 PAC207 238pac207 093a:2468 Webcam WB-1400T
226pac207 093a:2470 Genius GF112 239pac207 093a:2470 Genius GF112
227pac207 093a:2471 Genius VideoCam ge111 240pac207 093a:2471 Genius VideoCam ge111
228pac207 093a:2472 Genius VideoCam ge110 241pac207 093a:2472 Genius VideoCam ge110
@@ -230,18 +243,19 @@ pac207 093a:2474 Genius iLook 111
230pac207 093a:2476 Genius e-Messenger 112 243pac207 093a:2476 Genius e-Messenger 112
231pac7311 093a:2600 PAC7311 Typhoon 244pac7311 093a:2600 PAC7311 Typhoon
232pac7311 093a:2601 Philips SPC 610 NC 245pac7311 093a:2601 Philips SPC 610 NC
233pac7311 093a:2603 PAC7312 246pac7311 093a:2603 Philips SPC 500 NC
234pac7311 093a:2608 Trust WB-3300p 247pac7311 093a:2608 Trust WB-3300p
235pac7311 093a:260e Gigaware VGA PC Camera, Trust WB-3350p, SIGMA cam 2350 248pac7311 093a:260e Gigaware VGA PC Camera, Trust WB-3350p, SIGMA cam 2350
236pac7311 093a:260f SnakeCam 249pac7311 093a:260f SnakeCam
237pac7311 093a:2620 Apollo AC-905 250pac7302 093a:2620 Apollo AC-905
238pac7311 093a:2621 PAC731x 251pac7302 093a:2621 PAC731x
239pac7311 093a:2622 Genius Eye 312 252pac7302 093a:2622 Genius Eye 312
240pac7311 093a:2624 PAC7302 253pac7302 093a:2624 PAC7302
241pac7311 093a:2626 Labtec 2200 254pac7302 093a:2626 Labtec 2200
242pac7311 093a:2629 Genious iSlim 300 255pac7302 093a:2628 Genius iLook 300
243pac7311 093a:262a Webcam 300k 256pac7302 093a:2629 Genious iSlim 300
244pac7311 093a:262c Philips SPC 230 NC 257pac7302 093a:262a Webcam 300k
258pac7302 093a:262c Philips SPC 230 NC
245jeilinj 0979:0280 Sakar 57379 259jeilinj 0979:0280 Sakar 57379
246zc3xx 0ac8:0302 Z-star Vimicro zc0302 260zc3xx 0ac8:0302 Z-star Vimicro zc0302
247vc032x 0ac8:0321 Vimicro generic vc0321 261vc032x 0ac8:0321 Vimicro generic vc0321
@@ -250,12 +264,13 @@ vc032x 0ac8:0328 A4Tech PK-130MG
250zc3xx 0ac8:301b Z-Star zc301b 264zc3xx 0ac8:301b Z-Star zc301b
251zc3xx 0ac8:303b Vimicro 0x303b 265zc3xx 0ac8:303b Vimicro 0x303b
252zc3xx 0ac8:305b Z-star Vimicro zc0305b 266zc3xx 0ac8:305b Z-star Vimicro zc0305b
253zc3xx 0ac8:307b Ldlc VC302+Ov7620 267zc3xx 0ac8:307b PC Camera (ZS0211)
254vc032x 0ac8:c001 Sony embedded vimicro 268vc032x 0ac8:c001 Sony embedded vimicro
255vc032x 0ac8:c002 Sony embedded vimicro 269vc032x 0ac8:c002 Sony embedded vimicro
256vc032x 0ac8:c301 Samsung Q1 Ultra Premium 270vc032x 0ac8:c301 Samsung Q1 Ultra Premium
257spca508 0af9:0010 Hama USB Sightcam 100 271spca508 0af9:0010 Hama USB Sightcam 100
258spca508 0af9:0011 Hama USB Sightcam 100 272spca508 0af9:0011 Hama USB Sightcam 100
273ov519 0b62:0059 iBOT2 Webcam
259sonixb 0c45:6001 Genius VideoCAM NB 274sonixb 0c45:6001 Genius VideoCAM NB
260sonixb 0c45:6005 Microdia Sweex Mini Webcam 275sonixb 0c45:6005 Microdia Sweex Mini Webcam
261sonixb 0c45:6007 Sonix sn9c101 + Tas5110D 276sonixb 0c45:6007 Sonix sn9c101 + Tas5110D
@@ -292,6 +307,7 @@ sonixj 0c45:613b Surfer SN-206
292sonixj 0c45:613c Sonix Pccam168 307sonixj 0c45:613c Sonix Pccam168
293sonixj 0c45:6143 Sonix Pccam168 308sonixj 0c45:6143 Sonix Pccam168
294sonixj 0c45:6148 Digitus DA-70811/ZSMC USB PC Camera ZS211/Microdia 309sonixj 0c45:6148 Digitus DA-70811/ZSMC USB PC Camera ZS211/Microdia
310sonixj 0c45:614a Frontech E-Ccam (JIL-2225)
295sn9c20x 0c45:6240 PC Camera (SN9C201 + MT9M001) 311sn9c20x 0c45:6240 PC Camera (SN9C201 + MT9M001)
296sn9c20x 0c45:6242 PC Camera (SN9C201 + MT9M111) 312sn9c20x 0c45:6242 PC Camera (SN9C201 + MT9M111)
297sn9c20x 0c45:6248 PC Camera (SN9C201 + OV9655) 313sn9c20x 0c45:6248 PC Camera (SN9C201 + OV9655)
@@ -314,9 +330,15 @@ sn9c20x 0c45:62b0 PC Camera (SN9C202 + MT9V011/MT9V111/MT9V112)
314sn9c20x 0c45:62b3 PC Camera (SN9C202 + OV9655) 330sn9c20x 0c45:62b3 PC Camera (SN9C202 + OV9655)
315sn9c20x 0c45:62bb PC Camera (SN9C202 + OV7660) 331sn9c20x 0c45:62bb PC Camera (SN9C202 + OV7660)
316sn9c20x 0c45:62bc PC Camera (SN9C202 + HV7131R) 332sn9c20x 0c45:62bc PC Camera (SN9C202 + HV7131R)
333sn9c2028 0c45:8001 Wild Planet Digital Spy Camera
334sn9c2028 0c45:8003 Sakar #11199, #6637x, #67480 keychain cams
335sn9c2028 0c45:8008 Mini-Shotz ms-350
336sn9c2028 0c45:800a Vivitar Vivicam 3350B
317sunplus 0d64:0303 Sunplus FashionCam DXG 337sunplus 0d64:0303 Sunplus FashionCam DXG
338ov519 0e96:c001 TRUST 380 USB2 SPACEC@M
318etoms 102c:6151 Qcam Sangha CIF 339etoms 102c:6151 Qcam Sangha CIF
319etoms 102c:6251 Qcam xxxxxx VGA 340etoms 102c:6251 Qcam xxxxxx VGA
341ov519 1046:9967 W9967CF/W9968CF WebCam IC, Video Blaster WebCam Go
320zc3xx 10fd:0128 Typhoon Webshot II USB 300k 0x0128 342zc3xx 10fd:0128 Typhoon Webshot II USB 300k 0x0128
321spca561 10fd:7e50 FlyCam Usb 100 343spca561 10fd:7e50 FlyCam Usb 100
322zc3xx 10fd:8050 Typhoon Webshot II USB 300k 344zc3xx 10fd:8050 Typhoon Webshot II USB 300k
@@ -329,7 +351,13 @@ spca501 1776:501c Arowana 300K CMOS Camera
329t613 17a1:0128 TASCORP JPEG Webcam, NGS Cyclops 351t613 17a1:0128 TASCORP JPEG Webcam, NGS Cyclops
330vc032x 17ef:4802 Lenovo Vc0323+MI1310_SOC 352vc032x 17ef:4802 Lenovo Vc0323+MI1310_SOC
331pac207 2001:f115 D-Link DSB-C120 353pac207 2001:f115 D-Link DSB-C120
354sq905c 2770:9050 Disney pix micro (CIF)
355sq905c 2770:9052 Disney pix micro 2 (VGA)
356sq905c 2770:905c All 11 known cameras with this ID
357sq905 2770:9120 All 24 known cameras with this ID
358sq905c 2770:913d All 4 known cameras with this ID
332spca500 2899:012c Toptro Industrial 359spca500 2899:012c Toptro Industrial
360ov519 8020:ef04 ov519
333spca508 8086:0110 Intel Easy PC Camera 361spca508 8086:0110 Intel Easy PC Camera
334spca500 8086:0630 Intel Pocket PC Camera 362spca500 8086:0630 Intel Pocket PC Camera
335spca506 99fa:8988 Grandtec V.cap 363spca506 99fa:8988 Grandtec V.cap
diff --git a/Documentation/video4linux/sh_mobile_ceu_camera.txt b/Documentation/video4linux/sh_mobile_ceu_camera.txt
new file mode 100644
index 000000000000..2ae16349a78d
--- /dev/null
+++ b/Documentation/video4linux/sh_mobile_ceu_camera.txt
@@ -0,0 +1,157 @@
1 Cropping and Scaling algorithm, used in the sh_mobile_ceu_camera driver
2 =======================================================================
3
4Terminology
5-----------
6
7sensor scales: horizontal and vertical scales, configured by the sensor driver
8host scales: -"- host driver
9combined scales: sensor_scale * host_scale
10
11
12Generic scaling / cropping scheme
13---------------------------------
14
15-1--
16|
17-2-- -\
18| --\
19| --\
20+-5-- -\ -- -3--
21| ---\
22| --- -4-- -\
23| -\
24| - -6--
25|
26| - -6'-
27| -/
28| --- -4'- -/
29| ---/
30+-5'- -/
31| -- -3'-
32| --/
33| --/
34-2'- -/
35|
36|
37-1'-
38
39Produced by user requests:
40
41S_CROP(left / top = (5) - (1), width / height = (5') - (5))
42S_FMT(width / height = (6') - (6))
43
44Here:
45
46(1) to (1') - whole max width or height
47(1) to (2) - sensor cropped left or top
48(2) to (2') - sensor cropped width or height
49(3) to (3') - sensor scale
50(3) to (4) - CEU cropped left or top
51(4) to (4') - CEU cropped width or height
52(5) to (5') - reverse sensor scale applied to CEU cropped width or height
53(2) to (5) - reverse sensor scale applied to CEU cropped left or top
54(6) to (6') - CEU scale - user window
55
56
57S_FMT
58-----
59
60Do not touch input rectangle - it is already optimal.
61
621. Calculate current sensor scales:
63
64 scale_s = ((3') - (3)) / ((2') - (2))
65
662. Calculate "effective" input crop (sensor subwindow) - CEU crop scaled back at
67current sensor scales onto input window - this is user S_CROP:
68
69 width_u = (5') - (5) = ((4') - (4)) * scale_s
70
713. Calculate new combined scales from "effective" input window to requested user
72window:
73
74 scale_comb = width_u / ((6') - (6))
75
764. Calculate sensor output window by applying combined scales to real input
77window:
78
79 width_s_out = ((2') - (2)) / scale_comb
80
815. Apply iterative sensor S_FMT for sensor output window.
82
83 subdev->video_ops->s_fmt(.width = width_s_out)
84
856. Retrieve sensor output window (g_fmt)
86
877. Calculate new sensor scales:
88
89 scale_s_new = ((3')_new - (3)_new) / ((2') - (2))
90
918. Calculate new CEU crop - apply sensor scales to previously calculated
92"effective" crop:
93
94 width_ceu = (4')_new - (4)_new = width_u / scale_s_new
95 left_ceu = (4)_new - (3)_new = ((5) - (2)) / scale_s_new
96
979. Use CEU cropping to crop to the new window:
98
99 ceu_crop(.width = width_ceu, .left = left_ceu)
100
10110. Use CEU scaling to scale to the requested user window:
102
103 scale_ceu = width_ceu / width
104
105
106S_CROP
107------
108
109If old scale applied to new crop is invalid produce nearest new scale possible
110
1111. Calculate current combined scales.
112
113 scale_comb = (((4') - (4)) / ((6') - (6))) * (((2') - (2)) / ((3') - (3)))
114
1152. Apply iterative sensor S_CROP for new input window.
116
1173. If old combined scales applied to new crop produce an impossible user window,
118adjust scales to produce nearest possible window.
119
120 width_u_out = ((5') - (5)) / scale_comb
121
122 if (width_u_out > max)
123 scale_comb = ((5') - (5)) / max;
124 else if (width_u_out < min)
125 scale_comb = ((5') - (5)) / min;
126
1274. Issue G_CROP to retrieve actual input window.
128
1295. Using actual input window and calculated combined scales calculate sensor
130target output window.
131
132 width_s_out = ((3') - (3)) = ((2') - (2)) / scale_comb
133
1346. Apply iterative S_FMT for new sensor target output window.
135
1367. Issue G_FMT to retrieve the actual sensor output window.
137
1388. Calculate sensor scales.
139
140 scale_s = ((3') - (3)) / ((2') - (2))
141
1429. Calculate sensor output subwindow to be cropped on CEU by applying sensor
143scales to the requested window.
144
145 width_ceu = ((5') - (5)) / scale_s
146
14710. Use CEU cropping for above calculated window.
148
14911. Calculate CEU scales from sensor scales from results of (10) and user window
150from (3)
151
152 scale_ceu = calc_scale(((5') - (5)), &width_u_out)
153
15412. Apply CEU scales.
155
156--
157Author: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
diff --git a/Documentation/video4linux/si4713.txt b/Documentation/video4linux/si4713.txt
index 25abdb78209d..2e7392a4fee1 100644
--- a/Documentation/video4linux/si4713.txt
+++ b/Documentation/video4linux/si4713.txt
@@ -164,7 +164,7 @@ Stereo/Mono and RDS subchannels
164 164
165The device can also be configured using the available sub channels for 165The device can also be configured using the available sub channels for
166transmission. To do that use S/G_MODULATOR ioctl and configure txsubchans properly. 166transmission. To do that use S/G_MODULATOR ioctl and configure txsubchans properly.
167Refer to v4l2-spec for proper use of this ioctl. 167Refer to the V4L2 API specification for proper use of this ioctl.
168 168
169Testing 169Testing
170======= 170=======
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt
index b806edaf3e75..5155700c206b 100644
--- a/Documentation/video4linux/v4l2-framework.txt
+++ b/Documentation/video4linux/v4l2-framework.txt
@@ -561,6 +561,8 @@ video_device helper functions
561 561
562There are a few useful helper functions: 562There are a few useful helper functions:
563 563
564- file/video_device private data
565
564You can set/get driver private data in the video_device struct using: 566You can set/get driver private data in the video_device struct using:
565 567
566void *video_get_drvdata(struct video_device *vdev); 568void *video_get_drvdata(struct video_device *vdev);
@@ -575,8 +577,7 @@ struct video_device *video_devdata(struct file *file);
575 577
576returns the video_device belonging to the file struct. 578returns the video_device belonging to the file struct.
577 579
578The final helper function combines video_get_drvdata with 580The video_drvdata function combines video_get_drvdata with video_devdata:
579video_devdata:
580 581
581void *video_drvdata(struct file *file); 582void *video_drvdata(struct file *file);
582 583
@@ -584,102 +585,27 @@ You can go from a video_device struct to the v4l2_device struct using:
584 585
585struct v4l2_device *v4l2_dev = vdev->v4l2_dev; 586struct v4l2_device *v4l2_dev = vdev->v4l2_dev;
586 587
588- Device node name
589
590The video_device node kernel name can be retrieved using
591
592const char *video_device_node_name(struct video_device *vdev);
593
594The name is used as a hint by userspace tools such as udev. The function
595should be used where possible instead of accessing the video_device::num and
596video_device::minor fields.
597
598
587video buffer helper functions 599video buffer helper functions
588----------------------------- 600-----------------------------
589 601
590The v4l2 core API provides a standard method for dealing with video 602The v4l2 core API provides a set of standard methods (called "videobuf")
591buffers. Those methods allow a driver to implement read(), mmap() and 603for dealing with video buffers. Those methods allow a driver to implement
592overlay() on a consistent way. 604read(), mmap() and overlay() in a consistent way. There are currently
593 605methods for using video buffers on devices that supports DMA with
594There are currently methods for using video buffers on devices that 606scatter/gather method (videobuf-dma-sg), DMA with linear access
595supports DMA with scatter/gather method (videobuf-dma-sg), DMA with 607(videobuf-dma-contig), and vmalloced buffers, mostly used on USB drivers
596linear access (videobuf-dma-contig), and vmalloced buffers, mostly 608(videobuf-vmalloc).
597used on USB drivers (videobuf-vmalloc). 609
598 610Please see Documentation/video4linux/videobuf for more information on how
599Any driver using videobuf should provide operations (callbacks) for 611to use the videobuf layer.
600four handlers:
601
602ops->buf_setup - calculates the size of the video buffers and avoid they
603 to waste more than some maximum limit of RAM;
604ops->buf_prepare - fills the video buffer structs and calls
605 videobuf_iolock() to alloc and prepare mmaped memory;
606ops->buf_queue - advices the driver that another buffer were
607 requested (by read() or by QBUF);
608ops->buf_release - frees any buffer that were allocated.
609
610In order to use it, the driver need to have a code (generally called at
611interrupt context) that will properly handle the buffer request lists,
612announcing that a new buffer were filled.
613
614The irq handling code should handle the videobuf task lists, in order
615to advice videobuf that a new frame were filled, in order to honor to a
616request. The code is generally like this one:
617 if (list_empty(&dma_q->active))
618 return;
619
620 buf = list_entry(dma_q->active.next, struct vbuffer, vb.queue);
621
622 if (!waitqueue_active(&buf->vb.done))
623 return;
624
625 /* Some logic to handle the buf may be needed here */
626
627 list_del(&buf->vb.queue);
628 do_gettimeofday(&buf->vb.ts);
629 wake_up(&buf->vb.done);
630
631Those are the videobuffer functions used on drivers, implemented on
632videobuf-core:
633
634- Videobuf init functions
635 videobuf_queue_sg_init()
636 Initializes the videobuf infrastructure. This function should be
637 called before any other videobuf function on drivers that uses DMA
638 Scatter/Gather buffers.
639
640 videobuf_queue_dma_contig_init
641 Initializes the videobuf infrastructure. This function should be
642 called before any other videobuf function on drivers that need DMA
643 contiguous buffers.
644
645 videobuf_queue_vmalloc_init()
646 Initializes the videobuf infrastructure. This function should be
647 called before any other videobuf function on USB (and other drivers)
648 that need a vmalloced type of videobuf.
649
650- videobuf_iolock()
651 Prepares the videobuf memory for the proper method (read, mmap, overlay).
652
653- videobuf_queue_is_busy()
654 Checks if a videobuf is streaming.
655
656- videobuf_queue_cancel()
657 Stops video handling.
658
659- videobuf_mmap_free()
660 frees mmap buffers.
661
662- videobuf_stop()
663 Stops video handling, ends mmap and frees mmap and other buffers.
664
665- V4L2 api functions. Those functions correspond to VIDIOC_foo ioctls:
666 videobuf_reqbufs(), videobuf_querybuf(), videobuf_qbuf(),
667 videobuf_dqbuf(), videobuf_streamon(), videobuf_streamoff().
668
669- V4L1 api function (corresponds to VIDIOCMBUF ioctl):
670 videobuf_cgmbuf()
671 This function is used to provide backward compatibility with V4L1
672 API.
673
674- Some help functions for read()/poll() operations:
675 videobuf_read_stream()
676 For continuous stream read()
677 videobuf_read_one()
678 For snapshot read()
679 videobuf_poll_stream()
680 polling help function
681
682The better way to understand it is to take a look at vivi driver. One
683of the main reasons for vivi is to be a videobuf usage example. the
684vivi_thread_tick() does the task that the IRQ callback would do on PCI
685drivers (or the irq callback on USB).
diff --git a/Documentation/video4linux/videobuf b/Documentation/video4linux/videobuf
new file mode 100644
index 000000000000..17a1f9abf260
--- /dev/null
+++ b/Documentation/video4linux/videobuf
@@ -0,0 +1,360 @@
1An introduction to the videobuf layer
2Jonathan Corbet <corbet@lwn.net>
3Current as of 2.6.33
4
5The videobuf layer functions as a sort of glue layer between a V4L2 driver
6and user space. It handles the allocation and management of buffers for
7the storage of video frames. There is a set of functions which can be used
8to implement many of the standard POSIX I/O system calls, including read(),
9poll(), and, happily, mmap(). Another set of functions can be used to
10implement the bulk of the V4L2 ioctl() calls related to streaming I/O,
11including buffer allocation, queueing and dequeueing, and streaming
12control. Using videobuf imposes a few design decisions on the driver
13author, but the payback comes in the form of reduced code in the driver and
14a consistent implementation of the V4L2 user-space API.
15
16Buffer types
17
18Not all video devices use the same kind of buffers. In fact, there are (at
19least) three common variations:
20
21 - Buffers which are scattered in both the physical and (kernel) virtual
22 address spaces. (Almost) all user-space buffers are like this, but it
23 makes great sense to allocate kernel-space buffers this way as well when
24 it is possible. Unfortunately, it is not always possible; working with
25 this kind of buffer normally requires hardware which can do
26 scatter/gather DMA operations.
27
28 - Buffers which are physically scattered, but which are virtually
29 contiguous; buffers allocated with vmalloc(), in other words. These
30 buffers are just as hard to use for DMA operations, but they can be
31 useful in situations where DMA is not available but virtually-contiguous
32 buffers are convenient.
33
34 - Buffers which are physically contiguous. Allocation of this kind of
35 buffer can be unreliable on fragmented systems, but simpler DMA
36 controllers cannot deal with anything else.
37
38Videobuf can work with all three types of buffers, but the driver author
39must pick one at the outset and design the driver around that decision.
40
41[It's worth noting that there's a fourth kind of buffer: "overlay" buffers
42which are located within the system's video memory. The overlay
43functionality is considered to be deprecated for most use, but it still
44shows up occasionally in system-on-chip drivers where the performance
45benefits merit the use of this technique. Overlay buffers can be handled
46as a form of scattered buffer, but there are very few implementations in
47the kernel and a description of this technique is currently beyond the
48scope of this document.]
49
50Data structures, callbacks, and initialization
51
52Depending on which type of buffers are being used, the driver should
53include one of the following files:
54
55 <media/videobuf-dma-sg.h> /* Physically scattered */
56 <media/videobuf-vmalloc.h> /* vmalloc() buffers */
57 <media/videobuf-dma-contig.h> /* Physically contiguous */
58
59The driver's data structure describing a V4L2 device should include a
60struct videobuf_queue instance for the management of the buffer queue,
61along with a list_head for the queue of available buffers. There will also
62need to be an interrupt-safe spinlock which is used to protect (at least)
63the queue.
64
65The next step is to write four simple callbacks to help videobuf deal with
66the management of buffers:
67
68 struct videobuf_queue_ops {
69 int (*buf_setup)(struct videobuf_queue *q,
70 unsigned int *count, unsigned int *size);
71 int (*buf_prepare)(struct videobuf_queue *q,
72 struct videobuf_buffer *vb,
73 enum v4l2_field field);
74 void (*buf_queue)(struct videobuf_queue *q,
75 struct videobuf_buffer *vb);
76 void (*buf_release)(struct videobuf_queue *q,
77 struct videobuf_buffer *vb);
78 };
79
80buf_setup() is called early in the I/O process, when streaming is being
81initiated; its purpose is to tell videobuf about the I/O stream. The count
82parameter will be a suggested number of buffers to use; the driver should
83check it for rationality and adjust it if need be. As a practical rule, a
84minimum of two buffers are needed for proper streaming, and there is
85usually a maximum (which cannot exceed 32) which makes sense for each
86device. The size parameter should be set to the expected (maximum) size
87for each frame of data.
88
89Each buffer (in the form of a struct videobuf_buffer pointer) will be
90passed to buf_prepare(), which should set the buffer's size, width, height,
91and field fields properly. If the buffer's state field is
92VIDEOBUF_NEEDS_INIT, the driver should pass it to:
93
94 int videobuf_iolock(struct videobuf_queue* q, struct videobuf_buffer *vb,
95 struct v4l2_framebuffer *fbuf);
96
97Among other things, this call will usually allocate memory for the buffer.
98Finally, the buf_prepare() function should set the buffer's state to
99VIDEOBUF_PREPARED.
100
101When a buffer is queued for I/O, it is passed to buf_queue(), which should
102put it onto the driver's list of available buffers and set its state to
103VIDEOBUF_QUEUED. Note that this function is called with the queue spinlock
104held; if it tries to acquire it as well things will come to a screeching
105halt. Yes, this is the voice of experience. Note also that videobuf may
106wait on the first buffer in the queue; placing other buffers in front of it
107could again gum up the works. So use list_add_tail() to enqueue buffers.
108
109Finally, buf_release() is called when a buffer is no longer intended to be
110used. The driver should ensure that there is no I/O active on the buffer,
111then pass it to the appropriate free routine(s):
112
113 /* Scatter/gather drivers */
114 int videobuf_dma_unmap(struct videobuf_queue *q,
115 struct videobuf_dmabuf *dma);
116 int videobuf_dma_free(struct videobuf_dmabuf *dma);
117
118 /* vmalloc drivers */
119 void videobuf_vmalloc_free (struct videobuf_buffer *buf);
120
121 /* Contiguous drivers */
122 void videobuf_dma_contig_free(struct videobuf_queue *q,
123 struct videobuf_buffer *buf);
124
125One way to ensure that a buffer is no longer under I/O is to pass it to:
126
127 int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr);
128
129Here, vb is the buffer, non_blocking indicates whether non-blocking I/O
130should be used (it should be zero in the buf_release() case), and intr
131controls whether an interruptible wait is used.
132
133File operations
134
135At this point, much of the work is done; much of the rest is slipping
136videobuf calls into the implementation of the other driver callbacks. The
137first step is in the open() function, which must initialize the
138videobuf queue. The function to use depends on the type of buffer used:
139
140 void videobuf_queue_sg_init(struct videobuf_queue *q,
141 struct videobuf_queue_ops *ops,
142 struct device *dev,
143 spinlock_t *irqlock,
144 enum v4l2_buf_type type,
145 enum v4l2_field field,
146 unsigned int msize,
147 void *priv);
148
149 void videobuf_queue_vmalloc_init(struct videobuf_queue *q,
150 struct videobuf_queue_ops *ops,
151 struct device *dev,
152 spinlock_t *irqlock,
153 enum v4l2_buf_type type,
154 enum v4l2_field field,
155 unsigned int msize,
156 void *priv);
157
158 void videobuf_queue_dma_contig_init(struct videobuf_queue *q,
159 struct videobuf_queue_ops *ops,
160 struct device *dev,
161 spinlock_t *irqlock,
162 enum v4l2_buf_type type,
163 enum v4l2_field field,
164 unsigned int msize,
165 void *priv);
166
167In each case, the parameters are the same: q is the queue structure for the
168device, ops is the set of callbacks as described above, dev is the device
169structure for this video device, irqlock is an interrupt-safe spinlock to
170protect access to the data structures, type is the buffer type used by the
171device (cameras will use V4L2_BUF_TYPE_VIDEO_CAPTURE, for example), field
172describes which field is being captured (often V4L2_FIELD_NONE for
173progressive devices), msize is the size of any containing structure used
174around struct videobuf_buffer, and priv is a private data pointer which
175shows up in the priv_data field of struct videobuf_queue. Note that these
176are void functions which, evidently, are immune to failure.
177
178V4L2 capture drivers can be written to support either of two APIs: the
179read() system call and the rather more complicated streaming mechanism. As
180a general rule, it is necessary to support both to ensure that all
181applications have a chance of working with the device. Videobuf makes it
182easy to do that with the same code. To implement read(), the driver need
183only make a call to one of:
184
185 ssize_t videobuf_read_one(struct videobuf_queue *q,
186 char __user *data, size_t count,
187 loff_t *ppos, int nonblocking);
188
189 ssize_t videobuf_read_stream(struct videobuf_queue *q,
190 char __user *data, size_t count,
191 loff_t *ppos, int vbihack, int nonblocking);
192
193Either one of these functions will read frame data into data, returning the
194amount actually read; the difference is that videobuf_read_one() will only
195read a single frame, while videobuf_read_stream() will read multiple frames
196if they are needed to satisfy the count requested by the application. A
197typical driver read() implementation will start the capture engine, call
198one of the above functions, then stop the engine before returning (though a
199smarter implementation might leave the engine running for a little while in
200anticipation of another read() call happening in the near future).
201
202The poll() function can usually be implemented with a direct call to:
203
204 unsigned int videobuf_poll_stream(struct file *file,
205 struct videobuf_queue *q,
206 poll_table *wait);
207
208Note that the actual wait queue eventually used will be the one associated
209with the first available buffer.
210
211When streaming I/O is done to kernel-space buffers, the driver must support
212the mmap() system call to enable user space to access the data. In many
213V4L2 drivers, the often-complex mmap() implementation simplifies to a
214single call to:
215
216 int videobuf_mmap_mapper(struct videobuf_queue *q,
217 struct vm_area_struct *vma);
218
219Everything else is handled by the videobuf code.
220
221The release() function requires two separate videobuf calls:
222
223 void videobuf_stop(struct videobuf_queue *q);
224 int videobuf_mmap_free(struct videobuf_queue *q);
225
226The call to videobuf_stop() terminates any I/O in progress - though it is
227still up to the driver to stop the capture engine. The call to
228videobuf_mmap_free() will ensure that all buffers have been unmapped; if
229so, they will all be passed to the buf_release() callback. If buffers
230remain mapped, videobuf_mmap_free() returns an error code instead. The
231purpose is clearly to cause the closing of the file descriptor to fail if
232buffers are still mapped, but every driver in the 2.6.32 kernel cheerfully
233ignores its return value.
234
235ioctl() operations
236
237The V4L2 API includes a very long list of driver callbacks to respond to
238the many ioctl() commands made available to user space. A number of these
239- those associated with streaming I/O - turn almost directly into videobuf
240calls. The relevant helper functions are:
241
242 int videobuf_reqbufs(struct videobuf_queue *q,
243 struct v4l2_requestbuffers *req);
244 int videobuf_querybuf(struct videobuf_queue *q, struct v4l2_buffer *b);
245 int videobuf_qbuf(struct videobuf_queue *q, struct v4l2_buffer *b);
246 int videobuf_dqbuf(struct videobuf_queue *q, struct v4l2_buffer *b,
247 int nonblocking);
248 int videobuf_streamon(struct videobuf_queue *q);
249 int videobuf_streamoff(struct videobuf_queue *q);
250 int videobuf_cgmbuf(struct videobuf_queue *q, struct video_mbuf *mbuf,
251 int count);
252
253So, for example, a VIDIOC_REQBUFS call turns into a call to the driver's
254vidioc_reqbufs() callback which, in turn, usually only needs to locate the
255proper struct videobuf_queue pointer and pass it to videobuf_reqbufs().
256These support functions can replace a great deal of buffer management
257boilerplate in a lot of V4L2 drivers.
258
259The vidioc_streamon() and vidioc_streamoff() functions will be a bit more
260complex, of course, since they will also need to deal with starting and
261stopping the capture engine. videobuf_cgmbuf(), called from the driver's
262vidiocgmbuf() function, only exists if the V4L1 compatibility module has
263been selected with CONFIG_VIDEO_V4L1_COMPAT, so its use must be surrounded
264with #ifdef directives.
265
266Buffer allocation
267
268Thus far, we have talked about buffers, but have not looked at how they are
269allocated. The scatter/gather case is the most complex on this front. For
270allocation, the driver can leave buffer allocation entirely up to the
271videobuf layer; in this case, buffers will be allocated as anonymous
272user-space pages and will be very scattered indeed. If the application is
273using user-space buffers, no allocation is needed; the videobuf layer will
274take care of calling get_user_pages() and filling in the scatterlist array.
275
276If the driver needs to do its own memory allocation, it should be done in
277the vidioc_reqbufs() function, *after* calling videobuf_reqbufs(). The
278first step is a call to:
279
280 struct videobuf_dmabuf *videobuf_to_dma(struct videobuf_buffer *buf);
281
282The returned videobuf_dmabuf structure (defined in
283<media/videobuf-dma-sg.h>) includes a couple of relevant fields:
284
285 struct scatterlist *sglist;
286 int sglen;
287
288The driver must allocate an appropriately-sized scatterlist array and
289populate it with pointers to the pieces of the allocated buffer; sglen
290should be set to the length of the array.
291
292Drivers using the vmalloc() method need not (and cannot) concern themselves
293with buffer allocation at all; videobuf will handle those details. The
294same is normally true of contiguous-DMA drivers as well; videobuf will
295allocate the buffers (with dma_alloc_coherent()) when it sees fit. That
296means that these drivers may be trying to do high-order allocations at any
297time, an operation which is not always guaranteed to work. Some drivers
298play tricks by allocating DMA space at system boot time; videobuf does not
299currently play well with those drivers.
300
301As of 2.6.31, contiguous-DMA drivers can work with a user-supplied buffer,
302as long as that buffer is physically contiguous. Normal user-space
303allocations will not meet that criterion, but buffers obtained from other
304kernel drivers, or those contained within huge pages, will work with these
305drivers.
306
307Filling the buffers
308
309The final part of a videobuf implementation has no direct callback - it's
310the portion of the code which actually puts frame data into the buffers,
311usually in response to interrupts from the device. For all types of
312drivers, this process works approximately as follows:
313
314 - Obtain the next available buffer and make sure that somebody is actually
315 waiting for it.
316
317 - Get a pointer to the memory and put video data there.
318
319 - Mark the buffer as done and wake up the process waiting for it.
320
321Step (1) above is done by looking at the driver-managed list_head structure
322- the one which is filled in the buf_queue() callback. Because starting
323the engine and enqueueing buffers are done in separate steps, it's possible
324for the engine to be running without any buffers available - in the
325vmalloc() case especially. So the driver should be prepared for the list
326to be empty. It is equally possible that nobody is yet interested in the
327buffer; the driver should not remove it from the list or fill it until a
328process is waiting on it. That test can be done by examining the buffer's
329done field (a wait_queue_head_t structure) with waitqueue_active().
330
331A buffer's state should be set to VIDEOBUF_ACTIVE before being mapped for
332DMA; that ensures that the videobuf layer will not try to do anything with
333it while the device is transferring data.
334
335For scatter/gather drivers, the needed memory pointers will be found in the
336scatterlist structure described above. Drivers using the vmalloc() method
337can get a memory pointer with:
338
339 void *videobuf_to_vmalloc(struct videobuf_buffer *buf);
340
341For contiguous DMA drivers, the function to use is:
342
343 dma_addr_t videobuf_to_dma_contig(struct videobuf_buffer *buf);
344
345The contiguous DMA API goes out of its way to hide the kernel-space address
346of the DMA buffer from drivers.
347
348The final step is to set the size field of the relevant videobuf_buffer
349structure to the actual size of the captured image, set state to
350VIDEOBUF_DONE, then call wake_up() on the done queue. At this point, the
351buffer is owned by the videobuf layer and the driver should not touch it
352again.
353
354Developers who are interested in more information can go into the relevant
355header files; there are a few low-level functions declared there which have
356not been talked about here. Also worthwhile is the vivi driver
357(drivers/media/video/vivi.c), which is maintained as an example of how V4L2
358drivers should be written. Vivi only uses the vmalloc() API, but it's good
359enough to get started with. Note also that all of these calls are exported
360GPL-only, so they will not be available to non-GPL kernel modules.
diff --git a/Documentation/video4linux/zr364xx.txt b/Documentation/video4linux/zr364xx.txt
index 7f3d1955d214..d98e4d302977 100644
--- a/Documentation/video4linux/zr364xx.txt
+++ b/Documentation/video4linux/zr364xx.txt
@@ -66,3 +66,4 @@ Vendor Product Distributor Model
660x0a17 0x004e Pentax Optio 50 660x0a17 0x004e Pentax Optio 50
670x041e 0x405d Creative DiVi CAM 516 670x041e 0x405d Creative DiVi CAM 516
680x08ca 0x2102 Aiptek DV T300 680x08ca 0x2102 Aiptek DV T300
690x06d6 0x003d Trust Powerc@m 910Z