]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - drivers/media/video/cx88/cx88-cards.c
Merge commit 'v2.6.31-rc8' into next
[mirror_ubuntu-jammy-kernel.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"
55c88610 29#include "tea5767.h"
1da177e4 30
bbc83597
TP
31static unsigned int tuner[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
32static unsigned int radio[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
33static unsigned int card[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
34
35module_param_array(tuner, int, NULL, 0444);
36module_param_array(radio, int, NULL, 0444);
37module_param_array(card, int, NULL, 0444);
38
39MODULE_PARM_DESC(tuner,"tuner type");
40MODULE_PARM_DESC(radio,"radio tuner type");
41MODULE_PARM_DESC(card,"card type");
42
43static unsigned int latency = UNSET;
44module_param(latency,int,0444);
45MODULE_PARM_DESC(latency,"pci latency timer");
46
0f19e65b
MCC
47#define info_printk(core, fmt, arg...) \
48 printk(KERN_INFO "%s: " fmt, core->name , ## arg)
49
50#define warn_printk(core, fmt, arg...) \
51 printk(KERN_WARNING "%s: " fmt, core->name , ## arg)
52
53#define err_printk(core, fmt, arg...) \
54 printk(KERN_ERR "%s: " fmt, core->name , ## arg)
55
56
1da177e4
LT
57/* ------------------------------------------------------------------ */
58/* board config info */
59
4bf1226a
MCC
60/* If radio_type !=UNSET, radio_addr should be specified
61 */
62
bbc83597 63static const struct cx88_board cx88_boards[] = {
1da177e4
LT
64 [CX88_BOARD_UNKNOWN] = {
65 .name = "UNKNOWN/GENERIC",
66 .tuner_type = UNSET,
b45009b0
MCC
67 .radio_type = UNSET,
68 .tuner_addr = ADDR_UNSET,
69 .radio_addr = ADDR_UNSET,
1da177e4
LT
70 .input = {{
71 .type = CX88_VMUX_COMPOSITE1,
72 .vmux = 0,
73 },{
74 .type = CX88_VMUX_COMPOSITE2,
75 .vmux = 1,
76 },{
77 .type = CX88_VMUX_COMPOSITE3,
78 .vmux = 2,
79 },{
80 .type = CX88_VMUX_COMPOSITE4,
81 .vmux = 3,
82 }},
83 },
84 [CX88_BOARD_HAUPPAUGE] = {
85 .name = "Hauppauge WinTV 34xxx models",
86 .tuner_type = UNSET,
b45009b0
MCC
87 .radio_type = UNSET,
88 .tuner_addr = ADDR_UNSET,
89 .radio_addr = ADDR_UNSET,
1da177e4
LT
90 .tda9887_conf = TDA9887_PRESENT,
91 .input = {{
92 .type = CX88_VMUX_TELEVISION,
93 .vmux = 0,
94 .gpio0 = 0xff00, // internal decoder
95 },{
96 .type = CX88_VMUX_DEBUG,
97 .vmux = 0,
98 .gpio0 = 0xff01, // mono from tuner chip
99 },{
100 .type = CX88_VMUX_COMPOSITE1,
101 .vmux = 1,
102 .gpio0 = 0xff02,
103 },{
104 .type = CX88_VMUX_SVIDEO,
105 .vmux = 2,
106 .gpio0 = 0xff02,
107 }},
108 .radio = {
109 .type = CX88_RADIO,
110 .gpio0 = 0xff01,
111 },
112 },
113 [CX88_BOARD_GDI] = {
114 .name = "GDI Black Gold",
115 .tuner_type = UNSET,
b45009b0
MCC
116 .radio_type = UNSET,
117 .tuner_addr = ADDR_UNSET,
118 .radio_addr = ADDR_UNSET,
1da177e4
LT
119 .input = {{
120 .type = CX88_VMUX_TELEVISION,
121 .vmux = 0,
fd3113e8
MCC
122 },{
123 .type = CX88_VMUX_SVIDEO,
124 .vmux = 2,
1da177e4
LT
125 }},
126 },
127 [CX88_BOARD_PIXELVIEW] = {
128 .name = "PixelView",
b45009b0
MCC
129 .tuner_type = TUNER_PHILIPS_PAL,
130 .radio_type = UNSET,
131 .tuner_addr = ADDR_UNSET,
132 .radio_addr = ADDR_UNSET,
1da177e4
LT
133 .input = {{
134 .type = CX88_VMUX_TELEVISION,
135 .vmux = 0,
136 .gpio0 = 0xff00, // internal decoder
137 },{
138 .type = CX88_VMUX_COMPOSITE1,
139 .vmux = 1,
140 },{
141 .type = CX88_VMUX_SVIDEO,
142 .vmux = 2,
143 }},
144 .radio = {
145 .type = CX88_RADIO,
146 .gpio0 = 0xff10,
47ee2f38 147 },
1da177e4
LT
148 },
149 [CX88_BOARD_ATI_WONDER_PRO] = {
150 .name = "ATI TV Wonder Pro",
b45009b0
MCC
151 .tuner_type = TUNER_PHILIPS_4IN1,
152 .radio_type = UNSET,
153 .tuner_addr = ADDR_UNSET,
154 .radio_addr = ADDR_UNSET,
1da177e4
LT
155 .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER,
156 .input = {{
157 .type = CX88_VMUX_TELEVISION,
158 .vmux = 0,
4ac97914 159 .gpio0 = 0x03ff,
1da177e4
LT
160 },{
161 .type = CX88_VMUX_COMPOSITE1,
162 .vmux = 1,
4ac97914 163 .gpio0 = 0x03fe,
1da177e4
LT
164 },{
165 .type = CX88_VMUX_SVIDEO,
166 .vmux = 2,
4ac97914 167 .gpio0 = 0x03fe,
1da177e4
LT
168 }},
169 },
4ac97914
MCC
170 [CX88_BOARD_WINFAST2000XP_EXPERT] = {
171 .name = "Leadtek Winfast 2000XP Expert",
172 .tuner_type = TUNER_PHILIPS_4IN1,
b45009b0
MCC
173 .radio_type = UNSET,
174 .tuner_addr = ADDR_UNSET,
175 .radio_addr = ADDR_UNSET,
1da177e4 176 .tda9887_conf = TDA9887_PRESENT,
4ac97914
MCC
177 .input = {{
178 .type = CX88_VMUX_TELEVISION,
179 .vmux = 0,
1da177e4
LT
180 .gpio0 = 0x00F5e700,
181 .gpio1 = 0x00003004,
182 .gpio2 = 0x00F5e700,
183 .gpio3 = 0x02000000,
184 },{
185 .type = CX88_VMUX_COMPOSITE1,
186 .vmux = 1,
187 .gpio0 = 0x00F5c700,
188 .gpio1 = 0x00003004,
189 .gpio2 = 0x00F5c700,
190 .gpio3 = 0x02000000,
191 },{
192 .type = CX88_VMUX_SVIDEO,
193 .vmux = 2,
194 .gpio0 = 0x00F5c700,
195 .gpio1 = 0x00003004,
196 .gpio2 = 0x00F5c700,
197 .gpio3 = 0x02000000,
4ac97914
MCC
198 }},
199 .radio = {
200 .type = CX88_RADIO,
1da177e4
LT
201 .gpio0 = 0x00F5d700,
202 .gpio1 = 0x00003004,
203 .gpio2 = 0x00F5d700,
204 .gpio3 = 0x02000000,
4ac97914
MCC
205 },
206 },
7418f346 207 [CX88_BOARD_AVERTV_STUDIO_303] = {
1da177e4 208 .name = "AverTV Studio 303 (M126)",
b45009b0
MCC
209 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
210 .radio_type = UNSET,
211 .tuner_addr = ADDR_UNSET,
212 .radio_addr = ADDR_UNSET,
1da177e4
LT
213 .tda9887_conf = TDA9887_PRESENT,
214 .input = {{
215 .type = CX88_VMUX_TELEVISION,
216 .vmux = 0,
4aca4831 217 .gpio1 = 0xe09f,
1da177e4
LT
218 },{
219 .type = CX88_VMUX_COMPOSITE1,
220 .vmux = 1,
4aca4831 221 .gpio1 = 0xe05f,
1da177e4
LT
222 },{
223 .type = CX88_VMUX_SVIDEO,
224 .vmux = 2,
4aca4831 225 .gpio1 = 0xe05f,
1da177e4
LT
226 }},
227 .radio = {
4aca4831 228 .gpio1 = 0xe0df,
1da177e4
LT
229 .type = CX88_RADIO,
230 },
231 },
232 [CX88_BOARD_MSI_TVANYWHERE_MASTER] = {
233 // added gpio values thanks to Michal
234 // values for PAL from DScaler
235 .name = "MSI TV-@nywhere Master",
b45009b0
MCC
236 .tuner_type = TUNER_MT2032,
237 .radio_type = UNSET,
238 .tuner_addr = ADDR_UNSET,
239 .radio_addr = ADDR_UNSET,
3ae1adc6 240 .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER_NTSC,
1da177e4
LT
241 .input = {{
242 .type = CX88_VMUX_TELEVISION,
243 .vmux = 0,
244 .gpio0 = 0x000040bf,
245 .gpio1 = 0x000080c0,
246 .gpio2 = 0x0000ff40,
247 },{
4ac97914
MCC
248 .type = CX88_VMUX_COMPOSITE1,
249 .vmux = 1,
1da177e4
LT
250 .gpio0 = 0x000040bf,
251 .gpio1 = 0x000080c0,
252 .gpio2 = 0x0000ff40,
253 },{
4ac97914
MCC
254 .type = CX88_VMUX_SVIDEO,
255 .vmux = 2,
1da177e4
LT
256 .gpio0 = 0x000040bf,
257 .gpio1 = 0x000080c0,
258 .gpio2 = 0x0000ff40,
4ac97914
MCC
259 }},
260 .radio = {
1da177e4 261 .type = CX88_RADIO,
55c88610
MCC
262 .vmux = 3,
263 .gpio0 = 0x000040bf,
264 .gpio1 = 0x000080c0,
265 .gpio2 = 0x0000ff20,
4ac97914 266 },
1da177e4
LT
267 },
268 [CX88_BOARD_WINFAST_DV2000] = {
4ac97914
MCC
269 .name = "Leadtek Winfast DV2000",
270 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
b45009b0
MCC
271 .radio_type = UNSET,
272 .tuner_addr = ADDR_UNSET,
273 .radio_addr = ADDR_UNSET,
1da177e4 274 .tda9887_conf = TDA9887_PRESENT,
4ac97914
MCC
275 .input = {{
276 .type = CX88_VMUX_TELEVISION,
277 .vmux = 0,
1da177e4
LT
278 .gpio0 = 0x0035e700,
279 .gpio1 = 0x00003004,
280 .gpio2 = 0x0035e700,
281 .gpio3 = 0x02000000,
282 },{
283
284 .type = CX88_VMUX_COMPOSITE1,
285 .vmux = 1,
286 .gpio0 = 0x0035c700,
287 .gpio1 = 0x00003004,
288 .gpio2 = 0x0035c700,
289 .gpio3 = 0x02000000,
290 },{
291 .type = CX88_VMUX_SVIDEO,
292 .vmux = 2,
293 .gpio0 = 0x0035c700,
294 .gpio1 = 0x0035c700,
295 .gpio2 = 0x02000000,
296 .gpio3 = 0x02000000,
297 }},
4ac97914 298 .radio = {
1da177e4
LT
299 .type = CX88_RADIO,
300 .gpio0 = 0x0035d700,
301 .gpio1 = 0x00007004,
302 .gpio2 = 0x0035d700,
303 .gpio3 = 0x02000000,
47ee2f38 304 },
4ac97914 305 },
b45009b0 306 [CX88_BOARD_LEADTEK_PVR2000] = {
1da177e4 307 // gpio values for PAL version from regspy by DScaler
b45009b0
MCC
308 .name = "Leadtek PVR 2000",
309 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
310 .radio_type = UNSET,
311 .tuner_addr = ADDR_UNSET,
312 .radio_addr = ADDR_UNSET,
1da177e4 313 .tda9887_conf = TDA9887_PRESENT,
b45009b0
MCC
314 .input = {{
315 .type = CX88_VMUX_TELEVISION,
316 .vmux = 0,
317 .gpio0 = 0x0000bde2,
7b27d45b 318 .audioroute = 1,
b45009b0
MCC
319 },{
320 .type = CX88_VMUX_COMPOSITE1,
321 .vmux = 1,
322 .gpio0 = 0x0000bde6,
7b27d45b 323 .audioroute = 1,
b45009b0
MCC
324 },{
325 .type = CX88_VMUX_SVIDEO,
326 .vmux = 2,
327 .gpio0 = 0x0000bde6,
7b27d45b 328 .audioroute = 1,
b45009b0
MCC
329 }},
330 .radio = {
331 .type = CX88_RADIO,
332 .gpio0 = 0x0000bd62,
7b27d45b 333 .audioroute = 1,
b45009b0 334 },
48d5e803 335 .mpeg = CX88_MPEG_BLACKBIRD,
b45009b0 336 },
1da177e4 337 [CX88_BOARD_IODATA_GVVCP3PCI] = {
4ac97914 338 .name = "IODATA GV-VCP3/PCI",
1da177e4 339 .tuner_type = TUNER_ABSENT,
4ac97914 340 .radio_type = UNSET,
b45009b0
MCC
341 .tuner_addr = ADDR_UNSET,
342 .radio_addr = ADDR_UNSET,
343 .input = {{
4ac97914
MCC
344 .type = CX88_VMUX_COMPOSITE1,
345 .vmux = 0,
346 },{
347 .type = CX88_VMUX_COMPOSITE2,
348 .vmux = 1,
349 },{
350 .type = CX88_VMUX_SVIDEO,
351 .vmux = 2,
352 }},
353 },
1da177e4 354 [CX88_BOARD_PROLINK_PLAYTVPVR] = {
4ac97914
MCC
355 .name = "Prolink PlayTV PVR",
356 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
b45009b0
MCC
357 .radio_type = UNSET,
358 .tuner_addr = ADDR_UNSET,
359 .radio_addr = ADDR_UNSET,
1da177e4
LT
360 .tda9887_conf = TDA9887_PRESENT,
361 .input = {{
362 .type = CX88_VMUX_TELEVISION,
363 .vmux = 0,
fc34f165 364 .gpio0 = 0xbff0,
1da177e4
LT
365 },{
366 .type = CX88_VMUX_COMPOSITE1,
367 .vmux = 1,
fc34f165 368 .gpio0 = 0xbff3,
1da177e4
LT
369 },{
370 .type = CX88_VMUX_SVIDEO,
371 .vmux = 2,
fc34f165 372 .gpio0 = 0xbff3,
1da177e4
LT
373 }},
374 .radio = {
375 .type = CX88_RADIO,
fc34f165 376 .gpio0 = 0xbff0,
1da177e4
LT
377 },
378 },
379 [CX88_BOARD_ASUS_PVR_416] = {
380 .name = "ASUS PVR-416",
b45009b0
MCC
381 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
382 .radio_type = UNSET,
383 .tuner_addr = ADDR_UNSET,
384 .radio_addr = ADDR_UNSET,
385 .tda9887_conf = TDA9887_PRESENT,
1da177e4
LT
386 .input = {{
387 .type = CX88_VMUX_TELEVISION,
388 .vmux = 0,
389 .gpio0 = 0x0000fde6,
4ac97914 390 },{
1da177e4
LT
391 .type = CX88_VMUX_SVIDEO,
392 .vmux = 2,
393 .gpio0 = 0x0000fde6, // 0x0000fda6 L,R RCA audio in?
7b27d45b 394 .audioroute = 1,
1da177e4 395 }},
4ac97914
MCC
396 .radio = {
397 .type = CX88_RADIO,
1da177e4 398 .gpio0 = 0x0000fde2,
4ac97914 399 },
48d5e803 400 .mpeg = CX88_MPEG_BLACKBIRD,
1da177e4
LT
401 },
402 [CX88_BOARD_MSI_TVANYWHERE] = {
403 .name = "MSI TV-@nywhere",
b45009b0
MCC
404 .tuner_type = TUNER_MT2032,
405 .radio_type = UNSET,
406 .tuner_addr = ADDR_UNSET,
407 .radio_addr = ADDR_UNSET,
1da177e4
LT
408 .tda9887_conf = TDA9887_PRESENT,
409 .input = {{
410 .type = CX88_VMUX_TELEVISION,
411 .vmux = 0,
412 .gpio0 = 0x00000fbf,
413 .gpio2 = 0x0000fc08,
414 },{
4ac97914
MCC
415 .type = CX88_VMUX_COMPOSITE1,
416 .vmux = 1,
1da177e4
LT
417 .gpio0 = 0x00000fbf,
418 .gpio2 = 0x0000fc68,
419 },{
4ac97914
MCC
420 .type = CX88_VMUX_SVIDEO,
421 .vmux = 2,
1da177e4
LT
422 .gpio0 = 0x00000fbf,
423 .gpio2 = 0x0000fc68,
4ac97914 424 }},
1da177e4 425 },
4ac97914
MCC
426 [CX88_BOARD_KWORLD_DVB_T] = {
427 .name = "KWorld/VStream XPert DVB-T",
1da177e4 428 .tuner_type = TUNER_ABSENT,
b45009b0
MCC
429 .radio_type = UNSET,
430 .tuner_addr = ADDR_UNSET,
431 .radio_addr = ADDR_UNSET,
4ac97914
MCC
432 .input = {{
433 .type = CX88_VMUX_COMPOSITE1,
434 .vmux = 1,
1da177e4
LT
435 .gpio0 = 0x0700,
436 .gpio2 = 0x0101,
4ac97914
MCC
437 },{
438 .type = CX88_VMUX_SVIDEO,
439 .vmux = 2,
1da177e4
LT
440 .gpio0 = 0x0700,
441 .gpio2 = 0x0101,
4ac97914 442 }},
48d5e803 443 .mpeg = CX88_MPEG_DVB,
1da177e4
LT
444 },
445 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1] = {
a82decf6 446 .name = "DViCO FusionHDTV DVB-T1",
1da177e4 447 .tuner_type = TUNER_ABSENT, /* No analog tuner */
b45009b0
MCC
448 .radio_type = UNSET,
449 .tuner_addr = ADDR_UNSET,
450 .radio_addr = ADDR_UNSET,
1da177e4
LT
451 .input = {{
452 .type = CX88_VMUX_COMPOSITE1,
453 .vmux = 1,
454 .gpio0 = 0x000027df,
47ee2f38 455 },{
1da177e4
LT
456 .type = CX88_VMUX_SVIDEO,
457 .vmux = 2,
458 .gpio0 = 0x000027df,
459 }},
48d5e803 460 .mpeg = CX88_MPEG_DVB,
1da177e4
LT
461 },
462 [CX88_BOARD_KWORLD_LTV883] = {
463 .name = "KWorld LTV883RF",
b45009b0
MCC
464 .tuner_type = TUNER_TNF_8831BGFF,
465 .radio_type = UNSET,
466 .tuner_addr = ADDR_UNSET,
467 .radio_addr = ADDR_UNSET,
4ac97914
MCC
468 .input = {{
469 .type = CX88_VMUX_TELEVISION,
470 .vmux = 0,
471 .gpio0 = 0x07f8,
1da177e4
LT
472 },{
473 .type = CX88_VMUX_DEBUG,
474 .vmux = 0,
475 .gpio0 = 0x07f9, // mono from tuner chip
4ac97914
MCC
476 },{
477 .type = CX88_VMUX_COMPOSITE1,
478 .vmux = 1,
479 .gpio0 = 0x000007fa,
480 },{
481 .type = CX88_VMUX_SVIDEO,
482 .vmux = 2,
483 .gpio0 = 0x000007fa,
484 }},
485 .radio = {
486 .type = CX88_RADIO,
487 .gpio0 = 0x000007f8,
488 },
1da177e4 489 },
a82decf6
MCC
490 [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q] = {
491 .name = "DViCO FusionHDTV 3 Gold-Q",
1da177e4 492 .tuner_type = TUNER_MICROTUNE_4042FI5,
b45009b0
MCC
493 .radio_type = UNSET,
494 .tuner_addr = ADDR_UNSET,
495 .radio_addr = ADDR_UNSET,
1da177e4
LT
496 /*
497 GPIO[0] resets DT3302 DTV receiver
498 0 - reset asserted
499 1 - normal operation
500 GPIO[1] mutes analog audio output connector
501 0 - enable selected source
502 1 - mute
503 GPIO[2] selects source for analog audio output connector
504 0 - analog audio input connector on tab
505 1 - analog DAC output from CX23881 chip
506 GPIO[3] selects RF input connector on tuner module
507 0 - RF connector labeled CABLE
508 1 - RF connector labeled ANT
a82decf6
MCC
509 GPIO[4] selects high RF for QAM256 mode
510 0 - normal RF
511 1 - high RF
1da177e4
LT
512 */
513 .input = {{
514 .type = CX88_VMUX_TELEVISION,
515 .vmux = 0,
516 .gpio0 = 0x0f0d,
517 },{
518 .type = CX88_VMUX_CABLE,
519 .vmux = 0,
520 .gpio0 = 0x0f05,
521 },{
522 .type = CX88_VMUX_COMPOSITE1,
523 .vmux = 1,
524 .gpio0 = 0x0f00,
525 },{
526 .type = CX88_VMUX_SVIDEO,
527 .vmux = 2,
528 .gpio0 = 0x0f00,
529 }},
48d5e803 530 .mpeg = CX88_MPEG_DVB,
1da177e4 531 },
4ac97914 532 [CX88_BOARD_HAUPPAUGE_DVB_T1] = {
b45009b0 533 .name = "Hauppauge Nova-T DVB-T",
1da177e4 534 .tuner_type = TUNER_ABSENT,
b45009b0
MCC
535 .radio_type = UNSET,
536 .tuner_addr = ADDR_UNSET,
537 .radio_addr = ADDR_UNSET,
538 .input = {{
4ac97914
MCC
539 .type = CX88_VMUX_DVB,
540 .vmux = 0,
541 }},
48d5e803 542 .mpeg = CX88_MPEG_DVB,
1da177e4 543 },
4ac97914 544 [CX88_BOARD_CONEXANT_DVB_T1] = {
1da177e4
LT
545 .name = "Conexant DVB-T reference design",
546 .tuner_type = TUNER_ABSENT,
b45009b0
MCC
547 .radio_type = UNSET,
548 .tuner_addr = ADDR_UNSET,
549 .radio_addr = ADDR_UNSET,
4ac97914
MCC
550 .input = {{
551 .type = CX88_VMUX_DVB,
552 .vmux = 0,
553 }},
48d5e803 554 .mpeg = CX88_MPEG_DVB,
1da177e4
LT
555 },
556 [CX88_BOARD_PROVIDEO_PV259] = {
557 .name = "Provideo PV259",
558 .tuner_type = TUNER_PHILIPS_FQ1216ME,
b45009b0
MCC
559 .radio_type = UNSET,
560 .tuner_addr = ADDR_UNSET,
561 .radio_addr = ADDR_UNSET,
1da177e4
LT
562 .input = {{
563 .type = CX88_VMUX_TELEVISION,
564 .vmux = 0,
7b27d45b 565 .audioroute = 1,
1da177e4 566 }},
48d5e803 567 .mpeg = CX88_MPEG_BLACKBIRD,
1da177e4
LT
568 },
569 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS] = {
a82decf6 570 .name = "DViCO FusionHDTV DVB-T Plus",
1da177e4 571 .tuner_type = TUNER_ABSENT, /* No analog tuner */
b45009b0
MCC
572 .radio_type = UNSET,
573 .tuner_addr = ADDR_UNSET,
574 .radio_addr = ADDR_UNSET,
1da177e4
LT
575 .input = {{
576 .type = CX88_VMUX_COMPOSITE1,
577 .vmux = 1,
578 .gpio0 = 0x000027df,
47ee2f38 579 },{
1da177e4
LT
580 .type = CX88_VMUX_SVIDEO,
581 .vmux = 2,
582 .gpio0 = 0x000027df,
583 }},
48d5e803 584 .mpeg = CX88_MPEG_DVB,
1da177e4
LT
585 },
586 [CX88_BOARD_DNTV_LIVE_DVB_T] = {
4ac97914 587 .name = "digitalnow DNTV Live! DVB-T",
1da177e4 588 .tuner_type = TUNER_ABSENT,
b45009b0
MCC
589 .radio_type = UNSET,
590 .tuner_addr = ADDR_UNSET,
591 .radio_addr = ADDR_UNSET,
4ac97914 592 .input = {{
1da177e4
LT
593 .type = CX88_VMUX_COMPOSITE1,
594 .vmux = 1,
595 .gpio0 = 0x00000700,
596 .gpio2 = 0x00000101,
597 },{
598 .type = CX88_VMUX_SVIDEO,
599 .vmux = 2,
600 .gpio0 = 0x00000700,
601 .gpio2 = 0x00000101,
602 }},
48d5e803 603 .mpeg = CX88_MPEG_DVB,
1da177e4
LT
604 },
605 [CX88_BOARD_PCHDTV_HD3000] = {
606 .name = "pcHDTV HD3000 HDTV",
9175b854 607 .tuner_type = TUNER_THOMSON_DTT761X,
b45009b0
MCC
608 .radio_type = UNSET,
609 .tuner_addr = ADDR_UNSET,
610 .radio_addr = ADDR_UNSET,
e4f5c82a 611 .tda9887_conf = TDA9887_PRESENT,
19dc74b7
TP
612 /* GPIO[2] = audio source for analog audio out connector
613 * 0 = analog audio input connector
614 * 1 = CX88 audio DACs
615 *
616 * GPIO[7] = input to CX88's audio/chroma ADC
617 * 0 = FM 10.7 MHz IF
618 * 1 = Sound 4.5 MHz IF
619 *
620 * GPIO[1,5,6] = Oren 51132 pins 27,35,28 respectively
621 *
622 * GPIO[16] = Remote control input
623 */
1da177e4
LT
624 .input = {{
625 .type = CX88_VMUX_TELEVISION,
626 .vmux = 0,
627 .gpio0 = 0x00008484,
1da177e4
LT
628 },{
629 .type = CX88_VMUX_COMPOSITE1,
630 .vmux = 1,
631 .gpio0 = 0x00008400,
1da177e4
LT
632 },{
633 .type = CX88_VMUX_SVIDEO,
634 .vmux = 2,
635 .gpio0 = 0x00008400,
1da177e4
LT
636 }},
637 .radio = {
638 .type = CX88_RADIO,
19dc74b7 639 .gpio0 = 0x00008404,
1da177e4 640 },
48d5e803 641 .mpeg = CX88_MPEG_DVB,
1da177e4
LT
642 },
643 [CX88_BOARD_HAUPPAUGE_ROSLYN] = {
644 // entry added by Kaustubh D. Bhalerao <bhalerao.1@osu.edu>
645 // GPIO values obtained from regspy, courtesy Sean Covel
b45009b0
MCC
646 .name = "Hauppauge WinTV 28xxx (Roslyn) models",
647 .tuner_type = UNSET,
648 .radio_type = UNSET,
649 .tuner_addr = ADDR_UNSET,
650 .radio_addr = ADDR_UNSET,
1da177e4
LT
651 .input = {{
652 .type = CX88_VMUX_TELEVISION,
653 .vmux = 0,
0345c387 654 .gpio0 = 0xed1a,
1da177e4
LT
655 .gpio2 = 0x00ff,
656 },{
657 .type = CX88_VMUX_DEBUG,
658 .vmux = 0,
0345c387 659 .gpio0 = 0xff01,
1da177e4
LT
660 },{
661 .type = CX88_VMUX_COMPOSITE1,
662 .vmux = 1,
663 .gpio0 = 0xff02,
664 },{
665 .type = CX88_VMUX_SVIDEO,
666 .vmux = 2,
667 .gpio0 = 0xed92,
668 .gpio2 = 0x00ff,
669 }},
670 .radio = {
671 .type = CX88_RADIO,
672 .gpio0 = 0xed96,
673 .gpio2 = 0x00ff,
674 },
48d5e803 675 .mpeg = CX88_MPEG_BLACKBIRD,
1da177e4
LT
676 },
677 [CX88_BOARD_DIGITALLOGIC_MEC] = {
1da177e4 678 .name = "Digital-Logic MICROSPACE Entertainment Center (MEC)",
b45009b0
MCC
679 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
680 .radio_type = UNSET,
681 .tuner_addr = ADDR_UNSET,
682 .radio_addr = ADDR_UNSET,
1da177e4
LT
683 .tda9887_conf = TDA9887_PRESENT,
684 .input = {{
685 .type = CX88_VMUX_TELEVISION,
686 .vmux = 0,
b45009b0 687 .gpio0 = 0x00009d80,
7b27d45b 688 .audioroute = 1,
1da177e4
LT
689 },{
690 .type = CX88_VMUX_COMPOSITE1,
691 .vmux = 1,
b45009b0 692 .gpio0 = 0x00009d76,
7b27d45b 693 .audioroute = 1,
1da177e4
LT
694 },{
695 .type = CX88_VMUX_SVIDEO,
696 .vmux = 2,
b45009b0 697 .gpio0 = 0x00009d76,
7b27d45b 698 .audioroute = 1,
1da177e4
LT
699 }},
700 .radio = {
701 .type = CX88_RADIO,
b45009b0 702 .gpio0 = 0x00009d00,
7b27d45b 703 .audioroute = 1,
1da177e4 704 },
48d5e803 705 .mpeg = CX88_MPEG_BLACKBIRD,
1da177e4
LT
706 },
707 [CX88_BOARD_IODATA_GVBCTV7E] = {
708 .name = "IODATA GV/BCTV7E",
709 .tuner_type = TUNER_PHILIPS_FQ1286,
b45009b0
MCC
710 .radio_type = UNSET,
711 .tuner_addr = ADDR_UNSET,
712 .radio_addr = ADDR_UNSET,
1da177e4
LT
713 .tda9887_conf = TDA9887_PRESENT,
714 .input = {{
715 .type = CX88_VMUX_TELEVISION,
716 .vmux = 1,
717 .gpio1 = 0x0000e03f,
718 },{
719 .type = CX88_VMUX_COMPOSITE1,
720 .vmux = 2,
721 .gpio1 = 0x0000e07f,
722 },{
723 .type = CX88_VMUX_SVIDEO,
724 .vmux = 3,
725 .gpio1 = 0x0000e07f,
726 }}
727 },
239df2e2
MC
728 [CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO] = {
729 .name = "PixelView PlayTV Ultra Pro (Stereo)",
b45009b0
MCC
730 /* May be also TUNER_YMEC_TVF_5533MF for NTSC/M or PAL/M */
731 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
c5287ba1
MCC
732 .radio_type = UNSET,
733 .tuner_addr = ADDR_UNSET,
734 .radio_addr = ADDR_UNSET,
b8341e1d
HV
735 /* Some variants use a tda9874 and so need the tvaudio module. */
736 .audio_chip = V4L2_IDENT_TVAUDIO,
239df2e2
MC
737 .input = {{
738 .type = CX88_VMUX_TELEVISION,
739 .vmux = 0,
b45009b0 740 .gpio0 = 0xbf61, /* internal decoder */
239df2e2
MC
741 },{
742 .type = CX88_VMUX_COMPOSITE1,
743 .vmux = 1,
b45009b0 744 .gpio0 = 0xbf63,
239df2e2
MC
745 },{
746 .type = CX88_VMUX_SVIDEO,
747 .vmux = 2,
b45009b0 748 .gpio0 = 0xbf63,
239df2e2
MC
749 }},
750 .radio = {
b45009b0
MCC
751 .type = CX88_RADIO,
752 .gpio0 = 0xbf60,
753 },
239df2e2 754 },
4ac97914 755 [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T] = {
a82decf6 756 .name = "DViCO FusionHDTV 3 Gold-T",
83ac8722 757 .tuner_type = TUNER_THOMSON_DTT761X,
b45009b0
MCC
758 .radio_type = UNSET,
759 .tuner_addr = ADDR_UNSET,
760 .radio_addr = ADDR_UNSET,
e4f5c82a 761 .tda9887_conf = TDA9887_PRESENT,
a82decf6 762 .input = {{
4ac97914
MCC
763 .type = CX88_VMUX_TELEVISION,
764 .vmux = 0,
765 .gpio0 = 0x97ed,
766 },{
767 .type = CX88_VMUX_COMPOSITE1,
768 .vmux = 1,
769 .gpio0 = 0x97e9,
770 },{
771 .type = CX88_VMUX_SVIDEO,
772 .vmux = 2,
773 .gpio0 = 0x97e9,
774 }},
48d5e803 775 .mpeg = CX88_MPEG_DVB,
4ac97914
MCC
776 },
777 [CX88_BOARD_ADSTECH_DVB_T_PCI] = {
778 .name = "ADS Tech Instant TV DVB-T PCI",
a82decf6
MCC
779 .tuner_type = TUNER_ABSENT,
780 .radio_type = UNSET,
781 .tuner_addr = ADDR_UNSET,
782 .radio_addr = ADDR_UNSET,
783 .input = {{
4ac97914
MCC
784 .type = CX88_VMUX_COMPOSITE1,
785 .vmux = 1,
a82decf6
MCC
786 .gpio0 = 0x0700,
787 .gpio2 = 0x0101,
4ac97914
MCC
788 },{
789 .type = CX88_VMUX_SVIDEO,
790 .vmux = 2,
a82decf6
MCC
791 .gpio0 = 0x0700,
792 .gpio2 = 0x0101,
4ac97914 793 }},
48d5e803 794 .mpeg = CX88_MPEG_DVB,
a82decf6 795 },
e057ee11
MK
796 [CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1] = {
797 .name = "TerraTec Cinergy 1400 DVB-T",
798 .tuner_type = TUNER_ABSENT,
799 .input = {{
800 .type = CX88_VMUX_DVB,
801 .vmux = 0,
05eda249
HB
802 },{
803 .type = CX88_VMUX_COMPOSITE1,
804 .vmux = 2,
805 },{
806 .type = CX88_VMUX_SVIDEO,
807 .vmux = 2,
e057ee11 808 }},
48d5e803 809 .mpeg = CX88_MPEG_DVB,
e057ee11 810 },
9fef07ca
MK
811 [CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD] = {
812 .name = "DViCO FusionHDTV 5 Gold",
9c26c8b1 813 .tuner_type = TUNER_LG_TDVS_H06XF, /* TDVS-H062F */
9fef07ca
MK
814 .radio_type = UNSET,
815 .tuner_addr = ADDR_UNSET,
816 .radio_addr = ADDR_UNSET,
e52e98a7 817 .tda9887_conf = TDA9887_PRESENT,
9fef07ca 818 .input = {{
4ac97914
MCC
819 .type = CX88_VMUX_TELEVISION,
820 .vmux = 0,
821 .gpio0 = 0x87fd,
822 },{
823 .type = CX88_VMUX_COMPOSITE1,
824 .vmux = 1,
825 .gpio0 = 0x87f9,
826 },{
827 .type = CX88_VMUX_SVIDEO,
828 .vmux = 2,
829 .gpio0 = 0x87f9,
830 }},
48d5e803 831 .mpeg = CX88_MPEG_DVB,
9fef07ca 832 },
d45170ed
NS
833 [CX88_BOARD_AVERMEDIA_ULTRATV_MC_550] = {
834 .name = "AverMedia UltraTV Media Center PCI 550",
835 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
836 .radio_type = UNSET,
837 .tuner_addr = ADDR_UNSET,
838 .radio_addr = ADDR_UNSET,
839 .tda9887_conf = TDA9887_PRESENT,
d45170ed
NS
840 .input = {{
841 .type = CX88_VMUX_COMPOSITE1,
842 .vmux = 0,
843 .gpio0 = 0x0000cd73,
7b27d45b 844 .audioroute = 1,
d45170ed
NS
845 },{
846 .type = CX88_VMUX_SVIDEO,
847 .vmux = 1,
848 .gpio0 = 0x0000cd73,
7b27d45b 849 .audioroute = 1,
d45170ed
NS
850 },{
851 .type = CX88_VMUX_TELEVISION,
852 .vmux = 3,
853 .gpio0 = 0x0000cdb3,
7b27d45b 854 .audioroute = 1,
d45170ed
NS
855 }},
856 .radio = {
857 .type = CX88_RADIO,
858 .vmux = 2,
859 .gpio0 = 0x0000cdf3,
7b27d45b 860 .audioroute = 1,
d45170ed 861 },
5b26c82f 862 .mpeg = CX88_MPEG_BLACKBIRD,
d45170ed 863 },
0bcc37c3
AW
864 [CX88_BOARD_KWORLD_VSTREAM_EXPERT_DVD] = {
865 /* Alexander Wold <awold@bigfoot.com> */
4ac97914
MCC
866 .name = "Kworld V-Stream Xpert DVD",
867 .tuner_type = UNSET,
868 .input = {{
869 .type = CX88_VMUX_COMPOSITE1,
870 .vmux = 1,
871 .gpio0 = 0x03000000,
0bcc37c3
AW
872 .gpio1 = 0x01000000,
873 .gpio2 = 0x02000000,
874 .gpio3 = 0x00100000,
4ac97914
MCC
875 },{
876 .type = CX88_VMUX_SVIDEO,
877 .vmux = 2,
878 .gpio0 = 0x03000000,
879 .gpio1 = 0x01000000,
880 .gpio2 = 0x02000000,
881 .gpio3 = 0x00100000,
882 }},
0bcc37c3 883 },
e976f937
KL
884 [CX88_BOARD_ATI_HDTVWONDER] = {
885 .name = "ATI HDTV Wonder",
886 .tuner_type = TUNER_PHILIPS_TUV1236D,
887 .radio_type = UNSET,
888 .tuner_addr = ADDR_UNSET,
889 .radio_addr = ADDR_UNSET,
890 .input = {{
891 .type = CX88_VMUX_TELEVISION,
892 .vmux = 0,
893 .gpio0 = 0x00000ff7,
894 .gpio1 = 0x000000ff,
895 .gpio2 = 0x00000001,
896 .gpio3 = 0x00000000,
897 },{
898 .type = CX88_VMUX_COMPOSITE1,
899 .vmux = 1,
900 .gpio0 = 0x00000ffe,
901 .gpio1 = 0x000000ff,
902 .gpio2 = 0x00000001,
903 .gpio3 = 0x00000000,
904 },{
905 .type = CX88_VMUX_SVIDEO,
906 .vmux = 2,
907 .gpio0 = 0x00000ffe,
908 .gpio1 = 0x000000ff,
909 .gpio2 = 0x00000001,
910 .gpio3 = 0x00000000,
911 }},
48d5e803 912 .mpeg = CX88_MPEG_DVB,
e976f937 913 },
2b5200a7
DS
914 [CX88_BOARD_WINFAST_DTV1000] = {
915 .name = "WinFast DTV1000-T",
916 .tuner_type = TUNER_ABSENT,
917 .radio_type = UNSET,
918 .tuner_addr = ADDR_UNSET,
919 .radio_addr = ADDR_UNSET,
920 .input = {{
921 .type = CX88_VMUX_DVB,
922 .vmux = 0,
e8f4e752
JD
923 },{
924 .type = CX88_VMUX_COMPOSITE1,
925 .vmux = 1,
926 },{
927 .type = CX88_VMUX_SVIDEO,
928 .vmux = 2,
2b5200a7 929 }},
48d5e803 930 .mpeg = CX88_MPEG_DVB,
2b5200a7 931 },
7418f346
LB
932 [CX88_BOARD_AVERTV_303] = {
933 .name = "AVerTV 303 (M126)",
934 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
935 .radio_type = UNSET,
936 .tuner_addr = ADDR_UNSET,
937 .radio_addr = ADDR_UNSET,
938 .tda9887_conf = TDA9887_PRESENT,
939 .input = {{
940 .type = CX88_VMUX_TELEVISION,
941 .vmux = 0,
942 .gpio0 = 0x00ff,
943 .gpio1 = 0xe09f,
944 .gpio2 = 0x0010,
945 .gpio3 = 0x0000,
946 },{
947 .type = CX88_VMUX_COMPOSITE1,
948 .vmux = 1,
949 .gpio0 = 0x00ff,
950 .gpio1 = 0xe05f,
951 .gpio2 = 0x0010,
952 .gpio3 = 0x0000,
953 },{
954 .type = CX88_VMUX_SVIDEO,
955 .vmux = 2,
956 .gpio0 = 0x00ff,
957 .gpio1 = 0xe05f,
958 .gpio2 = 0x0010,
959 .gpio3 = 0x0000,
960 }},
961 },
0fa14aa6
ST
962 [CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1] = {
963 .name = "Hauppauge Nova-S-Plus DVB-S",
964 .tuner_type = TUNER_ABSENT,
965 .radio_type = UNSET,
966 .tuner_addr = ADDR_UNSET,
967 .radio_addr = ADDR_UNSET,
0fa14aa6
ST
968 .input = {{
969 .type = CX88_VMUX_DVB,
970 .vmux = 0,
971 },{
972 .type = CX88_VMUX_COMPOSITE1,
973 .vmux = 1,
974 },{
975 .type = CX88_VMUX_SVIDEO,
976 .vmux = 2,
977 }},
48d5e803 978 .mpeg = CX88_MPEG_DVB,
0fa14aa6
ST
979 },
980 [CX88_BOARD_HAUPPAUGE_NOVASE2_S1] = {
981 .name = "Hauppauge Nova-SE2 DVB-S",
982 .tuner_type = TUNER_ABSENT,
983 .radio_type = UNSET,
984 .tuner_addr = ADDR_UNSET,
985 .radio_addr = ADDR_UNSET,
986 .input = {{
987 .type = CX88_VMUX_DVB,
988 .vmux = 0,
989 }},
48d5e803 990 .mpeg = CX88_MPEG_DVB,
0fa14aa6 991 },
0e0351e3
VC
992 [CX88_BOARD_KWORLD_DVBS_100] = {
993 .name = "KWorld DVB-S 100",
994 .tuner_type = TUNER_ABSENT,
995 .radio_type = UNSET,
996 .tuner_addr = ADDR_UNSET,
997 .radio_addr = ADDR_UNSET,
998 .input = {{
999 .type = CX88_VMUX_DVB,
1000 .vmux = 0,
1001 },{
1002 .type = CX88_VMUX_COMPOSITE1,
1003 .vmux = 1,
1004 },{
1005 .type = CX88_VMUX_SVIDEO,
1006 .vmux = 2,
1007 }},
48d5e803 1008 .mpeg = CX88_MPEG_DVB,
0e0351e3 1009 },
611900c1
ST
1010 [CX88_BOARD_HAUPPAUGE_HVR1100] = {
1011 .name = "Hauppauge WinTV-HVR1100 DVB-T/Hybrid",
1012 .tuner_type = TUNER_PHILIPS_FMD1216ME_MK3,
1013 .radio_type = UNSET,
1014 .tuner_addr = ADDR_UNSET,
1015 .radio_addr = ADDR_UNSET,
1016 .tda9887_conf = TDA9887_PRESENT,
1017 .input = {{
1018 .type = CX88_VMUX_TELEVISION,
1019 .vmux = 0,
1020 },{
1021 .type = CX88_VMUX_COMPOSITE1,
1022 .vmux = 1,
1023 },{
1024 .type = CX88_VMUX_SVIDEO,
1025 .vmux = 2,
1026 }},
1027 /* fixme: Add radio support */
48d5e803 1028 .mpeg = CX88_MPEG_DVB,
611900c1
ST
1029 },
1030 [CX88_BOARD_HAUPPAUGE_HVR1100LP] = {
1031 .name = "Hauppauge WinTV-HVR1100 DVB-T/Hybrid (Low Profile)",
1032 .tuner_type = TUNER_PHILIPS_FMD1216ME_MK3,
1033 .radio_type = UNSET,
1034 .tuner_addr = ADDR_UNSET,
1035 .radio_addr = ADDR_UNSET,
1036 .tda9887_conf = TDA9887_PRESENT,
1037 .input = {{
1038 .type = CX88_VMUX_TELEVISION,
1039 .vmux = 0,
1040 },{
1041 .type = CX88_VMUX_COMPOSITE1,
1042 .vmux = 1,
1043 }},
1044 /* fixme: Add radio support */
48d5e803 1045 .mpeg = CX88_MPEG_DVB,
611900c1 1046 },
fc40b261
CP
1047 [CX88_BOARD_DNTV_LIVE_DVB_T_PRO] = {
1048 .name = "digitalnow DNTV Live! DVB-T Pro",
1049 .tuner_type = TUNER_PHILIPS_FMD1216ME_MK3,
1050 .radio_type = UNSET,
1051 .tuner_addr = ADDR_UNSET,
1052 .radio_addr = ADDR_UNSET,
1053 .tda9887_conf = TDA9887_PRESENT | TDA9887_PORT1_ACTIVE |
1054 TDA9887_PORT2_ACTIVE,
1055 .input = {{
1056 .type = CX88_VMUX_TELEVISION,
1057 .vmux = 0,
1058 .gpio0 = 0xf80808,
1059 },{
1060 .type = CX88_VMUX_COMPOSITE1,
1061 .vmux = 1,
1062 .gpio0 = 0xf80808,
1063 },{
1064 .type = CX88_VMUX_SVIDEO,
1065 .vmux = 2,
1066 .gpio0 = 0xf80808,
1067 }},
1068 .radio = {
1069 .type = CX88_RADIO,
1070 .gpio0 = 0xf80808,
1071 },
48d5e803 1072 .mpeg = CX88_MPEG_DVB,
fc40b261 1073 },
f39624fd
MM
1074 [CX88_BOARD_KWORLD_DVB_T_CX22702] = {
1075 /* Kworld V-stream Xpert DVB-T with Thomson tuner */
1076 /* DTT 7579 Conexant CX22702-19 Conexant CX2388x */
1077 /* Manenti Marco <marco_manenti@colman.it> */
1078 .name = "KWorld/VStream XPert DVB-T with cx22702",
1079 .tuner_type = TUNER_ABSENT,
1080 .radio_type = UNSET,
1081 .tuner_addr = ADDR_UNSET,
1082 .radio_addr = ADDR_UNSET,
1083 .input = {{
1084 .type = CX88_VMUX_COMPOSITE1,
1085 .vmux = 1,
1086 .gpio0 = 0x0700,
1087 .gpio2 = 0x0101,
1088 },{
1089 .type = CX88_VMUX_SVIDEO,
1090 .vmux = 2,
1091 .gpio0 = 0x0700,
1092 .gpio2 = 0x0101,
1093 }},
48d5e803 1094 .mpeg = CX88_MPEG_DVB,
f39624fd 1095 },
43eabb4e
CP
1096 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL] = {
1097 .name = "DViCO FusionHDTV DVB-T Dual Digital",
1098 .tuner_type = TUNER_ABSENT, /* No analog tuner */
1099 .radio_type = UNSET,
1100 .tuner_addr = ADDR_UNSET,
1101 .radio_addr = ADDR_UNSET,
1102 .input = {{
1103 .type = CX88_VMUX_COMPOSITE1,
1104 .vmux = 1,
d536e9c4 1105 .gpio0 = 0x000067df,
43eabb4e
CP
1106 },{
1107 .type = CX88_VMUX_SVIDEO,
1108 .vmux = 2,
d536e9c4 1109 .gpio0 = 0x000067df,
43eabb4e 1110 }},
48d5e803 1111 .mpeg = CX88_MPEG_DVB,
43eabb4e 1112 },
44256de1 1113 [CX88_BOARD_KWORLD_HARDWARE_MPEG_TV_XPERT] = {
44256de1
MK
1114 .name = "KWorld HardwareMpegTV XPert",
1115 .tuner_type = TUNER_PHILIPS_TDA8290,
1116 .radio_type = UNSET,
1117 .tuner_addr = ADDR_UNSET,
1118 .radio_addr = ADDR_UNSET,
1119 .input = {{
1120 .type = CX88_VMUX_TELEVISION,
1121 .vmux = 0,
e2798212 1122 .gpio0 = 0x3de2,
24da4e4b 1123 .gpio2 = 0x00ff,
bc53f783
MK
1124 },{
1125 .type = CX88_VMUX_COMPOSITE1,
1126 .vmux = 1,
1127 .gpio0 = 0x3de6,
7b27d45b 1128 .audioroute = 1,
bc53f783
MK
1129 },{
1130 .type = CX88_VMUX_SVIDEO,
1131 .vmux = 2,
1132 .gpio0 = 0x3de6,
7b27d45b 1133 .audioroute = 1,
44256de1 1134 }},
e2798212
MK
1135 .radio = {
1136 .type = CX88_RADIO,
1137 .gpio0 = 0x3de6,
24da4e4b 1138 .gpio2 = 0x00ff,
e2798212 1139 },
48d5e803 1140 .mpeg = CX88_MPEG_BLACKBIRD,
44256de1 1141 },
780dfef3
CP
1142 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID] = {
1143 .name = "DViCO FusionHDTV DVB-T Hybrid",
91ae3299 1144 .tuner_type = TUNER_THOMSON_FE6600,
780dfef3
CP
1145 .radio_type = UNSET,
1146 .tuner_addr = ADDR_UNSET,
1147 .radio_addr = ADDR_UNSET,
1148 .input = {{
1149 .type = CX88_VMUX_TELEVISION,
1150 .vmux = 0,
1151 .gpio0 = 0x0000a75f,
1152 },{
1153 .type = CX88_VMUX_COMPOSITE1,
1154 .vmux = 1,
1155 .gpio0 = 0x0000a75b,
1156 },{
1157 .type = CX88_VMUX_SVIDEO,
1158 .vmux = 2,
1159 .gpio0 = 0x0000a75b,
1160 }},
48d5e803 1161 .mpeg = CX88_MPEG_DVB,
780dfef3 1162 },
e142e7c4
MK
1163 [CX88_BOARD_PCHDTV_HD5500] = {
1164 .name = "pcHDTV HD5500 HDTV",
9c26c8b1 1165 .tuner_type = TUNER_LG_TDVS_H06XF, /* TDVS-H064F */
e142e7c4
MK
1166 .radio_type = UNSET,
1167 .tuner_addr = ADDR_UNSET,
1168 .radio_addr = ADDR_UNSET,
1169 .tda9887_conf = TDA9887_PRESENT,
1170 .input = {{
1171 .type = CX88_VMUX_TELEVISION,
1172 .vmux = 0,
1173 .gpio0 = 0x87fd,
1174 },{
1175 .type = CX88_VMUX_COMPOSITE1,
1176 .vmux = 1,
1177 .gpio0 = 0x87f9,
1178 },{
1179 .type = CX88_VMUX_SVIDEO,
1180 .vmux = 2,
1181 .gpio0 = 0x87f9,
1182 }},
48d5e803 1183 .mpeg = CX88_MPEG_DVB,
e142e7c4 1184 },
b3038304
VZ
1185 [CX88_BOARD_KWORLD_MCE200_DELUXE] = {
1186 /* FIXME: tested TV input only, disabled composite,
1187 svideo and radio until they can be tested also. */
1188 .name = "Kworld MCE 200 Deluxe",
1189 .tuner_type = TUNER_TENA_9533_DI,
1190 .radio_type = UNSET,
1191 .tda9887_conf = TDA9887_PRESENT,
1192 .tuner_addr = ADDR_UNSET,
1193 .radio_addr = ADDR_UNSET,
1194 .input = {{
1195 .type = CX88_VMUX_TELEVISION,
1196 .vmux = 0,
1197 .gpio0 = 0x0000BDE6
1198 }},
48d5e803 1199 .mpeg = CX88_MPEG_BLACKBIRD,
b3038304 1200 },
a3124622
AM
1201 [CX88_BOARD_PIXELVIEW_PLAYTV_P7000] = {
1202 /* FIXME: SVideo, Composite and FM inputs are untested */
1203 .name = "PixelView PlayTV P7000",
1204 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
1205 .radio_type = UNSET,
1206 .tuner_addr = ADDR_UNSET,
1207 .radio_addr = ADDR_UNSET,
1208 .tda9887_conf = TDA9887_PRESENT | TDA9887_PORT1_ACTIVE |
1209 TDA9887_PORT2_ACTIVE,
1210 .input = {{
1211 .type = CX88_VMUX_TELEVISION,
1212 .vmux = 0,
1213 .gpio0 = 0x5da6,
1214 }},
48d5e803 1215 .mpeg = CX88_MPEG_BLACKBIRD,
a3124622 1216 },
be4f4519
RC
1217 [CX88_BOARD_NPGTECH_REALTV_TOP10FM] = {
1218 .name = "NPG Tech Real TV FM Top 10",
1219 .tuner_type = TUNER_TNF_5335MF, /* Actually a TNF9535 */
680543c5
RC
1220 .radio_type = UNSET,
1221 .tuner_addr = ADDR_UNSET,
1222 .radio_addr = ADDR_UNSET,
1223 .input = {{
1224 .type = CX88_VMUX_TELEVISION,
1225 .vmux = 0,
1226 .gpio0 = 0x0788,
1227 },{
1228 .type = CX88_VMUX_COMPOSITE1,
1229 .vmux = 1,
1230 .gpio0 = 0x078b,
1231 },{
1232 .type = CX88_VMUX_SVIDEO,
1233 .vmux = 2,
be4f4519 1234 .gpio0 = 0x078b,
680543c5
RC
1235 }},
1236 .radio = {
1237 .type = CX88_RADIO,
1238 .gpio0 = 0x074a,
1239 },
1240 },
4bd6e9d9 1241 [CX88_BOARD_WINFAST_DTV2000H] = {
4bd6e9d9
MV
1242 .name = "WinFast DTV2000 H",
1243 .tuner_type = TUNER_PHILIPS_FMD1216ME_MK3,
1244 .radio_type = UNSET,
1245 .tuner_addr = ADDR_UNSET,
1246 .radio_addr = ADDR_UNSET,
1247 .tda9887_conf = TDA9887_PRESENT,
1248 .input = {{
1249 .type = CX88_VMUX_TELEVISION,
1250 .vmux = 0,
1251 .gpio0 = 0x00017304,
1252 .gpio1 = 0x00008203,
1253 .gpio2 = 0x00017304,
1254 .gpio3 = 0x02000000,
5cff91a0
VP
1255 }, {
1256 .type = CX88_VMUX_COMPOSITE1,
1257 .vmux = 1,
1258 .gpio0 = 0x0001d701,
1259 .gpio1 = 0x0000b207,
1260 .gpio2 = 0x0001d701,
1261 .gpio3 = 0x02000000,
1262 }, {
1263 .type = CX88_VMUX_COMPOSITE2,
1264 .vmux = 2,
1265 .gpio0 = 0x0001d503,
1266 .gpio1 = 0x0000b207,
1267 .gpio2 = 0x0001d503,
1268 .gpio3 = 0x02000000,
1269 }, {
1270 .type = CX88_VMUX_SVIDEO,
1271 .vmux = 3,
1272 .gpio0 = 0x0001d701,
1273 .gpio1 = 0x0000b207,
1274 .gpio2 = 0x0001d701,
1275 .gpio3 = 0x02000000,
4bd6e9d9 1276 }},
5cff91a0
VP
1277 .radio = {
1278 .type = CX88_RADIO,
1279 .gpio0 = 0x00015702,
1280 .gpio1 = 0x0000f207,
1281 .gpio2 = 0x00015702,
1282 .gpio3 = 0x02000000,
1283 },
48d5e803 1284 .mpeg = CX88_MPEG_DVB,
4bd6e9d9 1285 },
c02a34f4
SA
1286 [CX88_BOARD_GENIATECH_DVBS] = {
1287 .name = "Geniatech DVB-S",
1288 .tuner_type = TUNER_ABSENT,
1289 .radio_type = UNSET,
1290 .tuner_addr = ADDR_UNSET,
1291 .radio_addr = ADDR_UNSET,
1292 .input = {{
1293 .type = CX88_VMUX_DVB,
1294 .vmux = 0,
1295 },{
1296 .type = CX88_VMUX_COMPOSITE1,
1297 .vmux = 1,
1298 }},
48d5e803 1299 .mpeg = CX88_MPEG_DVB,
c02a34f4 1300 },
ad10c930 1301 [CX88_BOARD_HAUPPAUGE_HVR3000] = {
ad10c930
ET
1302 .name = "Hauppauge WinTV-HVR3000 TriMode Analog/DVB-S/DVB-T",
1303 .tuner_type = TUNER_PHILIPS_FMD1216ME_MK3,
1304 .radio_type = UNSET,
1305 .tuner_addr = ADDR_UNSET,
1306 .radio_addr = ADDR_UNSET,
1307 .tda9887_conf = TDA9887_PRESENT,
923ac7f7 1308 .audio_chip = V4L2_IDENT_WM8775,
ad10c930
ET
1309 .input = {{
1310 .type = CX88_VMUX_TELEVISION,
1311 .vmux = 0,
1312 .gpio0 = 0x84bf,
649e13a9 1313 /* 1: TV Audio / FM Mono */
923ac7f7 1314 .audioroute = 1,
ad10c930
ET
1315 },{
1316 .type = CX88_VMUX_COMPOSITE1,
1317 .vmux = 1,
1318 .gpio0 = 0x84bf,
649e13a9 1319 /* 2: Line-In */
923ac7f7 1320 .audioroute = 2,
ad10c930
ET
1321 },{
1322 .type = CX88_VMUX_SVIDEO,
1323 .vmux = 2,
1324 .gpio0 = 0x84bf,
649e13a9 1325 /* 2: Line-In */
923ac7f7 1326 .audioroute = 2,
ad10c930 1327 }},
63248f26
DB
1328 .radio = {
1329 .type = CX88_RADIO,
1330 .gpio0 = 0x84bf,
649e13a9
DB
1331 /* 4: FM Stereo (untested) */
1332 .audioroute = 8,
63248f26 1333 },
76dc82ab 1334 .mpeg = CX88_MPEG_DVB,
363c35fc 1335 .num_frontends = 2,
ad10c930 1336 },
d1009bd7
PN
1337 [CX88_BOARD_NORWOOD_MICRO] = {
1338 .name = "Norwood Micro TV Tuner",
1339 .tuner_type = TUNER_TNF_5335MF,
1340 .radio_type = UNSET,
1341 .tuner_addr = ADDR_UNSET,
1342 .radio_addr = ADDR_UNSET,
1343 .input = {{
1344 .type = CX88_VMUX_TELEVISION,
1345 .vmux = 0,
1346 .gpio0 = 0x0709,
1347 },{
1348 .type = CX88_VMUX_COMPOSITE1,
1349 .vmux = 1,
1350 .gpio0 = 0x070b,
1351 },{
1352 .type = CX88_VMUX_SVIDEO,
1353 .vmux = 2,
1354 .gpio0 = 0x070b,
1355 }},
1356 },
5b26c82f
MK
1357 [CX88_BOARD_TE_DTV_250_OEM_SWANN] = {
1358 .name = "Shenzhen Tungsten Ages Tech TE-DTV-250 / Swann OEM",
1359 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1360 .radio_type = UNSET,
1361 .tuner_addr = ADDR_UNSET,
1362 .radio_addr = ADDR_UNSET,
1363 .input = {{
1364 .type = CX88_VMUX_TELEVISION,
1365 .vmux = 0,
1366 .gpio0 = 0x003fffff,
1367 .gpio1 = 0x00e00000,
1368 .gpio2 = 0x003fffff,
1369 .gpio3 = 0x02000000,
1370 },{
1371 .type = CX88_VMUX_COMPOSITE1,
1372 .vmux = 1,
1373 .gpio0 = 0x003fffff,
1374 .gpio1 = 0x00e00000,
1375 .gpio2 = 0x003fffff,
1376 .gpio3 = 0x02000000,
1377 },{
1378 .type = CX88_VMUX_SVIDEO,
1379 .vmux = 2,
1380 .gpio0 = 0x003fffff,
1381 .gpio1 = 0x00e00000,
1382 .gpio2 = 0x003fffff,
1383 .gpio3 = 0x02000000,
1384 }},
1385 },
aa481a65
ST
1386 [CX88_BOARD_HAUPPAUGE_HVR1300] = {
1387 .name = "Hauppauge WinTV-HVR1300 DVB-T/Hybrid MPEG Encoder",
1388 .tuner_type = TUNER_PHILIPS_FMD1216ME_MK3,
1389 .radio_type = UNSET,
1390 .tuner_addr = ADDR_UNSET,
1391 .radio_addr = ADDR_UNSET,
1392 .tda9887_conf = TDA9887_PRESENT,
38f9d308 1393 .audio_chip = V4L2_IDENT_WM8775,
2491fbb7
ST
1394 /*
1395 * gpio0 as reported by Mike Crash <mike AT mikecrash.com>
1396 */
aa481a65
ST
1397 .input = {{
1398 .type = CX88_VMUX_TELEVISION,
1399 .vmux = 0,
2491fbb7 1400 .gpio0 = 0xef88,
649e13a9 1401 /* 1: TV Audio / FM Mono */
7b27d45b 1402 .audioroute = 1,
aa481a65
ST
1403 },{
1404 .type = CX88_VMUX_COMPOSITE1,
1405 .vmux = 1,
2491fbb7 1406 .gpio0 = 0xef88,
649e13a9 1407 /* 2: Line-In */
7b27d45b 1408 .audioroute = 2,
aa481a65
ST
1409 },{
1410 .type = CX88_VMUX_SVIDEO,
1411 .vmux = 2,
2491fbb7 1412 .gpio0 = 0xef88,
649e13a9 1413 /* 2: Line-In */
7b27d45b 1414 .audioroute = 2,
aa481a65 1415 }},
6c5be74c 1416 .mpeg = CX88_MPEG_DVB | CX88_MPEG_BLACKBIRD,
6b92b3bd
ST
1417 .radio = {
1418 .type = CX88_RADIO,
2491fbb7 1419 .gpio0 = 0xef88,
649e13a9
DB
1420 /* 4: FM Stereo (untested) */
1421 .audioroute = 8,
6b92b3bd 1422 },
aa481a65 1423 },
7cb47a14
DG
1424 [CX88_BOARD_ADSTECH_PTV_390] = {
1425 .name = "ADS Tech Instant Video PCI",
1426 .tuner_type = TUNER_ABSENT,
1427 .radio_type = UNSET,
1428 .tuner_addr = ADDR_UNSET,
1429 .radio_addr = ADDR_UNSET,
1430 .input = {{
1431 .type = CX88_VMUX_DEBUG,
1432 .vmux = 3,
1433 .gpio0 = 0x04ff,
1434 },{
1435 .type = CX88_VMUX_COMPOSITE1,
1436 .vmux = 1,
1437 .gpio0 = 0x07fa,
1438 },{
1439 .type = CX88_VMUX_SVIDEO,
1440 .vmux = 2,
1441 .gpio0 = 0x07fa,
1442 }},
1443 },
60464da8
ST
1444 [CX88_BOARD_PINNACLE_PCTV_HD_800i] = {
1445 .name = "Pinnacle PCTV HD 800i",
1446 .tuner_type = TUNER_XC5000,
1447 .radio_type = UNSET,
1448 .tuner_addr = ADDR_UNSET,
1449 .radio_addr = ADDR_UNSET,
1450 .input = {{
1451 .type = CX88_VMUX_TELEVISION,
1452 .vmux = 0,
1453 .gpio0 = 0x04fb,
1454 .gpio1 = 0x10ff,
1455 },{
1456 .type = CX88_VMUX_COMPOSITE1,
1457 .vmux = 1,
1458 .gpio0 = 0x04fb,
1459 .gpio1 = 0x10ef,
1460 .audioroute = 1,
1461 },{
1462 .type = CX88_VMUX_SVIDEO,
1463 .vmux = 2,
1464 .gpio0 = 0x04fb,
1465 .gpio1 = 0x10ef,
1466 .audioroute = 1,
1467 }},
1468 .mpeg = CX88_MPEG_DVB,
1469 },
5c00fac0 1470 [CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO] = {
8efd2e28
MK
1471 .name = "DViCO FusionHDTV 5 PCI nano",
1472 /* xc3008 tuner, digital only for now */
5c00fac0
ST
1473 .tuner_type = TUNER_ABSENT,
1474 .radio_type = UNSET,
1475 .tuner_addr = ADDR_UNSET,
1476 .radio_addr = ADDR_UNSET,
1477 .input = {{
1478 .type = CX88_VMUX_TELEVISION,
1479 .vmux = 0,
1480 .gpio0 = 0x000027df, /* Unconfirmed */
1481 }, {
1482 .type = CX88_VMUX_COMPOSITE1,
1483 .vmux = 1,
1484 .gpio0 = 0x000027df, /* Unconfirmed */
1485 .audioroute = 1,
1486 }, {
1487 .type = CX88_VMUX_SVIDEO,
1488 .vmux = 2,
1489 .gpio0 = 0x000027df, /* Unconfirmed */
1490 .audioroute = 1,
1491 } },
1492 .mpeg = CX88_MPEG_DVB,
1493 },
9507901e 1494 [CX88_BOARD_PINNACLE_HYBRID_PCTV] = {
000e27a6
MCC
1495 .name = "Pinnacle Hybrid PCTV",
1496 .tuner_type = TUNER_XC2028,
1497 .tuner_addr = 0x61,
3f6014fc
SV
1498 .radio_type = TUNER_XC2028,
1499 .radio_addr = 0x61,
000e27a6
MCC
1500 .input = { {
1501 .type = CX88_VMUX_TELEVISION,
1502 .vmux = 0,
3f6014fc
SV
1503 .gpio0 = 0x004ff,
1504 .gpio1 = 0x010ff,
1505 .gpio2 = 0x00001,
000e27a6
MCC
1506 }, {
1507 .type = CX88_VMUX_COMPOSITE1,
1508 .vmux = 1,
3f6014fc
SV
1509 .gpio0 = 0x004fb,
1510 .gpio1 = 0x010ef,
1511 .audioroute = 1,
000e27a6
MCC
1512 }, {
1513 .type = CX88_VMUX_SVIDEO,
1514 .vmux = 2,
3f6014fc
SV
1515 .gpio0 = 0x004fb,
1516 .gpio1 = 0x010ef,
1517 .audioroute = 1,
000e27a6
MCC
1518 } },
1519 .radio = {
1520 .type = CX88_RADIO,
1521 .gpio0 = 0x004ff,
1522 .gpio1 = 0x010ff,
1523 .gpio2 = 0x0ff,
1524 },
3f6014fc 1525 .mpeg = CX88_MPEG_DVB,
000e27a6 1526 },
14422f9d
MCC
1527 /* Terry Wu <terrywu2009@gmail.com> */
1528 /* TV Audio : set GPIO 2, 18, 19 value to 0, 1, 0 */
1529 /* FM Audio : set GPIO 2, 18, 19 value to 0, 0, 0 */
1530 /* Line-in Audio : set GPIO 2, 18, 19 value to 0, 1, 1 */
1531 /* Mute Audio : set GPIO 2 value to 1 */
000e27a6 1532 [CX88_BOARD_WINFAST_TV2000_XP_GLOBAL] = {
14422f9d 1533 .name = "Leadtek TV2000 XP Global",
000e27a6
MCC
1534 .tuner_type = TUNER_XC2028,
1535 .tuner_addr = 0x61,
14422f9d
MCC
1536 .radio_type = TUNER_XC2028,
1537 .radio_addr = 0x61,
000e27a6
MCC
1538 .input = { {
1539 .type = CX88_VMUX_TELEVISION,
1540 .vmux = 0,
14422f9d 1541 .gpio0 = 0x0400, /* pin 2 = 0 */
000e27a6 1542 .gpio1 = 0x0000,
14422f9d
MCC
1543 .gpio2 = 0x0C04, /* pin 18 = 1, pin 19 = 0 */
1544 .gpio3 = 0x0000,
000e27a6
MCC
1545 }, {
1546 .type = CX88_VMUX_COMPOSITE1,
1547 .vmux = 1,
14422f9d 1548 .gpio0 = 0x0400, /* pin 2 = 0 */
000e27a6 1549 .gpio1 = 0x0000,
14422f9d
MCC
1550 .gpio2 = 0x0C0C, /* pin 18 = 1, pin 19 = 1 */
1551 .gpio3 = 0x0000,
000e27a6
MCC
1552 }, {
1553 .type = CX88_VMUX_SVIDEO,
1554 .vmux = 2,
14422f9d
MCC
1555 .gpio0 = 0x0400, /* pin 2 = 0 */
1556 .gpio1 = 0x0000,
1557 .gpio2 = 0x0C0C, /* pin 18 = 1, pin 19 = 1 */
1558 .gpio3 = 0x0000,
000e27a6
MCC
1559 } },
1560 .radio = {
1561 .type = CX88_RADIO,
14422f9d
MCC
1562 .gpio0 = 0x0400, /* pin 2 = 0 */
1563 .gpio1 = 0x0000,
1564 .gpio2 = 0x0C00, /* pin 18 = 0, pin 19 = 0 */
1565 .gpio3 = 0x0000,
000e27a6
MCC
1566 },
1567 },
1568 [CX88_BOARD_POWERCOLOR_REAL_ANGEL] = {
a9606ce6 1569 .name = "PowerColor RA330", /* Long names may confuse LIRC. */
000e27a6
MCC
1570 .tuner_type = TUNER_XC2028,
1571 .tuner_addr = 0x61,
1572 .input = { {
a9606ce6
DG
1573 .type = CX88_VMUX_DEBUG,
1574 .vmux = 3, /* Due to the way the cx88 driver is written, */
1575 .gpio0 = 0x00ff, /* there is no way to deactivate audio pass- */
1576 .gpio1 = 0xf39d, /* through without this entry. Furthermore, if */
1577 .gpio3 = 0x0000, /* the TV mux entry is first, you get audio */
1578 }, { /* from the tuner on boot for a little while. */
000e27a6
MCC
1579 .type = CX88_VMUX_TELEVISION,
1580 .vmux = 0,
ab364983 1581 .gpio0 = 0x00ff,
000e27a6 1582 .gpio1 = 0xf35d,
ab364983 1583 .gpio3 = 0x0000,
000e27a6
MCC
1584 }, {
1585 .type = CX88_VMUX_COMPOSITE1,
1586 .vmux = 1,
ab364983
DF
1587 .gpio0 = 0x00ff,
1588 .gpio1 = 0xf37d,
1589 .gpio3 = 0x0000,
000e27a6
MCC
1590 }, {
1591 .type = CX88_VMUX_SVIDEO,
1592 .vmux = 2,
1593 .gpio0 = 0x000ff,
1594 .gpio1 = 0x0f37d,
000e27a6
MCC
1595 .gpio3 = 0x00000,
1596 } },
1597 .radio = {
1598 .type = CX88_RADIO,
1599 .gpio0 = 0x000ff,
1600 .gpio1 = 0x0f35d,
000e27a6
MCC
1601 .gpio3 = 0x00000,
1602 },
1603 },
1604 [CX88_BOARD_GENIATECH_X8000_MT] = {
9507901e 1605 /* Also PowerColor Real Angel 330 and Geniatech X800 OEM */
000e27a6
MCC
1606 .name = "Geniatech X8000-MT DVBT",
1607 .tuner_type = TUNER_XC2028,
1608 .tuner_addr = 0x61,
1609 .input = { {
1610 .type = CX88_VMUX_TELEVISION,
1611 .vmux = 0,
1612 .gpio0 = 0x00000000,
1613 .gpio1 = 0x00e3e341,
1614 .gpio2 = 0x00000000,
1615 .gpio3 = 0x00000000,
1616 }, {
1617 .type = CX88_VMUX_COMPOSITE1,
1618 .vmux = 1,
1619 .gpio0 = 0x00000000,
1620 .gpio1 = 0x00e3e361,
1621 .gpio2 = 0x00000000,
1622 .gpio3 = 0x00000000,
1623 }, {
1624 .type = CX88_VMUX_SVIDEO,
1625 .vmux = 2,
1626 .gpio0 = 0x00000000,
1627 .gpio1 = 0x00e3e361,
1628 .gpio2 = 0x00000000,
1629 .gpio3 = 0x00000000,
1630 } },
1631 .radio = {
1632 .type = CX88_RADIO,
1633 .gpio0 = 0x00000000,
1634 .gpio1 = 0x00e3e341,
1635 .gpio2 = 0x00000000,
1636 .gpio3 = 0x00000000,
1637 },
1638 .mpeg = CX88_MPEG_DVB,
1639 },
1640 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO] = {
1641 .name = "DViCO FusionHDTV DVB-T PRO",
19c309e3
TF
1642 .tuner_type = TUNER_XC2028,
1643 .tuner_addr = 0x61,
000e27a6 1644 .radio_type = UNSET,
000e27a6
MCC
1645 .radio_addr = ADDR_UNSET,
1646 .input = { {
1647 .type = CX88_VMUX_COMPOSITE1,
1648 .vmux = 1,
1649 .gpio0 = 0x000067df,
b3fb91d2 1650 }, {
000e27a6
MCC
1651 .type = CX88_VMUX_SVIDEO,
1652 .vmux = 2,
1653 .gpio0 = 0x000067df,
1654 } },
1655 .mpeg = CX88_MPEG_DVB,
1656 },
1117d6ba 1657 [CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD] = {
76464d41 1658 .name = "DViCO FusionHDTV 7 Gold",
1117d6ba
ST
1659 .tuner_type = TUNER_XC5000,
1660 .radio_type = UNSET,
1661 .tuner_addr = ADDR_UNSET,
1662 .radio_addr = ADDR_UNSET,
1663 .input = {{
1664 .type = CX88_VMUX_TELEVISION,
1665 .vmux = 0,
76464d41 1666 .gpio0 = 0x10df,
1117d6ba
ST
1667 },{
1668 .type = CX88_VMUX_COMPOSITE1,
1669 .vmux = 1,
76464d41 1670 .gpio0 = 0x16d9,
1117d6ba
ST
1671 },{
1672 .type = CX88_VMUX_SVIDEO,
1673 .vmux = 2,
76464d41 1674 .gpio0 = 0x16d9,
1117d6ba 1675 }},
d893d5dc 1676 .mpeg = CX88_MPEG_DVB,
1117d6ba 1677 },
2422a9b3
MCC
1678 [CX88_BOARD_PROLINK_PV_8000GT] = {
1679 .name = "Prolink Pixelview MPEG 8000GT",
1680 .tuner_type = TUNER_XC2028,
1681 .tuner_addr = 0x61,
1682 .input = { {
1683 .type = CX88_VMUX_TELEVISION,
1684 .vmux = 0,
1685 .gpio0 = 0x0ff,
1686 .gpio2 = 0x0cfb,
1687 }, {
1688 .type = CX88_VMUX_COMPOSITE1,
1689 .vmux = 1,
1690 .gpio2 = 0x0cfb,
1691 }, {
1692 .type = CX88_VMUX_SVIDEO,
1693 .vmux = 2,
1694 .gpio2 = 0x0cfb,
1695 } },
1696 .radio = {
1697 .type = CX88_RADIO,
1698 .gpio2 = 0x0cfb,
1699 },
1700 },
a31d2bb7
MCC
1701 [CX88_BOARD_PROLINK_PV_GLOBAL_XTREME] = {
1702 .name = "Prolink Pixelview Global Extreme",
1703 .tuner_type = TUNER_XC2028,
1704 .tuner_addr = 0x61,
1705 .input = { {
1706 .type = CX88_VMUX_TELEVISION,
1707 .vmux = 0,
1708 .gpio0 = 0x04fb,
1709 .gpio1 = 0x04080,
1710 .gpio2 = 0x0cf7,
1711 }, {
1712 .type = CX88_VMUX_COMPOSITE1,
1713 .vmux = 1,
1714 .gpio0 = 0x04fb,
1715 .gpio1 = 0x04080,
1716 .gpio2 = 0x0cfb,
1717 }, {
1718 .type = CX88_VMUX_SVIDEO,
1719 .vmux = 2,
1720 .gpio0 = 0x04fb,
1721 .gpio1 = 0x04080,
1722 .gpio2 = 0x0cfb,
1723 } },
1724 .radio = {
1725 .type = CX88_RADIO,
1726 .gpio0 = 0x04ff,
1727 .gpio1 = 0x04080,
1728 .gpio2 = 0x0cf7,
1729 },
1730 },
99e09eac
MCC
1731 /* Both radio, analog and ATSC work with this board.
1732 However, for analog to work, s5h1409 gate should be open,
1733 otherwise, tuner-xc3028 won't be detected.
1734 A proper fix require using the newer i2c methods to add
1735 tuner-xc3028 without doing an i2c probe.
1736 */
1737 [CX88_BOARD_KWORLD_ATSC_120] = {
1738 .name = "Kworld PlusTV HD PCI 120 (ATSC 120)",
1739 .tuner_type = TUNER_XC2028,
1740 .radio_type = UNSET,
1741 .tuner_addr = ADDR_UNSET,
1742 .radio_addr = ADDR_UNSET,
1743 .input = { {
1744 .type = CX88_VMUX_TELEVISION,
1745 .vmux = 0,
1746 .gpio0 = 0x000000ff,
1747 .gpio1 = 0x0000f35d,
1748 .gpio2 = 0x00000000,
1749 }, {
1750 .type = CX88_VMUX_COMPOSITE1,
1751 .vmux = 1,
1752 .gpio0 = 0x000000ff,
1753 .gpio1 = 0x0000f37e,
1754 .gpio2 = 0x00000000,
1755 }, {
1756 .type = CX88_VMUX_SVIDEO,
1757 .vmux = 2,
1758 .gpio0 = 0x000000ff,
1759 .gpio1 = 0x0000f37e,
1760 .gpio2 = 0x00000000,
1761 } },
1762 .radio = {
1763 .type = CX88_RADIO,
1764 .gpio0 = 0x000000ff,
1765 .gpio1 = 0x0000f35d,
1766 .gpio2 = 0x00000000,
1767 },
1768 .mpeg = CX88_MPEG_DVB,
1769 },
5bd1b663
ST
1770 [CX88_BOARD_HAUPPAUGE_HVR4000] = {
1771 .name = "Hauppauge WinTV-HVR4000 DVB-S/S2/T/Hybrid",
1772 .tuner_type = TUNER_PHILIPS_FMD1216ME_MK3,
1773 .radio_type = UNSET,
1774 .tuner_addr = ADDR_UNSET,
1775 .radio_addr = ADDR_UNSET,
1776 .tda9887_conf = TDA9887_PRESENT,
923ac7f7 1777 .audio_chip = V4L2_IDENT_WM8775,
5bd1b663
ST
1778 /*
1779 * GPIO0 (WINTV2000)
1780 *
1781 * Analogue SAT DVB-T
1782 * Antenna 0xc4bf 0xc4bb
1783 * Composite 0xc4bf 0xc4bb
1784 * S-Video 0xc4bf 0xc4bb
1785 * Composite1 0xc4ff 0xc4fb
1786 * S-Video1 0xc4ff 0xc4fb
2491fbb7
ST
1787 *
1788 * BIT VALUE FUNCTION GP{x}_IO
1789 * 0 1 I:?
1790 * 1 1 I:?
63248f26 1791 * 2 1 O:MPEG PORT 0=DVB-T 1=DVB-S
2491fbb7
ST
1792 * 3 1 I:?
1793 * 4 1 I:?
1794 * 5 1 I:?
1795 * 6 0 O:INPUT SELECTOR 0=INTERNAL 1=EXPANSION
1796 * 7 1 O:DVB-T DEMOD RESET LOW
1797 *
1798 * BIT VALUE FUNCTION GP{x}_OE
1799 * 8 0 I
1800 * 9 0 I
1801 * a 1 O
1802 * b 0 I
1803 * c 0 I
1804 * d 0 I
1805 * e 1 O
1806 * f 1 O
649e13a9
DB
1807 *
1808 * WM8775 ADC
1809 *
1810 * 1: TV Audio / FM Mono
1811 * 2: Line-In
1812 * 3: Line-In Expansion
1813 * 4: FM Stereo
5bd1b663
ST
1814 */
1815 .input = {{
1816 .type = CX88_VMUX_TELEVISION,
1817 .vmux = 0,
1818 .gpio0 = 0xc4bf,
649e13a9 1819 /* 1: TV Audio / FM Mono */
923ac7f7 1820 .audioroute = 1,
5bd1b663
ST
1821 }, {
1822 .type = CX88_VMUX_COMPOSITE1,
1823 .vmux = 1,
1824 .gpio0 = 0xc4bf,
649e13a9 1825 /* 2: Line-In */
923ac7f7 1826 .audioroute = 2,
5bd1b663
ST
1827 }, {
1828 .type = CX88_VMUX_SVIDEO,
1829 .vmux = 2,
1830 .gpio0 = 0xc4bf,
649e13a9 1831 /* 2: Line-In */
923ac7f7 1832 .audioroute = 2,
5bd1b663 1833 } },
63248f26
DB
1834 .radio = {
1835 .type = CX88_RADIO,
1836 .gpio0 = 0xc4bf,
649e13a9
DB
1837 /* 4: FM Stereo */
1838 .audioroute = 8,
63248f26 1839 },
5bd1b663 1840 .mpeg = CX88_MPEG_DVB,
363c35fc 1841 .num_frontends = 2,
5bd1b663
ST
1842 },
1843 [CX88_BOARD_HAUPPAUGE_HVR4000LITE] = {
1844 .name = "Hauppauge WinTV-HVR4000(Lite) DVB-S/S2",
1845 .tuner_type = UNSET,
1846 .radio_type = UNSET,
1847 .tuner_addr = ADDR_UNSET,
1848 .radio_addr = ADDR_UNSET,
1849 .input = {{
1850 .type = CX88_VMUX_DVB,
1851 .vmux = 0,
1852 } },
1853 .mpeg = CX88_MPEG_DVB,
1854 },
e4aab64c
IL
1855 [CX88_BOARD_TEVII_S420] = {
1856 .name = "TeVii S420 DVB-S",
1857 .tuner_type = UNSET,
1858 .radio_type = UNSET,
1859 .tuner_addr = ADDR_UNSET,
1860 .radio_addr = ADDR_UNSET,
1861 .input = {{
1862 .type = CX88_VMUX_DVB,
1863 .vmux = 0,
1864 } },
1865 .mpeg = CX88_MPEG_DVB,
1866 },
af832623
IL
1867 [CX88_BOARD_TEVII_S460] = {
1868 .name = "TeVii S460 DVB-S/S2",
1869 .tuner_type = UNSET,
1870 .radio_type = UNSET,
1871 .tuner_addr = ADDR_UNSET,
1872 .radio_addr = ADDR_UNSET,
1873 .input = {{
1874 .type = CX88_VMUX_DVB,
1875 .vmux = 0,
1876 } },
1877 .mpeg = CX88_MPEG_DVB,
1878 },
4cd7fb87
OR
1879 [CX88_BOARD_OMICOM_SS4_PCI] = {
1880 .name = "Omicom SS4 DVB-S/S2 PCI",
1881 .tuner_type = UNSET,
1882 .radio_type = UNSET,
1883 .tuner_addr = ADDR_UNSET,
1884 .radio_addr = ADDR_UNSET,
1885 .input = {{
1886 .type = CX88_VMUX_DVB,
1887 .vmux = 0,
1888 } },
1889 .mpeg = CX88_MPEG_DVB,
1890 },
4b29631d
IL
1891 [CX88_BOARD_TBS_8910] = {
1892 .name = "TBS 8910 DVB-S",
1893 .tuner_type = UNSET,
1894 .radio_type = UNSET,
1895 .tuner_addr = ADDR_UNSET,
1896 .radio_addr = ADDR_UNSET,
1897 .input = {{
1898 .type = CX88_VMUX_DVB,
1899 .vmux = 0,
1900 } },
1901 .mpeg = CX88_MPEG_DVB,
1902 },
ee73042c
OR
1903 [CX88_BOARD_TBS_8920] = {
1904 .name = "TBS 8920 DVB-S/S2",
1905 .tuner_type = TUNER_ABSENT,
1906 .radio_type = UNSET,
1907 .tuner_addr = ADDR_UNSET,
1908 .radio_addr = ADDR_UNSET,
1909 .input = {{
1910 .type = CX88_VMUX_DVB,
1911 .vmux = 1,
1912 } },
1913 .mpeg = CX88_MPEG_DVB,
1914 },
cd3cde12
IL
1915 [CX88_BOARD_PROF_6200] = {
1916 .name = "Prof 6200 DVB-S",
1917 .tuner_type = UNSET,
1918 .radio_type = UNSET,
1919 .tuner_addr = ADDR_UNSET,
1920 .radio_addr = ADDR_UNSET,
1921 .input = {{
1922 .type = CX88_VMUX_DVB,
1923 .vmux = 0,
1924 } },
1925 .mpeg = CX88_MPEG_DVB,
1926 },
57f51dbc
OR
1927 [CX88_BOARD_PROF_7300] = {
1928 .name = "PROF 7300 DVB-S/S2",
1929 .tuner_type = UNSET,
1930 .radio_type = UNSET,
1931 .tuner_addr = ADDR_UNSET,
1932 .radio_addr = ADDR_UNSET,
1933 .input = {{
1934 .type = CX88_VMUX_DVB,
1935 .vmux = 0,
1936 } },
1937 .mpeg = CX88_MPEG_DVB,
1938 },
4b29631d
IL
1939 [CX88_BOARD_SATTRADE_ST4200] = {
1940 .name = "SATTRADE ST4200 DVB-S/S2",
1941 .tuner_type = UNSET,
1942 .radio_type = UNSET,
1943 .tuner_addr = ADDR_UNSET,
1944 .radio_addr = ADDR_UNSET,
1945 .input = {{
1946 .type = CX88_VMUX_DVB,
1947 .vmux = 0,
1948 } },
1949 .mpeg = CX88_MPEG_DVB,
1950 },
70101a27
SW
1951 [CX88_BOARD_TERRATEC_CINERGY_HT_PCI_MKII] = {
1952 .name = "Terratec Cinergy HT PCI MKII",
1953 .tuner_type = TUNER_XC2028,
1954 .tuner_addr = 0x61,
1955 .radio_type = TUNER_XC2028,
1956 .radio_addr = 0x61,
1957 .input = { {
1958 .type = CX88_VMUX_TELEVISION,
1959 .vmux = 0,
1960 .gpio0 = 0x004ff,
1961 .gpio1 = 0x010ff,
1962 .gpio2 = 0x00001,
1963 }, {
1964 .type = CX88_VMUX_COMPOSITE1,
1965 .vmux = 1,
1966 .gpio0 = 0x004fb,
1967 .gpio1 = 0x010ef,
1968 .audioroute = 1,
1969 }, {
1970 .type = CX88_VMUX_SVIDEO,
1971 .vmux = 2,
1972 .gpio0 = 0x004fb,
1973 .gpio1 = 0x010ef,
1974 .audioroute = 1,
1975 } },
1976 .radio = {
1977 .type = CX88_RADIO,
1978 .gpio0 = 0x004ff,
1979 .gpio1 = 0x010ff,
1980 .gpio2 = 0x0ff,
1981 },
1982 .mpeg = CX88_MPEG_DVB,
1983 },
501d8cd4
ST
1984 [CX88_BOARD_HAUPPAUGE_IRONLY] = {
1985 .name = "Hauppauge WinTV-IR Only",
1986 .tuner_type = UNSET,
1987 .radio_type = UNSET,
1988 .tuner_addr = ADDR_UNSET,
1989 .radio_addr = ADDR_UNSET,
1990 },
3047a176
MS
1991 [CX88_BOARD_WINFAST_DTV1800H] = {
1992 .name = "Leadtek WinFast DTV1800 Hybrid",
1993 .tuner_type = TUNER_XC2028,
1994 .radio_type = TUNER_XC2028,
1995 .tuner_addr = 0x61,
1996 .radio_addr = 0x61,
1997 /*
1998 * GPIO setting
1999 *
2000 * 2: mute (0=off,1=on)
2001 * 12: tuner reset pin
2002 * 13: audio source (0=tuner audio,1=line in)
2003 * 14: FM (0=on,1=off ???)
2004 */
2005 .input = {{
2006 .type = CX88_VMUX_TELEVISION,
2007 .vmux = 0,
2008 .gpio0 = 0x0400, /* pin 2 = 0 */
2009 .gpio1 = 0x6040, /* pin 13 = 0, pin 14 = 1 */
2010 .gpio2 = 0x0000,
2011 }, {
2012 .type = CX88_VMUX_COMPOSITE1,
2013 .vmux = 1,
2014 .gpio0 = 0x0400, /* pin 2 = 0 */
2015 .gpio1 = 0x6060, /* pin 13 = 1, pin 14 = 1 */
2016 .gpio2 = 0x0000,
2017 }, {
2018 .type = CX88_VMUX_SVIDEO,
2019 .vmux = 2,
2020 .gpio0 = 0x0400, /* pin 2 = 0 */
2021 .gpio1 = 0x6060, /* pin 13 = 1, pin 14 = 1 */
2022 .gpio2 = 0x0000,
2023 } },
2024 .radio = {
2025 .type = CX88_RADIO,
2026 .gpio0 = 0x0400, /* pin 2 = 0 */
2027 .gpio1 = 0x6000, /* pin 13 = 0, pin 14 = 0 */
2028 .gpio2 = 0x0000,
2029 },
2030 .mpeg = CX88_MPEG_DVB,
2031 },
1da177e4 2032};
1da177e4
LT
2033
2034/* ------------------------------------------------------------------ */
2035/* PCI subsystem IDs */
2036
bbc83597 2037static const struct cx88_subid cx88_subids[] = {
1da177e4
LT
2038 {
2039 .subvendor = 0x0070,
2040 .subdevice = 0x3400,
2041 .card = CX88_BOARD_HAUPPAUGE,
2042 },{
2043 .subvendor = 0x0070,
2044 .subdevice = 0x3401,
2045 .card = CX88_BOARD_HAUPPAUGE,
2046 },{
2047 .subvendor = 0x14c7,
2048 .subdevice = 0x0106,
2049 .card = CX88_BOARD_GDI,
2050 },{
2051 .subvendor = 0x14c7,
2052 .subdevice = 0x0107, /* with mpeg encoder */
2053 .card = CX88_BOARD_GDI,
2054 },{
2055 .subvendor = PCI_VENDOR_ID_ATI,
2056 .subdevice = 0x00f8,
2057 .card = CX88_BOARD_ATI_WONDER_PRO,
bc13ae11
PL
2058 }, {
2059 .subvendor = PCI_VENDOR_ID_ATI,
2060 .subdevice = 0x00f9,
2061 .card = CX88_BOARD_ATI_WONDER_PRO,
2062 }, {
4ac97914
MCC
2063 .subvendor = 0x107d,
2064 .subdevice = 0x6611,
2065 .card = CX88_BOARD_WINFAST2000XP_EXPERT,
2066 },{
2067 .subvendor = 0x107d,
2068 .subdevice = 0x6613, /* NTSC */
2069 .card = CX88_BOARD_WINFAST2000XP_EXPERT,
2070 },{
2071 .subvendor = 0x107d,
2072 .subdevice = 0x6620,
2073 .card = CX88_BOARD_WINFAST_DV2000,
1da177e4 2074 },{
4ac97914
MCC
2075 .subvendor = 0x107d,
2076 .subdevice = 0x663b,
2077 .card = CX88_BOARD_LEADTEK_PVR2000,
1da177e4
LT
2078 },{
2079 .subvendor = 0x107d,
8dd86eeb 2080 .subdevice = 0x663c,
4ac97914
MCC
2081 .card = CX88_BOARD_LEADTEK_PVR2000,
2082 },{
1da177e4
LT
2083 .subvendor = 0x1461,
2084 .subdevice = 0x000b,
7418f346 2085 .card = CX88_BOARD_AVERTV_STUDIO_303,
1da177e4
LT
2086 },{
2087 .subvendor = 0x1462,
2088 .subdevice = 0x8606,
2089 .card = CX88_BOARD_MSI_TVANYWHERE_MASTER,
2090 },{
4ac97914
MCC
2091 .subvendor = 0x10fc,
2092 .subdevice = 0xd003,
2093 .card = CX88_BOARD_IODATA_GVVCP3PCI,
1da177e4 2094 },{
4ac97914
MCC
2095 .subvendor = 0x1043,
2096 .subdevice = 0x4823, /* with mpeg encoder */
2097 .card = CX88_BOARD_ASUS_PVR_416,
1da177e4
LT
2098 },{
2099 .subvendor = 0x17de,
2100 .subdevice = 0x08a6,
2101 .card = CX88_BOARD_KWORLD_DVB_T,
2102 },{
2103 .subvendor = 0x18ac,
2104 .subdevice = 0xd810,
a82decf6 2105 .card = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q,
097b750e
MK
2106 },{
2107 .subvendor = 0x18ac,
2108 .subdevice = 0xd820,
80d34362 2109 .card = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T,
1da177e4 2110 },{
7df64e8c
MK
2111 .subvendor = 0x18ac,
2112 .subdevice = 0xdb00,
1da177e4 2113 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1,
4ac97914 2114 },{
1da177e4
LT
2115 .subvendor = 0x0070,
2116 .subdevice = 0x9002,
2117 .card = CX88_BOARD_HAUPPAUGE_DVB_T1,
4ac97914 2118 },{
1da177e4
LT
2119 .subvendor = 0x14f1,
2120 .subdevice = 0x0187,
2121 .card = CX88_BOARD_CONEXANT_DVB_T1,
4ac97914 2122 },{
1da177e4
LT
2123 .subvendor = 0x1540,
2124 .subdevice = 0x2580,
2125 .card = CX88_BOARD_PROVIDEO_PV259,
2126 },{
7df64e8c
MK
2127 .subvendor = 0x18ac,
2128 .subdevice = 0xdb10,
1da177e4
LT
2129 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS,
2130 },{
4ac97914
MCC
2131 .subvendor = 0x1554,
2132 .subdevice = 0x4811,
2133 .card = CX88_BOARD_PIXELVIEW,
1da177e4
LT
2134 },{
2135 .subvendor = 0x7063,
2136 .subdevice = 0x3000, /* HD-3000 card */
2137 .card = CX88_BOARD_PCHDTV_HD3000,
2138 },{
7df64e8c
MK
2139 .subvendor = 0x17de,
2140 .subdevice = 0xa8a6,
1da177e4
LT
2141 .card = CX88_BOARD_DNTV_LIVE_DVB_T,
2142 },{
2143 .subvendor = 0x0070,
2144 .subdevice = 0x2801,
2145 .card = CX88_BOARD_HAUPPAUGE_ROSLYN,
2146 },{
7df64e8c 2147 .subvendor = 0x14f1,
1da177e4
LT
2148 .subdevice = 0x0342,
2149 .card = CX88_BOARD_DIGITALLOGIC_MEC,
2150 },{
2151 .subvendor = 0x10fc,
2152 .subdevice = 0xd035,
2153 .card = CX88_BOARD_IODATA_GVBCTV7E,
a82decf6
MCC
2154 },{
2155 .subvendor = 0x1421,
2156 .subdevice = 0x0334,
2157 .card = CX88_BOARD_ADSTECH_DVB_T_PCI,
4ac97914 2158 },{
e057ee11
MK
2159 .subvendor = 0x153b,
2160 .subdevice = 0x1166,
2161 .card = CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1,
4ac97914 2162 },{
9fef07ca
MK
2163 .subvendor = 0x18ac,
2164 .subdevice = 0xd500,
2165 .card = CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD,
4ac97914 2166 },{
d45170ed
NS
2167 .subvendor = 0x1461,
2168 .subdevice = 0x8011,
2169 .card = CX88_BOARD_AVERMEDIA_ULTRATV_MC_550,
4ac97914 2170 },{
e976f937
KL
2171 .subvendor = PCI_VENDOR_ID_ATI,
2172 .subdevice = 0xa101,
2173 .card = CX88_BOARD_ATI_HDTVWONDER,
4ac97914 2174 },{
2b5200a7
DS
2175 .subvendor = 0x107d,
2176 .subdevice = 0x665f,
2177 .card = CX88_BOARD_WINFAST_DTV1000,
7418f346
LB
2178 },{
2179 .subvendor = 0x1461,
2180 .subdevice = 0x000a,
2181 .card = CX88_BOARD_AVERTV_303,
0fa14aa6
ST
2182 },{
2183 .subvendor = 0x0070,
2184 .subdevice = 0x9200,
fb56cb65
ST
2185 .card = CX88_BOARD_HAUPPAUGE_NOVASE2_S1,
2186 },{
2187 .subvendor = 0x0070,
2188 .subdevice = 0x9201,
0fa14aa6
ST
2189 .card = CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1,
2190 },{
2191 .subvendor = 0x0070,
2192 .subdevice = 0x9202,
fb56cb65 2193 .card = CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1,
0e0351e3
VC
2194 },{
2195 .subvendor = 0x17de,
2196 .subdevice = 0x08b2,
2197 .card = CX88_BOARD_KWORLD_DVBS_100,
611900c1
ST
2198 },{
2199 .subvendor = 0x0070,
2200 .subdevice = 0x9400,
2201 .card = CX88_BOARD_HAUPPAUGE_HVR1100,
2202 },{
2203 .subvendor = 0x0070,
2204 .subdevice = 0x9402,
2205 .card = CX88_BOARD_HAUPPAUGE_HVR1100,
2206 },{
2207 .subvendor = 0x0070,
2208 .subdevice = 0x9800,
2209 .card = CX88_BOARD_HAUPPAUGE_HVR1100LP,
2210 },{
2211 .subvendor = 0x0070,
2212 .subdevice = 0x9802,
2213 .card = CX88_BOARD_HAUPPAUGE_HVR1100LP,
c432a072
ST
2214 },{
2215 .subvendor = 0x0070,
2216 .subdevice = 0x9001,
2217 .card = CX88_BOARD_HAUPPAUGE_DVB_T1,
fc40b261
CP
2218 },{
2219 .subvendor = 0x1822,
2220 .subdevice = 0x0025,
2221 .card = CX88_BOARD_DNTV_LIVE_DVB_T_PRO,
f39624fd 2222 },{
b9f4ad57
CP
2223 .subvendor = 0x17de,
2224 .subdevice = 0x08a1,
2225 .card = CX88_BOARD_KWORLD_DVB_T_CX22702,
43eabb4e
CP
2226 },{
2227 .subvendor = 0x18ac,
2228 .subdevice = 0xdb50,
2229 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL,
f74a6b39
MK
2230 },{
2231 .subvendor = 0x18ac,
2232 .subdevice = 0xdb54,
2233 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL,
2234 /* Re-branded DViCO: DigitalNow DVB-T Dual */
6bfb2e1f
MK
2235 },{
2236 .subvendor = 0x18ac,
2237 .subdevice = 0xdb11,
2238 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS,
2239 /* Re-branded DViCO: UltraView DVB-T Plus */
b3fb91d2
CP
2240 }, {
2241 .subvendor = 0x18ac,
2242 .subdevice = 0xdb30,
2243 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO,
2244 }, {
44256de1
MK
2245 .subvendor = 0x17de,
2246 .subdevice = 0x0840,
923da8a7
MK
2247 .card = CX88_BOARD_KWORLD_HARDWARE_MPEG_TV_XPERT,
2248 },{
2249 .subvendor = 0x1421,
2250 .subdevice = 0x0305,
44256de1 2251 .card = CX88_BOARD_KWORLD_HARDWARE_MPEG_TV_XPERT,
780dfef3
CP
2252 },{
2253 .subvendor = 0x18ac,
2254 .subdevice = 0xdb40,
2255 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID,
2256 },{
2257 .subvendor = 0x18ac,
2258 .subdevice = 0xdb44,
2259 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID,
da215d22
RS
2260 },{
2261 .subvendor = 0x7063,
2262 .subdevice = 0x5500,
2263 .card = CX88_BOARD_PCHDTV_HD5500,
b3038304
VZ
2264 },{
2265 .subvendor = 0x17de,
2266 .subdevice = 0x0841,
2267 .card = CX88_BOARD_KWORLD_MCE200_DELUXE,
fc066478
MK
2268 },{
2269 .subvendor = 0x1822,
2270 .subdevice = 0x0019,
2271 .card = CX88_BOARD_DNTV_LIVE_DVB_T_PRO,
a3124622
AM
2272 },{
2273 .subvendor = 0x1554,
2274 .subdevice = 0x4813,
2275 .card = CX88_BOARD_PIXELVIEW_PLAYTV_P7000,
680543c5
RC
2276 },{
2277 .subvendor = 0x14f1,
2278 .subdevice = 0x0842,
be4f4519 2279 .card = CX88_BOARD_NPGTECH_REALTV_TOP10FM,
4bd6e9d9
MV
2280 },{
2281 .subvendor = 0x107d,
2282 .subdevice = 0x665e,
2283 .card = CX88_BOARD_WINFAST_DTV2000H,
65271bff
MK
2284 },{
2285 .subvendor = 0x18ac,
2286 .subdevice = 0xd800, /* FusionHDTV 3 Gold (original revision) */
2287 .card = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q,
c02a34f4
SA
2288 },{
2289 .subvendor = 0x14f1,
2290 .subdevice = 0x0084,
2291 .card = CX88_BOARD_GENIATECH_DVBS,
ad10c930
ET
2292 },{
2293 .subvendor = 0x0070,
2294 .subdevice = 0x1404,
2295 .card = CX88_BOARD_HAUPPAUGE_HVR3000,
5dbaa2cb
MK
2296 },{
2297 .subvendor = 0x1461,
2298 .subdevice = 0xc111, /* AverMedia M150-D */
2299 /* This board is known to work with the ASUS PVR416 config */
2300 .card = CX88_BOARD_ASUS_PVR_416,
2acadefa
DB
2301 },{
2302 .subvendor = 0xc180,
2303 .subdevice = 0xc980,
2304 .card = CX88_BOARD_TE_DTV_250_OEM_SWANN,
aa481a65
ST
2305 },{
2306 .subvendor = 0x0070,
2307 .subdevice = 0x9600,
2308 .card = CX88_BOARD_HAUPPAUGE_HVR1300,
2309 },{
2310 .subvendor = 0x0070,
2311 .subdevice = 0x9601,
2312 .card = CX88_BOARD_HAUPPAUGE_HVR1300,
2313 },{
2314 .subvendor = 0x0070,
2315 .subdevice = 0x9602,
2316 .card = CX88_BOARD_HAUPPAUGE_HVR1300,
dab489df
MK
2317 },{
2318 .subvendor = 0x107d,
2319 .subdevice = 0x6632,
2320 .card = CX88_BOARD_LEADTEK_PVR2000,
4508f598
MK
2321 },{
2322 .subvendor = 0x12ab,
2323 .subdevice = 0x2300, /* Club3D Zap TV2100 */
2324 .card = CX88_BOARD_KWORLD_DVB_T_CX22702,
3979ecc7
ST
2325 },{
2326 .subvendor = 0x0070,
2327 .subdevice = 0x9000,
2328 .card = CX88_BOARD_HAUPPAUGE_DVB_T1,
76dc82ab
ST
2329 },{
2330 .subvendor = 0x0070,
2331 .subdevice = 0x1400,
2332 .card = CX88_BOARD_HAUPPAUGE_HVR3000,
2333 },{
2334 .subvendor = 0x0070,
2335 .subdevice = 0x1401,
2336 .card = CX88_BOARD_HAUPPAUGE_HVR3000,
2337 },{
2338 .subvendor = 0x0070,
2339 .subdevice = 0x1402,
2340 .card = CX88_BOARD_HAUPPAUGE_HVR3000,
733aeaf4
MK
2341 },{
2342 .subvendor = 0x1421,
2343 .subdevice = 0x0341, /* ADS Tech InstantTV DVB-S */
2344 .card = CX88_BOARD_KWORLD_DVBS_100,
7cb47a14
DG
2345 },{
2346 .subvendor = 0x1421,
2347 .subdevice = 0x0390,
2348 .card = CX88_BOARD_ADSTECH_PTV_390,
60464da8
ST
2349 },{
2350 .subvendor = 0x11bd,
2351 .subdevice = 0x0051,
2352 .card = CX88_BOARD_PINNACLE_PCTV_HD_800i,
5c00fac0
ST
2353 }, {
2354 .subvendor = 0x18ac,
2355 .subdevice = 0xd530,
2356 .card = CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO,
9507901e
MCC
2357 }, {
2358 .subvendor = 0x12ab,
2359 .subdevice = 0x1788,
2360 .card = CX88_BOARD_PINNACLE_HYBRID_PCTV,
2361 }, {
2362 .subvendor = 0x14f1,
2363 .subdevice = 0xea3d,
2364 .card = CX88_BOARD_POWERCOLOR_REAL_ANGEL,
2365 }, {
2366 .subvendor = 0x107d,
2367 .subdevice = 0x6f18,
2368 .card = CX88_BOARD_WINFAST_TV2000_XP_GLOBAL,
2369 }, {
2370 .subvendor = 0x14f1,
2371 .subdevice = 0x8852,
2372 .card = CX88_BOARD_GENIATECH_X8000_MT,
2422a9b3 2373 }, {
1117d6ba
ST
2374 .subvendor = 0x18ac,
2375 .subdevice = 0xd610,
2376 .card = CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD,
2422a9b3
MCC
2377 }, {
2378 .subvendor = 0x1554,
2379 .subdevice = 0x4935,
2380 .card = CX88_BOARD_PROLINK_PV_8000GT,
a31d2bb7
MCC
2381 }, {
2382 .subvendor = 0x1554,
2383 .subdevice = 0x4976,
2384 .card = CX88_BOARD_PROLINK_PV_GLOBAL_XTREME,
99e09eac
MCC
2385 }, {
2386 .subvendor = 0x17de,
2387 .subdevice = 0x08c1,
2388 .card = CX88_BOARD_KWORLD_ATSC_120,
5bd1b663
ST
2389 }, {
2390 .subvendor = 0x0070,
2391 .subdevice = 0x6900,
2392 .card = CX88_BOARD_HAUPPAUGE_HVR4000,
2393 }, {
2394 .subvendor = 0x0070,
2395 .subdevice = 0x6904,
2396 .card = CX88_BOARD_HAUPPAUGE_HVR4000,
2397 }, {
2398 .subvendor = 0x0070,
2399 .subdevice = 0x6902,
2400 .card = CX88_BOARD_HAUPPAUGE_HVR4000,
2401 }, {
2402 .subvendor = 0x0070,
2403 .subdevice = 0x6905,
2404 .card = CX88_BOARD_HAUPPAUGE_HVR4000LITE,
2405 }, {
2406 .subvendor = 0x0070,
2407 .subdevice = 0x6906,
2408 .card = CX88_BOARD_HAUPPAUGE_HVR4000LITE,
af832623 2409 }, {
e4aab64c
IL
2410 .subvendor = 0xd420,
2411 .subdevice = 0x9022,
2412 .card = CX88_BOARD_TEVII_S420,
2413 }, {
2414 .subvendor = 0xd460,
af832623
IL
2415 .subdevice = 0x9022,
2416 .card = CX88_BOARD_TEVII_S460,
4cd7fb87
OR
2417 }, {
2418 .subvendor = 0xA044,
2419 .subdevice = 0x2011,
2420 .card = CX88_BOARD_OMICOM_SS4_PCI,
4b29631d
IL
2421 }, {
2422 .subvendor = 0x8910,
2423 .subdevice = 0x8888,
2424 .card = CX88_BOARD_TBS_8910,
ee73042c
OR
2425 }, {
2426 .subvendor = 0x8920,
2427 .subdevice = 0x8888,
2428 .card = CX88_BOARD_TBS_8920,
cd3cde12
IL
2429 }, {
2430 .subvendor = 0xb022,
2431 .subdevice = 0x3022,
2432 .card = CX88_BOARD_PROF_6200,
57f51dbc
OR
2433 }, {
2434 .subvendor = 0xB033,
2435 .subdevice = 0x3033,
2436 .card = CX88_BOARD_PROF_7300,
4b29631d
IL
2437 }, {
2438 .subvendor = 0xb200,
2439 .subdevice = 0x4200,
2440 .card = CX88_BOARD_SATTRADE_ST4200,
70101a27
SW
2441 }, {
2442 .subvendor = 0x153b,
2443 .subdevice = 0x1177,
2444 .card = CX88_BOARD_TERRATEC_CINERGY_HT_PCI_MKII,
501d8cd4
ST
2445 }, {
2446 .subvendor = 0x0070,
2447 .subdevice = 0x9290,
2448 .card = CX88_BOARD_HAUPPAUGE_IRONLY,
3047a176
MS
2449 }, {
2450 .subvendor = 0x107d,
2451 .subdevice = 0x6654,
2452 .card = CX88_BOARD_WINFAST_DTV1800H,
14422f9d
MCC
2453 }, {
2454 /* PVR2000 PAL Model [107d:6630] */
2455 .subvendor = 0x107d,
2456 .subdevice = 0x6630,
2457 .card = CX88_BOARD_LEADTEK_PVR2000,
2458 }, {
2459 /* PVR2000 PAL Model [107d:6638] */
2460 .subvendor = 0x107d,
2461 .subdevice = 0x6638,
2462 .card = CX88_BOARD_LEADTEK_PVR2000,
2463 }, {
2464 /* PVR2000 NTSC Model [107d:6631] */
2465 .subvendor = 0x107d,
2466 .subdevice = 0x6631,
2467 .card = CX88_BOARD_LEADTEK_PVR2000,
2468 }, {
2469 /* PVR2000 NTSC Model [107d:6637] */
2470 .subvendor = 0x107d,
2471 .subdevice = 0x6637,
2472 .card = CX88_BOARD_LEADTEK_PVR2000,
2473 }, {
2474 /* PVR2000 NTSC Model [107d:663d] */
2475 .subvendor = 0x107d,
2476 .subdevice = 0x663d,
2477 .card = CX88_BOARD_LEADTEK_PVR2000,
2478 }, {
2479 /* DV2000 NTSC Model [107d:6621] */
2480 .subvendor = 0x107d,
2481 .subdevice = 0x6621,
2482 .card = CX88_BOARD_WINFAST_DV2000,
2483 }, {
2484 /* TV2000 XP Global [107d:6618] */
2485 .subvendor = 0x107d,
2486 .subdevice = 0x6618,
2487 .card = CX88_BOARD_WINFAST_TV2000_XP_GLOBAL,
2422a9b3 2488 },
1da177e4 2489};
1da177e4
LT
2490
2491/* ----------------------------------------------------------------------- */
2492/* some leadtek specific stuff */
2493
69f7e75a 2494static void leadtek_eeprom(struct cx88_core *core, u8 *eeprom_data)
1da177e4 2495{
1da177e4
LT
2496 if (eeprom_data[4] != 0x7d ||
2497 eeprom_data[5] != 0x10 ||
2498 eeprom_data[7] != 0x66) {
0f19e65b 2499 warn_printk(core, "Leadtek eeprom invalid.\n");
1da177e4
LT
2500 return;
2501 }
2502
14422f9d
MCC
2503 /* Terry Wu <terrywu2009@gmail.com> */
2504 switch (eeprom_data[6]) {
2505 case 0x13: /* SSID 6613 for TV2000 XP Expert NTSC Model */
2506 case 0x21: /* SSID 6621 for DV2000 NTSC Model */
2507 case 0x31: /* SSID 6631 for PVR2000 NTSC Model */
2508 case 0x37: /* SSID 6637 for PVR2000 NTSC Model */
2509 case 0x3d: /* SSID 6637 for PVR2000 NTSC Model */
2510 core->board.tuner_type = TUNER_PHILIPS_FM1236_MK3;
2511 break;
2512 default:
2513 core->board.tuner_type = TUNER_PHILIPS_FM1216ME_MK3;
2514 break;
2515 }
1da177e4 2516
0f19e65b
MCC
2517 info_printk(core, "Leadtek Winfast 2000XP Expert config: "
2518 "tuner=%d, eeprom[0]=0x%02x\n",
2519 core->board.tuner_type, eeprom_data[0]);
1da177e4
LT
2520}
2521
1da177e4
LT
2522static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data)
2523{
2524 struct tveeprom tv;
2525
0f97a931 2526 tveeprom_hauppauge_analog(&core->i2c_client, &tv, eeprom_data);
6a59d64c 2527 core->board.tuner_type = tv.tuner_type;
0345c387 2528 core->tuner_formats = tv.tuner_formats;
6a59d64c 2529 core->board.radio.type = tv.has_radio ? CX88_RADIO : 0;
1da177e4
LT
2530
2531 /* Make sure we support the board model */
3ca0ea98
ST
2532 switch (tv.model)
2533 {
76dc82ab
ST
2534 case 14009: /* WinTV-HVR3000 (Retail, IR, b/panel video, 3.5mm audio in) */
2535 case 14019: /* WinTV-HVR3000 (Retail, IR Blaster, b/panel video, 3.5mm audio in) */
2536 case 14029: /* WinTV-HVR3000 (Retail, IR, b/panel video, 3.5mm audio in - 880 bridge) */
2537 case 14109: /* WinTV-HVR3000 (Retail, IR, b/panel video, 3.5mm audio in - low profile) */
2538 case 14129: /* WinTV-HVR3000 (Retail, IR, b/panel video, 3.5mm audio in - 880 bridge - LP) */
2539 case 14559: /* WinTV-HVR3000 (OEM, no IR, b/panel video, 3.5mm audio in) */
ad10c930 2540 case 14569: /* WinTV-HVR3000 (OEM, no IR, no back panel video) */
76dc82ab
ST
2541 case 14659: /* WinTV-HVR3000 (OEM, no IR, b/panel video, RCA audio in - Low profile) */
2542 case 14669: /* WinTV-HVR3000 (OEM, no IR, no b/panel video - Low profile) */
0345c387 2543 case 28552: /* WinTV-PVR 'Roslyn' (No IR) */
42d2b6ef 2544 case 34519: /* WinTV-PCI-FM */
5bd1b663
ST
2545 case 69009:
2546 /* WinTV-HVR4000 (DVBS/S2/T, Video and IR, back panel inputs) */
2547 case 69100: /* WinTV-HVR4000LITE (DVBS/S2, IR) */
2548 case 69500: /* WinTV-HVR4000LITE (DVBS/S2, No IR) */
2549 case 69559:
2550 /* WinTV-HVR4000 (DVBS/S2/T, Video no IR, back panel inputs) */
2551 case 69569: /* WinTV-HVR4000 (DVBS/S2/T, Video no IR) */
759324c3 2552 case 90002: /* Nova-T-PCI (9002) */
0fe22865
ST
2553 case 92001: /* Nova-S-Plus (Video and IR) */
2554 case 92002: /* Nova-S-Plus (Video and IR) */
2555 case 90003: /* Nova-T-PCI (9002 No RF out) */
759324c3
ST
2556 case 90500: /* Nova-T-PCI (oem) */
2557 case 90501: /* Nova-T-PCI (oem/IR) */
3ca0ea98 2558 case 92000: /* Nova-SE2 (OEM, No Video or IR) */
501d8cd4 2559 case 92900: /* WinTV-IROnly (No analog or digital Video inputs) */
611900c1
ST
2560 case 94009: /* WinTV-HVR1100 (Video and IR Retail) */
2561 case 94501: /* WinTV-HVR1100 (Video and IR OEM) */
aa481a65
ST
2562 case 96009: /* WinTV-HVR1300 (PAL Video, MPEG Video and IR RX) */
2563 case 96019: /* WinTV-HVR1300 (PAL Video, MPEG Video and IR RX/TX) */
2564 case 96559: /* WinTV-HVR1300 (PAL Video, MPEG Video no IR) */
2565 case 96569: /* WinTV-HVR1300 () */
2566 case 96659: /* WinTV-HVR1300 () */
611900c1 2567 case 98559: /* WinTV-HVR1100LP (Video no IR, Retail - Low Profile) */
1da177e4
LT
2568 /* known */
2569 break;
2570 default:
0f19e65b
MCC
2571 warn_printk(core, "warning: unknown hauppauge model #%d\n",
2572 tv.model);
1da177e4
LT
2573 break;
2574 }
2575
0f19e65b 2576 info_printk(core, "hauppauge eeprom: model=%d\n", tv.model);
1da177e4
LT
2577}
2578
2579/* ----------------------------------------------------------------------- */
2580/* some GDI (was: Modular Technology) specific stuff */
2581
2582static struct {
2583 int id;
2584 int fm;
2585 char *name;
2586} gdi_tuner[] = {
2587 [ 0x01 ] = { .id = TUNER_ABSENT,
2588 .name = "NTSC_M" },
2589 [ 0x02 ] = { .id = TUNER_ABSENT,
2590 .name = "PAL_B" },
2591 [ 0x03 ] = { .id = TUNER_ABSENT,
2592 .name = "PAL_I" },
2593 [ 0x04 ] = { .id = TUNER_ABSENT,
2594 .name = "PAL_D" },
2595 [ 0x05 ] = { .id = TUNER_ABSENT,
2596 .name = "SECAM" },
2597
2598 [ 0x10 ] = { .id = TUNER_ABSENT,
2599 .fm = 1,
2600 .name = "TEMIC_4049" },
2601 [ 0x11 ] = { .id = TUNER_TEMIC_4136FY5,
2602 .name = "TEMIC_4136" },
2603 [ 0x12 ] = { .id = TUNER_ABSENT,
2604 .name = "TEMIC_4146" },
2605
2606 [ 0x20 ] = { .id = TUNER_PHILIPS_FQ1216ME,
2607 .fm = 1,
2608 .name = "PHILIPS_FQ1216_MK3" },
2609 [ 0x21 ] = { .id = TUNER_ABSENT, .fm = 1,
2610 .name = "PHILIPS_FQ1236_MK3" },
2611 [ 0x22 ] = { .id = TUNER_ABSENT,
2612 .name = "PHILIPS_FI1236_MK3" },
2613 [ 0x23 ] = { .id = TUNER_ABSENT,
2614 .name = "PHILIPS_FI1216_MK3" },
2615};
2616
2617static void gdi_eeprom(struct cx88_core *core, u8 *eeprom_data)
2618{
2619 char *name = (eeprom_data[0x0d] < ARRAY_SIZE(gdi_tuner))
2620 ? gdi_tuner[eeprom_data[0x0d]].name : NULL;
2621
0f19e65b 2622 info_printk(core, "GDI: tuner=%s\n", name ? name : "unknown");
1da177e4
LT
2623 if (NULL == name)
2624 return;
6a59d64c
TP
2625 core->board.tuner_type = gdi_tuner[eeprom_data[0x0d]].id;
2626 core->board.radio.type = gdi_tuner[eeprom_data[0x0d]].fm ?
2627 CX88_RADIO : 0;
1da177e4
LT
2628}
2629
b3fb91d2
CP
2630/* ------------------------------------------------------------------- */
2631/* some Divco specific stuff */
0be51b46
MCC
2632static int cx88_dvico_xc2028_callback(struct cx88_core *core,
2633 int command, int arg)
b3fb91d2 2634{
b3fb91d2
CP
2635 switch (command) {
2636 case XC2028_TUNER_RESET:
d7cba043
MK
2637 switch (core->boardnr) {
2638 case CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO:
2639 /* GPIO-4 xc3028 tuner */
2640
2641 cx_set(MO_GP0_IO, 0x00001000);
2642 cx_clear(MO_GP0_IO, 0x00000010);
2643 msleep(100);
2644 cx_set(MO_GP0_IO, 0x00000010);
2645 msleep(100);
2646 break;
2647 default:
2648 cx_write(MO_GP0_IO, 0x101000);
2649 mdelay(5);
2650 cx_set(MO_GP0_IO, 0x101010);
2651 }
b3fb91d2
CP
2652 break;
2653 default:
2654 return -EINVAL;
2655 }
2656
2657 return 0;
2658}
2659
2660
9507901e
MCC
2661/* ----------------------------------------------------------------------- */
2662/* some Geniatech specific stuff */
2663
0be51b46
MCC
2664static int cx88_xc3028_geniatech_tuner_callback(struct cx88_core *core,
2665 int command, int mode)
9507901e 2666{
9507901e
MCC
2667 switch (command) {
2668 case XC2028_TUNER_RESET:
2669 switch (INPUT(core->input).type) {
2670 case CX88_RADIO:
c450e50e 2671 break;
9507901e
MCC
2672 case CX88_VMUX_DVB:
2673 cx_write(MO_GP1_IO, 0x030302);
2674 mdelay(50);
c450e50e 2675 break;
9507901e
MCC
2676 default:
2677 cx_write(MO_GP1_IO, 0x030301);
2678 mdelay(50);
c450e50e
MCC
2679 }
2680 cx_write(MO_GP1_IO, 0x101010);
2681 mdelay(50);
2682 cx_write(MO_GP1_IO, 0x101000);
2683 mdelay(50);
2684 cx_write(MO_GP1_IO, 0x101010);
2685 mdelay(50);
2686 return 0;
9507901e
MCC
2687 }
2688 return -EINVAL;
2689}
2690
3047a176
MS
2691static int cx88_xc3028_winfast1800h_callback(struct cx88_core *core,
2692 int command, int arg)
2693{
2694 switch (command) {
2695 case XC2028_TUNER_RESET:
2696 /* GPIO 12 (xc3028 tuner reset) */
2697 cx_set(MO_GP1_IO, 0x1010);
2698 mdelay(50);
2699 cx_clear(MO_GP1_IO, 0x10);
2700 mdelay(50);
2701 cx_set(MO_GP1_IO, 0x10);
2702 mdelay(50);
2703 return 0;
2704 }
2705 return -EINVAL;
2706}
2707
2422a9b3
MCC
2708/* ------------------------------------------------------------------- */
2709/* some Divco specific stuff */
0be51b46
MCC
2710static int cx88_pv_8000gt_callback(struct cx88_core *core,
2711 int command, int arg)
2422a9b3 2712{
2422a9b3
MCC
2713 switch (command) {
2714 case XC2028_TUNER_RESET:
2715 cx_write(MO_GP2_IO, 0xcf7);
2716 mdelay(50);
2717 cx_write(MO_GP2_IO, 0xef5);
2718 mdelay(50);
2719 cx_write(MO_GP2_IO, 0xcf7);
2720 break;
2721 default:
2722 return -EINVAL;
2723 }
2724
2725 return 0;
2726}
2727
780dfef3
CP
2728/* ----------------------------------------------------------------------- */
2729/* some DViCO specific stuff */
2730
2731static void dvico_fusionhdtv_hybrid_init(struct cx88_core *core)
2732{
2733 struct i2c_msg msg = { .addr = 0x45, .flags = 0 };
2734 int i, err;
69b27e3d 2735 static u8 init_bufs[13][5] = {
780dfef3
CP
2736 { 0x10, 0x00, 0x20, 0x01, 0x03 },
2737 { 0x10, 0x10, 0x01, 0x00, 0x21 },
2738 { 0x10, 0x10, 0x10, 0x00, 0xCA },
2739 { 0x10, 0x10, 0x12, 0x00, 0x08 },
2740 { 0x10, 0x10, 0x13, 0x00, 0x0A },
2741 { 0x10, 0x10, 0x16, 0x01, 0xC0 },
2742 { 0x10, 0x10, 0x22, 0x01, 0x3D },
2743 { 0x10, 0x10, 0x73, 0x01, 0x2E },
2744 { 0x10, 0x10, 0x72, 0x00, 0xC5 },
2745 { 0x10, 0x10, 0x71, 0x01, 0x97 },
2746 { 0x10, 0x10, 0x70, 0x00, 0x0F },
2747 { 0x10, 0x10, 0xB0, 0x00, 0x01 },
2748 { 0x03, 0x0C },
2749 };
2750
5b9c4e6d 2751 for (i = 0; i < ARRAY_SIZE(init_bufs); i++) {
780dfef3
CP
2752 msg.buf = init_bufs[i];
2753 msg.len = (i != 12 ? 5 : 2);
2754 err = i2c_transfer(&core->i2c_adap, &msg, 1);
2755 if (err != 1) {
0f19e65b
MCC
2756 warn_printk(core, "dvico_fusionhdtv_hybrid_init buf %d "
2757 "failed (err = %d)!\n", i, err);
780dfef3
CP
2758 return;
2759 }
2760 }
2761}
2762
0be51b46
MCC
2763static int cx88_xc2028_tuner_callback(struct cx88_core *core,
2764 int command, int arg)
c2cb8fcc 2765{
9507901e
MCC
2766 /* Board-specific callbacks */
2767 switch (core->boardnr) {
9507901e
MCC
2768 case CX88_BOARD_POWERCOLOR_REAL_ANGEL:
2769 case CX88_BOARD_GENIATECH_X8000_MT:
99e09eac 2770 case CX88_BOARD_KWORLD_ATSC_120:
0be51b46
MCC
2771 return cx88_xc3028_geniatech_tuner_callback(core,
2772 command, arg);
2422a9b3 2773 case CX88_BOARD_PROLINK_PV_8000GT:
a31d2bb7 2774 case CX88_BOARD_PROLINK_PV_GLOBAL_XTREME:
0be51b46 2775 return cx88_pv_8000gt_callback(core, command, arg);
b3fb91d2 2776 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO:
d7cba043 2777 case CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO:
0be51b46 2778 return cx88_dvico_xc2028_callback(core, command, arg);
14422f9d 2779 case CX88_BOARD_WINFAST_TV2000_XP_GLOBAL:
3047a176
MS
2780 case CX88_BOARD_WINFAST_DTV1800H:
2781 return cx88_xc3028_winfast1800h_callback(core, command, arg);
9507901e
MCC
2782 }
2783
c2cb8fcc
MCC
2784 switch (command) {
2785 case XC2028_TUNER_RESET:
c2cb8fcc
MCC
2786 switch (INPUT(core->input).type) {
2787 case CX88_RADIO:
0f19e65b 2788 info_printk(core, "setting GPIO to radio!\n");
c2cb8fcc
MCC
2789 cx_write(MO_GP0_IO, 0x4ff);
2790 mdelay(250);
2791 cx_write(MO_GP2_IO, 0xff);
2792 mdelay(250);
c450e50e 2793 break;
c2cb8fcc
MCC
2794 case CX88_VMUX_DVB: /* Digital TV*/
2795 default: /* Analog TV */
0f19e65b 2796 info_printk(core, "setting GPIO to TV!\n");
c450e50e 2797 break;
c2cb8fcc 2798 }
c450e50e
MCC
2799 cx_write(MO_GP1_IO, 0x101010);
2800 mdelay(250);
2801 cx_write(MO_GP1_IO, 0x101000);
2802 mdelay(250);
2803 cx_write(MO_GP1_IO, 0x101010);
2804 mdelay(250);
2805 return 0;
c2cb8fcc
MCC
2806 }
2807 return -EINVAL;
2808}
2809
60464da8
ST
2810/* ----------------------------------------------------------------------- */
2811/* Tuner callback function. Currently only needed for the Pinnacle *
2812 * PCTV HD 800i with an xc5000 sillicon tuner. This is used for both *
2813 * analog tuner attach (tuner-core.c) and dvb tuner attach (cx88-dvb.c) */
2814
0be51b46
MCC
2815static int cx88_xc5000_tuner_callback(struct cx88_core *core,
2816 int command, int arg)
60464da8 2817{
c2cb8fcc 2818 switch (core->boardnr) {
60464da8 2819 case CX88_BOARD_PINNACLE_PCTV_HD_800i:
c2cb8fcc 2820 if (command == 0) { /* This is the reset command from xc5000 */
b8d91986
DH
2821
2822 /* djh - According to the engineer at PCTV Systems,
2823 the xc5000 reset pin is supposed to be on GPIO12.
2824 However, despite three nights of effort, pulling
2825 that GPIO low didn't reset the xc5000. While
2826 pulling MO_SRST_IO low does reset the xc5000, this
2827 also resets in the s5h1409 being reset as well.
2828 This causes tuning to always fail since the internal
2829 state of the s5h1409 does not match the driver's
2830 state. Given that the only two conditions in which
2831 the driver performs a reset is during firmware load
2832 and powering down the chip, I am taking out the
2833 reset. We know that the chip is being reset
2834 when the cx88 comes online, and not being able to
2835 do power management for this board is worse than
2836 not having any tuning at all. */
60464da8 2837 return 0;
c2cb8fcc 2838 } else {
0f19e65b
MCC
2839 err_printk(core, "xc5000: unknown tuner "
2840 "callback command.\n");
60464da8
ST
2841 return -EINVAL;
2842 }
2843 break;
1117d6ba
ST
2844 case CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD:
2845 if (command == 0) { /* This is the reset command from xc5000 */
2846 cx_clear(MO_GP0_IO, 0x00000010);
2847 msleep(10);
2848 cx_set(MO_GP0_IO, 0x00000010);
2849 return 0;
2850 } else {
2851 printk(KERN_ERR
2852 "xc5000: unknown tuner callback command.\n");
2853 return -EINVAL;
2854 }
2855 break;
60464da8
ST
2856 }
2857 return 0; /* Should never be here */
2858}
c2cb8fcc 2859
d7cba043 2860int cx88_tuner_callback(void *priv, int component, int command, int arg)
c2cb8fcc
MCC
2861{
2862 struct i2c_algo_bit_data *i2c_algo = priv;
0be51b46
MCC
2863 struct cx88_core *core;
2864
2865 if (!i2c_algo) {
2866 printk(KERN_ERR "cx88: Error - i2c private data undefined.\n");
2867 return -EINVAL;
2868 }
2869
2870 core = i2c_algo->data;
2871
2872 if (!core) {
2873 printk(KERN_ERR "cx88: Error - device struct undefined.\n");
2874 return -EINVAL;
2875 }
c2cb8fcc 2876
d7cba043
MK
2877 if (component != DVB_FRONTEND_COMPONENT_TUNER)
2878 return -EINVAL;
2879
c2cb8fcc
MCC
2880 switch (core->board.tuner_type) {
2881 case TUNER_XC2028:
0f19e65b 2882 info_printk(core, "Calling XC2028/3028 callback\n");
0be51b46 2883 return cx88_xc2028_tuner_callback(core, command, arg);
c2cb8fcc 2884 case TUNER_XC5000:
0f19e65b 2885 info_printk(core, "Calling XC5000 callback\n");
0be51b46 2886 return cx88_xc5000_tuner_callback(core, command, arg);
c2cb8fcc 2887 }
0f19e65b
MCC
2888 err_printk(core, "Error: Calling callback for tuner %d\n",
2889 core->board.tuner_type);
c2cb8fcc
MCC
2890 return -EINVAL;
2891}
60464da8
ST
2892EXPORT_SYMBOL(cx88_tuner_callback);
2893
1da177e4
LT
2894/* ----------------------------------------------------------------------- */
2895
bbc83597 2896static void cx88_card_list(struct cx88_core *core, struct pci_dev *pci)
1da177e4
LT
2897{
2898 int i;
2899
2900 if (0 == pci->subsystem_vendor &&
2901 0 == pci->subsystem_device) {
0f19e65b
MCC
2902 printk(KERN_ERR
2903 "%s: Your board has no valid PCI Subsystem ID and thus can't\n"
1da177e4
LT
2904 "%s: be autodetected. Please pass card=<n> insmod option to\n"
2905 "%s: workaround that. Redirect complaints to the vendor of\n"
2906 "%s: the TV card. Best regards,\n"
2907 "%s: -- tux\n",
2908 core->name,core->name,core->name,core->name,core->name);
2909 } else {
0f19e65b
MCC
2910 printk(KERN_ERR
2911 "%s: Your board isn't known (yet) to the driver. You can\n"
1da177e4
LT
2912 "%s: try to pick one of the existing card configs via\n"
2913 "%s: card=<n> insmod option. Updating to the latest\n"
2914 "%s: version might help as well.\n",
2915 core->name,core->name,core->name,core->name);
2916 }
0f19e65b
MCC
2917 err_printk(core, "Here is a list of valid choices for the card=<n> "
2918 "insmod option:\n");
bbc83597 2919 for (i = 0; i < ARRAY_SIZE(cx88_boards); i++)
0f19e65b 2920 printk(KERN_ERR "%s: card=%d -> %s\n",
1da177e4
LT
2921 core->name, i, cx88_boards[i].name);
2922}
2923
bbc83597 2924static void cx88_card_setup_pre_i2c(struct cx88_core *core)
aa481a65 2925{
6a59d64c 2926 switch (core->boardnr) {
aa481a65 2927 case CX88_BOARD_HAUPPAUGE_HVR1300:
2491fbb7
ST
2928 /*
2929 * Bring the 702 demod up before i2c scanning/attach or devices are hidden
2930 * We leave here with the 702 on the bus
2931 *
2932 * "reset the IR receiver on GPIO[3]"
2933 * Reported by Mike Crash <mike AT mikecrash.com>
2934 */
2935 cx_write(MO_GP0_IO, 0x0000ef88);
aa481a65 2936 udelay(1000);
2491fbb7 2937 cx_clear(MO_GP0_IO, 0x00000088);
aa481a65 2938 udelay(50);
2491fbb7 2939 cx_set(MO_GP0_IO, 0x00000088); /* 702 out of reset */
aa481a65
ST
2940 udelay(1000);
2941 break;
2422a9b3 2942
a31d2bb7 2943 case CX88_BOARD_PROLINK_PV_GLOBAL_XTREME:
2422a9b3
MCC
2944 case CX88_BOARD_PROLINK_PV_8000GT:
2945 cx_write(MO_GP2_IO, 0xcf7);
2946 mdelay(50);
2947 cx_write(MO_GP2_IO, 0xef5);
2948 mdelay(50);
2949 cx_write(MO_GP2_IO, 0xcf7);
2950 msleep(10);
2951 break;
2952
2491fbb7 2953 case CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD:
1117d6ba
ST
2954 /* Enable the xc5000 tuner */
2955 cx_set(MO_GP0_IO, 0x00001010);
2956 break;
2491fbb7
ST
2957
2958 case CX88_BOARD_HAUPPAUGE_HVR3000:
5bd1b663 2959 case CX88_BOARD_HAUPPAUGE_HVR4000:
2491fbb7
ST
2960 /* Init GPIO */
2961 cx_write(MO_GP0_IO, core->board.input[0].gpio0);
5bd1b663 2962 udelay(1000);
2f3af9e6
DB
2963 cx_clear(MO_GP0_IO, 0x00000080);
2964 udelay(50);
2965 cx_set(MO_GP0_IO, 0x00000080); /* 702 out of reset */
2966 udelay(1000);
2491fbb7 2967 break;
3047a176 2968
14422f9d 2969 case CX88_BOARD_WINFAST_TV2000_XP_GLOBAL:
3047a176
MS
2970 case CX88_BOARD_WINFAST_DTV1800H:
2971 /* GPIO 12 (xc3028 tuner reset) */
2972 cx_set(MO_GP1_IO, 0x1010);
2973 mdelay(50);
2974 cx_clear(MO_GP1_IO, 0x10);
2975 mdelay(50);
2976 cx_set(MO_GP1_IO, 0x10);
2977 mdelay(50);
2978 break;
aa481a65
ST
2979 }
2980}
2981
99e09eac
MCC
2982/*
2983 * Sets board-dependent xc3028 configuration
2984 */
2985void cx88_setup_xc3028(struct cx88_core *core, struct xc2028_ctrl *ctl)
2986{
2987 memset(ctl, 0, sizeof(*ctl));
2988
2989 ctl->fname = XC2028_DEFAULT_FIRMWARE;
2990 ctl->max_len = 64;
2991
2992 switch (core->boardnr) {
2993 case CX88_BOARD_POWERCOLOR_REAL_ANGEL:
a9606ce6
DG
2994 /* Now works with firmware version 2.7 */
2995 if (core->i2c_algo.udelay < 16)
2996 core->i2c_algo.udelay = 16;
99e09eac
MCC
2997 break;
2998 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO:
3047a176 2999 case CX88_BOARD_WINFAST_DTV1800H:
19c309e3 3000 ctl->demod = XC3028_FE_ZARLINK456;
99e09eac
MCC
3001 break;
3002 case CX88_BOARD_KWORLD_ATSC_120:
3003 case CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO:
3004 ctl->demod = XC3028_FE_OREN538;
3005 break;
93b99923
DH
3006 case CX88_BOARD_GENIATECH_X8000_MT:
3007 /* FIXME: For this board, the xc3028 never recovers after being
3008 powered down (the reset GPIO probably is not set properly).
3009 We don't have access to the hardware so we cannot determine
3010 which GPIO is used for xc3028, so just disable power xc3028
3011 power management for now */
3012 ctl->disable_power_mgmt = 1;
3013 break;
14422f9d 3014 case CX88_BOARD_WINFAST_TV2000_XP_GLOBAL:
a31d2bb7 3015 case CX88_BOARD_PROLINK_PV_GLOBAL_XTREME:
99e09eac
MCC
3016 case CX88_BOARD_PROLINK_PV_8000GT:
3017 /*
a31d2bb7 3018 * Those boards uses non-MTS firmware
99e09eac
MCC
3019 */
3020 break;
3f6014fc 3021 case CX88_BOARD_PINNACLE_HYBRID_PCTV:
70101a27 3022 case CX88_BOARD_TERRATEC_CINERGY_HT_PCI_MKII:
3f6014fc
SV
3023 ctl->demod = XC3028_FE_ZARLINK456;
3024 ctl->mts = 1;
3025 break;
99e09eac
MCC
3026 default:
3027 ctl->demod = XC3028_FE_OREN538;
3028 ctl->mts = 1;
3029 }
3030}
3031EXPORT_SYMBOL_GPL(cx88_setup_xc3028);
3032
bbc83597 3033static void cx88_card_setup(struct cx88_core *core)
1da177e4 3034{
3ca0ea98 3035 static u8 eeprom[256];
4bf1226a
MCC
3036 struct tuner_setup tun_setup;
3037 unsigned int mode_mask = T_RADIO |
3038 T_ANALOG_TV |
3039 T_DIGITAL_TV;
3040
3041 memset(&tun_setup, 0, sizeof(tun_setup));
1da177e4
LT
3042
3043 if (0 == core->i2c_rc) {
3044 core->i2c_client.addr = 0xa0 >> 1;
4bf1226a 3045 tveeprom_read(&core->i2c_client, eeprom, sizeof(eeprom));
1da177e4
LT
3046 }
3047
6a59d64c 3048 switch (core->boardnr) {
1da177e4
LT
3049 case CX88_BOARD_HAUPPAUGE:
3050 case CX88_BOARD_HAUPPAUGE_ROSLYN:
3051 if (0 == core->i2c_rc)
4bf1226a 3052 hauppauge_eeprom(core, eeprom+8);
1da177e4
LT
3053 break;
3054 case CX88_BOARD_GDI:
3055 if (0 == core->i2c_rc)
4bf1226a 3056 gdi_eeprom(core, eeprom);
1da177e4 3057 break;
14422f9d
MCC
3058 case CX88_BOARD_LEADTEK_PVR2000:
3059 case CX88_BOARD_WINFAST_DV2000:
1da177e4
LT
3060 case CX88_BOARD_WINFAST2000XP_EXPERT:
3061 if (0 == core->i2c_rc)
4bf1226a 3062 leadtek_eeprom(core, eeprom);
1da177e4 3063 break;
0fa14aa6
ST
3064 case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1:
3065 case CX88_BOARD_HAUPPAUGE_NOVASE2_S1:
1da177e4 3066 case CX88_BOARD_HAUPPAUGE_DVB_T1:
611900c1
ST
3067 case CX88_BOARD_HAUPPAUGE_HVR1100:
3068 case CX88_BOARD_HAUPPAUGE_HVR1100LP:
ad10c930 3069 case CX88_BOARD_HAUPPAUGE_HVR3000:
aa481a65 3070 case CX88_BOARD_HAUPPAUGE_HVR1300:
5bd1b663
ST
3071 case CX88_BOARD_HAUPPAUGE_HVR4000:
3072 case CX88_BOARD_HAUPPAUGE_HVR4000LITE:
501d8cd4 3073 case CX88_BOARD_HAUPPAUGE_IRONLY:
1da177e4 3074 if (0 == core->i2c_rc)
4bf1226a 3075 hauppauge_eeprom(core, eeprom);
1da177e4 3076 break;
0e0351e3
VC
3077 case CX88_BOARD_KWORLD_DVBS_100:
3078 cx_write(MO_GP0_IO, 0x000007f8);
3079 cx_write(MO_GP1_IO, 0x00000001);
3080 break;
8765561f
CP
3081 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO:
3082 /* GPIO0:0 is hooked to demod reset */
3083 /* GPIO0:4 is hooked to xc3028 reset */
3084 cx_write(MO_GP0_IO, 0x00111100);
3085 msleep(1);
3086 cx_write(MO_GP0_IO, 0x00111111);
3087 break;
d536e9c4
CP
3088 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL:
3089 /* GPIO0:6 is hooked to FX2 reset pin */
3090 cx_set(MO_GP0_IO, 0x00004040);
3091 cx_clear(MO_GP0_IO, 0x00000040);
3092 msleep(1000);
3093 cx_set(MO_GP0_IO, 0x00004040);
3094 /* FALLTHROUGH */
1da177e4
LT
3095 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1:
3096 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS:
780dfef3 3097 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID:
1da177e4
LT
3098 /* GPIO0:0 is hooked to mt352 reset pin */
3099 cx_set(MO_GP0_IO, 0x00000101);
3100 cx_clear(MO_GP0_IO, 0x00000001);
3101 msleep(1);
3102 cx_set(MO_GP0_IO, 0x00000101);
780dfef3 3103 if (0 == core->i2c_rc &&
6a59d64c 3104 core->boardnr == CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID)
780dfef3 3105 dvico_fusionhdtv_hybrid_init(core);
1da177e4
LT
3106 break;
3107 case CX88_BOARD_KWORLD_DVB_T:
3108 case CX88_BOARD_DNTV_LIVE_DVB_T:
3109 cx_set(MO_GP0_IO, 0x00000707);
3110 cx_set(MO_GP2_IO, 0x00000101);
3111 cx_clear(MO_GP2_IO, 0x00000001);
3112 msleep(1);
3113 cx_clear(MO_GP0_IO, 0x00000007);
3114 cx_set(MO_GP2_IO, 0x00000101);
3115 break;
fc40b261
CP
3116 case CX88_BOARD_DNTV_LIVE_DVB_T_PRO:
3117 cx_write(MO_GP0_IO, 0x00080808);
3118 break;
e976f937
KL
3119 case CX88_BOARD_ATI_HDTVWONDER:
3120 if (0 == core->i2c_rc) {
3121 /* enable tuner */
3122 int i;
5b9c4e6d
MCC
3123 static const u8 buffer [][2] = {
3124 {0x10,0x12},
3125 {0x13,0x04},
3126 {0x16,0x00},
3127 {0x14,0x04},
3128 {0x17,0x00}
3129 };
e976f937 3130 core->i2c_client.addr = 0x0a;
e976f937 3131
5b9c4e6d
MCC
3132 for (i = 0; i < ARRAY_SIZE(buffer); i++)
3133 if (2 != i2c_master_send(&core->i2c_client,
3134 buffer[i],2))
0f19e65b
MCC
3135 warn_printk(core, "Unable to enable "
3136 "tuner(%i).\n", i);
e976f937
KL
3137 }
3138 break;
55c88610
MCC
3139 case CX88_BOARD_MSI_TVANYWHERE_MASTER:
3140 {
3141 struct v4l2_priv_tun_config tea5767_cfg;
3142 struct tea5767_ctrl ctl;
3143
3144 memset(&ctl, 0, sizeof(ctl));
3145
3146 ctl.high_cut = 1;
3147 ctl.st_noise = 1;
3148 ctl.deemph_75 = 1;
3149 ctl.xtal_freq = TEA5767_HIGH_LO_13MHz;
3150
3151 tea5767_cfg.tuner = TUNER_TEA5767;
3152 tea5767_cfg.priv = &ctl;
3153
b8341e1d 3154 call_all(core, tuner, s_config, &tea5767_cfg);
af832623 3155 break;
55c88610 3156 }
e4aab64c 3157 case CX88_BOARD_TEVII_S420:
af832623 3158 case CX88_BOARD_TEVII_S460:
4cd7fb87 3159 case CX88_BOARD_OMICOM_SS4_PCI:
4b29631d 3160 case CX88_BOARD_TBS_8910:
ee73042c 3161 case CX88_BOARD_TBS_8920:
cd3cde12 3162 case CX88_BOARD_PROF_6200:
57f51dbc 3163 case CX88_BOARD_PROF_7300:
4b29631d 3164 case CX88_BOARD_SATTRADE_ST4200:
ee73042c
OR
3165 cx_write(MO_SRST_IO, 0);
3166 msleep(100);
3167 cx_write(MO_SRST_IO, 1);
3168 msleep(100);
3169 break;
4bf1226a
MCC
3170 } /*end switch() */
3171
3172
3173 /* Setup tuners */
3174 if ((core->board.radio_type != UNSET)) {
3175 tun_setup.mode_mask = T_RADIO;
3176 tun_setup.type = core->board.radio_type;
3177 tun_setup.addr = core->board.radio_addr;
3178 tun_setup.tuner_callback = cx88_tuner_callback;
b8341e1d 3179 call_all(core, tuner, s_type_addr, &tun_setup);
4bf1226a
MCC
3180 mode_mask &= ~T_RADIO;
3181 }
3182
3183 if (core->board.tuner_type != TUNER_ABSENT) {
3184 tun_setup.mode_mask = mode_mask;
3185 tun_setup.type = core->board.tuner_type;
3186 tun_setup.addr = core->board.tuner_addr;
3187 tun_setup.tuner_callback = cx88_tuner_callback;
3188
b8341e1d 3189 call_all(core, tuner, s_type_addr, &tun_setup);
4bf1226a
MCC
3190 }
3191
3192 if (core->board.tda9887_conf) {
3193 struct v4l2_priv_tun_config tda9887_cfg;
3194
3195 tda9887_cfg.tuner = TUNER_TDA9887;
3196 tda9887_cfg.priv = &core->board.tda9887_conf;
3197
b8341e1d 3198 call_all(core, tuner, s_config, &tda9887_cfg);
1da177e4 3199 }
c2cb8fcc
MCC
3200
3201 if (core->board.tuner_type == TUNER_XC2028) {
3202 struct v4l2_priv_tun_config xc2028_cfg;
3203 struct xc2028_ctrl ctl;
3204
99e09eac
MCC
3205 /* Fills device-dependent initialization parameters */
3206 cx88_setup_xc3028(core, &ctl);
c2cb8fcc 3207
99e09eac
MCC
3208 /* Sends parameters to xc2028/3028 tuner */
3209 memset(&xc2028_cfg, 0, sizeof(xc2028_cfg));
c2cb8fcc
MCC
3210 xc2028_cfg.tuner = TUNER_XC2028;
3211 xc2028_cfg.priv = &ctl;
64016330
MCC
3212 info_printk(core, "Asking xc2028/3028 to load firmware %s\n",
3213 ctl.fname);
b8341e1d 3214 call_all(core, tuner, s_config, &xc2028_cfg);
c2cb8fcc 3215 }
7c9fc9d5 3216 call_all(core, tuner, s_standby);
1da177e4
LT
3217}
3218
3219/* ------------------------------------------------------------------ */
3220
bbc83597
TP
3221static int cx88_pci_quirks(const char *name, struct pci_dev *pci)
3222{
3223 unsigned int lat = UNSET;
3224 u8 ctrl = 0;
3225 u8 value;
3226
3227 /* check pci quirks */
3228 if (pci_pci_problems & PCIPCI_TRITON) {
3229 printk(KERN_INFO "%s: quirk: PCIPCI_TRITON -- set TBFX\n",
3230 name);
3231 ctrl |= CX88X_EN_TBFX;
3232 }
3233 if (pci_pci_problems & PCIPCI_NATOMA) {
3234 printk(KERN_INFO "%s: quirk: PCIPCI_NATOMA -- set TBFX\n",
3235 name);
3236 ctrl |= CX88X_EN_TBFX;
3237 }
3238 if (pci_pci_problems & PCIPCI_VIAETBF) {
3239 printk(KERN_INFO "%s: quirk: PCIPCI_VIAETBF -- set TBFX\n",
3240 name);
3241 ctrl |= CX88X_EN_TBFX;
3242 }
3243 if (pci_pci_problems & PCIPCI_VSFX) {
3244 printk(KERN_INFO "%s: quirk: PCIPCI_VSFX -- set VSFX\n",
3245 name);
3246 ctrl |= CX88X_EN_VSFX;
3247 }
3248#ifdef PCIPCI_ALIMAGIK
3249 if (pci_pci_problems & PCIPCI_ALIMAGIK) {
3250 printk(KERN_INFO "%s: quirk: PCIPCI_ALIMAGIK -- latency fixup\n",
3251 name);
3252 lat = 0x0A;
3253 }
3254#endif
3255
3256 /* check insmod options */
3257 if (UNSET != latency)
3258 lat = latency;
3259
3260 /* apply stuff */
3261 if (ctrl) {
3262 pci_read_config_byte(pci, CX88X_DEVCTRL, &value);
3263 value |= ctrl;
3264 pci_write_config_byte(pci, CX88X_DEVCTRL, value);
3265 }
3266 if (UNSET != lat) {
3267 printk(KERN_INFO "%s: setting pci latency timer to %d\n",
3268 name, latency);
3269 pci_write_config_byte(pci, PCI_LATENCY_TIMER, latency);
3270 }
3271 return 0;
3272}
3273
3274int cx88_get_resources(const struct cx88_core *core, struct pci_dev *pci)
3275{
3276 if (request_mem_region(pci_resource_start(pci,0),
3277 pci_resource_len(pci,0),
3278 core->name))
3279 return 0;
3280 printk(KERN_ERR
3281 "%s/%d: Can't get MMIO memory @ 0x%llx, subsystem: %04x:%04x\n",
3282 core->name, PCI_FUNC(pci->devfn),
3283 (unsigned long long)pci_resource_start(pci, 0),
3284 pci->subsystem_vendor, pci->subsystem_device);
3285 return -EBUSY;
3286}
3287
3288/* Allocate and initialize the cx88 core struct. One should hold the
3289 * devlist mutex before calling this. */
3290struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr)
3291{
3292 struct cx88_core *core;
3293 int i;
3294
3295 core = kzalloc(sizeof(*core), GFP_KERNEL);
fbc0ae20
AC
3296 if (core == NULL)
3297 return NULL;
bbc83597
TP
3298
3299 atomic_inc(&core->refcount);
3300 core->pci_bus = pci->bus->number;
3301 core->pci_slot = PCI_SLOT(pci->devfn);
8ddac9ee
TP
3302 core->pci_irqmask = PCI_INT_RISC_RD_BERRINT | PCI_INT_RISC_WR_BERRINT |
3303 PCI_INT_BRDG_BERRINT | PCI_INT_SRC_DMA_BERRINT |
3304 PCI_INT_DST_DMA_BERRINT | PCI_INT_IPB_DMA_BERRINT;
bbc83597
TP
3305 mutex_init(&core->lock);
3306
3307 core->nr = nr;
3308 sprintf(core->name, "cx88[%d]", core->nr);
9467fe12
HV
3309
3310 strcpy(core->v4l2_dev.name, core->name);
3311 if (v4l2_device_register(NULL, &core->v4l2_dev)) {
3312 kfree(core);
3313 return NULL;
3314 }
3315
bbc83597 3316 if (0 != cx88_get_resources(core, pci)) {
9467fe12 3317 v4l2_device_unregister(&core->v4l2_dev);
bbc83597
TP
3318 kfree(core);
3319 return NULL;
3320 }
3321
3322 /* PCI stuff */
3323 cx88_pci_quirks(core->name, pci);
3324 core->lmmio = ioremap(pci_resource_start(pci, 0),
3325 pci_resource_len(pci, 0));
3326 core->bmmio = (u8 __iomem *)core->lmmio;
3327
fbc0ae20
AC
3328 if (core->lmmio == NULL) {
3329 kfree(core);
3330 return NULL;
3331 }
3332
bbc83597
TP
3333 /* board config */
3334 core->boardnr = UNSET;
3335 if (card[core->nr] < ARRAY_SIZE(cx88_boards))
3336 core->boardnr = card[core->nr];
3337 for (i = 0; UNSET == core->boardnr && i < ARRAY_SIZE(cx88_subids); i++)
3338 if (pci->subsystem_vendor == cx88_subids[i].subvendor &&
3339 pci->subsystem_device == cx88_subids[i].subdevice)
3340 core->boardnr = cx88_subids[i].card;
3341 if (UNSET == core->boardnr) {
3342 core->boardnr = CX88_BOARD_UNKNOWN;
3343 cx88_card_list(core, pci);
3344 }
3345
3346 memcpy(&core->board, &cx88_boards[core->boardnr], sizeof(core->board));
3347
3007703d
MCC
3348 if (!core->board.num_frontends && (core->board.mpeg & CX88_MPEG_DVB))
3349 core->board.num_frontends = 1;
363c35fc
ST
3350
3351 info_printk(core, "subsystem: %04x:%04x, board: %s [card=%d,%s], frontend(s): %d\n",
0f19e65b 3352 pci->subsystem_vendor, pci->subsystem_device, core->board.name,
bbc83597 3353 core->boardnr, card[core->nr] == core->boardnr ?
363c35fc
ST
3354 "insmod option" : "autodetected",
3355 core->board.num_frontends);
bbc83597
TP
3356
3357 if (tuner[core->nr] != UNSET)
3358 core->board.tuner_type = tuner[core->nr];
3359 if (radio[core->nr] != UNSET)
3360 core->board.radio_type = radio[core->nr];
3361
0f19e65b
MCC
3362 info_printk(core, "TV tuner type %d, Radio tuner type %d\n",
3363 core->board.tuner_type, core->board.radio_type);
bbc83597
TP
3364
3365 /* init hardware */
3366 cx88_reset(core);
3367 cx88_card_setup_pre_i2c(core);
3368 cx88_i2c_init(core, pci);
189bf5f0
MCC
3369
3370 /* load tuner module, if needed */
b8341e1d 3371 if (TUNER_ABSENT != core->board.tuner_type) {
43d5eab7
HV
3372 /* Ignore 0x6b and 0x6f on cx88 boards.
3373 * FusionHDTV5 RT Gold has an ir receiver at 0x6b
3374 * and an RTC at 0x6f which can get corrupted if probed. */
3375 static const unsigned short tv_addrs[] = {
3376 0x42, 0x43, 0x4a, 0x4b, /* tda8290 */
3377 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
3378 0x68, 0x69, 0x6a, 0x6c, 0x6d, 0x6e,
3379 I2C_CLIENT_END
3380 };
b8341e1d
HV
3381 int has_demod = (core->board.tda9887_conf & TDA9887_PRESENT);
3382
3383 /* I don't trust the radio_type as is stored in the card
3384 definitions, so we just probe for it.
3385 The radio_type is sometimes missing, or set to UNSET but
3386 later code configures a tea5767.
3387 */
e6574f2f
HV
3388 v4l2_i2c_new_probed_subdev(&core->v4l2_dev, &core->i2c_adap,
3389 "tuner", "tuner",
b8341e1d
HV
3390 v4l2_i2c_tuner_addrs(ADDRS_RADIO));
3391 if (has_demod)
e6574f2f
HV
3392 v4l2_i2c_new_probed_subdev(&core->v4l2_dev,
3393 &core->i2c_adap, "tuner", "tuner",
3394 v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
b8341e1d 3395 if (core->board.tuner_addr == ADDR_UNSET) {
e6574f2f
HV
3396 v4l2_i2c_new_probed_subdev(&core->v4l2_dev,
3397 &core->i2c_adap, "tuner", "tuner",
3398 has_demod ? tv_addrs + 4 : tv_addrs);
b8341e1d 3399 } else {
e6574f2f 3400 v4l2_i2c_new_subdev(&core->v4l2_dev, &core->i2c_adap,
b8341e1d
HV
3401 "tuner", "tuner", core->board.tuner_addr);
3402 }
3403 }
189bf5f0 3404
bbc83597
TP
3405 cx88_card_setup(core);
3406 cx88_ir_init(core, pci);
3407
3408 return core;
3409}