diff options
Diffstat (limited to 'Documentation/video4linux')
-rw-r--r-- | Documentation/video4linux/CARDLIST.bttv | 2 | ||||
-rw-r--r-- | Documentation/video4linux/CARDLIST.cx23885 | 1 | ||||
-rw-r--r-- | Documentation/video4linux/CARDLIST.cx88 | 1 | ||||
-rw-r--r-- | Documentation/video4linux/CARDLIST.em28xx | 4 | ||||
-rw-r--r-- | Documentation/video4linux/CARDLIST.saa7134 | 5 | ||||
-rw-r--r-- | Documentation/video4linux/CARDLIST.tuner | 2 | ||||
-rw-r--r-- | Documentation/video4linux/README.tlg2300 | 47 | ||||
-rw-r--r-- | Documentation/video4linux/extract_xc3028.pl | 817 | ||||
-rw-r--r-- | Documentation/video4linux/gspca.txt | 31 | ||||
-rw-r--r-- | Documentation/video4linux/sh_mobile_ceu_camera.txt | 80 | ||||
-rw-r--r-- | Documentation/video4linux/v4l2-framework.txt | 249 | ||||
-rw-r--r-- | Documentation/video4linux/videobuf | 360 |
12 files changed, 1426 insertions, 173 deletions
diff --git a/Documentation/video4linux/CARDLIST.bttv b/Documentation/video4linux/CARDLIST.bttv index f11c583295e9..4739d5684305 100644 --- a/Documentation/video4linux/CARDLIST.bttv +++ b/Documentation/video4linux/CARDLIST.bttv | |||
@@ -100,7 +100,7 @@ | |||
100 | 99 -> AD-TVK503 | 100 | 99 -> AD-TVK503 |
101 | 100 -> Hercules Smart TV Stereo | 101 | 100 -> Hercules Smart TV Stereo |
102 | 101 -> Pace TV & Radio Card | 102 | 101 -> Pace TV & Radio Card |
103 | 102 -> IVC-200 [0000:a155,0001:a155,0002:a155,0003:a155,0100:a155,0101:a155,0102:a155,0103:a155] | 103 | 102 -> IVC-200 [0000:a155,0001:a155,0002:a155,0003:a155,0100:a155,0101:a155,0102:a155,0103:a155,0800:a155,0801:a155,0802:a155,0803:a155] |
104 | 103 -> Grand X-Guard / Trust 814PCI [0304:0102] | 104 | 103 -> Grand X-Guard / Trust 814PCI [0304:0102] |
105 | 104 -> Nebula Electronics DigiTV [0071:0101] | 105 | 104 -> Nebula Electronics DigiTV [0071:0101] |
106 | 105 -> ProVideo PV143 [aa00:1430,aa00:1431,aa00:1432,aa00:1433,aa03:1433] | 106 | 105 -> ProVideo PV143 [aa00:1430,aa00:1431,aa00:1432,aa00:1433,aa03:1433] |
diff --git a/Documentation/video4linux/CARDLIST.cx23885 b/Documentation/video4linux/CARDLIST.cx23885 index 7539e8fa1ffd..16ca030e1185 100644 --- a/Documentation/video4linux/CARDLIST.cx23885 +++ b/Documentation/video4linux/CARDLIST.cx23885 | |||
@@ -26,3 +26,4 @@ | |||
26 | 25 -> Compro VideoMate E800 [1858:e800] | 26 | 25 -> Compro VideoMate E800 [1858:e800] |
27 | 26 -> Hauppauge WinTV-HVR1290 [0070:8551] | 27 | 26 -> Hauppauge WinTV-HVR1290 [0070:8551] |
28 | 27 -> Mygica X8558 PRO DMB-TH [14f1:8578] | 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 7ec3c4e4b60f..f2510541373b 100644 --- a/Documentation/video4linux/CARDLIST.cx88 +++ b/Documentation/video4linux/CARDLIST.cx88 | |||
@@ -82,3 +82,4 @@ | |||
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] | 84 | 83 -> Prof 7301 DVB-S/S2 [b034:3034] |
85 | 84 -> Samsung SMT 7020 DVB-S [18ac:dc00,18ac:dccd] | ||
diff --git a/Documentation/video4linux/CARDLIST.em28xx b/Documentation/video4linux/CARDLIST.em28xx index 0c166ff003a0..3a623aaeae5f 100644 --- a/Documentation/video4linux/CARDLIST.em28xx +++ b/Documentation/video4linux/CARDLIST.em28xx | |||
@@ -1,5 +1,5 @@ | |||
1 | 0 -> Unknown EM2800 video grabber (em2800) [eb1a:2800] | 1 | 0 -> Unknown EM2800 video grabber (em2800) [eb1a:2800] |
2 | 1 -> Unknown EM2750/28xx video grabber (em2820/em2840) [eb1a:2710,eb1a:2820,eb1a:2821,eb1a:2860,eb1a:2861,eb1a:2862,eb1a:2870,eb1a:2881,eb1a:2883,eb1a:2868] | 2 | 1 -> Unknown EM2750/28xx video grabber (em2820/em2840) [eb1a:2710,eb1a:2820,eb1a:2821,eb1a:2860,eb1a:2861,eb1a:2862,eb1a:2863,eb1a:2870,eb1a:2881,eb1a:2883,eb1a:2868] |
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] |
@@ -27,6 +27,7 @@ | |||
27 | 26 -> Hercules Smart TV USB 2.0 (em2820/em2840) | 27 | 26 -> Hercules Smart TV USB 2.0 (em2820/em2840) |
28 | 27 -> Pinnacle PCTV USB 2 (Philips FM1216ME) (em2820/em2840) | 28 | 27 -> Pinnacle PCTV USB 2 (Philips FM1216ME) (em2820/em2840) |
29 | 28 -> Leadtek Winfast USB II Deluxe (em2820/em2840) | 29 | 28 -> Leadtek Winfast USB II Deluxe (em2820/em2840) |
30 | 29 -> EM2860/TVP5150 Reference Design (em2860) | ||
30 | 30 -> Videology 20K14XUSB USB2.0 (em2820/em2840) | 31 | 30 -> Videology 20K14XUSB USB2.0 (em2820/em2840) |
31 | 31 -> Usbgear VD204v9 (em2821) | 32 | 31 -> Usbgear VD204v9 (em2821) |
32 | 32 -> Supercomp USB 2.0 TV (em2821) | 33 | 32 -> Supercomp USB 2.0 TV (em2821) |
@@ -70,3 +71,4 @@ | |||
70 | 72 -> Gadmei UTV330+ (em2861) | 71 | 72 -> Gadmei UTV330+ (em2861) |
71 | 73 -> Reddo DVB-C USB TV Box (em2870) | 72 | 73 -> Reddo DVB-C USB TV Box (em2870) |
72 | 74 -> Actionmaster/LinXcel/Digitus VC211A (em2800) | 73 | 74 -> Actionmaster/LinXcel/Digitus VC211A (em2800) |
74 | 75 -> Dikom DK300 (em2882) | ||
diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134 index fce1e7eb0474..1387a69ae3aa 100644 --- a/Documentation/video4linux/CARDLIST.saa7134 +++ b/Documentation/video4linux/CARDLIST.saa7134 | |||
@@ -174,3 +174,8 @@ | |||
174 | 173 -> Zolid Hybrid TV Tuner PCI [1131:2004] | 174 | 173 -> Zolid Hybrid TV Tuner PCI [1131:2004] |
175 | 174 -> Asus Europa Hybrid OEM [1043:4847] | 175 | 174 -> Asus Europa Hybrid OEM [1043:4847] |
176 | 175 -> Leadtek Winfast DTV1000S [107d:6655] | 176 | 175 -> Leadtek Winfast DTV1000S [107d:6655] |
177 | 176 -> Beholder BeholdTV 505 RDS [0000:5051] | ||
178 | 177 -> Hawell HW-404M7 | ||
179 | 178 -> Beholder BeholdTV H7 [5ace:7190] | ||
180 | 179 -> Beholder BeholdTV A7 [5ace:7090] | ||
181 | 180 -> Avermedia M733A [1461:4155,1461:4255] | ||
diff --git a/Documentation/video4linux/CARDLIST.tuner b/Documentation/video4linux/CARDLIST.tuner index e0d298fe8830..e67c1db96854 100644 --- a/Documentation/video4linux/CARDLIST.tuner +++ b/Documentation/video4linux/CARDLIST.tuner | |||
@@ -81,3 +81,5 @@ tuner=80 - Philips FQ1216LME MK3 PAL/SECAM w/active loopthrough | |||
81 | tuner=81 - Partsnic (Daewoo) PTI-5NF05 | 81 | tuner=81 - Partsnic (Daewoo) PTI-5NF05 |
82 | tuner=82 - Philips CU1216L | 82 | tuner=82 - Philips CU1216L |
83 | tuner=83 - NXP TDA18271 | 83 | tuner=83 - NXP TDA18271 |
84 | tuner=84 - Sony BTF-Pxn01Z | ||
85 | tuner=85 - Philips FQ1236 MK5 | ||
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 @@ | |||
1 | tlg2300 release notes | ||
2 | ==================== | ||
3 | |||
4 | This is a v4l2/dvb device driver for the tlg2300 chip. | ||
5 | |||
6 | |||
7 | current status | ||
8 | ============== | ||
9 | |||
10 | video | ||
11 | - support mmap and read().(no overlay) | ||
12 | |||
13 | audio | ||
14 | - The driver will register a ALSA card for the audio input. | ||
15 | |||
16 | vbi | ||
17 | - Works for almost TV norms. | ||
18 | |||
19 | dvb-t | ||
20 | - works for DVB-T | ||
21 | |||
22 | FM | ||
23 | - Works for radio. | ||
24 | |||
25 | --------------------------------------------------------------------------- | ||
26 | TESTED 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 | --------------------------------------------------------------------------- | ||
39 | KNOWN PROBLEMS: | ||
40 | about 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/extract_xc3028.pl b/Documentation/video4linux/extract_xc3028.pl index 2cb816047fc1..47877deae6d7 100644 --- a/Documentation/video4linux/extract_xc3028.pl +++ b/Documentation/video4linux/extract_xc3028.pl | |||
@@ -5,12 +5,18 @@ | |||
5 | # | 5 | # |
6 | # In order to use, you need to: | 6 | # In order to use, you need to: |
7 | # 1) Download the windows driver with something like: | 7 | # 1) Download the windows driver with something like: |
8 | # Version 2.4 | ||
9 | # wget http://www.twinhan.com/files/AW/BDA T/20080303_V1.0.6.7.zip | ||
10 | # or wget http://www.stefanringel.de/pub/20080303_V1.0.6.7.zip | ||
11 | # Version 2.7 | ||
8 | # wget http://www.steventoth.net/linux/xc5000/HVR-12x0-14x0-17x0_1_25_25271_WHQL.zip | 12 | # wget http://www.steventoth.net/linux/xc5000/HVR-12x0-14x0-17x0_1_25_25271_WHQL.zip |
9 | # 2) Extract the file hcw85bda.sys from the zip into the current dir: | 13 | # 2) Extract the files from the zip into the current dir: |
14 | # unzip -j 20080303_V1.0.6.7.zip 20080303_v1.0.6.7/UDXTTM6000.sys | ||
10 | # unzip -j HVR-12x0-14x0-17x0_1_25_25271_WHQL.zip Driver85/hcw85bda.sys | 15 | # unzip -j HVR-12x0-14x0-17x0_1_25_25271_WHQL.zip Driver85/hcw85bda.sys |
11 | # 3) run the script: | 16 | # 3) run the script: |
12 | # ./extract_xc3028.pl | 17 | # ./extract_xc3028.pl |
13 | # 4) copy the generated file: | 18 | # 4) copy the generated files: |
19 | # cp xc3028-v24.fw /lib/firmware | ||
14 | # cp xc3028-v27.fw /lib/firmware | 20 | # cp xc3028-v27.fw /lib/firmware |
15 | 21 | ||
16 | #use strict; | 22 | #use strict; |
@@ -135,7 +141,7 @@ sub write_hunk_fix_endian($$) | |||
135 | } | 141 | } |
136 | } | 142 | } |
137 | 143 | ||
138 | sub main_firmware($$$$) | 144 | sub main_firmware_24($$$$) |
139 | { | 145 | { |
140 | my $out; | 146 | my $out; |
141 | my $j=0; | 147 | my $j=0; |
@@ -146,8 +152,774 @@ sub main_firmware($$$$) | |||
146 | 152 | ||
147 | for ($j = length($name); $j <32; $j++) { | 153 | for ($j = length($name); $j <32; $j++) { |
148 | $name = $name.chr(0); | 154 | $name = $name.chr(0); |
155 | } | ||
156 | |||
157 | open OUTFILE, ">$outfile"; | ||
158 | syswrite(OUTFILE, $name); | ||
159 | write_le16($version); | ||
160 | write_le16($nr_desc); | ||
161 | |||
162 | # | ||
163 | # Firmware 0, type: BASE FW F8MHZ (0x00000003), id: (0000000000000000), size: 6635 | ||
164 | # | ||
165 | |||
166 | write_le32(0x00000003); # Type | ||
167 | write_le64(0x00000000, 0x00000000); # ID | ||
168 | write_le32(6635); # Size | ||
169 | write_hunk_fix_endian(257752, 6635); | ||
170 | |||
171 | # | ||
172 | # Firmware 1, type: BASE FW F8MHZ MTS (0x00000007), id: (0000000000000000), size: 6635 | ||
173 | # | ||
174 | |||
175 | write_le32(0x00000007); # Type | ||
176 | write_le64(0x00000000, 0x00000000); # ID | ||
177 | write_le32(6635); # Size | ||
178 | write_hunk_fix_endian(264392, 6635); | ||
179 | |||
180 | # | ||
181 | # Firmware 2, type: BASE FW FM (0x00000401), id: (0000000000000000), size: 6525 | ||
182 | # | ||
183 | |||
184 | write_le32(0x00000401); # Type | ||
185 | write_le64(0x00000000, 0x00000000); # ID | ||
186 | write_le32(6525); # Size | ||
187 | write_hunk_fix_endian(271040, 6525); | ||
188 | |||
189 | # | ||
190 | # Firmware 3, type: BASE FW FM INPUT1 (0x00000c01), id: (0000000000000000), size: 6539 | ||
191 | # | ||
192 | |||
193 | write_le32(0x00000c01); # Type | ||
194 | write_le64(0x00000000, 0x00000000); # ID | ||
195 | write_le32(6539); # Size | ||
196 | write_hunk_fix_endian(277568, 6539); | ||
197 | |||
198 | # | ||
199 | # Firmware 4, type: BASE FW (0x00000001), id: (0000000000000000), size: 6633 | ||
200 | # | ||
201 | |||
202 | write_le32(0x00000001); # Type | ||
203 | write_le64(0x00000000, 0x00000000); # ID | ||
204 | write_le32(6633); # Size | ||
205 | write_hunk_fix_endian(284120, 6633); | ||
206 | |||
207 | # | ||
208 | # Firmware 5, type: BASE FW MTS (0x00000005), id: (0000000000000000), size: 6617 | ||
209 | # | ||
210 | |||
211 | write_le32(0x00000005); # Type | ||
212 | write_le64(0x00000000, 0x00000000); # ID | ||
213 | write_le32(6617); # Size | ||
214 | write_hunk_fix_endian(290760, 6617); | ||
215 | |||
216 | # | ||
217 | # Firmware 6, type: STD FW (0x00000000), id: PAL/BG A2/A (0000000100000007), size: 161 | ||
218 | # | ||
219 | |||
220 | write_le32(0x00000000); # Type | ||
221 | write_le64(0x00000001, 0x00000007); # ID | ||
222 | write_le32(161); # Size | ||
223 | write_hunk_fix_endian(297384, 161); | ||
224 | |||
225 | # | ||
226 | # Firmware 7, type: STD FW MTS (0x00000004), id: PAL/BG A2/A (0000000100000007), size: 169 | ||
227 | # | ||
228 | |||
229 | write_le32(0x00000004); # Type | ||
230 | write_le64(0x00000001, 0x00000007); # ID | ||
231 | write_le32(169); # Size | ||
232 | write_hunk_fix_endian(297552, 169); | ||
233 | |||
234 | # | ||
235 | # Firmware 8, type: STD FW (0x00000000), id: PAL/BG A2/B (0000000200000007), size: 161 | ||
236 | # | ||
237 | |||
238 | write_le32(0x00000000); # Type | ||
239 | write_le64(0x00000002, 0x00000007); # ID | ||
240 | write_le32(161); # Size | ||
241 | write_hunk_fix_endian(297728, 161); | ||
242 | |||
243 | # | ||
244 | # Firmware 9, type: STD FW MTS (0x00000004), id: PAL/BG A2/B (0000000200000007), size: 169 | ||
245 | # | ||
246 | |||
247 | write_le32(0x00000004); # Type | ||
248 | write_le64(0x00000002, 0x00000007); # ID | ||
249 | write_le32(169); # Size | ||
250 | write_hunk_fix_endian(297896, 169); | ||
251 | |||
252 | # | ||
253 | # Firmware 10, type: STD FW (0x00000000), id: PAL/BG NICAM/A (0000000400000007), size: 161 | ||
254 | # | ||
255 | |||
256 | write_le32(0x00000000); # Type | ||
257 | write_le64(0x00000004, 0x00000007); # ID | ||
258 | write_le32(161); # Size | ||
259 | write_hunk_fix_endian(298072, 161); | ||
260 | |||
261 | # | ||
262 | # Firmware 11, type: STD FW MTS (0x00000004), id: PAL/BG NICAM/A (0000000400000007), size: 169 | ||
263 | # | ||
264 | |||
265 | write_le32(0x00000004); # Type | ||
266 | write_le64(0x00000004, 0x00000007); # ID | ||
267 | write_le32(169); # Size | ||
268 | write_hunk_fix_endian(298240, 169); | ||
269 | |||
270 | # | ||
271 | # Firmware 12, type: STD FW (0x00000000), id: PAL/BG NICAM/B (0000000800000007), size: 161 | ||
272 | # | ||
273 | |||
274 | write_le32(0x00000000); # Type | ||
275 | write_le64(0x00000008, 0x00000007); # ID | ||
276 | write_le32(161); # Size | ||
277 | write_hunk_fix_endian(298416, 161); | ||
278 | |||
279 | # | ||
280 | # Firmware 13, type: STD FW MTS (0x00000004), id: PAL/BG NICAM/B (0000000800000007), size: 169 | ||
281 | # | ||
282 | |||
283 | write_le32(0x00000004); # Type | ||
284 | write_le64(0x00000008, 0x00000007); # ID | ||
285 | write_le32(169); # Size | ||
286 | write_hunk_fix_endian(298584, 169); | ||
287 | |||
288 | # | ||
289 | # Firmware 14, type: STD FW (0x00000000), id: PAL/DK A2 (00000003000000e0), size: 161 | ||
290 | # | ||
291 | |||
292 | write_le32(0x00000000); # Type | ||
293 | write_le64(0x00000003, 0x000000e0); # ID | ||
294 | write_le32(161); # Size | ||
295 | write_hunk_fix_endian(298760, 161); | ||
296 | |||
297 | # | ||
298 | # Firmware 15, type: STD FW MTS (0x00000004), id: PAL/DK A2 (00000003000000e0), size: 169 | ||
299 | # | ||
300 | |||
301 | write_le32(0x00000004); # Type | ||
302 | write_le64(0x00000003, 0x000000e0); # ID | ||
303 | write_le32(169); # Size | ||
304 | write_hunk_fix_endian(298928, 169); | ||
305 | |||
306 | # | ||
307 | # Firmware 16, type: STD FW (0x00000000), id: PAL/DK NICAM (0000000c000000e0), size: 161 | ||
308 | # | ||
309 | |||
310 | write_le32(0x00000000); # Type | ||
311 | write_le64(0x0000000c, 0x000000e0); # ID | ||
312 | write_le32(161); # Size | ||
313 | write_hunk_fix_endian(299104, 161); | ||
314 | |||
315 | # | ||
316 | # Firmware 17, type: STD FW MTS (0x00000004), id: PAL/DK NICAM (0000000c000000e0), size: 169 | ||
317 | # | ||
318 | |||
319 | write_le32(0x00000004); # Type | ||
320 | write_le64(0x0000000c, 0x000000e0); # ID | ||
321 | write_le32(169); # Size | ||
322 | write_hunk_fix_endian(299272, 169); | ||
323 | |||
324 | # | ||
325 | # Firmware 18, type: STD FW (0x00000000), id: SECAM/K1 (0000000000200000), size: 161 | ||
326 | # | ||
327 | |||
328 | write_le32(0x00000000); # Type | ||
329 | write_le64(0x00000000, 0x00200000); # ID | ||
330 | write_le32(161); # Size | ||
331 | write_hunk_fix_endian(299448, 161); | ||
332 | |||
333 | # | ||
334 | # Firmware 19, type: STD FW MTS (0x00000004), id: SECAM/K1 (0000000000200000), size: 169 | ||
335 | # | ||
336 | |||
337 | write_le32(0x00000004); # Type | ||
338 | write_le64(0x00000000, 0x00200000); # ID | ||
339 | write_le32(169); # Size | ||
340 | write_hunk_fix_endian(299616, 169); | ||
341 | |||
342 | # | ||
343 | # Firmware 20, type: STD FW (0x00000000), id: SECAM/K3 (0000000004000000), size: 161 | ||
344 | # | ||
345 | |||
346 | write_le32(0x00000000); # Type | ||
347 | write_le64(0x00000000, 0x04000000); # ID | ||
348 | write_le32(161); # Size | ||
349 | write_hunk_fix_endian(299792, 161); | ||
350 | |||
351 | # | ||
352 | # Firmware 21, type: STD FW MTS (0x00000004), id: SECAM/K3 (0000000004000000), size: 169 | ||
353 | # | ||
354 | |||
355 | write_le32(0x00000004); # Type | ||
356 | write_le64(0x00000000, 0x04000000); # ID | ||
357 | write_le32(169); # Size | ||
358 | write_hunk_fix_endian(299960, 169); | ||
359 | |||
360 | # | ||
361 | # Firmware 22, type: STD FW D2633 DTV6 ATSC (0x00010030), id: (0000000000000000), size: 149 | ||
362 | # | ||
363 | |||
364 | write_le32(0x00010030); # Type | ||
365 | write_le64(0x00000000, 0x00000000); # ID | ||
366 | write_le32(149); # Size | ||
367 | write_hunk_fix_endian(300136, 149); | ||
368 | |||
369 | # | ||
370 | # Firmware 23, type: STD FW D2620 DTV6 QAM (0x00000068), id: (0000000000000000), size: 149 | ||
371 | # | ||
372 | |||
373 | write_le32(0x00000068); # Type | ||
374 | write_le64(0x00000000, 0x00000000); # ID | ||
375 | write_le32(149); # Size | ||
376 | write_hunk_fix_endian(300296, 149); | ||
377 | |||
378 | # | ||
379 | # Firmware 24, type: STD FW D2633 DTV6 QAM (0x00000070), id: (0000000000000000), size: 149 | ||
380 | # | ||
381 | |||
382 | write_le32(0x00000070); # Type | ||
383 | write_le64(0x00000000, 0x00000000); # ID | ||
384 | write_le32(149); # Size | ||
385 | write_hunk_fix_endian(300448, 149); | ||
386 | |||
387 | # | ||
388 | # Firmware 25, type: STD FW D2620 DTV7 (0x00000088), id: (0000000000000000), size: 149 | ||
389 | # | ||
390 | |||
391 | write_le32(0x00000088); # Type | ||
392 | write_le64(0x00000000, 0x00000000); # ID | ||
393 | write_le32(149); # Size | ||
394 | write_hunk_fix_endian(300608, 149); | ||
395 | |||
396 | # | ||
397 | # Firmware 26, type: STD FW D2633 DTV7 (0x00000090), id: (0000000000000000), size: 149 | ||
398 | # | ||
399 | |||
400 | write_le32(0x00000090); # Type | ||
401 | write_le64(0x00000000, 0x00000000); # ID | ||
402 | write_le32(149); # Size | ||
403 | write_hunk_fix_endian(300760, 149); | ||
404 | |||
405 | # | ||
406 | # Firmware 27, type: STD FW D2620 DTV78 (0x00000108), id: (0000000000000000), size: 149 | ||
407 | # | ||
408 | |||
409 | write_le32(0x00000108); # Type | ||
410 | write_le64(0x00000000, 0x00000000); # ID | ||
411 | write_le32(149); # Size | ||
412 | write_hunk_fix_endian(300920, 149); | ||
413 | |||
414 | # | ||
415 | # Firmware 28, type: STD FW D2633 DTV78 (0x00000110), id: (0000000000000000), size: 149 | ||
416 | # | ||
417 | |||
418 | write_le32(0x00000110); # Type | ||
419 | write_le64(0x00000000, 0x00000000); # ID | ||
420 | write_le32(149); # Size | ||
421 | write_hunk_fix_endian(301072, 149); | ||
422 | |||
423 | # | ||
424 | # Firmware 29, type: STD FW D2620 DTV8 (0x00000208), id: (0000000000000000), size: 149 | ||
425 | # | ||
426 | |||
427 | write_le32(0x00000208); # Type | ||
428 | write_le64(0x00000000, 0x00000000); # ID | ||
429 | write_le32(149); # Size | ||
430 | write_hunk_fix_endian(301232, 149); | ||
431 | |||
432 | # | ||
433 | # Firmware 30, type: STD FW D2633 DTV8 (0x00000210), id: (0000000000000000), size: 149 | ||
434 | # | ||
435 | |||
436 | write_le32(0x00000210); # Type | ||
437 | write_le64(0x00000000, 0x00000000); # ID | ||
438 | write_le32(149); # Size | ||
439 | write_hunk_fix_endian(301384, 149); | ||
440 | |||
441 | # | ||
442 | # Firmware 31, type: STD FW FM (0x00000400), id: (0000000000000000), size: 135 | ||
443 | # | ||
444 | |||
445 | write_le32(0x00000400); # Type | ||
446 | write_le64(0x00000000, 0x00000000); # ID | ||
447 | write_le32(135); # Size | ||
448 | write_hunk_fix_endian(301554, 135); | ||
449 | |||
450 | # | ||
451 | # Firmware 32, type: STD FW (0x00000000), id: PAL/I (0000000000000010), size: 161 | ||
452 | # | ||
453 | |||
454 | write_le32(0x00000000); # Type | ||
455 | write_le64(0x00000000, 0x00000010); # ID | ||
456 | write_le32(161); # Size | ||
457 | write_hunk_fix_endian(301688, 161); | ||
458 | |||
459 | # | ||
460 | # Firmware 33, type: STD FW MTS (0x00000004), id: PAL/I (0000000000000010), size: 169 | ||
461 | # | ||
462 | |||
463 | write_le32(0x00000004); # Type | ||
464 | write_le64(0x00000000, 0x00000010); # ID | ||
465 | write_le32(169); # Size | ||
466 | write_hunk_fix_endian(301856, 169); | ||
467 | |||
468 | # | ||
469 | # Firmware 34, type: STD FW (0x00000000), id: SECAM/L AM (0000001000400000), size: 169 | ||
470 | # | ||
471 | |||
472 | # | ||
473 | # Firmware 35, type: STD FW (0x00000000), id: SECAM/L NICAM (0000000c00400000), size: 161 | ||
474 | # | ||
475 | |||
476 | write_le32(0x00000000); # Type | ||
477 | write_le64(0x0000000c, 0x00400000); # ID | ||
478 | write_le32(161); # Size | ||
479 | write_hunk_fix_endian(302032, 161); | ||
480 | |||
481 | # | ||
482 | # Firmware 36, type: STD FW (0x00000000), id: SECAM/Lc (0000000000800000), size: 161 | ||
483 | # | ||
484 | |||
485 | write_le32(0x00000000); # Type | ||
486 | write_le64(0x00000000, 0x00800000); # ID | ||
487 | write_le32(161); # Size | ||
488 | write_hunk_fix_endian(302200, 161); | ||
489 | |||
490 | # | ||
491 | # Firmware 37, type: STD FW (0x00000000), id: NTSC/M Kr (0000000000008000), size: 161 | ||
492 | # | ||
493 | |||
494 | write_le32(0x00000000); # Type | ||
495 | write_le64(0x00000000, 0x00008000); # ID | ||
496 | write_le32(161); # Size | ||
497 | write_hunk_fix_endian(302368, 161); | ||
498 | |||
499 | # | ||
500 | # Firmware 38, type: STD FW LCD (0x00001000), id: NTSC/M Kr (0000000000008000), size: 161 | ||
501 | # | ||
502 | |||
503 | write_le32(0x00001000); # Type | ||
504 | write_le64(0x00000000, 0x00008000); # ID | ||
505 | write_le32(161); # Size | ||
506 | write_hunk_fix_endian(302536, 161); | ||
507 | |||
508 | # | ||
509 | # Firmware 39, type: STD FW LCD NOGD (0x00003000), id: NTSC/M Kr (0000000000008000), size: 161 | ||
510 | # | ||
511 | |||
512 | write_le32(0x00003000); # Type | ||
513 | write_le64(0x00000000, 0x00008000); # ID | ||
514 | write_le32(161); # Size | ||
515 | write_hunk_fix_endian(302704, 161); | ||
516 | |||
517 | # | ||
518 | # Firmware 40, type: STD FW MTS (0x00000004), id: NTSC/M Kr (0000000000008000), size: 169 | ||
519 | # | ||
520 | |||
521 | write_le32(0x00000004); # Type | ||
522 | write_le64(0x00000000, 0x00008000); # ID | ||
523 | write_le32(169); # Size | ||
524 | write_hunk_fix_endian(302872, 169); | ||
525 | |||
526 | # | ||
527 | # Firmware 41, type: STD FW (0x00000000), id: NTSC PAL/M PAL/N (000000000000b700), size: 161 | ||
528 | # | ||
529 | |||
530 | write_le32(0x00000000); # Type | ||
531 | write_le64(0x00000000, 0x0000b700); # ID | ||
532 | write_le32(161); # Size | ||
533 | write_hunk_fix_endian(303048, 161); | ||
534 | |||
535 | # | ||
536 | # Firmware 42, type: STD FW LCD (0x00001000), id: NTSC PAL/M PAL/N (000000000000b700), size: 161 | ||
537 | # | ||
538 | |||
539 | write_le32(0x00001000); # Type | ||
540 | write_le64(0x00000000, 0x0000b700); # ID | ||
541 | write_le32(161); # Size | ||
542 | write_hunk_fix_endian(303216, 161); | ||
543 | |||
544 | # | ||
545 | # Firmware 43, type: STD FW LCD NOGD (0x00003000), id: NTSC PAL/M PAL/N (000000000000b700), size: 161 | ||
546 | # | ||
547 | |||
548 | write_le32(0x00003000); # Type | ||
549 | write_le64(0x00000000, 0x0000b700); # ID | ||
550 | write_le32(161); # Size | ||
551 | write_hunk_fix_endian(303384, 161); | ||
552 | |||
553 | # | ||
554 | # Firmware 44, type: STD FW (0x00000000), id: NTSC/M Jp (0000000000002000), size: 161 | ||
555 | # | ||
556 | |||
557 | write_le32(0x00000000); # Type | ||
558 | write_le64(0x00000000, 0x00002000); # ID | ||
559 | write_le32(161); # Size | ||
560 | write_hunk_fix_endian(303552, 161); | ||
561 | |||
562 | # | ||
563 | # Firmware 45, type: STD FW MTS (0x00000004), id: NTSC PAL/M PAL/N (000000000000b700), size: 169 | ||
564 | # | ||
565 | |||
566 | write_le32(0x00000004); # Type | ||
567 | write_le64(0x00000000, 0x0000b700); # ID | ||
568 | write_le32(169); # Size | ||
569 | write_hunk_fix_endian(303720, 169); | ||
570 | |||
571 | # | ||
572 | # Firmware 46, type: STD FW MTS LCD (0x00001004), id: NTSC PAL/M PAL/N (000000000000b700), size: 169 | ||
573 | # | ||
574 | |||
575 | write_le32(0x00001004); # Type | ||
576 | write_le64(0x00000000, 0x0000b700); # ID | ||
577 | write_le32(169); # Size | ||
578 | write_hunk_fix_endian(303896, 169); | ||
579 | |||
580 | # | ||
581 | # Firmware 47, type: STD FW MTS LCD NOGD (0x00003004), id: NTSC PAL/M PAL/N (000000000000b700), size: 169 | ||
582 | # | ||
583 | |||
584 | write_le32(0x00003004); # Type | ||
585 | write_le64(0x00000000, 0x0000b700); # ID | ||
586 | write_le32(169); # Size | ||
587 | write_hunk_fix_endian(304072, 169); | ||
588 | |||
589 | # | ||
590 | # Firmware 48, type: SCODE FW HAS IF (0x60000000), IF = 3.28 MHz id: (0000000000000000), size: 192 | ||
591 | # | ||
592 | |||
593 | write_le32(0x60000000); # Type | ||
594 | write_le64(0x00000000, 0x00000000); # ID | ||
595 | write_le16(3280); # IF | ||
596 | write_le32(192); # Size | ||
597 | write_hunk(309048, 192); | ||
598 | |||
599 | # | ||
600 | # Firmware 49, type: SCODE FW HAS IF (0x60000000), IF = 3.30 MHz id: (0000000000000000), size: 192 | ||
601 | # | ||
602 | |||
603 | # write_le32(0x60000000); # Type | ||
604 | # write_le64(0x00000000, 0x00000000); # ID | ||
605 | # write_le16(3300); # IF | ||
606 | # write_le32(192); # Size | ||
607 | # write_hunk(304440, 192); | ||
608 | |||
609 | # | ||
610 | # Firmware 50, type: SCODE FW HAS IF (0x60000000), IF = 3.44 MHz id: (0000000000000000), size: 192 | ||
611 | # | ||
612 | |||
613 | write_le32(0x60000000); # Type | ||
614 | write_le64(0x00000000, 0x00000000); # ID | ||
615 | write_le16(3440); # IF | ||
616 | write_le32(192); # Size | ||
617 | write_hunk(309432, 192); | ||
618 | |||
619 | # | ||
620 | # Firmware 51, type: SCODE FW HAS IF (0x60000000), IF = 3.46 MHz id: (0000000000000000), size: 192 | ||
621 | # | ||
622 | |||
623 | write_le32(0x60000000); # Type | ||
624 | write_le64(0x00000000, 0x00000000); # ID | ||
625 | write_le16(3460); # IF | ||
626 | write_le32(192); # Size | ||
627 | write_hunk(309624, 192); | ||
628 | |||
629 | # | ||
630 | # Firmware 52, type: SCODE FW DTV6 ATSC OREN36 HAS IF (0x60210020), IF = 3.80 MHz id: (0000000000000000), size: 192 | ||
631 | # | ||
632 | |||
633 | write_le32(0x60210020); # Type | ||
634 | write_le64(0x00000000, 0x00000000); # ID | ||
635 | write_le16(3800); # IF | ||
636 | write_le32(192); # Size | ||
637 | write_hunk(306936, 192); | ||
638 | |||
639 | # | ||
640 | # Firmware 53, type: SCODE FW HAS IF (0x60000000), IF = 4.00 MHz id: (0000000000000000), size: 192 | ||
641 | # | ||
642 | |||
643 | write_le32(0x60000000); # Type | ||
644 | write_le64(0x00000000, 0x00000000); # ID | ||
645 | write_le16(4000); # IF | ||
646 | write_le32(192); # Size | ||
647 | write_hunk(309240, 192); | ||
648 | |||
649 | # | ||
650 | # Firmware 54, type: SCODE FW DTV6 ATSC TOYOTA388 HAS IF (0x60410020), IF = 4.08 MHz id: (0000000000000000), size: 192 | ||
651 | # | ||
652 | |||
653 | write_le32(0x60410020); # Type | ||
654 | write_le64(0x00000000, 0x00000000); # ID | ||
655 | write_le16(4080); # IF | ||
656 | write_le32(192); # Size | ||
657 | write_hunk(307128, 192); | ||
658 | |||
659 | # | ||
660 | # Firmware 55, type: SCODE FW HAS IF (0x60000000), IF = 4.20 MHz id: (0000000000000000), size: 192 | ||
661 | # | ||
662 | |||
663 | write_le32(0x60000000); # Type | ||
664 | write_le64(0x00000000, 0x00000000); # ID | ||
665 | write_le16(4200); # IF | ||
666 | write_le32(192); # Size | ||
667 | write_hunk(308856, 192); | ||
668 | |||
669 | # | ||
670 | # Firmware 56, type: SCODE FW MONO HAS IF (0x60008000), IF = 4.32 MHz id: NTSC/M Kr (0000000000008000), size: 192 | ||
671 | # | ||
672 | |||
673 | write_le32(0x60008000); # Type | ||
674 | write_le64(0x00000000, 0x00008000); # ID | ||
675 | write_le16(4320); # IF | ||
676 | write_le32(192); # Size | ||
677 | write_hunk(305208, 192); | ||
678 | |||
679 | # | ||
680 | # Firmware 57, type: SCODE FW HAS IF (0x60000000), IF = 4.45 MHz id: (0000000000000000), size: 192 | ||
681 | # | ||
682 | |||
683 | write_le32(0x60000000); # Type | ||
684 | write_le64(0x00000000, 0x00000000); # ID | ||
685 | write_le16(4450); # IF | ||
686 | write_le32(192); # Size | ||
687 | write_hunk(309816, 192); | ||
688 | |||
689 | # | ||
690 | # Firmware 58, type: SCODE FW MTS LCD NOGD MONO IF HAS IF (0x6002b004), IF = 4.50 MHz id: NTSC PAL/M PAL/N (000000000000b700), size: 192 | ||
691 | # | ||
692 | |||
693 | write_le32(0x6002b004); # Type | ||
694 | write_le64(0x00000000, 0x0000b700); # ID | ||
695 | write_le16(4500); # IF | ||
696 | write_le32(192); # Size | ||
697 | write_hunk(304824, 192); | ||
698 | |||
699 | # | ||
700 | # Firmware 59, type: SCODE FW LCD NOGD IF HAS IF (0x60023000), IF = 4.60 MHz id: NTSC/M Kr (0000000000008000), size: 192 | ||
701 | # | ||
702 | |||
703 | write_le32(0x60023000); # Type | ||
704 | write_le64(0x00000000, 0x00008000); # ID | ||
705 | write_le16(4600); # IF | ||
706 | write_le32(192); # Size | ||
707 | write_hunk(305016, 192); | ||
708 | |||
709 | # | ||
710 | # Firmware 60, type: SCODE FW DTV6 QAM DTV7 DTV78 DTV8 ZARLINK456 HAS IF (0x620003e0), IF = 4.76 MHz id: (0000000000000000), size: 192 | ||
711 | # | ||
712 | |||
713 | write_le32(0x620003e0); # Type | ||
714 | write_le64(0x00000000, 0x00000000); # ID | ||
715 | write_le16(4760); # IF | ||
716 | write_le32(192); # Size | ||
717 | write_hunk(304440, 192); | ||
718 | |||
719 | # | ||
720 | # Firmware 61, type: SCODE FW HAS IF (0x60000000), IF = 4.94 MHz id: (0000000000000000), size: 192 | ||
721 | # | ||
722 | |||
723 | write_le32(0x60000000); # Type | ||
724 | write_le64(0x00000000, 0x00000000); # ID | ||
725 | write_le16(4940); # IF | ||
726 | write_le32(192); # Size | ||
727 | write_hunk(308664, 192); | ||
728 | |||
729 | # | ||
730 | # Firmware 62, type: SCODE FW HAS IF (0x60000000), IF = 5.26 MHz id: (0000000000000000), size: 192 | ||
731 | # | ||
732 | |||
733 | write_le32(0x60000000); # Type | ||
734 | write_le64(0x00000000, 0x00000000); # ID | ||
735 | write_le16(5260); # IF | ||
736 | write_le32(192); # Size | ||
737 | write_hunk(307704, 192); | ||
738 | |||
739 | # | ||
740 | # Firmware 63, type: SCODE FW MONO HAS IF (0x60008000), IF = 5.32 MHz id: PAL/BG A2 NICAM (0000000f00000007), size: 192 | ||
741 | # | ||
742 | |||
743 | write_le32(0x60008000); # Type | ||
744 | write_le64(0x0000000f, 0x00000007); # ID | ||
745 | write_le16(5320); # IF | ||
746 | write_le32(192); # Size | ||
747 | write_hunk(307896, 192); | ||
748 | |||
749 | # | ||
750 | # Firmware 64, type: SCODE FW DTV7 DTV78 DTV8 DIBCOM52 CHINA HAS IF (0x65000380), IF = 5.40 MHz id: (0000000000000000), size: 192 | ||
751 | # | ||
752 | |||
753 | write_le32(0x65000380); # Type | ||
754 | write_le64(0x00000000, 0x00000000); # ID | ||
755 | write_le16(5400); # IF | ||
756 | write_le32(192); # Size | ||
757 | write_hunk(304248, 192); | ||
758 | |||
759 | # | ||
760 | # Firmware 65, type: SCODE FW DTV6 ATSC OREN538 HAS IF (0x60110020), IF = 5.58 MHz id: (0000000000000000), size: 192 | ||
761 | # | ||
762 | |||
763 | write_le32(0x60110020); # Type | ||
764 | write_le64(0x00000000, 0x00000000); # ID | ||
765 | write_le16(5580); # IF | ||
766 | write_le32(192); # Size | ||
767 | write_hunk(306744, 192); | ||
768 | |||
769 | # | ||
770 | # Firmware 66, type: SCODE FW HAS IF (0x60000000), IF = 5.64 MHz id: PAL/BG A2 (0000000300000007), size: 192 | ||
771 | # | ||
772 | |||
773 | write_le32(0x60000000); # Type | ||
774 | write_le64(0x00000003, 0x00000007); # ID | ||
775 | write_le16(5640); # IF | ||
776 | write_le32(192); # Size | ||
777 | write_hunk(305592, 192); | ||
778 | |||
779 | # | ||
780 | # Firmware 67, type: SCODE FW HAS IF (0x60000000), IF = 5.74 MHz id: PAL/BG NICAM (0000000c00000007), size: 192 | ||
781 | # | ||
782 | |||
783 | write_le32(0x60000000); # Type | ||
784 | write_le64(0x0000000c, 0x00000007); # ID | ||
785 | write_le16(5740); # IF | ||
786 | write_le32(192); # Size | ||
787 | write_hunk(305784, 192); | ||
788 | |||
789 | # | ||
790 | # Firmware 68, type: SCODE FW HAS IF (0x60000000), IF = 5.90 MHz id: (0000000000000000), size: 192 | ||
791 | # | ||
792 | |||
793 | write_le32(0x60000000); # Type | ||
794 | write_le64(0x00000000, 0x00000000); # ID | ||
795 | write_le16(5900); # IF | ||
796 | write_le32(192); # Size | ||
797 | write_hunk(307512, 192); | ||
798 | |||
799 | # | ||
800 | # Firmware 69, type: SCODE FW MONO HAS IF (0x60008000), IF = 6.00 MHz id: PAL/DK PAL/I SECAM/K3 SECAM/L SECAM/Lc NICAM (0000000c04c000f0), size: 192 | ||
801 | # | ||
802 | |||
803 | write_le32(0x60008000); # Type | ||
804 | write_le64(0x0000000c, 0x04c000f0); # ID | ||
805 | write_le16(6000); # IF | ||
806 | write_le32(192); # Size | ||
807 | write_hunk(305576, 192); | ||
808 | |||
809 | # | ||
810 | # Firmware 70, type: SCODE FW DTV6 QAM ATSC LG60 F6MHZ HAS IF (0x68050060), IF = 6.20 MHz id: (0000000000000000), size: 192 | ||
811 | # | ||
812 | |||
813 | write_le32(0x68050060); # Type | ||
814 | write_le64(0x00000000, 0x00000000); # ID | ||
815 | write_le16(6200); # IF | ||
816 | write_le32(192); # Size | ||
817 | write_hunk(306552, 192); | ||
818 | |||
819 | # | ||
820 | # Firmware 71, type: SCODE FW HAS IF (0x60000000), IF = 6.24 MHz id: PAL/I (0000000000000010), size: 192 | ||
821 | # | ||
822 | |||
823 | write_le32(0x60000000); # Type | ||
824 | write_le64(0x00000000, 0x00000010); # ID | ||
825 | write_le16(6240); # IF | ||
826 | write_le32(192); # Size | ||
827 | write_hunk(305400, 192); | ||
828 | |||
829 | # | ||
830 | # Firmware 72, type: SCODE FW MONO HAS IF (0x60008000), IF = 6.32 MHz id: SECAM/K1 (0000000000200000), size: 192 | ||
831 | # | ||
832 | |||
833 | write_le32(0x60008000); # Type | ||
834 | write_le64(0x00000000, 0x00200000); # ID | ||
835 | write_le16(6320); # IF | ||
836 | write_le32(192); # Size | ||
837 | write_hunk(308472, 192); | ||
838 | |||
839 | # | ||
840 | # Firmware 73, type: SCODE FW HAS IF (0x60000000), IF = 6.34 MHz id: SECAM/K1 (0000000000200000), size: 192 | ||
841 | # | ||
842 | |||
843 | write_le32(0x60000000); # Type | ||
844 | write_le64(0x00000000, 0x00200000); # ID | ||
845 | write_le16(6340); # IF | ||
846 | write_le32(192); # Size | ||
847 | write_hunk(306360, 192); | ||
848 | |||
849 | # | ||
850 | # Firmware 74, type: SCODE FW MONO HAS IF (0x60008000), IF = 6.50 MHz id: PAL/DK SECAM/K3 SECAM/L NICAM (0000000c044000e0), size: 192 | ||
851 | # | ||
852 | |||
853 | write_le32(0x60008000); # Type | ||
854 | write_le64(0x0000000c, 0x044000e0); # ID | ||
855 | write_le16(6500); # IF | ||
856 | write_le32(192); # Size | ||
857 | write_hunk(308280, 192); | ||
858 | |||
859 | # | ||
860 | # Firmware 75, type: SCODE FW DTV6 ATSC ATI638 HAS IF (0x60090020), IF = 6.58 MHz id: (0000000000000000), size: 192 | ||
861 | # | ||
862 | |||
863 | write_le32(0x60090020); # Type | ||
864 | write_le64(0x00000000, 0x00000000); # ID | ||
865 | write_le16(6580); # IF | ||
866 | write_le32(192); # Size | ||
867 | write_hunk(304632, 192); | ||
868 | |||
869 | # | ||
870 | # Firmware 76, type: SCODE FW HAS IF (0x60000000), IF = 6.60 MHz id: PAL/DK A2 (00000003000000e0), size: 192 | ||
871 | # | ||
872 | |||
873 | write_le32(0x60000000); # Type | ||
874 | write_le64(0x00000003, 0x000000e0); # ID | ||
875 | write_le16(6600); # IF | ||
876 | write_le32(192); # Size | ||
877 | write_hunk(306168, 192); | ||
878 | |||
879 | # | ||
880 | # Firmware 77, type: SCODE FW MONO HAS IF (0x60008000), IF = 6.68 MHz id: PAL/DK A2 (00000003000000e0), size: 192 | ||
881 | # | ||
882 | |||
883 | write_le32(0x60008000); # Type | ||
884 | write_le64(0x00000003, 0x000000e0); # ID | ||
885 | write_le16(6680); # IF | ||
886 | write_le32(192); # Size | ||
887 | write_hunk(308088, 192); | ||
888 | |||
889 | # | ||
890 | # Firmware 78, type: SCODE FW DTV6 ATSC TOYOTA794 HAS IF (0x60810020), IF = 8.14 MHz id: (0000000000000000), size: 192 | ||
891 | # | ||
892 | |||
893 | write_le32(0x60810020); # Type | ||
894 | write_le64(0x00000000, 0x00000000); # ID | ||
895 | write_le16(8140); # IF | ||
896 | write_le32(192); # Size | ||
897 | write_hunk(307320, 192); | ||
898 | |||
899 | # | ||
900 | # Firmware 79, type: SCODE FW HAS IF (0x60000000), IF = 8.20 MHz id: (0000000000000000), size: 192 | ||
901 | # | ||
902 | |||
903 | # write_le32(0x60000000); # Type | ||
904 | # write_le64(0x00000000, 0x00000000); # ID | ||
905 | # write_le16(8200); # IF | ||
906 | # write_le32(192); # Size | ||
907 | # write_hunk(308088, 192); | ||
149 | } | 908 | } |
150 | 909 | ||
910 | sub main_firmware_27($$$$) | ||
911 | { | ||
912 | my $out; | ||
913 | my $j=0; | ||
914 | my $outfile = shift; | ||
915 | my $name = shift; | ||
916 | my $version = shift; | ||
917 | my $nr_desc = shift; | ||
918 | |||
919 | for ($j = length($name); $j <32; $j++) { | ||
920 | $name = $name.chr(0); | ||
921 | } | ||
922 | |||
151 | open OUTFILE, ">$outfile"; | 923 | open OUTFILE, ">$outfile"; |
152 | syswrite(OUTFILE, $name); | 924 | syswrite(OUTFILE, $name); |
153 | write_le16($version); | 925 | write_le16($version); |
@@ -906,20 +1678,39 @@ sub main_firmware($$$$) | |||
906 | write_hunk(812856, 192); | 1678 | write_hunk(812856, 192); |
907 | } | 1679 | } |
908 | 1680 | ||
1681 | |||
909 | sub extract_firmware { | 1682 | sub extract_firmware { |
910 | my $sourcefile = "hcw85bda.sys"; | 1683 | my $sourcefile_24 = "UDXTTM6000.sys"; |
911 | my $hash = "0e44dbf63bb0169d57446aec21881ff2"; | 1684 | my $hash_24 = "cb9deb5508a5e150af2880f5b0066d78"; |
912 | my $outfile = "xc3028-v27.fw"; | 1685 | my $outfile_24 = "xc3028-v24.fw"; |
913 | my $name = "xc2028 firmware"; | 1686 | my $name_24 = "xc2028 firmware"; |
914 | my $version = 519; | 1687 | my $version_24 = 516; |
915 | my $nr_desc = 80; | 1688 | my $nr_desc_24 = 77; |
1689 | my $out; | ||
1690 | |||
1691 | my $sourcefile_27 = "hcw85bda.sys"; | ||
1692 | my $hash_27 = "0e44dbf63bb0169d57446aec21881ff2"; | ||
1693 | my $outfile_27 = "xc3028-v27.fw"; | ||
1694 | my $name_27 = "xc2028 firmware"; | ||
1695 | my $version_27 = 519; | ||
1696 | my $nr_desc_27 = 80; | ||
916 | my $out; | 1697 | my $out; |
917 | 1698 | ||
918 | verify($sourcefile, $hash); | 1699 | if (-e $sourcefile_24) { |
1700 | verify($sourcefile_24, $hash_24); | ||
1701 | |||
1702 | open INFILE, "<$sourcefile_24"; | ||
1703 | main_firmware_24($outfile_24, $name_24, $version_24, $nr_desc_24); | ||
1704 | close INFILE; | ||
1705 | } | ||
919 | 1706 | ||
920 | open INFILE, "<$sourcefile"; | 1707 | if (-e $sourcefile_27) { |
921 | main_firmware($outfile, $name, $version, $nr_desc); | 1708 | verify($sourcefile_27, $hash_27); |
922 | close INFILE; | 1709 | |
1710 | open INFILE, "<$sourcefile_27"; | ||
1711 | main_firmware_27($outfile_27, $name_27, $version_27, $nr_desc_27); | ||
1712 | close INFILE; | ||
1713 | } | ||
923 | } | 1714 | } |
924 | 1715 | ||
925 | extract_firmware; | 1716 | extract_firmware; |
diff --git a/Documentation/video4linux/gspca.txt b/Documentation/video4linux/gspca.txt index 1800a62cf135..f13eb036c439 100644 --- a/Documentation/video4linux/gspca.txt +++ b/Documentation/video4linux/gspca.txt | |||
@@ -42,6 +42,7 @@ ov519 041e:4064 Creative Live! VISTA VF0420 | |||
42 | ov519 041e:4067 Creative Live! Cam Video IM (VF0350) | 42 | ov519 041e:4067 Creative Live! Cam Video IM (VF0350) |
43 | ov519 041e:4068 Creative Live! VISTA VF0470 | 43 | ov519 041e:4068 Creative Live! VISTA VF0470 |
44 | spca561 0458:7004 Genius VideoCAM Express V2 | 44 | spca561 0458:7004 Genius VideoCAM Express V2 |
45 | sn9c2028 0458:7005 Genius Smart 300, version 2 | ||
45 | sunplus 0458:7006 Genius Dsc 1.3 Smart | 46 | sunplus 0458:7006 Genius Dsc 1.3 Smart |
46 | zc3xx 0458:7007 Genius VideoCam V2 | 47 | zc3xx 0458:7007 Genius VideoCam V2 |
47 | zc3xx 0458:700c Genius VideoCam V3 | 48 | zc3xx 0458:700c Genius VideoCam V3 |
@@ -49,6 +50,8 @@ zc3xx 0458:700f Genius VideoCam Web V2 | |||
49 | sonixj 0458:7025 Genius Eye 311Q | 50 | sonixj 0458:7025 Genius Eye 311Q |
50 | sn9c20x 0458:7029 Genius Look 320s | 51 | sn9c20x 0458:7029 Genius Look 320s |
51 | sonixj 0458:702e Genius Slim 310 NB | 52 | sonixj 0458:702e Genius Slim 310 NB |
53 | sn9c20x 0458:704a Genius Slim 1320 | ||
54 | sn9c20x 0458:704c Genius i-Look 1321 | ||
52 | sn9c20x 045e:00f4 LifeCam VX-6000 (SN9C20x + OV9650) | 55 | sn9c20x 045e:00f4 LifeCam VX-6000 (SN9C20x + OV9650) |
53 | sonixj 045e:00f5 MicroSoft VX3000 | 56 | sonixj 045e:00f5 MicroSoft VX3000 |
54 | sonixj 045e:00f7 MicroSoft VX1000 | 57 | sonixj 045e:00f7 MicroSoft VX1000 |
@@ -109,6 +112,7 @@ sunplus 04a5:3003 Benq DC 1300 | |||
109 | sunplus 04a5:3008 Benq DC 1500 | 112 | sunplus 04a5:3008 Benq DC 1500 |
110 | sunplus 04a5:300a Benq DC 3410 | 113 | sunplus 04a5:300a Benq DC 3410 |
111 | spca500 04a5:300c Benq DC 1016 | 114 | spca500 04a5:300c Benq DC 1016 |
115 | benq 04a5:3035 Benq DC E300 | ||
112 | finepix 04cb:0104 Fujifilm FinePix 4800 | 116 | finepix 04cb:0104 Fujifilm FinePix 4800 |
113 | finepix 04cb:0109 Fujifilm FinePix A202 | 117 | finepix 04cb:0109 Fujifilm FinePix A202 |
114 | finepix 04cb:010b Fujifilm FinePix A203 | 118 | finepix 04cb:010b Fujifilm FinePix A203 |
@@ -142,6 +146,7 @@ sunplus 04fc:5360 Sunplus Generic | |||
142 | spca500 04fc:7333 PalmPixDC85 | 146 | spca500 04fc:7333 PalmPixDC85 |
143 | sunplus 04fc:ffff Pure DigitalDakota | 147 | sunplus 04fc:ffff Pure DigitalDakota |
144 | spca501 0506:00df 3Com HomeConnect Lite | 148 | spca501 0506:00df 3Com HomeConnect Lite |
149 | sunplus 052b:1507 Megapixel 5 Pretec DC-1007 | ||
145 | sunplus 052b:1513 Megapix V4 | 150 | sunplus 052b:1513 Megapix V4 |
146 | sunplus 052b:1803 MegaImage VI | 151 | sunplus 052b:1803 MegaImage VI |
147 | tv8532 0545:808b Veo Stingray | 152 | tv8532 0545:808b Veo Stingray |
@@ -151,6 +156,7 @@ sunplus 0546:3191 Polaroid Ion 80 | |||
151 | sunplus 0546:3273 Polaroid PDC2030 | 156 | sunplus 0546:3273 Polaroid PDC2030 |
152 | ov519 054c:0154 Sonny toy4 | 157 | ov519 054c:0154 Sonny toy4 |
153 | ov519 054c:0155 Sonny toy5 | 158 | ov519 054c:0155 Sonny toy5 |
159 | cpia1 0553:0002 CPIA CPiA (version1) based cameras | ||
154 | zc3xx 055f:c005 Mustek Wcam300A | 160 | zc3xx 055f:c005 Mustek Wcam300A |
155 | spca500 055f:c200 Mustek Gsmart 300 | 161 | spca500 055f:c200 Mustek Gsmart 300 |
156 | sunplus 055f:c211 Kowa Bs888e Microcamera | 162 | sunplus 055f:c211 Kowa Bs888e Microcamera |
@@ -188,8 +194,7 @@ spca500 06bd:0404 Agfa CL20 | |||
188 | spca500 06be:0800 Optimedia | 194 | spca500 06be:0800 Optimedia |
189 | sunplus 06d6:0031 Trust 610 LCD PowerC@m Zoom | 195 | sunplus 06d6:0031 Trust 610 LCD PowerC@m Zoom |
190 | spca506 06e1:a190 ADS Instant VCD | 196 | spca506 06e1:a190 ADS Instant VCD |
191 | ov534 06f8:3002 Hercules Blog Webcam | 197 | ov534_9 06f8:3003 Hercules Dualpix HD Weblog |
192 | ov534 06f8:3003 Hercules Dualpix HD Weblog | ||
193 | sonixj 06f8:3004 Hercules Classic Silver | 198 | sonixj 06f8:3004 Hercules Classic Silver |
194 | sonixj 06f8:3008 Hercules Deluxe Optical Glass | 199 | sonixj 06f8:3008 Hercules Deluxe Optical Glass |
195 | pac7302 06f8:3009 Hercules Classic Link | 200 | pac7302 06f8:3009 Hercules Classic Link |
@@ -204,6 +209,7 @@ sunplus 0733:2221 Mercury Digital Pro 3.1p | |||
204 | sunplus 0733:3261 Concord 3045 spca536a | 209 | sunplus 0733:3261 Concord 3045 spca536a |
205 | sunplus 0733:3281 Cyberpix S550V | 210 | sunplus 0733:3281 Cyberpix S550V |
206 | spca506 0734:043b 3DeMon USB Capture aka | 211 | spca506 0734:043b 3DeMon USB Capture aka |
212 | cpia1 0813:0001 QX3 camera | ||
207 | ov519 0813:0002 Dual Mode USB Camera Plus | 213 | ov519 0813:0002 Dual Mode USB Camera Plus |
208 | spca500 084d:0003 D-Link DSC-350 | 214 | spca500 084d:0003 D-Link DSC-350 |
209 | spca500 08ca:0103 Aiptek PocketDV | 215 | spca500 08ca:0103 Aiptek PocketDV |
@@ -225,7 +231,8 @@ sunplus 08ca:2050 Medion MD 41437 | |||
225 | sunplus 08ca:2060 Aiptek PocketDV5300 | 231 | sunplus 08ca:2060 Aiptek PocketDV5300 |
226 | tv8532 0923:010f ICM532 cams | 232 | tv8532 0923:010f ICM532 cams |
227 | mars 093a:050f Mars-Semi Pc-Camera | 233 | mars 093a:050f Mars-Semi Pc-Camera |
228 | mr97310a 093a:010f Sakar Digital no. 77379 | 234 | mr97310a 093a:010e All known CIF cams with this ID |
235 | mr97310a 093a:010f All known VGA cams with this ID | ||
229 | pac207 093a:2460 Qtec Webcam 100 | 236 | pac207 093a:2460 Qtec Webcam 100 |
230 | pac207 093a:2461 HP Webcam | 237 | pac207 093a:2461 HP Webcam |
231 | pac207 093a:2463 Philips SPC 220 NC | 238 | pac207 093a:2463 Philips SPC 220 NC |
@@ -283,6 +290,7 @@ sonixb 0c45:602e Genius VideoCam Messenger | |||
283 | sonixj 0c45:6040 Speed NVC 350K | 290 | sonixj 0c45:6040 Speed NVC 350K |
284 | sonixj 0c45:607c Sonix sn9c102p Hv7131R | 291 | sonixj 0c45:607c Sonix sn9c102p Hv7131R |
285 | sonixj 0c45:60c0 Sangha Sn535 | 292 | sonixj 0c45:60c0 Sangha Sn535 |
293 | sonixj 0c45:60ce USB-PC-Camera-168 (TALK-5067) | ||
286 | sonixj 0c45:60ec SN9C105+MO4000 | 294 | sonixj 0c45:60ec SN9C105+MO4000 |
287 | sonixj 0c45:60fb Surfer NoName | 295 | sonixj 0c45:60fb Surfer NoName |
288 | sonixj 0c45:60fc LG-LIC300 | 296 | sonixj 0c45:60fc LG-LIC300 |
@@ -300,11 +308,14 @@ sonixj 0c45:6138 Sn9c120 Mo4000 | |||
300 | sonixj 0c45:613a Microdia Sonix PC Camera | 308 | sonixj 0c45:613a Microdia Sonix PC Camera |
301 | sonixj 0c45:613b Surfer SN-206 | 309 | sonixj 0c45:613b Surfer SN-206 |
302 | sonixj 0c45:613c Sonix Pccam168 | 310 | sonixj 0c45:613c Sonix Pccam168 |
311 | sonixj 0c45:6142 Hama PC-Webcam AC-150 | ||
303 | sonixj 0c45:6143 Sonix Pccam168 | 312 | sonixj 0c45:6143 Sonix Pccam168 |
304 | sonixj 0c45:6148 Digitus DA-70811/ZSMC USB PC Camera ZS211/Microdia | 313 | sonixj 0c45:6148 Digitus DA-70811/ZSMC USB PC Camera ZS211/Microdia |
314 | sonixj 0c45:614a Frontech E-Ccam (JIL-2225) | ||
305 | sn9c20x 0c45:6240 PC Camera (SN9C201 + MT9M001) | 315 | sn9c20x 0c45:6240 PC Camera (SN9C201 + MT9M001) |
306 | sn9c20x 0c45:6242 PC Camera (SN9C201 + MT9M111) | 316 | sn9c20x 0c45:6242 PC Camera (SN9C201 + MT9M111) |
307 | sn9c20x 0c45:6248 PC Camera (SN9C201 + OV9655) | 317 | sn9c20x 0c45:6248 PC Camera (SN9C201 + OV9655) |
318 | sn9c20x 0c45:624c PC Camera (SN9C201 + MT9M112) | ||
308 | sn9c20x 0c45:624e PC Camera (SN9C201 + SOI968) | 319 | sn9c20x 0c45:624e PC Camera (SN9C201 + SOI968) |
309 | sn9c20x 0c45:624f PC Camera (SN9C201 + OV9650) | 320 | sn9c20x 0c45:624f PC Camera (SN9C201 + OV9650) |
310 | sn9c20x 0c45:6251 PC Camera (SN9C201 + OV9650) | 321 | sn9c20x 0c45:6251 PC Camera (SN9C201 + OV9650) |
@@ -317,6 +328,7 @@ sn9c20x 0c45:627f PC Camera (SN9C201 + OV9650) | |||
317 | sn9c20x 0c45:6280 PC Camera (SN9C202 + MT9M001) | 328 | sn9c20x 0c45:6280 PC Camera (SN9C202 + MT9M001) |
318 | sn9c20x 0c45:6282 PC Camera (SN9C202 + MT9M111) | 329 | sn9c20x 0c45:6282 PC Camera (SN9C202 + MT9M111) |
319 | sn9c20x 0c45:6288 PC Camera (SN9C202 + OV9655) | 330 | sn9c20x 0c45:6288 PC Camera (SN9C202 + OV9655) |
331 | sn9c20x 0c45:628c PC Camera (SN9C201 + MT9M112) | ||
320 | sn9c20x 0c45:628e PC Camera (SN9C202 + SOI968) | 332 | sn9c20x 0c45:628e PC Camera (SN9C202 + SOI968) |
321 | sn9c20x 0c45:628f PC Camera (SN9C202 + OV9650) | 333 | sn9c20x 0c45:628f PC Camera (SN9C202 + OV9650) |
322 | sn9c20x 0c45:62a0 PC Camera (SN9C202 + OV7670) | 334 | sn9c20x 0c45:62a0 PC Camera (SN9C202 + OV7670) |
@@ -324,6 +336,10 @@ sn9c20x 0c45:62b0 PC Camera (SN9C202 + MT9V011/MT9V111/MT9V112) | |||
324 | sn9c20x 0c45:62b3 PC Camera (SN9C202 + OV9655) | 336 | sn9c20x 0c45:62b3 PC Camera (SN9C202 + OV9655) |
325 | sn9c20x 0c45:62bb PC Camera (SN9C202 + OV7660) | 337 | sn9c20x 0c45:62bb PC Camera (SN9C202 + OV7660) |
326 | sn9c20x 0c45:62bc PC Camera (SN9C202 + HV7131R) | 338 | sn9c20x 0c45:62bc PC Camera (SN9C202 + HV7131R) |
339 | sn9c2028 0c45:8001 Wild Planet Digital Spy Camera | ||
340 | sn9c2028 0c45:8003 Sakar #11199, #6637x, #67480 keychain cams | ||
341 | sn9c2028 0c45:8008 Mini-Shotz ms-350 | ||
342 | sn9c2028 0c45:800a Vivitar Vivicam 3350B | ||
327 | sunplus 0d64:0303 Sunplus FashionCam DXG | 343 | sunplus 0d64:0303 Sunplus FashionCam DXG |
328 | ov519 0e96:c001 TRUST 380 USB2 SPACEC@M | 344 | ov519 0e96:c001 TRUST 380 USB2 SPACEC@M |
329 | etoms 102c:6151 Qcam Sangha CIF | 345 | etoms 102c:6151 Qcam Sangha CIF |
@@ -341,10 +357,11 @@ spca501 1776:501c Arowana 300K CMOS Camera | |||
341 | t613 17a1:0128 TASCORP JPEG Webcam, NGS Cyclops | 357 | t613 17a1:0128 TASCORP JPEG Webcam, NGS Cyclops |
342 | vc032x 17ef:4802 Lenovo Vc0323+MI1310_SOC | 358 | vc032x 17ef:4802 Lenovo Vc0323+MI1310_SOC |
343 | pac207 2001:f115 D-Link DSB-C120 | 359 | pac207 2001:f115 D-Link DSB-C120 |
344 | sq905c 2770:9050 sq905c | 360 | sq905c 2770:9050 Disney pix micro (CIF) |
345 | sq905c 2770:905c DualCamera | 361 | sq905c 2770:9052 Disney pix micro 2 (VGA) |
346 | sq905 2770:9120 Argus Digital Camera DC1512 | 362 | sq905c 2770:905c All 11 known cameras with this ID |
347 | sq905c 2770:913d sq905c | 363 | sq905 2770:9120 All 24 known cameras with this ID |
364 | sq905c 2770:913d All 4 known cameras with this ID | ||
348 | spca500 2899:012c Toptro Industrial | 365 | spca500 2899:012c Toptro Industrial |
349 | ov519 8020:ef04 ov519 | 366 | ov519 8020:ef04 ov519 |
350 | spca508 8086:0110 Intel Easy PC Camera | 367 | spca508 8086:0110 Intel Easy PC Camera |
diff --git a/Documentation/video4linux/sh_mobile_ceu_camera.txt b/Documentation/video4linux/sh_mobile_ceu_camera.txt index 2ae16349a78d..cb47e723af74 100644 --- a/Documentation/video4linux/sh_mobile_ceu_camera.txt +++ b/Documentation/video4linux/sh_mobile_ceu_camera.txt | |||
@@ -17,18 +17,18 @@ Generic scaling / cropping scheme | |||
17 | -2-- -\ | 17 | -2-- -\ |
18 | | --\ | 18 | | --\ |
19 | | --\ | 19 | | --\ |
20 | +-5-- -\ -- -3-- | 20 | +-5-- . -- -3-- -\ |
21 | | ---\ | 21 | | `... -\ |
22 | | --- -4-- -\ | 22 | | `... -4-- . - -7.. |
23 | | -\ | 23 | | `. |
24 | | - -6-- | 24 | | `. .6-- |
25 | | | 25 | | |
26 | | - -6'- | 26 | | . .6'- |
27 | | -/ | 27 | | .´ |
28 | | --- -4'- -/ | 28 | | ... -4'- .´ |
29 | | ---/ | 29 | | ...´ - -7'. |
30 | +-5'- -/ | 30 | +-5'- .´ -/ |
31 | | -- -3'- | 31 | | -- -3'- -/ |
32 | | --/ | 32 | | --/ |
33 | | --/ | 33 | | --/ |
34 | -2'- -/ | 34 | -2'- -/ |
@@ -36,7 +36,11 @@ Generic scaling / cropping scheme | |||
36 | | | 36 | | |
37 | -1'- | 37 | -1'- |
38 | 38 | ||
39 | Produced by user requests: | 39 | In the above chart minuses and slashes represent "real" data amounts, points and |
40 | accents represent "useful" data, basically, CEU scaled amd cropped output, | ||
41 | mapped back onto the client's source plane. | ||
42 | |||
43 | Such a configuration can be produced by user requests: | ||
40 | 44 | ||
41 | S_CROP(left / top = (5) - (1), width / height = (5') - (5)) | 45 | S_CROP(left / top = (5) - (1), width / height = (5') - (5)) |
42 | S_FMT(width / height = (6') - (6)) | 46 | S_FMT(width / height = (6') - (6)) |
@@ -106,52 +110,30 @@ window: | |||
106 | S_CROP | 110 | S_CROP |
107 | ------ | 111 | ------ |
108 | 112 | ||
109 | If old scale applied to new crop is invalid produce nearest new scale possible | 113 | The API at http://v4l2spec.bytesex.org/spec/x1904.htm says: |
110 | |||
111 | 1. Calculate current combined scales. | ||
112 | |||
113 | scale_comb = (((4') - (4)) / ((6') - (6))) * (((2') - (2)) / ((3') - (3))) | ||
114 | |||
115 | 2. Apply iterative sensor S_CROP for new input window. | ||
116 | |||
117 | 3. If old combined scales applied to new crop produce an impossible user window, | ||
118 | adjust scales to produce nearest possible window. | ||
119 | |||
120 | width_u_out = ((5') - (5)) / scale_comb | ||
121 | 114 | ||
122 | if (width_u_out > max) | 115 | "...specification does not define an origin or units. However by convention |
123 | scale_comb = ((5') - (5)) / max; | 116 | drivers should horizontally count unscaled samples relative to 0H." |
124 | else if (width_u_out < min) | ||
125 | scale_comb = ((5') - (5)) / min; | ||
126 | 117 | ||
127 | 4. Issue G_CROP to retrieve actual input window. | 118 | We choose to follow the advise and interpret cropping units as client input |
119 | pixels. | ||
128 | 120 | ||
129 | 5. Using actual input window and calculated combined scales calculate sensor | 121 | Cropping is performed in the following 6 steps: |
130 | target output window. | ||
131 | |||
132 | width_s_out = ((3') - (3)) = ((2') - (2)) / scale_comb | ||
133 | |||
134 | 6. Apply iterative S_FMT for new sensor target output window. | ||
135 | |||
136 | 7. Issue G_FMT to retrieve the actual sensor output window. | ||
137 | |||
138 | 8. Calculate sensor scales. | ||
139 | |||
140 | scale_s = ((3') - (3)) / ((2') - (2)) | ||
141 | 122 | ||
142 | 9. Calculate sensor output subwindow to be cropped on CEU by applying sensor | 123 | 1. Request exactly user rectangle from the sensor. |
143 | scales to the requested window. | ||
144 | 124 | ||
145 | width_ceu = ((5') - (5)) / scale_s | 125 | 2. If smaller - iterate until a larger one is obtained. Result: sensor cropped |
126 | to 2 : 2', target crop 5 : 5', current output format 6' - 6. | ||
146 | 127 | ||
147 | 10. Use CEU cropping for above calculated window. | 128 | 3. In the previous step the sensor has tried to preserve its output frame as |
129 | good as possible, but it could have changed. Retrieve it again. | ||
148 | 130 | ||
149 | 11. Calculate CEU scales from sensor scales from results of (10) and user window | 131 | 4. Sensor scaled to 3 : 3'. Sensor's scale is (2' - 2) / (3' - 3). Calculate |
150 | from (3) | 132 | intermediate window: 4' - 4 = (5' - 5) * (3' - 3) / (2' - 2) |
151 | 133 | ||
152 | scale_ceu = calc_scale(((5') - (5)), &width_u_out) | 134 | 5. Calculate and apply host scale = (6' - 6) / (4' - 4) |
153 | 135 | ||
154 | 12. Apply CEU scales. | 136 | 6. Calculate and apply host crop: 6 - 7 = (5 - 2) * (6' - 6) / (5' - 5) |
155 | 137 | ||
156 | -- | 138 | -- |
157 | Author: Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 139 | Author: Guennadi Liakhovetski <g.liakhovetski@gmx.de> |
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt index 74d677c8b036..e831aaca66f8 100644 --- a/Documentation/video4linux/v4l2-framework.txt +++ b/Documentation/video4linux/v4l2-framework.txt | |||
@@ -545,12 +545,11 @@ unregister them: | |||
545 | This will remove the device nodes from sysfs (causing udev to remove them | 545 | This will remove the device nodes from sysfs (causing udev to remove them |
546 | from /dev). | 546 | from /dev). |
547 | 547 | ||
548 | After video_unregister_device() returns no new opens can be done. | 548 | After video_unregister_device() returns no new opens can be done. However, |
549 | 549 | in the case of USB devices some application might still have one of these | |
550 | However, in the case of USB devices some application might still have one | 550 | device nodes open. So after the unregister all file operations will return |
551 | of these device nodes open. You should block all new accesses to read, | 551 | an error as well, except for the ioctl and unlocked_ioctl file operations: |
552 | write, poll, etc. except possibly for certain ioctl operations like | 552 | those will still be passed on since some buffer ioctls may still be needed. |
553 | queueing buffers. | ||
554 | 553 | ||
555 | When the last user of the video device node exits, then the vdev->release() | 554 | When the last user of the video device node exits, then the vdev->release() |
556 | callback is called and you can do the final cleanup there. | 555 | callback is called and you can do the final cleanup there. |
@@ -599,99 +598,145 @@ video_device::minor fields. | |||
599 | video buffer helper functions | 598 | video buffer helper functions |
600 | ----------------------------- | 599 | ----------------------------- |
601 | 600 | ||
602 | The v4l2 core API provides a standard method for dealing with video | 601 | The v4l2 core API provides a set of standard methods (called "videobuf") |
603 | buffers. Those methods allow a driver to implement read(), mmap() and | 602 | for dealing with video buffers. Those methods allow a driver to implement |
604 | overlay() on a consistent way. | 603 | read(), mmap() and overlay() in a consistent way. There are currently |
605 | 604 | methods for using video buffers on devices that supports DMA with | |
606 | There are currently methods for using video buffers on devices that | 605 | scatter/gather method (videobuf-dma-sg), DMA with linear access |
607 | supports DMA with scatter/gather method (videobuf-dma-sg), DMA with | 606 | (videobuf-dma-contig), and vmalloced buffers, mostly used on USB drivers |
608 | linear access (videobuf-dma-contig), and vmalloced buffers, mostly | 607 | (videobuf-vmalloc). |
609 | used on USB drivers (videobuf-vmalloc). | 608 | |
610 | 609 | Please see Documentation/video4linux/videobuf for more information on how | |
611 | Any driver using videobuf should provide operations (callbacks) for | 610 | to use the videobuf layer. |
612 | four handlers: | 611 | |
613 | 612 | struct v4l2_fh | |
614 | ops->buf_setup - calculates the size of the video buffers and avoid they | 613 | -------------- |
615 | to waste more than some maximum limit of RAM; | 614 | |
616 | ops->buf_prepare - fills the video buffer structs and calls | 615 | struct v4l2_fh provides a way to easily keep file handle specific data |
617 | videobuf_iolock() to alloc and prepare mmaped memory; | 616 | that is used by the V4L2 framework. Using v4l2_fh is optional for |
618 | ops->buf_queue - advices the driver that another buffer were | 617 | drivers. |
619 | requested (by read() or by QBUF); | 618 | |
620 | ops->buf_release - frees any buffer that were allocated. | 619 | The users of v4l2_fh (in the V4L2 framework, not the driver) know |
621 | 620 | whether a driver uses v4l2_fh as its file->private_data pointer by | |
622 | In order to use it, the driver need to have a code (generally called at | 621 | testing the V4L2_FL_USES_V4L2_FH bit in video_device->flags. |
623 | interrupt context) that will properly handle the buffer request lists, | 622 | |
624 | announcing that a new buffer were filled. | 623 | Useful functions: |
625 | 624 | ||
626 | The irq handling code should handle the videobuf task lists, in order | 625 | - v4l2_fh_init() |
627 | to advice videobuf that a new frame were filled, in order to honor to a | 626 | |
628 | request. The code is generally like this one: | 627 | Initialise the file handle. This *MUST* be performed in the driver's |
629 | if (list_empty(&dma_q->active)) | 628 | v4l2_file_operations->open() handler. |
630 | return; | 629 | |
631 | 630 | - v4l2_fh_add() | |
632 | buf = list_entry(dma_q->active.next, struct vbuffer, vb.queue); | 631 | |
633 | 632 | Add a v4l2_fh to video_device file handle list. May be called after | |
634 | if (!waitqueue_active(&buf->vb.done)) | 633 | initialising the file handle. |
635 | return; | 634 | |
636 | 635 | - v4l2_fh_del() | |
637 | /* Some logic to handle the buf may be needed here */ | 636 | |
638 | 637 | Unassociate the file handle from video_device(). The file handle | |
639 | list_del(&buf->vb.queue); | 638 | exit function may now be called. |
640 | do_gettimeofday(&buf->vb.ts); | 639 | |
641 | wake_up(&buf->vb.done); | 640 | - v4l2_fh_exit() |
642 | 641 | ||
643 | Those are the videobuffer functions used on drivers, implemented on | 642 | Uninitialise the file handle. After uninitialisation the v4l2_fh |
644 | videobuf-core: | 643 | memory can be freed. |
645 | 644 | ||
646 | - Videobuf init functions | 645 | struct v4l2_fh is allocated as a part of the driver's own file handle |
647 | videobuf_queue_sg_init() | 646 | structure and is set to file->private_data in the driver's open |
648 | Initializes the videobuf infrastructure. This function should be | 647 | function by the driver. Drivers can extract their own file handle |
649 | called before any other videobuf function on drivers that uses DMA | 648 | structure by using the container_of macro. Example: |
650 | Scatter/Gather buffers. | 649 | |
651 | 650 | struct my_fh { | |
652 | videobuf_queue_dma_contig_init | 651 | int blah; |
653 | Initializes the videobuf infrastructure. This function should be | 652 | struct v4l2_fh fh; |
654 | called before any other videobuf function on drivers that need DMA | 653 | }; |
655 | contiguous buffers. | 654 | |
656 | 655 | ... | |
657 | videobuf_queue_vmalloc_init() | 656 | |
658 | Initializes the videobuf infrastructure. This function should be | 657 | int my_open(struct file *file) |
659 | called before any other videobuf function on USB (and other drivers) | 658 | { |
660 | that need a vmalloced type of videobuf. | 659 | struct my_fh *my_fh; |
661 | 660 | struct video_device *vfd; | |
662 | - videobuf_iolock() | 661 | int ret; |
663 | Prepares the videobuf memory for the proper method (read, mmap, overlay). | 662 | |
664 | 663 | ... | |
665 | - videobuf_queue_is_busy() | 664 | |
666 | Checks if a videobuf is streaming. | 665 | ret = v4l2_fh_init(&my_fh->fh, vfd); |
667 | 666 | if (ret) | |
668 | - videobuf_queue_cancel() | 667 | return ret; |
669 | Stops video handling. | 668 | |
670 | 669 | v4l2_fh_add(&my_fh->fh); | |
671 | - videobuf_mmap_free() | 670 | |
672 | frees mmap buffers. | 671 | file->private_data = &my_fh->fh; |
673 | 672 | ||
674 | - videobuf_stop() | 673 | ... |
675 | Stops video handling, ends mmap and frees mmap and other buffers. | 674 | } |
676 | 675 | ||
677 | - V4L2 api functions. Those functions correspond to VIDIOC_foo ioctls: | 676 | int my_release(struct file *file) |
678 | videobuf_reqbufs(), videobuf_querybuf(), videobuf_qbuf(), | 677 | { |
679 | videobuf_dqbuf(), videobuf_streamon(), videobuf_streamoff(). | 678 | struct v4l2_fh *fh = file->private_data; |
680 | 679 | struct my_fh *my_fh = container_of(fh, struct my_fh, fh); | |
681 | - V4L1 api function (corresponds to VIDIOCMBUF ioctl): | 680 | |
682 | videobuf_cgmbuf() | 681 | ... |
683 | This function is used to provide backward compatibility with V4L1 | 682 | } |
684 | API. | 683 | |
685 | 684 | V4L2 events | |
686 | - Some help functions for read()/poll() operations: | 685 | ----------- |
687 | videobuf_read_stream() | 686 | |
688 | For continuous stream read() | 687 | The V4L2 events provide a generic way to pass events to user space. |
689 | videobuf_read_one() | 688 | The driver must use v4l2_fh to be able to support V4L2 events. |
690 | For snapshot read() | 689 | |
691 | videobuf_poll_stream() | 690 | Useful functions: |
692 | polling help function | 691 | |
693 | 692 | - v4l2_event_alloc() | |
694 | The better way to understand it is to take a look at vivi driver. One | 693 | |
695 | of the main reasons for vivi is to be a videobuf usage example. the | 694 | To use events, the driver must allocate events for the file handle. By |
696 | vivi_thread_tick() does the task that the IRQ callback would do on PCI | 695 | calling the function more than once, the driver may assure that at least n |
697 | drivers (or the irq callback on USB). | 696 | events in total have been allocated. The function may not be called in |
697 | atomic context. | ||
698 | |||
699 | - v4l2_event_queue() | ||
700 | |||
701 | Queue events to video device. The driver's only responsibility is to fill | ||
702 | in the type and the data fields. The other fields will be filled in by | ||
703 | V4L2. | ||
704 | |||
705 | - v4l2_event_subscribe() | ||
706 | |||
707 | The video_device->ioctl_ops->vidioc_subscribe_event must check the driver | ||
708 | is able to produce events with specified event id. Then it calls | ||
709 | v4l2_event_subscribe() to subscribe the event. | ||
710 | |||
711 | - v4l2_event_unsubscribe() | ||
712 | |||
713 | vidioc_unsubscribe_event in struct v4l2_ioctl_ops. A driver may use | ||
714 | v4l2_event_unsubscribe() directly unless it wants to be involved in | ||
715 | unsubscription process. | ||
716 | |||
717 | The special type V4L2_EVENT_ALL may be used to unsubscribe all events. The | ||
718 | drivers may want to handle this in a special way. | ||
719 | |||
720 | - v4l2_event_pending() | ||
721 | |||
722 | Returns the number of pending events. Useful when implementing poll. | ||
723 | |||
724 | Drivers do not initialise events directly. The events are initialised | ||
725 | through v4l2_fh_init() if video_device->ioctl_ops->vidioc_subscribe_event is | ||
726 | non-NULL. This *MUST* be performed in the driver's | ||
727 | v4l2_file_operations->open() handler. | ||
728 | |||
729 | Events are delivered to user space through the poll system call. The driver | ||
730 | can use v4l2_fh->events->wait wait_queue_head_t as the argument for | ||
731 | poll_wait(). | ||
732 | |||
733 | There are standard and private events. New standard events must use the | ||
734 | smallest available event type. The drivers must allocate their events from | ||
735 | their own class starting from class base. Class base is | ||
736 | V4L2_EVENT_PRIVATE_START + n * 1000 where n is the lowest available number. | ||
737 | The first event type in the class is reserved for future use, so the first | ||
738 | available event type is 'class base + 1'. | ||
739 | |||
740 | An example on how the V4L2 events may be used can be found in the OMAP | ||
741 | 3 ISP driver available at <URL:http://gitorious.org/omap3camera> as of | ||
742 | writing this. | ||
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 @@ | |||
1 | An introduction to the videobuf layer | ||
2 | Jonathan Corbet <corbet@lwn.net> | ||
3 | Current as of 2.6.33 | ||
4 | |||
5 | The videobuf layer functions as a sort of glue layer between a V4L2 driver | ||
6 | and user space. It handles the allocation and management of buffers for | ||
7 | the storage of video frames. There is a set of functions which can be used | ||
8 | to implement many of the standard POSIX I/O system calls, including read(), | ||
9 | poll(), and, happily, mmap(). Another set of functions can be used to | ||
10 | implement the bulk of the V4L2 ioctl() calls related to streaming I/O, | ||
11 | including buffer allocation, queueing and dequeueing, and streaming | ||
12 | control. Using videobuf imposes a few design decisions on the driver | ||
13 | author, but the payback comes in the form of reduced code in the driver and | ||
14 | a consistent implementation of the V4L2 user-space API. | ||
15 | |||
16 | Buffer types | ||
17 | |||
18 | Not all video devices use the same kind of buffers. In fact, there are (at | ||
19 | least) 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 | |||
38 | Videobuf can work with all three types of buffers, but the driver author | ||
39 | must 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 | ||
42 | which are located within the system's video memory. The overlay | ||
43 | functionality is considered to be deprecated for most use, but it still | ||
44 | shows up occasionally in system-on-chip drivers where the performance | ||
45 | benefits merit the use of this technique. Overlay buffers can be handled | ||
46 | as a form of scattered buffer, but there are very few implementations in | ||
47 | the kernel and a description of this technique is currently beyond the | ||
48 | scope of this document.] | ||
49 | |||
50 | Data structures, callbacks, and initialization | ||
51 | |||
52 | Depending on which type of buffers are being used, the driver should | ||
53 | include 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 | |||
59 | The driver's data structure describing a V4L2 device should include a | ||
60 | struct videobuf_queue instance for the management of the buffer queue, | ||
61 | along with a list_head for the queue of available buffers. There will also | ||
62 | need to be an interrupt-safe spinlock which is used to protect (at least) | ||
63 | the queue. | ||
64 | |||
65 | The next step is to write four simple callbacks to help videobuf deal with | ||
66 | the 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 | |||
80 | buf_setup() is called early in the I/O process, when streaming is being | ||
81 | initiated; its purpose is to tell videobuf about the I/O stream. The count | ||
82 | parameter will be a suggested number of buffers to use; the driver should | ||
83 | check it for rationality and adjust it if need be. As a practical rule, a | ||
84 | minimum of two buffers are needed for proper streaming, and there is | ||
85 | usually a maximum (which cannot exceed 32) which makes sense for each | ||
86 | device. The size parameter should be set to the expected (maximum) size | ||
87 | for each frame of data. | ||
88 | |||
89 | Each buffer (in the form of a struct videobuf_buffer pointer) will be | ||
90 | passed to buf_prepare(), which should set the buffer's size, width, height, | ||
91 | and field fields properly. If the buffer's state field is | ||
92 | VIDEOBUF_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 | |||
97 | Among other things, this call will usually allocate memory for the buffer. | ||
98 | Finally, the buf_prepare() function should set the buffer's state to | ||
99 | VIDEOBUF_PREPARED. | ||
100 | |||
101 | When a buffer is queued for I/O, it is passed to buf_queue(), which should | ||
102 | put it onto the driver's list of available buffers and set its state to | ||
103 | VIDEOBUF_QUEUED. Note that this function is called with the queue spinlock | ||
104 | held; if it tries to acquire it as well things will come to a screeching | ||
105 | halt. Yes, this is the voice of experience. Note also that videobuf may | ||
106 | wait on the first buffer in the queue; placing other buffers in front of it | ||
107 | could again gum up the works. So use list_add_tail() to enqueue buffers. | ||
108 | |||
109 | Finally, buf_release() is called when a buffer is no longer intended to be | ||
110 | used. The driver should ensure that there is no I/O active on the buffer, | ||
111 | then 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 | |||
125 | One 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 | |||
129 | Here, vb is the buffer, non_blocking indicates whether non-blocking I/O | ||
130 | should be used (it should be zero in the buf_release() case), and intr | ||
131 | controls whether an interruptible wait is used. | ||
132 | |||
133 | File operations | ||
134 | |||
135 | At this point, much of the work is done; much of the rest is slipping | ||
136 | videobuf calls into the implementation of the other driver callbacks. The | ||
137 | first step is in the open() function, which must initialize the | ||
138 | videobuf 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 | |||
167 | In each case, the parameters are the same: q is the queue structure for the | ||
168 | device, ops is the set of callbacks as described above, dev is the device | ||
169 | structure for this video device, irqlock is an interrupt-safe spinlock to | ||
170 | protect access to the data structures, type is the buffer type used by the | ||
171 | device (cameras will use V4L2_BUF_TYPE_VIDEO_CAPTURE, for example), field | ||
172 | describes which field is being captured (often V4L2_FIELD_NONE for | ||
173 | progressive devices), msize is the size of any containing structure used | ||
174 | around struct videobuf_buffer, and priv is a private data pointer which | ||
175 | shows up in the priv_data field of struct videobuf_queue. Note that these | ||
176 | are void functions which, evidently, are immune to failure. | ||
177 | |||
178 | V4L2 capture drivers can be written to support either of two APIs: the | ||
179 | read() system call and the rather more complicated streaming mechanism. As | ||
180 | a general rule, it is necessary to support both to ensure that all | ||
181 | applications have a chance of working with the device. Videobuf makes it | ||
182 | easy to do that with the same code. To implement read(), the driver need | ||
183 | only 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 | |||
193 | Either one of these functions will read frame data into data, returning the | ||
194 | amount actually read; the difference is that videobuf_read_one() will only | ||
195 | read a single frame, while videobuf_read_stream() will read multiple frames | ||
196 | if they are needed to satisfy the count requested by the application. A | ||
197 | typical driver read() implementation will start the capture engine, call | ||
198 | one of the above functions, then stop the engine before returning (though a | ||
199 | smarter implementation might leave the engine running for a little while in | ||
200 | anticipation of another read() call happening in the near future). | ||
201 | |||
202 | The 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 | |||
208 | Note that the actual wait queue eventually used will be the one associated | ||
209 | with the first available buffer. | ||
210 | |||
211 | When streaming I/O is done to kernel-space buffers, the driver must support | ||
212 | the mmap() system call to enable user space to access the data. In many | ||
213 | V4L2 drivers, the often-complex mmap() implementation simplifies to a | ||
214 | single call to: | ||
215 | |||
216 | int videobuf_mmap_mapper(struct videobuf_queue *q, | ||
217 | struct vm_area_struct *vma); | ||
218 | |||
219 | Everything else is handled by the videobuf code. | ||
220 | |||
221 | The 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 | |||
226 | The call to videobuf_stop() terminates any I/O in progress - though it is | ||
227 | still up to the driver to stop the capture engine. The call to | ||
228 | videobuf_mmap_free() will ensure that all buffers have been unmapped; if | ||
229 | so, they will all be passed to the buf_release() callback. If buffers | ||
230 | remain mapped, videobuf_mmap_free() returns an error code instead. The | ||
231 | purpose is clearly to cause the closing of the file descriptor to fail if | ||
232 | buffers are still mapped, but every driver in the 2.6.32 kernel cheerfully | ||
233 | ignores its return value. | ||
234 | |||
235 | ioctl() operations | ||
236 | |||
237 | The V4L2 API includes a very long list of driver callbacks to respond to | ||
238 | the many ioctl() commands made available to user space. A number of these | ||
239 | - those associated with streaming I/O - turn almost directly into videobuf | ||
240 | calls. 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 | |||
253 | So, for example, a VIDIOC_REQBUFS call turns into a call to the driver's | ||
254 | vidioc_reqbufs() callback which, in turn, usually only needs to locate the | ||
255 | proper struct videobuf_queue pointer and pass it to videobuf_reqbufs(). | ||
256 | These support functions can replace a great deal of buffer management | ||
257 | boilerplate in a lot of V4L2 drivers. | ||
258 | |||
259 | The vidioc_streamon() and vidioc_streamoff() functions will be a bit more | ||
260 | complex, of course, since they will also need to deal with starting and | ||
261 | stopping the capture engine. videobuf_cgmbuf(), called from the driver's | ||
262 | vidiocgmbuf() function, only exists if the V4L1 compatibility module has | ||
263 | been selected with CONFIG_VIDEO_V4L1_COMPAT, so its use must be surrounded | ||
264 | with #ifdef directives. | ||
265 | |||
266 | Buffer allocation | ||
267 | |||
268 | Thus far, we have talked about buffers, but have not looked at how they are | ||
269 | allocated. The scatter/gather case is the most complex on this front. For | ||
270 | allocation, the driver can leave buffer allocation entirely up to the | ||
271 | videobuf layer; in this case, buffers will be allocated as anonymous | ||
272 | user-space pages and will be very scattered indeed. If the application is | ||
273 | using user-space buffers, no allocation is needed; the videobuf layer will | ||
274 | take care of calling get_user_pages() and filling in the scatterlist array. | ||
275 | |||
276 | If the driver needs to do its own memory allocation, it should be done in | ||
277 | the vidioc_reqbufs() function, *after* calling videobuf_reqbufs(). The | ||
278 | first step is a call to: | ||
279 | |||
280 | struct videobuf_dmabuf *videobuf_to_dma(struct videobuf_buffer *buf); | ||
281 | |||
282 | The 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 | |||
288 | The driver must allocate an appropriately-sized scatterlist array and | ||
289 | populate it with pointers to the pieces of the allocated buffer; sglen | ||
290 | should be set to the length of the array. | ||
291 | |||
292 | Drivers using the vmalloc() method need not (and cannot) concern themselves | ||
293 | with buffer allocation at all; videobuf will handle those details. The | ||
294 | same is normally true of contiguous-DMA drivers as well; videobuf will | ||
295 | allocate the buffers (with dma_alloc_coherent()) when it sees fit. That | ||
296 | means that these drivers may be trying to do high-order allocations at any | ||
297 | time, an operation which is not always guaranteed to work. Some drivers | ||
298 | play tricks by allocating DMA space at system boot time; videobuf does not | ||
299 | currently play well with those drivers. | ||
300 | |||
301 | As of 2.6.31, contiguous-DMA drivers can work with a user-supplied buffer, | ||
302 | as long as that buffer is physically contiguous. Normal user-space | ||
303 | allocations will not meet that criterion, but buffers obtained from other | ||
304 | kernel drivers, or those contained within huge pages, will work with these | ||
305 | drivers. | ||
306 | |||
307 | Filling the buffers | ||
308 | |||
309 | The final part of a videobuf implementation has no direct callback - it's | ||
310 | the portion of the code which actually puts frame data into the buffers, | ||
311 | usually in response to interrupts from the device. For all types of | ||
312 | drivers, 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 | |||
321 | Step (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 | ||
323 | the engine and enqueueing buffers are done in separate steps, it's possible | ||
324 | for the engine to be running without any buffers available - in the | ||
325 | vmalloc() case especially. So the driver should be prepared for the list | ||
326 | to be empty. It is equally possible that nobody is yet interested in the | ||
327 | buffer; the driver should not remove it from the list or fill it until a | ||
328 | process is waiting on it. That test can be done by examining the buffer's | ||
329 | done field (a wait_queue_head_t structure) with waitqueue_active(). | ||
330 | |||
331 | A buffer's state should be set to VIDEOBUF_ACTIVE before being mapped for | ||
332 | DMA; that ensures that the videobuf layer will not try to do anything with | ||
333 | it while the device is transferring data. | ||
334 | |||
335 | For scatter/gather drivers, the needed memory pointers will be found in the | ||
336 | scatterlist structure described above. Drivers using the vmalloc() method | ||
337 | can get a memory pointer with: | ||
338 | |||
339 | void *videobuf_to_vmalloc(struct videobuf_buffer *buf); | ||
340 | |||
341 | For contiguous DMA drivers, the function to use is: | ||
342 | |||
343 | dma_addr_t videobuf_to_dma_contig(struct videobuf_buffer *buf); | ||
344 | |||
345 | The contiguous DMA API goes out of its way to hide the kernel-space address | ||
346 | of the DMA buffer from drivers. | ||
347 | |||
348 | The final step is to set the size field of the relevant videobuf_buffer | ||
349 | structure to the actual size of the captured image, set state to | ||
350 | VIDEOBUF_DONE, then call wake_up() on the done queue. At this point, the | ||
351 | buffer is owned by the videobuf layer and the driver should not touch it | ||
352 | again. | ||
353 | |||
354 | Developers who are interested in more information can go into the relevant | ||
355 | header files; there are a few low-level functions declared there which have | ||
356 | not 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 | ||
358 | drivers should be written. Vivi only uses the vmalloc() API, but it's good | ||
359 | enough to get started with. Note also that all of these calls are exported | ||
360 | GPL-only, so they will not be available to non-GPL kernel modules. | ||