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