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/delay.h>
28 #include <linux/i2c.h>
29 #include <linux/usb.h>
30 #include <media/tuner.h>
31 #include <media/msp3400.h>
32 #include <media/saa7115.h>
33 #include <media/tvp5150.h>
34 #include <media/tvaudio.h>
35 #include <media/i2c-addr.h>
36 #include <media/tveeprom.h>
37 #include <media/v4l2-common.h>
38 #include <media/v4l2-chip-ident.h>
42 #define DRIVER_NAME "em28xx"
44 static int tuner
= -1;
45 module_param(tuner
, int, 0444);
46 MODULE_PARM_DESC(tuner
, "tuner type");
48 static unsigned int disable_ir
;
49 module_param(disable_ir
, int, 0444);
50 MODULE_PARM_DESC(disable_ir
, "disable infrared remote support");
52 static unsigned int disable_usb_speed_check
;
53 module_param(disable_usb_speed_check
, int, 0444);
54 MODULE_PARM_DESC(disable_usb_speed_check
,
55 "override min bandwidth requirement of 480M bps");
57 static unsigned int card
[] = {[0 ... (EM28XX_MAXBOARDS
- 1)] = UNSET
};
58 module_param_array(card
, int, NULL
, 0444);
59 MODULE_PARM_DESC(card
, "card type");
61 /* Bitmask marking allocated devices from 0 to EM28XX_MAXBOARDS */
62 static unsigned long em28xx_devused
;
64 struct em28xx_hash_table
{
71 * Reset sequences for analog/digital modes
74 /* Reset for the most [analog] boards */
75 static struct em28xx_reg_seq default_analog
[] = {
76 {EM28XX_R08_GPIO
, 0x6d, ~EM_GPIO_4
, 10},
80 /* Reset for the most [digital] boards */
81 static struct em28xx_reg_seq default_digital
[] = {
82 {EM28XX_R08_GPIO
, 0x6e, ~EM_GPIO_4
, 10},
86 /* Board Hauppauge WinTV HVR 900 analog */
87 static struct em28xx_reg_seq hauppauge_wintv_hvr_900_analog
[] = {
88 {EM28XX_R08_GPIO
, 0x2d, ~EM_GPIO_4
, 10},
89 {0x05, 0xff, 0x10, 10},
93 /* Board Hauppauge WinTV HVR 900 digital */
94 static struct em28xx_reg_seq hauppauge_wintv_hvr_900_digital
[] = {
95 {EM28XX_R08_GPIO
, 0x2e, ~EM_GPIO_4
, 10},
96 {EM2880_R04_GPO
, 0x04, 0x0f, 10},
97 {EM2880_R04_GPO
, 0x0c, 0x0f, 10},
101 /* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
102 static struct em28xx_reg_seq em2880_msi_digivox_ad_analog
[] = {
103 {EM28XX_R08_GPIO
, 0x69, ~EM_GPIO_4
, 10},
107 /* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
109 /* Board - EM2870 Kworld 355u
110 Analog - No input analog */
112 /* Board - EM2882 Kworld 315U digital */
113 static struct em28xx_reg_seq em2882_kworld_315u_digital
[] = {
114 {EM28XX_R08_GPIO
, 0xff, 0xff, 10},
115 {EM28XX_R08_GPIO
, 0xfe, 0xff, 10},
116 {EM2880_R04_GPO
, 0x04, 0xff, 10},
117 {EM2880_R04_GPO
, 0x0c, 0xff, 10},
118 {EM28XX_R08_GPIO
, 0x7e, 0xff, 10},
122 static struct em28xx_reg_seq em2882_kworld_315u_tuner_gpio
[] = {
123 {EM2880_R04_GPO
, 0x08, 0xff, 10},
124 {EM2880_R04_GPO
, 0x0c, 0xff, 10},
125 {EM2880_R04_GPO
, 0x08, 0xff, 10},
126 {EM2880_R04_GPO
, 0x0c, 0xff, 10},
130 static struct em28xx_reg_seq kworld_330u_analog
[] = {
131 {EM28XX_R08_GPIO
, 0x6d, ~EM_GPIO_4
, 10},
132 {EM2880_R04_GPO
, 0x00, 0xff, 10},
136 static struct em28xx_reg_seq kworld_330u_digital
[] = {
137 {EM28XX_R08_GPIO
, 0x6e, ~EM_GPIO_4
, 10},
138 {EM2880_R04_GPO
, 0x08, 0xff, 10},
143 GPIO0 - Enable digital power (s5h1409) - low to enable
144 GPIO1 - Enable analog power (tvp5150/emp202) - low to enable
148 static struct em28xx_reg_seq evga_indtube_analog
[] = {
149 {EM28XX_R08_GPIO
, 0x79, 0xff, 60},
153 static struct em28xx_reg_seq evga_indtube_digital
[] = {
154 {EM28XX_R08_GPIO
, 0x7a, 0xff, 1},
155 {EM2880_R04_GPO
, 0x04, 0xff, 10},
156 {EM2880_R04_GPO
, 0x0c, 0xff, 1},
160 /* Pinnacle Hybrid Pro eb1a:2881 */
161 static struct em28xx_reg_seq pinnacle_hybrid_pro_analog
[] = {
162 {EM28XX_R08_GPIO
, 0xfd, ~EM_GPIO_4
, 10},
166 static struct em28xx_reg_seq pinnacle_hybrid_pro_digital
[] = {
167 {EM28XX_R08_GPIO
, 0x6e, ~EM_GPIO_4
, 10},
168 {EM2880_R04_GPO
, 0x04, 0xff, 100},/* zl10353 reset */
169 {EM2880_R04_GPO
, 0x0c, 0xff, 1},
173 /* eb1a:2868 Reddo DVB-C USB TV Box
175 Other GPIOs seems to be don't care. */
176 static struct em28xx_reg_seq reddo_dvb_c_usb_box
[] = {
177 {EM28XX_R08_GPIO
, 0xfe, 0xff, 10},
178 {EM28XX_R08_GPIO
, 0xde, 0xff, 10},
179 {EM28XX_R08_GPIO
, 0xfe, 0xff, 10},
180 {EM28XX_R08_GPIO
, 0xff, 0xff, 10},
181 {EM28XX_R08_GPIO
, 0x7f, 0xff, 10},
182 {EM28XX_R08_GPIO
, 0x6f, 0xff, 10},
183 {EM28XX_R08_GPIO
, 0xff, 0xff, 10},
187 /* Callback for the most boards */
188 static struct em28xx_reg_seq default_tuner_gpio
[] = {
189 {EM28XX_R08_GPIO
, EM_GPIO_4
, EM_GPIO_4
, 10},
190 {EM28XX_R08_GPIO
, 0, EM_GPIO_4
, 10},
191 {EM28XX_R08_GPIO
, EM_GPIO_4
, EM_GPIO_4
, 10},
196 static struct em28xx_reg_seq compro_unmute_tv_gpio
[] = {
197 {EM28XX_R08_GPIO
, 5, 7, 10},
201 static struct em28xx_reg_seq compro_unmute_svid_gpio
[] = {
202 {EM28XX_R08_GPIO
, 4, 7, 10},
206 static struct em28xx_reg_seq compro_mute_gpio
[] = {
207 {EM28XX_R08_GPIO
, 6, 7, 10},
212 static struct em28xx_reg_seq terratec_av350_mute_gpio
[] = {
213 {EM28XX_R08_GPIO
, 0xff, 0x7f, 10},
217 static struct em28xx_reg_seq terratec_av350_unmute_gpio
[] = {
218 {EM28XX_R08_GPIO
, 0xff, 0xff, 10},
222 static struct em28xx_reg_seq silvercrest_reg_seq
[] = {
223 {EM28XX_R08_GPIO
, 0xff, 0xff, 10},
224 {EM28XX_R08_GPIO
, 0x01, 0xf7, 10},
231 struct em28xx_board em28xx_boards
[] = {
232 [EM2750_BOARD_UNKNOWN
] = {
233 .name
= "EM2710/EM2750/EM2751 webcam grabber",
234 .xclk
= EM28XX_XCLK_FREQUENCY_20MHZ
,
235 .tuner_type
= TUNER_ABSENT
,
238 .type
= EM28XX_VMUX_COMPOSITE1
,
240 .amux
= EM28XX_AMUX_VIDEO
,
241 .gpio
= silvercrest_reg_seq
,
244 [EM2800_BOARD_UNKNOWN
] = {
245 .name
= "Unknown EM2800 video grabber",
247 .tda9887_conf
= TDA9887_PRESENT
,
248 .decoder
= EM28XX_SAA711X
,
249 .tuner_type
= TUNER_ABSENT
,
251 .type
= EM28XX_VMUX_COMPOSITE1
,
252 .vmux
= SAA7115_COMPOSITE0
,
253 .amux
= EM28XX_AMUX_LINE_IN
,
255 .type
= EM28XX_VMUX_SVIDEO
,
256 .vmux
= SAA7115_SVIDEO3
,
257 .amux
= EM28XX_AMUX_LINE_IN
,
260 [EM2820_BOARD_UNKNOWN
] = {
261 .name
= "Unknown EM2750/28xx video grabber",
262 .tuner_type
= TUNER_ABSENT
,
263 .is_webcam
= 1, /* To enable sensor probe */
265 [EM2750_BOARD_DLCW_130
] = {
266 /* Beijing Huaqi Information Digital Technology Co., Ltd */
267 .name
= "Huaqi DLCW-130",
268 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
269 .xclk
= EM28XX_XCLK_FREQUENCY_48MHZ
,
270 .tuner_type
= TUNER_ABSENT
,
273 .type
= EM28XX_VMUX_COMPOSITE1
,
275 .amux
= EM28XX_AMUX_VIDEO
,
278 [EM2820_BOARD_KWORLD_PVRTV2800RF
] = {
279 .name
= "Kworld PVR TV 2800 RF",
280 .tuner_type
= TUNER_TEMIC_PAL
,
281 .tda9887_conf
= TDA9887_PRESENT
,
282 .decoder
= EM28XX_SAA711X
,
284 .type
= EM28XX_VMUX_COMPOSITE1
,
285 .vmux
= SAA7115_COMPOSITE0
,
286 .amux
= EM28XX_AMUX_LINE_IN
,
288 .type
= EM28XX_VMUX_SVIDEO
,
289 .vmux
= SAA7115_SVIDEO3
,
290 .amux
= EM28XX_AMUX_LINE_IN
,
293 [EM2820_BOARD_GADMEI_TVR200
] = {
294 .name
= "Gadmei TVR200",
295 .tuner_type
= TUNER_LG_PAL_NEW_TAPC
,
296 .tda9887_conf
= TDA9887_PRESENT
,
297 .decoder
= EM28XX_SAA711X
,
299 .type
= EM28XX_VMUX_TELEVISION
,
300 .vmux
= SAA7115_COMPOSITE2
,
301 .amux
= EM28XX_AMUX_LINE_IN
,
303 .type
= EM28XX_VMUX_COMPOSITE1
,
304 .vmux
= SAA7115_COMPOSITE0
,
305 .amux
= EM28XX_AMUX_LINE_IN
,
307 .type
= EM28XX_VMUX_SVIDEO
,
308 .vmux
= SAA7115_SVIDEO3
,
309 .amux
= EM28XX_AMUX_LINE_IN
,
312 [EM2820_BOARD_TERRATEC_CINERGY_250
] = {
313 .name
= "Terratec Cinergy 250 USB",
314 .tuner_type
= TUNER_LG_PAL_NEW_TAPC
,
316 .tda9887_conf
= TDA9887_PRESENT
,
317 .decoder
= EM28XX_SAA711X
,
319 .type
= EM28XX_VMUX_TELEVISION
,
320 .vmux
= SAA7115_COMPOSITE2
,
321 .amux
= EM28XX_AMUX_LINE_IN
,
323 .type
= EM28XX_VMUX_COMPOSITE1
,
324 .vmux
= SAA7115_COMPOSITE0
,
325 .amux
= EM28XX_AMUX_LINE_IN
,
327 .type
= EM28XX_VMUX_SVIDEO
,
328 .vmux
= SAA7115_SVIDEO3
,
329 .amux
= EM28XX_AMUX_LINE_IN
,
332 [EM2820_BOARD_PINNACLE_USB_2
] = {
333 .name
= "Pinnacle PCTV USB 2",
334 .tuner_type
= TUNER_LG_PAL_NEW_TAPC
,
336 .tda9887_conf
= TDA9887_PRESENT
,
337 .decoder
= EM28XX_SAA711X
,
339 .type
= EM28XX_VMUX_TELEVISION
,
340 .vmux
= SAA7115_COMPOSITE2
,
341 .amux
= EM28XX_AMUX_VIDEO
,
343 .type
= EM28XX_VMUX_COMPOSITE1
,
344 .vmux
= SAA7115_COMPOSITE0
,
345 .amux
= EM28XX_AMUX_LINE_IN
,
347 .type
= EM28XX_VMUX_SVIDEO
,
348 .vmux
= SAA7115_SVIDEO3
,
349 .amux
= EM28XX_AMUX_LINE_IN
,
352 [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2
] = {
353 .name
= "Hauppauge WinTV USB 2",
354 .tuner_type
= TUNER_PHILIPS_FM1236_MK3
,
355 .tda9887_conf
= TDA9887_PRESENT
|
356 TDA9887_PORT1_ACTIVE
|
357 TDA9887_PORT2_ACTIVE
,
358 .decoder
= EM28XX_TVP5150
,
362 .type
= EM28XX_VMUX_TELEVISION
,
363 .vmux
= TVP5150_COMPOSITE0
,
364 .amux
= MSP_INPUT_DEFAULT
,
366 .type
= EM28XX_VMUX_SVIDEO
,
367 .vmux
= TVP5150_SVIDEO
,
368 .amux
= MSP_INPUT(MSP_IN_SCART1
, MSP_IN_TUNER1
,
369 MSP_DSP_IN_SCART
, MSP_DSP_IN_SCART
),
372 [EM2820_BOARD_DLINK_USB_TV
] = {
373 .name
= "D-Link DUB-T210 TV Tuner",
374 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
375 .tuner_type
= TUNER_LG_PAL_NEW_TAPC
,
376 .tda9887_conf
= TDA9887_PRESENT
,
377 .decoder
= EM28XX_SAA711X
,
379 .type
= EM28XX_VMUX_TELEVISION
,
380 .vmux
= SAA7115_COMPOSITE2
,
381 .amux
= EM28XX_AMUX_LINE_IN
,
383 .type
= EM28XX_VMUX_COMPOSITE1
,
384 .vmux
= SAA7115_COMPOSITE0
,
385 .amux
= EM28XX_AMUX_LINE_IN
,
387 .type
= EM28XX_VMUX_SVIDEO
,
388 .vmux
= SAA7115_SVIDEO3
,
389 .amux
= EM28XX_AMUX_LINE_IN
,
392 [EM2820_BOARD_HERCULES_SMART_TV_USB2
] = {
393 .name
= "Hercules Smart TV USB 2.0",
394 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
395 .tuner_type
= TUNER_LG_PAL_NEW_TAPC
,
396 .tda9887_conf
= TDA9887_PRESENT
,
397 .decoder
= EM28XX_SAA711X
,
399 .type
= EM28XX_VMUX_TELEVISION
,
400 .vmux
= SAA7115_COMPOSITE2
,
401 .amux
= EM28XX_AMUX_LINE_IN
,
403 .type
= EM28XX_VMUX_COMPOSITE1
,
404 .vmux
= SAA7115_COMPOSITE0
,
405 .amux
= EM28XX_AMUX_LINE_IN
,
407 .type
= EM28XX_VMUX_SVIDEO
,
408 .vmux
= SAA7115_SVIDEO3
,
409 .amux
= EM28XX_AMUX_LINE_IN
,
412 [EM2820_BOARD_PINNACLE_USB_2_FM1216ME
] = {
413 .name
= "Pinnacle PCTV USB 2 (Philips FM1216ME)",
414 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
415 .tuner_type
= TUNER_PHILIPS_FM1216ME_MK3
,
416 .tda9887_conf
= TDA9887_PRESENT
,
417 .decoder
= EM28XX_SAA711X
,
419 .type
= EM28XX_VMUX_TELEVISION
,
420 .vmux
= SAA7115_COMPOSITE2
,
421 .amux
= EM28XX_AMUX_VIDEO
,
423 .type
= EM28XX_VMUX_COMPOSITE1
,
424 .vmux
= SAA7115_COMPOSITE0
,
425 .amux
= EM28XX_AMUX_LINE_IN
,
427 .type
= EM28XX_VMUX_SVIDEO
,
428 .vmux
= SAA7115_SVIDEO3
,
429 .amux
= EM28XX_AMUX_LINE_IN
,
432 [EM2820_BOARD_GADMEI_UTV310
] = {
433 .name
= "Gadmei UTV310",
434 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
435 .tuner_type
= TUNER_TNF_5335MF
,
436 .tda9887_conf
= TDA9887_PRESENT
,
437 .decoder
= EM28XX_SAA711X
,
439 .type
= EM28XX_VMUX_TELEVISION
,
440 .vmux
= SAA7115_COMPOSITE1
,
441 .amux
= EM28XX_AMUX_LINE_IN
,
443 .type
= EM28XX_VMUX_COMPOSITE1
,
444 .vmux
= SAA7115_COMPOSITE0
,
445 .amux
= EM28XX_AMUX_LINE_IN
,
447 .type
= EM28XX_VMUX_SVIDEO
,
448 .vmux
= SAA7115_SVIDEO3
,
449 .amux
= EM28XX_AMUX_LINE_IN
,
452 [EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE
] = {
453 .name
= "Leadtek Winfast USB II Deluxe",
454 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
455 .tuner_type
= TUNER_PHILIPS_FM1216ME_MK3
,
456 .tda9887_conf
= TDA9887_PRESENT
,
457 .decoder
= EM28XX_SAA711X
,
459 .type
= EM28XX_VMUX_TELEVISION
,
460 .vmux
= SAA7115_COMPOSITE2
,
461 .amux
= EM28XX_AMUX_VIDEO
,
463 .type
= EM28XX_VMUX_COMPOSITE1
,
464 .vmux
= SAA7115_COMPOSITE0
,
465 .amux
= EM28XX_AMUX_LINE_IN
,
467 .type
= EM28XX_VMUX_SVIDEO
,
468 .vmux
= SAA7115_COMPOSITE0
,
469 .amux
= EM28XX_AMUX_LINE_IN
,
472 [EM2820_BOARD_VIDEOLOGY_20K14XUSB
] = {
473 .name
= "Videology 20K14XUSB USB2.0",
474 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
475 .tuner_type
= TUNER_ABSENT
,
478 .type
= EM28XX_VMUX_COMPOSITE1
,
480 .amux
= EM28XX_AMUX_VIDEO
,
483 [EM2820_BOARD_SILVERCREST_WEBCAM
] = {
484 .name
= "Silvercrest Webcam 1.3mpix",
485 .tuner_type
= TUNER_ABSENT
,
488 .type
= EM28XX_VMUX_COMPOSITE1
,
490 .amux
= EM28XX_AMUX_VIDEO
,
491 .gpio
= silvercrest_reg_seq
,
494 [EM2821_BOARD_SUPERCOMP_USB_2
] = {
495 .name
= "Supercomp USB 2.0 TV",
496 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
497 .tuner_type
= TUNER_PHILIPS_FM1236_MK3
,
498 .tda9887_conf
= TDA9887_PRESENT
|
499 TDA9887_PORT1_ACTIVE
|
500 TDA9887_PORT2_ACTIVE
,
501 .decoder
= EM28XX_SAA711X
,
503 .type
= EM28XX_VMUX_TELEVISION
,
504 .vmux
= SAA7115_COMPOSITE2
,
505 .amux
= EM28XX_AMUX_LINE_IN
,
507 .type
= EM28XX_VMUX_COMPOSITE1
,
508 .vmux
= SAA7115_COMPOSITE0
,
509 .amux
= EM28XX_AMUX_VIDEO
,
511 .type
= EM28XX_VMUX_SVIDEO
,
512 .vmux
= SAA7115_SVIDEO3
,
513 .amux
= EM28XX_AMUX_LINE_IN
,
516 [EM2821_BOARD_USBGEAR_VD204
] = {
517 .name
= "Usbgear VD204v9",
518 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
519 .tuner_type
= TUNER_ABSENT
, /* Capture only device */
520 .decoder
= EM28XX_SAA711X
,
522 .type
= EM28XX_VMUX_COMPOSITE1
,
523 .vmux
= SAA7115_COMPOSITE0
,
524 .amux
= EM28XX_AMUX_LINE_IN
,
526 .type
= EM28XX_VMUX_SVIDEO
,
527 .vmux
= SAA7115_SVIDEO3
,
528 .amux
= EM28XX_AMUX_LINE_IN
,
531 [EM2860_BOARD_NETGMBH_CAM
] = {
532 /* Beijing Huaqi Information Digital Technology Co., Ltd */
533 .name
= "NetGMBH Cam",
534 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
535 .tuner_type
= TUNER_ABSENT
,
538 .type
= EM28XX_VMUX_COMPOSITE1
,
540 .amux
= EM28XX_AMUX_VIDEO
,
543 [EM2860_BOARD_TYPHOON_DVD_MAKER
] = {
544 .name
= "Typhoon DVD Maker",
545 .decoder
= EM28XX_SAA711X
,
546 .tuner_type
= TUNER_ABSENT
, /* Capture only device */
548 .type
= EM28XX_VMUX_COMPOSITE1
,
549 .vmux
= SAA7115_COMPOSITE0
,
550 .amux
= EM28XX_AMUX_LINE_IN
,
552 .type
= EM28XX_VMUX_SVIDEO
,
553 .vmux
= SAA7115_SVIDEO3
,
554 .amux
= EM28XX_AMUX_LINE_IN
,
557 [EM2860_BOARD_GADMEI_UTV330
] = {
558 .name
= "Gadmei UTV330",
559 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
560 .tuner_type
= TUNER_TNF_5335MF
,
561 .tda9887_conf
= TDA9887_PRESENT
,
562 .decoder
= EM28XX_SAA711X
,
564 .type
= EM28XX_VMUX_TELEVISION
,
565 .vmux
= SAA7115_COMPOSITE2
,
566 .amux
= EM28XX_AMUX_VIDEO
,
568 .type
= EM28XX_VMUX_COMPOSITE1
,
569 .vmux
= SAA7115_COMPOSITE0
,
570 .amux
= EM28XX_AMUX_LINE_IN
,
572 .type
= EM28XX_VMUX_SVIDEO
,
573 .vmux
= SAA7115_SVIDEO3
,
574 .amux
= EM28XX_AMUX_LINE_IN
,
577 [EM2861_BOARD_GADMEI_UTV330PLUS
] = {
578 .name
= "Gadmei UTV330+",
579 .tuner_type
= TUNER_TNF_5335MF
,
580 .tda9887_conf
= TDA9887_PRESENT
,
581 .ir_codes
= &ir_codes_gadmei_rm008z_table
,
582 .decoder
= EM28XX_SAA711X
,
583 .xclk
= EM28XX_XCLK_FREQUENCY_12MHZ
,
585 .type
= EM28XX_VMUX_TELEVISION
,
586 .vmux
= SAA7115_COMPOSITE2
,
587 .amux
= EM28XX_AMUX_VIDEO
,
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_TERRATEC_HYBRID_XS
] = {
599 .name
= "Terratec Cinergy A Hybrid XS",
600 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
601 .tuner_type
= TUNER_XC2028
,
602 .tuner_gpio
= default_tuner_gpio
,
603 .decoder
= EM28XX_TVP5150
,
606 .type
= EM28XX_VMUX_TELEVISION
,
607 .vmux
= TVP5150_COMPOSITE0
,
608 .amux
= EM28XX_AMUX_VIDEO
,
609 .gpio
= hauppauge_wintv_hvr_900_analog
,
611 .type
= EM28XX_VMUX_COMPOSITE1
,
612 .vmux
= TVP5150_COMPOSITE1
,
613 .amux
= EM28XX_AMUX_LINE_IN
,
614 .gpio
= hauppauge_wintv_hvr_900_analog
,
616 .type
= EM28XX_VMUX_SVIDEO
,
617 .vmux
= TVP5150_SVIDEO
,
618 .amux
= EM28XX_AMUX_LINE_IN
,
619 .gpio
= hauppauge_wintv_hvr_900_analog
,
622 [EM2861_BOARD_KWORLD_PVRTV_300U
] = {
623 .name
= "KWorld PVRTV 300U",
624 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
625 .tuner_type
= TUNER_XC2028
,
626 .tuner_gpio
= default_tuner_gpio
,
627 .decoder
= EM28XX_TVP5150
,
629 .type
= EM28XX_VMUX_TELEVISION
,
630 .vmux
= TVP5150_COMPOSITE0
,
631 .amux
= EM28XX_AMUX_VIDEO
,
633 .type
= EM28XX_VMUX_COMPOSITE1
,
634 .vmux
= TVP5150_COMPOSITE1
,
635 .amux
= EM28XX_AMUX_LINE_IN
,
637 .type
= EM28XX_VMUX_SVIDEO
,
638 .vmux
= TVP5150_SVIDEO
,
639 .amux
= EM28XX_AMUX_LINE_IN
,
642 [EM2861_BOARD_YAKUMO_MOVIE_MIXER
] = {
643 .name
= "Yakumo MovieMixer",
644 .tuner_type
= TUNER_ABSENT
, /* Capture only device */
645 .decoder
= EM28XX_TVP5150
,
647 .type
= EM28XX_VMUX_TELEVISION
,
648 .vmux
= TVP5150_COMPOSITE0
,
649 .amux
= EM28XX_AMUX_VIDEO
,
651 .type
= EM28XX_VMUX_COMPOSITE1
,
652 .vmux
= TVP5150_COMPOSITE1
,
653 .amux
= EM28XX_AMUX_LINE_IN
,
655 .type
= EM28XX_VMUX_SVIDEO
,
656 .vmux
= TVP5150_SVIDEO
,
657 .amux
= EM28XX_AMUX_LINE_IN
,
660 [EM2861_BOARD_PLEXTOR_PX_TV100U
] = {
661 .name
= "Plextor ConvertX PX-TV100U",
662 .tuner_type
= TUNER_TNF_5335MF
,
663 .xclk
= EM28XX_XCLK_I2S_MSB_TIMING
|
664 EM28XX_XCLK_FREQUENCY_12MHZ
,
665 .tda9887_conf
= TDA9887_PRESENT
,
666 .decoder
= EM28XX_TVP5150
,
669 .type
= EM28XX_VMUX_TELEVISION
,
670 .vmux
= TVP5150_COMPOSITE0
,
671 .amux
= EM28XX_AMUX_LINE_IN
,
672 .gpio
= pinnacle_hybrid_pro_analog
,
674 .type
= EM28XX_VMUX_COMPOSITE1
,
675 .vmux
= TVP5150_COMPOSITE1
,
676 .amux
= EM28XX_AMUX_LINE_IN
,
677 .gpio
= pinnacle_hybrid_pro_analog
,
679 .type
= EM28XX_VMUX_SVIDEO
,
680 .vmux
= TVP5150_SVIDEO
,
681 .amux
= EM28XX_AMUX_LINE_IN
,
682 .gpio
= pinnacle_hybrid_pro_analog
,
686 /* Those boards with em2870 are DVB Only*/
688 [EM2870_BOARD_TERRATEC_XS
] = {
689 .name
= "Terratec Cinergy T XS",
690 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
691 .tuner_type
= TUNER_XC2028
,
692 .tuner_gpio
= default_tuner_gpio
,
694 [EM2870_BOARD_TERRATEC_XS_MT2060
] = {
695 .name
= "Terratec Cinergy T XS (MT2060)",
696 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
697 .tuner_type
= TUNER_ABSENT
, /* MT2060 */
699 [EM2870_BOARD_KWORLD_350U
] = {
700 .name
= "Kworld 350 U DVB-T",
701 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
702 .tuner_type
= TUNER_XC2028
,
703 .tuner_gpio
= default_tuner_gpio
,
705 [EM2870_BOARD_KWORLD_355U
] = {
706 .name
= "Kworld 355 U DVB-T",
707 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
709 [EM2870_BOARD_PINNACLE_PCTV_DVB
] = {
710 .name
= "Pinnacle PCTV DVB-T",
711 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
712 .tuner_type
= TUNER_ABSENT
, /* MT2060 */
713 /* djh - I have serious doubts this is right... */
714 .xclk
= EM28XX_XCLK_IR_RC5_MODE
|
715 EM28XX_XCLK_FREQUENCY_10MHZ
,
717 [EM2870_BOARD_COMPRO_VIDEOMATE
] = {
718 .name
= "Compro, VideoMate U3",
719 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
720 .tuner_type
= TUNER_ABSENT
, /* MT2060 */
723 [EM2880_BOARD_TERRATEC_HYBRID_XS_FR
] = {
724 .name
= "Terratec Hybrid XS Secam",
725 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
727 .tuner_type
= TUNER_XC2028
,
728 .tuner_gpio
= default_tuner_gpio
,
729 .decoder
= EM28XX_TVP5150
,
731 .type
= EM28XX_VMUX_TELEVISION
,
732 .vmux
= TVP5150_COMPOSITE0
,
733 .amux
= EM28XX_AMUX_VIDEO
,
734 .gpio
= default_analog
,
736 .type
= EM28XX_VMUX_COMPOSITE1
,
737 .vmux
= TVP5150_COMPOSITE1
,
738 .amux
= EM28XX_AMUX_LINE_IN
,
739 .gpio
= default_analog
,
741 .type
= EM28XX_VMUX_SVIDEO
,
742 .vmux
= TVP5150_SVIDEO
,
743 .amux
= EM28XX_AMUX_LINE_IN
,
744 .gpio
= default_analog
,
747 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900
] = {
748 .name
= "Hauppauge WinTV HVR 900",
749 .tda9887_conf
= TDA9887_PRESENT
,
750 .tuner_type
= TUNER_XC2028
,
751 .tuner_gpio
= default_tuner_gpio
,
754 .dvb_gpio
= hauppauge_wintv_hvr_900_digital
,
755 .ir_codes
= &ir_codes_hauppauge_new_table
,
756 .decoder
= EM28XX_TVP5150
,
758 .type
= EM28XX_VMUX_TELEVISION
,
759 .vmux
= TVP5150_COMPOSITE0
,
760 .amux
= EM28XX_AMUX_VIDEO
,
761 .gpio
= hauppauge_wintv_hvr_900_analog
,
763 .type
= EM28XX_VMUX_COMPOSITE1
,
764 .vmux
= TVP5150_COMPOSITE1
,
765 .amux
= EM28XX_AMUX_LINE_IN
,
766 .gpio
= hauppauge_wintv_hvr_900_analog
,
768 .type
= EM28XX_VMUX_SVIDEO
,
769 .vmux
= TVP5150_SVIDEO
,
770 .amux
= EM28XX_AMUX_LINE_IN
,
771 .gpio
= hauppauge_wintv_hvr_900_analog
,
774 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2
] = {
775 .name
= "Hauppauge WinTV HVR 900 (R2)",
776 .tda9887_conf
= TDA9887_PRESENT
,
777 .tuner_type
= TUNER_XC2028
,
778 .tuner_gpio
= default_tuner_gpio
,
780 .ir_codes
= &ir_codes_hauppauge_new_table
,
781 .decoder
= EM28XX_TVP5150
,
783 .type
= EM28XX_VMUX_TELEVISION
,
784 .vmux
= TVP5150_COMPOSITE0
,
785 .amux
= EM28XX_AMUX_VIDEO
,
786 .gpio
= hauppauge_wintv_hvr_900_analog
,
788 .type
= EM28XX_VMUX_COMPOSITE1
,
789 .vmux
= TVP5150_COMPOSITE1
,
790 .amux
= EM28XX_AMUX_LINE_IN
,
791 .gpio
= hauppauge_wintv_hvr_900_analog
,
793 .type
= EM28XX_VMUX_SVIDEO
,
794 .vmux
= TVP5150_SVIDEO
,
795 .amux
= EM28XX_AMUX_LINE_IN
,
796 .gpio
= hauppauge_wintv_hvr_900_analog
,
799 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850
] = {
800 .name
= "Hauppauge WinTV HVR 850",
801 .tuner_type
= TUNER_XC2028
,
802 .tuner_gpio
= default_tuner_gpio
,
805 .dvb_gpio
= hauppauge_wintv_hvr_900_digital
,
806 .ir_codes
= &ir_codes_hauppauge_new_table
,
807 .decoder
= EM28XX_TVP5150
,
809 .type
= EM28XX_VMUX_TELEVISION
,
810 .vmux
= TVP5150_COMPOSITE0
,
811 .amux
= EM28XX_AMUX_VIDEO
,
812 .gpio
= hauppauge_wintv_hvr_900_analog
,
814 .type
= EM28XX_VMUX_COMPOSITE1
,
815 .vmux
= TVP5150_COMPOSITE1
,
816 .amux
= EM28XX_AMUX_LINE_IN
,
817 .gpio
= hauppauge_wintv_hvr_900_analog
,
819 .type
= EM28XX_VMUX_SVIDEO
,
820 .vmux
= TVP5150_SVIDEO
,
821 .amux
= EM28XX_AMUX_LINE_IN
,
822 .gpio
= hauppauge_wintv_hvr_900_analog
,
825 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950
] = {
826 .name
= "Hauppauge WinTV HVR 950",
827 .tuner_type
= TUNER_XC2028
,
828 .tuner_gpio
= default_tuner_gpio
,
831 .dvb_gpio
= hauppauge_wintv_hvr_900_digital
,
832 .ir_codes
= &ir_codes_hauppauge_new_table
,
833 .decoder
= EM28XX_TVP5150
,
835 .type
= EM28XX_VMUX_TELEVISION
,
836 .vmux
= TVP5150_COMPOSITE0
,
837 .amux
= EM28XX_AMUX_VIDEO
,
838 .gpio
= hauppauge_wintv_hvr_900_analog
,
840 .type
= EM28XX_VMUX_COMPOSITE1
,
841 .vmux
= TVP5150_COMPOSITE1
,
842 .amux
= EM28XX_AMUX_LINE_IN
,
843 .gpio
= hauppauge_wintv_hvr_900_analog
,
845 .type
= EM28XX_VMUX_SVIDEO
,
846 .vmux
= TVP5150_SVIDEO
,
847 .amux
= EM28XX_AMUX_LINE_IN
,
848 .gpio
= hauppauge_wintv_hvr_900_analog
,
851 [EM2880_BOARD_PINNACLE_PCTV_HD_PRO
] = {
852 .name
= "Pinnacle PCTV HD Pro Stick",
853 .tuner_type
= TUNER_XC2028
,
854 .tuner_gpio
= default_tuner_gpio
,
857 .dvb_gpio
= hauppauge_wintv_hvr_900_digital
,
858 .ir_codes
= &ir_codes_pinnacle_pctv_hd_table
,
859 .decoder
= EM28XX_TVP5150
,
861 .type
= EM28XX_VMUX_TELEVISION
,
862 .vmux
= TVP5150_COMPOSITE0
,
863 .amux
= EM28XX_AMUX_VIDEO
,
864 .gpio
= hauppauge_wintv_hvr_900_analog
,
866 .type
= EM28XX_VMUX_COMPOSITE1
,
867 .vmux
= TVP5150_COMPOSITE1
,
868 .amux
= EM28XX_AMUX_LINE_IN
,
869 .gpio
= hauppauge_wintv_hvr_900_analog
,
871 .type
= EM28XX_VMUX_SVIDEO
,
872 .vmux
= TVP5150_SVIDEO
,
873 .amux
= EM28XX_AMUX_LINE_IN
,
874 .gpio
= hauppauge_wintv_hvr_900_analog
,
877 [EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600
] = {
878 .name
= "AMD ATI TV Wonder HD 600",
879 .tuner_type
= TUNER_XC2028
,
880 .tuner_gpio
= default_tuner_gpio
,
883 .dvb_gpio
= hauppauge_wintv_hvr_900_digital
,
884 .ir_codes
= &ir_codes_ati_tv_wonder_hd_600_table
,
885 .decoder
= EM28XX_TVP5150
,
887 .type
= EM28XX_VMUX_TELEVISION
,
888 .vmux
= TVP5150_COMPOSITE0
,
889 .amux
= EM28XX_AMUX_VIDEO
,
890 .gpio
= hauppauge_wintv_hvr_900_analog
,
892 .type
= EM28XX_VMUX_COMPOSITE1
,
893 .vmux
= TVP5150_COMPOSITE1
,
894 .amux
= EM28XX_AMUX_LINE_IN
,
895 .gpio
= hauppauge_wintv_hvr_900_analog
,
897 .type
= EM28XX_VMUX_SVIDEO
,
898 .vmux
= TVP5150_SVIDEO
,
899 .amux
= EM28XX_AMUX_LINE_IN
,
900 .gpio
= hauppauge_wintv_hvr_900_analog
,
903 [EM2880_BOARD_TERRATEC_HYBRID_XS
] = {
904 .name
= "Terratec Hybrid XS",
905 .tuner_type
= TUNER_XC2028
,
906 .tuner_gpio
= default_tuner_gpio
,
907 .decoder
= EM28XX_TVP5150
,
909 .dvb_gpio
= default_digital
,
910 .ir_codes
= &ir_codes_terratec_cinergy_xs_table
,
911 .xclk
= EM28XX_XCLK_FREQUENCY_12MHZ
, /* NEC IR */
913 .type
= EM28XX_VMUX_TELEVISION
,
914 .vmux
= TVP5150_COMPOSITE0
,
915 .amux
= EM28XX_AMUX_VIDEO
,
916 .gpio
= default_analog
,
918 .type
= EM28XX_VMUX_COMPOSITE1
,
919 .vmux
= TVP5150_COMPOSITE1
,
920 .amux
= EM28XX_AMUX_LINE_IN
,
921 .gpio
= default_analog
,
923 .type
= EM28XX_VMUX_SVIDEO
,
924 .vmux
= TVP5150_SVIDEO
,
925 .amux
= EM28XX_AMUX_LINE_IN
,
926 .gpio
= default_analog
,
929 /* maybe there's a reason behind it why Terratec sells the Hybrid XS
930 as Prodigy XS with a different PID, let's keep it separated for now
931 maybe we'll need it lateron */
932 [EM2880_BOARD_TERRATEC_PRODIGY_XS
] = {
933 .name
= "Terratec Prodigy XS",
934 .tuner_type
= TUNER_XC2028
,
935 .tuner_gpio
= default_tuner_gpio
,
936 .decoder
= EM28XX_TVP5150
,
938 .type
= EM28XX_VMUX_TELEVISION
,
939 .vmux
= TVP5150_COMPOSITE0
,
940 .amux
= EM28XX_AMUX_VIDEO
,
941 .gpio
= hauppauge_wintv_hvr_900_analog
,
943 .type
= EM28XX_VMUX_COMPOSITE1
,
944 .vmux
= TVP5150_COMPOSITE1
,
945 .amux
= EM28XX_AMUX_LINE_IN
,
946 .gpio
= hauppauge_wintv_hvr_900_analog
,
948 .type
= EM28XX_VMUX_SVIDEO
,
949 .vmux
= TVP5150_SVIDEO
,
950 .amux
= EM28XX_AMUX_LINE_IN
,
951 .gpio
= hauppauge_wintv_hvr_900_analog
,
954 [EM2820_BOARD_MSI_VOX_USB_2
] = {
955 .name
= "MSI VOX USB 2.0",
956 .tuner_type
= TUNER_LG_PAL_NEW_TAPC
,
957 .tda9887_conf
= TDA9887_PRESENT
|
958 TDA9887_PORT1_ACTIVE
|
959 TDA9887_PORT2_ACTIVE
,
960 .max_range_640_480
= 1,
961 .decoder
= EM28XX_SAA711X
,
963 .type
= EM28XX_VMUX_TELEVISION
,
964 .vmux
= SAA7115_COMPOSITE4
,
965 .amux
= EM28XX_AMUX_VIDEO
,
967 .type
= EM28XX_VMUX_COMPOSITE1
,
968 .vmux
= SAA7115_COMPOSITE0
,
969 .amux
= EM28XX_AMUX_LINE_IN
,
971 .type
= EM28XX_VMUX_SVIDEO
,
972 .vmux
= SAA7115_SVIDEO3
,
973 .amux
= EM28XX_AMUX_LINE_IN
,
976 [EM2800_BOARD_TERRATEC_CINERGY_200
] = {
977 .name
= "Terratec Cinergy 200 USB",
980 .tuner_type
= TUNER_LG_PAL_NEW_TAPC
,
981 .tda9887_conf
= TDA9887_PRESENT
,
982 .decoder
= EM28XX_SAA711X
,
984 .type
= EM28XX_VMUX_TELEVISION
,
985 .vmux
= SAA7115_COMPOSITE2
,
986 .amux
= EM28XX_AMUX_VIDEO
,
988 .type
= EM28XX_VMUX_COMPOSITE1
,
989 .vmux
= SAA7115_COMPOSITE0
,
990 .amux
= EM28XX_AMUX_LINE_IN
,
992 .type
= EM28XX_VMUX_SVIDEO
,
993 .vmux
= SAA7115_SVIDEO3
,
994 .amux
= EM28XX_AMUX_LINE_IN
,
997 [EM2800_BOARD_GRABBEEX_USB2800
] = {
998 .name
= "eMPIA Technology, Inc. GrabBeeX+ Video Encoder",
1000 .decoder
= EM28XX_SAA711X
,
1001 .tuner_type
= TUNER_ABSENT
, /* capture only board */
1003 .type
= EM28XX_VMUX_COMPOSITE1
,
1004 .vmux
= SAA7115_COMPOSITE0
,
1005 .amux
= EM28XX_AMUX_LINE_IN
,
1007 .type
= EM28XX_VMUX_SVIDEO
,
1008 .vmux
= SAA7115_SVIDEO3
,
1009 .amux
= EM28XX_AMUX_LINE_IN
,
1012 [EM2800_BOARD_LEADTEK_WINFAST_USBII
] = {
1013 .name
= "Leadtek Winfast USB II",
1015 .tuner_type
= TUNER_LG_PAL_NEW_TAPC
,
1016 .tda9887_conf
= TDA9887_PRESENT
,
1017 .decoder
= EM28XX_SAA711X
,
1019 .type
= EM28XX_VMUX_TELEVISION
,
1020 .vmux
= SAA7115_COMPOSITE2
,
1021 .amux
= EM28XX_AMUX_VIDEO
,
1023 .type
= EM28XX_VMUX_COMPOSITE1
,
1024 .vmux
= SAA7115_COMPOSITE0
,
1025 .amux
= EM28XX_AMUX_LINE_IN
,
1027 .type
= EM28XX_VMUX_SVIDEO
,
1028 .vmux
= SAA7115_SVIDEO3
,
1029 .amux
= EM28XX_AMUX_LINE_IN
,
1032 [EM2800_BOARD_KWORLD_USB2800
] = {
1033 .name
= "Kworld USB2800",
1035 .tuner_type
= TUNER_PHILIPS_FCV1236D
,
1036 .tda9887_conf
= TDA9887_PRESENT
,
1037 .decoder
= EM28XX_SAA711X
,
1039 .type
= EM28XX_VMUX_TELEVISION
,
1040 .vmux
= SAA7115_COMPOSITE2
,
1041 .amux
= EM28XX_AMUX_VIDEO
,
1043 .type
= EM28XX_VMUX_COMPOSITE1
,
1044 .vmux
= SAA7115_COMPOSITE0
,
1045 .amux
= EM28XX_AMUX_LINE_IN
,
1047 .type
= EM28XX_VMUX_SVIDEO
,
1048 .vmux
= SAA7115_SVIDEO3
,
1049 .amux
= EM28XX_AMUX_LINE_IN
,
1052 [EM2820_BOARD_PINNACLE_DVC_90
] = {
1053 .name
= "Pinnacle Dazzle DVC 90/100/101/107 / Kaiser Baas Video to DVD maker "
1054 "/ Kworld DVD Maker 2",
1055 .tuner_type
= TUNER_ABSENT
, /* capture only board */
1056 .decoder
= EM28XX_SAA711X
,
1058 .type
= EM28XX_VMUX_COMPOSITE1
,
1059 .vmux
= SAA7115_COMPOSITE0
,
1060 .amux
= EM28XX_AMUX_LINE_IN
,
1062 .type
= EM28XX_VMUX_SVIDEO
,
1063 .vmux
= SAA7115_SVIDEO3
,
1064 .amux
= EM28XX_AMUX_LINE_IN
,
1067 [EM2800_BOARD_VGEAR_POCKETTV
] = {
1068 .name
= "V-Gear PocketTV",
1070 .tuner_type
= TUNER_LG_PAL_NEW_TAPC
,
1071 .tda9887_conf
= TDA9887_PRESENT
,
1072 .decoder
= EM28XX_SAA711X
,
1074 .type
= EM28XX_VMUX_TELEVISION
,
1075 .vmux
= SAA7115_COMPOSITE2
,
1076 .amux
= EM28XX_AMUX_VIDEO
,
1078 .type
= EM28XX_VMUX_COMPOSITE1
,
1079 .vmux
= SAA7115_COMPOSITE0
,
1080 .amux
= EM28XX_AMUX_LINE_IN
,
1082 .type
= EM28XX_VMUX_SVIDEO
,
1083 .vmux
= SAA7115_SVIDEO3
,
1084 .amux
= EM28XX_AMUX_LINE_IN
,
1087 [EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2
] = {
1088 .name
= "Pixelview PlayTV Box 4 USB 2.0",
1089 .tda9887_conf
= TDA9887_PRESENT
,
1090 .tuner_type
= TUNER_YMEC_TVF_5533MF
,
1091 .decoder
= EM28XX_SAA711X
,
1093 .type
= EM28XX_VMUX_TELEVISION
,
1094 .vmux
= SAA7115_COMPOSITE2
,
1095 .amux
= EM28XX_AMUX_VIDEO
,
1096 .aout
= EM28XX_AOUT_MONO
| /* I2S */
1097 EM28XX_AOUT_MASTER
, /* Line out pin */
1099 .type
= EM28XX_VMUX_COMPOSITE1
,
1100 .vmux
= SAA7115_COMPOSITE0
,
1101 .amux
= EM28XX_AMUX_LINE_IN
,
1103 .type
= EM28XX_VMUX_SVIDEO
,
1104 .vmux
= SAA7115_SVIDEO3
,
1105 .amux
= EM28XX_AMUX_LINE_IN
,
1108 [EM2820_BOARD_PROLINK_PLAYTV_USB2
] = {
1109 .name
= "SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0",
1110 .has_snapshot_button
= 1,
1111 .tda9887_conf
= TDA9887_PRESENT
,
1112 .tuner_type
= TUNER_YMEC_TVF_5533MF
,
1113 .decoder
= EM28XX_SAA711X
,
1115 .type
= EM28XX_VMUX_TELEVISION
,
1116 .vmux
= SAA7115_COMPOSITE2
,
1117 .amux
= EM28XX_AMUX_VIDEO
,
1118 .aout
= EM28XX_AOUT_MONO
| /* I2S */
1119 EM28XX_AOUT_MASTER
, /* Line out pin */
1121 .type
= EM28XX_VMUX_COMPOSITE1
,
1122 .vmux
= SAA7115_COMPOSITE0
,
1123 .amux
= EM28XX_AMUX_LINE_IN
,
1125 .type
= EM28XX_VMUX_SVIDEO
,
1126 .vmux
= SAA7115_SVIDEO3
,
1127 .amux
= EM28XX_AMUX_LINE_IN
,
1130 [EM2860_BOARD_SAA711X_REFERENCE_DESIGN
] = {
1131 .name
= "EM2860/SAA711X Reference Design",
1132 .has_snapshot_button
= 1,
1133 .tuner_type
= TUNER_ABSENT
,
1134 .decoder
= EM28XX_SAA711X
,
1136 .type
= EM28XX_VMUX_SVIDEO
,
1137 .vmux
= SAA7115_SVIDEO3
,
1139 .type
= EM28XX_VMUX_COMPOSITE1
,
1140 .vmux
= SAA7115_COMPOSITE0
,
1143 [EM2880_BOARD_MSI_DIGIVOX_AD
] = {
1144 .name
= "MSI DigiVox A/D",
1145 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
1146 .tuner_type
= TUNER_XC2028
,
1147 .tuner_gpio
= default_tuner_gpio
,
1148 .decoder
= EM28XX_TVP5150
,
1150 .type
= EM28XX_VMUX_TELEVISION
,
1151 .vmux
= TVP5150_COMPOSITE0
,
1152 .amux
= EM28XX_AMUX_VIDEO
,
1153 .gpio
= em2880_msi_digivox_ad_analog
,
1155 .type
= EM28XX_VMUX_COMPOSITE1
,
1156 .vmux
= TVP5150_COMPOSITE1
,
1157 .amux
= EM28XX_AMUX_LINE_IN
,
1158 .gpio
= em2880_msi_digivox_ad_analog
,
1160 .type
= EM28XX_VMUX_SVIDEO
,
1161 .vmux
= TVP5150_SVIDEO
,
1162 .amux
= EM28XX_AMUX_LINE_IN
,
1163 .gpio
= em2880_msi_digivox_ad_analog
,
1166 [EM2880_BOARD_MSI_DIGIVOX_AD_II
] = {
1167 .name
= "MSI DigiVox A/D II",
1168 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
1169 .tuner_type
= TUNER_XC2028
,
1170 .tuner_gpio
= default_tuner_gpio
,
1171 .decoder
= EM28XX_TVP5150
,
1173 .type
= EM28XX_VMUX_TELEVISION
,
1174 .vmux
= TVP5150_COMPOSITE0
,
1175 .amux
= EM28XX_AMUX_VIDEO
,
1176 .gpio
= em2880_msi_digivox_ad_analog
,
1178 .type
= EM28XX_VMUX_COMPOSITE1
,
1179 .vmux
= TVP5150_COMPOSITE1
,
1180 .amux
= EM28XX_AMUX_LINE_IN
,
1181 .gpio
= em2880_msi_digivox_ad_analog
,
1183 .type
= EM28XX_VMUX_SVIDEO
,
1184 .vmux
= TVP5150_SVIDEO
,
1185 .amux
= EM28XX_AMUX_LINE_IN
,
1186 .gpio
= em2880_msi_digivox_ad_analog
,
1189 [EM2880_BOARD_KWORLD_DVB_305U
] = {
1190 .name
= "KWorld DVB-T 305U",
1191 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
1192 .tuner_type
= TUNER_XC2028
,
1193 .tuner_gpio
= default_tuner_gpio
,
1194 .decoder
= EM28XX_TVP5150
,
1196 .type
= EM28XX_VMUX_TELEVISION
,
1197 .vmux
= TVP5150_COMPOSITE0
,
1198 .amux
= EM28XX_AMUX_VIDEO
,
1200 .type
= EM28XX_VMUX_COMPOSITE1
,
1201 .vmux
= TVP5150_COMPOSITE1
,
1202 .amux
= EM28XX_AMUX_LINE_IN
,
1204 .type
= EM28XX_VMUX_SVIDEO
,
1205 .vmux
= TVP5150_SVIDEO
,
1206 .amux
= EM28XX_AMUX_LINE_IN
,
1209 [EM2880_BOARD_KWORLD_DVB_310U
] = {
1210 .name
= "KWorld DVB-T 310U",
1211 .tuner_type
= TUNER_XC2028
,
1212 .tuner_gpio
= default_tuner_gpio
,
1214 .dvb_gpio
= default_digital
,
1216 .decoder
= EM28XX_TVP5150
,
1218 .type
= EM28XX_VMUX_TELEVISION
,
1219 .vmux
= TVP5150_COMPOSITE0
,
1220 .amux
= EM28XX_AMUX_VIDEO
,
1221 .gpio
= default_analog
,
1223 .type
= EM28XX_VMUX_COMPOSITE1
,
1224 .vmux
= TVP5150_COMPOSITE1
,
1225 .amux
= EM28XX_AMUX_LINE_IN
,
1226 .gpio
= default_analog
,
1227 }, { /* S-video has not been tested yet */
1228 .type
= EM28XX_VMUX_SVIDEO
,
1229 .vmux
= TVP5150_SVIDEO
,
1230 .amux
= EM28XX_AMUX_LINE_IN
,
1231 .gpio
= default_analog
,
1234 [EM2882_BOARD_KWORLD_ATSC_315U
] = {
1235 .name
= "KWorld ATSC 315U HDTV TV Box",
1236 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
1237 .tuner_type
= TUNER_THOMSON_DTT761X
,
1238 .tuner_gpio
= em2882_kworld_315u_tuner_gpio
,
1239 .tda9887_conf
= TDA9887_PRESENT
,
1240 .decoder
= EM28XX_SAA711X
,
1242 .dvb_gpio
= em2882_kworld_315u_digital
,
1243 .xclk
= EM28XX_XCLK_FREQUENCY_12MHZ
,
1244 .i2c_speed
= EM28XX_I2C_CLK_WAIT_ENABLE
,
1245 /* Analog mode - still not ready */
1247 .type = EM28XX_VMUX_TELEVISION,
1248 .vmux = SAA7115_COMPOSITE2,
1249 .amux = EM28XX_AMUX_VIDEO,
1250 .gpio = em2882_kworld_315u_analog,
1251 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1253 .type = EM28XX_VMUX_COMPOSITE1,
1254 .vmux = SAA7115_COMPOSITE0,
1255 .amux = EM28XX_AMUX_LINE_IN,
1256 .gpio = em2882_kworld_315u_analog1,
1257 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1259 .type = EM28XX_VMUX_SVIDEO,
1260 .vmux = SAA7115_SVIDEO3,
1261 .amux = EM28XX_AMUX_LINE_IN,
1262 .gpio = em2882_kworld_315u_analog1,
1263 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1266 [EM2880_BOARD_EMPIRE_DUAL_TV
] = {
1267 .name
= "Empire dual TV",
1268 .tuner_type
= TUNER_XC2028
,
1269 .tuner_gpio
= default_tuner_gpio
,
1271 .dvb_gpio
= default_digital
,
1273 .decoder
= EM28XX_TVP5150
,
1275 .type
= EM28XX_VMUX_TELEVISION
,
1276 .vmux
= TVP5150_COMPOSITE0
,
1277 .amux
= EM28XX_AMUX_VIDEO
,
1278 .gpio
= default_analog
,
1280 .type
= EM28XX_VMUX_COMPOSITE1
,
1281 .vmux
= TVP5150_COMPOSITE1
,
1282 .amux
= EM28XX_AMUX_LINE_IN
,
1283 .gpio
= default_analog
,
1285 .type
= EM28XX_VMUX_SVIDEO
,
1286 .vmux
= TVP5150_SVIDEO
,
1287 .amux
= EM28XX_AMUX_LINE_IN
,
1288 .gpio
= default_analog
,
1291 [EM2881_BOARD_DNT_DA2_HYBRID
] = {
1292 .name
= "DNT DA2 Hybrid",
1293 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
1294 .tuner_type
= TUNER_XC2028
,
1295 .tuner_gpio
= default_tuner_gpio
,
1296 .decoder
= EM28XX_TVP5150
,
1298 .type
= EM28XX_VMUX_TELEVISION
,
1299 .vmux
= TVP5150_COMPOSITE0
,
1300 .amux
= EM28XX_AMUX_VIDEO
,
1301 .gpio
= default_analog
,
1303 .type
= EM28XX_VMUX_COMPOSITE1
,
1304 .vmux
= TVP5150_COMPOSITE1
,
1305 .amux
= EM28XX_AMUX_LINE_IN
,
1306 .gpio
= default_analog
,
1308 .type
= EM28XX_VMUX_SVIDEO
,
1309 .vmux
= TVP5150_SVIDEO
,
1310 .amux
= EM28XX_AMUX_LINE_IN
,
1311 .gpio
= default_analog
,
1314 [EM2881_BOARD_PINNACLE_HYBRID_PRO
] = {
1315 .name
= "Pinnacle Hybrid Pro",
1316 .tuner_type
= TUNER_XC2028
,
1317 .tuner_gpio
= default_tuner_gpio
,
1318 .decoder
= EM28XX_TVP5150
,
1320 .dvb_gpio
= pinnacle_hybrid_pro_digital
,
1322 .type
= EM28XX_VMUX_TELEVISION
,
1323 .vmux
= TVP5150_COMPOSITE0
,
1324 .amux
= EM28XX_AMUX_VIDEO
,
1325 .gpio
= pinnacle_hybrid_pro_analog
,
1327 .type
= EM28XX_VMUX_COMPOSITE1
,
1328 .vmux
= TVP5150_COMPOSITE1
,
1329 .amux
= EM28XX_AMUX_LINE_IN
,
1330 .gpio
= pinnacle_hybrid_pro_analog
,
1332 .type
= EM28XX_VMUX_SVIDEO
,
1333 .vmux
= TVP5150_SVIDEO
,
1334 .amux
= EM28XX_AMUX_LINE_IN
,
1335 .gpio
= pinnacle_hybrid_pro_analog
,
1338 [EM2882_BOARD_PINNACLE_HYBRID_PRO
] = {
1339 .name
= "Pinnacle Hybrid Pro (2)",
1340 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
1341 .tuner_type
= TUNER_XC2028
,
1342 .tuner_gpio
= default_tuner_gpio
,
1344 .decoder
= EM28XX_TVP5150
,
1346 .type
= EM28XX_VMUX_TELEVISION
,
1347 .vmux
= TVP5150_COMPOSITE0
,
1348 .amux
= EM28XX_AMUX_VIDEO
,
1349 .gpio
= hauppauge_wintv_hvr_900_analog
,
1351 .type
= EM28XX_VMUX_COMPOSITE1
,
1352 .vmux
= TVP5150_COMPOSITE1
,
1353 .amux
= EM28XX_AMUX_LINE_IN
,
1354 .gpio
= hauppauge_wintv_hvr_900_analog
,
1356 .type
= EM28XX_VMUX_SVIDEO
,
1357 .vmux
= TVP5150_SVIDEO
,
1358 .amux
= EM28XX_AMUX_LINE_IN
,
1359 .gpio
= hauppauge_wintv_hvr_900_analog
,
1362 [EM2882_BOARD_KWORLD_VS_DVBT
] = {
1363 .name
= "Kworld VS-DVB-T 323UR",
1364 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
1365 .tuner_type
= TUNER_XC2028
,
1366 .tuner_gpio
= default_tuner_gpio
,
1367 .decoder
= EM28XX_TVP5150
,
1369 .type
= EM28XX_VMUX_TELEVISION
,
1370 .vmux
= TVP5150_COMPOSITE0
,
1371 .amux
= EM28XX_AMUX_VIDEO
,
1373 .type
= EM28XX_VMUX_COMPOSITE1
,
1374 .vmux
= TVP5150_COMPOSITE1
,
1375 .amux
= EM28XX_AMUX_LINE_IN
,
1377 .type
= EM28XX_VMUX_SVIDEO
,
1378 .vmux
= TVP5150_SVIDEO
,
1379 .amux
= EM28XX_AMUX_LINE_IN
,
1382 [EM2882_BOARD_TERRATEC_HYBRID_XS
] = {
1383 .name
= "Terratec Hybrid XS (em2882)",
1384 .valid
= EM28XX_BOARD_NOT_VALIDATED
,
1385 .tuner_type
= TUNER_XC2028
,
1386 .tuner_gpio
= default_tuner_gpio
,
1387 .decoder
= EM28XX_TVP5150
,
1389 .type
= EM28XX_VMUX_TELEVISION
,
1390 .vmux
= TVP5150_COMPOSITE0
,
1391 .amux
= EM28XX_AMUX_VIDEO
,
1392 .gpio
= hauppauge_wintv_hvr_900_analog
,
1394 .type
= EM28XX_VMUX_COMPOSITE1
,
1395 .vmux
= TVP5150_COMPOSITE1
,
1396 .amux
= EM28XX_AMUX_LINE_IN
,
1397 .gpio
= hauppauge_wintv_hvr_900_analog
,
1399 .type
= EM28XX_VMUX_SVIDEO
,
1400 .vmux
= TVP5150_SVIDEO
,
1401 .amux
= EM28XX_AMUX_LINE_IN
,
1402 .gpio
= hauppauge_wintv_hvr_900_analog
,
1405 [EM2883_BOARD_KWORLD_HYBRID_330U
] = {
1406 .name
= "Kworld PlusTV HD Hybrid 330",
1407 .tuner_type
= TUNER_XC2028
,
1408 .tuner_gpio
= default_tuner_gpio
,
1409 .decoder
= EM28XX_TVP5150
,
1412 .dvb_gpio
= kworld_330u_digital
,
1413 .xclk
= EM28XX_XCLK_FREQUENCY_12MHZ
,
1414 .i2c_speed
= EM28XX_I2C_CLK_WAIT_ENABLE
|
1415 EM28XX_I2C_EEPROM_ON_BOARD
|
1416 EM28XX_I2C_EEPROM_KEY_VALID
,
1418 .type
= EM28XX_VMUX_TELEVISION
,
1419 .vmux
= TVP5150_COMPOSITE0
,
1420 .amux
= EM28XX_AMUX_VIDEO
,
1421 .gpio
= kworld_330u_analog
,
1422 .aout
= EM28XX_AOUT_PCM_IN
| EM28XX_AOUT_PCM_STEREO
,
1424 .type
= EM28XX_VMUX_COMPOSITE1
,
1425 .vmux
= TVP5150_COMPOSITE1
,
1426 .amux
= EM28XX_AMUX_LINE_IN
,
1427 .gpio
= kworld_330u_analog
,
1428 .aout
= EM28XX_AOUT_PCM_IN
| EM28XX_AOUT_PCM_STEREO
,
1430 .type
= EM28XX_VMUX_SVIDEO
,
1431 .vmux
= TVP5150_SVIDEO
,
1432 .amux
= EM28XX_AMUX_LINE_IN
,
1433 .gpio
= kworld_330u_analog
,
1436 [EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU
] = {
1437 .name
= "Compro VideoMate ForYou/Stereo",
1438 .tuner_type
= TUNER_LG_PAL_NEW_TAPC
,
1439 .tvaudio_addr
= 0xb0,
1440 .tda9887_conf
= TDA9887_PRESENT
,
1441 .decoder
= EM28XX_TVP5150
,
1442 .adecoder
= EM28XX_TVAUDIO
,
1443 .mute_gpio
= compro_mute_gpio
,
1445 .type
= EM28XX_VMUX_TELEVISION
,
1446 .vmux
= TVP5150_COMPOSITE0
,
1447 .amux
= EM28XX_AMUX_VIDEO
,
1448 .gpio
= compro_unmute_tv_gpio
,
1450 .type
= EM28XX_VMUX_SVIDEO
,
1451 .vmux
= TVP5150_SVIDEO
,
1452 .amux
= EM28XX_AMUX_LINE_IN
,
1453 .gpio
= compro_unmute_svid_gpio
,
1456 [EM2860_BOARD_KAIOMY_TVNPC_U2
] = {
1457 .name
= "Kaiomy TVnPC U2",
1459 .tuner_type
= TUNER_XC2028
,
1462 .decoder
= EM28XX_TVP5150
,
1463 .tuner_gpio
= default_tuner_gpio
,
1464 .ir_codes
= &ir_codes_kaiomy_table
,
1466 .type
= EM28XX_VMUX_TELEVISION
,
1467 .vmux
= TVP5150_COMPOSITE0
,
1468 .amux
= EM28XX_AMUX_VIDEO
,
1471 .type
= EM28XX_VMUX_COMPOSITE1
,
1472 .vmux
= TVP5150_COMPOSITE1
,
1473 .amux
= EM28XX_AMUX_LINE_IN
,
1475 .type
= EM28XX_VMUX_SVIDEO
,
1476 .vmux
= TVP5150_SVIDEO
,
1477 .amux
= EM28XX_AMUX_LINE_IN
,
1480 .type
= EM28XX_RADIO
,
1481 .amux
= EM28XX_AMUX_LINE_IN
,
1484 [EM2860_BOARD_EASYCAP
] = {
1485 .name
= "Easy Cap Capture DC-60",
1487 .tuner_type
= TUNER_ABSENT
,
1488 .decoder
= EM28XX_SAA711X
,
1490 .type
= EM28XX_VMUX_COMPOSITE1
,
1491 .vmux
= SAA7115_COMPOSITE0
,
1492 .amux
= EM28XX_AMUX_LINE_IN
,
1494 .type
= EM28XX_VMUX_SVIDEO
,
1495 .vmux
= SAA7115_SVIDEO3
,
1496 .amux
= EM28XX_AMUX_LINE_IN
,
1499 [EM2820_BOARD_IODATA_GVMVP_SZ
] = {
1500 .name
= "IO-DATA GV-MVP/SZ",
1501 .tuner_type
= TUNER_PHILIPS_FM1236_MK3
,
1502 .tuner_gpio
= default_tuner_gpio
,
1503 .tda9887_conf
= TDA9887_PRESENT
,
1504 .decoder
= EM28XX_TVP5150
,
1506 .type
= EM28XX_VMUX_TELEVISION
,
1507 .vmux
= TVP5150_COMPOSITE0
,
1508 .amux
= EM28XX_AMUX_VIDEO
,
1509 }, { /* Composite has not been tested yet */
1510 .type
= EM28XX_VMUX_COMPOSITE1
,
1511 .vmux
= TVP5150_COMPOSITE1
,
1512 .amux
= EM28XX_AMUX_VIDEO
,
1513 }, { /* S-video has not been tested yet */
1514 .type
= EM28XX_VMUX_SVIDEO
,
1515 .vmux
= TVP5150_SVIDEO
,
1516 .amux
= EM28XX_AMUX_VIDEO
,
1519 [EM2860_BOARD_TERRATEC_GRABBY
] = {
1520 .name
= "Terratec Grabby",
1522 .tuner_type
= TUNER_ABSENT
,
1523 .decoder
= EM28XX_SAA711X
,
1524 .xclk
= EM28XX_XCLK_FREQUENCY_12MHZ
,
1526 .type
= EM28XX_VMUX_COMPOSITE1
,
1527 .vmux
= SAA7115_COMPOSITE0
,
1528 .amux
= EM28XX_AMUX_VIDEO2
,
1530 .type
= EM28XX_VMUX_SVIDEO
,
1531 .vmux
= SAA7115_SVIDEO3
,
1532 .amux
= EM28XX_AMUX_VIDEO2
,
1535 [EM2860_BOARD_TERRATEC_AV350
] = {
1536 .name
= "Terratec AV350",
1538 .tuner_type
= TUNER_ABSENT
,
1539 .decoder
= EM28XX_TVP5150
,
1540 .xclk
= EM28XX_XCLK_FREQUENCY_12MHZ
,
1541 .mute_gpio
= terratec_av350_mute_gpio
,
1543 .type
= EM28XX_VMUX_COMPOSITE1
,
1544 .vmux
= TVP5150_COMPOSITE1
,
1545 .amux
= EM28XX_AUDIO_SRC_LINE
,
1546 .gpio
= terratec_av350_unmute_gpio
,
1549 .type
= EM28XX_VMUX_SVIDEO
,
1550 .vmux
= TVP5150_SVIDEO
,
1551 .amux
= EM28XX_AUDIO_SRC_LINE
,
1552 .gpio
= terratec_av350_unmute_gpio
,
1555 [EM2882_BOARD_EVGA_INDTUBE
] = {
1556 .name
= "Evga inDtube",
1557 .tuner_type
= TUNER_XC2028
,
1558 .tuner_gpio
= default_tuner_gpio
,
1559 .decoder
= EM28XX_TVP5150
,
1560 .xclk
= EM28XX_XCLK_FREQUENCY_12MHZ
, /* NEC IR */
1563 .dvb_gpio
= evga_indtube_digital
,
1564 .ir_codes
= &ir_codes_evga_indtube_table
,
1566 .type
= EM28XX_VMUX_TELEVISION
,
1567 .vmux
= TVP5150_COMPOSITE0
,
1568 .amux
= EM28XX_AMUX_VIDEO
,
1569 .gpio
= evga_indtube_analog
,
1571 .type
= EM28XX_VMUX_COMPOSITE1
,
1572 .vmux
= TVP5150_COMPOSITE1
,
1573 .amux
= EM28XX_AMUX_LINE_IN
,
1574 .gpio
= evga_indtube_analog
,
1576 .type
= EM28XX_VMUX_SVIDEO
,
1577 .vmux
= TVP5150_SVIDEO
,
1578 .amux
= EM28XX_AMUX_LINE_IN
,
1579 .gpio
= evga_indtube_analog
,
1582 /* eb1a:2868 Empia EM2870 + Philips CU1216L NIM (Philips TDA10023 +
1583 Infineon TUA6034) */
1584 [EM2870_BOARD_REDDO_DVB_C_USB_BOX
] = {
1585 .name
= "Reddo DVB-C USB TV Box",
1586 .tuner_type
= TUNER_ABSENT
,
1588 .dvb_gpio
= reddo_dvb_c_usb_box
,
1591 const unsigned int em28xx_bcount
= ARRAY_SIZE(em28xx_boards
);
1593 /* table of devices that work with this driver */
1594 struct usb_device_id em28xx_id_table
[] = {
1595 { USB_DEVICE(0xeb1a, 0x2750),
1596 .driver_info
= EM2750_BOARD_UNKNOWN
},
1597 { USB_DEVICE(0xeb1a, 0x2751),
1598 .driver_info
= EM2750_BOARD_UNKNOWN
},
1599 { USB_DEVICE(0xeb1a, 0x2800),
1600 .driver_info
= EM2800_BOARD_UNKNOWN
},
1601 { USB_DEVICE(0xeb1a, 0x2710),
1602 .driver_info
= EM2820_BOARD_UNKNOWN
},
1603 { USB_DEVICE(0xeb1a, 0x2820),
1604 .driver_info
= EM2820_BOARD_UNKNOWN
},
1605 { USB_DEVICE(0xeb1a, 0x2821),
1606 .driver_info
= EM2820_BOARD_UNKNOWN
},
1607 { USB_DEVICE(0xeb1a, 0x2860),
1608 .driver_info
= EM2820_BOARD_UNKNOWN
},
1609 { USB_DEVICE(0xeb1a, 0x2861),
1610 .driver_info
= EM2820_BOARD_UNKNOWN
},
1611 { USB_DEVICE(0xeb1a, 0x2870),
1612 .driver_info
= EM2820_BOARD_UNKNOWN
},
1613 { USB_DEVICE(0xeb1a, 0x2881),
1614 .driver_info
= EM2820_BOARD_UNKNOWN
},
1615 { USB_DEVICE(0xeb1a, 0x2883),
1616 .driver_info
= EM2820_BOARD_UNKNOWN
},
1617 { USB_DEVICE(0xeb1a, 0x2868),
1618 .driver_info
= EM2820_BOARD_UNKNOWN
},
1619 { USB_DEVICE(0xeb1a, 0xe300),
1620 .driver_info
= EM2861_BOARD_KWORLD_PVRTV_300U
},
1621 { USB_DEVICE(0xeb1a, 0xe303),
1622 .driver_info
= EM2860_BOARD_KAIOMY_TVNPC_U2
},
1623 { USB_DEVICE(0xeb1a, 0xe305),
1624 .driver_info
= EM2880_BOARD_KWORLD_DVB_305U
},
1625 { USB_DEVICE(0xeb1a, 0xe310),
1626 .driver_info
= EM2880_BOARD_MSI_DIGIVOX_AD
},
1627 { USB_DEVICE(0xeb1a, 0xa313),
1628 .driver_info
= EM2882_BOARD_KWORLD_ATSC_315U
},
1629 { USB_DEVICE(0xeb1a, 0xa316),
1630 .driver_info
= EM2883_BOARD_KWORLD_HYBRID_330U
},
1631 { USB_DEVICE(0xeb1a, 0xe320),
1632 .driver_info
= EM2880_BOARD_MSI_DIGIVOX_AD_II
},
1633 { USB_DEVICE(0xeb1a, 0xe323),
1634 .driver_info
= EM2882_BOARD_KWORLD_VS_DVBT
},
1635 { USB_DEVICE(0xeb1a, 0xe350),
1636 .driver_info
= EM2870_BOARD_KWORLD_350U
},
1637 { USB_DEVICE(0xeb1a, 0xe355),
1638 .driver_info
= EM2870_BOARD_KWORLD_355U
},
1639 { USB_DEVICE(0xeb1a, 0x2801),
1640 .driver_info
= EM2800_BOARD_GRABBEEX_USB2800
},
1641 { USB_DEVICE(0xeb1a, 0xe357),
1642 .driver_info
= EM2870_BOARD_KWORLD_355U
},
1643 { USB_DEVICE(0x1b80, 0xe302),
1644 .driver_info
= EM2820_BOARD_PINNACLE_DVC_90
}, /* Kaiser Baas Video to DVD maker */
1645 { USB_DEVICE(0x1b80, 0xe304),
1646 .driver_info
= EM2820_BOARD_PINNACLE_DVC_90
}, /* Kworld DVD Maker 2 */
1647 { USB_DEVICE(0x0ccd, 0x0036),
1648 .driver_info
= EM2820_BOARD_TERRATEC_CINERGY_250
},
1649 { USB_DEVICE(0x0ccd, 0x004c),
1650 .driver_info
= EM2880_BOARD_TERRATEC_HYBRID_XS_FR
},
1651 { USB_DEVICE(0x0ccd, 0x004f),
1652 .driver_info
= EM2860_BOARD_TERRATEC_HYBRID_XS
},
1653 { USB_DEVICE(0x0ccd, 0x005e),
1654 .driver_info
= EM2882_BOARD_TERRATEC_HYBRID_XS
},
1655 { USB_DEVICE(0x0ccd, 0x0042),
1656 .driver_info
= EM2880_BOARD_TERRATEC_HYBRID_XS
},
1657 { USB_DEVICE(0x0ccd, 0x0043),
1658 .driver_info
= EM2870_BOARD_TERRATEC_XS
},
1659 { USB_DEVICE(0x0ccd, 0x0047),
1660 .driver_info
= EM2880_BOARD_TERRATEC_PRODIGY_XS
},
1661 { USB_DEVICE(0x0ccd, 0x0084),
1662 .driver_info
= EM2860_BOARD_TERRATEC_AV350
},
1663 { USB_DEVICE(0x0ccd, 0x0096),
1664 .driver_info
= EM2860_BOARD_TERRATEC_GRABBY
},
1665 { USB_DEVICE(0x185b, 0x2870),
1666 .driver_info
= EM2870_BOARD_COMPRO_VIDEOMATE
},
1667 { USB_DEVICE(0x185b, 0x2041),
1668 .driver_info
= EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU
},
1669 { USB_DEVICE(0x2040, 0x4200),
1670 .driver_info
= EM2820_BOARD_HAUPPAUGE_WINTV_USB_2
},
1671 { USB_DEVICE(0x2040, 0x4201),
1672 .driver_info
= EM2820_BOARD_HAUPPAUGE_WINTV_USB_2
},
1673 { USB_DEVICE(0x2040, 0x6500),
1674 .driver_info
= EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900
},
1675 { USB_DEVICE(0x2040, 0x6502),
1676 .driver_info
= EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2
},
1677 { USB_DEVICE(0x2040, 0x6513), /* HCW HVR-980 */
1678 .driver_info
= EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950
},
1679 { USB_DEVICE(0x2040, 0x6517), /* HP HVR-950 */
1680 .driver_info
= EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950
},
1681 { USB_DEVICE(0x2040, 0x651b), /* RP HVR-950 */
1682 .driver_info
= EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950
},
1683 { USB_DEVICE(0x2040, 0x651f),
1684 .driver_info
= EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850
},
1685 { USB_DEVICE(0x0438, 0xb002),
1686 .driver_info
= EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600
},
1687 { USB_DEVICE(0x2001, 0xf112),
1688 .driver_info
= EM2820_BOARD_DLINK_USB_TV
},
1689 { USB_DEVICE(0x2304, 0x0207),
1690 .driver_info
= EM2820_BOARD_PINNACLE_DVC_90
},
1691 { USB_DEVICE(0x2304, 0x0208),
1692 .driver_info
= EM2820_BOARD_PINNACLE_USB_2
},
1693 { USB_DEVICE(0x2304, 0x021a),
1694 .driver_info
= EM2820_BOARD_PINNACLE_DVC_90
},
1695 { USB_DEVICE(0x2304, 0x0226),
1696 .driver_info
= EM2882_BOARD_PINNACLE_HYBRID_PRO
},
1697 { USB_DEVICE(0x2304, 0x0227),
1698 .driver_info
= EM2880_BOARD_PINNACLE_PCTV_HD_PRO
},
1699 { USB_DEVICE(0x0413, 0x6023),
1700 .driver_info
= EM2800_BOARD_LEADTEK_WINFAST_USBII
},
1701 { USB_DEVICE(0x093b, 0xa005),
1702 .driver_info
= EM2861_BOARD_PLEXTOR_PX_TV100U
},
1703 { USB_DEVICE(0x04bb, 0x0515),
1704 .driver_info
= EM2820_BOARD_IODATA_GVMVP_SZ
},
1705 { USB_DEVICE(0xeb1a, 0x50a6),
1706 .driver_info
= EM2860_BOARD_GADMEI_UTV330
},
1709 MODULE_DEVICE_TABLE(usb
, em28xx_id_table
);
1712 * EEPROM hash table for devices with generic USB IDs
1714 static struct em28xx_hash_table em28xx_eeprom_hash
[] = {
1715 /* P/N: SA 60002070465 Tuner: TVF7533-MF */
1716 {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2
, TUNER_YMEC_TVF_5533MF
},
1717 {0x72cc5a8b, EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2
, TUNER_YMEC_TVF_5533MF
},
1718 {0x966a0441, EM2880_BOARD_KWORLD_DVB_310U
, TUNER_XC2028
},
1719 {0x166a0441, EM2880_BOARD_EMPIRE_DUAL_TV
, TUNER_XC2028
},
1720 {0xcee44a99, EM2882_BOARD_EVGA_INDTUBE
, TUNER_XC2028
},
1721 {0xb8846b20, EM2881_BOARD_PINNACLE_HYBRID_PRO
, TUNER_XC2028
},
1722 {0x63f653bd, EM2870_BOARD_REDDO_DVB_C_USB_BOX
, TUNER_ABSENT
},
1725 /* I2C devicelist hash table for devices with generic USB IDs */
1726 static struct em28xx_hash_table em28xx_i2c_hash
[] = {
1727 {0xb06a32c3, EM2800_BOARD_TERRATEC_CINERGY_200
, TUNER_LG_PAL_NEW_TAPC
},
1728 {0xf51200e3, EM2800_BOARD_VGEAR_POCKETTV
, TUNER_LG_PAL_NEW_TAPC
},
1729 {0x1ba50080, EM2860_BOARD_SAA711X_REFERENCE_DESIGN
, TUNER_ABSENT
},
1730 {0xc51200e3, EM2820_BOARD_GADMEI_TVR200
, TUNER_LG_PAL_NEW_TAPC
},
1731 {0x4ba50080, EM2861_BOARD_GADMEI_UTV330PLUS
, TUNER_TNF_5335MF
},
1734 /* I2C possible address to saa7115, tvp5150, msp3400, tvaudio */
1735 static unsigned short saa711x_addrs
[] = {
1736 0x4a >> 1, 0x48 >> 1, /* SAA7111, SAA7111A and SAA7113 */
1737 0x42 >> 1, 0x40 >> 1, /* SAA7114, SAA7115 and SAA7118 */
1740 static unsigned short tvp5150_addrs
[] = {
1746 static unsigned short mt9v011_addrs
[] = {
1751 static unsigned short msp3400_addrs
[] = {
1757 int em28xx_tuner_callback(void *ptr
, int component
, int command
, int arg
)
1760 struct em28xx
*dev
= ptr
;
1762 if (dev
->tuner_type
!= TUNER_XC2028
)
1765 if (command
!= XC2028_TUNER_RESET
)
1768 rc
= em28xx_gpio_set(dev
, dev
->board
.tuner_gpio
);
1772 EXPORT_SYMBOL_GPL(em28xx_tuner_callback
);
1774 static inline void em28xx_set_model(struct em28xx
*dev
)
1776 memcpy(&dev
->board
, &em28xx_boards
[dev
->model
], sizeof(dev
->board
));
1778 /* Those are the default values for the majority of boards
1779 Use those values if not specified otherwise at boards entry
1781 if (!dev
->board
.xclk
)
1782 dev
->board
.xclk
= EM28XX_XCLK_IR_RC5_MODE
|
1783 EM28XX_XCLK_FREQUENCY_12MHZ
;
1785 if (!dev
->board
.i2c_speed
)
1786 dev
->board
.i2c_speed
= EM28XX_I2C_CLK_WAIT_ENABLE
|
1787 EM28XX_I2C_FREQ_100_KHZ
;
1791 /* FIXME: Should be replaced by a proper mt9m111 driver */
1792 static int em28xx_initialize_mt9m111(struct em28xx
*dev
)
1795 unsigned char regs
[][3] = {
1796 { 0x0d, 0x00, 0x01, }, /* reset and use defaults */
1797 { 0x0d, 0x00, 0x00, },
1798 { 0x0a, 0x00, 0x21, },
1799 { 0x21, 0x04, 0x00, }, /* full readout speed, no row/col skipping */
1802 for (i
= 0; i
< ARRAY_SIZE(regs
); i
++)
1803 i2c_master_send(&dev
->i2c_client
, ®s
[i
][0], 3);
1809 /* FIXME: Should be replaced by a proper mt9m001 driver */
1810 static int em28xx_initialize_mt9m001(struct em28xx
*dev
)
1813 unsigned char regs
[][3] = {
1814 { 0x0d, 0x00, 0x01, },
1815 { 0x0d, 0x00, 0x00, },
1816 { 0x04, 0x05, 0x00, }, /* hres = 1280 */
1817 { 0x03, 0x04, 0x00, }, /* vres = 1024 */
1818 { 0x20, 0x11, 0x00, },
1819 { 0x06, 0x00, 0x10, },
1820 { 0x2b, 0x00, 0x24, },
1821 { 0x2e, 0x00, 0x24, },
1822 { 0x35, 0x00, 0x24, },
1823 { 0x2d, 0x00, 0x20, },
1824 { 0x2c, 0x00, 0x20, },
1825 { 0x09, 0x0a, 0xd4, },
1826 { 0x35, 0x00, 0x57, },
1829 for (i
= 0; i
< ARRAY_SIZE(regs
); i
++)
1830 i2c_master_send(&dev
->i2c_client
, ®s
[i
][0], 3);
1835 /* HINT method: webcam I2C chips
1837 * This method works for webcams with Micron sensors
1839 static int em28xx_hint_sensor(struct em28xx
*dev
)
1847 /* Micron sensor detection */
1848 dev
->i2c_client
.addr
= 0xba >> 1;
1850 i2c_master_send(&dev
->i2c_client
, &cmd
, 1);
1851 rc
= i2c_master_recv(&dev
->i2c_client
, (char *)&version_be
, 2);
1855 version
= be16_to_cpu(version_be
);
1857 case 0x8232: /* mt9v011 640x480 1.3 Mpix sensor */
1858 case 0x8243: /* mt9v011 rev B 640x480 1.3 Mpix sensor */
1859 dev
->model
= EM2820_BOARD_SILVERCREST_WEBCAM
;
1860 em28xx_set_model(dev
);
1862 sensor_name
= "mt9v011";
1863 dev
->em28xx_sensor
= EM28XX_MT9V011
;
1864 dev
->sensor_xres
= 640;
1865 dev
->sensor_yres
= 480;
1867 * FIXME: mt9v011 uses I2S speed as xtal clk - at least with
1868 * the Silvercrest cam I have here for testing - for higher
1869 * resolutions, a high clock cause horizontal artifacts, so we
1870 * need to use a lower xclk frequency.
1871 * Yet, it would be possible to adjust xclk depending on the
1872 * desired resolution, since this affects directly the
1875 dev
->board
.xclk
= EM28XX_XCLK_FREQUENCY_4_3MHZ
;
1876 dev
->sensor_xtal
= 4300000;
1878 /* probably means GRGB 16 bit bayer */
1879 dev
->vinmode
= 0x0d;
1884 case 0x143a: /* MT9M111 as found in the ECS G200 */
1885 dev
->model
= EM2750_BOARD_UNKNOWN
;
1886 em28xx_set_model(dev
);
1888 sensor_name
= "mt9m111";
1889 dev
->board
.xclk
= EM28XX_XCLK_FREQUENCY_48MHZ
;
1890 dev
->em28xx_sensor
= EM28XX_MT9M111
;
1891 em28xx_initialize_mt9m111(dev
);
1892 dev
->sensor_xres
= 640;
1893 dev
->sensor_yres
= 512;
1895 dev
->vinmode
= 0x0a;
1901 dev
->model
= EM2750_BOARD_UNKNOWN
;
1902 em28xx_set_model(dev
);
1904 sensor_name
= "mt9m001";
1905 dev
->em28xx_sensor
= EM28XX_MT9M001
;
1906 em28xx_initialize_mt9m001(dev
);
1907 dev
->sensor_xres
= 1280;
1908 dev
->sensor_yres
= 1024;
1910 /* probably means BGGR 16 bit bayer */
1911 dev
->vinmode
= 0x0c;
1916 printk("Unknown Micron Sensor 0x%04x\n", version
);
1920 /* Setup webcam defaults */
1921 em28xx_pre_card_setup(dev
);
1923 em28xx_errdev("Sensor is %s, using model %s entry.\n",
1924 sensor_name
, em28xx_boards
[dev
->model
].name
);
1929 /* Since em28xx_pre_card_setup() requires a proper dev->model,
1930 * this won't work for boards with generic PCI IDs
1932 void em28xx_pre_card_setup(struct em28xx
*dev
)
1934 /* Set the initial XCLK and I2C clock values based on the board
1936 em28xx_write_reg(dev
, EM28XX_R0F_XCLK
, dev
->board
.xclk
& 0x7f);
1937 em28xx_write_reg(dev
, EM28XX_R06_I2C_CLK
, dev
->board
.i2c_speed
);
1940 /* request some modules */
1941 switch (dev
->model
) {
1942 case EM2861_BOARD_PLEXTOR_PX_TV100U
:
1943 /* Sets the msp34xx I2S speed */
1944 dev
->i2s_speed
= 2048000;
1946 case EM2861_BOARD_KWORLD_PVRTV_300U
:
1947 case EM2880_BOARD_KWORLD_DVB_305U
:
1948 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0x6d);
1950 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0x7d);
1953 case EM2870_BOARD_COMPRO_VIDEOMATE
:
1954 /* TODO: someone can do some cleanup here...
1955 not everything's needed */
1956 em28xx_write_reg(dev
, EM2880_R04_GPO
, 0x00);
1958 em28xx_write_reg(dev
, EM2880_R04_GPO
, 0x01);
1960 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xfd);
1962 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xfc);
1964 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xdc);
1966 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xfc);
1969 case EM2870_BOARD_TERRATEC_XS_MT2060
:
1970 /* this device needs some gpio writes to get the DVB-T
1972 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xfe);
1974 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xde);
1976 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xfe);
1979 case EM2870_BOARD_PINNACLE_PCTV_DVB
:
1980 /* this device needs some gpio writes to get the
1982 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xfe);
1984 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xde);
1986 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xfe);
1989 case EM2820_BOARD_GADMEI_UTV310
:
1990 case EM2820_BOARD_MSI_VOX_USB_2
:
1991 /* enables audio for that devices */
1992 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xfd);
1995 case EM2882_BOARD_KWORLD_ATSC_315U
:
1996 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xff);
1998 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xfe);
2000 em28xx_write_reg(dev
, EM2880_R04_GPO
, 0x00);
2002 em28xx_write_reg(dev
, EM2880_R04_GPO
, 0x08);
2006 case EM2860_BOARD_KAIOMY_TVNPC_U2
:
2007 em28xx_write_regs(dev
, EM28XX_R0F_XCLK
, "\x07", 1);
2008 em28xx_write_regs(dev
, EM28XX_R06_I2C_CLK
, "\x40", 1);
2009 em28xx_write_regs(dev
, 0x0d, "\x42", 1);
2010 em28xx_write_regs(dev
, 0x08, "\xfd", 1);
2012 em28xx_write_regs(dev
, 0x08, "\xff", 1);
2014 em28xx_write_regs(dev
, 0x08, "\x7f", 1);
2016 em28xx_write_regs(dev
, 0x08, "\x6b", 1);
2019 case EM2860_BOARD_EASYCAP
:
2020 em28xx_write_regs(dev
, 0x08, "\xf8", 1);
2023 case EM2820_BOARD_IODATA_GVMVP_SZ
:
2024 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xff);
2026 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xf7);
2028 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xfe);
2030 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xfd);
2035 em28xx_gpio_set(dev
, dev
->board
.tuner_gpio
);
2036 em28xx_set_mode(dev
, EM28XX_ANALOG_MODE
);
2039 em28xx_set_mode(dev
, EM28XX_SUSPEND
);
2042 static void em28xx_setup_xc3028(struct em28xx
*dev
, struct xc2028_ctrl
*ctl
)
2044 memset(ctl
, 0, sizeof(*ctl
));
2046 ctl
->fname
= XC2028_DEFAULT_FIRMWARE
;
2048 ctl
->mts
= em28xx_boards
[dev
->model
].mts_firmware
;
2050 switch (dev
->model
) {
2051 case EM2880_BOARD_EMPIRE_DUAL_TV
:
2052 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900
:
2053 ctl
->demod
= XC3028_FE_ZARLINK456
;
2055 case EM2880_BOARD_TERRATEC_HYBRID_XS
:
2056 case EM2881_BOARD_PINNACLE_HYBRID_PRO
:
2057 ctl
->demod
= XC3028_FE_ZARLINK456
;
2059 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2
:
2060 /* djh - Not sure which demod we need here */
2061 ctl
->demod
= XC3028_FE_DEFAULT
;
2063 case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600
:
2064 ctl
->demod
= XC3028_FE_DEFAULT
;
2065 ctl
->fname
= XC3028L_DEFAULT_FIRMWARE
;
2067 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850
:
2068 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950
:
2069 case EM2880_BOARD_PINNACLE_PCTV_HD_PRO
:
2070 /* FIXME: Better to specify the needed IF */
2071 ctl
->demod
= XC3028_FE_DEFAULT
;
2073 case EM2883_BOARD_KWORLD_HYBRID_330U
:
2074 ctl
->demod
= XC3028_FE_CHINA
;
2075 ctl
->fname
= XC2028_DEFAULT_FIRMWARE
;
2077 case EM2882_BOARD_EVGA_INDTUBE
:
2078 ctl
->demod
= XC3028_FE_CHINA
;
2079 ctl
->fname
= XC3028L_DEFAULT_FIRMWARE
;
2082 ctl
->demod
= XC3028_FE_OREN538
;
2086 static void em28xx_tuner_setup(struct em28xx
*dev
)
2088 struct tuner_setup tun_setup
;
2089 struct v4l2_frequency f
;
2091 if (dev
->tuner_type
== TUNER_ABSENT
)
2094 memset(&tun_setup
, 0, sizeof(tun_setup
));
2096 tun_setup
.mode_mask
= T_ANALOG_TV
| T_RADIO
;
2097 tun_setup
.tuner_callback
= em28xx_tuner_callback
;
2099 if (dev
->board
.radio
.type
) {
2100 tun_setup
.type
= dev
->board
.radio
.type
;
2101 tun_setup
.addr
= dev
->board
.radio_addr
;
2103 v4l2_device_call_all(&dev
->v4l2_dev
, 0, tuner
, s_type_addr
, &tun_setup
);
2106 if ((dev
->tuner_type
!= TUNER_ABSENT
) && (dev
->tuner_type
)) {
2107 tun_setup
.type
= dev
->tuner_type
;
2108 tun_setup
.addr
= dev
->tuner_addr
;
2110 v4l2_device_call_all(&dev
->v4l2_dev
, 0, tuner
, s_type_addr
, &tun_setup
);
2113 if (dev
->tda9887_conf
) {
2114 struct v4l2_priv_tun_config tda9887_cfg
;
2116 tda9887_cfg
.tuner
= TUNER_TDA9887
;
2117 tda9887_cfg
.priv
= &dev
->tda9887_conf
;
2119 v4l2_device_call_all(&dev
->v4l2_dev
, 0, tuner
, s_config
, &tda9887_cfg
);
2122 if (dev
->tuner_type
== TUNER_XC2028
) {
2123 struct v4l2_priv_tun_config xc2028_cfg
;
2124 struct xc2028_ctrl ctl
;
2126 memset(&xc2028_cfg
, 0, sizeof(xc2028_cfg
));
2127 memset(&ctl
, 0, sizeof(ctl
));
2129 em28xx_setup_xc3028(dev
, &ctl
);
2131 xc2028_cfg
.tuner
= TUNER_XC2028
;
2132 xc2028_cfg
.priv
= &ctl
;
2134 v4l2_device_call_all(&dev
->v4l2_dev
, 0, tuner
, s_config
, &xc2028_cfg
);
2137 /* configure tuner */
2139 f
.type
= V4L2_TUNER_ANALOG_TV
;
2140 f
.frequency
= 9076; /* just a magic number */
2141 dev
->ctl_freq
= f
.frequency
;
2142 v4l2_device_call_all(&dev
->v4l2_dev
, 0, tuner
, s_frequency
, &f
);
2145 static int em28xx_hint_board(struct em28xx
*dev
)
2149 /* HINT method: EEPROM
2151 * This method works only for boards with eeprom.
2152 * Uses a hash of all eeprom bytes. The hash should be
2153 * unique for a vendor/tuner pair.
2154 * There are a high chance that tuners for different
2155 * video standards produce different hashes.
2157 for (i
= 0; i
< ARRAY_SIZE(em28xx_eeprom_hash
); i
++) {
2158 if (dev
->hash
== em28xx_eeprom_hash
[i
].hash
) {
2159 dev
->model
= em28xx_eeprom_hash
[i
].model
;
2160 dev
->tuner_type
= em28xx_eeprom_hash
[i
].tuner
;
2162 em28xx_errdev("Your board has no unique USB ID.\n");
2163 em28xx_errdev("A hint were successfully done, "
2164 "based on eeprom hash.\n");
2165 em28xx_errdev("This method is not 100%% failproof.\n");
2166 em28xx_errdev("If the board were missdetected, "
2167 "please email this log to:\n");
2168 em28xx_errdev("\tV4L Mailing List "
2169 " <linux-media@vger.kernel.org>\n");
2170 em28xx_errdev("Board detected as %s\n",
2171 em28xx_boards
[dev
->model
].name
);
2177 /* HINT method: I2C attached devices
2179 * This method works for all boards.
2180 * Uses a hash of i2c scanned devices.
2181 * Devices with the same i2c attached chips will
2182 * be considered equal.
2183 * This method is less precise than the eeprom one.
2186 /* user did not request i2c scanning => do it now */
2188 em28xx_do_i2c_scan(dev
);
2190 for (i
= 0; i
< ARRAY_SIZE(em28xx_i2c_hash
); i
++) {
2191 if (dev
->i2c_hash
== em28xx_i2c_hash
[i
].hash
) {
2192 dev
->model
= em28xx_i2c_hash
[i
].model
;
2193 dev
->tuner_type
= em28xx_i2c_hash
[i
].tuner
;
2194 em28xx_errdev("Your board has no unique USB ID.\n");
2195 em28xx_errdev("A hint were successfully done, "
2196 "based on i2c devicelist hash.\n");
2197 em28xx_errdev("This method is not 100%% failproof.\n");
2198 em28xx_errdev("If the board were missdetected, "
2199 "please email this log to:\n");
2200 em28xx_errdev("\tV4L Mailing List "
2201 " <linux-media@vger.kernel.org>\n");
2202 em28xx_errdev("Board detected as %s\n",
2203 em28xx_boards
[dev
->model
].name
);
2209 em28xx_errdev("Your board has no unique USB ID and thus need a "
2210 "hint to be detected.\n");
2211 em28xx_errdev("You may try to use card=<n> insmod option to "
2212 "workaround that.\n");
2213 em28xx_errdev("Please send an email with this log to:\n");
2214 em28xx_errdev("\tV4L Mailing List <linux-media@vger.kernel.org>\n");
2215 em28xx_errdev("Board eeprom hash is 0x%08lx\n", dev
->hash
);
2216 em28xx_errdev("Board i2c devicelist hash is 0x%08lx\n", dev
->i2c_hash
);
2218 em28xx_errdev("Here is a list of valid choices for the card=<n>"
2219 " insmod option:\n");
2220 for (i
= 0; i
< em28xx_bcount
; i
++) {
2221 em28xx_errdev(" card=%d -> %s\n",
2222 i
, em28xx_boards
[i
].name
);
2227 /* ----------------------------------------------------------------------- */
2228 void em28xx_register_i2c_ir(struct em28xx
*dev
)
2230 const unsigned short addr_list
[] = {
2231 0x30, 0x47, I2C_CLIENT_END
2237 memset(&dev
->info
, 0, sizeof(&dev
->info
));
2238 memset(&dev
->init_data
, 0, sizeof(dev
->init_data
));
2239 strlcpy(dev
->info
.type
, "ir_video", I2C_NAME_SIZE
);
2241 /* detect & configure */
2242 switch (dev
->model
) {
2243 case EM2800_BOARD_TERRATEC_CINERGY_200
:
2244 case EM2820_BOARD_TERRATEC_CINERGY_250
:
2245 dev
->init_data
.ir_codes
= &ir_codes_em_terratec_table
;
2246 dev
->init_data
.get_key
= em28xx_get_key_terratec
;
2247 dev
->init_data
.name
= "i2c IR (EM28XX Terratec)";
2249 case EM2820_BOARD_PINNACLE_USB_2
:
2250 dev
->init_data
.ir_codes
= &ir_codes_pinnacle_grey_table
;
2251 dev
->init_data
.get_key
= em28xx_get_key_pinnacle_usb_grey
;
2252 dev
->init_data
.name
= "i2c IR (EM28XX Pinnacle PCTV)";
2254 case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2
:
2255 dev
->init_data
.ir_codes
= &ir_codes_hauppauge_new_table
;
2256 dev
->init_data
.get_key
= em28xx_get_key_em_haup
;
2257 dev
->init_data
.name
= "i2c IR (EM2840 Hauppauge)";
2261 if (dev
->init_data
.name
)
2262 dev
->info
.platform_data
= &dev
->init_data
;
2263 i2c_new_probed_device(&dev
->i2c_adap
, &dev
->info
, addr_list
);
2266 void em28xx_card_setup(struct em28xx
*dev
)
2269 * If the device can be a webcam, seek for a sensor.
2270 * If sensor is not found, then it isn't a webcam.
2272 if (dev
->board
.is_webcam
) {
2273 if (em28xx_hint_sensor(dev
) < 0)
2274 dev
->board
.is_webcam
= 0;
2276 dev
->progressive
= 1;
2278 em28xx_set_model(dev
);
2280 em28xx_info("Identified as %s (card=%d)\n",
2281 dev
->board
.name
, dev
->model
);
2283 dev
->tuner_type
= em28xx_boards
[dev
->model
].tuner_type
;
2284 if (em28xx_boards
[dev
->model
].tuner_addr
)
2285 dev
->tuner_addr
= em28xx_boards
[dev
->model
].tuner_addr
;
2287 if (em28xx_boards
[dev
->model
].tda9887_conf
)
2288 dev
->tda9887_conf
= em28xx_boards
[dev
->model
].tda9887_conf
;
2290 /* request some modules */
2291 switch (dev
->model
) {
2292 case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2
:
2293 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900
:
2294 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2
:
2295 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850
:
2296 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950
:
2299 #if defined(CONFIG_MODULES) && defined(MODULE)
2300 request_module("tveeprom");
2302 /* Call first TVeeprom */
2304 dev
->i2c_client
.addr
= 0xa0 >> 1;
2305 tveeprom_hauppauge_analog(&dev
->i2c_client
, &tv
, dev
->eedata
);
2307 dev
->tuner_type
= tv
.tuner_type
;
2309 if (tv
.audio_processor
== V4L2_IDENT_MSPX4XX
) {
2310 dev
->i2s_speed
= 2048000;
2311 dev
->board
.has_msp34xx
= 1;
2315 case EM2882_BOARD_KWORLD_ATSC_315U
:
2316 em28xx_write_reg(dev
, 0x0d, 0x42);
2318 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xfd);
2321 case EM2820_BOARD_KWORLD_PVRTV2800RF
:
2322 /* GPIO enables sound on KWORLD PVR TV 2800RF */
2323 em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xf9);
2325 case EM2820_BOARD_UNKNOWN
:
2326 case EM2800_BOARD_UNKNOWN
:
2328 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD.
2330 * This occurs because they share identical USB vendor and
2333 * What we do here is look up the EEPROM hash of the K-WORLD
2334 * and if it is found then we decide that we do not have
2335 * a DIGIVOX and reset the device to the K-WORLD instead.
2337 * This solution is only valid if they do not share eeprom
2338 * hash identities which has not been determined as yet.
2340 case EM2880_BOARD_MSI_DIGIVOX_AD
:
2341 if (!em28xx_hint_board(dev
))
2342 em28xx_set_model(dev
);
2344 /* In cases where we had to use a board hint, the call to
2345 em28xx_set_mode() in em28xx_pre_card_setup() was a no-op,
2346 so make the call now so the analog GPIOs are set properly
2347 before probing the i2c bus. */
2348 em28xx_gpio_set(dev
, dev
->board
.tuner_gpio
);
2349 em28xx_set_mode(dev
, EM28XX_ANALOG_MODE
);
2353 #if defined(CONFIG_MODULES) && defined(MODULE)
2354 if (dev
->board
.has_ir_i2c
&& !disable_ir
)
2355 request_module("ir-kbd-i2c");
2357 if (dev
->board
.has_snapshot_button
)
2358 em28xx_register_snapshot_button(dev
);
2360 if (dev
->board
.valid
== EM28XX_BOARD_NOT_VALIDATED
) {
2361 em28xx_errdev("\n\n");
2362 em28xx_errdev("The support for this board weren't "
2364 em28xx_errdev("Please send a report of having this working\n");
2365 em28xx_errdev("not to V4L mailing list (and/or to other "
2369 /* Allow override tuner type by a module parameter */
2371 dev
->tuner_type
= tuner
;
2373 /* request some modules */
2374 if (dev
->board
.has_msp34xx
)
2375 v4l2_i2c_new_subdev(&dev
->v4l2_dev
, &dev
->i2c_adap
,
2376 "msp3400", "msp3400", 0, msp3400_addrs
);
2378 if (dev
->board
.decoder
== EM28XX_SAA711X
)
2379 v4l2_i2c_new_subdev(&dev
->v4l2_dev
, &dev
->i2c_adap
,
2380 "saa7115", "saa7115_auto", 0, saa711x_addrs
);
2382 if (dev
->board
.decoder
== EM28XX_TVP5150
)
2383 v4l2_i2c_new_subdev(&dev
->v4l2_dev
, &dev
->i2c_adap
,
2384 "tvp5150", "tvp5150", 0, tvp5150_addrs
);
2386 if (dev
->em28xx_sensor
== EM28XX_MT9V011
) {
2387 struct v4l2_subdev
*sd
;
2389 sd
= v4l2_i2c_new_subdev(&dev
->v4l2_dev
,
2390 &dev
->i2c_adap
, "mt9v011", "mt9v011", 0, mt9v011_addrs
);
2391 v4l2_subdev_call(sd
, core
, s_config
, 0, &dev
->sensor_xtal
);
2395 if (dev
->board
.adecoder
== EM28XX_TVAUDIO
)
2396 v4l2_i2c_new_subdev(&dev
->v4l2_dev
, &dev
->i2c_adap
,
2397 "tvaudio", "tvaudio", dev
->board
.tvaudio_addr
, NULL
);
2399 if (dev
->board
.tuner_type
!= TUNER_ABSENT
) {
2400 int has_demod
= (dev
->tda9887_conf
& TDA9887_PRESENT
);
2402 if (dev
->board
.radio
.type
)
2403 v4l2_i2c_new_subdev(&dev
->v4l2_dev
, &dev
->i2c_adap
,
2404 "tuner", "tuner", dev
->board
.radio_addr
, NULL
);
2407 v4l2_i2c_new_subdev(&dev
->v4l2_dev
,
2408 &dev
->i2c_adap
, "tuner", "tuner",
2409 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD
));
2410 if (dev
->tuner_addr
== 0) {
2411 enum v4l2_i2c_tuner_type type
=
2412 has_demod
? ADDRS_TV_WITH_DEMOD
: ADDRS_TV
;
2413 struct v4l2_subdev
*sd
;
2415 sd
= v4l2_i2c_new_subdev(&dev
->v4l2_dev
,
2416 &dev
->i2c_adap
, "tuner", "tuner",
2417 0, v4l2_i2c_tuner_addrs(type
));
2420 dev
->tuner_addr
= v4l2_i2c_subdev_addr(sd
);
2422 v4l2_i2c_new_subdev(&dev
->v4l2_dev
, &dev
->i2c_adap
,
2423 "tuner", "tuner", dev
->tuner_addr
, NULL
);
2427 em28xx_tuner_setup(dev
);
2430 em28xx_ir_init(dev
);
2434 #if defined(CONFIG_MODULES) && defined(MODULE)
2435 static void request_module_async(struct work_struct
*work
)
2437 struct em28xx
*dev
= container_of(work
,
2438 struct em28xx
, request_module_wk
);
2440 if (dev
->has_audio_class
)
2441 request_module("snd-usb-audio");
2442 else if (dev
->has_alsa_audio
)
2443 request_module("em28xx-alsa");
2445 if (dev
->board
.has_dvb
)
2446 request_module("em28xx-dvb");
2449 static void request_modules(struct em28xx
*dev
)
2451 INIT_WORK(&dev
->request_module_wk
, request_module_async
);
2452 schedule_work(&dev
->request_module_wk
);
2455 #define request_modules(dev)
2456 #endif /* CONFIG_MODULES */
2459 * em28xx_realease_resources()
2460 * unregisters the v4l2,i2c and usb devices
2461 * called when the device gets disconected or at module unload
2463 void em28xx_release_resources(struct em28xx
*dev
)
2465 if (dev
->sbutton_input_dev
)
2466 em28xx_deregister_snapshot_button(dev
);
2469 em28xx_ir_fini(dev
);
2471 /*FIXME: I2C IR should be disconnected */
2473 em28xx_release_analog_resources(dev
);
2475 em28xx_remove_from_devlist(dev
);
2477 em28xx_i2c_unregister(dev
);
2479 v4l2_device_unregister(&dev
->v4l2_dev
);
2481 usb_put_dev(dev
->udev
);
2483 /* Mark device as unused */
2484 em28xx_devused
&= ~(1 << dev
->devno
);
2489 * allocates and inits the device structs, registers i2c bus and v4l device
2491 static int em28xx_init_dev(struct em28xx
**devhandle
, struct usb_device
*udev
,
2492 struct usb_interface
*interface
,
2495 struct em28xx
*dev
= *devhandle
;
2500 mutex_init(&dev
->ctrl_urb_lock
);
2501 spin_lock_init(&dev
->slock
);
2502 init_waitqueue_head(&dev
->open
);
2503 init_waitqueue_head(&dev
->wait_frame
);
2504 init_waitqueue_head(&dev
->wait_stream
);
2506 dev
->em28xx_write_regs
= em28xx_write_regs
;
2507 dev
->em28xx_read_reg
= em28xx_read_reg
;
2508 dev
->em28xx_read_reg_req_len
= em28xx_read_reg_req_len
;
2509 dev
->em28xx_write_regs_req
= em28xx_write_regs_req
;
2510 dev
->em28xx_read_reg_req
= em28xx_read_reg_req
;
2511 dev
->board
.is_em2800
= em28xx_boards
[dev
->model
].is_em2800
;
2513 em28xx_set_model(dev
);
2515 /* Set the default GPO/GPIO for legacy devices */
2516 dev
->reg_gpo_num
= EM2880_R04_GPO
;
2517 dev
->reg_gpio_num
= EM28XX_R08_GPIO
;
2519 dev
->wait_after_write
= 5;
2521 /* Based on the Chip ID, set the device configuration */
2522 retval
= em28xx_read_reg(dev
, EM28XX_R0A_CHIPID
);
2524 dev
->chip_id
= retval
;
2526 switch (dev
->chip_id
) {
2527 case CHIP_ID_EM2710
:
2528 em28xx_info("chip ID is em2710\n");
2530 case CHIP_ID_EM2750
:
2531 em28xx_info("chip ID is em2750\n");
2533 case CHIP_ID_EM2820
:
2534 em28xx_info("chip ID is em2820 (or em2710)\n");
2536 case CHIP_ID_EM2840
:
2537 em28xx_info("chip ID is em2840\n");
2539 case CHIP_ID_EM2860
:
2540 em28xx_info("chip ID is em2860\n");
2542 case CHIP_ID_EM2870
:
2543 em28xx_info("chip ID is em2870\n");
2544 dev
->wait_after_write
= 0;
2546 case CHIP_ID_EM2874
:
2547 em28xx_info("chip ID is em2874\n");
2548 dev
->reg_gpio_num
= EM2874_R80_GPIO
;
2549 dev
->wait_after_write
= 0;
2551 case CHIP_ID_EM2883
:
2552 em28xx_info("chip ID is em2882/em2883\n");
2553 dev
->wait_after_write
= 0;
2556 em28xx_info("em28xx chip ID = %d\n", dev
->chip_id
);
2560 /* Prepopulate cached GPO register content */
2561 retval
= em28xx_read_reg(dev
, dev
->reg_gpo_num
);
2563 dev
->reg_gpo
= retval
;
2565 em28xx_pre_card_setup(dev
);
2567 if (!dev
->board
.is_em2800
) {
2568 /* Sets I2C speed to 100 KHz */
2569 retval
= em28xx_write_reg(dev
, EM28XX_R06_I2C_CLK
, 0x40);
2571 em28xx_errdev("%s: em28xx_write_regs_req failed!"
2578 retval
= v4l2_device_register(&interface
->dev
, &dev
->v4l2_dev
);
2580 em28xx_errdev("Call to v4l2_device_register() failed!\n");
2584 /* register i2c bus */
2585 errCode
= em28xx_i2c_register(dev
);
2587 v4l2_device_unregister(&dev
->v4l2_dev
);
2588 em28xx_errdev("%s: em28xx_i2c_register - errCode [%d]!\n",
2594 * Default format, used for tvp5150 or saa711x output formats
2596 dev
->vinmode
= 0x10;
2597 dev
->vinctl
= EM28XX_VINCTRL_INTERLACED
|
2598 EM28XX_VINCTRL_CCIR656_ENABLE
;
2600 /* Do board specific init and eeprom reading */
2601 em28xx_card_setup(dev
);
2603 /* Configure audio */
2604 errCode
= em28xx_audio_setup(dev
);
2606 v4l2_device_unregister(&dev
->v4l2_dev
);
2607 em28xx_errdev("%s: Error while setting audio - errCode [%d]!\n",
2611 /* wake i2c devices */
2612 em28xx_wake_i2c(dev
);
2614 /* init video dma queues */
2615 INIT_LIST_HEAD(&dev
->vidq
.active
);
2616 INIT_LIST_HEAD(&dev
->vidq
.queued
);
2617 INIT_LIST_HEAD(&dev
->vbiq
.active
);
2618 INIT_LIST_HEAD(&dev
->vbiq
.queued
);
2621 if (dev
->board
.has_msp34xx
) {
2622 /* Send a reset to other chips via gpio */
2623 errCode
= em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xf7);
2625 em28xx_errdev("%s: em28xx_write_regs_req - "
2626 "msp34xx(1) failed! errCode [%d]\n",
2632 errCode
= em28xx_write_reg(dev
, EM28XX_R08_GPIO
, 0xff);
2634 em28xx_errdev("%s: em28xx_write_regs_req - "
2635 "msp34xx(2) failed! errCode [%d]\n",
2642 em28xx_add_into_devlist(dev
);
2644 retval
= em28xx_register_analog_devices(dev
);
2646 em28xx_release_resources(dev
);
2647 goto fail_reg_devices
;
2650 em28xx_init_extension(dev
);
2652 /* Save some power by putting tuner to sleep */
2653 v4l2_device_call_all(&dev
->v4l2_dev
, 0, tuner
, s_standby
);
2662 * em28xx_usb_probe()
2663 * checks for supported devices
2665 static int em28xx_usb_probe(struct usb_interface
*interface
,
2666 const struct usb_device_id
*id
)
2668 const struct usb_endpoint_descriptor
*endpoint
;
2669 struct usb_device
*udev
;
2670 struct usb_interface
*uif
;
2671 struct em28xx
*dev
= NULL
;
2673 int i
, nr
, ifnum
, isoc_pipe
;
2675 char descr
[255] = "";
2677 udev
= usb_get_dev(interface_to_usbdev(interface
));
2678 ifnum
= interface
->altsetting
[0].desc
.bInterfaceNumber
;
2680 /* Check to see next free device and mark as used */
2681 nr
= find_first_zero_bit(&em28xx_devused
, EM28XX_MAXBOARDS
);
2682 em28xx_devused
|= 1<<nr
;
2684 /* Don't register audio interfaces */
2685 if (interface
->altsetting
[0].desc
.bInterfaceClass
== USB_CLASS_AUDIO
) {
2686 em28xx_err(DRIVER_NAME
" audio device (%04x:%04x): "
2687 "interface %i, class %i\n",
2688 le16_to_cpu(udev
->descriptor
.idVendor
),
2689 le16_to_cpu(udev
->descriptor
.idProduct
),
2691 interface
->altsetting
[0].desc
.bInterfaceClass
);
2693 em28xx_devused
&= ~(1<<nr
);
2698 endpoint
= &interface
->cur_altsetting
->endpoint
[0].desc
;
2700 /* check if the device has the iso in endpoint at the correct place */
2701 if (usb_endpoint_xfer_isoc(endpoint
)
2703 (interface
->altsetting
[1].endpoint
[0].desc
.wMaxPacketSize
== 940)) {
2704 /* It's a newer em2874/em2875 device */
2707 int check_interface
= 1;
2709 endpoint
= &interface
->cur_altsetting
->endpoint
[1].desc
;
2710 if (!usb_endpoint_xfer_isoc(endpoint
))
2711 check_interface
= 0;
2713 if (usb_endpoint_dir_out(endpoint
))
2714 check_interface
= 0;
2716 if (!check_interface
) {
2717 em28xx_err(DRIVER_NAME
" video device (%04x:%04x): "
2718 "interface %i, class %i found.\n",
2719 le16_to_cpu(udev
->descriptor
.idVendor
),
2720 le16_to_cpu(udev
->descriptor
.idProduct
),
2722 interface
->altsetting
[0].desc
.bInterfaceClass
);
2724 em28xx_err(DRIVER_NAME
" This is an anciliary "
2725 "interface not used by the driver\n");
2727 em28xx_devused
&= ~(1<<nr
);
2733 switch (udev
->speed
) {
2737 case USB_SPEED_UNKNOWN
:
2738 case USB_SPEED_FULL
:
2741 case USB_SPEED_HIGH
:
2748 if (udev
->manufacturer
)
2749 strlcpy(descr
, udev
->manufacturer
, sizeof(descr
));
2751 if (udev
->product
) {
2753 strlcat(descr
, " ", sizeof(descr
));
2754 strlcat(descr
, udev
->product
, sizeof(descr
));
2757 strlcat(descr
, " ", sizeof(descr
));
2759 printk(DRIVER_NAME
": New device %s@ %s Mbps "
2760 "(%04x:%04x, interface %d, class %d)\n",
2763 le16_to_cpu(udev
->descriptor
.idVendor
),
2764 le16_to_cpu(udev
->descriptor
.idProduct
),
2766 interface
->altsetting
->desc
.bInterfaceNumber
);
2769 * Make sure we have 480 Mbps of bandwidth, otherwise things like
2770 * video stream wouldn't likely work, since 12 Mbps is generally
2771 * not enough even for most Digital TV streams.
2773 if (udev
->speed
!= USB_SPEED_HIGH
&& disable_usb_speed_check
== 0) {
2774 printk(DRIVER_NAME
": Device initialization failed.\n");
2775 printk(DRIVER_NAME
": Device must be connected to a high-speed"
2776 " USB 2.0 port.\n");
2777 em28xx_devused
&= ~(1<<nr
);
2782 if (nr
>= EM28XX_MAXBOARDS
) {
2783 printk(DRIVER_NAME
": Supports only %i em28xx boards.\n",
2785 em28xx_devused
&= ~(1<<nr
);
2790 /* allocate memory for our device state and initialize it */
2791 dev
= kzalloc(sizeof(*dev
), GFP_KERNEL
);
2793 em28xx_err(DRIVER_NAME
": out of memory!\n");
2794 em28xx_devused
&= ~(1<<nr
);
2799 snprintf(dev
->name
, 29, "em28xx #%d", nr
);
2801 dev
->model
= id
->driver_info
;
2804 /* Checks if audio is provided by some interface */
2805 for (i
= 0; i
< udev
->config
->desc
.bNumInterfaces
; i
++) {
2806 uif
= udev
->config
->interface
[i
];
2807 if (uif
->altsetting
[0].desc
.bInterfaceClass
== USB_CLASS_AUDIO
) {
2808 dev
->has_audio_class
= 1;
2813 /* compute alternate max packet sizes */
2814 uif
= udev
->actconfig
->interface
[0];
2816 dev
->num_alt
= uif
->num_altsetting
;
2817 dev
->alt_max_pkt_size
= kmalloc(32 * dev
->num_alt
, GFP_KERNEL
);
2819 if (dev
->alt_max_pkt_size
== NULL
) {
2820 em28xx_errdev("out of memory!\n");
2821 em28xx_devused
&= ~(1<<nr
);
2827 for (i
= 0; i
< dev
->num_alt
; i
++) {
2828 u16 tmp
= le16_to_cpu(uif
->altsetting
[i
].endpoint
[isoc_pipe
].desc
.wMaxPacketSize
);
2829 dev
->alt_max_pkt_size
[i
] =
2830 (tmp
& 0x07ff) * (((tmp
& 0x1800) >> 11) + 1);
2833 if ((card
[nr
] >= 0) && (card
[nr
] < em28xx_bcount
))
2834 dev
->model
= card
[nr
];
2836 /* allocate device struct */
2837 mutex_init(&dev
->lock
);
2838 mutex_lock(&dev
->lock
);
2839 retval
= em28xx_init_dev(&dev
, udev
, interface
, nr
);
2841 em28xx_devused
&= ~(1<<dev
->devno
);
2842 mutex_unlock(&dev
->lock
);
2847 /* save our data pointer in this interface device */
2848 usb_set_intfdata(interface
, dev
);
2850 request_modules(dev
);
2852 /* Should be the last thing to do, to avoid newer udev's to
2853 open the device before fully initializing it
2855 mutex_unlock(&dev
->lock
);
2864 * em28xx_usb_disconnect()
2865 * called when the device gets diconencted
2866 * video device will be unregistered on v4l2_close in case it is still open
2868 static void em28xx_usb_disconnect(struct usb_interface
*interface
)
2872 dev
= usb_get_intfdata(interface
);
2873 usb_set_intfdata(interface
, NULL
);
2878 em28xx_info("disconnecting %s\n", dev
->vdev
->name
);
2880 /* wait until all current v4l2 io is finished then deallocate
2882 mutex_lock(&dev
->lock
);
2884 wake_up_interruptible_all(&dev
->open
);
2886 v4l2_device_disconnect(&dev
->v4l2_dev
);
2890 ("device /dev/video%d is open! Deregistration and memory "
2891 "deallocation are deferred on close.\n",
2894 dev
->state
|= DEV_MISCONFIGURED
;
2895 em28xx_uninit_isoc(dev
);
2896 dev
->state
|= DEV_DISCONNECTED
;
2897 wake_up_interruptible(&dev
->wait_frame
);
2898 wake_up_interruptible(&dev
->wait_stream
);
2900 dev
->state
|= DEV_DISCONNECTED
;
2901 em28xx_release_resources(dev
);
2904 em28xx_close_extension(dev
);
2906 mutex_unlock(&dev
->lock
);
2909 kfree(dev
->alt_max_pkt_size
);
2914 static struct usb_driver em28xx_usb_driver
= {
2916 .probe
= em28xx_usb_probe
,
2917 .disconnect
= em28xx_usb_disconnect
,
2918 .id_table
= em28xx_id_table
,
2921 static int __init
em28xx_module_init(void)
2925 /* register this driver with the USB subsystem */
2926 result
= usb_register(&em28xx_usb_driver
);
2928 em28xx_err(DRIVER_NAME
2929 " usb_register failed. Error number %d.\n", result
);
2931 printk(KERN_INFO DRIVER_NAME
" driver loaded\n");
2936 static void __exit
em28xx_module_exit(void)
2938 /* deregister this driver with the USB subsystem */
2939 usb_deregister(&em28xx_usb_driver
);
2942 module_init(em28xx_module_init
);
2943 module_exit(em28xx_module_exit
);