2 em28xx-cards.c - driver for Empia EM2800/EM2820/2840 USB
5 Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it>
6 Markus Rechberger <mrechberger@gmail.com>
7 Mauro Carvalho Chehab <mchehab@infradead.org>
8 Sascha Sommer <saschasommer@freenet.de>
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #include <linux/init.h>
26 #include <linux/module.h>
27 #include <linux/slab.h>
28 #include <linux/delay.h>
29 #include <linux/i2c.h>
30 #include <linux/usb.h>
31 #include <media/tuner.h>
32 #include <media/msp3400.h>
33 #include <media/saa7115.h>
34 #include <media/tvp5150.h>
35 #include <media/tvaudio.h>
36 #include <media/mt9v011.h>
37 #include <media/i2c-addr.h>
38 #include <media/tveeprom.h>
39 #include <media/v4l2-common.h>
40 #include <media/v4l2-chip-ident.h>
44 #define DRIVER_NAME "em28xx"
46 static int tuner
= -1;
47 module_param(tuner
, int, 0444);
48 MODULE_PARM_DESC(tuner
, "tuner type");
50 static unsigned int disable_ir
;
51 module_param(disable_ir
, int, 0444);
52 MODULE_PARM_DESC(disable_ir
, "disable infrared remote support");
54 static unsigned int disable_usb_speed_check
;
55 module_param(disable_usb_speed_check
, int, 0444);
56 MODULE_PARM_DESC(disable_usb_speed_check
,
57 "override min bandwidth requirement of 480M bps");
59 static unsigned int card
[] = {[0 ... (EM28XX_MAXBOARDS
- 1)] = UNSET
};
60 module_param_array(card
, int, NULL
, 0444);
61 MODULE_PARM_DESC(card
, "card type");
63 /* Bitmask marking allocated devices from 0 to EM28XX_MAXBOARDS */
64 static unsigned long em28xx_devused
;
66 struct em28xx_hash_table
{
73 * Reset sequences for analog/digital modes
76 /* Reset for the most [analog] boards */
77 static struct em28xx_reg_seq default_analog
[] = {
78 {EM28XX_R08_GPIO
, 0x6d, ~EM_GPIO_4
, 10},
82 /* Reset for the most [digital] boards */
83 static struct em28xx_reg_seq default_digital
[] = {
84 {EM28XX_R08_GPIO
, 0x6e, ~EM_GPIO_4
, 10},
88 /* Board Hauppauge WinTV HVR 900 analog */
89 static struct em28xx_reg_seq hauppauge_wintv_hvr_900_analog
[] = {
90 {EM28XX_R08_GPIO
, 0x2d, ~EM_GPIO_4
, 10},
91 {0x05, 0xff, 0x10, 10},
95 /* Board Hauppauge WinTV HVR 900 digital */
96 static struct em28xx_reg_seq hauppauge_wintv_hvr_900_digital
[] = {
97 {EM28XX_R08_GPIO
, 0x2e, ~EM_GPIO_4
, 10},
98 {EM2880_R04_GPO
, 0x04, 0x0f, 10},
99 {EM2880_R04_GPO
, 0x0c, 0x0f, 10},
103 /* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
104 static struct em28xx_reg_seq em2880_msi_digivox_ad_analog
[] = {
105 {EM28XX_R08_GPIO
, 0x69, ~EM_GPIO_4
, 10},
109 /* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
111 /* Board - EM2870 Kworld 355u
112 Analog - No input analog */
114 /* Board - EM2882 Kworld 315U digital */
115 static struct em28xx_reg_seq em2882_kworld_315u_digital
[] = {
116 {EM28XX_R08_GPIO
, 0xff, 0xff, 10},
117 {EM28XX_R08_GPIO
, 0xfe, 0xff, 10},
118 {EM2880_R04_GPO
, 0x04, 0xff, 10},
119 {EM2880_R04_GPO
, 0x0c, 0xff, 10},
120 {EM28XX_R08_GPIO
, 0x7e, 0xff, 10},
124 static struct em28xx_reg_seq em2882_kworld_315u_tuner_gpio
[] = {
125 {EM2880_R04_GPO
, 0x08, 0xff, 10},
126 {EM2880_R04_GPO
, 0x0c, 0xff, 10},
127 {EM2880_R04_GPO
, 0x08, 0xff, 10},
128 {EM2880_R04_GPO
, 0x0c, 0xff, 10},
132 static struct em28xx_reg_seq kworld_330u_analog
[] = {
133 {EM28XX_R08_GPIO
, 0x6d, ~EM_GPIO_4
, 10},
134 {EM2880_R04_GPO
, 0x00, 0xff, 10},
138 static struct em28xx_reg_seq kworld_330u_digital
[] = {
139 {EM28XX_R08_GPIO
, 0x6e, ~EM_GPIO_4
, 10},
140 {EM2880_R04_GPO
, 0x08, 0xff, 10},
145 GPIO0 - Enable digital power (s5h1409) - low to enable
146 GPIO1 - Enable analog power (tvp5150/emp202) - low to enable
150 static struct em28xx_reg_seq evga_indtube_analog
[] = {
151 {EM28XX_R08_GPIO
, 0x79, 0xff, 60},
155 static struct em28xx_reg_seq evga_indtube_digital
[] = {
156 {EM28XX_R08_GPIO
, 0x7a, 0xff, 1},
157 {EM2880_R04_GPO
, 0x04, 0xff, 10},
158 {EM2880_R04_GPO
, 0x0c, 0xff, 1},
163 * KWorld PlusTV 340U and UB435-Q (ATSC) GPIOs map:
164 * EM_GPIO_0 - currently unknown
165 * EM_GPIO_1 - LED disable/enable (1 = off, 0 = on)
166 * EM_GPIO_2 - currently unknown
167 * EM_GPIO_3 - currently unknown
168 * EM_GPIO_4 - TDA18271HD/C1 tuner (1 = active, 0 = in reset)
169 * EM_GPIO_5 - LGDT3304 ATSC/QAM demod (1 = active, 0 = in reset)
170 * EM_GPIO_6 - currently unknown
171 * EM_GPIO_7 - currently unknown
173 static struct em28xx_reg_seq kworld_a340_digital
[] = {
174 {EM28XX_R08_GPIO
, 0x6d, ~EM_GPIO_4
, 10},
178 /* Pinnacle Hybrid Pro eb1a:2881 */
179 static struct em28xx_reg_seq pinnacle_hybrid_pro_analog
[] = {
180 {EM28XX_R08_GPIO
, 0xfd, ~EM_GPIO_4
, 10},
184 static struct em28xx_reg_seq pinnacle_hybrid_pro_digital
[] = {
185 {EM28XX_R08_GPIO
, 0x6e, ~EM_GPIO_4
, 10},
186 {EM2880_R04_GPO
, 0x04, 0xff, 100},/* zl10353 reset */
187 {EM2880_R04_GPO
, 0x0c, 0xff, 1},
191 static struct em28xx_reg_seq terratec_cinergy_USB_XS_FR_analog
[] = {
192 {EM28XX_R08_GPIO
, 0x6d, ~EM_GPIO_4
, 10},
193 {EM2880_R04_GPO
, 0x00, 0xff, 10},
197 static struct em28xx_reg_seq terratec_cinergy_USB_XS_FR_digital
[] = {
198 {EM28XX_R08_GPIO
, 0x6e, ~EM_GPIO_4
, 10},
199 {EM2880_R04_GPO
, 0x08, 0xff, 10},
203 /* eb1a:2868 Reddo DVB-C USB TV Box
205 Other GPIOs seems to be don't care. */
206 static struct em28xx_reg_seq reddo_dvb_c_usb_box
[] = {
207 {EM28XX_R08_GPIO
, 0xfe, 0xff, 10},
208 {EM28XX_R08_GPIO
, 0xde, 0xff, 10},
209 {EM28XX_R08_GPIO
, 0xfe, 0xff, 10},
210 {EM28XX_R08_GPIO
, 0xff, 0xff, 10},
211 {EM28XX_R08_GPIO
, 0x7f, 0xff, 10},
212 {EM28XX_R08_GPIO
, 0x6f, 0xff, 10},
213 {EM28XX_R08_GPIO
, 0xff, 0xff, 10},
217 /* Callback for the most boards */
218 static struct em28xx_reg_seq default_tuner_gpio
[] = {
219 {EM28XX_R08_GPIO
, EM_GPIO_4
, EM_GPIO_4
, 10},
220 {EM28XX_R08_GPIO
, 0, EM_GPIO_4
, 10},
221 {EM28XX_R08_GPIO
, EM_GPIO_4
, EM_GPIO_4
, 10},
226 static struct em28xx_reg_seq compro_unmute_tv_gpio
[] = {
227 {EM28XX_R08_GPIO
, 5, 7, 10},
231 static struct em28xx_reg_seq compro_unmute_svid_gpio
[] = {
232 {EM28XX_R08_GPIO
, 4, 7, 10},
236 static struct em28xx_reg_seq compro_mute_gpio
[] = {
237 {EM28XX_R08_GPIO
, 6, 7, 10},
242 static struct em28xx_reg_seq terratec_av350_mute_gpio
[] = {
243 {EM28XX_R08_GPIO
, 0xff, 0x7f, 10},
247 static struct em28xx_reg_seq terratec_av350_unmute_gpio
[] = {
248 {EM28XX_R08_GPIO
, 0xff, 0xff, 10},
252 static struct em28xx_reg_seq silvercrest_reg_seq
[] = {
253 {EM28XX_R08_GPIO
, 0xff, 0xff, 10},
254 {EM28XX_R08_GPIO
, 0x01, 0xf7, 10},
258 static struct em28xx_reg_seq vc211a_enable
[] = {
259 {EM28XX_R08_GPIO
, 0xff, 0x07, 10},
260 {EM28XX_R08_GPIO
, 0xff, 0x0f, 10},
261 {EM28XX_R08_GPIO
, 0xff, 0x0b, 10},
265 static struct em28xx_reg_seq dikom_dk300_digital
[] = {
266 {EM28XX_R08_GPIO
, 0x6e, ~EM_GPIO_4
, 10},
267 {EM2880_R04_GPO
, 0x08, 0xff, 10},
272 /* Reset for the most [digital] boards */
273 static struct em28xx_reg_seq leadership_digital
[] = {
274 {EM2874_R80_GPIO
, 0x70, 0xff, 10},
278 static struct em28xx_reg_seq leadership_reset
[] = {
279 {EM2874_R80_GPIO
, 0xf0, 0xff, 10},
280 {EM2874_R80_GPIO
, 0xb0, 0xff, 10},
281 {EM2874_R80_GPIO
, 0xf0, 0xff, 10},
289 struct em28xx_board em28xx_boards
[] = {
290 [EM2750_BOARD_UNKNOWN
] = {
291 .name
= "EM2710/EM2750/EM2751 webcam grabber",
292 .xclk
= EM28XX_XCLK_FREQUENCY_20MHZ
,
293 .tuner_type
= TUNER_ABSENT
,
296 .type
= EM28XX_VMUX_COMPOSITE1
,
298 .amux
= EM28XX_AMUX_VIDEO
,
299 .gpio
= silvercrest_reg_seq
,
302 [EM2800_BOARD_UNKNOWN
] = {
303 .name
= "Unknown EM2800 video grabber",
305 .tda9887_conf
= TDA9887_PRESENT
,
306 .decoder
= EM28XX_SAA711X
,
307 .tuner_type
= TUNER_ABSENT
,
309 .type
= EM28XX_VMUX_COMPOSITE1
,
310 .vmux
= SAA7115_COMPOSITE0
,
311 .amux
= EM28XX_AMUX_LINE_IN
,
313 .type
= EM28XX_VMUX_SVIDEO
,
314 .vmux
= SAA7115_SVIDEO3
,
315 .amux
= EM28XX_AMUX_LINE_IN
,
318 [EM2820_BOARD_UNKNOWN
] = {
319 .name
= "Unknown EM2750/28xx video grabber",
320 .tuner_type
= TUNER_ABSENT
,
321 .is_webcam
= 1, /* To enable sensor probe */
323 [EM2750_BOARD_DLCW_130
] = {
324 /* Beijing Huaqi Information Digital Technology Co., Ltd */
325 .name
= "Huaqi DLCW-130",
326 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
327 .xclk
= EM28XX_XCLK_FREQUENCY_48MHZ
,
328 .tuner_type
= TUNER_ABSENT
,
331 .type
= EM28XX_VMUX_COMPOSITE1
,
333 .amux
= EM28XX_AMUX_VIDEO
,
336 [EM2820_BOARD_KWORLD_PVRTV2800RF
] = {
337 .name
= "Kworld PVR TV 2800 RF",
338 .tuner_type
= TUNER_TEMIC_PAL
,
339 .tda9887_conf
= TDA9887_PRESENT
,
340 .decoder
= EM28XX_SAA711X
,
342 .type
= EM28XX_VMUX_COMPOSITE1
,
343 .vmux
= SAA7115_COMPOSITE0
,
344 .amux
= EM28XX_AMUX_LINE_IN
,
346 .type
= EM28XX_VMUX_SVIDEO
,
347 .vmux
= SAA7115_SVIDEO3
,
348 .amux
= EM28XX_AMUX_LINE_IN
,
351 [EM2820_BOARD_GADMEI_TVR200
] = {
352 .name
= "Gadmei TVR200",
353 .tuner_type
= TUNER_LG_PAL_NEW_TAPC
,
354 .tda9887_conf
= TDA9887_PRESENT
,
355 .decoder
= EM28XX_SAA711X
,
357 .type
= EM28XX_VMUX_TELEVISION
,
358 .vmux
= SAA7115_COMPOSITE2
,
359 .amux
= EM28XX_AMUX_LINE_IN
,
361 .type
= EM28XX_VMUX_COMPOSITE1
,
362 .vmux
= SAA7115_COMPOSITE0
,
363 .amux
= EM28XX_AMUX_LINE_IN
,
365 .type
= EM28XX_VMUX_SVIDEO
,
366 .vmux
= SAA7115_SVIDEO3
,
367 .amux
= EM28XX_AMUX_LINE_IN
,
370 [EM2820_BOARD_TERRATEC_CINERGY_250
] = {
371 .name
= "Terratec Cinergy 250 USB",
372 .tuner_type
= TUNER_LG_PAL_NEW_TAPC
,
374 .tda9887_conf
= TDA9887_PRESENT
,
375 .decoder
= EM28XX_SAA711X
,
377 .type
= EM28XX_VMUX_TELEVISION
,
378 .vmux
= SAA7115_COMPOSITE2
,
379 .amux
= EM28XX_AMUX_LINE_IN
,
381 .type
= EM28XX_VMUX_COMPOSITE1
,
382 .vmux
= SAA7115_COMPOSITE0
,
383 .amux
= EM28XX_AMUX_LINE_IN
,
385 .type
= EM28XX_VMUX_SVIDEO
,
386 .vmux
= SAA7115_SVIDEO3
,
387 .amux
= EM28XX_AMUX_LINE_IN
,
390 [EM2820_BOARD_PINNACLE_USB_2
] = {
391 .name
= "Pinnacle PCTV USB 2",
392 .tuner_type
= TUNER_LG_PAL_NEW_TAPC
,
394 .tda9887_conf
= TDA9887_PRESENT
,
395 .decoder
= EM28XX_SAA711X
,
397 .type
= EM28XX_VMUX_TELEVISION
,
398 .vmux
= SAA7115_COMPOSITE2
,
399 .amux
= EM28XX_AMUX_VIDEO
,
401 .type
= EM28XX_VMUX_COMPOSITE1
,
402 .vmux
= SAA7115_COMPOSITE0
,
403 .amux
= EM28XX_AMUX_LINE_IN
,
405 .type
= EM28XX_VMUX_SVIDEO
,
406 .vmux
= SAA7115_SVIDEO3
,
407 .amux
= EM28XX_AMUX_LINE_IN
,
410 [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2
] = {
411 .name
= "Hauppauge WinTV USB 2",
412 .tuner_type
= TUNER_PHILIPS_FM1236_MK3
,
413 .tda9887_conf
= TDA9887_PRESENT
|
414 TDA9887_PORT1_ACTIVE
|
415 TDA9887_PORT2_ACTIVE
,
416 .decoder
= EM28XX_TVP5150
,
420 .type
= EM28XX_VMUX_TELEVISION
,
421 .vmux
= TVP5150_COMPOSITE0
,
422 .amux
= MSP_INPUT_DEFAULT
,
424 .type
= EM28XX_VMUX_SVIDEO
,
425 .vmux
= TVP5150_SVIDEO
,
426 .amux
= MSP_INPUT(MSP_IN_SCART1
, MSP_IN_TUNER1
,
427 MSP_DSP_IN_SCART
, MSP_DSP_IN_SCART
),
430 [EM2820_BOARD_DLINK_USB_TV
] = {
431 .name
= "D-Link DUB-T210 TV Tuner",
432 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
433 .tuner_type
= TUNER_LG_PAL_NEW_TAPC
,
434 .tda9887_conf
= TDA9887_PRESENT
,
435 .decoder
= EM28XX_SAA711X
,
437 .type
= EM28XX_VMUX_TELEVISION
,
438 .vmux
= SAA7115_COMPOSITE2
,
439 .amux
= EM28XX_AMUX_LINE_IN
,
441 .type
= EM28XX_VMUX_COMPOSITE1
,
442 .vmux
= SAA7115_COMPOSITE0
,
443 .amux
= EM28XX_AMUX_LINE_IN
,
445 .type
= EM28XX_VMUX_SVIDEO
,
446 .vmux
= SAA7115_SVIDEO3
,
447 .amux
= EM28XX_AMUX_LINE_IN
,
450 [EM2820_BOARD_HERCULES_SMART_TV_USB2
] = {
451 .name
= "Hercules Smart TV USB 2.0",
452 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
453 .tuner_type
= TUNER_LG_PAL_NEW_TAPC
,
454 .tda9887_conf
= TDA9887_PRESENT
,
455 .decoder
= EM28XX_SAA711X
,
457 .type
= EM28XX_VMUX_TELEVISION
,
458 .vmux
= SAA7115_COMPOSITE2
,
459 .amux
= EM28XX_AMUX_LINE_IN
,
461 .type
= EM28XX_VMUX_COMPOSITE1
,
462 .vmux
= SAA7115_COMPOSITE0
,
463 .amux
= EM28XX_AMUX_LINE_IN
,
465 .type
= EM28XX_VMUX_SVIDEO
,
466 .vmux
= SAA7115_SVIDEO3
,
467 .amux
= EM28XX_AMUX_LINE_IN
,
470 [EM2820_BOARD_PINNACLE_USB_2_FM1216ME
] = {
471 .name
= "Pinnacle PCTV USB 2 (Philips FM1216ME)",
472 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
473 .tuner_type
= TUNER_PHILIPS_FM1216ME_MK3
,
474 .tda9887_conf
= TDA9887_PRESENT
,
475 .decoder
= EM28XX_SAA711X
,
477 .type
= EM28XX_VMUX_TELEVISION
,
478 .vmux
= SAA7115_COMPOSITE2
,
479 .amux
= EM28XX_AMUX_VIDEO
,
481 .type
= EM28XX_VMUX_COMPOSITE1
,
482 .vmux
= SAA7115_COMPOSITE0
,
483 .amux
= EM28XX_AMUX_LINE_IN
,
485 .type
= EM28XX_VMUX_SVIDEO
,
486 .vmux
= SAA7115_SVIDEO3
,
487 .amux
= EM28XX_AMUX_LINE_IN
,
490 [EM2820_BOARD_GADMEI_UTV310
] = {
491 .name
= "Gadmei UTV310",
492 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
493 .tuner_type
= TUNER_TNF_5335MF
,
494 .tda9887_conf
= TDA9887_PRESENT
,
495 .decoder
= EM28XX_SAA711X
,
497 .type
= EM28XX_VMUX_TELEVISION
,
498 .vmux
= SAA7115_COMPOSITE1
,
499 .amux
= EM28XX_AMUX_LINE_IN
,
501 .type
= EM28XX_VMUX_COMPOSITE1
,
502 .vmux
= SAA7115_COMPOSITE0
,
503 .amux
= EM28XX_AMUX_LINE_IN
,
505 .type
= EM28XX_VMUX_SVIDEO
,
506 .vmux
= SAA7115_SVIDEO3
,
507 .amux
= EM28XX_AMUX_LINE_IN
,
510 [EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE
] = {
511 .name
= "Leadtek Winfast USB II Deluxe",
512 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
513 .tuner_type
= TUNER_PHILIPS_FM1216ME_MK3
,
515 .tvaudio_addr
= 0x58,
516 .tda9887_conf
= TDA9887_PRESENT
|
517 TDA9887_PORT2_ACTIVE
|
519 .decoder
= EM28XX_SAA711X
,
520 .adecoder
= EM28XX_TVAUDIO
,
522 .type
= EM28XX_VMUX_TELEVISION
,
523 .vmux
= SAA7115_COMPOSITE4
,
524 .amux
= EM28XX_AMUX_AUX
,
526 .type
= EM28XX_VMUX_COMPOSITE1
,
527 .vmux
= SAA7115_COMPOSITE5
,
528 .amux
= EM28XX_AMUX_LINE_IN
,
530 .type
= EM28XX_VMUX_SVIDEO
,
531 .vmux
= SAA7115_SVIDEO3
,
532 .amux
= EM28XX_AMUX_LINE_IN
,
535 .type
= EM28XX_RADIO
,
536 .amux
= EM28XX_AMUX_AUX
,
539 [EM2820_BOARD_VIDEOLOGY_20K14XUSB
] = {
540 .name
= "Videology 20K14XUSB USB2.0",
541 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
542 .tuner_type
= TUNER_ABSENT
,
545 .type
= EM28XX_VMUX_COMPOSITE1
,
547 .amux
= EM28XX_AMUX_VIDEO
,
550 [EM2820_BOARD_SILVERCREST_WEBCAM
] = {
551 .name
= "Silvercrest Webcam 1.3mpix",
552 .tuner_type
= TUNER_ABSENT
,
555 .type
= EM28XX_VMUX_COMPOSITE1
,
557 .amux
= EM28XX_AMUX_VIDEO
,
558 .gpio
= silvercrest_reg_seq
,
561 [EM2821_BOARD_SUPERCOMP_USB_2
] = {
562 .name
= "Supercomp USB 2.0 TV",
563 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
564 .tuner_type
= TUNER_PHILIPS_FM1236_MK3
,
565 .tda9887_conf
= TDA9887_PRESENT
|
566 TDA9887_PORT1_ACTIVE
|
567 TDA9887_PORT2_ACTIVE
,
568 .decoder
= EM28XX_SAA711X
,
570 .type
= EM28XX_VMUX_TELEVISION
,
571 .vmux
= SAA7115_COMPOSITE2
,
572 .amux
= EM28XX_AMUX_LINE_IN
,
574 .type
= EM28XX_VMUX_COMPOSITE1
,
575 .vmux
= SAA7115_COMPOSITE0
,
576 .amux
= EM28XX_AMUX_VIDEO
,
578 .type
= EM28XX_VMUX_SVIDEO
,
579 .vmux
= SAA7115_SVIDEO3
,
580 .amux
= EM28XX_AMUX_LINE_IN
,
583 [EM2821_BOARD_USBGEAR_VD204
] = {
584 .name
= "Usbgear VD204v9",
585 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
586 .tuner_type
= TUNER_ABSENT
, /* Capture only device */
587 .decoder
= EM28XX_SAA711X
,
589 .type
= EM28XX_VMUX_COMPOSITE1
,
590 .vmux
= SAA7115_COMPOSITE0
,
591 .amux
= EM28XX_AMUX_LINE_IN
,
593 .type
= EM28XX_VMUX_SVIDEO
,
594 .vmux
= SAA7115_SVIDEO3
,
595 .amux
= EM28XX_AMUX_LINE_IN
,
598 [EM2860_BOARD_NETGMBH_CAM
] = {
599 /* Beijing Huaqi Information Digital Technology Co., Ltd */
600 .name
= "NetGMBH Cam",
601 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
602 .tuner_type
= TUNER_ABSENT
,
605 .type
= EM28XX_VMUX_COMPOSITE1
,
607 .amux
= EM28XX_AMUX_VIDEO
,
610 [EM2860_BOARD_TYPHOON_DVD_MAKER
] = {
611 .name
= "Typhoon DVD Maker",
612 .decoder
= EM28XX_SAA711X
,
613 .tuner_type
= TUNER_ABSENT
, /* Capture only device */
615 .type
= EM28XX_VMUX_COMPOSITE1
,
616 .vmux
= SAA7115_COMPOSITE0
,
617 .amux
= EM28XX_AMUX_LINE_IN
,
619 .type
= EM28XX_VMUX_SVIDEO
,
620 .vmux
= SAA7115_SVIDEO3
,
621 .amux
= EM28XX_AMUX_LINE_IN
,
624 [EM2860_BOARD_GADMEI_UTV330
] = {
625 .name
= "Gadmei UTV330",
626 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
627 .tuner_type
= TUNER_TNF_5335MF
,
628 .tda9887_conf
= TDA9887_PRESENT
,
629 .decoder
= EM28XX_SAA711X
,
631 .type
= EM28XX_VMUX_TELEVISION
,
632 .vmux
= SAA7115_COMPOSITE2
,
633 .amux
= EM28XX_AMUX_VIDEO
,
635 .type
= EM28XX_VMUX_COMPOSITE1
,
636 .vmux
= SAA7115_COMPOSITE0
,
637 .amux
= EM28XX_AMUX_LINE_IN
,
639 .type
= EM28XX_VMUX_SVIDEO
,
640 .vmux
= SAA7115_SVIDEO3
,
641 .amux
= EM28XX_AMUX_LINE_IN
,
644 [EM2861_BOARD_GADMEI_UTV330PLUS
] = {
645 .name
= "Gadmei UTV330+",
646 .tuner_type
= TUNER_TNF_5335MF
,
647 .tda9887_conf
= TDA9887_PRESENT
,
648 .ir_codes
= RC_MAP_GADMEI_RM008Z
,
649 .decoder
= EM28XX_SAA711X
,
650 .xclk
= EM28XX_XCLK_FREQUENCY_12MHZ
,
652 .type
= EM28XX_VMUX_TELEVISION
,
653 .vmux
= SAA7115_COMPOSITE2
,
654 .amux
= EM28XX_AMUX_VIDEO
,
656 .type
= EM28XX_VMUX_COMPOSITE1
,
657 .vmux
= SAA7115_COMPOSITE0
,
658 .amux
= EM28XX_AMUX_LINE_IN
,
660 .type
= EM28XX_VMUX_SVIDEO
,
661 .vmux
= SAA7115_SVIDEO3
,
662 .amux
= EM28XX_AMUX_LINE_IN
,
665 [EM2860_BOARD_TERRATEC_HYBRID_XS
] = {
666 .name
= "Terratec Cinergy A Hybrid XS",
667 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
668 .tuner_type
= TUNER_XC2028
,
669 .tuner_gpio
= default_tuner_gpio
,
670 .decoder
= EM28XX_TVP5150
,
673 .type
= EM28XX_VMUX_TELEVISION
,
674 .vmux
= TVP5150_COMPOSITE0
,
675 .amux
= EM28XX_AMUX_VIDEO
,
676 .gpio
= hauppauge_wintv_hvr_900_analog
,
678 .type
= EM28XX_VMUX_COMPOSITE1
,
679 .vmux
= TVP5150_COMPOSITE1
,
680 .amux
= EM28XX_AMUX_LINE_IN
,
681 .gpio
= hauppauge_wintv_hvr_900_analog
,
683 .type
= EM28XX_VMUX_SVIDEO
,
684 .vmux
= TVP5150_SVIDEO
,
685 .amux
= EM28XX_AMUX_LINE_IN
,
686 .gpio
= hauppauge_wintv_hvr_900_analog
,
689 [EM2861_BOARD_KWORLD_PVRTV_300U
] = {
690 .name
= "KWorld PVRTV 300U",
691 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
692 .tuner_type
= TUNER_XC2028
,
693 .tuner_gpio
= default_tuner_gpio
,
694 .decoder
= EM28XX_TVP5150
,
696 .type
= EM28XX_VMUX_TELEVISION
,
697 .vmux
= TVP5150_COMPOSITE0
,
698 .amux
= EM28XX_AMUX_VIDEO
,
700 .type
= EM28XX_VMUX_COMPOSITE1
,
701 .vmux
= TVP5150_COMPOSITE1
,
702 .amux
= EM28XX_AMUX_LINE_IN
,
704 .type
= EM28XX_VMUX_SVIDEO
,
705 .vmux
= TVP5150_SVIDEO
,
706 .amux
= EM28XX_AMUX_LINE_IN
,
709 [EM2861_BOARD_YAKUMO_MOVIE_MIXER
] = {
710 .name
= "Yakumo MovieMixer",
711 .tuner_type
= TUNER_ABSENT
, /* Capture only device */
712 .decoder
= EM28XX_TVP5150
,
714 .type
= EM28XX_VMUX_TELEVISION
,
715 .vmux
= TVP5150_COMPOSITE0
,
716 .amux
= EM28XX_AMUX_VIDEO
,
718 .type
= EM28XX_VMUX_COMPOSITE1
,
719 .vmux
= TVP5150_COMPOSITE1
,
720 .amux
= EM28XX_AMUX_LINE_IN
,
722 .type
= EM28XX_VMUX_SVIDEO
,
723 .vmux
= TVP5150_SVIDEO
,
724 .amux
= EM28XX_AMUX_LINE_IN
,
727 [EM2860_BOARD_TVP5150_REFERENCE_DESIGN
] = {
728 .name
= "EM2860/TVP5150 Reference Design",
729 .tuner_type
= TUNER_ABSENT
, /* Capture only device */
730 .decoder
= EM28XX_TVP5150
,
732 .type
= EM28XX_VMUX_COMPOSITE1
,
733 .vmux
= TVP5150_COMPOSITE1
,
734 .amux
= EM28XX_AMUX_LINE_IN
,
736 .type
= EM28XX_VMUX_SVIDEO
,
737 .vmux
= TVP5150_SVIDEO
,
738 .amux
= EM28XX_AMUX_LINE_IN
,
741 [EM2861_BOARD_PLEXTOR_PX_TV100U
] = {
742 .name
= "Plextor ConvertX PX-TV100U",
743 .tuner_type
= TUNER_TNF_5335MF
,
744 .xclk
= EM28XX_XCLK_I2S_MSB_TIMING
|
745 EM28XX_XCLK_FREQUENCY_12MHZ
,
746 .tda9887_conf
= TDA9887_PRESENT
,
747 .decoder
= EM28XX_TVP5150
,
750 .type
= EM28XX_VMUX_TELEVISION
,
751 .vmux
= TVP5150_COMPOSITE0
,
752 .amux
= EM28XX_AMUX_LINE_IN
,
753 .gpio
= pinnacle_hybrid_pro_analog
,
755 .type
= EM28XX_VMUX_COMPOSITE1
,
756 .vmux
= TVP5150_COMPOSITE1
,
757 .amux
= EM28XX_AMUX_LINE_IN
,
758 .gpio
= pinnacle_hybrid_pro_analog
,
760 .type
= EM28XX_VMUX_SVIDEO
,
761 .vmux
= TVP5150_SVIDEO
,
762 .amux
= EM28XX_AMUX_LINE_IN
,
763 .gpio
= pinnacle_hybrid_pro_analog
,
767 /* Those boards with em2870 are DVB Only*/
769 [EM2870_BOARD_TERRATEC_XS
] = {
770 .name
= "Terratec Cinergy T XS",
771 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
772 .tuner_type
= TUNER_XC2028
,
773 .tuner_gpio
= default_tuner_gpio
,
775 [EM2870_BOARD_TERRATEC_XS_MT2060
] = {
776 .name
= "Terratec Cinergy T XS (MT2060)",
777 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
778 .tuner_type
= TUNER_ABSENT
, /* MT2060 */
780 [EM2870_BOARD_KWORLD_350U
] = {
781 .name
= "Kworld 350 U DVB-T",
782 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
783 .tuner_type
= TUNER_XC2028
,
784 .tuner_gpio
= default_tuner_gpio
,
786 [EM2870_BOARD_KWORLD_355U
] = {
787 .name
= "Kworld 355 U DVB-T",
788 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
790 [EM2870_BOARD_PINNACLE_PCTV_DVB
] = {
791 .name
= "Pinnacle PCTV DVB-T",
792 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
793 .tuner_type
= TUNER_ABSENT
, /* MT2060 */
794 /* djh - I have serious doubts this is right... */
795 .xclk
= EM28XX_XCLK_IR_RC5_MODE
|
796 EM28XX_XCLK_FREQUENCY_10MHZ
,
798 [EM2870_BOARD_COMPRO_VIDEOMATE
] = {
799 .name
= "Compro, VideoMate U3",
800 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
801 .tuner_type
= TUNER_ABSENT
, /* MT2060 */
804 [EM2880_BOARD_TERRATEC_HYBRID_XS_FR
] = {
805 .name
= "Terratec Hybrid XS Secam",
807 .tuner_type
= TUNER_XC2028
,
808 .tuner_gpio
= default_tuner_gpio
,
809 .decoder
= EM28XX_TVP5150
,
811 .dvb_gpio
= terratec_cinergy_USB_XS_FR_digital
,
813 .type
= EM28XX_VMUX_TELEVISION
,
814 .vmux
= TVP5150_COMPOSITE0
,
815 .amux
= EM28XX_AMUX_VIDEO
,
816 .gpio
= terratec_cinergy_USB_XS_FR_analog
,
818 .type
= EM28XX_VMUX_COMPOSITE1
,
819 .vmux
= TVP5150_COMPOSITE1
,
820 .amux
= EM28XX_AMUX_LINE_IN
,
821 .gpio
= terratec_cinergy_USB_XS_FR_analog
,
823 .type
= EM28XX_VMUX_SVIDEO
,
824 .vmux
= TVP5150_SVIDEO
,
825 .amux
= EM28XX_AMUX_LINE_IN
,
826 .gpio
= terratec_cinergy_USB_XS_FR_analog
,
829 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900
] = {
830 .name
= "Hauppauge WinTV HVR 900",
831 .tda9887_conf
= TDA9887_PRESENT
,
832 .tuner_type
= TUNER_XC2028
,
833 .tuner_gpio
= default_tuner_gpio
,
836 .dvb_gpio
= hauppauge_wintv_hvr_900_digital
,
837 .ir_codes
= RC_MAP_HAUPPAUGE
,
838 .decoder
= EM28XX_TVP5150
,
840 .type
= EM28XX_VMUX_TELEVISION
,
841 .vmux
= TVP5150_COMPOSITE0
,
842 .amux
= EM28XX_AMUX_VIDEO
,
843 .gpio
= hauppauge_wintv_hvr_900_analog
,
845 .type
= EM28XX_VMUX_COMPOSITE1
,
846 .vmux
= TVP5150_COMPOSITE1
,
847 .amux
= EM28XX_AMUX_LINE_IN
,
848 .gpio
= hauppauge_wintv_hvr_900_analog
,
850 .type
= EM28XX_VMUX_SVIDEO
,
851 .vmux
= TVP5150_SVIDEO
,
852 .amux
= EM28XX_AMUX_LINE_IN
,
853 .gpio
= hauppauge_wintv_hvr_900_analog
,
856 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2
] = {
857 .name
= "Hauppauge WinTV HVR 900 (R2)",
858 .tda9887_conf
= TDA9887_PRESENT
,
859 .tuner_type
= TUNER_XC2028
,
860 .tuner_gpio
= default_tuner_gpio
,
862 .ir_codes
= RC_MAP_HAUPPAUGE
,
863 .decoder
= EM28XX_TVP5150
,
865 .type
= EM28XX_VMUX_TELEVISION
,
866 .vmux
= TVP5150_COMPOSITE0
,
867 .amux
= EM28XX_AMUX_VIDEO
,
868 .gpio
= hauppauge_wintv_hvr_900_analog
,
870 .type
= EM28XX_VMUX_COMPOSITE1
,
871 .vmux
= TVP5150_COMPOSITE1
,
872 .amux
= EM28XX_AMUX_LINE_IN
,
873 .gpio
= hauppauge_wintv_hvr_900_analog
,
875 .type
= EM28XX_VMUX_SVIDEO
,
876 .vmux
= TVP5150_SVIDEO
,
877 .amux
= EM28XX_AMUX_LINE_IN
,
878 .gpio
= hauppauge_wintv_hvr_900_analog
,
881 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850
] = {
882 .name
= "Hauppauge WinTV HVR 850",
883 .tuner_type
= TUNER_XC2028
,
884 .tuner_gpio
= default_tuner_gpio
,
887 .dvb_gpio
= hauppauge_wintv_hvr_900_digital
,
888 .ir_codes
= RC_MAP_HAUPPAUGE
,
889 .decoder
= EM28XX_TVP5150
,
891 .type
= EM28XX_VMUX_TELEVISION
,
892 .vmux
= TVP5150_COMPOSITE0
,
893 .amux
= EM28XX_AMUX_VIDEO
,
894 .gpio
= hauppauge_wintv_hvr_900_analog
,
896 .type
= EM28XX_VMUX_COMPOSITE1
,
897 .vmux
= TVP5150_COMPOSITE1
,
898 .amux
= EM28XX_AMUX_LINE_IN
,
899 .gpio
= hauppauge_wintv_hvr_900_analog
,
901 .type
= EM28XX_VMUX_SVIDEO
,
902 .vmux
= TVP5150_SVIDEO
,
903 .amux
= EM28XX_AMUX_LINE_IN
,
904 .gpio
= hauppauge_wintv_hvr_900_analog
,
907 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950
] = {
908 .name
= "Hauppauge WinTV HVR 950",
909 .tuner_type
= TUNER_XC2028
,
910 .tuner_gpio
= default_tuner_gpio
,
913 .dvb_gpio
= hauppauge_wintv_hvr_900_digital
,
914 .ir_codes
= RC_MAP_HAUPPAUGE
,
915 .decoder
= EM28XX_TVP5150
,
917 .type
= EM28XX_VMUX_TELEVISION
,
918 .vmux
= TVP5150_COMPOSITE0
,
919 .amux
= EM28XX_AMUX_VIDEO
,
920 .gpio
= hauppauge_wintv_hvr_900_analog
,
922 .type
= EM28XX_VMUX_COMPOSITE1
,
923 .vmux
= TVP5150_COMPOSITE1
,
924 .amux
= EM28XX_AMUX_LINE_IN
,
925 .gpio
= hauppauge_wintv_hvr_900_analog
,
927 .type
= EM28XX_VMUX_SVIDEO
,
928 .vmux
= TVP5150_SVIDEO
,
929 .amux
= EM28XX_AMUX_LINE_IN
,
930 .gpio
= hauppauge_wintv_hvr_900_analog
,
933 [EM2880_BOARD_PINNACLE_PCTV_HD_PRO
] = {
934 .name
= "Pinnacle PCTV HD Pro Stick",
935 .tuner_type
= TUNER_XC2028
,
936 .tuner_gpio
= default_tuner_gpio
,
939 .dvb_gpio
= hauppauge_wintv_hvr_900_digital
,
940 .ir_codes
= RC_MAP_PINNACLE_PCTV_HD
,
941 .decoder
= EM28XX_TVP5150
,
943 .type
= EM28XX_VMUX_TELEVISION
,
944 .vmux
= TVP5150_COMPOSITE0
,
945 .amux
= EM28XX_AMUX_VIDEO
,
946 .gpio
= hauppauge_wintv_hvr_900_analog
,
948 .type
= EM28XX_VMUX_COMPOSITE1
,
949 .vmux
= TVP5150_COMPOSITE1
,
950 .amux
= EM28XX_AMUX_LINE_IN
,
951 .gpio
= hauppauge_wintv_hvr_900_analog
,
953 .type
= EM28XX_VMUX_SVIDEO
,
954 .vmux
= TVP5150_SVIDEO
,
955 .amux
= EM28XX_AMUX_LINE_IN
,
956 .gpio
= hauppauge_wintv_hvr_900_analog
,
959 [EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600
] = {
960 .name
= "AMD ATI TV Wonder HD 600",
961 .tuner_type
= TUNER_XC2028
,
962 .tuner_gpio
= default_tuner_gpio
,
965 .dvb_gpio
= hauppauge_wintv_hvr_900_digital
,
966 .ir_codes
= RC_MAP_ATI_TV_WONDER_HD_600
,
967 .decoder
= EM28XX_TVP5150
,
969 .type
= EM28XX_VMUX_TELEVISION
,
970 .vmux
= TVP5150_COMPOSITE0
,
971 .amux
= EM28XX_AMUX_VIDEO
,
972 .gpio
= hauppauge_wintv_hvr_900_analog
,
974 .type
= EM28XX_VMUX_COMPOSITE1
,
975 .vmux
= TVP5150_COMPOSITE1
,
976 .amux
= EM28XX_AMUX_LINE_IN
,
977 .gpio
= hauppauge_wintv_hvr_900_analog
,
979 .type
= EM28XX_VMUX_SVIDEO
,
980 .vmux
= TVP5150_SVIDEO
,
981 .amux
= EM28XX_AMUX_LINE_IN
,
982 .gpio
= hauppauge_wintv_hvr_900_analog
,
985 [EM2880_BOARD_TERRATEC_HYBRID_XS
] = {
986 .name
= "Terratec Hybrid XS",
987 .tuner_type
= TUNER_XC2028
,
988 .tuner_gpio
= default_tuner_gpio
,
989 .decoder
= EM28XX_TVP5150
,
991 .dvb_gpio
= default_digital
,
992 .ir_codes
= RC_MAP_TERRATEC_CINERGY_XS
,
993 .xclk
= EM28XX_XCLK_FREQUENCY_12MHZ
, /* NEC IR */
995 .type
= EM28XX_VMUX_TELEVISION
,
996 .vmux
= TVP5150_COMPOSITE0
,
997 .amux
= EM28XX_AMUX_VIDEO
,
998 .gpio
= default_analog
,
1000 .type
= EM28XX_VMUX_COMPOSITE1
,
1001 .vmux
= TVP5150_COMPOSITE1
,
1002 .amux
= EM28XX_AMUX_LINE_IN
,
1003 .gpio
= default_analog
,
1005 .type
= EM28XX_VMUX_SVIDEO
,
1006 .vmux
= TVP5150_SVIDEO
,
1007 .amux
= EM28XX_AMUX_LINE_IN
,
1008 .gpio
= default_analog
,
1011 /* maybe there's a reason behind it why Terratec sells the Hybrid XS
1012 as Prodigy XS with a different PID, let's keep it separated for now
1013 maybe we'll need it lateron */
1014 [EM2880_BOARD_TERRATEC_PRODIGY_XS
] = {
1015 .name
= "Terratec Prodigy XS",
1016 .tuner_type
= TUNER_XC2028
,
1017 .tuner_gpio
= default_tuner_gpio
,
1018 .decoder
= EM28XX_TVP5150
,
1020 .type
= EM28XX_VMUX_TELEVISION
,
1021 .vmux
= TVP5150_COMPOSITE0
,
1022 .amux
= EM28XX_AMUX_VIDEO
,
1023 .gpio
= hauppauge_wintv_hvr_900_analog
,
1025 .type
= EM28XX_VMUX_COMPOSITE1
,
1026 .vmux
= TVP5150_COMPOSITE1
,
1027 .amux
= EM28XX_AMUX_LINE_IN
,
1028 .gpio
= hauppauge_wintv_hvr_900_analog
,
1030 .type
= EM28XX_VMUX_SVIDEO
,
1031 .vmux
= TVP5150_SVIDEO
,
1032 .amux
= EM28XX_AMUX_LINE_IN
,
1033 .gpio
= hauppauge_wintv_hvr_900_analog
,
1036 [EM2820_BOARD_MSI_VOX_USB_2
] = {
1037 .name
= "MSI VOX USB 2.0",
1038 .tuner_type
= TUNER_LG_PAL_NEW_TAPC
,
1039 .tda9887_conf
= TDA9887_PRESENT
|
1040 TDA9887_PORT1_ACTIVE
|
1041 TDA9887_PORT2_ACTIVE
,
1042 .max_range_640_480
= 1,
1043 .decoder
= EM28XX_SAA711X
,
1045 .type
= EM28XX_VMUX_TELEVISION
,
1046 .vmux
= SAA7115_COMPOSITE4
,
1047 .amux
= EM28XX_AMUX_VIDEO
,
1049 .type
= EM28XX_VMUX_COMPOSITE1
,
1050 .vmux
= SAA7115_COMPOSITE0
,
1051 .amux
= EM28XX_AMUX_LINE_IN
,
1053 .type
= EM28XX_VMUX_SVIDEO
,
1054 .vmux
= SAA7115_SVIDEO3
,
1055 .amux
= EM28XX_AMUX_LINE_IN
,
1058 [EM2800_BOARD_TERRATEC_CINERGY_200
] = {
1059 .name
= "Terratec Cinergy 200 USB",
1062 .tuner_type
= TUNER_LG_PAL_NEW_TAPC
,
1063 .tda9887_conf
= TDA9887_PRESENT
,
1064 .decoder
= EM28XX_SAA711X
,
1066 .type
= EM28XX_VMUX_TELEVISION
,
1067 .vmux
= SAA7115_COMPOSITE2
,
1068 .amux
= EM28XX_AMUX_VIDEO
,
1070 .type
= EM28XX_VMUX_COMPOSITE1
,
1071 .vmux
= SAA7115_COMPOSITE0
,
1072 .amux
= EM28XX_AMUX_LINE_IN
,
1074 .type
= EM28XX_VMUX_SVIDEO
,
1075 .vmux
= SAA7115_SVIDEO3
,
1076 .amux
= EM28XX_AMUX_LINE_IN
,
1079 [EM2800_BOARD_GRABBEEX_USB2800
] = {
1080 .name
= "eMPIA Technology, Inc. GrabBeeX+ Video Encoder",
1082 .decoder
= EM28XX_SAA711X
,
1083 .tuner_type
= TUNER_ABSENT
, /* capture only board */
1085 .type
= EM28XX_VMUX_COMPOSITE1
,
1086 .vmux
= SAA7115_COMPOSITE0
,
1087 .amux
= EM28XX_AMUX_LINE_IN
,
1089 .type
= EM28XX_VMUX_SVIDEO
,
1090 .vmux
= SAA7115_SVIDEO3
,
1091 .amux
= EM28XX_AMUX_LINE_IN
,
1094 [EM2800_BOARD_VC211A
] = {
1095 .name
= "Actionmaster/LinXcel/Digitus VC211A",
1097 .tuner_type
= TUNER_ABSENT
, /* Capture-only board */
1098 .decoder
= EM28XX_SAA711X
,
1100 .type
= EM28XX_VMUX_COMPOSITE1
,
1101 .vmux
= SAA7115_COMPOSITE0
,
1102 .amux
= EM28XX_AMUX_LINE_IN
,
1103 .gpio
= vc211a_enable
,
1105 .type
= EM28XX_VMUX_SVIDEO
,
1106 .vmux
= SAA7115_SVIDEO3
,
1107 .amux
= EM28XX_AMUX_LINE_IN
,
1108 .gpio
= vc211a_enable
,
1111 [EM2800_BOARD_LEADTEK_WINFAST_USBII
] = {
1112 .name
= "Leadtek Winfast USB II",
1114 .tuner_type
= TUNER_LG_PAL_NEW_TAPC
,
1115 .tda9887_conf
= TDA9887_PRESENT
,
1116 .decoder
= EM28XX_SAA711X
,
1118 .type
= EM28XX_VMUX_TELEVISION
,
1119 .vmux
= SAA7115_COMPOSITE2
,
1120 .amux
= EM28XX_AMUX_VIDEO
,
1122 .type
= EM28XX_VMUX_COMPOSITE1
,
1123 .vmux
= SAA7115_COMPOSITE0
,
1124 .amux
= EM28XX_AMUX_LINE_IN
,
1126 .type
= EM28XX_VMUX_SVIDEO
,
1127 .vmux
= SAA7115_SVIDEO3
,
1128 .amux
= EM28XX_AMUX_LINE_IN
,
1131 [EM2800_BOARD_KWORLD_USB2800
] = {
1132 .name
= "Kworld USB2800",
1134 .tuner_type
= TUNER_PHILIPS_FCV1236D
,
1135 .tda9887_conf
= TDA9887_PRESENT
,
1136 .decoder
= EM28XX_SAA711X
,
1138 .type
= EM28XX_VMUX_TELEVISION
,
1139 .vmux
= SAA7115_COMPOSITE2
,
1140 .amux
= EM28XX_AMUX_VIDEO
,
1142 .type
= EM28XX_VMUX_COMPOSITE1
,
1143 .vmux
= SAA7115_COMPOSITE0
,
1144 .amux
= EM28XX_AMUX_LINE_IN
,
1146 .type
= EM28XX_VMUX_SVIDEO
,
1147 .vmux
= SAA7115_SVIDEO3
,
1148 .amux
= EM28XX_AMUX_LINE_IN
,
1151 [EM2820_BOARD_PINNACLE_DVC_90
] = {
1152 .name
= "Pinnacle Dazzle DVC 90/100/101/107 / Kaiser Baas Video to DVD maker "
1153 "/ Kworld DVD Maker 2",
1154 .tuner_type
= TUNER_ABSENT
, /* capture only board */
1155 .decoder
= EM28XX_SAA711X
,
1157 .type
= EM28XX_VMUX_COMPOSITE1
,
1158 .vmux
= SAA7115_COMPOSITE0
,
1159 .amux
= EM28XX_AMUX_LINE_IN
,
1161 .type
= EM28XX_VMUX_SVIDEO
,
1162 .vmux
= SAA7115_SVIDEO3
,
1163 .amux
= EM28XX_AMUX_LINE_IN
,
1166 [EM2800_BOARD_VGEAR_POCKETTV
] = {
1167 .name
= "V-Gear PocketTV",
1169 .tuner_type
= TUNER_LG_PAL_NEW_TAPC
,
1170 .tda9887_conf
= TDA9887_PRESENT
,
1171 .decoder
= EM28XX_SAA711X
,
1173 .type
= EM28XX_VMUX_TELEVISION
,
1174 .vmux
= SAA7115_COMPOSITE2
,
1175 .amux
= EM28XX_AMUX_VIDEO
,
1177 .type
= EM28XX_VMUX_COMPOSITE1
,
1178 .vmux
= SAA7115_COMPOSITE0
,
1179 .amux
= EM28XX_AMUX_LINE_IN
,
1181 .type
= EM28XX_VMUX_SVIDEO
,
1182 .vmux
= SAA7115_SVIDEO3
,
1183 .amux
= EM28XX_AMUX_LINE_IN
,
1186 [EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2
] = {
1187 .name
= "Pixelview PlayTV Box 4 USB 2.0",
1188 .tda9887_conf
= TDA9887_PRESENT
,
1189 .tuner_type
= TUNER_YMEC_TVF_5533MF
,
1190 .decoder
= EM28XX_SAA711X
,
1192 .type
= EM28XX_VMUX_TELEVISION
,
1193 .vmux
= SAA7115_COMPOSITE2
,
1194 .amux
= EM28XX_AMUX_VIDEO
,
1195 .aout
= EM28XX_AOUT_MONO
| /* I2S */
1196 EM28XX_AOUT_MASTER
, /* Line out pin */
1198 .type
= EM28XX_VMUX_COMPOSITE1
,
1199 .vmux
= SAA7115_COMPOSITE0
,
1200 .amux
= EM28XX_AMUX_LINE_IN
,
1202 .type
= EM28XX_VMUX_SVIDEO
,
1203 .vmux
= SAA7115_SVIDEO3
,
1204 .amux
= EM28XX_AMUX_LINE_IN
,
1207 [EM2820_BOARD_PROLINK_PLAYTV_USB2
] = {
1208 .name
= "SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0",
1209 .has_snapshot_button
= 1,
1210 .tda9887_conf
= TDA9887_PRESENT
,
1211 .tuner_type
= TUNER_YMEC_TVF_5533MF
,
1212 .decoder
= EM28XX_SAA711X
,
1214 .type
= EM28XX_VMUX_TELEVISION
,
1215 .vmux
= SAA7115_COMPOSITE2
,
1216 .amux
= EM28XX_AMUX_VIDEO
,
1217 .aout
= EM28XX_AOUT_MONO
| /* I2S */
1218 EM28XX_AOUT_MASTER
, /* Line out pin */
1220 .type
= EM28XX_VMUX_COMPOSITE1
,
1221 .vmux
= SAA7115_COMPOSITE0
,
1222 .amux
= EM28XX_AMUX_LINE_IN
,
1224 .type
= EM28XX_VMUX_SVIDEO
,
1225 .vmux
= SAA7115_SVIDEO3
,
1226 .amux
= EM28XX_AMUX_LINE_IN
,
1229 [EM2860_BOARD_SAA711X_REFERENCE_DESIGN
] = {
1230 .name
= "EM2860/SAA711X Reference Design",
1231 .has_snapshot_button
= 1,
1232 .tuner_type
= TUNER_ABSENT
,
1233 .decoder
= EM28XX_SAA711X
,
1235 .type
= EM28XX_VMUX_SVIDEO
,
1236 .vmux
= SAA7115_SVIDEO3
,
1238 .type
= EM28XX_VMUX_COMPOSITE1
,
1239 .vmux
= SAA7115_COMPOSITE0
,
1243 [EM2874_LEADERSHIP_ISDBT
] = {
1244 .i2c_speed
= EM2874_I2C_SECONDARY_BUS_SELECT
|
1245 EM28XX_I2C_CLK_WAIT_ENABLE
|
1246 EM28XX_I2C_FREQ_100_KHZ
,
1247 .xclk
= EM28XX_XCLK_FREQUENCY_10MHZ
,
1248 .name
= "EM2874 Leadership ISDBT",
1249 .tuner_type
= TUNER_ABSENT
,
1250 .tuner_gpio
= leadership_reset
,
1251 .dvb_gpio
= leadership_digital
,
1255 [EM2880_BOARD_MSI_DIGIVOX_AD
] = {
1256 .name
= "MSI DigiVox A/D",
1257 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
1258 .tuner_type
= TUNER_XC2028
,
1259 .tuner_gpio
= default_tuner_gpio
,
1260 .decoder
= EM28XX_TVP5150
,
1262 .type
= EM28XX_VMUX_TELEVISION
,
1263 .vmux
= TVP5150_COMPOSITE0
,
1264 .amux
= EM28XX_AMUX_VIDEO
,
1265 .gpio
= em2880_msi_digivox_ad_analog
,
1267 .type
= EM28XX_VMUX_COMPOSITE1
,
1268 .vmux
= TVP5150_COMPOSITE1
,
1269 .amux
= EM28XX_AMUX_LINE_IN
,
1270 .gpio
= em2880_msi_digivox_ad_analog
,
1272 .type
= EM28XX_VMUX_SVIDEO
,
1273 .vmux
= TVP5150_SVIDEO
,
1274 .amux
= EM28XX_AMUX_LINE_IN
,
1275 .gpio
= em2880_msi_digivox_ad_analog
,
1278 [EM2880_BOARD_MSI_DIGIVOX_AD_II
] = {
1279 .name
= "MSI DigiVox A/D II",
1280 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
1281 .tuner_type
= TUNER_XC2028
,
1282 .tuner_gpio
= default_tuner_gpio
,
1283 .decoder
= EM28XX_TVP5150
,
1285 .type
= EM28XX_VMUX_TELEVISION
,
1286 .vmux
= TVP5150_COMPOSITE0
,
1287 .amux
= EM28XX_AMUX_VIDEO
,
1288 .gpio
= em2880_msi_digivox_ad_analog
,
1290 .type
= EM28XX_VMUX_COMPOSITE1
,
1291 .vmux
= TVP5150_COMPOSITE1
,
1292 .amux
= EM28XX_AMUX_LINE_IN
,
1293 .gpio
= em2880_msi_digivox_ad_analog
,
1295 .type
= EM28XX_VMUX_SVIDEO
,
1296 .vmux
= TVP5150_SVIDEO
,
1297 .amux
= EM28XX_AMUX_LINE_IN
,
1298 .gpio
= em2880_msi_digivox_ad_analog
,
1301 [EM2880_BOARD_KWORLD_DVB_305U
] = {
1302 .name
= "KWorld DVB-T 305U",
1303 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
1304 .tuner_type
= TUNER_XC2028
,
1305 .tuner_gpio
= default_tuner_gpio
,
1306 .decoder
= EM28XX_TVP5150
,
1308 .type
= EM28XX_VMUX_TELEVISION
,
1309 .vmux
= TVP5150_COMPOSITE0
,
1310 .amux
= EM28XX_AMUX_VIDEO
,
1312 .type
= EM28XX_VMUX_COMPOSITE1
,
1313 .vmux
= TVP5150_COMPOSITE1
,
1314 .amux
= EM28XX_AMUX_LINE_IN
,
1316 .type
= EM28XX_VMUX_SVIDEO
,
1317 .vmux
= TVP5150_SVIDEO
,
1318 .amux
= EM28XX_AMUX_LINE_IN
,
1321 [EM2880_BOARD_KWORLD_DVB_310U
] = {
1322 .name
= "KWorld DVB-T 310U",
1323 .tuner_type
= TUNER_XC2028
,
1324 .tuner_gpio
= default_tuner_gpio
,
1326 .dvb_gpio
= default_digital
,
1328 .decoder
= EM28XX_TVP5150
,
1330 .type
= EM28XX_VMUX_TELEVISION
,
1331 .vmux
= TVP5150_COMPOSITE0
,
1332 .amux
= EM28XX_AMUX_VIDEO
,
1333 .gpio
= default_analog
,
1335 .type
= EM28XX_VMUX_COMPOSITE1
,
1336 .vmux
= TVP5150_COMPOSITE1
,
1337 .amux
= EM28XX_AMUX_LINE_IN
,
1338 .gpio
= default_analog
,
1339 }, { /* S-video has not been tested yet */
1340 .type
= EM28XX_VMUX_SVIDEO
,
1341 .vmux
= TVP5150_SVIDEO
,
1342 .amux
= EM28XX_AMUX_LINE_IN
,
1343 .gpio
= default_analog
,
1346 [EM2882_BOARD_KWORLD_ATSC_315U
] = {
1347 .name
= "KWorld ATSC 315U HDTV TV Box",
1348 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
1349 .tuner_type
= TUNER_THOMSON_DTT761X
,
1350 .tuner_gpio
= em2882_kworld_315u_tuner_gpio
,
1351 .tda9887_conf
= TDA9887_PRESENT
,
1352 .decoder
= EM28XX_SAA711X
,
1354 .dvb_gpio
= em2882_kworld_315u_digital
,
1355 .ir_codes
= RC_MAP_KWORLD_315U
,
1356 .xclk
= EM28XX_XCLK_FREQUENCY_12MHZ
,
1357 .i2c_speed
= EM28XX_I2C_CLK_WAIT_ENABLE
,
1358 /* Analog mode - still not ready */
1360 .type = EM28XX_VMUX_TELEVISION,
1361 .vmux = SAA7115_COMPOSITE2,
1362 .amux = EM28XX_AMUX_VIDEO,
1363 .gpio = em2882_kworld_315u_analog,
1364 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1366 .type = EM28XX_VMUX_COMPOSITE1,
1367 .vmux = SAA7115_COMPOSITE0,
1368 .amux = EM28XX_AMUX_LINE_IN,
1369 .gpio = em2882_kworld_315u_analog1,
1370 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1372 .type = EM28XX_VMUX_SVIDEO,
1373 .vmux = SAA7115_SVIDEO3,
1374 .amux = EM28XX_AMUX_LINE_IN,
1375 .gpio = em2882_kworld_315u_analog1,
1376 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1379 [EM2880_BOARD_EMPIRE_DUAL_TV
] = {
1380 .name
= "Empire dual TV",
1381 .tuner_type
= TUNER_XC2028
,
1382 .tuner_gpio
= default_tuner_gpio
,
1384 .dvb_gpio
= default_digital
,
1386 .decoder
= EM28XX_TVP5150
,
1388 .type
= EM28XX_VMUX_TELEVISION
,
1389 .vmux
= TVP5150_COMPOSITE0
,
1390 .amux
= EM28XX_AMUX_VIDEO
,
1391 .gpio
= default_analog
,
1393 .type
= EM28XX_VMUX_COMPOSITE1
,
1394 .vmux
= TVP5150_COMPOSITE1
,
1395 .amux
= EM28XX_AMUX_LINE_IN
,
1396 .gpio
= default_analog
,
1398 .type
= EM28XX_VMUX_SVIDEO
,
1399 .vmux
= TVP5150_SVIDEO
,
1400 .amux
= EM28XX_AMUX_LINE_IN
,
1401 .gpio
= default_analog
,
1404 [EM2881_BOARD_DNT_DA2_HYBRID
] = {
1405 .name
= "DNT DA2 Hybrid",
1406 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
1407 .tuner_type
= TUNER_XC2028
,
1408 .tuner_gpio
= default_tuner_gpio
,
1409 .decoder
= EM28XX_TVP5150
,
1411 .type
= EM28XX_VMUX_TELEVISION
,
1412 .vmux
= TVP5150_COMPOSITE0
,
1413 .amux
= EM28XX_AMUX_VIDEO
,
1414 .gpio
= default_analog
,
1416 .type
= EM28XX_VMUX_COMPOSITE1
,
1417 .vmux
= TVP5150_COMPOSITE1
,
1418 .amux
= EM28XX_AMUX_LINE_IN
,
1419 .gpio
= default_analog
,
1421 .type
= EM28XX_VMUX_SVIDEO
,
1422 .vmux
= TVP5150_SVIDEO
,
1423 .amux
= EM28XX_AMUX_LINE_IN
,
1424 .gpio
= default_analog
,
1427 [EM2881_BOARD_PINNACLE_HYBRID_PRO
] = {
1428 .name
= "Pinnacle Hybrid Pro",
1429 .tuner_type
= TUNER_XC2028
,
1430 .tuner_gpio
= default_tuner_gpio
,
1431 .decoder
= EM28XX_TVP5150
,
1433 .dvb_gpio
= pinnacle_hybrid_pro_digital
,
1435 .type
= EM28XX_VMUX_TELEVISION
,
1436 .vmux
= TVP5150_COMPOSITE0
,
1437 .amux
= EM28XX_AMUX_VIDEO
,
1438 .gpio
= pinnacle_hybrid_pro_analog
,
1440 .type
= EM28XX_VMUX_COMPOSITE1
,
1441 .vmux
= TVP5150_COMPOSITE1
,
1442 .amux
= EM28XX_AMUX_LINE_IN
,
1443 .gpio
= pinnacle_hybrid_pro_analog
,
1445 .type
= EM28XX_VMUX_SVIDEO
,
1446 .vmux
= TVP5150_SVIDEO
,
1447 .amux
= EM28XX_AMUX_LINE_IN
,
1448 .gpio
= pinnacle_hybrid_pro_analog
,
1451 [EM2882_BOARD_PINNACLE_HYBRID_PRO
] = {
1452 .name
= "Pinnacle Hybrid Pro (2)",
1453 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
1454 .tuner_type
= TUNER_XC2028
,
1455 .tuner_gpio
= default_tuner_gpio
,
1457 .decoder
= EM28XX_TVP5150
,
1459 .type
= EM28XX_VMUX_TELEVISION
,
1460 .vmux
= TVP5150_COMPOSITE0
,
1461 .amux
= EM28XX_AMUX_VIDEO
,
1462 .gpio
= hauppauge_wintv_hvr_900_analog
,
1464 .type
= EM28XX_VMUX_COMPOSITE1
,
1465 .vmux
= TVP5150_COMPOSITE1
,
1466 .amux
= EM28XX_AMUX_LINE_IN
,
1467 .gpio
= hauppauge_wintv_hvr_900_analog
,
1469 .type
= EM28XX_VMUX_SVIDEO
,
1470 .vmux
= TVP5150_SVIDEO
,
1471 .amux
= EM28XX_AMUX_LINE_IN
,
1472 .gpio
= hauppauge_wintv_hvr_900_analog
,
1475 [EM2882_BOARD_KWORLD_VS_DVBT
] = {
1476 .name
= "Kworld VS-DVB-T 323UR",
1477 .tuner_type
= TUNER_XC2028
,
1478 .tuner_gpio
= default_tuner_gpio
,
1479 .decoder
= EM28XX_TVP5150
,
1482 .dvb_gpio
= kworld_330u_digital
,
1483 .xclk
= EM28XX_XCLK_FREQUENCY_12MHZ
, /* NEC IR */
1484 .ir_codes
= RC_MAP_KWORLD_315U
,
1486 .type
= EM28XX_VMUX_TELEVISION
,
1487 .vmux
= TVP5150_COMPOSITE0
,
1488 .amux
= EM28XX_AMUX_VIDEO
,
1490 .type
= EM28XX_VMUX_COMPOSITE1
,
1491 .vmux
= TVP5150_COMPOSITE1
,
1492 .amux
= EM28XX_AMUX_LINE_IN
,
1494 .type
= EM28XX_VMUX_SVIDEO
,
1495 .vmux
= TVP5150_SVIDEO
,
1496 .amux
= EM28XX_AMUX_LINE_IN
,
1499 [EM2882_BOARD_TERRATEC_HYBRID_XS
] = {
1500 .name
= "Terratec Cinnergy Hybrid T USB XS (em2882)",
1501 .tuner_type
= TUNER_XC2028
,
1502 .tuner_gpio
= default_tuner_gpio
,
1504 .decoder
= EM28XX_TVP5150
,
1506 .dvb_gpio
= hauppauge_wintv_hvr_900_digital
,
1507 .ir_codes
= RC_MAP_TERRATEC_CINERGY_XS
,
1508 .xclk
= EM28XX_XCLK_FREQUENCY_12MHZ
,
1510 .type
= EM28XX_VMUX_TELEVISION
,
1511 .vmux
= TVP5150_COMPOSITE0
,
1512 .amux
= EM28XX_AMUX_VIDEO
,
1513 .gpio
= hauppauge_wintv_hvr_900_analog
,
1515 .type
= EM28XX_VMUX_COMPOSITE1
,
1516 .vmux
= TVP5150_COMPOSITE1
,
1517 .amux
= EM28XX_AMUX_LINE_IN
,
1518 .gpio
= hauppauge_wintv_hvr_900_analog
,
1520 .type
= EM28XX_VMUX_SVIDEO
,
1521 .vmux
= TVP5150_SVIDEO
,
1522 .amux
= EM28XX_AMUX_LINE_IN
,
1523 .gpio
= hauppauge_wintv_hvr_900_analog
,
1526 [EM2882_BOARD_DIKOM_DK300
] = {
1527 .name
= "Dikom DK300",
1528 .tuner_type
= TUNER_XC2028
,
1529 .tuner_gpio
= default_tuner_gpio
,
1530 .decoder
= EM28XX_TVP5150
,
1533 .dvb_gpio
= dikom_dk300_digital
,
1535 .type
= EM28XX_VMUX_TELEVISION
,
1536 .vmux
= TVP5150_COMPOSITE0
,
1537 .amux
= EM28XX_AMUX_VIDEO
,
1538 .gpio
= default_analog
,
1541 [EM2883_BOARD_KWORLD_HYBRID_330U
] = {
1542 .name
= "Kworld PlusTV HD Hybrid 330",
1543 .tuner_type
= TUNER_XC2028
,
1544 .tuner_gpio
= default_tuner_gpio
,
1545 .decoder
= EM28XX_TVP5150
,
1548 .dvb_gpio
= kworld_330u_digital
,
1549 .xclk
= EM28XX_XCLK_FREQUENCY_12MHZ
,
1550 .i2c_speed
= EM28XX_I2C_CLK_WAIT_ENABLE
|
1551 EM28XX_I2C_EEPROM_ON_BOARD
|
1552 EM28XX_I2C_EEPROM_KEY_VALID
,
1554 .type
= EM28XX_VMUX_TELEVISION
,
1555 .vmux
= TVP5150_COMPOSITE0
,
1556 .amux
= EM28XX_AMUX_VIDEO
,
1557 .gpio
= kworld_330u_analog
,
1558 .aout
= EM28XX_AOUT_PCM_IN
| EM28XX_AOUT_PCM_STEREO
,
1560 .type
= EM28XX_VMUX_COMPOSITE1
,
1561 .vmux
= TVP5150_COMPOSITE1
,
1562 .amux
= EM28XX_AMUX_LINE_IN
,
1563 .gpio
= kworld_330u_analog
,
1564 .aout
= EM28XX_AOUT_PCM_IN
| EM28XX_AOUT_PCM_STEREO
,
1566 .type
= EM28XX_VMUX_SVIDEO
,
1567 .vmux
= TVP5150_SVIDEO
,
1568 .amux
= EM28XX_AMUX_LINE_IN
,
1569 .gpio
= kworld_330u_analog
,
1572 [EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU
] = {
1573 .name
= "Compro VideoMate ForYou/Stereo",
1574 .tuner_type
= TUNER_LG_PAL_NEW_TAPC
,
1575 .tvaudio_addr
= 0xb0,
1576 .tda9887_conf
= TDA9887_PRESENT
,
1577 .decoder
= EM28XX_TVP5150
,
1578 .adecoder
= EM28XX_TVAUDIO
,
1579 .mute_gpio
= compro_mute_gpio
,
1581 .type
= EM28XX_VMUX_TELEVISION
,
1582 .vmux
= TVP5150_COMPOSITE0
,
1583 .amux
= EM28XX_AMUX_VIDEO
,
1584 .gpio
= compro_unmute_tv_gpio
,
1586 .type
= EM28XX_VMUX_SVIDEO
,
1587 .vmux
= TVP5150_SVIDEO
,
1588 .amux
= EM28XX_AMUX_LINE_IN
,
1589 .gpio
= compro_unmute_svid_gpio
,
1592 [EM2860_BOARD_KAIOMY_TVNPC_U2
] = {
1593 .name
= "Kaiomy TVnPC U2",
1595 .tuner_type
= TUNER_XC2028
,
1598 .decoder
= EM28XX_TVP5150
,
1599 .tuner_gpio
= default_tuner_gpio
,
1600 .ir_codes
= RC_MAP_KAIOMY
,
1602 .type
= EM28XX_VMUX_TELEVISION
,
1603 .vmux
= TVP5150_COMPOSITE0
,
1604 .amux
= EM28XX_AMUX_VIDEO
,
1607 .type
= EM28XX_VMUX_COMPOSITE1
,
1608 .vmux
= TVP5150_COMPOSITE1
,
1609 .amux
= EM28XX_AMUX_LINE_IN
,
1611 .type
= EM28XX_VMUX_SVIDEO
,
1612 .vmux
= TVP5150_SVIDEO
,
1613 .amux
= EM28XX_AMUX_LINE_IN
,
1616 .type
= EM28XX_RADIO
,
1617 .amux
= EM28XX_AMUX_LINE_IN
,
1620 [EM2860_BOARD_EASYCAP
] = {
1621 .name
= "Easy Cap Capture DC-60",
1623 .tuner_type
= TUNER_ABSENT
,
1624 .decoder
= EM28XX_SAA711X
,
1626 .type
= EM28XX_VMUX_COMPOSITE1
,
1627 .vmux
= SAA7115_COMPOSITE0
,
1628 .amux
= EM28XX_AMUX_LINE_IN
,
1630 .type
= EM28XX_VMUX_SVIDEO
,
1631 .vmux
= SAA7115_SVIDEO3
,
1632 .amux
= EM28XX_AMUX_LINE_IN
,
1635 [EM2820_BOARD_IODATA_GVMVP_SZ
] = {
1636 .name
= "IO-DATA GV-MVP/SZ",
1637 .tuner_type
= TUNER_PHILIPS_FM1236_MK3
,
1638 .tuner_gpio
= default_tuner_gpio
,
1639 .tda9887_conf
= TDA9887_PRESENT
,
1640 .decoder
= EM28XX_TVP5150
,
1642 .type
= EM28XX_VMUX_TELEVISION
,
1643 .vmux
= TVP5150_COMPOSITE0
,
1644 .amux
= EM28XX_AMUX_VIDEO
,
1645 }, { /* Composite has not been tested yet */
1646 .type
= EM28XX_VMUX_COMPOSITE1
,
1647 .vmux
= TVP5150_COMPOSITE1
,
1648 .amux
= EM28XX_AMUX_VIDEO
,
1649 }, { /* S-video has not been tested yet */
1650 .type
= EM28XX_VMUX_SVIDEO
,
1651 .vmux
= TVP5150_SVIDEO
,
1652 .amux
= EM28XX_AMUX_VIDEO
,
1655 [EM2860_BOARD_TERRATEC_GRABBY
] = {
1656 .name
= "Terratec Grabby",
1658 .tuner_type
= TUNER_ABSENT
,
1659 .decoder
= EM28XX_SAA711X
,
1660 .xclk
= EM28XX_XCLK_FREQUENCY_12MHZ
,
1662 .type
= EM28XX_VMUX_COMPOSITE1
,
1663 .vmux
= SAA7115_COMPOSITE0
,
1664 .amux
= EM28XX_AMUX_LINE_IN
,
1666 .type
= EM28XX_VMUX_SVIDEO
,
1667 .vmux
= SAA7115_SVIDEO3
,
1668 .amux
= EM28XX_AMUX_LINE_IN
,
1671 [EM2860_BOARD_TERRATEC_AV350
] = {
1672 .name
= "Terratec AV350",
1674 .tuner_type
= TUNER_ABSENT
,
1675 .decoder
= EM28XX_TVP5150
,
1676 .xclk
= EM28XX_XCLK_FREQUENCY_12MHZ
,
1677 .mute_gpio
= terratec_av350_mute_gpio
,
1679 .type
= EM28XX_VMUX_COMPOSITE1
,
1680 .vmux
= TVP5150_COMPOSITE1
,
1681 .amux
= EM28XX_AUDIO_SRC_LINE
,
1682 .gpio
= terratec_av350_unmute_gpio
,
1685 .type
= EM28XX_VMUX_SVIDEO
,
1686 .vmux
= TVP5150_SVIDEO
,
1687 .amux
= EM28XX_AUDIO_SRC_LINE
,
1688 .gpio
= terratec_av350_unmute_gpio
,
1692 [EM2860_BOARD_ELGATO_VIDEO_CAPTURE
] = {
1693 .name
= "Elgato Video Capture",
1694 .decoder
= EM28XX_SAA711X
,
1695 .tuner_type
= TUNER_ABSENT
, /* Capture only device */
1697 .type
= EM28XX_VMUX_COMPOSITE1
,
1698 .vmux
= SAA7115_COMPOSITE0
,
1699 .amux
= EM28XX_AMUX_LINE_IN
,
1701 .type
= EM28XX_VMUX_SVIDEO
,
1702 .vmux
= SAA7115_SVIDEO3
,
1703 .amux
= EM28XX_AMUX_LINE_IN
,
1707 [EM2882_BOARD_EVGA_INDTUBE
] = {
1708 .name
= "Evga inDtube",
1709 .tuner_type
= TUNER_XC2028
,
1710 .tuner_gpio
= default_tuner_gpio
,
1711 .decoder
= EM28XX_TVP5150
,
1712 .xclk
= EM28XX_XCLK_FREQUENCY_12MHZ
, /* NEC IR */
1715 .dvb_gpio
= evga_indtube_digital
,
1716 .ir_codes
= RC_MAP_EVGA_INDTUBE
,
1718 .type
= EM28XX_VMUX_TELEVISION
,
1719 .vmux
= TVP5150_COMPOSITE0
,
1720 .amux
= EM28XX_AMUX_VIDEO
,
1721 .gpio
= evga_indtube_analog
,
1723 .type
= EM28XX_VMUX_COMPOSITE1
,
1724 .vmux
= TVP5150_COMPOSITE1
,
1725 .amux
= EM28XX_AMUX_LINE_IN
,
1726 .gpio
= evga_indtube_analog
,
1728 .type
= EM28XX_VMUX_SVIDEO
,
1729 .vmux
= TVP5150_SVIDEO
,
1730 .amux
= EM28XX_AMUX_LINE_IN
,
1731 .gpio
= evga_indtube_analog
,
1734 /* eb1a:2868 Empia EM2870 + Philips CU1216L NIM (Philips TDA10023 +
1735 Infineon TUA6034) */
1736 [EM2870_BOARD_REDDO_DVB_C_USB_BOX
] = {
1737 .name
= "Reddo DVB-C USB TV Box",
1738 .tuner_type
= TUNER_ABSENT
,
1739 .tuner_gpio
= reddo_dvb_c_usb_box
,
1742 /* 1b80:a340 - Empia EM2870, NXP TDA18271HD and LG DT3304, sold
1743 * initially as the KWorld PlusTV 340U, then as the UB435-Q.
1744 * Early variants have a TDA18271HD/C1, later ones a TDA18271HD/C2 */
1745 [EM2870_BOARD_KWORLD_A340
] = {
1746 .name
= "KWorld PlusTV 340U or UB435-Q (ATSC)",
1747 .tuner_type
= TUNER_ABSENT
, /* Digital-only TDA18271HD */
1749 .dvb_gpio
= kworld_a340_digital
,
1750 .tuner_gpio
= default_tuner_gpio
,
1753 const unsigned int em28xx_bcount
= ARRAY_SIZE(em28xx_boards
);
1755 /* table of devices that work with this driver */
1756 struct usb_device_id em28xx_id_table
[] = {
1757 { USB_DEVICE(0xeb1a, 0x2750),
1758 .driver_info
= EM2750_BOARD_UNKNOWN
},
1759 { USB_DEVICE(0xeb1a, 0x2751),
1760 .driver_info
= EM2750_BOARD_UNKNOWN
},
1761 { USB_DEVICE(0xeb1a, 0x2800),
1762 .driver_info
= EM2800_BOARD_UNKNOWN
},
1763 { USB_DEVICE(0xeb1a, 0x2710),
1764 .driver_info
= EM2820_BOARD_UNKNOWN
},
1765 { USB_DEVICE(0xeb1a, 0x2820),
1766 .driver_info
= EM2820_BOARD_UNKNOWN
},
1767 { USB_DEVICE(0xeb1a, 0x2821),
1768 .driver_info
= EM2820_BOARD_UNKNOWN
},
1769 { USB_DEVICE(0xeb1a, 0x2860),
1770 .driver_info
= EM2820_BOARD_UNKNOWN
},
1771 { USB_DEVICE(0xeb1a, 0x2861),
1772 .driver_info
= EM2820_BOARD_UNKNOWN
},
1773 { USB_DEVICE(0xeb1a, 0x2862),
1774 .driver_info
= EM2820_BOARD_UNKNOWN
},
1775 { USB_DEVICE(0xeb1a, 0x2863),
1776 .driver_info
= EM2820_BOARD_UNKNOWN
},
1777 { USB_DEVICE(0xeb1a, 0x2870),
1778 .driver_info
= EM2820_BOARD_UNKNOWN
},
1779 { USB_DEVICE(0xeb1a, 0x2881),
1780 .driver_info
= EM2820_BOARD_UNKNOWN
},
1781 { USB_DEVICE(0xeb1a, 0x2883),
1782 .driver_info
= EM2820_BOARD_UNKNOWN
},
1783 { USB_DEVICE(0xeb1a, 0x2868),
1784 .driver_info
= EM2820_BOARD_UNKNOWN
},
1785 { USB_DEVICE(0xeb1a, 0x2875),
1786 .driver_info
= EM2820_BOARD_UNKNOWN
},
1787 { USB_DEVICE(0xeb1a, 0xe300),
1788 .driver_info
= EM2861_BOARD_KWORLD_PVRTV_300U
},
1789 { USB_DEVICE(0xeb1a, 0xe303),
1790 .driver_info
= EM2860_BOARD_KAIOMY_TVNPC_U2
},
1791 { USB_DEVICE(0xeb1a, 0xe305),
1792 .driver_info
= EM2880_BOARD_KWORLD_DVB_305U
},
1793 { USB_DEVICE(0xeb1a, 0xe310),
1794 .driver_info
= EM2880_BOARD_MSI_DIGIVOX_AD
},
1795 { USB_DEVICE(0xeb1a, 0xa313),
1796 .driver_info
= EM2882_BOARD_KWORLD_ATSC_315U
},
1797 { USB_DEVICE(0xeb1a, 0xa316),
1798 .driver_info
= EM2883_BOARD_KWORLD_HYBRID_330U
},
1799 { USB_DEVICE(0xeb1a, 0xe320),
1800 .driver_info
= EM2880_BOARD_MSI_DIGIVOX_AD_II
},
1801 { USB_DEVICE(0xeb1a, 0xe323),
1802 .driver_info
= EM2882_BOARD_KWORLD_VS_DVBT
},
1803 { USB_DEVICE(0xeb1a, 0xe350),
1804 .driver_info
= EM2870_BOARD_KWORLD_350U
},
1805 { USB_DEVICE(0xeb1a, 0xe355),
1806 .driver_info
= EM2870_BOARD_KWORLD_355U
},
1807 { USB_DEVICE(0xeb1a, 0x2801),
1808 .driver_info
= EM2800_BOARD_GRABBEEX_USB2800
},
1809 { USB_DEVICE(0xeb1a, 0xe357),
1810 .driver_info
= EM2870_BOARD_KWORLD_355U
},
1811 { USB_DEVICE(0x1b80, 0xe302),
1812 .driver_info
= EM2820_BOARD_PINNACLE_DVC_90
}, /* Kaiser Baas Video to DVD maker */
1813 { USB_DEVICE(0x1b80, 0xe304),
1814 .driver_info
= EM2820_BOARD_PINNACLE_DVC_90
}, /* Kworld DVD Maker 2 */
1815 { USB_DEVICE(0x0ccd, 0x0036),
1816 .driver_info
= EM2820_BOARD_TERRATEC_CINERGY_250
},
1817 { USB_DEVICE(0x0ccd, 0x004c),
1818 .driver_info
= EM2880_BOARD_TERRATEC_HYBRID_XS_FR
},
1819 { USB_DEVICE(0x0ccd, 0x004f),
1820 .driver_info
= EM2860_BOARD_TERRATEC_HYBRID_XS
},
1821 { USB_DEVICE(0x0ccd, 0x005e),
1822 .driver_info
= EM2882_BOARD_TERRATEC_HYBRID_XS
},
1823 { USB_DEVICE(0x0ccd, 0x0042),
1824 .driver_info
= EM2882_BOARD_TERRATEC_HYBRID_XS
},
1825 { USB_DEVICE(0x0ccd, 0x0043),
1826 .driver_info
= EM2870_BOARD_TERRATEC_XS
},
1827 { USB_DEVICE(0x0ccd, 0x0047),
1828 .driver_info
= EM2880_BOARD_TERRATEC_PRODIGY_XS
},
1829 { USB_DEVICE(0x0ccd, 0x0084),
1830 .driver_info
= EM2860_BOARD_TERRATEC_AV350
},
1831 { USB_DEVICE(0x0ccd, 0x0096),
1832 .driver_info
= EM2860_BOARD_TERRATEC_GRABBY
},
1833 { USB_DEVICE(0x0fd9, 0x0033),
1834 .driver_info
= EM2860_BOARD_ELGATO_VIDEO_CAPTURE
},
1835 { USB_DEVICE(0x185b, 0x2870),
1836 .driver_info
= EM2870_BOARD_COMPRO_VIDEOMATE
},
1837 { USB_DEVICE(0x185b, 0x2041),
1838 .driver_info
= EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU
},
1839 { USB_DEVICE(0x2040, 0x4200),
1840 .driver_info
= EM2820_BOARD_HAUPPAUGE_WINTV_USB_2
},
1841 { USB_DEVICE(0x2040, 0x4201),
1842 .driver_info
= EM2820_BOARD_HAUPPAUGE_WINTV_USB_2
},
1843 { USB_DEVICE(0x2040, 0x6500),
1844 .driver_info
= EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900
},
1845 { USB_DEVICE(0x2040, 0x6502),
1846 .driver_info
= EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2
},
1847 { USB_DEVICE(0x2040, 0x6513), /* HCW HVR-980 */
1848 .driver_info
= EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950
},
1849 { USB_DEVICE(0x2040, 0x6517), /* HP HVR-950 */
1850 .driver_info
= EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950
},
1851 { USB_DEVICE(0x2040, 0x651b), /* RP HVR-950 */
1852 .driver_info
= EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950
},
1853 { USB_DEVICE(0x2040, 0x651f),
1854 .driver_info
= EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850
},
1855 { USB_DEVICE(0x0438, 0xb002),
1856 .driver_info
= EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600
},
1857 { USB_DEVICE(0x2001, 0xf112),
1858 .driver_info
= EM2820_BOARD_DLINK_USB_TV
},
1859 { USB_DEVICE(0x2304, 0x0207),
1860 .driver_info
= EM2820_BOARD_PINNACLE_DVC_90
},
1861 { USB_DEVICE(0x2304, 0x0208),
1862 .driver_info
= EM2820_BOARD_PINNACLE_USB_2
},
1863 { USB_DEVICE(0x2304, 0x021a),
1864 .driver_info
= EM2820_BOARD_PINNACLE_DVC_90
},
1865 { USB_DEVICE(0x2304, 0x0226),
1866 .driver_info
= EM2882_BOARD_PINNACLE_HYBRID_PRO
},
1867 { USB_DEVICE(0x2304, 0x0227),
1868 .driver_info
= EM2880_BOARD_PINNACLE_PCTV_HD_PRO
},
1869 { USB_DEVICE(0x0413, 0x6023),
1870 .driver_info
= EM2800_BOARD_LEADTEK_WINFAST_USBII
},
1871 { USB_DEVICE(0x093b, 0xa005),
1872 .driver_info
= EM2861_BOARD_PLEXTOR_PX_TV100U
},
1873 { USB_DEVICE(0x04bb, 0x0515),
1874 .driver_info
= EM2820_BOARD_IODATA_GVMVP_SZ
},
1875 { USB_DEVICE(0xeb1a, 0x50a6),
1876 .driver_info
= EM2860_BOARD_GADMEI_UTV330
},
1877 { USB_DEVICE(0x1b80, 0xa340),
1878 .driver_info
= EM2870_BOARD_KWORLD_A340
},
1881 MODULE_DEVICE_TABLE(usb
, em28xx_id_table
);
1884 * EEPROM hash table for devices with generic USB IDs
1886 static struct em28xx_hash_table em28xx_eeprom_hash
[] = {
1887 /* P/N: SA 60002070465 Tuner: TVF7533-MF */
1888 {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2
, TUNER_YMEC_TVF_5533MF
},
1889 {0x72cc5a8b, EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2
, TUNER_YMEC_TVF_5533MF
},
1890 {0x966a0441, EM2880_BOARD_KWORLD_DVB_310U
, TUNER_XC2028
},
1891 {0x166a0441, EM2880_BOARD_EMPIRE_DUAL_TV
, TUNER_XC2028
},
1892 {0xcee44a99, EM2882_BOARD_EVGA_INDTUBE
, TUNER_XC2028
},
1893 {0xb8846b20, EM2881_BOARD_PINNACLE_HYBRID_PRO
, TUNER_XC2028
},
1894 {0x63f653bd, EM2870_BOARD_REDDO_DVB_C_USB_BOX
, TUNER_ABSENT
},
1895 {0x4e913442, EM2882_BOARD_DIKOM_DK300
, TUNER_XC2028
},
1898 /* I2C devicelist hash table for devices with generic USB IDs */
1899 static struct em28xx_hash_table em28xx_i2c_hash
[] = {
1900 {0xb06a32c3, EM2800_BOARD_TERRATEC_CINERGY_200
, TUNER_LG_PAL_NEW_TAPC
},
1901 {0xf51200e3, EM2800_BOARD_VGEAR_POCKETTV
, TUNER_LG_PAL_NEW_TAPC
},
1902 {0x1ba50080, EM2860_BOARD_SAA711X_REFERENCE_DESIGN
, TUNER_ABSENT
},
1903 {0x77800080, EM2860_BOARD_TVP5150_REFERENCE_DESIGN
, TUNER_ABSENT
},
1904 {0xc51200e3, EM2820_BOARD_GADMEI_TVR200
, TUNER_LG_PAL_NEW_TAPC
},
1905 {0x4ba50080, EM2861_BOARD_GADMEI_UTV330PLUS
, TUNER_TNF_5335MF
},
1906 {0x6b800080, EM2874_LEADERSHIP_ISDBT
, TUNER_ABSENT
},
1909 /* I2C possible address to saa7115, tvp5150, msp3400, tvaudio */
1910 static unsigned short saa711x_addrs
[] = {
1911 0x4a >> 1, 0x48 >> 1, /* SAA7111, SAA7111A and SAA7113 */
1912 0x42 >> 1, 0x40 >> 1, /* SAA7114, SAA7115 and SAA7118 */
1915 static unsigned short tvp5150_addrs
[] = {
1921 static unsigned short msp3400_addrs
[] = {
1927 int em28xx_tuner_callback(void *ptr
, int component
, int command
, int arg
)
1930 struct em28xx
*dev
= ptr
;
1932 if (dev
->tuner_type
!= TUNER_XC2028
)
1935 if (command
!= XC2028_TUNER_RESET
)
1938 rc
= em28xx_gpio_set(dev
, dev
->board
.tuner_gpio
);
1942 EXPORT_SYMBOL_GPL(em28xx_tuner_callback
);
1944 static inline void em28xx_set_model(struct em28xx
*dev
)
1946 memcpy(&dev
->board
, &em28xx_boards
[dev
->model
], sizeof(dev
->board
));
1948 /* Those are the default values for the majority of boards
1949 Use those values if not specified otherwise at boards entry
1951 if (!dev
->board
.xclk
)
1952 dev
->board
.xclk
= EM28XX_XCLK_IR_RC5_MODE
|
1953 EM28XX_XCLK_FREQUENCY_12MHZ
;
1955 if (!dev
->board
.i2c_speed
)
1956 dev
->board
.i2c_speed
= EM28XX_I2C_CLK_WAIT_ENABLE
|
1957 EM28XX_I2C_FREQ_100_KHZ
;
1961 /* FIXME: Should be replaced by a proper mt9m111 driver */
1962 static int em28xx_initialize_mt9m111(struct em28xx
*dev
)
1965 unsigned char regs
[][3] = {
1966 { 0x0d, 0x00, 0x01, }, /* reset and use defaults */
1967 { 0x0d, 0x00, 0x00, },
1968 { 0x0a, 0x00, 0x21, },
1969 { 0x21, 0x04, 0x00, }, /* full readout speed, no row/col skipping */
1972 for (i
= 0; i
< ARRAY_SIZE(regs
); i
++)
1973 i2c_master_send(&dev
->i2c_client
, ®s
[i
][0], 3);
1979 /* FIXME: Should be replaced by a proper mt9m001 driver */
1980 static int em28xx_initialize_mt9m001(struct em28xx
*dev
)
1983 unsigned char regs
[][3] = {
1984 { 0x0d, 0x00, 0x01, },
1985 { 0x0d, 0x00, 0x00, },
1986 { 0x04, 0x05, 0x00, }, /* hres = 1280 */
1987 { 0x03, 0x04, 0x00, }, /* vres = 1024 */
1988 { 0x20, 0x11, 0x00, },
1989 { 0x06, 0x00, 0x10, },
1990 { 0x2b, 0x00, 0x24, },
1991 { 0x2e, 0x00, 0x24, },
1992 { 0x35, 0x00, 0x24, },
1993 { 0x2d, 0x00, 0x20, },
1994 { 0x2c, 0x00, 0x20, },
1995 { 0x09, 0x0a, 0xd4, },
1996 { 0x35, 0x00, 0x57, },
1999 for (i
= 0; i
< ARRAY_SIZE(regs
); i
++)
2000 i2c_master_send(&dev
->i2c_client
, ®s
[i
][0], 3);
2005 /* HINT method: webcam I2C chips
2007 * This method works for webcams with Micron sensors
2009 static int em28xx_hint_sensor(struct em28xx
*dev
)
2017 /* Micron sensor detection */
2018 dev
->i2c_client
.addr
= 0xba >> 1;
2020 i2c_master_send(&dev
->i2c_client
, &cmd
, 1);
2021 rc
= i2c_master_recv(&dev
->i2c_client
, (char *)&version_be
, 2);
2025 version
= be16_to_cpu(version_be
);
2027 case 0x8232: /* mt9v011 640x480 1.3 Mpix sensor */
2028 case 0x8243: /* mt9v011 rev B 640x480 1.3 Mpix sensor */
2029 dev
->model
= EM2820_BOARD_SILVERCREST_WEBCAM
;
2030 em28xx_set_model(dev
);
2032 sensor_name
= "mt9v011";
2033 dev
->em28xx_sensor
= EM28XX_MT9V011
;
2034 dev
->sensor_xres
= 640;
2035 dev
->sensor_yres
= 480;
2037 * FIXME: mt9v011 uses I2S speed as xtal clk - at least with
2038 * the Silvercrest cam I have here for testing - for higher
2039 * resolutions, a high clock cause horizontal artifacts, so we
2040 * need to use a lower xclk frequency.
2041 * Yet, it would be possible to adjust xclk depending on the
2042 * desired resolution, since this affects directly the
2045 dev
->board
.xclk
= EM28XX_XCLK_FREQUENCY_4_3MHZ
;
2046 dev
->sensor_xtal
= 4300000;
2048 /* probably means GRGB 16 bit bayer */
2049 dev
->vinmode
= 0x0d;
2054 case 0x143a: /* MT9M111 as found in the ECS G200 */
2055 dev
->model
= EM2750_BOARD_UNKNOWN
;
2056 em28xx_set_model(dev
);
2058 sensor_name
= "mt9m111";
2059 dev
->board
.xclk
= EM28XX_XCLK_FREQUENCY_48MHZ
;
2060 dev
->em28xx_sensor
= EM28XX_MT9M111
;
2061 em28xx_initialize_mt9m111(dev
);
2062 dev
->sensor_xres
= 640;
2063 dev
->sensor_yres
= 512;
2065 dev
->vinmode
= 0x0a;
2071 dev
->model
= EM2750_BOARD_UNKNOWN
;
2072 em28xx_set_model(dev
);
2074 sensor_name
= "mt9m001";
2075 dev
->em28xx_sensor
= EM28XX_MT9M001
;
2076 em28xx_initialize_mt9m001(dev
);
2077 dev
->sensor_xres
= 1280;
2078 dev
->sensor_yres
= 1024;
2080 /* probably means BGGR 16 bit bayer */
2081 dev
->vinmode
= 0x0c;
2086 printk("Unknown Micron Sensor 0x%04x\n", version
);
2090 /* Setup webcam defaults */
2091 em28xx_pre_card_setup(dev
);
2093 em28xx_errdev("Sensor is %s, using model %s entry.\n",
2094 sensor_name
, em28xx_boards
[dev
->model
].name
);
2099 /* Since em28xx_pre_card_setup() requires a proper dev->model,
2100 * this won't work for boards with generic PCI IDs
2102 void em28xx_pre_card_setup(struct em28xx
*dev
)
2104 /* Set the initial XCLK and I2C clock values based on the board
2106 em28xx_write_reg(dev
, EM28XX_R0F_XCLK
, dev
->board
.xclk
& 0x7f);
2107 em28xx_write_reg(dev
, EM28XX_R06_I2C_CLK
, dev
->board
.i2c_speed
);
2110 /* request some modules */
2111 switch (dev
->model
) {
2112 case EM2861_BOARD_PLEXTOR_PX_TV100U
:
2113 /* Sets the msp34xx I2S speed */
2114 dev
->i2s_speed
= 2048000;
2116 case EM2861_BOARD_KWORLD_PVRTV_300U
:
2117 case EM2880_BOARD_KWORLD_DVB_305U
:
2118 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0x6d);
2120 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0x7d);
2123 case EM2870_BOARD_COMPRO_VIDEOMATE
:
2124 /* TODO: someone can do some cleanup here...
2125 not everything's needed */
2126 em28xx_write_reg(dev
, EM2880_R04_GPO
, 0x00);
2128 em28xx_write_reg(dev
, EM2880_R04_GPO
, 0x01);
2130 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xfd);
2132 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xfc);
2134 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xdc);
2136 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xfc);
2139 case EM2870_BOARD_TERRATEC_XS_MT2060
:
2140 /* this device needs some gpio writes to get the DVB-T
2142 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xfe);
2144 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xde);
2146 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xfe);
2149 case EM2870_BOARD_PINNACLE_PCTV_DVB
:
2150 /* this device needs some gpio writes to get the
2152 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xfe);
2154 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xde);
2156 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xfe);
2159 case EM2820_BOARD_GADMEI_UTV310
:
2160 case EM2820_BOARD_MSI_VOX_USB_2
:
2161 /* enables audio for that devices */
2162 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xfd);
2165 case EM2882_BOARD_KWORLD_ATSC_315U
:
2166 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xff);
2168 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xfe);
2170 em28xx_write_reg(dev
, EM2880_R04_GPO
, 0x00);
2172 em28xx_write_reg(dev
, EM2880_R04_GPO
, 0x08);
2176 case EM2860_BOARD_KAIOMY_TVNPC_U2
:
2177 em28xx_write_regs(dev
, EM28XX_R0F_XCLK
, "\x07", 1);
2178 em28xx_write_regs(dev
, EM28XX_R06_I2C_CLK
, "\x40", 1);
2179 em28xx_write_regs(dev
, 0x0d, "\x42", 1);
2180 em28xx_write_regs(dev
, 0x08, "\xfd", 1);
2182 em28xx_write_regs(dev
, 0x08, "\xff", 1);
2184 em28xx_write_regs(dev
, 0x08, "\x7f", 1);
2186 em28xx_write_regs(dev
, 0x08, "\x6b", 1);
2189 case EM2860_BOARD_EASYCAP
:
2190 em28xx_write_regs(dev
, 0x08, "\xf8", 1);
2193 case EM2820_BOARD_IODATA_GVMVP_SZ
:
2194 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xff);
2196 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xf7);
2198 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xfe);
2200 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xfd);
2205 em28xx_gpio_set(dev
, dev
->board
.tuner_gpio
);
2206 em28xx_set_mode(dev
, EM28XX_ANALOG_MODE
);
2209 em28xx_set_mode(dev
, EM28XX_SUSPEND
);
2212 static void em28xx_setup_xc3028(struct em28xx
*dev
, struct xc2028_ctrl
*ctl
)
2214 memset(ctl
, 0, sizeof(*ctl
));
2216 ctl
->fname
= XC2028_DEFAULT_FIRMWARE
;
2218 ctl
->mts
= em28xx_boards
[dev
->model
].mts_firmware
;
2220 switch (dev
->model
) {
2221 case EM2880_BOARD_EMPIRE_DUAL_TV
:
2222 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900
:
2223 case EM2882_BOARD_TERRATEC_HYBRID_XS
:
2224 ctl
->demod
= XC3028_FE_ZARLINK456
;
2226 case EM2880_BOARD_TERRATEC_HYBRID_XS
:
2227 case EM2880_BOARD_TERRATEC_HYBRID_XS_FR
:
2228 case EM2881_BOARD_PINNACLE_HYBRID_PRO
:
2229 ctl
->demod
= XC3028_FE_ZARLINK456
;
2231 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2
:
2232 /* djh - Not sure which demod we need here */
2233 ctl
->demod
= XC3028_FE_DEFAULT
;
2235 case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600
:
2236 ctl
->demod
= XC3028_FE_DEFAULT
;
2237 ctl
->fname
= XC3028L_DEFAULT_FIRMWARE
;
2239 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850
:
2240 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950
:
2241 case EM2880_BOARD_PINNACLE_PCTV_HD_PRO
:
2242 /* FIXME: Better to specify the needed IF */
2243 ctl
->demod
= XC3028_FE_DEFAULT
;
2245 case EM2883_BOARD_KWORLD_HYBRID_330U
:
2246 case EM2882_BOARD_DIKOM_DK300
:
2247 case EM2882_BOARD_KWORLD_VS_DVBT
:
2248 ctl
->demod
= XC3028_FE_CHINA
;
2249 ctl
->fname
= XC2028_DEFAULT_FIRMWARE
;
2251 case EM2882_BOARD_EVGA_INDTUBE
:
2252 ctl
->demod
= XC3028_FE_CHINA
;
2253 ctl
->fname
= XC3028L_DEFAULT_FIRMWARE
;
2256 ctl
->demod
= XC3028_FE_OREN538
;
2260 static void em28xx_tuner_setup(struct em28xx
*dev
)
2262 struct tuner_setup tun_setup
;
2263 struct v4l2_frequency f
;
2265 if (dev
->tuner_type
== TUNER_ABSENT
)
2268 memset(&tun_setup
, 0, sizeof(tun_setup
));
2270 tun_setup
.mode_mask
= T_ANALOG_TV
| T_RADIO
;
2271 tun_setup
.tuner_callback
= em28xx_tuner_callback
;
2273 if (dev
->board
.radio
.type
) {
2274 tun_setup
.type
= dev
->board
.radio
.type
;
2275 tun_setup
.addr
= dev
->board
.radio_addr
;
2277 v4l2_device_call_all(&dev
->v4l2_dev
, 0, tuner
, s_type_addr
, &tun_setup
);
2280 if ((dev
->tuner_type
!= TUNER_ABSENT
) && (dev
->tuner_type
)) {
2281 tun_setup
.type
= dev
->tuner_type
;
2282 tun_setup
.addr
= dev
->tuner_addr
;
2284 v4l2_device_call_all(&dev
->v4l2_dev
, 0, tuner
, s_type_addr
, &tun_setup
);
2287 if (dev
->tda9887_conf
) {
2288 struct v4l2_priv_tun_config tda9887_cfg
;
2290 tda9887_cfg
.tuner
= TUNER_TDA9887
;
2291 tda9887_cfg
.priv
= &dev
->tda9887_conf
;
2293 v4l2_device_call_all(&dev
->v4l2_dev
, 0, tuner
, s_config
, &tda9887_cfg
);
2296 if (dev
->tuner_type
== TUNER_XC2028
) {
2297 struct v4l2_priv_tun_config xc2028_cfg
;
2298 struct xc2028_ctrl ctl
;
2300 memset(&xc2028_cfg
, 0, sizeof(xc2028_cfg
));
2301 memset(&ctl
, 0, sizeof(ctl
));
2303 em28xx_setup_xc3028(dev
, &ctl
);
2305 xc2028_cfg
.tuner
= TUNER_XC2028
;
2306 xc2028_cfg
.priv
= &ctl
;
2308 v4l2_device_call_all(&dev
->v4l2_dev
, 0, tuner
, s_config
, &xc2028_cfg
);
2311 /* configure tuner */
2313 f
.type
= V4L2_TUNER_ANALOG_TV
;
2314 f
.frequency
= 9076; /* just a magic number */
2315 dev
->ctl_freq
= f
.frequency
;
2316 v4l2_device_call_all(&dev
->v4l2_dev
, 0, tuner
, s_frequency
, &f
);
2319 static int em28xx_hint_board(struct em28xx
*dev
)
2323 /* HINT method: EEPROM
2325 * This method works only for boards with eeprom.
2326 * Uses a hash of all eeprom bytes. The hash should be
2327 * unique for a vendor/tuner pair.
2328 * There are a high chance that tuners for different
2329 * video standards produce different hashes.
2331 for (i
= 0; i
< ARRAY_SIZE(em28xx_eeprom_hash
); i
++) {
2332 if (dev
->hash
== em28xx_eeprom_hash
[i
].hash
) {
2333 dev
->model
= em28xx_eeprom_hash
[i
].model
;
2334 dev
->tuner_type
= em28xx_eeprom_hash
[i
].tuner
;
2336 em28xx_errdev("Your board has no unique USB ID.\n");
2337 em28xx_errdev("A hint were successfully done, "
2338 "based on eeprom hash.\n");
2339 em28xx_errdev("This method is not 100%% failproof.\n");
2340 em28xx_errdev("If the board were missdetected, "
2341 "please email this log to:\n");
2342 em28xx_errdev("\tV4L Mailing List "
2343 " <linux-media@vger.kernel.org>\n");
2344 em28xx_errdev("Board detected as %s\n",
2345 em28xx_boards
[dev
->model
].name
);
2351 /* HINT method: I2C attached devices
2353 * This method works for all boards.
2354 * Uses a hash of i2c scanned devices.
2355 * Devices with the same i2c attached chips will
2356 * be considered equal.
2357 * This method is less precise than the eeprom one.
2360 /* user did not request i2c scanning => do it now */
2362 em28xx_do_i2c_scan(dev
);
2364 for (i
= 0; i
< ARRAY_SIZE(em28xx_i2c_hash
); i
++) {
2365 if (dev
->i2c_hash
== em28xx_i2c_hash
[i
].hash
) {
2366 dev
->model
= em28xx_i2c_hash
[i
].model
;
2367 dev
->tuner_type
= em28xx_i2c_hash
[i
].tuner
;
2368 em28xx_errdev("Your board has no unique USB ID.\n");
2369 em28xx_errdev("A hint were successfully done, "
2370 "based on i2c devicelist hash.\n");
2371 em28xx_errdev("This method is not 100%% failproof.\n");
2372 em28xx_errdev("If the board were missdetected, "
2373 "please email this log to:\n");
2374 em28xx_errdev("\tV4L Mailing List "
2375 " <linux-media@vger.kernel.org>\n");
2376 em28xx_errdev("Board detected as %s\n",
2377 em28xx_boards
[dev
->model
].name
);
2383 em28xx_errdev("Your board has no unique USB ID and thus need a "
2384 "hint to be detected.\n");
2385 em28xx_errdev("You may try to use card=<n> insmod option to "
2386 "workaround that.\n");
2387 em28xx_errdev("Please send an email with this log to:\n");
2388 em28xx_errdev("\tV4L Mailing List <linux-media@vger.kernel.org>\n");
2389 em28xx_errdev("Board eeprom hash is 0x%08lx\n", dev
->hash
);
2390 em28xx_errdev("Board i2c devicelist hash is 0x%08lx\n", dev
->i2c_hash
);
2392 em28xx_errdev("Here is a list of valid choices for the card=<n>"
2393 " insmod option:\n");
2394 for (i
= 0; i
< em28xx_bcount
; i
++) {
2395 em28xx_errdev(" card=%d -> %s\n",
2396 i
, em28xx_boards
[i
].name
);
2401 /* ----------------------------------------------------------------------- */
2402 void em28xx_register_i2c_ir(struct em28xx
*dev
)
2404 /* Leadtek winfast tv USBII deluxe can find a non working IR-device */
2405 /* at address 0x18, so if that address is needed for another board in */
2406 /* the future, please put it after 0x1f. */
2407 struct i2c_board_info info
;
2408 const unsigned short addr_list
[] = {
2409 0x1f, 0x30, 0x47, I2C_CLIENT_END
2415 memset(&info
, 0, sizeof(struct i2c_board_info
));
2416 memset(&dev
->init_data
, 0, sizeof(dev
->init_data
));
2417 strlcpy(info
.type
, "ir_video", I2C_NAME_SIZE
);
2419 /* detect & configure */
2420 switch (dev
->model
) {
2421 case EM2800_BOARD_TERRATEC_CINERGY_200
:
2422 case EM2820_BOARD_TERRATEC_CINERGY_250
:
2423 dev
->init_data
.ir_codes
= RC_MAP_EM_TERRATEC
;
2424 dev
->init_data
.get_key
= em28xx_get_key_terratec
;
2425 dev
->init_data
.name
= "i2c IR (EM28XX Terratec)";
2427 case EM2820_BOARD_PINNACLE_USB_2
:
2428 dev
->init_data
.ir_codes
= RC_MAP_PINNACLE_GREY
;
2429 dev
->init_data
.get_key
= em28xx_get_key_pinnacle_usb_grey
;
2430 dev
->init_data
.name
= "i2c IR (EM28XX Pinnacle PCTV)";
2432 case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2
:
2433 dev
->init_data
.ir_codes
= RC_MAP_HAUPPAUGE
;
2434 dev
->init_data
.get_key
= em28xx_get_key_em_haup
;
2435 dev
->init_data
.name
= "i2c IR (EM2840 Hauppauge)";
2437 case EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE
:
2438 dev
->init_data
.ir_codes
= RC_MAP_WINFAST_USBII_DELUXE
;
2439 dev
->init_data
.get_key
= em28xx_get_key_winfast_usbii_deluxe
;
2440 dev
->init_data
.name
= "i2c IR (EM2820 Winfast TV USBII Deluxe)";
2444 if (dev
->init_data
.name
)
2445 info
.platform_data
= &dev
->init_data
;
2446 i2c_new_probed_device(&dev
->i2c_adap
, &info
, addr_list
, NULL
);
2449 void em28xx_card_setup(struct em28xx
*dev
)
2452 * If the device can be a webcam, seek for a sensor.
2453 * If sensor is not found, then it isn't a webcam.
2455 if (dev
->board
.is_webcam
) {
2456 if (em28xx_hint_sensor(dev
) < 0)
2457 dev
->board
.is_webcam
= 0;
2459 dev
->progressive
= 1;
2462 if (!dev
->board
.is_webcam
) {
2463 switch (dev
->model
) {
2464 case EM2820_BOARD_UNKNOWN
:
2465 case EM2800_BOARD_UNKNOWN
:
2467 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD.
2469 * This occurs because they share identical USB vendor and
2472 * What we do here is look up the EEPROM hash of the K-WORLD
2473 * and if it is found then we decide that we do not have
2474 * a DIGIVOX and reset the device to the K-WORLD instead.
2476 * This solution is only valid if they do not share eeprom
2477 * hash identities which has not been determined as yet.
2479 if (em28xx_hint_board(dev
) < 0)
2480 em28xx_errdev("Board not discovered\n");
2482 em28xx_set_model(dev
);
2483 em28xx_pre_card_setup(dev
);
2487 em28xx_set_model(dev
);
2491 em28xx_info("Identified as %s (card=%d)\n",
2492 dev
->board
.name
, dev
->model
);
2494 dev
->tuner_type
= em28xx_boards
[dev
->model
].tuner_type
;
2495 if (em28xx_boards
[dev
->model
].tuner_addr
)
2496 dev
->tuner_addr
= em28xx_boards
[dev
->model
].tuner_addr
;
2498 if (em28xx_boards
[dev
->model
].tda9887_conf
)
2499 dev
->tda9887_conf
= em28xx_boards
[dev
->model
].tda9887_conf
;
2501 /* request some modules */
2502 switch (dev
->model
) {
2503 case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2
:
2504 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900
:
2505 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2
:
2506 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850
:
2507 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950
:
2510 #if defined(CONFIG_MODULES) && defined(MODULE)
2511 request_module("tveeprom");
2513 /* Call first TVeeprom */
2515 dev
->i2c_client
.addr
= 0xa0 >> 1;
2516 tveeprom_hauppauge_analog(&dev
->i2c_client
, &tv
, dev
->eedata
);
2518 dev
->tuner_type
= tv
.tuner_type
;
2520 if (tv
.audio_processor
== V4L2_IDENT_MSPX4XX
) {
2521 dev
->i2s_speed
= 2048000;
2522 dev
->board
.has_msp34xx
= 1;
2526 case EM2882_BOARD_KWORLD_ATSC_315U
:
2527 em28xx_write_reg(dev
, 0x0d, 0x42);
2529 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xfd);
2532 case EM2820_BOARD_KWORLD_PVRTV2800RF
:
2533 /* GPIO enables sound on KWORLD PVR TV 2800RF */
2534 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xf9);
2536 case EM2820_BOARD_UNKNOWN
:
2537 case EM2800_BOARD_UNKNOWN
:
2539 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD.
2541 * This occurs because they share identical USB vendor and
2544 * What we do here is look up the EEPROM hash of the K-WORLD
2545 * and if it is found then we decide that we do not have
2546 * a DIGIVOX and reset the device to the K-WORLD instead.
2548 * This solution is only valid if they do not share eeprom
2549 * hash identities which has not been determined as yet.
2551 case EM2880_BOARD_MSI_DIGIVOX_AD
:
2552 if (!em28xx_hint_board(dev
))
2553 em28xx_set_model(dev
);
2555 /* In cases where we had to use a board hint, the call to
2556 em28xx_set_mode() in em28xx_pre_card_setup() was a no-op,
2557 so make the call now so the analog GPIOs are set properly
2558 before probing the i2c bus. */
2559 em28xx_gpio_set(dev
, dev
->board
.tuner_gpio
);
2560 em28xx_set_mode(dev
, EM28XX_ANALOG_MODE
);
2564 * The Dikom DK300 is detected as an Kworld VS-DVB-T 323UR.
2566 * This occurs because they share identical USB vendor and
2569 * What we do here is look up the EEPROM hash of the Dikom
2570 * and if it is found then we decide that we do not have
2571 * a Kworld and reset the device to the Dikom instead.
2573 * This solution is only valid if they do not share eeprom
2574 * hash identities which has not been determined as yet.
2576 case EM2882_BOARD_KWORLD_VS_DVBT
:
2577 if (!em28xx_hint_board(dev
))
2578 em28xx_set_model(dev
);
2580 /* In cases where we had to use a board hint, the call to
2581 em28xx_set_mode() in em28xx_pre_card_setup() was a no-op,
2582 so make the call now so the analog GPIOs are set properly
2583 before probing the i2c bus. */
2584 em28xx_gpio_set(dev
, dev
->board
.tuner_gpio
);
2585 em28xx_set_mode(dev
, EM28XX_ANALOG_MODE
);
2589 #if defined(CONFIG_MODULES) && defined(MODULE)
2590 if (dev
->board
.has_ir_i2c
&& !disable_ir
)
2591 request_module("ir-kbd-i2c");
2593 if (dev
->board
.has_snapshot_button
)
2594 em28xx_register_snapshot_button(dev
);
2596 if (dev
->board
.valid
== EM28XX_BOARD_NOT_VALIDATED
) {
2597 em28xx_errdev("\n\n");
2598 em28xx_errdev("The support for this board weren't "
2600 em28xx_errdev("Please send a report of having this working\n");
2601 em28xx_errdev("not to V4L mailing list (and/or to other "
2605 /* Allow override tuner type by a module parameter */
2607 dev
->tuner_type
= tuner
;
2609 /* request some modules */
2610 if (dev
->board
.has_msp34xx
)
2611 v4l2_i2c_new_subdev(&dev
->v4l2_dev
, &dev
->i2c_adap
,
2612 "msp3400", 0, msp3400_addrs
);
2614 if (dev
->board
.decoder
== EM28XX_SAA711X
)
2615 v4l2_i2c_new_subdev(&dev
->v4l2_dev
, &dev
->i2c_adap
,
2616 "saa7115_auto", 0, saa711x_addrs
);
2618 if (dev
->board
.decoder
== EM28XX_TVP5150
)
2619 v4l2_i2c_new_subdev(&dev
->v4l2_dev
, &dev
->i2c_adap
,
2620 "tvp5150", 0, tvp5150_addrs
);
2622 if (dev
->em28xx_sensor
== EM28XX_MT9V011
) {
2623 struct mt9v011_platform_data pdata
;
2624 struct i2c_board_info mt9v011_info
= {
2627 .platform_data
= &pdata
,
2629 struct v4l2_subdev
*sd
;
2631 pdata
.xtal
= dev
->sensor_xtal
;
2632 sd
= v4l2_i2c_new_subdev_board(&dev
->v4l2_dev
, &dev
->i2c_adap
,
2633 &mt9v011_info
, NULL
);
2637 if (dev
->board
.adecoder
== EM28XX_TVAUDIO
)
2638 v4l2_i2c_new_subdev(&dev
->v4l2_dev
, &dev
->i2c_adap
,
2639 "tvaudio", dev
->board
.tvaudio_addr
, NULL
);
2641 if (dev
->board
.tuner_type
!= TUNER_ABSENT
) {
2642 int has_demod
= (dev
->tda9887_conf
& TDA9887_PRESENT
);
2644 if (dev
->board
.radio
.type
)
2645 v4l2_i2c_new_subdev(&dev
->v4l2_dev
, &dev
->i2c_adap
,
2646 "tuner", dev
->board
.radio_addr
, NULL
);
2649 v4l2_i2c_new_subdev(&dev
->v4l2_dev
,
2650 &dev
->i2c_adap
, "tuner",
2651 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD
));
2652 if (dev
->tuner_addr
== 0) {
2653 enum v4l2_i2c_tuner_type type
=
2654 has_demod
? ADDRS_TV_WITH_DEMOD
: ADDRS_TV
;
2655 struct v4l2_subdev
*sd
;
2657 sd
= v4l2_i2c_new_subdev(&dev
->v4l2_dev
,
2658 &dev
->i2c_adap
, "tuner",
2659 0, v4l2_i2c_tuner_addrs(type
));
2662 dev
->tuner_addr
= v4l2_i2c_subdev_addr(sd
);
2664 v4l2_i2c_new_subdev(&dev
->v4l2_dev
, &dev
->i2c_adap
,
2665 "tuner", dev
->tuner_addr
, NULL
);
2669 em28xx_tuner_setup(dev
);
2672 em28xx_ir_init(dev
);
2676 #if defined(CONFIG_MODULES) && defined(MODULE)
2677 static void request_module_async(struct work_struct
*work
)
2679 struct em28xx
*dev
= container_of(work
,
2680 struct em28xx
, request_module_wk
);
2682 if (dev
->has_audio_class
)
2683 request_module("snd-usb-audio");
2684 else if (dev
->has_alsa_audio
)
2685 request_module("em28xx-alsa");
2687 if (dev
->board
.has_dvb
)
2688 request_module("em28xx-dvb");
2691 static void request_modules(struct em28xx
*dev
)
2693 INIT_WORK(&dev
->request_module_wk
, request_module_async
);
2694 schedule_work(&dev
->request_module_wk
);
2697 static void flush_request_modules(struct em28xx
*dev
)
2699 flush_work_sync(&dev
->request_module_wk
);
2702 #define request_modules(dev)
2703 #define flush_request_modules(dev)
2704 #endif /* CONFIG_MODULES */
2707 * em28xx_realease_resources()
2708 * unregisters the v4l2,i2c and usb devices
2709 * called when the device gets disconected or at module unload
2711 void em28xx_release_resources(struct em28xx
*dev
)
2713 if (dev
->sbutton_input_dev
)
2714 em28xx_deregister_snapshot_button(dev
);
2717 em28xx_ir_fini(dev
);
2719 /*FIXME: I2C IR should be disconnected */
2721 em28xx_release_analog_resources(dev
);
2723 em28xx_remove_from_devlist(dev
);
2725 em28xx_i2c_unregister(dev
);
2727 v4l2_device_unregister(&dev
->v4l2_dev
);
2729 usb_put_dev(dev
->udev
);
2731 /* Mark device as unused */
2732 em28xx_devused
&= ~(1 << dev
->devno
);
2737 * allocates and inits the device structs, registers i2c bus and v4l device
2739 static int em28xx_init_dev(struct em28xx
**devhandle
, struct usb_device
*udev
,
2740 struct usb_interface
*interface
,
2743 struct em28xx
*dev
= *devhandle
;
2748 mutex_init(&dev
->ctrl_urb_lock
);
2749 spin_lock_init(&dev
->slock
);
2750 init_waitqueue_head(&dev
->open
);
2751 init_waitqueue_head(&dev
->wait_frame
);
2752 init_waitqueue_head(&dev
->wait_stream
);
2754 dev
->em28xx_write_regs
= em28xx_write_regs
;
2755 dev
->em28xx_read_reg
= em28xx_read_reg
;
2756 dev
->em28xx_read_reg_req_len
= em28xx_read_reg_req_len
;
2757 dev
->em28xx_write_regs_req
= em28xx_write_regs_req
;
2758 dev
->em28xx_read_reg_req
= em28xx_read_reg_req
;
2759 dev
->board
.is_em2800
= em28xx_boards
[dev
->model
].is_em2800
;
2761 em28xx_set_model(dev
);
2763 /* Set the default GPO/GPIO for legacy devices */
2764 dev
->reg_gpo_num
= EM2880_R04_GPO
;
2765 dev
->reg_gpio_num
= EM28XX_R08_GPIO
;
2767 dev
->wait_after_write
= 5;
2769 /* Based on the Chip ID, set the device configuration */
2770 retval
= em28xx_read_reg(dev
, EM28XX_R0A_CHIPID
);
2772 dev
->chip_id
= retval
;
2774 switch (dev
->chip_id
) {
2775 case CHIP_ID_EM2800
:
2776 em28xx_info("chip ID is em2800\n");
2778 case CHIP_ID_EM2710
:
2779 em28xx_info("chip ID is em2710\n");
2781 case CHIP_ID_EM2750
:
2782 em28xx_info("chip ID is em2750\n");
2784 case CHIP_ID_EM2820
:
2785 em28xx_info("chip ID is em2820 (or em2710)\n");
2787 case CHIP_ID_EM2840
:
2788 em28xx_info("chip ID is em2840\n");
2790 case CHIP_ID_EM2860
:
2791 em28xx_info("chip ID is em2860\n");
2793 case CHIP_ID_EM2870
:
2794 em28xx_info("chip ID is em2870\n");
2795 dev
->wait_after_write
= 0;
2797 case CHIP_ID_EM2874
:
2798 em28xx_info("chip ID is em2874\n");
2799 dev
->reg_gpio_num
= EM2874_R80_GPIO
;
2800 dev
->wait_after_write
= 0;
2802 case CHIP_ID_EM2883
:
2803 em28xx_info("chip ID is em2882/em2883\n");
2804 dev
->wait_after_write
= 0;
2807 em28xx_info("em28xx chip ID = %d\n", dev
->chip_id
);
2811 /* Prepopulate cached GPO register content */
2812 retval
= em28xx_read_reg(dev
, dev
->reg_gpo_num
);
2814 dev
->reg_gpo
= retval
;
2816 em28xx_pre_card_setup(dev
);
2818 if (!dev
->board
.is_em2800
) {
2819 /* Resets I2C speed */
2820 em28xx_write_reg(dev
, EM28XX_R06_I2C_CLK
, dev
->board
.i2c_speed
);
2822 em28xx_errdev("%s: em28xx_write_regs_req failed!"
2829 retval
= v4l2_device_register(&interface
->dev
, &dev
->v4l2_dev
);
2831 em28xx_errdev("Call to v4l2_device_register() failed!\n");
2835 /* register i2c bus */
2836 errCode
= em28xx_i2c_register(dev
);
2838 v4l2_device_unregister(&dev
->v4l2_dev
);
2839 em28xx_errdev("%s: em28xx_i2c_register - errCode [%d]!\n",
2845 * Default format, used for tvp5150 or saa711x output formats
2847 dev
->vinmode
= 0x10;
2848 dev
->vinctl
= EM28XX_VINCTRL_INTERLACED
|
2849 EM28XX_VINCTRL_CCIR656_ENABLE
;
2851 /* Do board specific init and eeprom reading */
2852 em28xx_card_setup(dev
);
2854 /* Configure audio */
2855 errCode
= em28xx_audio_setup(dev
);
2857 v4l2_device_unregister(&dev
->v4l2_dev
);
2858 em28xx_errdev("%s: Error while setting audio - errCode [%d]!\n",
2862 /* wake i2c devices */
2863 em28xx_wake_i2c(dev
);
2865 /* init video dma queues */
2866 INIT_LIST_HEAD(&dev
->vidq
.active
);
2867 INIT_LIST_HEAD(&dev
->vidq
.queued
);
2868 INIT_LIST_HEAD(&dev
->vbiq
.active
);
2869 INIT_LIST_HEAD(&dev
->vbiq
.queued
);
2871 if (dev
->board
.has_msp34xx
) {
2872 /* Send a reset to other chips via gpio */
2873 errCode
= em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xf7);
2875 em28xx_errdev("%s: em28xx_write_regs_req - "
2876 "msp34xx(1) failed! errCode [%d]\n",
2882 errCode
= em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xff);
2884 em28xx_errdev("%s: em28xx_write_regs_req - "
2885 "msp34xx(2) failed! errCode [%d]\n",
2892 em28xx_add_into_devlist(dev
);
2894 retval
= em28xx_register_analog_devices(dev
);
2896 em28xx_release_resources(dev
);
2897 goto fail_reg_devices
;
2900 em28xx_init_extension(dev
);
2902 /* Save some power by putting tuner to sleep */
2903 v4l2_device_call_all(&dev
->v4l2_dev
, 0, core
, s_power
, 0);
2912 * em28xx_usb_probe()
2913 * checks for supported devices
2915 static int em28xx_usb_probe(struct usb_interface
*interface
,
2916 const struct usb_device_id
*id
)
2918 const struct usb_endpoint_descriptor
*endpoint
;
2919 struct usb_device
*udev
;
2920 struct usb_interface
*uif
;
2921 struct em28xx
*dev
= NULL
;
2923 int i
, nr
, ifnum
, isoc_pipe
;
2925 char descr
[255] = "";
2927 udev
= usb_get_dev(interface_to_usbdev(interface
));
2928 ifnum
= interface
->altsetting
[0].desc
.bInterfaceNumber
;
2930 /* Check to see next free device and mark as used */
2931 nr
= find_first_zero_bit(&em28xx_devused
, EM28XX_MAXBOARDS
);
2932 em28xx_devused
|= 1<<nr
;
2934 /* Don't register audio interfaces */
2935 if (interface
->altsetting
[0].desc
.bInterfaceClass
== USB_CLASS_AUDIO
) {
2936 em28xx_err(DRIVER_NAME
" audio device (%04x:%04x): "
2937 "interface %i, class %i\n",
2938 le16_to_cpu(udev
->descriptor
.idVendor
),
2939 le16_to_cpu(udev
->descriptor
.idProduct
),
2941 interface
->altsetting
[0].desc
.bInterfaceClass
);
2943 em28xx_devused
&= ~(1<<nr
);
2948 endpoint
= &interface
->cur_altsetting
->endpoint
[0].desc
;
2950 /* check if the device has the iso in endpoint at the correct place */
2951 if (usb_endpoint_xfer_isoc(endpoint
)
2953 (interface
->altsetting
[1].endpoint
[0].desc
.wMaxPacketSize
== 940)) {
2954 /* It's a newer em2874/em2875 device */
2957 int check_interface
= 1;
2959 endpoint
= &interface
->cur_altsetting
->endpoint
[1].desc
;
2960 if (!usb_endpoint_xfer_isoc(endpoint
))
2961 check_interface
= 0;
2963 if (usb_endpoint_dir_out(endpoint
))
2964 check_interface
= 0;
2966 if (!check_interface
) {
2967 em28xx_err(DRIVER_NAME
" video device (%04x:%04x): "
2968 "interface %i, class %i found.\n",
2969 le16_to_cpu(udev
->descriptor
.idVendor
),
2970 le16_to_cpu(udev
->descriptor
.idProduct
),
2972 interface
->altsetting
[0].desc
.bInterfaceClass
);
2974 em28xx_err(DRIVER_NAME
" This is an anciliary "
2975 "interface not used by the driver\n");
2977 em28xx_devused
&= ~(1<<nr
);
2983 switch (udev
->speed
) {
2987 case USB_SPEED_UNKNOWN
:
2988 case USB_SPEED_FULL
:
2991 case USB_SPEED_HIGH
:
2998 if (udev
->manufacturer
)
2999 strlcpy(descr
, udev
->manufacturer
, sizeof(descr
));
3001 if (udev
->product
) {
3003 strlcat(descr
, " ", sizeof(descr
));
3004 strlcat(descr
, udev
->product
, sizeof(descr
));
3007 strlcat(descr
, " ", sizeof(descr
));
3009 printk(DRIVER_NAME
": New device %s@ %s Mbps "
3010 "(%04x:%04x, interface %d, class %d)\n",
3013 le16_to_cpu(udev
->descriptor
.idVendor
),
3014 le16_to_cpu(udev
->descriptor
.idProduct
),
3016 interface
->altsetting
->desc
.bInterfaceNumber
);
3019 * Make sure we have 480 Mbps of bandwidth, otherwise things like
3020 * video stream wouldn't likely work, since 12 Mbps is generally
3021 * not enough even for most Digital TV streams.
3023 if (udev
->speed
!= USB_SPEED_HIGH
&& disable_usb_speed_check
== 0) {
3024 printk(DRIVER_NAME
": Device initialization failed.\n");
3025 printk(DRIVER_NAME
": Device must be connected to a high-speed"
3026 " USB 2.0 port.\n");
3027 em28xx_devused
&= ~(1<<nr
);
3032 if (nr
>= EM28XX_MAXBOARDS
) {
3033 printk(DRIVER_NAME
": Supports only %i em28xx boards.\n",
3035 em28xx_devused
&= ~(1<<nr
);
3040 /* allocate memory for our device state and initialize it */
3041 dev
= kzalloc(sizeof(*dev
), GFP_KERNEL
);
3043 em28xx_err(DRIVER_NAME
": out of memory!\n");
3044 em28xx_devused
&= ~(1<<nr
);
3049 snprintf(dev
->name
, 29, "em28xx #%d", nr
);
3051 dev
->model
= id
->driver_info
;
3054 /* Checks if audio is provided by some interface */
3055 for (i
= 0; i
< udev
->config
->desc
.bNumInterfaces
; i
++) {
3056 uif
= udev
->config
->interface
[i
];
3057 if (uif
->altsetting
[0].desc
.bInterfaceClass
== USB_CLASS_AUDIO
) {
3058 dev
->has_audio_class
= 1;
3063 /* compute alternate max packet sizes */
3064 uif
= udev
->actconfig
->interface
[0];
3066 dev
->num_alt
= uif
->num_altsetting
;
3067 dev
->alt_max_pkt_size
= kmalloc(32 * dev
->num_alt
, GFP_KERNEL
);
3069 if (dev
->alt_max_pkt_size
== NULL
) {
3070 em28xx_errdev("out of memory!\n");
3071 em28xx_devused
&= ~(1<<nr
);
3077 for (i
= 0; i
< dev
->num_alt
; i
++) {
3078 u16 tmp
= le16_to_cpu(uif
->altsetting
[i
].endpoint
[isoc_pipe
].desc
.wMaxPacketSize
);
3079 dev
->alt_max_pkt_size
[i
] =
3080 (tmp
& 0x07ff) * (((tmp
& 0x1800) >> 11) + 1);
3083 if ((card
[nr
] >= 0) && (card
[nr
] < em28xx_bcount
))
3084 dev
->model
= card
[nr
];
3086 /* allocate device struct */
3087 mutex_init(&dev
->lock
);
3088 mutex_lock(&dev
->lock
);
3089 retval
= em28xx_init_dev(&dev
, udev
, interface
, nr
);
3091 em28xx_devused
&= ~(1<<dev
->devno
);
3092 mutex_unlock(&dev
->lock
);
3097 /* save our data pointer in this interface device */
3098 usb_set_intfdata(interface
, dev
);
3100 request_modules(dev
);
3102 /* Should be the last thing to do, to avoid newer udev's to
3103 open the device before fully initializing it
3105 mutex_unlock(&dev
->lock
);
3114 * em28xx_usb_disconnect()
3115 * called when the device gets diconencted
3116 * video device will be unregistered on v4l2_close in case it is still open
3118 static void em28xx_usb_disconnect(struct usb_interface
*interface
)
3122 dev
= usb_get_intfdata(interface
);
3123 usb_set_intfdata(interface
, NULL
);
3128 em28xx_info("disconnecting %s\n", dev
->vdev
->name
);
3130 flush_request_modules(dev
);
3132 /* wait until all current v4l2 io is finished then deallocate
3134 mutex_lock(&dev
->lock
);
3136 wake_up_interruptible_all(&dev
->open
);
3138 v4l2_device_disconnect(&dev
->v4l2_dev
);
3142 ("device %s is open! Deregistration and memory "
3143 "deallocation are deferred on close.\n",
3144 video_device_node_name(dev
->vdev
));
3146 dev
->state
|= DEV_MISCONFIGURED
;
3147 em28xx_uninit_isoc(dev
);
3148 dev
->state
|= DEV_DISCONNECTED
;
3149 wake_up_interruptible(&dev
->wait_frame
);
3150 wake_up_interruptible(&dev
->wait_stream
);
3152 dev
->state
|= DEV_DISCONNECTED
;
3153 em28xx_release_resources(dev
);
3156 em28xx_close_extension(dev
);
3158 mutex_unlock(&dev
->lock
);
3161 kfree(dev
->alt_max_pkt_size
);
3166 static struct usb_driver em28xx_usb_driver
= {
3168 .probe
= em28xx_usb_probe
,
3169 .disconnect
= em28xx_usb_disconnect
,
3170 .id_table
= em28xx_id_table
,
3173 static int __init
em28xx_module_init(void)
3177 /* register this driver with the USB subsystem */
3178 result
= usb_register(&em28xx_usb_driver
);
3180 em28xx_err(DRIVER_NAME
3181 " usb_register failed. Error number %d.\n", result
);
3183 printk(KERN_INFO DRIVER_NAME
" driver loaded\n");
3188 static void __exit
em28xx_module_exit(void)
3190 /* deregister this driver with the USB subsystem */
3191 usb_deregister(&em28xx_usb_driver
);
3194 module_init(em28xx_module_init
);
3195 module_exit(em28xx_module_exit
);