]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blob - drivers/media/video/cx88/cx88-cards.c
[PATCH] v4l: cx88 update
[mirror_ubuntu-zesty-kernel.git] / drivers / media / video / cx88 / cx88-cards.c
1 /*
2 * $Id: cx88-cards.c,v 1.82 2005/06/28 04:33:53 mkrufky Exp $
3 *
4 * device driver for Conexant 2388x based TV cards
5 * card-specific stuff.
6 *
7 * (c) 2003 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24 #include <linux/init.h>
25 #include <linux/module.h>
26 #include <linux/pci.h>
27 #include <linux/delay.h>
28
29 #include "cx88.h"
30
31 /* ------------------------------------------------------------------ */
32 /* board config info */
33
34 struct cx88_board cx88_boards[] = {
35 [CX88_BOARD_UNKNOWN] = {
36 .name = "UNKNOWN/GENERIC",
37 .tuner_type = UNSET,
38 .radio_type = UNSET,
39 .tuner_addr = ADDR_UNSET,
40 .radio_addr = ADDR_UNSET,
41 .input = {{
42 .type = CX88_VMUX_COMPOSITE1,
43 .vmux = 0,
44 },{
45 .type = CX88_VMUX_COMPOSITE2,
46 .vmux = 1,
47 },{
48 .type = CX88_VMUX_COMPOSITE3,
49 .vmux = 2,
50 },{
51 .type = CX88_VMUX_COMPOSITE4,
52 .vmux = 3,
53 }},
54 },
55 [CX88_BOARD_HAUPPAUGE] = {
56 .name = "Hauppauge WinTV 34xxx models",
57 .tuner_type = UNSET,
58 .radio_type = UNSET,
59 .tuner_addr = ADDR_UNSET,
60 .radio_addr = ADDR_UNSET,
61 .tda9887_conf = TDA9887_PRESENT,
62 .input = {{
63 .type = CX88_VMUX_TELEVISION,
64 .vmux = 0,
65 .gpio0 = 0xff00, // internal decoder
66 },{
67 .type = CX88_VMUX_DEBUG,
68 .vmux = 0,
69 .gpio0 = 0xff01, // mono from tuner chip
70 },{
71 .type = CX88_VMUX_COMPOSITE1,
72 .vmux = 1,
73 .gpio0 = 0xff02,
74 },{
75 .type = CX88_VMUX_SVIDEO,
76 .vmux = 2,
77 .gpio0 = 0xff02,
78 }},
79 .radio = {
80 .type = CX88_RADIO,
81 .gpio0 = 0xff01,
82 },
83 },
84 [CX88_BOARD_GDI] = {
85 .name = "GDI Black Gold",
86 .tuner_type = UNSET,
87 .radio_type = UNSET,
88 .tuner_addr = ADDR_UNSET,
89 .radio_addr = ADDR_UNSET,
90 .input = {{
91 .type = CX88_VMUX_TELEVISION,
92 .vmux = 0,
93 }},
94 },
95 [CX88_BOARD_PIXELVIEW] = {
96 .name = "PixelView",
97 .tuner_type = TUNER_PHILIPS_PAL,
98 .radio_type = UNSET,
99 .tuner_addr = ADDR_UNSET,
100 .radio_addr = ADDR_UNSET,
101 .input = {{
102 .type = CX88_VMUX_TELEVISION,
103 .vmux = 0,
104 .gpio0 = 0xff00, // internal decoder
105 },{
106 .type = CX88_VMUX_COMPOSITE1,
107 .vmux = 1,
108 },{
109 .type = CX88_VMUX_SVIDEO,
110 .vmux = 2,
111 }},
112 .radio = {
113 .type = CX88_RADIO,
114 .gpio0 = 0xff10,
115 },
116 },
117 [CX88_BOARD_ATI_WONDER_PRO] = {
118 .name = "ATI TV Wonder Pro",
119 .tuner_type = TUNER_PHILIPS_4IN1,
120 .radio_type = UNSET,
121 .tuner_addr = ADDR_UNSET,
122 .radio_addr = ADDR_UNSET,
123 .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER,
124 .input = {{
125 .type = CX88_VMUX_TELEVISION,
126 .vmux = 0,
127 .gpio0 = 0x03ff,
128 },{
129 .type = CX88_VMUX_COMPOSITE1,
130 .vmux = 1,
131 .gpio0 = 0x03fe,
132 },{
133 .type = CX88_VMUX_SVIDEO,
134 .vmux = 2,
135 .gpio0 = 0x03fe,
136 }},
137 },
138 [CX88_BOARD_WINFAST2000XP_EXPERT] = {
139 .name = "Leadtek Winfast 2000XP Expert",
140 .tuner_type = TUNER_PHILIPS_4IN1,
141 .radio_type = UNSET,
142 .tuner_addr = ADDR_UNSET,
143 .radio_addr = ADDR_UNSET,
144 .tda9887_conf = TDA9887_PRESENT,
145 .input = {{
146 .type = CX88_VMUX_TELEVISION,
147 .vmux = 0,
148 .gpio0 = 0x00F5e700,
149 .gpio1 = 0x00003004,
150 .gpio2 = 0x00F5e700,
151 .gpio3 = 0x02000000,
152 },{
153 .type = CX88_VMUX_COMPOSITE1,
154 .vmux = 1,
155 .gpio0 = 0x00F5c700,
156 .gpio1 = 0x00003004,
157 .gpio2 = 0x00F5c700,
158 .gpio3 = 0x02000000,
159 },{
160 .type = CX88_VMUX_SVIDEO,
161 .vmux = 2,
162 .gpio0 = 0x00F5c700,
163 .gpio1 = 0x00003004,
164 .gpio2 = 0x00F5c700,
165 .gpio3 = 0x02000000,
166 }},
167 .radio = {
168 .type = CX88_RADIO,
169 .gpio0 = 0x00F5d700,
170 .gpio1 = 0x00003004,
171 .gpio2 = 0x00F5d700,
172 .gpio3 = 0x02000000,
173 },
174 },
175 [CX88_BOARD_AVERTV_303] = {
176 .name = "AverTV Studio 303 (M126)",
177 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
178 .radio_type = UNSET,
179 .tuner_addr = ADDR_UNSET,
180 .radio_addr = ADDR_UNSET,
181 .tda9887_conf = TDA9887_PRESENT,
182 .input = {{
183 .type = CX88_VMUX_TELEVISION,
184 .vmux = 0,
185 .gpio1 = 0x309f,
186 },{
187 .type = CX88_VMUX_COMPOSITE1,
188 .vmux = 1,
189 .gpio1 = 0x305f,
190 },{
191 .type = CX88_VMUX_SVIDEO,
192 .vmux = 2,
193 .gpio1 = 0x305f,
194 }},
195 .radio = {
196 .type = CX88_RADIO,
197 },
198 },
199 [CX88_BOARD_MSI_TVANYWHERE_MASTER] = {
200 // added gpio values thanks to Michal
201 // values for PAL from DScaler
202 .name = "MSI TV-@nywhere Master",
203 .tuner_type = TUNER_MT2032,
204 .radio_type = UNSET,
205 .tuner_addr = ADDR_UNSET,
206 .radio_addr = ADDR_UNSET,
207 .tda9887_conf = TDA9887_PRESENT,
208 .input = {{
209 .type = CX88_VMUX_TELEVISION,
210 .vmux = 0,
211 .gpio0 = 0x000040bf,
212 .gpio1 = 0x000080c0,
213 .gpio2 = 0x0000ff40,
214 },{
215 .type = CX88_VMUX_COMPOSITE1,
216 .vmux = 1,
217 .gpio0 = 0x000040bf,
218 .gpio1 = 0x000080c0,
219 .gpio2 = 0x0000ff40,
220 },{
221 .type = CX88_VMUX_SVIDEO,
222 .vmux = 2,
223 .gpio0 = 0x000040bf,
224 .gpio1 = 0x000080c0,
225 .gpio2 = 0x0000ff40,
226 }},
227 .radio = {
228 .type = CX88_RADIO,
229 },
230 },
231 [CX88_BOARD_WINFAST_DV2000] = {
232 .name = "Leadtek Winfast DV2000",
233 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
234 .radio_type = UNSET,
235 .tuner_addr = ADDR_UNSET,
236 .radio_addr = ADDR_UNSET,
237 .tda9887_conf = TDA9887_PRESENT,
238 .input = {{
239 .type = CX88_VMUX_TELEVISION,
240 .vmux = 0,
241 .gpio0 = 0x0035e700,
242 .gpio1 = 0x00003004,
243 .gpio2 = 0x0035e700,
244 .gpio3 = 0x02000000,
245 },{
246
247 .type = CX88_VMUX_COMPOSITE1,
248 .vmux = 1,
249 .gpio0 = 0x0035c700,
250 .gpio1 = 0x00003004,
251 .gpio2 = 0x0035c700,
252 .gpio3 = 0x02000000,
253 },{
254 .type = CX88_VMUX_SVIDEO,
255 .vmux = 2,
256 .gpio0 = 0x0035c700,
257 .gpio1 = 0x0035c700,
258 .gpio2 = 0x02000000,
259 .gpio3 = 0x02000000,
260 }},
261 .radio = {
262 .type = CX88_RADIO,
263 .gpio0 = 0x0035d700,
264 .gpio1 = 0x00007004,
265 .gpio2 = 0x0035d700,
266 .gpio3 = 0x02000000,
267 },
268 },
269 [CX88_BOARD_LEADTEK_PVR2000] = {
270 // gpio values for PAL version from regspy by DScaler
271 .name = "Leadtek PVR 2000",
272 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
273 .radio_type = UNSET,
274 .tuner_addr = ADDR_UNSET,
275 .radio_addr = ADDR_UNSET,
276 .tda9887_conf = TDA9887_PRESENT,
277 .input = {{
278 .type = CX88_VMUX_TELEVISION,
279 .vmux = 0,
280 .gpio0 = 0x0000bde2,
281 },{
282 .type = CX88_VMUX_COMPOSITE1,
283 .vmux = 1,
284 .gpio0 = 0x0000bde6,
285 },{
286 .type = CX88_VMUX_SVIDEO,
287 .vmux = 2,
288 .gpio0 = 0x0000bde6,
289 }},
290 .radio = {
291 .type = CX88_RADIO,
292 .gpio0 = 0x0000bd62,
293 },
294 .blackbird = 1,
295 },
296 [CX88_BOARD_IODATA_GVVCP3PCI] = {
297 .name = "IODATA GV-VCP3/PCI",
298 .tuner_type = TUNER_ABSENT,
299 .radio_type = UNSET,
300 .tuner_addr = ADDR_UNSET,
301 .radio_addr = ADDR_UNSET,
302 .input = {{
303 .type = CX88_VMUX_COMPOSITE1,
304 .vmux = 0,
305 },{
306 .type = CX88_VMUX_COMPOSITE2,
307 .vmux = 1,
308 },{
309 .type = CX88_VMUX_SVIDEO,
310 .vmux = 2,
311 }},
312 },
313 [CX88_BOARD_PROLINK_PLAYTVPVR] = {
314 .name = "Prolink PlayTV PVR",
315 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
316 .radio_type = UNSET,
317 .tuner_addr = ADDR_UNSET,
318 .radio_addr = ADDR_UNSET,
319 .tda9887_conf = TDA9887_PRESENT,
320 .input = {{
321 .type = CX88_VMUX_TELEVISION,
322 .vmux = 0,
323 .gpio0 = 0xff00,
324 },{
325 .type = CX88_VMUX_COMPOSITE1,
326 .vmux = 1,
327 .gpio0 = 0xff03,
328 },{
329 .type = CX88_VMUX_SVIDEO,
330 .vmux = 2,
331 .gpio0 = 0xff03,
332 }},
333 .radio = {
334 .type = CX88_RADIO,
335 .gpio0 = 0xff00,
336 },
337 },
338 [CX88_BOARD_ASUS_PVR_416] = {
339 .name = "ASUS PVR-416",
340 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
341 .radio_type = UNSET,
342 .tuner_addr = ADDR_UNSET,
343 .radio_addr = ADDR_UNSET,
344 .tda9887_conf = TDA9887_PRESENT,
345 .input = {{
346 .type = CX88_VMUX_TELEVISION,
347 .vmux = 0,
348 .gpio0 = 0x0000fde6,
349 },{
350 .type = CX88_VMUX_SVIDEO,
351 .vmux = 2,
352 .gpio0 = 0x0000fde6, // 0x0000fda6 L,R RCA audio in?
353 }},
354 .radio = {
355 .type = CX88_RADIO,
356 .gpio0 = 0x0000fde2,
357 },
358 .blackbird = 1,
359 },
360 [CX88_BOARD_MSI_TVANYWHERE] = {
361 .name = "MSI TV-@nywhere",
362 .tuner_type = TUNER_MT2032,
363 .radio_type = UNSET,
364 .tuner_addr = ADDR_UNSET,
365 .radio_addr = ADDR_UNSET,
366 .tda9887_conf = TDA9887_PRESENT,
367 .input = {{
368 .type = CX88_VMUX_TELEVISION,
369 .vmux = 0,
370 .gpio0 = 0x00000fbf,
371 .gpio2 = 0x0000fc08,
372 },{
373 .type = CX88_VMUX_COMPOSITE1,
374 .vmux = 1,
375 .gpio0 = 0x00000fbf,
376 .gpio2 = 0x0000fc68,
377 },{
378 .type = CX88_VMUX_SVIDEO,
379 .vmux = 2,
380 .gpio0 = 0x00000fbf,
381 .gpio2 = 0x0000fc68,
382 }},
383 },
384 [CX88_BOARD_KWORLD_DVB_T] = {
385 .name = "KWorld/VStream XPert DVB-T",
386 .tuner_type = TUNER_ABSENT,
387 .radio_type = UNSET,
388 .tuner_addr = ADDR_UNSET,
389 .radio_addr = ADDR_UNSET,
390 .input = {{
391 .type = CX88_VMUX_COMPOSITE1,
392 .vmux = 1,
393 .gpio0 = 0x0700,
394 .gpio2 = 0x0101,
395 },{
396 .type = CX88_VMUX_SVIDEO,
397 .vmux = 2,
398 .gpio0 = 0x0700,
399 .gpio2 = 0x0101,
400 }},
401 .dvb = 1,
402 },
403 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1] = {
404 .name = "DViCO FusionHDTV DVB-T1",
405 .tuner_type = TUNER_ABSENT, /* No analog tuner */
406 .radio_type = UNSET,
407 .tuner_addr = ADDR_UNSET,
408 .radio_addr = ADDR_UNSET,
409 .input = {{
410 .type = CX88_VMUX_COMPOSITE1,
411 .vmux = 1,
412 .gpio0 = 0x000027df,
413 },{
414 .type = CX88_VMUX_SVIDEO,
415 .vmux = 2,
416 .gpio0 = 0x000027df,
417 }},
418 .dvb = 1,
419 },
420 [CX88_BOARD_KWORLD_LTV883] = {
421 .name = "KWorld LTV883RF",
422 .tuner_type = TUNER_TNF_8831BGFF,
423 .radio_type = UNSET,
424 .tuner_addr = ADDR_UNSET,
425 .radio_addr = ADDR_UNSET,
426 .input = {{
427 .type = CX88_VMUX_TELEVISION,
428 .vmux = 0,
429 .gpio0 = 0x07f8,
430 },{
431 .type = CX88_VMUX_DEBUG,
432 .vmux = 0,
433 .gpio0 = 0x07f9, // mono from tuner chip
434 },{
435 .type = CX88_VMUX_COMPOSITE1,
436 .vmux = 1,
437 .gpio0 = 0x000007fa,
438 },{
439 .type = CX88_VMUX_SVIDEO,
440 .vmux = 2,
441 .gpio0 = 0x000007fa,
442 }},
443 .radio = {
444 .type = CX88_RADIO,
445 .gpio0 = 0x000007f8,
446 },
447 },
448 [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q] = {
449 .name = "DViCO FusionHDTV 3 Gold-Q",
450 .tuner_type = TUNER_MICROTUNE_4042FI5,
451 .radio_type = UNSET,
452 .tuner_addr = ADDR_UNSET,
453 .radio_addr = ADDR_UNSET,
454 /*
455 GPIO[0] resets DT3302 DTV receiver
456 0 - reset asserted
457 1 - normal operation
458 GPIO[1] mutes analog audio output connector
459 0 - enable selected source
460 1 - mute
461 GPIO[2] selects source for analog audio output connector
462 0 - analog audio input connector on tab
463 1 - analog DAC output from CX23881 chip
464 GPIO[3] selects RF input connector on tuner module
465 0 - RF connector labeled CABLE
466 1 - RF connector labeled ANT
467 GPIO[4] selects high RF for QAM256 mode
468 0 - normal RF
469 1 - high RF
470 */
471 .input = {{
472 .type = CX88_VMUX_TELEVISION,
473 .vmux = 0,
474 .gpio0 = 0x0f0d,
475 },{
476 .type = CX88_VMUX_CABLE,
477 .vmux = 0,
478 .gpio0 = 0x0f05,
479 },{
480 .type = CX88_VMUX_COMPOSITE1,
481 .vmux = 1,
482 .gpio0 = 0x0f00,
483 },{
484 .type = CX88_VMUX_SVIDEO,
485 .vmux = 2,
486 .gpio0 = 0x0f00,
487 }},
488 },
489 [CX88_BOARD_HAUPPAUGE_DVB_T1] = {
490 .name = "Hauppauge Nova-T DVB-T",
491 .tuner_type = TUNER_ABSENT,
492 .radio_type = UNSET,
493 .tuner_addr = ADDR_UNSET,
494 .radio_addr = ADDR_UNSET,
495 .input = {{
496 .type = CX88_VMUX_DVB,
497 .vmux = 0,
498 }},
499 .dvb = 1,
500 },
501 [CX88_BOARD_CONEXANT_DVB_T1] = {
502 .name = "Conexant DVB-T reference design",
503 .tuner_type = TUNER_ABSENT,
504 .radio_type = UNSET,
505 .tuner_addr = ADDR_UNSET,
506 .radio_addr = ADDR_UNSET,
507 .input = {{
508 .type = CX88_VMUX_DVB,
509 .vmux = 0,
510 }},
511 .dvb = 1,
512 },
513 [CX88_BOARD_PROVIDEO_PV259] = {
514 .name = "Provideo PV259",
515 .tuner_type = TUNER_PHILIPS_FQ1216ME,
516 .radio_type = UNSET,
517 .tuner_addr = ADDR_UNSET,
518 .radio_addr = ADDR_UNSET,
519 .input = {{
520 .type = CX88_VMUX_TELEVISION,
521 .vmux = 0,
522 }},
523 .blackbird = 1,
524 },
525 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS] = {
526 .name = "DViCO FusionHDTV DVB-T Plus",
527 .tuner_type = TUNER_ABSENT, /* No analog tuner */
528 .radio_type = UNSET,
529 .tuner_addr = ADDR_UNSET,
530 .radio_addr = ADDR_UNSET,
531 .input = {{
532 .type = CX88_VMUX_COMPOSITE1,
533 .vmux = 1,
534 .gpio0 = 0x000027df,
535 },{
536 .type = CX88_VMUX_SVIDEO,
537 .vmux = 2,
538 .gpio0 = 0x000027df,
539 }},
540 .dvb = 1,
541 },
542 [CX88_BOARD_DNTV_LIVE_DVB_T] = {
543 .name = "digitalnow DNTV Live! DVB-T",
544 .tuner_type = TUNER_ABSENT,
545 .radio_type = UNSET,
546 .tuner_addr = ADDR_UNSET,
547 .radio_addr = ADDR_UNSET,
548 .input = {{
549 .type = CX88_VMUX_COMPOSITE1,
550 .vmux = 1,
551 .gpio0 = 0x00000700,
552 .gpio2 = 0x00000101,
553 },{
554 .type = CX88_VMUX_SVIDEO,
555 .vmux = 2,
556 .gpio0 = 0x00000700,
557 .gpio2 = 0x00000101,
558 }},
559 .dvb = 1,
560 },
561 [CX88_BOARD_PCHDTV_HD3000] = {
562 .name = "pcHDTV HD3000 HDTV",
563 .tuner_type = TUNER_THOMSON_DTT7610,
564 .radio_type = UNSET,
565 .tuner_addr = ADDR_UNSET,
566 .radio_addr = ADDR_UNSET,
567 .input = {{
568 .type = CX88_VMUX_TELEVISION,
569 .vmux = 0,
570 .gpio0 = 0x00008484,
571 .gpio1 = 0x00000000,
572 .gpio2 = 0x00000000,
573 .gpio3 = 0x00000000,
574 },{
575 .type = CX88_VMUX_COMPOSITE1,
576 .vmux = 1,
577 .gpio0 = 0x00008400,
578 .gpio1 = 0x00000000,
579 .gpio2 = 0x00000000,
580 .gpio3 = 0x00000000,
581 },{
582 .type = CX88_VMUX_SVIDEO,
583 .vmux = 2,
584 .gpio0 = 0x00008400,
585 .gpio1 = 0x00000000,
586 .gpio2 = 0x00000000,
587 .gpio3 = 0x00000000,
588 }},
589 .radio = {
590 .type = CX88_RADIO,
591 .vmux = 2,
592 .gpio0 = 0x00008400,
593 .gpio1 = 0x00000000,
594 .gpio2 = 0x00000000,
595 .gpio3 = 0x00000000,
596 },
597 .dvb = 1,
598 },
599 [CX88_BOARD_HAUPPAUGE_ROSLYN] = {
600 // entry added by Kaustubh D. Bhalerao <bhalerao.1@osu.edu>
601 // GPIO values obtained from regspy, courtesy Sean Covel
602 .name = "Hauppauge WinTV 28xxx (Roslyn) models",
603 .tuner_type = UNSET,
604 .radio_type = UNSET,
605 .tuner_addr = ADDR_UNSET,
606 .radio_addr = ADDR_UNSET,
607 .input = {{
608 .type = CX88_VMUX_TELEVISION,
609 .vmux = 0,
610 .gpio0 = 0xed12, // internal decoder
611 .gpio2 = 0x00ff,
612 },{
613 .type = CX88_VMUX_DEBUG,
614 .vmux = 0,
615 .gpio0 = 0xff01, // mono from tuner chip
616 },{
617 .type = CX88_VMUX_COMPOSITE1,
618 .vmux = 1,
619 .gpio0 = 0xff02,
620 },{
621 .type = CX88_VMUX_SVIDEO,
622 .vmux = 2,
623 .gpio0 = 0xed92,
624 .gpio2 = 0x00ff,
625 }},
626 .radio = {
627 .type = CX88_RADIO,
628 .gpio0 = 0xed96,
629 .gpio2 = 0x00ff,
630 },
631 .blackbird = 1,
632 },
633 [CX88_BOARD_DIGITALLOGIC_MEC] = {
634 .name = "Digital-Logic MICROSPACE Entertainment Center (MEC)",
635 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
636 .radio_type = UNSET,
637 .tuner_addr = ADDR_UNSET,
638 .radio_addr = ADDR_UNSET,
639 .tda9887_conf = TDA9887_PRESENT,
640 .input = {{
641 .type = CX88_VMUX_TELEVISION,
642 .vmux = 0,
643 .gpio0 = 0x00009d80,
644 },{
645 .type = CX88_VMUX_COMPOSITE1,
646 .vmux = 1,
647 .gpio0 = 0x00009d76,
648 },{
649 .type = CX88_VMUX_SVIDEO,
650 .vmux = 2,
651 .gpio0 = 0x00009d76,
652 }},
653 .radio = {
654 .type = CX88_RADIO,
655 .gpio0 = 0x00009d00,
656 },
657 .blackbird = 1,
658 },
659 [CX88_BOARD_IODATA_GVBCTV7E] = {
660 .name = "IODATA GV/BCTV7E",
661 .tuner_type = TUNER_PHILIPS_FQ1286,
662 .radio_type = UNSET,
663 .tuner_addr = ADDR_UNSET,
664 .radio_addr = ADDR_UNSET,
665 .tda9887_conf = TDA9887_PRESENT,
666 .input = {{
667 .type = CX88_VMUX_TELEVISION,
668 .vmux = 1,
669 .gpio1 = 0x0000e03f,
670 },{
671 .type = CX88_VMUX_COMPOSITE1,
672 .vmux = 2,
673 .gpio1 = 0x0000e07f,
674 },{
675 .type = CX88_VMUX_SVIDEO,
676 .vmux = 3,
677 .gpio1 = 0x0000e07f,
678 }}
679 },
680 [CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO] = {
681 .name = "PixelView PlayTV Ultra Pro (Stereo)",
682 /* May be also TUNER_YMEC_TVF_5533MF for NTSC/M or PAL/M */
683 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
684 .radio_type = TUNER_TEA5767,
685 .tuner_addr = 0xc2>>1,
686 .radio_addr = 0xc0>>1,
687 .input = {{
688 .type = CX88_VMUX_TELEVISION,
689 .vmux = 0,
690 .gpio0 = 0xbf61, /* internal decoder */
691 },{
692 .type = CX88_VMUX_COMPOSITE1,
693 .vmux = 1,
694 .gpio0 = 0xbf63,
695 },{
696 .type = CX88_VMUX_SVIDEO,
697 .vmux = 2,
698 .gpio0 = 0xbf63,
699 }},
700 .radio = {
701 .type = CX88_RADIO,
702 .gpio0 = 0xbf60,
703 },
704 },
705 [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T] = {
706 .name = "DViCO FusionHDTV 3 Gold-T",
707 .tuner_type = TUNER_THOMSON_DTT7611,
708 .radio_type = UNSET,
709 .tuner_addr = ADDR_UNSET,
710 .radio_addr = ADDR_UNSET,
711 /* See DViCO FusionHDTV 3 Gold-Q for GPIO documentation. */
712 .input = {{
713 .type = CX88_VMUX_TELEVISION,
714 .vmux = 0,
715 .gpio0 = 0x0f0d,
716 },{
717 .type = CX88_VMUX_COMPOSITE1,
718 .vmux = 1,
719 .gpio0 = 0x0f00,
720 },{
721 .type = CX88_VMUX_SVIDEO,
722 .vmux = 2,
723 .gpio0 = 0x0f00,
724 }},
725 },
726 [CX88_BOARD_ADSTECH_DVB_T_PCI] = {
727 .name = "ADS Tech Instant TV DVB-T PCI",
728 .tuner_type = TUNER_ABSENT,
729 .radio_type = UNSET,
730 .tuner_addr = ADDR_UNSET,
731 .radio_addr = ADDR_UNSET,
732 .input = {{
733 .type = CX88_VMUX_COMPOSITE1,
734 .vmux = 1,
735 .gpio0 = 0x0700,
736 .gpio2 = 0x0101,
737 },{
738 .type = CX88_VMUX_SVIDEO,
739 .vmux = 2,
740 .gpio0 = 0x0700,
741 .gpio2 = 0x0101,
742 }},
743 .dvb = 1,
744 },
745 };
746 const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards);
747
748 /* ------------------------------------------------------------------ */
749 /* PCI subsystem IDs */
750
751 struct cx88_subid cx88_subids[] = {
752 {
753 .subvendor = 0x0070,
754 .subdevice = 0x3400,
755 .card = CX88_BOARD_HAUPPAUGE,
756 },{
757 .subvendor = 0x0070,
758 .subdevice = 0x3401,
759 .card = CX88_BOARD_HAUPPAUGE,
760 },{
761 .subvendor = 0x14c7,
762 .subdevice = 0x0106,
763 .card = CX88_BOARD_GDI,
764 },{
765 .subvendor = 0x14c7,
766 .subdevice = 0x0107, /* with mpeg encoder */
767 .card = CX88_BOARD_GDI,
768 },{
769 .subvendor = PCI_VENDOR_ID_ATI,
770 .subdevice = 0x00f8,
771 .card = CX88_BOARD_ATI_WONDER_PRO,
772 },{
773 .subvendor = 0x107d,
774 .subdevice = 0x6611,
775 .card = CX88_BOARD_WINFAST2000XP_EXPERT,
776 },{
777 .subvendor = 0x107d,
778 .subdevice = 0x6613, /* NTSC */
779 .card = CX88_BOARD_WINFAST2000XP_EXPERT,
780 },{
781 .subvendor = 0x107d,
782 .subdevice = 0x6620,
783 .card = CX88_BOARD_WINFAST_DV2000,
784 },{
785 .subvendor = 0x107d,
786 .subdevice = 0x663b,
787 .card = CX88_BOARD_LEADTEK_PVR2000,
788 },{
789 .subvendor = 0x107d,
790 .subdevice = 0x663C,
791 .card = CX88_BOARD_LEADTEK_PVR2000,
792 },{
793 .subvendor = 0x1461,
794 .subdevice = 0x000b,
795 .card = CX88_BOARD_AVERTV_303,
796 },{
797 .subvendor = 0x1462,
798 .subdevice = 0x8606,
799 .card = CX88_BOARD_MSI_TVANYWHERE_MASTER,
800 },{
801 .subvendor = 0x10fc,
802 .subdevice = 0xd003,
803 .card = CX88_BOARD_IODATA_GVVCP3PCI,
804 },{
805 .subvendor = 0x1043,
806 .subdevice = 0x4823, /* with mpeg encoder */
807 .card = CX88_BOARD_ASUS_PVR_416,
808 },{
809 .subvendor = 0x17de,
810 .subdevice = 0x08a6,
811 .card = CX88_BOARD_KWORLD_DVB_T,
812 },{
813 .subvendor = 0x18ac,
814 .subdevice = 0xd810,
815 .card = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q,
816 },{
817 .subvendor = 0x18ac,
818 .subdevice = 0xd820,
819 .card = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T,
820 },{
821 .subvendor = 0x18AC,
822 .subdevice = 0xDB00,
823 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1,
824 },{
825 .subvendor = 0x0070,
826 .subdevice = 0x9002,
827 .card = CX88_BOARD_HAUPPAUGE_DVB_T1,
828 },{
829 .subvendor = 0x14f1,
830 .subdevice = 0x0187,
831 .card = CX88_BOARD_CONEXANT_DVB_T1,
832 },{
833 .subvendor = 0x1540,
834 .subdevice = 0x2580,
835 .card = CX88_BOARD_PROVIDEO_PV259,
836 },{
837 .subvendor = 0x18AC,
838 .subdevice = 0xDB10,
839 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS,
840 },{
841 .subvendor = 0x1554,
842 .subdevice = 0x4811,
843 .card = CX88_BOARD_PIXELVIEW,
844 },{
845 .subvendor = 0x7063,
846 .subdevice = 0x3000, /* HD-3000 card */
847 .card = CX88_BOARD_PCHDTV_HD3000,
848 },{
849 .subvendor = 0x17DE,
850 .subdevice = 0xA8A6,
851 .card = CX88_BOARD_DNTV_LIVE_DVB_T,
852 },{
853 .subvendor = 0x0070,
854 .subdevice = 0x2801,
855 .card = CX88_BOARD_HAUPPAUGE_ROSLYN,
856 },{
857 .subvendor = 0x14F1,
858 .subdevice = 0x0342,
859 .card = CX88_BOARD_DIGITALLOGIC_MEC,
860 },{
861 .subvendor = 0x10fc,
862 .subdevice = 0xd035,
863 .card = CX88_BOARD_IODATA_GVBCTV7E,
864 },{
865 .subvendor = 0x1421,
866 .subdevice = 0x0334,
867 .card = CX88_BOARD_ADSTECH_DVB_T_PCI,
868 },
869 };
870 const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids);
871
872 /* ----------------------------------------------------------------------- */
873 /* some leadtek specific stuff */
874
875 static void __devinit leadtek_eeprom(struct cx88_core *core, u8 *eeprom_data)
876 {
877 /* This is just for the "Winfast 2000XP Expert" board ATM; I don't have data on
878 * any others.
879 *
880 * Byte 0 is 1 on the NTSC board.
881 */
882
883 if (eeprom_data[4] != 0x7d ||
884 eeprom_data[5] != 0x10 ||
885 eeprom_data[7] != 0x66) {
886 printk(KERN_WARNING "%s: Leadtek eeprom invalid.\n",
887 core->name);
888 return;
889 }
890
891 core->has_radio = 1;
892 core->tuner_type = (eeprom_data[6] == 0x13) ? 43 : 38;
893
894 printk(KERN_INFO "%s: Leadtek Winfast 2000XP Expert config: "
895 "tuner=%d, eeprom[0]=0x%02x\n",
896 core->name, core->tuner_type, eeprom_data[0]);
897 }
898
899
900 /* ----------------------------------------------------------------------- */
901
902 static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data)
903 {
904 struct tveeprom tv;
905
906 tveeprom_hauppauge_analog(&tv, eeprom_data);
907 core->tuner_type = tv.tuner_type;
908 core->has_radio = tv.has_radio;
909 }
910
911 static int hauppauge_eeprom_dvb(struct cx88_core *core, u8 *ee)
912 {
913 int model;
914 int tuner;
915
916 /* Make sure we support the board model */
917 model = ee[0x1f] << 24 | ee[0x1e] << 16 | ee[0x1d] << 8 | ee[0x1c];
918 switch(model) {
919 case 90002:
920 case 90500:
921 case 90501:
922 /* known */
923 break;
924 default:
925 printk("%s: warning: unknown hauppauge model #%d\n",
926 core->name, model);
927 break;
928 }
929
930 /* Make sure we support the tuner */
931 tuner = ee[0x2d];
932 switch(tuner) {
933 case 0x4B: /* dtt 7595 */
934 case 0x4C: /* dtt 7592 */
935 break;
936 default:
937 printk("%s: error: unknown hauppauge tuner 0x%02x\n",
938 core->name, tuner);
939 return -ENODEV;
940 }
941 printk(KERN_INFO "%s: hauppauge eeprom: model=%d, tuner=%d\n",
942 core->name, model, tuner);
943 return 0;
944 }
945
946 /* ----------------------------------------------------------------------- */
947 /* some GDI (was: Modular Technology) specific stuff */
948
949 static struct {
950 int id;
951 int fm;
952 char *name;
953 } gdi_tuner[] = {
954 [ 0x01 ] = { .id = TUNER_ABSENT,
955 .name = "NTSC_M" },
956 [ 0x02 ] = { .id = TUNER_ABSENT,
957 .name = "PAL_B" },
958 [ 0x03 ] = { .id = TUNER_ABSENT,
959 .name = "PAL_I" },
960 [ 0x04 ] = { .id = TUNER_ABSENT,
961 .name = "PAL_D" },
962 [ 0x05 ] = { .id = TUNER_ABSENT,
963 .name = "SECAM" },
964
965 [ 0x10 ] = { .id = TUNER_ABSENT,
966 .fm = 1,
967 .name = "TEMIC_4049" },
968 [ 0x11 ] = { .id = TUNER_TEMIC_4136FY5,
969 .name = "TEMIC_4136" },
970 [ 0x12 ] = { .id = TUNER_ABSENT,
971 .name = "TEMIC_4146" },
972
973 [ 0x20 ] = { .id = TUNER_PHILIPS_FQ1216ME,
974 .fm = 1,
975 .name = "PHILIPS_FQ1216_MK3" },
976 [ 0x21 ] = { .id = TUNER_ABSENT, .fm = 1,
977 .name = "PHILIPS_FQ1236_MK3" },
978 [ 0x22 ] = { .id = TUNER_ABSENT,
979 .name = "PHILIPS_FI1236_MK3" },
980 [ 0x23 ] = { .id = TUNER_ABSENT,
981 .name = "PHILIPS_FI1216_MK3" },
982 };
983
984 static void gdi_eeprom(struct cx88_core *core, u8 *eeprom_data)
985 {
986 char *name = (eeprom_data[0x0d] < ARRAY_SIZE(gdi_tuner))
987 ? gdi_tuner[eeprom_data[0x0d]].name : NULL;
988
989 printk(KERN_INFO "%s: GDI: tuner=%s\n", core->name,
990 name ? name : "unknown");
991 if (NULL == name)
992 return;
993 core->tuner_type = gdi_tuner[eeprom_data[0x0d]].id;
994 core->has_radio = gdi_tuner[eeprom_data[0x0d]].fm;
995 }
996
997 /* ----------------------------------------------------------------------- */
998
999 void cx88_card_list(struct cx88_core *core, struct pci_dev *pci)
1000 {
1001 int i;
1002
1003 if (0 == pci->subsystem_vendor &&
1004 0 == pci->subsystem_device) {
1005 printk("%s: Your board has no valid PCI Subsystem ID and thus can't\n"
1006 "%s: be autodetected. Please pass card=<n> insmod option to\n"
1007 "%s: workaround that. Redirect complaints to the vendor of\n"
1008 "%s: the TV card. Best regards,\n"
1009 "%s: -- tux\n",
1010 core->name,core->name,core->name,core->name,core->name);
1011 } else {
1012 printk("%s: Your board isn't known (yet) to the driver. You can\n"
1013 "%s: try to pick one of the existing card configs via\n"
1014 "%s: card=<n> insmod option. Updating to the latest\n"
1015 "%s: version might help as well.\n",
1016 core->name,core->name,core->name,core->name);
1017 }
1018 printk("%s: Here is a list of valid choices for the card=<n> insmod option:\n",
1019 core->name);
1020 for (i = 0; i < cx88_bcount; i++)
1021 printk("%s: card=%d -> %s\n",
1022 core->name, i, cx88_boards[i].name);
1023 }
1024
1025 void cx88_card_setup(struct cx88_core *core)
1026 {
1027 static u8 eeprom[128];
1028
1029 if (0 == core->i2c_rc) {
1030 core->i2c_client.addr = 0xa0 >> 1;
1031 tveeprom_read(&core->i2c_client,eeprom,sizeof(eeprom));
1032 }
1033
1034 switch (core->board) {
1035 case CX88_BOARD_HAUPPAUGE:
1036 case CX88_BOARD_HAUPPAUGE_ROSLYN:
1037 if (0 == core->i2c_rc)
1038 hauppauge_eeprom(core,eeprom+8);
1039 break;
1040 case CX88_BOARD_GDI:
1041 if (0 == core->i2c_rc)
1042 gdi_eeprom(core,eeprom);
1043 break;
1044 case CX88_BOARD_WINFAST2000XP_EXPERT:
1045 if (0 == core->i2c_rc)
1046 leadtek_eeprom(core,eeprom);
1047 break;
1048 case CX88_BOARD_HAUPPAUGE_DVB_T1:
1049 if (0 == core->i2c_rc)
1050 hauppauge_eeprom_dvb(core,eeprom);
1051 break;
1052 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1:
1053 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS:
1054 /* GPIO0:0 is hooked to mt352 reset pin */
1055 cx_set(MO_GP0_IO, 0x00000101);
1056 cx_clear(MO_GP0_IO, 0x00000001);
1057 msleep(1);
1058 cx_set(MO_GP0_IO, 0x00000101);
1059 break;
1060 case CX88_BOARD_KWORLD_DVB_T:
1061 case CX88_BOARD_DNTV_LIVE_DVB_T:
1062 cx_set(MO_GP0_IO, 0x00000707);
1063 cx_set(MO_GP2_IO, 0x00000101);
1064 cx_clear(MO_GP2_IO, 0x00000001);
1065 msleep(1);
1066 cx_clear(MO_GP0_IO, 0x00000007);
1067 cx_set(MO_GP2_IO, 0x00000101);
1068 break;
1069 }
1070 if (cx88_boards[core->board].radio.type == CX88_RADIO)
1071 core->has_radio = 1;
1072 }
1073
1074 /* ------------------------------------------------------------------ */
1075
1076 EXPORT_SYMBOL(cx88_boards);
1077 EXPORT_SYMBOL(cx88_bcount);
1078 EXPORT_SYMBOL(cx88_subids);
1079 EXPORT_SYMBOL(cx88_idcount);
1080 EXPORT_SYMBOL(cx88_card_list);
1081 EXPORT_SYMBOL(cx88_card_setup);
1082
1083 /*
1084 * Local variables:
1085 * c-basic-offset: 8
1086 * End:
1087 * kate: eol "unix"; indent-width 3; remove-trailing-space on; replace-trailing-space-save on; tab-width 8; replace-tabs off; space-indent off; mixed-indent off
1088 */