Linux 3.11-rc3
[cris-mirror.git] / drivers / media / usb / em28xx / em28xx-cards.c
blobdc65742c4bbcabfddf54f8fdd9797d6bdf162a6f
1 /*
2 em28xx-cards.c - driver for Empia EM2800/EM2820/2840 USB
3 video capture devices
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>
9 Copyright (C) 2012 Frank Schäfer <fschaefer.oss@googlemail.com>
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 #include <linux/init.h>
27 #include <linux/module.h>
28 #include <linux/slab.h>
29 #include <linux/delay.h>
30 #include <linux/i2c.h>
31 #include <linux/usb.h>
32 #include <media/tuner.h>
33 #include <media/msp3400.h>
34 #include <media/saa7115.h>
35 #include <media/tvp5150.h>
36 #include <media/tvaudio.h>
37 #include <media/i2c-addr.h>
38 #include <media/tveeprom.h>
39 #include <media/v4l2-common.h>
41 #include "em28xx.h"
43 #define DRIVER_NAME "em28xx"
45 static int tuner = -1;
46 module_param(tuner, int, 0444);
47 MODULE_PARM_DESC(tuner, "tuner type");
49 static unsigned int disable_ir;
50 module_param(disable_ir, int, 0444);
51 MODULE_PARM_DESC(disable_ir, "disable infrared remote support");
53 static unsigned int disable_usb_speed_check;
54 module_param(disable_usb_speed_check, int, 0444);
55 MODULE_PARM_DESC(disable_usb_speed_check,
56 "override min bandwidth requirement of 480M bps");
58 static unsigned int card[] = {[0 ... (EM28XX_MAXBOARDS - 1)] = -1U };
59 module_param_array(card, int, NULL, 0444);
60 MODULE_PARM_DESC(card, "card type");
62 static int usb_xfer_mode = -1;
63 module_param(usb_xfer_mode, int, 0444);
64 MODULE_PARM_DESC(usb_xfer_mode,
65 "USB transfer mode for frame data (-1 = auto, 0 = prefer isoc, 1 = prefer bulk)");
68 /* Bitmask marking allocated devices from 0 to EM28XX_MAXBOARDS - 1 */
69 static unsigned long em28xx_devused;
71 struct em28xx_hash_table {
72 unsigned long hash;
73 unsigned int model;
74 unsigned int tuner;
77 static void em28xx_pre_card_setup(struct em28xx *dev);
80 * Reset sequences for analog/digital modes
83 /* Reset for the most [analog] boards */
84 static struct em28xx_reg_seq default_analog[] = {
85 {EM2820_R08_GPIO_CTRL, 0x6d, ~EM_GPIO_4, 10},
86 { -1, -1, -1, -1},
89 /* Reset for the most [digital] boards */
90 static struct em28xx_reg_seq default_digital[] = {
91 {EM2820_R08_GPIO_CTRL, 0x6e, ~EM_GPIO_4, 10},
92 { -1, -1, -1, -1},
95 /* Board Hauppauge WinTV HVR 900 analog */
96 static struct em28xx_reg_seq hauppauge_wintv_hvr_900_analog[] = {
97 {EM2820_R08_GPIO_CTRL, 0x2d, ~EM_GPIO_4, 10},
98 {0x05, 0xff, 0x10, 10},
99 { -1, -1, -1, -1},
102 /* Board Hauppauge WinTV HVR 900 digital */
103 static struct em28xx_reg_seq hauppauge_wintv_hvr_900_digital[] = {
104 {EM2820_R08_GPIO_CTRL, 0x2e, ~EM_GPIO_4, 10},
105 {EM2880_R04_GPO, 0x04, 0x0f, 10},
106 {EM2880_R04_GPO, 0x0c, 0x0f, 10},
107 { -1, -1, -1, -1},
110 /* Board Hauppauge WinTV HVR 900 (R2) digital */
111 static struct em28xx_reg_seq hauppauge_wintv_hvr_900R2_digital[] = {
112 {EM2820_R08_GPIO_CTRL, 0x2e, ~EM_GPIO_4, 10},
113 {EM2880_R04_GPO, 0x0c, 0x0f, 10},
114 { -1, -1, -1, -1},
117 /* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
118 static struct em28xx_reg_seq em2880_msi_digivox_ad_analog[] = {
119 {EM2820_R08_GPIO_CTRL, 0x69, ~EM_GPIO_4, 10},
120 { -1, -1, -1, -1},
123 /* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
125 /* Board - EM2870 Kworld 355u
126 Analog - No input analog */
128 /* Board - EM2882 Kworld 315U digital */
129 static struct em28xx_reg_seq em2882_kworld_315u_digital[] = {
130 {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10},
131 {EM2820_R08_GPIO_CTRL, 0xfe, 0xff, 10},
132 {EM2880_R04_GPO, 0x04, 0xff, 10},
133 {EM2880_R04_GPO, 0x0c, 0xff, 10},
134 {EM2820_R08_GPIO_CTRL, 0x7e, 0xff, 10},
135 { -1, -1, -1, -1},
138 static struct em28xx_reg_seq em2882_kworld_315u_tuner_gpio[] = {
139 {EM2880_R04_GPO, 0x08, 0xff, 10},
140 {EM2880_R04_GPO, 0x0c, 0xff, 10},
141 {EM2880_R04_GPO, 0x08, 0xff, 10},
142 {EM2880_R04_GPO, 0x0c, 0xff, 10},
143 { -1, -1, -1, -1},
146 static struct em28xx_reg_seq kworld_330u_analog[] = {
147 {EM2820_R08_GPIO_CTRL, 0x6d, ~EM_GPIO_4, 10},
148 {EM2880_R04_GPO, 0x00, 0xff, 10},
149 { -1, -1, -1, -1},
152 static struct em28xx_reg_seq kworld_330u_digital[] = {
153 {EM2820_R08_GPIO_CTRL, 0x6e, ~EM_GPIO_4, 10},
154 {EM2880_R04_GPO, 0x08, 0xff, 10},
155 { -1, -1, -1, -1},
158 /* Evga inDtube
159 GPIO0 - Enable digital power (s5h1409) - low to enable
160 GPIO1 - Enable analog power (tvp5150/emp202) - low to enable
161 GPIO4 - xc3028 reset
162 GOP3 - s5h1409 reset
164 static struct em28xx_reg_seq evga_indtube_analog[] = {
165 {EM2820_R08_GPIO_CTRL, 0x79, 0xff, 60},
166 { -1, -1, -1, -1},
169 static struct em28xx_reg_seq evga_indtube_digital[] = {
170 {EM2820_R08_GPIO_CTRL, 0x7a, 0xff, 1},
171 {EM2880_R04_GPO, 0x04, 0xff, 10},
172 {EM2880_R04_GPO, 0x0c, 0xff, 1},
173 { -1, -1, -1, -1},
177 * KWorld PlusTV 340U and UB435-Q (ATSC) GPIOs map:
178 * EM_GPIO_0 - currently unknown
179 * EM_GPIO_1 - LED disable/enable (1 = off, 0 = on)
180 * EM_GPIO_2 - currently unknown
181 * EM_GPIO_3 - currently unknown
182 * EM_GPIO_4 - TDA18271HD/C1 tuner (1 = active, 0 = in reset)
183 * EM_GPIO_5 - LGDT3304 ATSC/QAM demod (1 = active, 0 = in reset)
184 * EM_GPIO_6 - currently unknown
185 * EM_GPIO_7 - currently unknown
187 static struct em28xx_reg_seq kworld_a340_digital[] = {
188 {EM2820_R08_GPIO_CTRL, 0x6d, ~EM_GPIO_4, 10},
189 { -1, -1, -1, -1},
192 /* Pinnacle Hybrid Pro eb1a:2881 */
193 static struct em28xx_reg_seq pinnacle_hybrid_pro_analog[] = {
194 {EM2820_R08_GPIO_CTRL, 0xfd, ~EM_GPIO_4, 10},
195 { -1, -1, -1, -1},
198 static struct em28xx_reg_seq pinnacle_hybrid_pro_digital[] = {
199 {EM2820_R08_GPIO_CTRL, 0x6e, ~EM_GPIO_4, 10},
200 {EM2880_R04_GPO, 0x04, 0xff, 100},/* zl10353 reset */
201 {EM2880_R04_GPO, 0x0c, 0xff, 1},
202 { -1, -1, -1, -1},
205 static struct em28xx_reg_seq terratec_cinergy_USB_XS_FR_analog[] = {
206 {EM2820_R08_GPIO_CTRL, 0x6d, ~EM_GPIO_4, 10},
207 {EM2880_R04_GPO, 0x00, 0xff, 10},
208 { -1, -1, -1, -1},
211 static struct em28xx_reg_seq terratec_cinergy_USB_XS_FR_digital[] = {
212 {EM2820_R08_GPIO_CTRL, 0x6e, ~EM_GPIO_4, 10},
213 {EM2880_R04_GPO, 0x08, 0xff, 10},
214 { -1, -1, -1, -1},
217 /* eb1a:2868 Reddo DVB-C USB TV Box
218 GPIO4 - CU1216L NIM
219 Other GPIOs seems to be don't care. */
220 static struct em28xx_reg_seq reddo_dvb_c_usb_box[] = {
221 {EM2820_R08_GPIO_CTRL, 0xfe, 0xff, 10},
222 {EM2820_R08_GPIO_CTRL, 0xde, 0xff, 10},
223 {EM2820_R08_GPIO_CTRL, 0xfe, 0xff, 10},
224 {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10},
225 {EM2820_R08_GPIO_CTRL, 0x7f, 0xff, 10},
226 {EM2820_R08_GPIO_CTRL, 0x6f, 0xff, 10},
227 {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10},
228 {-1, -1, -1, -1},
231 /* Callback for the most boards */
232 static struct em28xx_reg_seq default_tuner_gpio[] = {
233 {EM2820_R08_GPIO_CTRL, EM_GPIO_4, EM_GPIO_4, 10},
234 {EM2820_R08_GPIO_CTRL, 0, EM_GPIO_4, 10},
235 {EM2820_R08_GPIO_CTRL, EM_GPIO_4, EM_GPIO_4, 10},
236 { -1, -1, -1, -1},
239 /* Mute/unmute */
240 static struct em28xx_reg_seq compro_unmute_tv_gpio[] = {
241 {EM2820_R08_GPIO_CTRL, 5, 7, 10},
242 { -1, -1, -1, -1},
245 static struct em28xx_reg_seq compro_unmute_svid_gpio[] = {
246 {EM2820_R08_GPIO_CTRL, 4, 7, 10},
247 { -1, -1, -1, -1},
250 static struct em28xx_reg_seq compro_mute_gpio[] = {
251 {EM2820_R08_GPIO_CTRL, 6, 7, 10},
252 { -1, -1, -1, -1},
255 /* Terratec AV350 */
256 static struct em28xx_reg_seq terratec_av350_mute_gpio[] = {
257 {EM2820_R08_GPIO_CTRL, 0xff, 0x7f, 10},
258 { -1, -1, -1, -1},
261 static struct em28xx_reg_seq terratec_av350_unmute_gpio[] = {
262 {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10},
263 { -1, -1, -1, -1},
266 static struct em28xx_reg_seq silvercrest_reg_seq[] = {
267 {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10},
268 {EM2820_R08_GPIO_CTRL, 0x01, 0xf7, 10},
269 { -1, -1, -1, -1},
272 static struct em28xx_reg_seq vc211a_enable[] = {
273 {EM2820_R08_GPIO_CTRL, 0xff, 0x07, 10},
274 {EM2820_R08_GPIO_CTRL, 0xff, 0x0f, 10},
275 {EM2820_R08_GPIO_CTRL, 0xff, 0x0b, 10},
276 { -1, -1, -1, -1},
279 static struct em28xx_reg_seq dikom_dk300_digital[] = {
280 {EM2820_R08_GPIO_CTRL, 0x6e, ~EM_GPIO_4, 10},
281 {EM2880_R04_GPO, 0x08, 0xff, 10},
282 { -1, -1, -1, -1},
286 /* Reset for the most [digital] boards */
287 static struct em28xx_reg_seq leadership_digital[] = {
288 {EM2874_R80_GPIO_P0_CTRL, 0x70, 0xff, 10},
289 { -1, -1, -1, -1},
292 static struct em28xx_reg_seq leadership_reset[] = {
293 {EM2874_R80_GPIO_P0_CTRL, 0xf0, 0xff, 10},
294 {EM2874_R80_GPIO_P0_CTRL, 0xb0, 0xff, 10},
295 {EM2874_R80_GPIO_P0_CTRL, 0xf0, 0xff, 10},
296 { -1, -1, -1, -1},
299 /* 2013:024f PCTV nanoStick T2 290e
300 * GPIO_6 - demod reset
301 * GPIO_7 - LED
303 static struct em28xx_reg_seq pctv_290e[] = {
304 {EM2874_R80_GPIO_P0_CTRL, 0x00, 0xff, 80},
305 {EM2874_R80_GPIO_P0_CTRL, 0x40, 0xff, 80}, /* GPIO_6 = 1 */
306 {EM2874_R80_GPIO_P0_CTRL, 0xc0, 0xff, 80}, /* GPIO_7 = 1 */
307 {-1, -1, -1, -1},
310 #if 0
311 static struct em28xx_reg_seq terratec_h5_gpio[] = {
312 {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10},
313 {EM2874_R80_GPIO_P0_CTRL, 0xf6, 0xff, 100},
314 {EM2874_R80_GPIO_P0_CTRL, 0xf2, 0xff, 50},
315 {EM2874_R80_GPIO_P0_CTRL, 0xf6, 0xff, 50},
316 { -1, -1, -1, -1},
319 static struct em28xx_reg_seq terratec_h5_digital[] = {
320 {EM2874_R80_GPIO_P0_CTRL, 0xf6, 0xff, 10},
321 {EM2874_R80_GPIO_P0_CTRL, 0xe6, 0xff, 100},
322 {EM2874_R80_GPIO_P0_CTRL, 0xa6, 0xff, 10},
323 { -1, -1, -1, -1},
325 #endif
327 /* 2013:024f PCTV DVB-S2 Stick 460e
328 * GPIO_0 - POWER_ON
329 * GPIO_1 - BOOST
330 * GPIO_2 - VUV_LNB (red LED)
331 * GPIO_3 - EXT_12V
332 * GPIO_4 - INT_DEM (DEMOD GPIO_0)
333 * GPIO_5 - INT_LNB
334 * GPIO_6 - RESET_DEM
335 * GPIO_7 - LED (green LED)
337 static struct em28xx_reg_seq pctv_460e[] = {
338 {EM2874_R80_GPIO_P0_CTRL, 0x01, 0xff, 50},
339 {0x0d, 0xff, 0xff, 50},
340 {EM2874_R80_GPIO_P0_CTRL, 0x41, 0xff, 50}, /* GPIO_6=1 */
341 {0x0d, 0x42, 0xff, 50},
342 {EM2874_R80_GPIO_P0_CTRL, 0x61, 0xff, 50}, /* GPIO_5=1 */
343 { -1, -1, -1, -1},
346 static struct em28xx_reg_seq c3tech_digital_duo_digital[] = {
347 {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xff, 10},
348 {EM2874_R80_GPIO_P0_CTRL, 0xfd, 0xff, 10}, /* xc5000 reset */
349 {EM2874_R80_GPIO_P0_CTRL, 0xf9, 0xff, 35},
350 {EM2874_R80_GPIO_P0_CTRL, 0xfd, 0xff, 10},
351 {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xff, 10},
352 {EM2874_R80_GPIO_P0_CTRL, 0xfe, 0xff, 10},
353 {EM2874_R80_GPIO_P0_CTRL, 0xbe, 0xff, 10},
354 {EM2874_R80_GPIO_P0_CTRL, 0xfe, 0xff, 20},
355 { -1, -1, -1, -1},
358 #if 0
359 static struct em28xx_reg_seq hauppauge_930c_gpio[] = {
360 {EM2874_R80_GPIO_P0_CTRL, 0x6f, 0xff, 10},
361 {EM2874_R80_GPIO_P0_CTRL, 0x4f, 0xff, 10}, /* xc5000 reset */
362 {EM2874_R80_GPIO_P0_CTRL, 0x6f, 0xff, 10},
363 {EM2874_R80_GPIO_P0_CTRL, 0x4f, 0xff, 10},
364 { -1, -1, -1, -1},
367 static struct em28xx_reg_seq hauppauge_930c_digital[] = {
368 {EM2874_R80_GPIO_P0_CTRL, 0xf6, 0xff, 10},
369 {EM2874_R80_GPIO_P0_CTRL, 0xe6, 0xff, 100},
370 {EM2874_R80_GPIO_P0_CTRL, 0xa6, 0xff, 10},
371 { -1, -1, -1, -1},
373 #endif
375 /* 1b80:e425 MaxMedia UB425-TC
376 * 1b80:e1cc Delock 61959
377 * GPIO_6 - demod reset, 0=active
378 * GPIO_7 - LED, 0=active
380 static struct em28xx_reg_seq maxmedia_ub425_tc[] = {
381 {EM2874_R80_GPIO_P0_CTRL, 0x83, 0xff, 100},
382 {EM2874_R80_GPIO_P0_CTRL, 0xc3, 0xff, 100}, /* GPIO_6 = 1 */
383 {EM2874_R80_GPIO_P0_CTRL, 0x43, 0xff, 000}, /* GPIO_7 = 0 */
384 {-1, -1, -1, -1},
387 /* 2304:0242 PCTV QuatroStick (510e)
388 * GPIO_2: decoder reset, 0=active
389 * GPIO_4: decoder suspend, 0=active
390 * GPIO_6: demod reset, 0=active
391 * GPIO_7: LED, 1=active
393 static struct em28xx_reg_seq pctv_510e[] = {
394 {EM2874_R80_GPIO_P0_CTRL, 0x10, 0xff, 100},
395 {EM2874_R80_GPIO_P0_CTRL, 0x14, 0xff, 100}, /* GPIO_2 = 1 */
396 {EM2874_R80_GPIO_P0_CTRL, 0x54, 0xff, 050}, /* GPIO_6 = 1 */
397 { -1, -1, -1, -1},
400 /* 2013:0251 PCTV QuatroStick nano (520e)
401 * GPIO_2: decoder reset, 0=active
402 * GPIO_4: decoder suspend, 0=active
403 * GPIO_6: demod reset, 0=active
404 * GPIO_7: LED, 1=active
406 static struct em28xx_reg_seq pctv_520e[] = {
407 {EM2874_R80_GPIO_P0_CTRL, 0x10, 0xff, 100},
408 {EM2874_R80_GPIO_P0_CTRL, 0x14, 0xff, 100}, /* GPIO_2 = 1 */
409 {EM2874_R80_GPIO_P0_CTRL, 0x54, 0xff, 050}, /* GPIO_6 = 1 */
410 {EM2874_R80_GPIO_P0_CTRL, 0xd4, 0xff, 000}, /* GPIO_7 = 1 */
411 { -1, -1, -1, -1},
415 * Board definitions
417 struct em28xx_board em28xx_boards[] = {
418 [EM2750_BOARD_UNKNOWN] = {
419 .name = "EM2710/EM2750/EM2751 webcam grabber",
420 .xclk = EM28XX_XCLK_FREQUENCY_20MHZ,
421 .tuner_type = TUNER_ABSENT,
422 .is_webcam = 1,
423 .input = { {
424 .type = EM28XX_VMUX_COMPOSITE1,
425 .vmux = 0,
426 .amux = EM28XX_AMUX_VIDEO,
427 .gpio = silvercrest_reg_seq,
428 } },
430 [EM2800_BOARD_UNKNOWN] = {
431 .name = "Unknown EM2800 video grabber",
432 .is_em2800 = 1,
433 .tda9887_conf = TDA9887_PRESENT,
434 .decoder = EM28XX_SAA711X,
435 .tuner_type = TUNER_ABSENT,
436 .input = { {
437 .type = EM28XX_VMUX_COMPOSITE1,
438 .vmux = SAA7115_COMPOSITE0,
439 .amux = EM28XX_AMUX_LINE_IN,
440 }, {
441 .type = EM28XX_VMUX_SVIDEO,
442 .vmux = SAA7115_SVIDEO3,
443 .amux = EM28XX_AMUX_LINE_IN,
444 } },
446 [EM2820_BOARD_UNKNOWN] = {
447 .name = "Unknown EM2750/28xx video grabber",
448 .tuner_type = TUNER_ABSENT,
449 .is_webcam = 1, /* To enable sensor probe */
451 [EM2750_BOARD_DLCW_130] = {
452 /* Beijing Huaqi Information Digital Technology Co., Ltd */
453 .name = "Huaqi DLCW-130",
454 .valid = EM28XX_BOARD_NOT_VALIDATED,
455 .xclk = EM28XX_XCLK_FREQUENCY_48MHZ,
456 .tuner_type = TUNER_ABSENT,
457 .is_webcam = 1,
458 .input = { {
459 .type = EM28XX_VMUX_COMPOSITE1,
460 .vmux = 0,
461 .amux = EM28XX_AMUX_VIDEO,
462 } },
464 [EM2820_BOARD_KWORLD_PVRTV2800RF] = {
465 .name = "Kworld PVR TV 2800 RF",
466 .tuner_type = TUNER_TEMIC_PAL,
467 .tda9887_conf = TDA9887_PRESENT,
468 .decoder = EM28XX_SAA711X,
469 .input = { {
470 .type = EM28XX_VMUX_COMPOSITE1,
471 .vmux = SAA7115_COMPOSITE0,
472 .amux = EM28XX_AMUX_LINE_IN,
473 }, {
474 .type = EM28XX_VMUX_SVIDEO,
475 .vmux = SAA7115_SVIDEO3,
476 .amux = EM28XX_AMUX_LINE_IN,
477 } },
479 [EM2820_BOARD_GADMEI_TVR200] = {
480 .name = "Gadmei TVR200",
481 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
482 .tda9887_conf = TDA9887_PRESENT,
483 .decoder = EM28XX_SAA711X,
484 .input = { {
485 .type = EM28XX_VMUX_TELEVISION,
486 .vmux = SAA7115_COMPOSITE2,
487 .amux = EM28XX_AMUX_LINE_IN,
488 }, {
489 .type = EM28XX_VMUX_COMPOSITE1,
490 .vmux = SAA7115_COMPOSITE0,
491 .amux = EM28XX_AMUX_LINE_IN,
492 }, {
493 .type = EM28XX_VMUX_SVIDEO,
494 .vmux = SAA7115_SVIDEO3,
495 .amux = EM28XX_AMUX_LINE_IN,
496 } },
498 [EM2820_BOARD_TERRATEC_CINERGY_250] = {
499 .name = "Terratec Cinergy 250 USB",
500 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
501 .has_ir_i2c = 1,
502 .tda9887_conf = TDA9887_PRESENT,
503 .decoder = EM28XX_SAA711X,
504 .input = { {
505 .type = EM28XX_VMUX_TELEVISION,
506 .vmux = SAA7115_COMPOSITE2,
507 .amux = EM28XX_AMUX_VIDEO,
508 }, {
509 .type = EM28XX_VMUX_COMPOSITE1,
510 .vmux = SAA7115_COMPOSITE0,
511 .amux = EM28XX_AMUX_LINE_IN,
512 }, {
513 .type = EM28XX_VMUX_SVIDEO,
514 .vmux = SAA7115_SVIDEO3,
515 .amux = EM28XX_AMUX_LINE_IN,
516 } },
518 [EM2820_BOARD_PINNACLE_USB_2] = {
519 .name = "Pinnacle PCTV USB 2",
520 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
521 .has_ir_i2c = 1,
522 .tda9887_conf = TDA9887_PRESENT,
523 .decoder = EM28XX_SAA711X,
524 .input = { {
525 .type = EM28XX_VMUX_TELEVISION,
526 .vmux = SAA7115_COMPOSITE2,
527 .amux = EM28XX_AMUX_VIDEO,
528 }, {
529 .type = EM28XX_VMUX_COMPOSITE1,
530 .vmux = SAA7115_COMPOSITE0,
531 .amux = EM28XX_AMUX_LINE_IN,
532 }, {
533 .type = EM28XX_VMUX_SVIDEO,
534 .vmux = SAA7115_SVIDEO3,
535 .amux = EM28XX_AMUX_LINE_IN,
536 } },
538 [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2] = {
539 .name = "Hauppauge WinTV USB 2",
540 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
541 .tda9887_conf = TDA9887_PRESENT |
542 TDA9887_PORT1_ACTIVE |
543 TDA9887_PORT2_ACTIVE,
544 .decoder = EM28XX_TVP5150,
545 .has_msp34xx = 1,
546 .has_ir_i2c = 1,
547 .input = { {
548 .type = EM28XX_VMUX_TELEVISION,
549 .vmux = TVP5150_COMPOSITE0,
550 .amux = MSP_INPUT_DEFAULT,
551 }, {
552 .type = EM28XX_VMUX_SVIDEO,
553 .vmux = TVP5150_SVIDEO,
554 .amux = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1,
555 MSP_DSP_IN_SCART, MSP_DSP_IN_SCART),
556 } },
558 [EM2820_BOARD_DLINK_USB_TV] = {
559 .name = "D-Link DUB-T210 TV Tuner",
560 .valid = EM28XX_BOARD_NOT_VALIDATED,
561 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
562 .tda9887_conf = TDA9887_PRESENT,
563 .decoder = EM28XX_SAA711X,
564 .input = { {
565 .type = EM28XX_VMUX_TELEVISION,
566 .vmux = SAA7115_COMPOSITE2,
567 .amux = EM28XX_AMUX_LINE_IN,
568 }, {
569 .type = EM28XX_VMUX_COMPOSITE1,
570 .vmux = SAA7115_COMPOSITE0,
571 .amux = EM28XX_AMUX_LINE_IN,
572 }, {
573 .type = EM28XX_VMUX_SVIDEO,
574 .vmux = SAA7115_SVIDEO3,
575 .amux = EM28XX_AMUX_LINE_IN,
576 } },
578 [EM2820_BOARD_HERCULES_SMART_TV_USB2] = {
579 .name = "Hercules Smart TV USB 2.0",
580 .valid = EM28XX_BOARD_NOT_VALIDATED,
581 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
582 .tda9887_conf = TDA9887_PRESENT,
583 .decoder = EM28XX_SAA711X,
584 .input = { {
585 .type = EM28XX_VMUX_TELEVISION,
586 .vmux = SAA7115_COMPOSITE2,
587 .amux = EM28XX_AMUX_LINE_IN,
588 }, {
589 .type = EM28XX_VMUX_COMPOSITE1,
590 .vmux = SAA7115_COMPOSITE0,
591 .amux = EM28XX_AMUX_LINE_IN,
592 }, {
593 .type = EM28XX_VMUX_SVIDEO,
594 .vmux = SAA7115_SVIDEO3,
595 .amux = EM28XX_AMUX_LINE_IN,
596 } },
598 [EM2820_BOARD_PINNACLE_USB_2_FM1216ME] = {
599 .name = "Pinnacle PCTV USB 2 (Philips FM1216ME)",
600 .valid = EM28XX_BOARD_NOT_VALIDATED,
601 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
602 .tda9887_conf = TDA9887_PRESENT,
603 .decoder = EM28XX_SAA711X,
604 .input = { {
605 .type = EM28XX_VMUX_TELEVISION,
606 .vmux = SAA7115_COMPOSITE2,
607 .amux = EM28XX_AMUX_VIDEO,
608 }, {
609 .type = EM28XX_VMUX_COMPOSITE1,
610 .vmux = SAA7115_COMPOSITE0,
611 .amux = EM28XX_AMUX_LINE_IN,
612 }, {
613 .type = EM28XX_VMUX_SVIDEO,
614 .vmux = SAA7115_SVIDEO3,
615 .amux = EM28XX_AMUX_LINE_IN,
616 } },
618 [EM2820_BOARD_GADMEI_UTV310] = {
619 .name = "Gadmei UTV310",
620 .valid = EM28XX_BOARD_NOT_VALIDATED,
621 .tuner_type = TUNER_TNF_5335MF,
622 .tda9887_conf = TDA9887_PRESENT,
623 .decoder = EM28XX_SAA711X,
624 .input = { {
625 .type = EM28XX_VMUX_TELEVISION,
626 .vmux = SAA7115_COMPOSITE1,
627 .amux = EM28XX_AMUX_LINE_IN,
628 }, {
629 .type = EM28XX_VMUX_COMPOSITE1,
630 .vmux = SAA7115_COMPOSITE0,
631 .amux = EM28XX_AMUX_LINE_IN,
632 }, {
633 .type = EM28XX_VMUX_SVIDEO,
634 .vmux = SAA7115_SVIDEO3,
635 .amux = EM28XX_AMUX_LINE_IN,
636 } },
638 [EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE] = {
639 .name = "Leadtek Winfast USB II Deluxe",
640 .valid = EM28XX_BOARD_NOT_VALIDATED,
641 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
642 .has_ir_i2c = 1,
643 .tvaudio_addr = 0x58,
644 .tda9887_conf = TDA9887_PRESENT |
645 TDA9887_PORT2_ACTIVE |
646 TDA9887_QSS,
647 .decoder = EM28XX_SAA711X,
648 .adecoder = EM28XX_TVAUDIO,
649 .input = { {
650 .type = EM28XX_VMUX_TELEVISION,
651 .vmux = SAA7115_COMPOSITE4,
652 .amux = EM28XX_AMUX_AUX,
653 }, {
654 .type = EM28XX_VMUX_COMPOSITE1,
655 .vmux = SAA7115_COMPOSITE5,
656 .amux = EM28XX_AMUX_LINE_IN,
657 }, {
658 .type = EM28XX_VMUX_SVIDEO,
659 .vmux = SAA7115_SVIDEO3,
660 .amux = EM28XX_AMUX_LINE_IN,
661 } },
662 .radio = {
663 .type = EM28XX_RADIO,
664 .amux = EM28XX_AMUX_AUX,
667 [EM2820_BOARD_VIDEOLOGY_20K14XUSB] = {
668 .name = "Videology 20K14XUSB USB2.0",
669 .valid = EM28XX_BOARD_NOT_VALIDATED,
670 .tuner_type = TUNER_ABSENT,
671 .is_webcam = 1,
672 .input = { {
673 .type = EM28XX_VMUX_COMPOSITE1,
674 .vmux = 0,
675 .amux = EM28XX_AMUX_VIDEO,
676 } },
678 [EM2820_BOARD_SILVERCREST_WEBCAM] = {
679 .name = "Silvercrest Webcam 1.3mpix",
680 .tuner_type = TUNER_ABSENT,
681 .is_webcam = 1,
682 .input = { {
683 .type = EM28XX_VMUX_COMPOSITE1,
684 .vmux = 0,
685 .amux = EM28XX_AMUX_VIDEO,
686 .gpio = silvercrest_reg_seq,
687 } },
689 [EM2821_BOARD_SUPERCOMP_USB_2] = {
690 .name = "Supercomp USB 2.0 TV",
691 .valid = EM28XX_BOARD_NOT_VALIDATED,
692 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
693 .tda9887_conf = TDA9887_PRESENT |
694 TDA9887_PORT1_ACTIVE |
695 TDA9887_PORT2_ACTIVE,
696 .decoder = EM28XX_SAA711X,
697 .input = { {
698 .type = EM28XX_VMUX_TELEVISION,
699 .vmux = SAA7115_COMPOSITE2,
700 .amux = EM28XX_AMUX_LINE_IN,
701 }, {
702 .type = EM28XX_VMUX_COMPOSITE1,
703 .vmux = SAA7115_COMPOSITE0,
704 .amux = EM28XX_AMUX_VIDEO,
705 }, {
706 .type = EM28XX_VMUX_SVIDEO,
707 .vmux = SAA7115_SVIDEO3,
708 .amux = EM28XX_AMUX_LINE_IN,
709 } },
711 [EM2821_BOARD_USBGEAR_VD204] = {
712 .name = "Usbgear VD204v9",
713 .valid = EM28XX_BOARD_NOT_VALIDATED,
714 .tuner_type = TUNER_ABSENT, /* Capture only device */
715 .decoder = EM28XX_SAA711X,
716 .input = { {
717 .type = EM28XX_VMUX_COMPOSITE1,
718 .vmux = SAA7115_COMPOSITE0,
719 .amux = EM28XX_AMUX_LINE_IN,
720 }, {
721 .type = EM28XX_VMUX_SVIDEO,
722 .vmux = SAA7115_SVIDEO3,
723 .amux = EM28XX_AMUX_LINE_IN,
724 } },
726 [EM2860_BOARD_NETGMBH_CAM] = {
727 /* Beijing Huaqi Information Digital Technology Co., Ltd */
728 .name = "NetGMBH Cam",
729 .valid = EM28XX_BOARD_NOT_VALIDATED,
730 .tuner_type = TUNER_ABSENT,
731 .is_webcam = 1,
732 .input = { {
733 .type = EM28XX_VMUX_COMPOSITE1,
734 .vmux = 0,
735 .amux = EM28XX_AMUX_VIDEO,
736 } },
738 [EM2860_BOARD_TYPHOON_DVD_MAKER] = {
739 .name = "Typhoon DVD Maker",
740 .decoder = EM28XX_SAA711X,
741 .tuner_type = TUNER_ABSENT, /* Capture only device */
742 .input = { {
743 .type = EM28XX_VMUX_COMPOSITE1,
744 .vmux = SAA7115_COMPOSITE0,
745 .amux = EM28XX_AMUX_LINE_IN,
746 }, {
747 .type = EM28XX_VMUX_SVIDEO,
748 .vmux = SAA7115_SVIDEO3,
749 .amux = EM28XX_AMUX_LINE_IN,
750 } },
752 [EM2860_BOARD_GADMEI_UTV330] = {
753 .name = "Gadmei UTV330",
754 .valid = EM28XX_BOARD_NOT_VALIDATED,
755 .tuner_type = TUNER_TNF_5335MF,
756 .tda9887_conf = TDA9887_PRESENT,
757 .decoder = EM28XX_SAA711X,
758 .input = { {
759 .type = EM28XX_VMUX_TELEVISION,
760 .vmux = SAA7115_COMPOSITE2,
761 .amux = EM28XX_AMUX_VIDEO,
762 }, {
763 .type = EM28XX_VMUX_COMPOSITE1,
764 .vmux = SAA7115_COMPOSITE0,
765 .amux = EM28XX_AMUX_LINE_IN,
766 }, {
767 .type = EM28XX_VMUX_SVIDEO,
768 .vmux = SAA7115_SVIDEO3,
769 .amux = EM28XX_AMUX_LINE_IN,
770 } },
772 [EM2861_BOARD_GADMEI_UTV330PLUS] = {
773 .name = "Gadmei UTV330+",
774 .tuner_type = TUNER_TNF_5335MF,
775 .tda9887_conf = TDA9887_PRESENT,
776 .ir_codes = RC_MAP_GADMEI_RM008Z,
777 .decoder = EM28XX_SAA711X,
778 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
779 .input = { {
780 .type = EM28XX_VMUX_TELEVISION,
781 .vmux = SAA7115_COMPOSITE2,
782 .amux = EM28XX_AMUX_VIDEO,
783 }, {
784 .type = EM28XX_VMUX_COMPOSITE1,
785 .vmux = SAA7115_COMPOSITE0,
786 .amux = EM28XX_AMUX_LINE_IN,
787 }, {
788 .type = EM28XX_VMUX_SVIDEO,
789 .vmux = SAA7115_SVIDEO3,
790 .amux = EM28XX_AMUX_LINE_IN,
791 } },
793 [EM2860_BOARD_TERRATEC_HYBRID_XS] = {
794 .name = "Terratec Cinergy A Hybrid XS",
795 .valid = EM28XX_BOARD_NOT_VALIDATED,
796 .tuner_type = TUNER_XC2028,
797 .tuner_gpio = default_tuner_gpio,
798 .decoder = EM28XX_TVP5150,
800 .input = { {
801 .type = EM28XX_VMUX_TELEVISION,
802 .vmux = TVP5150_COMPOSITE0,
803 .amux = EM28XX_AMUX_VIDEO,
804 .gpio = hauppauge_wintv_hvr_900_analog,
805 }, {
806 .type = EM28XX_VMUX_COMPOSITE1,
807 .vmux = TVP5150_COMPOSITE1,
808 .amux = EM28XX_AMUX_LINE_IN,
809 .gpio = hauppauge_wintv_hvr_900_analog,
810 }, {
811 .type = EM28XX_VMUX_SVIDEO,
812 .vmux = TVP5150_SVIDEO,
813 .amux = EM28XX_AMUX_LINE_IN,
814 .gpio = hauppauge_wintv_hvr_900_analog,
815 } },
817 [EM2861_BOARD_KWORLD_PVRTV_300U] = {
818 .name = "KWorld PVRTV 300U",
819 .valid = EM28XX_BOARD_NOT_VALIDATED,
820 .tuner_type = TUNER_XC2028,
821 .tuner_gpio = default_tuner_gpio,
822 .decoder = EM28XX_TVP5150,
823 .input = { {
824 .type = EM28XX_VMUX_TELEVISION,
825 .vmux = TVP5150_COMPOSITE0,
826 .amux = EM28XX_AMUX_VIDEO,
827 }, {
828 .type = EM28XX_VMUX_COMPOSITE1,
829 .vmux = TVP5150_COMPOSITE1,
830 .amux = EM28XX_AMUX_LINE_IN,
831 }, {
832 .type = EM28XX_VMUX_SVIDEO,
833 .vmux = TVP5150_SVIDEO,
834 .amux = EM28XX_AMUX_LINE_IN,
835 } },
837 [EM2861_BOARD_YAKUMO_MOVIE_MIXER] = {
838 .name = "Yakumo MovieMixer",
839 .tuner_type = TUNER_ABSENT, /* Capture only device */
840 .decoder = EM28XX_TVP5150,
841 .input = { {
842 .type = EM28XX_VMUX_TELEVISION,
843 .vmux = TVP5150_COMPOSITE0,
844 .amux = EM28XX_AMUX_VIDEO,
845 }, {
846 .type = EM28XX_VMUX_COMPOSITE1,
847 .vmux = TVP5150_COMPOSITE1,
848 .amux = EM28XX_AMUX_LINE_IN,
849 }, {
850 .type = EM28XX_VMUX_SVIDEO,
851 .vmux = TVP5150_SVIDEO,
852 .amux = EM28XX_AMUX_LINE_IN,
853 } },
855 [EM2860_BOARD_TVP5150_REFERENCE_DESIGN] = {
856 .name = "EM2860/TVP5150 Reference Design",
857 .tuner_type = TUNER_ABSENT, /* Capture only device */
858 .decoder = EM28XX_TVP5150,
859 .input = { {
860 .type = EM28XX_VMUX_COMPOSITE1,
861 .vmux = TVP5150_COMPOSITE1,
862 .amux = EM28XX_AMUX_LINE_IN,
863 }, {
864 .type = EM28XX_VMUX_SVIDEO,
865 .vmux = TVP5150_SVIDEO,
866 .amux = EM28XX_AMUX_LINE_IN,
867 } },
869 [EM2861_BOARD_PLEXTOR_PX_TV100U] = {
870 .name = "Plextor ConvertX PX-TV100U",
871 .tuner_type = TUNER_TNF_5335MF,
872 .xclk = EM28XX_XCLK_I2S_MSB_TIMING |
873 EM28XX_XCLK_FREQUENCY_12MHZ,
874 .tda9887_conf = TDA9887_PRESENT,
875 .decoder = EM28XX_TVP5150,
876 .has_msp34xx = 1,
877 .input = { {
878 .type = EM28XX_VMUX_TELEVISION,
879 .vmux = TVP5150_COMPOSITE0,
880 .amux = EM28XX_AMUX_LINE_IN,
881 .gpio = pinnacle_hybrid_pro_analog,
882 }, {
883 .type = EM28XX_VMUX_COMPOSITE1,
884 .vmux = TVP5150_COMPOSITE1,
885 .amux = EM28XX_AMUX_LINE_IN,
886 .gpio = pinnacle_hybrid_pro_analog,
887 }, {
888 .type = EM28XX_VMUX_SVIDEO,
889 .vmux = TVP5150_SVIDEO,
890 .amux = EM28XX_AMUX_LINE_IN,
891 .gpio = pinnacle_hybrid_pro_analog,
892 } },
895 /* Those boards with em2870 are DVB Only*/
897 [EM2870_BOARD_TERRATEC_XS] = {
898 .name = "Terratec Cinergy T XS",
899 .valid = EM28XX_BOARD_NOT_VALIDATED,
900 .tuner_type = TUNER_XC2028,
901 .tuner_gpio = default_tuner_gpio,
903 [EM2870_BOARD_TERRATEC_XS_MT2060] = {
904 .name = "Terratec Cinergy T XS (MT2060)",
905 .valid = EM28XX_BOARD_NOT_VALIDATED,
906 .tuner_type = TUNER_ABSENT, /* MT2060 */
908 [EM2870_BOARD_KWORLD_350U] = {
909 .name = "Kworld 350 U DVB-T",
910 .valid = EM28XX_BOARD_NOT_VALIDATED,
911 .tuner_type = TUNER_XC2028,
912 .tuner_gpio = default_tuner_gpio,
914 [EM2870_BOARD_KWORLD_355U] = {
915 .name = "Kworld 355 U DVB-T",
916 .valid = EM28XX_BOARD_NOT_VALIDATED,
917 .tuner_type = TUNER_ABSENT,
918 .tuner_gpio = default_tuner_gpio,
919 .has_dvb = 1,
920 .dvb_gpio = default_digital,
922 [EM2870_BOARD_PINNACLE_PCTV_DVB] = {
923 .name = "Pinnacle PCTV DVB-T",
924 .valid = EM28XX_BOARD_NOT_VALIDATED,
925 .tuner_type = TUNER_ABSENT, /* MT2060 */
926 /* djh - I have serious doubts this is right... */
927 .xclk = EM28XX_XCLK_IR_RC5_MODE |
928 EM28XX_XCLK_FREQUENCY_10MHZ,
930 [EM2870_BOARD_COMPRO_VIDEOMATE] = {
931 .name = "Compro, VideoMate U3",
932 .valid = EM28XX_BOARD_NOT_VALIDATED,
933 .tuner_type = TUNER_ABSENT, /* MT2060 */
936 [EM2880_BOARD_TERRATEC_HYBRID_XS_FR] = {
937 .name = "Terratec Hybrid XS Secam",
938 .has_msp34xx = 1,
939 .tuner_type = TUNER_XC2028,
940 .tuner_gpio = default_tuner_gpio,
941 .decoder = EM28XX_TVP5150,
942 .has_dvb = 1,
943 .dvb_gpio = terratec_cinergy_USB_XS_FR_digital,
944 .input = { {
945 .type = EM28XX_VMUX_TELEVISION,
946 .vmux = TVP5150_COMPOSITE0,
947 .amux = EM28XX_AMUX_VIDEO,
948 .gpio = terratec_cinergy_USB_XS_FR_analog,
949 }, {
950 .type = EM28XX_VMUX_COMPOSITE1,
951 .vmux = TVP5150_COMPOSITE1,
952 .amux = EM28XX_AMUX_LINE_IN,
953 .gpio = terratec_cinergy_USB_XS_FR_analog,
954 }, {
955 .type = EM28XX_VMUX_SVIDEO,
956 .vmux = TVP5150_SVIDEO,
957 .amux = EM28XX_AMUX_LINE_IN,
958 .gpio = terratec_cinergy_USB_XS_FR_analog,
959 } },
961 [EM2884_BOARD_TERRATEC_H5] = {
962 .name = "Terratec Cinergy H5",
963 .has_dvb = 1,
964 #if 0
965 .tuner_type = TUNER_PHILIPS_TDA8290,
966 .tuner_addr = 0x41,
967 .dvb_gpio = terratec_h5_digital, /* FIXME: probably wrong */
968 .tuner_gpio = terratec_h5_gpio,
969 #else
970 .tuner_type = TUNER_ABSENT,
971 #endif
972 .def_i2c_bus = 1,
973 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
974 EM28XX_I2C_FREQ_400_KHZ,
976 [EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C] = {
977 .name = "Hauppauge WinTV HVR 930C",
978 .has_dvb = 1,
979 #if 0 /* FIXME: Add analog support */
980 .tuner_type = TUNER_XC5000,
981 .tuner_addr = 0x41,
982 .dvb_gpio = hauppauge_930c_digital,
983 .tuner_gpio = hauppauge_930c_gpio,
984 #else
985 .tuner_type = TUNER_ABSENT,
986 #endif
987 .ir_codes = RC_MAP_HAUPPAUGE,
988 .def_i2c_bus = 1,
989 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
990 EM28XX_I2C_FREQ_400_KHZ,
992 [EM2884_BOARD_C3TECH_DIGITAL_DUO] = {
993 .name = "C3 Tech Digital Duo HDTV/SDTV USB",
994 .has_dvb = 1,
995 /* FIXME: Add analog support - need a saa7136 driver */
996 .tuner_type = TUNER_ABSENT, /* Digital-only TDA18271HD */
997 .ir_codes = RC_MAP_EMPTY,
998 .def_i2c_bus = 1,
999 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE,
1000 .dvb_gpio = c3tech_digital_duo_digital,
1002 [EM2884_BOARD_CINERGY_HTC_STICK] = {
1003 .name = "Terratec Cinergy HTC Stick",
1004 .has_dvb = 1,
1005 .ir_codes = RC_MAP_NEC_TERRATEC_CINERGY_XS,
1006 .tuner_type = TUNER_ABSENT,
1007 .def_i2c_bus = 1,
1008 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
1009 EM28XX_I2C_FREQ_400_KHZ,
1011 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900] = {
1012 .name = "Hauppauge WinTV HVR 900",
1013 .tda9887_conf = TDA9887_PRESENT,
1014 .tuner_type = TUNER_XC2028,
1015 .tuner_gpio = default_tuner_gpio,
1016 .mts_firmware = 1,
1017 .has_dvb = 1,
1018 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
1019 .ir_codes = RC_MAP_HAUPPAUGE,
1020 .decoder = EM28XX_TVP5150,
1021 .input = { {
1022 .type = EM28XX_VMUX_TELEVISION,
1023 .vmux = TVP5150_COMPOSITE0,
1024 .amux = EM28XX_AMUX_VIDEO,
1025 .gpio = hauppauge_wintv_hvr_900_analog,
1026 }, {
1027 .type = EM28XX_VMUX_COMPOSITE1,
1028 .vmux = TVP5150_COMPOSITE1,
1029 .amux = EM28XX_AMUX_LINE_IN,
1030 .gpio = hauppauge_wintv_hvr_900_analog,
1031 }, {
1032 .type = EM28XX_VMUX_SVIDEO,
1033 .vmux = TVP5150_SVIDEO,
1034 .amux = EM28XX_AMUX_LINE_IN,
1035 .gpio = hauppauge_wintv_hvr_900_analog,
1036 } },
1038 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2] = {
1039 .name = "Hauppauge WinTV HVR 900 (R2)",
1040 .tda9887_conf = TDA9887_PRESENT,
1041 .tuner_type = TUNER_XC2028,
1042 .tuner_gpio = default_tuner_gpio,
1043 .mts_firmware = 1,
1044 .has_dvb = 1,
1045 .dvb_gpio = hauppauge_wintv_hvr_900R2_digital,
1046 .ir_codes = RC_MAP_HAUPPAUGE,
1047 .decoder = EM28XX_TVP5150,
1048 .input = { {
1049 .type = EM28XX_VMUX_TELEVISION,
1050 .vmux = TVP5150_COMPOSITE0,
1051 .amux = EM28XX_AMUX_VIDEO,
1052 .gpio = hauppauge_wintv_hvr_900_analog,
1053 }, {
1054 .type = EM28XX_VMUX_COMPOSITE1,
1055 .vmux = TVP5150_COMPOSITE1,
1056 .amux = EM28XX_AMUX_LINE_IN,
1057 .gpio = hauppauge_wintv_hvr_900_analog,
1058 }, {
1059 .type = EM28XX_VMUX_SVIDEO,
1060 .vmux = TVP5150_SVIDEO,
1061 .amux = EM28XX_AMUX_LINE_IN,
1062 .gpio = hauppauge_wintv_hvr_900_analog,
1063 } },
1065 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850] = {
1066 .name = "Hauppauge WinTV HVR 850",
1067 .tuner_type = TUNER_XC2028,
1068 .tuner_gpio = default_tuner_gpio,
1069 .mts_firmware = 1,
1070 .has_dvb = 1,
1071 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
1072 .ir_codes = RC_MAP_HAUPPAUGE,
1073 .decoder = EM28XX_TVP5150,
1074 .input = { {
1075 .type = EM28XX_VMUX_TELEVISION,
1076 .vmux = TVP5150_COMPOSITE0,
1077 .amux = EM28XX_AMUX_VIDEO,
1078 .gpio = hauppauge_wintv_hvr_900_analog,
1079 }, {
1080 .type = EM28XX_VMUX_COMPOSITE1,
1081 .vmux = TVP5150_COMPOSITE1,
1082 .amux = EM28XX_AMUX_LINE_IN,
1083 .gpio = hauppauge_wintv_hvr_900_analog,
1084 }, {
1085 .type = EM28XX_VMUX_SVIDEO,
1086 .vmux = TVP5150_SVIDEO,
1087 .amux = EM28XX_AMUX_LINE_IN,
1088 .gpio = hauppauge_wintv_hvr_900_analog,
1089 } },
1091 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950] = {
1092 .name = "Hauppauge WinTV HVR 950",
1093 .tuner_type = TUNER_XC2028,
1094 .tuner_gpio = default_tuner_gpio,
1095 .mts_firmware = 1,
1096 .has_dvb = 1,
1097 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
1098 .ir_codes = RC_MAP_HAUPPAUGE,
1099 .decoder = EM28XX_TVP5150,
1100 .input = { {
1101 .type = EM28XX_VMUX_TELEVISION,
1102 .vmux = TVP5150_COMPOSITE0,
1103 .amux = EM28XX_AMUX_VIDEO,
1104 .gpio = hauppauge_wintv_hvr_900_analog,
1105 }, {
1106 .type = EM28XX_VMUX_COMPOSITE1,
1107 .vmux = TVP5150_COMPOSITE1,
1108 .amux = EM28XX_AMUX_LINE_IN,
1109 .gpio = hauppauge_wintv_hvr_900_analog,
1110 }, {
1111 .type = EM28XX_VMUX_SVIDEO,
1112 .vmux = TVP5150_SVIDEO,
1113 .amux = EM28XX_AMUX_LINE_IN,
1114 .gpio = hauppauge_wintv_hvr_900_analog,
1115 } },
1117 [EM2880_BOARD_PINNACLE_PCTV_HD_PRO] = {
1118 .name = "Pinnacle PCTV HD Pro Stick",
1119 .tuner_type = TUNER_XC2028,
1120 .tuner_gpio = default_tuner_gpio,
1121 .mts_firmware = 1,
1122 .has_dvb = 1,
1123 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
1124 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
1125 .decoder = EM28XX_TVP5150,
1126 .input = { {
1127 .type = EM28XX_VMUX_TELEVISION,
1128 .vmux = TVP5150_COMPOSITE0,
1129 .amux = EM28XX_AMUX_VIDEO,
1130 .gpio = hauppauge_wintv_hvr_900_analog,
1131 }, {
1132 .type = EM28XX_VMUX_COMPOSITE1,
1133 .vmux = TVP5150_COMPOSITE1,
1134 .amux = EM28XX_AMUX_LINE_IN,
1135 .gpio = hauppauge_wintv_hvr_900_analog,
1136 }, {
1137 .type = EM28XX_VMUX_SVIDEO,
1138 .vmux = TVP5150_SVIDEO,
1139 .amux = EM28XX_AMUX_LINE_IN,
1140 .gpio = hauppauge_wintv_hvr_900_analog,
1141 } },
1143 [EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600] = {
1144 .name = "AMD ATI TV Wonder HD 600",
1145 .tuner_type = TUNER_XC2028,
1146 .tuner_gpio = default_tuner_gpio,
1147 .mts_firmware = 1,
1148 .has_dvb = 1,
1149 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
1150 .ir_codes = RC_MAP_ATI_TV_WONDER_HD_600,
1151 .decoder = EM28XX_TVP5150,
1152 .input = { {
1153 .type = EM28XX_VMUX_TELEVISION,
1154 .vmux = TVP5150_COMPOSITE0,
1155 .amux = EM28XX_AMUX_VIDEO,
1156 .gpio = hauppauge_wintv_hvr_900_analog,
1157 }, {
1158 .type = EM28XX_VMUX_COMPOSITE1,
1159 .vmux = TVP5150_COMPOSITE1,
1160 .amux = EM28XX_AMUX_LINE_IN,
1161 .gpio = hauppauge_wintv_hvr_900_analog,
1162 }, {
1163 .type = EM28XX_VMUX_SVIDEO,
1164 .vmux = TVP5150_SVIDEO,
1165 .amux = EM28XX_AMUX_LINE_IN,
1166 .gpio = hauppauge_wintv_hvr_900_analog,
1167 } },
1169 [EM2880_BOARD_TERRATEC_HYBRID_XS] = {
1170 .name = "Terratec Hybrid XS",
1171 .tuner_type = TUNER_XC2028,
1172 .tuner_gpio = default_tuner_gpio,
1173 .decoder = EM28XX_TVP5150,
1174 .has_dvb = 1,
1175 .dvb_gpio = default_digital,
1176 .ir_codes = RC_MAP_TERRATEC_CINERGY_XS,
1177 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */
1178 .input = { {
1179 .type = EM28XX_VMUX_TELEVISION,
1180 .vmux = TVP5150_COMPOSITE0,
1181 .amux = EM28XX_AMUX_VIDEO,
1182 .gpio = default_analog,
1183 }, {
1184 .type = EM28XX_VMUX_COMPOSITE1,
1185 .vmux = TVP5150_COMPOSITE1,
1186 .amux = EM28XX_AMUX_LINE_IN,
1187 .gpio = default_analog,
1188 }, {
1189 .type = EM28XX_VMUX_SVIDEO,
1190 .vmux = TVP5150_SVIDEO,
1191 .amux = EM28XX_AMUX_LINE_IN,
1192 .gpio = default_analog,
1193 } },
1195 /* maybe there's a reason behind it why Terratec sells the Hybrid XS
1196 as Prodigy XS with a different PID, let's keep it separated for now
1197 maybe we'll need it lateron */
1198 [EM2880_BOARD_TERRATEC_PRODIGY_XS] = {
1199 .name = "Terratec Prodigy XS",
1200 .tuner_type = TUNER_XC2028,
1201 .tuner_gpio = default_tuner_gpio,
1202 .decoder = EM28XX_TVP5150,
1203 .input = { {
1204 .type = EM28XX_VMUX_TELEVISION,
1205 .vmux = TVP5150_COMPOSITE0,
1206 .amux = EM28XX_AMUX_VIDEO,
1207 .gpio = hauppauge_wintv_hvr_900_analog,
1208 }, {
1209 .type = EM28XX_VMUX_COMPOSITE1,
1210 .vmux = TVP5150_COMPOSITE1,
1211 .amux = EM28XX_AMUX_LINE_IN,
1212 .gpio = hauppauge_wintv_hvr_900_analog,
1213 }, {
1214 .type = EM28XX_VMUX_SVIDEO,
1215 .vmux = TVP5150_SVIDEO,
1216 .amux = EM28XX_AMUX_LINE_IN,
1217 .gpio = hauppauge_wintv_hvr_900_analog,
1218 } },
1220 [EM2820_BOARD_MSI_VOX_USB_2] = {
1221 .name = "MSI VOX USB 2.0",
1222 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1223 .tda9887_conf = TDA9887_PRESENT |
1224 TDA9887_PORT1_ACTIVE |
1225 TDA9887_PORT2_ACTIVE,
1226 .max_range_640_480 = 1,
1227 .decoder = EM28XX_SAA711X,
1228 .input = { {
1229 .type = EM28XX_VMUX_TELEVISION,
1230 .vmux = SAA7115_COMPOSITE4,
1231 .amux = EM28XX_AMUX_VIDEO,
1232 }, {
1233 .type = EM28XX_VMUX_COMPOSITE1,
1234 .vmux = SAA7115_COMPOSITE0,
1235 .amux = EM28XX_AMUX_LINE_IN,
1236 }, {
1237 .type = EM28XX_VMUX_SVIDEO,
1238 .vmux = SAA7115_SVIDEO3,
1239 .amux = EM28XX_AMUX_LINE_IN,
1240 } },
1242 [EM2800_BOARD_TERRATEC_CINERGY_200] = {
1243 .name = "Terratec Cinergy 200 USB",
1244 .is_em2800 = 1,
1245 .has_ir_i2c = 1,
1246 .tuner_type = TUNER_LG_TALN,
1247 .tda9887_conf = TDA9887_PRESENT,
1248 .decoder = EM28XX_SAA711X,
1249 .input = { {
1250 .type = EM28XX_VMUX_TELEVISION,
1251 .vmux = SAA7115_COMPOSITE2,
1252 .amux = EM28XX_AMUX_VIDEO,
1253 }, {
1254 .type = EM28XX_VMUX_COMPOSITE1,
1255 .vmux = SAA7115_COMPOSITE0,
1256 .amux = EM28XX_AMUX_LINE_IN,
1257 }, {
1258 .type = EM28XX_VMUX_SVIDEO,
1259 .vmux = SAA7115_SVIDEO3,
1260 .amux = EM28XX_AMUX_LINE_IN,
1261 } },
1263 [EM2800_BOARD_GRABBEEX_USB2800] = {
1264 .name = "eMPIA Technology, Inc. GrabBeeX+ Video Encoder",
1265 .is_em2800 = 1,
1266 .decoder = EM28XX_SAA711X,
1267 .tuner_type = TUNER_ABSENT, /* capture only board */
1268 .input = { {
1269 .type = EM28XX_VMUX_COMPOSITE1,
1270 .vmux = SAA7115_COMPOSITE0,
1271 .amux = EM28XX_AMUX_LINE_IN,
1272 }, {
1273 .type = EM28XX_VMUX_SVIDEO,
1274 .vmux = SAA7115_SVIDEO3,
1275 .amux = EM28XX_AMUX_LINE_IN,
1276 } },
1278 [EM2800_BOARD_VC211A] = {
1279 .name = "Actionmaster/LinXcel/Digitus VC211A",
1280 .is_em2800 = 1,
1281 .tuner_type = TUNER_ABSENT, /* Capture-only board */
1282 .decoder = EM28XX_SAA711X,
1283 .input = { {
1284 .type = EM28XX_VMUX_COMPOSITE1,
1285 .vmux = SAA7115_COMPOSITE0,
1286 .amux = EM28XX_AMUX_LINE_IN,
1287 .gpio = vc211a_enable,
1288 }, {
1289 .type = EM28XX_VMUX_SVIDEO,
1290 .vmux = SAA7115_SVIDEO3,
1291 .amux = EM28XX_AMUX_LINE_IN,
1292 .gpio = vc211a_enable,
1293 } },
1295 [EM2800_BOARD_LEADTEK_WINFAST_USBII] = {
1296 .name = "Leadtek Winfast USB II",
1297 .is_em2800 = 1,
1298 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1299 .tda9887_conf = TDA9887_PRESENT,
1300 .decoder = EM28XX_SAA711X,
1301 .input = { {
1302 .type = EM28XX_VMUX_TELEVISION,
1303 .vmux = SAA7115_COMPOSITE2,
1304 .amux = EM28XX_AMUX_VIDEO,
1305 }, {
1306 .type = EM28XX_VMUX_COMPOSITE1,
1307 .vmux = SAA7115_COMPOSITE0,
1308 .amux = EM28XX_AMUX_LINE_IN,
1309 }, {
1310 .type = EM28XX_VMUX_SVIDEO,
1311 .vmux = SAA7115_SVIDEO3,
1312 .amux = EM28XX_AMUX_LINE_IN,
1313 } },
1315 [EM2800_BOARD_KWORLD_USB2800] = {
1316 .name = "Kworld USB2800",
1317 .is_em2800 = 1,
1318 .tuner_type = TUNER_PHILIPS_FCV1236D,
1319 .tda9887_conf = TDA9887_PRESENT,
1320 .decoder = EM28XX_SAA711X,
1321 .input = { {
1322 .type = EM28XX_VMUX_TELEVISION,
1323 .vmux = SAA7115_COMPOSITE2,
1324 .amux = EM28XX_AMUX_VIDEO,
1325 }, {
1326 .type = EM28XX_VMUX_COMPOSITE1,
1327 .vmux = SAA7115_COMPOSITE0,
1328 .amux = EM28XX_AMUX_LINE_IN,
1329 }, {
1330 .type = EM28XX_VMUX_SVIDEO,
1331 .vmux = SAA7115_SVIDEO3,
1332 .amux = EM28XX_AMUX_LINE_IN,
1333 } },
1335 [EM2820_BOARD_PINNACLE_DVC_90] = {
1336 .name = "Pinnacle Dazzle DVC 90/100/101/107 / Kaiser Baas Video to DVD maker "
1337 "/ Kworld DVD Maker 2 / Plextor ConvertX PX-AV100U",
1338 .tuner_type = TUNER_ABSENT, /* capture only board */
1339 .decoder = EM28XX_SAA711X,
1340 .input = { {
1341 .type = EM28XX_VMUX_COMPOSITE1,
1342 .vmux = SAA7115_COMPOSITE0,
1343 .amux = EM28XX_AMUX_LINE_IN,
1344 }, {
1345 .type = EM28XX_VMUX_SVIDEO,
1346 .vmux = SAA7115_SVIDEO3,
1347 .amux = EM28XX_AMUX_LINE_IN,
1348 } },
1350 [EM2800_BOARD_VGEAR_POCKETTV] = {
1351 .name = "V-Gear PocketTV",
1352 .is_em2800 = 1,
1353 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1354 .tda9887_conf = TDA9887_PRESENT,
1355 .decoder = EM28XX_SAA711X,
1356 .input = { {
1357 .type = EM28XX_VMUX_TELEVISION,
1358 .vmux = SAA7115_COMPOSITE2,
1359 .amux = EM28XX_AMUX_VIDEO,
1360 }, {
1361 .type = EM28XX_VMUX_COMPOSITE1,
1362 .vmux = SAA7115_COMPOSITE0,
1363 .amux = EM28XX_AMUX_LINE_IN,
1364 }, {
1365 .type = EM28XX_VMUX_SVIDEO,
1366 .vmux = SAA7115_SVIDEO3,
1367 .amux = EM28XX_AMUX_LINE_IN,
1368 } },
1370 [EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2] = {
1371 .name = "Pixelview PlayTV Box 4 USB 2.0",
1372 .tda9887_conf = TDA9887_PRESENT,
1373 .tuner_type = TUNER_YMEC_TVF_5533MF,
1374 .decoder = EM28XX_SAA711X,
1375 .input = { {
1376 .type = EM28XX_VMUX_TELEVISION,
1377 .vmux = SAA7115_COMPOSITE2,
1378 .amux = EM28XX_AMUX_VIDEO,
1379 .aout = EM28XX_AOUT_MONO | /* I2S */
1380 EM28XX_AOUT_MASTER, /* Line out pin */
1381 }, {
1382 .type = EM28XX_VMUX_COMPOSITE1,
1383 .vmux = SAA7115_COMPOSITE0,
1384 .amux = EM28XX_AMUX_LINE_IN,
1385 }, {
1386 .type = EM28XX_VMUX_SVIDEO,
1387 .vmux = SAA7115_SVIDEO3,
1388 .amux = EM28XX_AMUX_LINE_IN,
1389 } },
1391 [EM2820_BOARD_PROLINK_PLAYTV_USB2] = {
1392 .name = "SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0",
1393 .has_snapshot_button = 1,
1394 .tda9887_conf = TDA9887_PRESENT,
1395 .tuner_type = TUNER_YMEC_TVF_5533MF,
1396 .decoder = EM28XX_SAA711X,
1397 .input = { {
1398 .type = EM28XX_VMUX_TELEVISION,
1399 .vmux = SAA7115_COMPOSITE2,
1400 .amux = EM28XX_AMUX_VIDEO,
1401 .aout = EM28XX_AOUT_MONO | /* I2S */
1402 EM28XX_AOUT_MASTER, /* Line out pin */
1403 }, {
1404 .type = EM28XX_VMUX_COMPOSITE1,
1405 .vmux = SAA7115_COMPOSITE0,
1406 .amux = EM28XX_AMUX_LINE_IN,
1407 }, {
1408 .type = EM28XX_VMUX_SVIDEO,
1409 .vmux = SAA7115_SVIDEO3,
1410 .amux = EM28XX_AMUX_LINE_IN,
1411 } },
1413 [EM2860_BOARD_SAA711X_REFERENCE_DESIGN] = {
1414 .name = "EM2860/SAA711X Reference Design",
1415 .has_snapshot_button = 1,
1416 .tuner_type = TUNER_ABSENT,
1417 .decoder = EM28XX_SAA711X,
1418 .input = { {
1419 .type = EM28XX_VMUX_SVIDEO,
1420 .vmux = SAA7115_SVIDEO3,
1421 }, {
1422 .type = EM28XX_VMUX_COMPOSITE1,
1423 .vmux = SAA7115_COMPOSITE0,
1424 } },
1427 [EM2874_BOARD_LEADERSHIP_ISDBT] = {
1428 .def_i2c_bus = 1,
1429 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
1430 EM28XX_I2C_FREQ_100_KHZ,
1431 .xclk = EM28XX_XCLK_FREQUENCY_10MHZ,
1432 .name = "EM2874 Leadership ISDBT",
1433 .tuner_type = TUNER_ABSENT,
1434 .tuner_gpio = leadership_reset,
1435 .dvb_gpio = leadership_digital,
1436 .has_dvb = 1,
1439 [EM2880_BOARD_MSI_DIGIVOX_AD] = {
1440 .name = "MSI DigiVox A/D",
1441 .valid = EM28XX_BOARD_NOT_VALIDATED,
1442 .tuner_type = TUNER_XC2028,
1443 .tuner_gpio = default_tuner_gpio,
1444 .decoder = EM28XX_TVP5150,
1445 .input = { {
1446 .type = EM28XX_VMUX_TELEVISION,
1447 .vmux = TVP5150_COMPOSITE0,
1448 .amux = EM28XX_AMUX_VIDEO,
1449 .gpio = em2880_msi_digivox_ad_analog,
1450 }, {
1451 .type = EM28XX_VMUX_COMPOSITE1,
1452 .vmux = TVP5150_COMPOSITE1,
1453 .amux = EM28XX_AMUX_LINE_IN,
1454 .gpio = em2880_msi_digivox_ad_analog,
1455 }, {
1456 .type = EM28XX_VMUX_SVIDEO,
1457 .vmux = TVP5150_SVIDEO,
1458 .amux = EM28XX_AMUX_LINE_IN,
1459 .gpio = em2880_msi_digivox_ad_analog,
1460 } },
1462 [EM2880_BOARD_MSI_DIGIVOX_AD_II] = {
1463 .name = "MSI DigiVox A/D II",
1464 .valid = EM28XX_BOARD_NOT_VALIDATED,
1465 .tuner_type = TUNER_XC2028,
1466 .tuner_gpio = default_tuner_gpio,
1467 .decoder = EM28XX_TVP5150,
1468 .input = { {
1469 .type = EM28XX_VMUX_TELEVISION,
1470 .vmux = TVP5150_COMPOSITE0,
1471 .amux = EM28XX_AMUX_VIDEO,
1472 .gpio = em2880_msi_digivox_ad_analog,
1473 }, {
1474 .type = EM28XX_VMUX_COMPOSITE1,
1475 .vmux = TVP5150_COMPOSITE1,
1476 .amux = EM28XX_AMUX_LINE_IN,
1477 .gpio = em2880_msi_digivox_ad_analog,
1478 }, {
1479 .type = EM28XX_VMUX_SVIDEO,
1480 .vmux = TVP5150_SVIDEO,
1481 .amux = EM28XX_AMUX_LINE_IN,
1482 .gpio = em2880_msi_digivox_ad_analog,
1483 } },
1485 [EM2880_BOARD_KWORLD_DVB_305U] = {
1486 .name = "KWorld DVB-T 305U",
1487 .tuner_type = TUNER_XC2028,
1488 .tuner_gpio = default_tuner_gpio,
1489 .decoder = EM28XX_TVP5150,
1490 .input = { {
1491 .type = EM28XX_VMUX_TELEVISION,
1492 .vmux = TVP5150_COMPOSITE0,
1493 .amux = EM28XX_AMUX_VIDEO,
1494 }, {
1495 .type = EM28XX_VMUX_COMPOSITE1,
1496 .vmux = TVP5150_COMPOSITE1,
1497 .amux = EM28XX_AMUX_LINE_IN,
1498 }, {
1499 .type = EM28XX_VMUX_SVIDEO,
1500 .vmux = TVP5150_SVIDEO,
1501 .amux = EM28XX_AMUX_LINE_IN,
1502 } },
1504 [EM2880_BOARD_KWORLD_DVB_310U] = {
1505 .name = "KWorld DVB-T 310U",
1506 .tuner_type = TUNER_XC2028,
1507 .tuner_gpio = default_tuner_gpio,
1508 .has_dvb = 1,
1509 .dvb_gpio = default_digital,
1510 .mts_firmware = 1,
1511 .decoder = EM28XX_TVP5150,
1512 .input = { {
1513 .type = EM28XX_VMUX_TELEVISION,
1514 .vmux = TVP5150_COMPOSITE0,
1515 .amux = EM28XX_AMUX_VIDEO,
1516 .gpio = default_analog,
1517 }, {
1518 .type = EM28XX_VMUX_COMPOSITE1,
1519 .vmux = TVP5150_COMPOSITE1,
1520 .amux = EM28XX_AMUX_LINE_IN,
1521 .gpio = default_analog,
1522 }, { /* S-video has not been tested yet */
1523 .type = EM28XX_VMUX_SVIDEO,
1524 .vmux = TVP5150_SVIDEO,
1525 .amux = EM28XX_AMUX_LINE_IN,
1526 .gpio = default_analog,
1527 } },
1529 [EM2882_BOARD_KWORLD_ATSC_315U] = {
1530 .name = "KWorld ATSC 315U HDTV TV Box",
1531 .valid = EM28XX_BOARD_NOT_VALIDATED,
1532 .tuner_type = TUNER_THOMSON_DTT761X,
1533 .tuner_gpio = em2882_kworld_315u_tuner_gpio,
1534 .tda9887_conf = TDA9887_PRESENT,
1535 .decoder = EM28XX_SAA711X,
1536 .has_dvb = 1,
1537 .dvb_gpio = em2882_kworld_315u_digital,
1538 .ir_codes = RC_MAP_KWORLD_315U,
1539 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
1540 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE,
1541 /* Analog mode - still not ready */
1542 /*.input = { {
1543 .type = EM28XX_VMUX_TELEVISION,
1544 .vmux = SAA7115_COMPOSITE2,
1545 .amux = EM28XX_AMUX_VIDEO,
1546 .gpio = em2882_kworld_315u_analog,
1547 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1548 }, {
1549 .type = EM28XX_VMUX_COMPOSITE1,
1550 .vmux = SAA7115_COMPOSITE0,
1551 .amux = EM28XX_AMUX_LINE_IN,
1552 .gpio = em2882_kworld_315u_analog1,
1553 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1554 }, {
1555 .type = EM28XX_VMUX_SVIDEO,
1556 .vmux = SAA7115_SVIDEO3,
1557 .amux = EM28XX_AMUX_LINE_IN,
1558 .gpio = em2882_kworld_315u_analog1,
1559 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1560 } }, */
1562 [EM2880_BOARD_EMPIRE_DUAL_TV] = {
1563 .name = "Empire dual TV",
1564 .tuner_type = TUNER_XC2028,
1565 .tuner_gpio = default_tuner_gpio,
1566 .has_dvb = 1,
1567 .dvb_gpio = default_digital,
1568 .mts_firmware = 1,
1569 .decoder = EM28XX_TVP5150,
1570 .input = { {
1571 .type = EM28XX_VMUX_TELEVISION,
1572 .vmux = TVP5150_COMPOSITE0,
1573 .amux = EM28XX_AMUX_VIDEO,
1574 .gpio = default_analog,
1575 }, {
1576 .type = EM28XX_VMUX_COMPOSITE1,
1577 .vmux = TVP5150_COMPOSITE1,
1578 .amux = EM28XX_AMUX_LINE_IN,
1579 .gpio = default_analog,
1580 }, {
1581 .type = EM28XX_VMUX_SVIDEO,
1582 .vmux = TVP5150_SVIDEO,
1583 .amux = EM28XX_AMUX_LINE_IN,
1584 .gpio = default_analog,
1585 } },
1587 [EM2881_BOARD_DNT_DA2_HYBRID] = {
1588 .name = "DNT DA2 Hybrid",
1589 .valid = EM28XX_BOARD_NOT_VALIDATED,
1590 .tuner_type = TUNER_XC2028,
1591 .tuner_gpio = default_tuner_gpio,
1592 .decoder = EM28XX_TVP5150,
1593 .input = { {
1594 .type = EM28XX_VMUX_TELEVISION,
1595 .vmux = TVP5150_COMPOSITE0,
1596 .amux = EM28XX_AMUX_VIDEO,
1597 .gpio = default_analog,
1598 }, {
1599 .type = EM28XX_VMUX_COMPOSITE1,
1600 .vmux = TVP5150_COMPOSITE1,
1601 .amux = EM28XX_AMUX_LINE_IN,
1602 .gpio = default_analog,
1603 }, {
1604 .type = EM28XX_VMUX_SVIDEO,
1605 .vmux = TVP5150_SVIDEO,
1606 .amux = EM28XX_AMUX_LINE_IN,
1607 .gpio = default_analog,
1608 } },
1610 [EM2881_BOARD_PINNACLE_HYBRID_PRO] = {
1611 .name = "Pinnacle Hybrid Pro",
1612 .tuner_type = TUNER_XC2028,
1613 .tuner_gpio = default_tuner_gpio,
1614 .decoder = EM28XX_TVP5150,
1615 .has_dvb = 1,
1616 .dvb_gpio = pinnacle_hybrid_pro_digital,
1617 .input = { {
1618 .type = EM28XX_VMUX_TELEVISION,
1619 .vmux = TVP5150_COMPOSITE0,
1620 .amux = EM28XX_AMUX_VIDEO,
1621 .gpio = pinnacle_hybrid_pro_analog,
1622 }, {
1623 .type = EM28XX_VMUX_COMPOSITE1,
1624 .vmux = TVP5150_COMPOSITE1,
1625 .amux = EM28XX_AMUX_LINE_IN,
1626 .gpio = pinnacle_hybrid_pro_analog,
1627 }, {
1628 .type = EM28XX_VMUX_SVIDEO,
1629 .vmux = TVP5150_SVIDEO,
1630 .amux = EM28XX_AMUX_LINE_IN,
1631 .gpio = pinnacle_hybrid_pro_analog,
1632 } },
1634 [EM2882_BOARD_PINNACLE_HYBRID_PRO_330E] = {
1635 .name = "Pinnacle Hybrid Pro (330e)",
1636 .tuner_type = TUNER_XC2028,
1637 .tuner_gpio = default_tuner_gpio,
1638 .mts_firmware = 1,
1639 .has_dvb = 1,
1640 .dvb_gpio = hauppauge_wintv_hvr_900R2_digital,
1641 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
1642 .decoder = EM28XX_TVP5150,
1643 .input = { {
1644 .type = EM28XX_VMUX_TELEVISION,
1645 .vmux = TVP5150_COMPOSITE0,
1646 .amux = EM28XX_AMUX_VIDEO,
1647 .gpio = hauppauge_wintv_hvr_900_analog,
1648 }, {
1649 .type = EM28XX_VMUX_COMPOSITE1,
1650 .vmux = TVP5150_COMPOSITE1,
1651 .amux = EM28XX_AMUX_LINE_IN,
1652 .gpio = hauppauge_wintv_hvr_900_analog,
1653 }, {
1654 .type = EM28XX_VMUX_SVIDEO,
1655 .vmux = TVP5150_SVIDEO,
1656 .amux = EM28XX_AMUX_LINE_IN,
1657 .gpio = hauppauge_wintv_hvr_900_analog,
1658 } },
1660 [EM2882_BOARD_KWORLD_VS_DVBT] = {
1661 .name = "Kworld VS-DVB-T 323UR",
1662 .tuner_type = TUNER_XC2028,
1663 .tuner_gpio = default_tuner_gpio,
1664 .decoder = EM28XX_TVP5150,
1665 .mts_firmware = 1,
1666 .has_dvb = 1,
1667 .dvb_gpio = kworld_330u_digital,
1668 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */
1669 .ir_codes = RC_MAP_KWORLD_315U,
1670 .input = { {
1671 .type = EM28XX_VMUX_TELEVISION,
1672 .vmux = TVP5150_COMPOSITE0,
1673 .amux = EM28XX_AMUX_VIDEO,
1674 }, {
1675 .type = EM28XX_VMUX_COMPOSITE1,
1676 .vmux = TVP5150_COMPOSITE1,
1677 .amux = EM28XX_AMUX_LINE_IN,
1678 }, {
1679 .type = EM28XX_VMUX_SVIDEO,
1680 .vmux = TVP5150_SVIDEO,
1681 .amux = EM28XX_AMUX_LINE_IN,
1682 } },
1684 [EM2882_BOARD_TERRATEC_HYBRID_XS] = {
1685 .name = "Terratec Cinnergy Hybrid T USB XS (em2882)",
1686 .tuner_type = TUNER_XC2028,
1687 .tuner_gpio = default_tuner_gpio,
1688 .mts_firmware = 1,
1689 .decoder = EM28XX_TVP5150,
1690 .has_dvb = 1,
1691 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
1692 .ir_codes = RC_MAP_TERRATEC_CINERGY_XS,
1693 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
1694 .input = { {
1695 .type = EM28XX_VMUX_TELEVISION,
1696 .vmux = TVP5150_COMPOSITE0,
1697 .amux = EM28XX_AMUX_VIDEO,
1698 .gpio = hauppauge_wintv_hvr_900_analog,
1699 }, {
1700 .type = EM28XX_VMUX_COMPOSITE1,
1701 .vmux = TVP5150_COMPOSITE1,
1702 .amux = EM28XX_AMUX_LINE_IN,
1703 .gpio = hauppauge_wintv_hvr_900_analog,
1704 }, {
1705 .type = EM28XX_VMUX_SVIDEO,
1706 .vmux = TVP5150_SVIDEO,
1707 .amux = EM28XX_AMUX_LINE_IN,
1708 .gpio = hauppauge_wintv_hvr_900_analog,
1709 } },
1711 [EM2882_BOARD_DIKOM_DK300] = {
1712 .name = "Dikom DK300",
1713 .tuner_type = TUNER_XC2028,
1714 .tuner_gpio = default_tuner_gpio,
1715 .decoder = EM28XX_TVP5150,
1716 .mts_firmware = 1,
1717 .has_dvb = 1,
1718 .dvb_gpio = dikom_dk300_digital,
1719 .input = { {
1720 .type = EM28XX_VMUX_TELEVISION,
1721 .vmux = TVP5150_COMPOSITE0,
1722 .amux = EM28XX_AMUX_VIDEO,
1723 .gpio = default_analog,
1724 } },
1726 [EM2883_BOARD_KWORLD_HYBRID_330U] = {
1727 .name = "Kworld PlusTV HD Hybrid 330",
1728 .tuner_type = TUNER_XC2028,
1729 .tuner_gpio = default_tuner_gpio,
1730 .decoder = EM28XX_TVP5150,
1731 .mts_firmware = 1,
1732 .has_dvb = 1,
1733 .dvb_gpio = kworld_330u_digital,
1734 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
1735 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
1736 EM28XX_I2C_EEPROM_ON_BOARD |
1737 EM28XX_I2C_EEPROM_KEY_VALID,
1738 .input = { {
1739 .type = EM28XX_VMUX_TELEVISION,
1740 .vmux = TVP5150_COMPOSITE0,
1741 .amux = EM28XX_AMUX_VIDEO,
1742 .gpio = kworld_330u_analog,
1743 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1744 }, {
1745 .type = EM28XX_VMUX_COMPOSITE1,
1746 .vmux = TVP5150_COMPOSITE1,
1747 .amux = EM28XX_AMUX_LINE_IN,
1748 .gpio = kworld_330u_analog,
1749 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1750 }, {
1751 .type = EM28XX_VMUX_SVIDEO,
1752 .vmux = TVP5150_SVIDEO,
1753 .amux = EM28XX_AMUX_LINE_IN,
1754 .gpio = kworld_330u_analog,
1755 } },
1757 [EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU] = {
1758 .name = "Compro VideoMate ForYou/Stereo",
1759 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1760 .tvaudio_addr = 0xb0,
1761 .tda9887_conf = TDA9887_PRESENT,
1762 .decoder = EM28XX_TVP5150,
1763 .adecoder = EM28XX_TVAUDIO,
1764 .mute_gpio = compro_mute_gpio,
1765 .input = { {
1766 .type = EM28XX_VMUX_TELEVISION,
1767 .vmux = TVP5150_COMPOSITE0,
1768 .amux = EM28XX_AMUX_VIDEO,
1769 .gpio = compro_unmute_tv_gpio,
1770 }, {
1771 .type = EM28XX_VMUX_SVIDEO,
1772 .vmux = TVP5150_SVIDEO,
1773 .amux = EM28XX_AMUX_LINE_IN,
1774 .gpio = compro_unmute_svid_gpio,
1775 } },
1777 [EM2860_BOARD_KAIOMY_TVNPC_U2] = {
1778 .name = "Kaiomy TVnPC U2",
1779 .vchannels = 3,
1780 .tuner_type = TUNER_XC2028,
1781 .tuner_addr = 0x61,
1782 .mts_firmware = 1,
1783 .decoder = EM28XX_TVP5150,
1784 .tuner_gpio = default_tuner_gpio,
1785 .ir_codes = RC_MAP_KAIOMY,
1786 .input = { {
1787 .type = EM28XX_VMUX_TELEVISION,
1788 .vmux = TVP5150_COMPOSITE0,
1789 .amux = EM28XX_AMUX_VIDEO,
1791 }, {
1792 .type = EM28XX_VMUX_COMPOSITE1,
1793 .vmux = TVP5150_COMPOSITE1,
1794 .amux = EM28XX_AMUX_LINE_IN,
1795 }, {
1796 .type = EM28XX_VMUX_SVIDEO,
1797 .vmux = TVP5150_SVIDEO,
1798 .amux = EM28XX_AMUX_LINE_IN,
1799 } },
1800 .radio = {
1801 .type = EM28XX_RADIO,
1802 .amux = EM28XX_AMUX_LINE_IN,
1805 [EM2860_BOARD_EASYCAP] = {
1806 .name = "Easy Cap Capture DC-60",
1807 .vchannels = 2,
1808 .tuner_type = TUNER_ABSENT,
1809 .decoder = EM28XX_SAA711X,
1810 .input = { {
1811 .type = EM28XX_VMUX_COMPOSITE1,
1812 .vmux = SAA7115_COMPOSITE0,
1813 .amux = EM28XX_AMUX_LINE_IN,
1814 }, {
1815 .type = EM28XX_VMUX_SVIDEO,
1816 .vmux = SAA7115_SVIDEO3,
1817 .amux = EM28XX_AMUX_LINE_IN,
1818 } },
1820 [EM2820_BOARD_IODATA_GVMVP_SZ] = {
1821 .name = "IO-DATA GV-MVP/SZ",
1822 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
1823 .tuner_gpio = default_tuner_gpio,
1824 .tda9887_conf = TDA9887_PRESENT,
1825 .decoder = EM28XX_TVP5150,
1826 .input = { {
1827 .type = EM28XX_VMUX_TELEVISION,
1828 .vmux = TVP5150_COMPOSITE0,
1829 .amux = EM28XX_AMUX_VIDEO,
1830 }, { /* Composite has not been tested yet */
1831 .type = EM28XX_VMUX_COMPOSITE1,
1832 .vmux = TVP5150_COMPOSITE1,
1833 .amux = EM28XX_AMUX_VIDEO,
1834 }, { /* S-video has not been tested yet */
1835 .type = EM28XX_VMUX_SVIDEO,
1836 .vmux = TVP5150_SVIDEO,
1837 .amux = EM28XX_AMUX_VIDEO,
1838 } },
1840 [EM2860_BOARD_TERRATEC_GRABBY] = {
1841 .name = "Terratec Grabby",
1842 .vchannels = 2,
1843 .tuner_type = TUNER_ABSENT,
1844 .decoder = EM28XX_SAA711X,
1845 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
1846 .input = { {
1847 .type = EM28XX_VMUX_COMPOSITE1,
1848 .vmux = SAA7115_COMPOSITE0,
1849 .amux = EM28XX_AMUX_LINE_IN,
1850 }, {
1851 .type = EM28XX_VMUX_SVIDEO,
1852 .vmux = SAA7115_SVIDEO3,
1853 .amux = EM28XX_AMUX_LINE_IN,
1854 } },
1856 [EM2860_BOARD_TERRATEC_AV350] = {
1857 .name = "Terratec AV350",
1858 .vchannels = 2,
1859 .tuner_type = TUNER_ABSENT,
1860 .decoder = EM28XX_TVP5150,
1861 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
1862 .mute_gpio = terratec_av350_mute_gpio,
1863 .input = { {
1864 .type = EM28XX_VMUX_COMPOSITE1,
1865 .vmux = TVP5150_COMPOSITE1,
1866 .amux = EM28XX_AUDIO_SRC_LINE,
1867 .gpio = terratec_av350_unmute_gpio,
1869 }, {
1870 .type = EM28XX_VMUX_SVIDEO,
1871 .vmux = TVP5150_SVIDEO,
1872 .amux = EM28XX_AUDIO_SRC_LINE,
1873 .gpio = terratec_av350_unmute_gpio,
1874 } },
1877 [EM2860_BOARD_ELGATO_VIDEO_CAPTURE] = {
1878 .name = "Elgato Video Capture",
1879 .decoder = EM28XX_SAA711X,
1880 .tuner_type = TUNER_ABSENT, /* Capture only device */
1881 .input = { {
1882 .type = EM28XX_VMUX_COMPOSITE1,
1883 .vmux = SAA7115_COMPOSITE0,
1884 .amux = EM28XX_AMUX_LINE_IN,
1885 }, {
1886 .type = EM28XX_VMUX_SVIDEO,
1887 .vmux = SAA7115_SVIDEO3,
1888 .amux = EM28XX_AMUX_LINE_IN,
1889 } },
1892 [EM2882_BOARD_EVGA_INDTUBE] = {
1893 .name = "Evga inDtube",
1894 .tuner_type = TUNER_XC2028,
1895 .tuner_gpio = default_tuner_gpio,
1896 .decoder = EM28XX_TVP5150,
1897 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */
1898 .mts_firmware = 1,
1899 .has_dvb = 1,
1900 .dvb_gpio = evga_indtube_digital,
1901 .ir_codes = RC_MAP_EVGA_INDTUBE,
1902 .input = { {
1903 .type = EM28XX_VMUX_TELEVISION,
1904 .vmux = TVP5150_COMPOSITE0,
1905 .amux = EM28XX_AMUX_VIDEO,
1906 .gpio = evga_indtube_analog,
1907 }, {
1908 .type = EM28XX_VMUX_COMPOSITE1,
1909 .vmux = TVP5150_COMPOSITE1,
1910 .amux = EM28XX_AMUX_LINE_IN,
1911 .gpio = evga_indtube_analog,
1912 }, {
1913 .type = EM28XX_VMUX_SVIDEO,
1914 .vmux = TVP5150_SVIDEO,
1915 .amux = EM28XX_AMUX_LINE_IN,
1916 .gpio = evga_indtube_analog,
1917 } },
1919 /* eb1a:2868 Empia EM2870 + Philips CU1216L NIM (Philips TDA10023 +
1920 Infineon TUA6034) */
1921 [EM2870_BOARD_REDDO_DVB_C_USB_BOX] = {
1922 .name = "Reddo DVB-C USB TV Box",
1923 .tuner_type = TUNER_ABSENT,
1924 .tuner_gpio = reddo_dvb_c_usb_box,
1925 .has_dvb = 1,
1927 /* 1b80:a340 - Empia EM2870, NXP TDA18271HD and LG DT3304, sold
1928 * initially as the KWorld PlusTV 340U, then as the UB435-Q.
1929 * Early variants have a TDA18271HD/C1, later ones a TDA18271HD/C2 */
1930 [EM2870_BOARD_KWORLD_A340] = {
1931 .name = "KWorld PlusTV 340U or UB435-Q (ATSC)",
1932 .tuner_type = TUNER_ABSENT, /* Digital-only TDA18271HD */
1933 .has_dvb = 1,
1934 .dvb_gpio = kworld_a340_digital,
1935 .tuner_gpio = default_tuner_gpio,
1937 /* 2013:024f PCTV nanoStick T2 290e.
1938 * Empia EM28174, Sony CXD2820R and NXP TDA18271HD/C2 */
1939 [EM28174_BOARD_PCTV_290E] = {
1940 .name = "PCTV nanoStick T2 290e",
1941 .def_i2c_bus = 1,
1942 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_FREQ_100_KHZ,
1943 .tuner_type = TUNER_ABSENT,
1944 .tuner_gpio = pctv_290e,
1945 .has_dvb = 1,
1946 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
1948 /* 2013:024f PCTV DVB-S2 Stick 460e
1949 * Empia EM28174, NXP TDA10071, Conexant CX24118A and Allegro A8293 */
1950 [EM28174_BOARD_PCTV_460E] = {
1951 .def_i2c_bus = 1,
1952 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_FREQ_400_KHZ,
1953 .name = "PCTV DVB-S2 Stick (460e)",
1954 .tuner_type = TUNER_ABSENT,
1955 .tuner_gpio = pctv_460e,
1956 .has_dvb = 1,
1957 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
1959 /* eb1a:5006 Honestech VIDBOX NW03
1960 * Empia EM2860, Philips SAA7113, Empia EMP202, No Tuner */
1961 [EM2860_BOARD_HT_VIDBOX_NW03] = {
1962 .name = "Honestech Vidbox NW03",
1963 .tuner_type = TUNER_ABSENT,
1964 .decoder = EM28XX_SAA711X,
1965 .input = { {
1966 .type = EM28XX_VMUX_COMPOSITE1,
1967 .vmux = SAA7115_COMPOSITE0,
1968 .amux = EM28XX_AMUX_LINE_IN,
1969 }, {
1970 .type = EM28XX_VMUX_SVIDEO,
1971 .vmux = SAA7115_SVIDEO3, /* S-VIDEO needs confirming */
1972 .amux = EM28XX_AMUX_LINE_IN,
1973 } },
1975 /* 1b80:e425 MaxMedia UB425-TC
1976 * Empia EM2874B + Micronas DRX 3913KA2 + NXP TDA18271HDC2 */
1977 [EM2874_BOARD_MAXMEDIA_UB425_TC] = {
1978 .name = "MaxMedia UB425-TC",
1979 .tuner_type = TUNER_ABSENT,
1980 .tuner_gpio = maxmedia_ub425_tc,
1981 .has_dvb = 1,
1982 .ir_codes = RC_MAP_REDDO,
1983 .def_i2c_bus = 1,
1984 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
1985 EM28XX_I2C_FREQ_400_KHZ,
1987 /* 2304:0242 PCTV QuatroStick (510e)
1988 * Empia EM2884 + Micronas DRX 3926K + NXP TDA18271HDC2 */
1989 [EM2884_BOARD_PCTV_510E] = {
1990 .name = "PCTV QuatroStick (510e)",
1991 .tuner_type = TUNER_ABSENT,
1992 .tuner_gpio = pctv_510e,
1993 .has_dvb = 1,
1994 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
1995 .def_i2c_bus = 1,
1996 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
1997 EM28XX_I2C_FREQ_400_KHZ,
1999 /* 2013:0251 PCTV QuatroStick nano (520e)
2000 * Empia EM2884 + Micronas DRX 3926K + NXP TDA18271HDC2 */
2001 [EM2884_BOARD_PCTV_520E] = {
2002 .name = "PCTV QuatroStick nano (520e)",
2003 .tuner_type = TUNER_ABSENT,
2004 .tuner_gpio = pctv_520e,
2005 .has_dvb = 1,
2006 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
2007 .def_i2c_bus = 1,
2008 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
2009 EM28XX_I2C_FREQ_400_KHZ,
2011 [EM2884_BOARD_TERRATEC_HTC_USB_XS] = {
2012 .name = "Terratec Cinergy HTC USB XS",
2013 .has_dvb = 1,
2014 .ir_codes = RC_MAP_NEC_TERRATEC_CINERGY_XS,
2015 .tuner_type = TUNER_ABSENT,
2016 .def_i2c_bus = 1,
2017 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
2018 EM28XX_I2C_FREQ_400_KHZ,
2020 /* 1b80:e1cc Delock 61959
2021 * Empia EM2874B + Micronas DRX 3913KA2 + NXP TDA18271HDC2
2022 * mostly the same as MaxMedia UB-425-TC but different remote */
2023 [EM2874_BOARD_DELOCK_61959] = {
2024 .name = "Delock 61959",
2025 .tuner_type = TUNER_ABSENT,
2026 .tuner_gpio = maxmedia_ub425_tc,
2027 .has_dvb = 1,
2028 .ir_codes = RC_MAP_DELOCK_61959,
2029 .def_i2c_bus = 1,
2030 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
2031 EM28XX_I2C_FREQ_400_KHZ,
2034 const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards);
2036 /* table of devices that work with this driver */
2037 struct usb_device_id em28xx_id_table[] = {
2038 { USB_DEVICE(0xeb1a, 0x2750),
2039 .driver_info = EM2750_BOARD_UNKNOWN },
2040 { USB_DEVICE(0xeb1a, 0x2751),
2041 .driver_info = EM2750_BOARD_UNKNOWN },
2042 { USB_DEVICE(0xeb1a, 0x2800),
2043 .driver_info = EM2800_BOARD_UNKNOWN },
2044 { USB_DEVICE(0xeb1a, 0x2710),
2045 .driver_info = EM2820_BOARD_UNKNOWN },
2046 { USB_DEVICE(0xeb1a, 0x2820),
2047 .driver_info = EM2820_BOARD_UNKNOWN },
2048 { USB_DEVICE(0xeb1a, 0x2821),
2049 .driver_info = EM2820_BOARD_UNKNOWN },
2050 { USB_DEVICE(0xeb1a, 0x2860),
2051 .driver_info = EM2820_BOARD_UNKNOWN },
2052 { USB_DEVICE(0xeb1a, 0x2861),
2053 .driver_info = EM2820_BOARD_UNKNOWN },
2054 { USB_DEVICE(0xeb1a, 0x2862),
2055 .driver_info = EM2820_BOARD_UNKNOWN },
2056 { USB_DEVICE(0xeb1a, 0x2863),
2057 .driver_info = EM2820_BOARD_UNKNOWN },
2058 { USB_DEVICE(0xeb1a, 0x2870),
2059 .driver_info = EM2820_BOARD_UNKNOWN },
2060 { USB_DEVICE(0xeb1a, 0x2881),
2061 .driver_info = EM2820_BOARD_UNKNOWN },
2062 { USB_DEVICE(0xeb1a, 0x2883),
2063 .driver_info = EM2820_BOARD_UNKNOWN },
2064 { USB_DEVICE(0xeb1a, 0x2868),
2065 .driver_info = EM2820_BOARD_UNKNOWN },
2066 { USB_DEVICE(0xeb1a, 0x2875),
2067 .driver_info = EM2820_BOARD_UNKNOWN },
2068 { USB_DEVICE(0xeb1a, 0xe300),
2069 .driver_info = EM2861_BOARD_KWORLD_PVRTV_300U },
2070 { USB_DEVICE(0xeb1a, 0xe303),
2071 .driver_info = EM2860_BOARD_KAIOMY_TVNPC_U2 },
2072 { USB_DEVICE(0xeb1a, 0xe305),
2073 .driver_info = EM2880_BOARD_KWORLD_DVB_305U },
2074 { USB_DEVICE(0xeb1a, 0xe310),
2075 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD },
2076 { USB_DEVICE(0xeb1a, 0xa313),
2077 .driver_info = EM2882_BOARD_KWORLD_ATSC_315U },
2078 { USB_DEVICE(0xeb1a, 0xa316),
2079 .driver_info = EM2883_BOARD_KWORLD_HYBRID_330U },
2080 { USB_DEVICE(0xeb1a, 0xe320),
2081 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD_II },
2082 { USB_DEVICE(0xeb1a, 0xe323),
2083 .driver_info = EM2882_BOARD_KWORLD_VS_DVBT },
2084 { USB_DEVICE(0xeb1a, 0xe350),
2085 .driver_info = EM2870_BOARD_KWORLD_350U },
2086 { USB_DEVICE(0xeb1a, 0xe355),
2087 .driver_info = EM2870_BOARD_KWORLD_355U },
2088 { USB_DEVICE(0xeb1a, 0x2801),
2089 .driver_info = EM2800_BOARD_GRABBEEX_USB2800 },
2090 { USB_DEVICE(0xeb1a, 0xe357),
2091 .driver_info = EM2870_BOARD_KWORLD_355U },
2092 { USB_DEVICE(0xeb1a, 0xe359),
2093 .driver_info = EM2870_BOARD_KWORLD_355U },
2094 { USB_DEVICE(0x1b80, 0xe302),
2095 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, /* Kaiser Baas Video to DVD maker */
2096 { USB_DEVICE(0x1b80, 0xe304),
2097 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, /* Kworld DVD Maker 2 */
2098 { USB_DEVICE(0x0ccd, 0x0036),
2099 .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 },
2100 { USB_DEVICE(0x0ccd, 0x004c),
2101 .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS_FR },
2102 { USB_DEVICE(0x0ccd, 0x004f),
2103 .driver_info = EM2860_BOARD_TERRATEC_HYBRID_XS },
2104 { USB_DEVICE(0x0ccd, 0x005e),
2105 .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS },
2106 { USB_DEVICE(0x0ccd, 0x0042),
2107 .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS },
2108 { USB_DEVICE(0x0ccd, 0x0043),
2109 .driver_info = EM2870_BOARD_TERRATEC_XS },
2110 { USB_DEVICE(0x0ccd, 0x008e), /* Cinergy HTC USB XS Rev. 1 */
2111 .driver_info = EM2884_BOARD_TERRATEC_HTC_USB_XS },
2112 { USB_DEVICE(0x0ccd, 0x00ac), /* Cinergy HTC USB XS Rev. 2 */
2113 .driver_info = EM2884_BOARD_TERRATEC_HTC_USB_XS },
2114 { USB_DEVICE(0x0ccd, 0x10a2), /* H5 Rev. 1 */
2115 .driver_info = EM2884_BOARD_TERRATEC_H5 },
2116 { USB_DEVICE(0x0ccd, 0x10ad), /* H5 Rev. 2 */
2117 .driver_info = EM2884_BOARD_TERRATEC_H5 },
2118 { USB_DEVICE(0x0ccd, 0x10b6), /* H5 Rev. 3 */
2119 .driver_info = EM2884_BOARD_TERRATEC_H5 },
2120 { USB_DEVICE(0x0ccd, 0x0084),
2121 .driver_info = EM2860_BOARD_TERRATEC_AV350 },
2122 { USB_DEVICE(0x0ccd, 0x0096),
2123 .driver_info = EM2860_BOARD_TERRATEC_GRABBY },
2124 { USB_DEVICE(0x0ccd, 0x10AF),
2125 .driver_info = EM2860_BOARD_TERRATEC_GRABBY },
2126 { USB_DEVICE(0x0ccd, 0x00b2),
2127 .driver_info = EM2884_BOARD_CINERGY_HTC_STICK },
2128 { USB_DEVICE(0x0fd9, 0x0033),
2129 .driver_info = EM2860_BOARD_ELGATO_VIDEO_CAPTURE},
2130 { USB_DEVICE(0x185b, 0x2870),
2131 .driver_info = EM2870_BOARD_COMPRO_VIDEOMATE },
2132 { USB_DEVICE(0x185b, 0x2041),
2133 .driver_info = EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU },
2134 { USB_DEVICE(0x2040, 0x4200),
2135 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
2136 { USB_DEVICE(0x2040, 0x4201),
2137 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
2138 { USB_DEVICE(0x2040, 0x6500),
2139 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 },
2140 { USB_DEVICE(0x2040, 0x6502),
2141 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2 },
2142 { USB_DEVICE(0x2040, 0x6513), /* HCW HVR-980 */
2143 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
2144 { USB_DEVICE(0x2040, 0x6517), /* HP HVR-950 */
2145 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
2146 { USB_DEVICE(0x2040, 0x651b), /* RP HVR-950 */
2147 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
2148 { USB_DEVICE(0x2040, 0x651f),
2149 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850 },
2150 { USB_DEVICE(0x0438, 0xb002),
2151 .driver_info = EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600 },
2152 { USB_DEVICE(0x2001, 0xf112),
2153 .driver_info = EM2820_BOARD_DLINK_USB_TV },
2154 { USB_DEVICE(0x2304, 0x0207),
2155 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
2156 { USB_DEVICE(0x2304, 0x0208),
2157 .driver_info = EM2820_BOARD_PINNACLE_USB_2 },
2158 { USB_DEVICE(0x2304, 0x021a),
2159 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
2160 { USB_DEVICE(0x2304, 0x0226),
2161 .driver_info = EM2882_BOARD_PINNACLE_HYBRID_PRO_330E },
2162 { USB_DEVICE(0x2304, 0x0227),
2163 .driver_info = EM2880_BOARD_PINNACLE_PCTV_HD_PRO },
2164 { USB_DEVICE(0x0413, 0x6023),
2165 .driver_info = EM2800_BOARD_LEADTEK_WINFAST_USBII },
2166 { USB_DEVICE(0x093b, 0xa003),
2167 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
2168 { USB_DEVICE(0x093b, 0xa005),
2169 .driver_info = EM2861_BOARD_PLEXTOR_PX_TV100U },
2170 { USB_DEVICE(0x04bb, 0x0515),
2171 .driver_info = EM2820_BOARD_IODATA_GVMVP_SZ },
2172 { USB_DEVICE(0xeb1a, 0x50a6),
2173 .driver_info = EM2860_BOARD_GADMEI_UTV330 },
2174 { USB_DEVICE(0x1b80, 0xa340),
2175 .driver_info = EM2870_BOARD_KWORLD_A340 },
2176 { USB_DEVICE(0x2013, 0x024f),
2177 .driver_info = EM28174_BOARD_PCTV_290E },
2178 { USB_DEVICE(0x2013, 0x024c),
2179 .driver_info = EM28174_BOARD_PCTV_460E },
2180 { USB_DEVICE(0x2040, 0x1605),
2181 .driver_info = EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C },
2182 { USB_DEVICE(0x1b80, 0xe755),
2183 .driver_info = EM2884_BOARD_C3TECH_DIGITAL_DUO },
2184 { USB_DEVICE(0xeb1a, 0x5006),
2185 .driver_info = EM2860_BOARD_HT_VIDBOX_NW03 },
2186 { USB_DEVICE(0x1b80, 0xe309), /* Sveon STV40 */
2187 .driver_info = EM2860_BOARD_EASYCAP },
2188 { USB_DEVICE(0x1b80, 0xe425),
2189 .driver_info = EM2874_BOARD_MAXMEDIA_UB425_TC },
2190 { USB_DEVICE(0x2304, 0x0242),
2191 .driver_info = EM2884_BOARD_PCTV_510E },
2192 { USB_DEVICE(0x2013, 0x0251),
2193 .driver_info = EM2884_BOARD_PCTV_520E },
2194 { USB_DEVICE(0x1b80, 0xe1cc),
2195 .driver_info = EM2874_BOARD_DELOCK_61959 },
2196 { },
2198 MODULE_DEVICE_TABLE(usb, em28xx_id_table);
2201 * EEPROM hash table for devices with generic USB IDs
2203 static struct em28xx_hash_table em28xx_eeprom_hash[] = {
2204 /* P/N: SA 60002070465 Tuner: TVF7533-MF */
2205 {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF},
2206 {0x72cc5a8b, EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2, TUNER_YMEC_TVF_5533MF},
2207 {0x966a0441, EM2880_BOARD_KWORLD_DVB_310U, TUNER_XC2028},
2208 {0x166a0441, EM2880_BOARD_EMPIRE_DUAL_TV, TUNER_XC2028},
2209 {0xcee44a99, EM2882_BOARD_EVGA_INDTUBE, TUNER_XC2028},
2210 {0xb8846b20, EM2881_BOARD_PINNACLE_HYBRID_PRO, TUNER_XC2028},
2211 {0x63f653bd, EM2870_BOARD_REDDO_DVB_C_USB_BOX, TUNER_ABSENT},
2212 {0x4e913442, EM2882_BOARD_DIKOM_DK300, TUNER_XC2028},
2215 /* I2C devicelist hash table for devices with generic USB IDs */
2216 static struct em28xx_hash_table em28xx_i2c_hash[] = {
2217 {0xb06a32c3, EM2800_BOARD_TERRATEC_CINERGY_200, TUNER_LG_PAL_NEW_TAPC},
2218 {0xf51200e3, EM2800_BOARD_VGEAR_POCKETTV, TUNER_LG_PAL_NEW_TAPC},
2219 {0x1ba50080, EM2860_BOARD_SAA711X_REFERENCE_DESIGN, TUNER_ABSENT},
2220 {0x77800080, EM2860_BOARD_TVP5150_REFERENCE_DESIGN, TUNER_ABSENT},
2221 {0xc51200e3, EM2820_BOARD_GADMEI_TVR200, TUNER_LG_PAL_NEW_TAPC},
2222 {0x4ba50080, EM2861_BOARD_GADMEI_UTV330PLUS, TUNER_TNF_5335MF},
2223 {0x6b800080, EM2874_BOARD_LEADERSHIP_ISDBT, TUNER_ABSENT},
2225 /* NOTE: introduce a separate hash table for devices with 16 bit eeproms */
2227 /* I2C possible address to saa7115, tvp5150, msp3400, tvaudio */
2228 static unsigned short saa711x_addrs[] = {
2229 0x4a >> 1, 0x48 >> 1, /* SAA7111, SAA7111A and SAA7113 */
2230 0x42 >> 1, 0x40 >> 1, /* SAA7114, SAA7115 and SAA7118 */
2231 I2C_CLIENT_END };
2233 static unsigned short tvp5150_addrs[] = {
2234 0xb8 >> 1,
2235 0xba >> 1,
2236 I2C_CLIENT_END
2239 static unsigned short msp3400_addrs[] = {
2240 0x80 >> 1,
2241 0x88 >> 1,
2242 I2C_CLIENT_END
2245 int em28xx_tuner_callback(void *ptr, int component, int command, int arg)
2247 struct em28xx_i2c_bus *i2c_bus = ptr;
2248 struct em28xx *dev = i2c_bus->dev;
2249 int rc = 0;
2251 if (dev->tuner_type != TUNER_XC2028 && dev->tuner_type != TUNER_XC5000)
2252 return 0;
2254 if (command != XC2028_TUNER_RESET && command != XC5000_TUNER_RESET)
2255 return 0;
2257 rc = em28xx_gpio_set(dev, dev->board.tuner_gpio);
2259 return rc;
2261 EXPORT_SYMBOL_GPL(em28xx_tuner_callback);
2263 static inline void em28xx_set_model(struct em28xx *dev)
2265 dev->board = em28xx_boards[dev->model];
2267 /* Those are the default values for the majority of boards
2268 Use those values if not specified otherwise at boards entry
2270 if (!dev->board.xclk)
2271 dev->board.xclk = EM28XX_XCLK_IR_RC5_MODE |
2272 EM28XX_XCLK_FREQUENCY_12MHZ;
2274 if (!dev->board.i2c_speed)
2275 dev->board.i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
2276 EM28XX_I2C_FREQ_100_KHZ;
2278 /* Should be initialized early, for I2C to work */
2279 dev->def_i2c_bus = dev->board.def_i2c_bus;
2282 /* Since em28xx_pre_card_setup() requires a proper dev->model,
2283 * this won't work for boards with generic PCI IDs
2285 static void em28xx_pre_card_setup(struct em28xx *dev)
2287 /* Set the initial XCLK and I2C clock values based on the board
2288 definition */
2289 em28xx_write_reg(dev, EM28XX_R0F_XCLK, dev->board.xclk & 0x7f);
2290 if (!dev->board.is_em2800)
2291 em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed);
2292 msleep(50);
2294 /* request some modules */
2295 switch (dev->model) {
2296 case EM2861_BOARD_PLEXTOR_PX_TV100U:
2297 /* Sets the msp34xx I2S speed */
2298 dev->i2s_speed = 2048000;
2299 break;
2300 case EM2861_BOARD_KWORLD_PVRTV_300U:
2301 case EM2880_BOARD_KWORLD_DVB_305U:
2302 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0x6d);
2303 msleep(10);
2304 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0x7d);
2305 msleep(10);
2306 break;
2307 case EM2870_BOARD_COMPRO_VIDEOMATE:
2308 /* TODO: someone can do some cleanup here...
2309 not everything's needed */
2310 em28xx_write_reg(dev, EM2880_R04_GPO, 0x00);
2311 msleep(10);
2312 em28xx_write_reg(dev, EM2880_R04_GPO, 0x01);
2313 msleep(10);
2314 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfd);
2315 mdelay(70);
2316 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfc);
2317 mdelay(70);
2318 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xdc);
2319 mdelay(70);
2320 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfc);
2321 mdelay(70);
2322 break;
2323 case EM2870_BOARD_TERRATEC_XS_MT2060:
2324 /* this device needs some gpio writes to get the DVB-T
2325 demod work */
2326 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfe);
2327 mdelay(70);
2328 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xde);
2329 mdelay(70);
2330 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfe);
2331 mdelay(70);
2332 break;
2333 case EM2870_BOARD_PINNACLE_PCTV_DVB:
2334 /* this device needs some gpio writes to get the
2335 DVB-T demod work */
2336 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfe);
2337 mdelay(70);
2338 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xde);
2339 mdelay(70);
2340 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfe);
2341 mdelay(70);
2342 break;
2343 case EM2820_BOARD_GADMEI_UTV310:
2344 case EM2820_BOARD_MSI_VOX_USB_2:
2345 /* enables audio for that devices */
2346 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfd);
2347 break;
2349 case EM2882_BOARD_KWORLD_ATSC_315U:
2350 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xff);
2351 msleep(10);
2352 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfe);
2353 msleep(10);
2354 em28xx_write_reg(dev, EM2880_R04_GPO, 0x00);
2355 msleep(10);
2356 em28xx_write_reg(dev, EM2880_R04_GPO, 0x08);
2357 msleep(10);
2358 break;
2360 case EM2860_BOARD_KAIOMY_TVNPC_U2:
2361 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x07", 1);
2362 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
2363 em28xx_write_regs(dev, 0x0d, "\x42", 1);
2364 em28xx_write_regs(dev, 0x08, "\xfd", 1);
2365 msleep(10);
2366 em28xx_write_regs(dev, 0x08, "\xff", 1);
2367 msleep(10);
2368 em28xx_write_regs(dev, 0x08, "\x7f", 1);
2369 msleep(10);
2370 em28xx_write_regs(dev, 0x08, "\x6b", 1);
2372 break;
2373 case EM2860_BOARD_EASYCAP:
2374 em28xx_write_regs(dev, 0x08, "\xf8", 1);
2375 break;
2377 case EM2820_BOARD_IODATA_GVMVP_SZ:
2378 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xff);
2379 msleep(70);
2380 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xf7);
2381 msleep(10);
2382 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfe);
2383 msleep(70);
2384 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfd);
2385 msleep(70);
2386 break;
2389 em28xx_gpio_set(dev, dev->board.tuner_gpio);
2390 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
2392 /* Unlock device */
2393 em28xx_set_mode(dev, EM28XX_SUSPEND);
2396 static void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl)
2398 memset(ctl, 0, sizeof(*ctl));
2400 ctl->fname = XC2028_DEFAULT_FIRMWARE;
2401 ctl->max_len = 64;
2402 ctl->mts = em28xx_boards[dev->model].mts_firmware;
2404 switch (dev->model) {
2405 case EM2880_BOARD_EMPIRE_DUAL_TV:
2406 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
2407 case EM2882_BOARD_TERRATEC_HYBRID_XS:
2408 ctl->demod = XC3028_FE_ZARLINK456;
2409 break;
2410 case EM2880_BOARD_TERRATEC_HYBRID_XS:
2411 case EM2880_BOARD_TERRATEC_HYBRID_XS_FR:
2412 case EM2881_BOARD_PINNACLE_HYBRID_PRO:
2413 ctl->demod = XC3028_FE_ZARLINK456;
2414 break;
2415 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
2416 case EM2882_BOARD_PINNACLE_HYBRID_PRO_330E:
2417 ctl->demod = XC3028_FE_DEFAULT;
2418 break;
2419 case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600:
2420 ctl->demod = XC3028_FE_DEFAULT;
2421 ctl->fname = XC3028L_DEFAULT_FIRMWARE;
2422 break;
2423 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850:
2424 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
2425 case EM2880_BOARD_PINNACLE_PCTV_HD_PRO:
2426 /* FIXME: Better to specify the needed IF */
2427 ctl->demod = XC3028_FE_DEFAULT;
2428 break;
2429 case EM2883_BOARD_KWORLD_HYBRID_330U:
2430 case EM2882_BOARD_DIKOM_DK300:
2431 case EM2882_BOARD_KWORLD_VS_DVBT:
2432 ctl->demod = XC3028_FE_CHINA;
2433 ctl->fname = XC2028_DEFAULT_FIRMWARE;
2434 break;
2435 case EM2882_BOARD_EVGA_INDTUBE:
2436 ctl->demod = XC3028_FE_CHINA;
2437 ctl->fname = XC3028L_DEFAULT_FIRMWARE;
2438 break;
2439 default:
2440 ctl->demod = XC3028_FE_OREN538;
2444 static void em28xx_tuner_setup(struct em28xx *dev)
2446 struct tuner_setup tun_setup;
2447 struct v4l2_frequency f;
2449 if (dev->tuner_type == TUNER_ABSENT)
2450 return;
2452 memset(&tun_setup, 0, sizeof(tun_setup));
2454 tun_setup.mode_mask = T_ANALOG_TV | T_RADIO;
2455 tun_setup.tuner_callback = em28xx_tuner_callback;
2457 if (dev->board.radio.type) {
2458 tun_setup.type = dev->board.radio.type;
2459 tun_setup.addr = dev->board.radio_addr;
2461 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_type_addr, &tun_setup);
2464 if ((dev->tuner_type != TUNER_ABSENT) && (dev->tuner_type)) {
2465 tun_setup.type = dev->tuner_type;
2466 tun_setup.addr = dev->tuner_addr;
2468 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_type_addr, &tun_setup);
2471 if (dev->tda9887_conf) {
2472 struct v4l2_priv_tun_config tda9887_cfg;
2474 tda9887_cfg.tuner = TUNER_TDA9887;
2475 tda9887_cfg.priv = &dev->tda9887_conf;
2477 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_config, &tda9887_cfg);
2480 if (dev->tuner_type == TUNER_XC2028) {
2481 struct v4l2_priv_tun_config xc2028_cfg;
2482 struct xc2028_ctrl ctl;
2484 memset(&xc2028_cfg, 0, sizeof(xc2028_cfg));
2485 memset(&ctl, 0, sizeof(ctl));
2487 em28xx_setup_xc3028(dev, &ctl);
2489 xc2028_cfg.tuner = TUNER_XC2028;
2490 xc2028_cfg.priv = &ctl;
2492 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_config, &xc2028_cfg);
2495 /* configure tuner */
2496 f.tuner = 0;
2497 f.type = V4L2_TUNER_ANALOG_TV;
2498 f.frequency = 9076; /* just a magic number */
2499 dev->ctl_freq = f.frequency;
2500 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f);
2503 static int em28xx_hint_board(struct em28xx *dev)
2505 int i;
2507 if (dev->board.is_webcam) {
2508 if (dev->em28xx_sensor == EM28XX_MT9V011) {
2509 dev->model = EM2820_BOARD_SILVERCREST_WEBCAM;
2510 } else if (dev->em28xx_sensor == EM28XX_MT9M001 ||
2511 dev->em28xx_sensor == EM28XX_MT9M111) {
2512 dev->model = EM2750_BOARD_UNKNOWN;
2514 /* FIXME: IMPROVE ! */
2516 return 0;
2519 /* HINT method: EEPROM
2521 * This method works only for boards with eeprom.
2522 * Uses a hash of all eeprom bytes. The hash should be
2523 * unique for a vendor/tuner pair.
2524 * There are a high chance that tuners for different
2525 * video standards produce different hashes.
2527 for (i = 0; i < ARRAY_SIZE(em28xx_eeprom_hash); i++) {
2528 if (dev->hash == em28xx_eeprom_hash[i].hash) {
2529 dev->model = em28xx_eeprom_hash[i].model;
2530 dev->tuner_type = em28xx_eeprom_hash[i].tuner;
2532 em28xx_errdev("Your board has no unique USB ID.\n");
2533 em28xx_errdev("A hint were successfully done, "
2534 "based on eeprom hash.\n");
2535 em28xx_errdev("This method is not 100%% failproof.\n");
2536 em28xx_errdev("If the board were missdetected, "
2537 "please email this log to:\n");
2538 em28xx_errdev("\tV4L Mailing List "
2539 " <linux-media@vger.kernel.org>\n");
2540 em28xx_errdev("Board detected as %s\n",
2541 em28xx_boards[dev->model].name);
2543 return 0;
2547 /* HINT method: I2C attached devices
2549 * This method works for all boards.
2550 * Uses a hash of i2c scanned devices.
2551 * Devices with the same i2c attached chips will
2552 * be considered equal.
2553 * This method is less precise than the eeprom one.
2556 /* user did not request i2c scanning => do it now */
2557 if (!dev->i2c_hash)
2558 em28xx_do_i2c_scan(dev, dev->def_i2c_bus);
2560 for (i = 0; i < ARRAY_SIZE(em28xx_i2c_hash); i++) {
2561 if (dev->i2c_hash == em28xx_i2c_hash[i].hash) {
2562 dev->model = em28xx_i2c_hash[i].model;
2563 dev->tuner_type = em28xx_i2c_hash[i].tuner;
2564 em28xx_errdev("Your board has no unique USB ID.\n");
2565 em28xx_errdev("A hint were successfully done, "
2566 "based on i2c devicelist hash.\n");
2567 em28xx_errdev("This method is not 100%% failproof.\n");
2568 em28xx_errdev("If the board were missdetected, "
2569 "please email this log to:\n");
2570 em28xx_errdev("\tV4L Mailing List "
2571 " <linux-media@vger.kernel.org>\n");
2572 em28xx_errdev("Board detected as %s\n",
2573 em28xx_boards[dev->model].name);
2575 return 0;
2579 em28xx_errdev("Your board has no unique USB ID and thus need a "
2580 "hint to be detected.\n");
2581 em28xx_errdev("You may try to use card=<n> insmod option to "
2582 "workaround that.\n");
2583 em28xx_errdev("Please send an email with this log to:\n");
2584 em28xx_errdev("\tV4L Mailing List <linux-media@vger.kernel.org>\n");
2585 em28xx_errdev("Board eeprom hash is 0x%08lx\n", dev->hash);
2586 em28xx_errdev("Board i2c devicelist hash is 0x%08lx\n", dev->i2c_hash);
2588 em28xx_errdev("Here is a list of valid choices for the card=<n>"
2589 " insmod option:\n");
2590 for (i = 0; i < em28xx_bcount; i++) {
2591 em28xx_errdev(" card=%d -> %s\n",
2592 i, em28xx_boards[i].name);
2594 return -1;
2597 static void em28xx_card_setup(struct em28xx *dev)
2600 * If the device can be a webcam, seek for a sensor.
2601 * If sensor is not found, then it isn't a webcam.
2603 if (dev->board.is_webcam) {
2604 if (em28xx_detect_sensor(dev) < 0)
2605 dev->board.is_webcam = 0;
2606 else
2607 dev->progressive = 1;
2610 switch (dev->model) {
2611 case EM2750_BOARD_UNKNOWN:
2612 case EM2820_BOARD_UNKNOWN:
2613 case EM2800_BOARD_UNKNOWN:
2615 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD.
2617 * This occurs because they share identical USB vendor and
2618 * product IDs.
2620 * What we do here is look up the EEPROM hash of the K-WORLD
2621 * and if it is found then we decide that we do not have
2622 * a DIGIVOX and reset the device to the K-WORLD instead.
2624 * This solution is only valid if they do not share eeprom
2625 * hash identities which has not been determined as yet.
2627 if (em28xx_hint_board(dev) < 0)
2628 em28xx_errdev("Board not discovered\n");
2629 else {
2630 em28xx_set_model(dev);
2631 em28xx_pre_card_setup(dev);
2633 break;
2634 default:
2635 em28xx_set_model(dev);
2638 em28xx_info("Identified as %s (card=%d)\n",
2639 dev->board.name, dev->model);
2641 dev->tuner_type = em28xx_boards[dev->model].tuner_type;
2642 if (em28xx_boards[dev->model].tuner_addr)
2643 dev->tuner_addr = em28xx_boards[dev->model].tuner_addr;
2645 if (em28xx_boards[dev->model].tda9887_conf)
2646 dev->tda9887_conf = em28xx_boards[dev->model].tda9887_conf;
2648 /* request some modules */
2649 switch (dev->model) {
2650 case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2:
2651 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
2652 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
2653 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850:
2654 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
2655 case EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C:
2657 struct tveeprom tv;
2659 if (dev->eedata == NULL)
2660 break;
2661 #if defined(CONFIG_MODULES) && defined(MODULE)
2662 request_module("tveeprom");
2663 #endif
2664 /* Call first TVeeprom */
2666 dev->i2c_client[dev->def_i2c_bus].addr = 0xa0 >> 1;
2667 tveeprom_hauppauge_analog(&dev->i2c_client[dev->def_i2c_bus], &tv, dev->eedata);
2669 dev->tuner_type = tv.tuner_type;
2671 if (tv.audio_processor == TVEEPROM_AUDPROC_MSP) {
2672 dev->i2s_speed = 2048000;
2673 dev->board.has_msp34xx = 1;
2675 break;
2677 case EM2882_BOARD_KWORLD_ATSC_315U:
2678 em28xx_write_reg(dev, 0x0d, 0x42);
2679 msleep(10);
2680 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfd);
2681 msleep(10);
2682 break;
2683 case EM2820_BOARD_KWORLD_PVRTV2800RF:
2684 /* GPIO enables sound on KWORLD PVR TV 2800RF */
2685 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xf9);
2686 break;
2687 case EM2820_BOARD_UNKNOWN:
2688 case EM2800_BOARD_UNKNOWN:
2690 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD.
2692 * This occurs because they share identical USB vendor and
2693 * product IDs.
2695 * What we do here is look up the EEPROM hash of the K-WORLD
2696 * and if it is found then we decide that we do not have
2697 * a DIGIVOX and reset the device to the K-WORLD instead.
2699 * This solution is only valid if they do not share eeprom
2700 * hash identities which has not been determined as yet.
2702 case EM2880_BOARD_MSI_DIGIVOX_AD:
2703 if (!em28xx_hint_board(dev))
2704 em28xx_set_model(dev);
2706 /* In cases where we had to use a board hint, the call to
2707 em28xx_set_mode() in em28xx_pre_card_setup() was a no-op,
2708 so make the call now so the analog GPIOs are set properly
2709 before probing the i2c bus. */
2710 em28xx_gpio_set(dev, dev->board.tuner_gpio);
2711 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
2712 break;
2715 * The Dikom DK300 is detected as an Kworld VS-DVB-T 323UR.
2717 * This occurs because they share identical USB vendor and
2718 * product IDs.
2720 * What we do here is look up the EEPROM hash of the Dikom
2721 * and if it is found then we decide that we do not have
2722 * a Kworld and reset the device to the Dikom instead.
2724 * This solution is only valid if they do not share eeprom
2725 * hash identities which has not been determined as yet.
2727 case EM2882_BOARD_KWORLD_VS_DVBT:
2728 if (!em28xx_hint_board(dev))
2729 em28xx_set_model(dev);
2731 /* In cases where we had to use a board hint, the call to
2732 em28xx_set_mode() in em28xx_pre_card_setup() was a no-op,
2733 so make the call now so the analog GPIOs are set properly
2734 before probing the i2c bus. */
2735 em28xx_gpio_set(dev, dev->board.tuner_gpio);
2736 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
2737 break;
2740 if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) {
2741 em28xx_errdev("\n\n");
2742 em28xx_errdev("The support for this board weren't "
2743 "valid yet.\n");
2744 em28xx_errdev("Please send a report of having this working\n");
2745 em28xx_errdev("not to V4L mailing list (and/or to other "
2746 "addresses)\n\n");
2749 /* Free eeprom data memory */
2750 kfree(dev->eedata);
2751 dev->eedata = NULL;
2753 /* Allow override tuner type by a module parameter */
2754 if (tuner >= 0)
2755 dev->tuner_type = tuner;
2757 /* request some modules */
2758 if (dev->board.has_msp34xx)
2759 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap[dev->def_i2c_bus],
2760 "msp3400", 0, msp3400_addrs);
2762 if (dev->board.decoder == EM28XX_SAA711X)
2763 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap[dev->def_i2c_bus],
2764 "saa7115_auto", 0, saa711x_addrs);
2766 if (dev->board.decoder == EM28XX_TVP5150)
2767 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap[dev->def_i2c_bus],
2768 "tvp5150", 0, tvp5150_addrs);
2770 if (dev->board.adecoder == EM28XX_TVAUDIO)
2771 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap[dev->def_i2c_bus],
2772 "tvaudio", dev->board.tvaudio_addr, NULL);
2774 if (dev->board.tuner_type != TUNER_ABSENT) {
2775 int has_demod = (dev->tda9887_conf & TDA9887_PRESENT);
2777 if (dev->board.radio.type)
2778 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap[dev->def_i2c_bus],
2779 "tuner", dev->board.radio_addr, NULL);
2781 if (has_demod)
2782 v4l2_i2c_new_subdev(&dev->v4l2_dev,
2783 &dev->i2c_adap[dev->def_i2c_bus], "tuner",
2784 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
2785 if (dev->tuner_addr == 0) {
2786 enum v4l2_i2c_tuner_type type =
2787 has_demod ? ADDRS_TV_WITH_DEMOD : ADDRS_TV;
2788 struct v4l2_subdev *sd;
2790 sd = v4l2_i2c_new_subdev(&dev->v4l2_dev,
2791 &dev->i2c_adap[dev->def_i2c_bus], "tuner",
2792 0, v4l2_i2c_tuner_addrs(type));
2794 if (sd)
2795 dev->tuner_addr = v4l2_i2c_subdev_addr(sd);
2796 } else {
2797 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap[dev->def_i2c_bus],
2798 "tuner", dev->tuner_addr, NULL);
2802 em28xx_tuner_setup(dev);
2804 em28xx_init_camera(dev);
2808 static void request_module_async(struct work_struct *work)
2810 struct em28xx *dev = container_of(work,
2811 struct em28xx, request_module_wk);
2814 * The em28xx extensions can be modules or builtin. If the
2815 * modules are already loaded or are built in, those extensions
2816 * can be initialised right now. Otherwise, the module init
2817 * code will do it.
2819 em28xx_init_extension(dev);
2821 #if defined(CONFIG_MODULES) && defined(MODULE)
2822 if (dev->has_audio_class)
2823 request_module("snd-usb-audio");
2824 else if (dev->has_alsa_audio)
2825 request_module("em28xx-alsa");
2827 if (dev->board.has_dvb)
2828 request_module("em28xx-dvb");
2829 if (dev->board.has_snapshot_button ||
2830 ((dev->board.ir_codes || dev->board.has_ir_i2c) && !disable_ir))
2831 request_module("em28xx-rc");
2832 #endif /* CONFIG_MODULES */
2835 static void request_modules(struct em28xx *dev)
2837 INIT_WORK(&dev->request_module_wk, request_module_async);
2838 schedule_work(&dev->request_module_wk);
2841 static void flush_request_modules(struct em28xx *dev)
2843 flush_work(&dev->request_module_wk);
2847 * em28xx_release_resources()
2848 * unregisters the v4l2,i2c and usb devices
2849 * called when the device gets disconnected or at module unload
2851 void em28xx_release_resources(struct em28xx *dev)
2853 /*FIXME: I2C IR should be disconnected */
2855 em28xx_release_analog_resources(dev);
2857 if (dev->def_i2c_bus)
2858 em28xx_i2c_unregister(dev, 1);
2859 em28xx_i2c_unregister(dev, 0);
2861 v4l2_ctrl_handler_free(&dev->ctrl_handler);
2863 v4l2_device_unregister(&dev->v4l2_dev);
2865 usb_put_dev(dev->udev);
2867 /* Mark device as unused */
2868 clear_bit(dev->devno, &em28xx_devused);
2872 * em28xx_init_dev()
2873 * allocates and inits the device structs, registers i2c bus and v4l device
2875 static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,
2876 struct usb_interface *interface,
2877 int minor)
2879 struct v4l2_ctrl_handler *hdl = &dev->ctrl_handler;
2880 int retval;
2881 static const char *default_chip_name = "em28xx";
2882 const char *chip_name = default_chip_name;
2884 dev->udev = udev;
2885 mutex_init(&dev->vb_queue_lock);
2886 mutex_init(&dev->vb_vbi_queue_lock);
2887 mutex_init(&dev->ctrl_urb_lock);
2888 spin_lock_init(&dev->slock);
2890 dev->em28xx_write_regs = em28xx_write_regs;
2891 dev->em28xx_read_reg = em28xx_read_reg;
2892 dev->em28xx_read_reg_req_len = em28xx_read_reg_req_len;
2893 dev->em28xx_write_regs_req = em28xx_write_regs_req;
2894 dev->em28xx_read_reg_req = em28xx_read_reg_req;
2895 dev->board.is_em2800 = em28xx_boards[dev->model].is_em2800;
2897 em28xx_set_model(dev);
2899 dev->wait_after_write = 5;
2901 /* Based on the Chip ID, set the device configuration */
2902 retval = em28xx_read_reg(dev, EM28XX_R0A_CHIPID);
2903 if (retval > 0) {
2904 dev->chip_id = retval;
2906 switch (dev->chip_id) {
2907 case CHIP_ID_EM2800:
2908 chip_name = "em2800";
2909 break;
2910 case CHIP_ID_EM2710:
2911 chip_name = "em2710";
2912 break;
2913 case CHIP_ID_EM2750:
2914 chip_name = "em2750";
2915 break;
2916 case CHIP_ID_EM2765:
2917 chip_name = "em2765";
2918 dev->wait_after_write = 0;
2919 dev->is_em25xx = 1;
2920 dev->eeprom_addrwidth_16bit = 1;
2921 break;
2922 case CHIP_ID_EM2820:
2923 chip_name = "em2710/2820";
2924 if (le16_to_cpu(dev->udev->descriptor.idVendor)
2925 == 0xeb1a) {
2926 __le16 idProd = dev->udev->descriptor.idProduct;
2927 if (le16_to_cpu(idProd) == 0x2710)
2928 chip_name = "em2710";
2929 else if (le16_to_cpu(idProd) == 0x2820)
2930 chip_name = "em2820";
2932 /* NOTE: the em2820 is used in webcams, too ! */
2933 break;
2934 case CHIP_ID_EM2840:
2935 chip_name = "em2840";
2936 break;
2937 case CHIP_ID_EM2860:
2938 chip_name = "em2860";
2939 break;
2940 case CHIP_ID_EM2870:
2941 chip_name = "em2870";
2942 dev->wait_after_write = 0;
2943 break;
2944 case CHIP_ID_EM2874:
2945 chip_name = "em2874";
2946 dev->wait_after_write = 0;
2947 dev->eeprom_addrwidth_16bit = 1;
2948 break;
2949 case CHIP_ID_EM28174:
2950 chip_name = "em28174";
2951 dev->wait_after_write = 0;
2952 dev->eeprom_addrwidth_16bit = 1;
2953 break;
2954 case CHIP_ID_EM2883:
2955 chip_name = "em2882/3";
2956 dev->wait_after_write = 0;
2957 break;
2958 case CHIP_ID_EM2884:
2959 chip_name = "em2884";
2960 dev->wait_after_write = 0;
2961 dev->eeprom_addrwidth_16bit = 1;
2962 break;
2963 default:
2964 printk(KERN_INFO DRIVER_NAME
2965 ": unknown em28xx chip ID (%d)\n", dev->chip_id);
2969 if (chip_name != default_chip_name)
2970 printk(KERN_INFO DRIVER_NAME
2971 ": chip ID is %s\n", chip_name);
2974 * For em2820/em2710, the name may change latter, after checking
2975 * if the device has a sensor (so, it is em2710) or not.
2977 snprintf(dev->name, sizeof(dev->name), "%s #%d", chip_name, dev->devno);
2979 if (dev->is_audio_only) {
2980 retval = em28xx_audio_setup(dev);
2981 if (retval)
2982 return -ENODEV;
2983 em28xx_init_extension(dev);
2985 return 0;
2988 em28xx_pre_card_setup(dev);
2990 if (!dev->board.is_em2800) {
2991 /* Resets I2C speed */
2992 retval = em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed);
2993 if (retval < 0) {
2994 em28xx_errdev("%s: em28xx_write_reg failed!"
2995 " retval [%d]\n",
2996 __func__, retval);
2997 return retval;
3001 retval = v4l2_device_register(&interface->dev, &dev->v4l2_dev);
3002 if (retval < 0) {
3003 em28xx_errdev("Call to v4l2_device_register() failed!\n");
3004 return retval;
3007 v4l2_ctrl_handler_init(hdl, 8);
3008 dev->v4l2_dev.ctrl_handler = hdl;
3010 rt_mutex_init(&dev->i2c_bus_lock);
3012 /* register i2c bus 0 */
3013 if (dev->board.is_em2800)
3014 retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM2800);
3015 else
3016 retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM28XX);
3017 if (retval < 0) {
3018 em28xx_errdev("%s: em28xx_i2c_register bus 0 - error [%d]!\n",
3019 __func__, retval);
3020 goto unregister_dev;
3023 /* register i2c bus 1 */
3024 if (dev->def_i2c_bus) {
3025 if (dev->is_em25xx)
3026 retval = em28xx_i2c_register(dev, 1,
3027 EM28XX_I2C_ALGO_EM25XX_BUS_B);
3028 else
3029 retval = em28xx_i2c_register(dev, 1,
3030 EM28XX_I2C_ALGO_EM28XX);
3031 if (retval < 0) {
3032 em28xx_errdev("%s: em28xx_i2c_register bus 1 - error [%d]!\n",
3033 __func__, retval);
3034 goto unregister_dev;
3039 * Default format, used for tvp5150 or saa711x output formats
3041 dev->vinmode = 0x10;
3042 dev->vinctl = EM28XX_VINCTRL_INTERLACED |
3043 EM28XX_VINCTRL_CCIR656_ENABLE;
3045 /* Do board specific init and eeprom reading */
3046 em28xx_card_setup(dev);
3048 /* Configure audio */
3049 retval = em28xx_audio_setup(dev);
3050 if (retval < 0) {
3051 em28xx_errdev("%s: Error while setting audio - error [%d]!\n",
3052 __func__, retval);
3053 goto fail;
3055 if (dev->audio_mode.ac97 != EM28XX_NO_AC97) {
3056 v4l2_ctrl_new_std(hdl, &em28xx_ctrl_ops,
3057 V4L2_CID_AUDIO_MUTE, 0, 1, 1, 1);
3058 v4l2_ctrl_new_std(hdl, &em28xx_ctrl_ops,
3059 V4L2_CID_AUDIO_VOLUME, 0, 0x1f, 1, 0x1f);
3060 } else {
3061 /* install the em28xx notify callback */
3062 v4l2_ctrl_notify(v4l2_ctrl_find(hdl, V4L2_CID_AUDIO_MUTE),
3063 em28xx_ctrl_notify, dev);
3064 v4l2_ctrl_notify(v4l2_ctrl_find(hdl, V4L2_CID_AUDIO_VOLUME),
3065 em28xx_ctrl_notify, dev);
3068 /* wake i2c devices */
3069 em28xx_wake_i2c(dev);
3071 /* init video dma queues */
3072 INIT_LIST_HEAD(&dev->vidq.active);
3073 INIT_LIST_HEAD(&dev->vbiq.active);
3075 if (dev->board.has_msp34xx) {
3076 /* Send a reset to other chips via gpio */
3077 retval = em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xf7);
3078 if (retval < 0) {
3079 em28xx_errdev("%s: em28xx_write_reg - "
3080 "msp34xx(1) failed! error [%d]\n",
3081 __func__, retval);
3082 goto fail;
3084 msleep(3);
3086 retval = em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xff);
3087 if (retval < 0) {
3088 em28xx_errdev("%s: em28xx_write_reg - "
3089 "msp34xx(2) failed! error [%d]\n",
3090 __func__, retval);
3091 goto fail;
3093 msleep(3);
3096 retval = em28xx_register_analog_devices(dev);
3097 if (retval < 0) {
3098 goto fail;
3101 /* Save some power by putting tuner to sleep */
3102 v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_power, 0);
3104 return 0;
3106 fail:
3107 if (dev->def_i2c_bus)
3108 em28xx_i2c_unregister(dev, 1);
3109 em28xx_i2c_unregister(dev, 0);
3110 v4l2_ctrl_handler_free(&dev->ctrl_handler);
3112 unregister_dev:
3113 v4l2_device_unregister(&dev->v4l2_dev);
3115 return retval;
3118 /* high bandwidth multiplier, as encoded in highspeed endpoint descriptors */
3119 #define hb_mult(wMaxPacketSize) (1 + (((wMaxPacketSize) >> 11) & 0x03))
3122 * em28xx_usb_probe()
3123 * checks for supported devices
3125 static int em28xx_usb_probe(struct usb_interface *interface,
3126 const struct usb_device_id *id)
3128 struct usb_device *udev;
3129 struct em28xx *dev = NULL;
3130 int retval;
3131 bool has_audio = false, has_video = false, has_dvb = false;
3132 int i, nr, try_bulk;
3133 const int ifnum = interface->altsetting[0].desc.bInterfaceNumber;
3134 char *speed;
3136 udev = usb_get_dev(interface_to_usbdev(interface));
3138 /* Check to see next free device and mark as used */
3139 do {
3140 nr = find_first_zero_bit(&em28xx_devused, EM28XX_MAXBOARDS);
3141 if (nr >= EM28XX_MAXBOARDS) {
3142 /* No free device slots */
3143 printk(DRIVER_NAME ": Supports only %i em28xx boards.\n",
3144 EM28XX_MAXBOARDS);
3145 retval = -ENOMEM;
3146 goto err_no_slot;
3148 } while (test_and_set_bit(nr, &em28xx_devused));
3150 /* Don't register audio interfaces */
3151 if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
3152 em28xx_err(DRIVER_NAME " audio device (%04x:%04x): "
3153 "interface %i, class %i\n",
3154 le16_to_cpu(udev->descriptor.idVendor),
3155 le16_to_cpu(udev->descriptor.idProduct),
3156 ifnum,
3157 interface->altsetting[0].desc.bInterfaceClass);
3159 retval = -ENODEV;
3160 goto err;
3163 /* allocate memory for our device state and initialize it */
3164 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
3165 if (dev == NULL) {
3166 em28xx_err(DRIVER_NAME ": out of memory!\n");
3167 retval = -ENOMEM;
3168 goto err;
3171 /* compute alternate max packet sizes */
3172 dev->alt_max_pkt_size_isoc =
3173 kmalloc(sizeof(dev->alt_max_pkt_size_isoc[0]) *
3174 interface->num_altsetting, GFP_KERNEL);
3175 if (dev->alt_max_pkt_size_isoc == NULL) {
3176 em28xx_errdev("out of memory!\n");
3177 kfree(dev);
3178 retval = -ENOMEM;
3179 goto err;
3182 /* Get endpoints */
3183 for (i = 0; i < interface->num_altsetting; i++) {
3184 int ep;
3186 for (ep = 0; ep < interface->altsetting[i].desc.bNumEndpoints; ep++) {
3187 const struct usb_endpoint_descriptor *e;
3188 int sizedescr, size;
3190 e = &interface->altsetting[i].endpoint[ep].desc;
3192 sizedescr = le16_to_cpu(e->wMaxPacketSize);
3193 size = sizedescr & 0x7ff;
3195 if (udev->speed == USB_SPEED_HIGH)
3196 size = size * hb_mult(sizedescr);
3198 if (usb_endpoint_dir_in(e)) {
3199 switch (e->bEndpointAddress) {
3200 case 0x82:
3201 has_video = true;
3202 if (usb_endpoint_xfer_isoc(e)) {
3203 dev->analog_ep_isoc =
3204 e->bEndpointAddress;
3205 dev->alt_max_pkt_size_isoc[i] = size;
3206 } else if (usb_endpoint_xfer_bulk(e)) {
3207 dev->analog_ep_bulk =
3208 e->bEndpointAddress;
3210 break;
3211 case 0x83:
3212 if (usb_endpoint_xfer_isoc(e)) {
3213 has_audio = true;
3214 } else {
3215 printk(KERN_INFO DRIVER_NAME
3216 ": error: skipping audio endpoint 0x83, because it uses bulk transfers !\n");
3218 break;
3219 case 0x84:
3220 if (has_video &&
3221 (usb_endpoint_xfer_bulk(e))) {
3222 dev->analog_ep_bulk =
3223 e->bEndpointAddress;
3224 } else {
3225 if (usb_endpoint_xfer_isoc(e)) {
3226 if (size > dev->dvb_max_pkt_size_isoc) {
3227 has_dvb = true; /* see NOTE (~) */
3228 dev->dvb_ep_isoc = e->bEndpointAddress;
3229 dev->dvb_max_pkt_size_isoc = size;
3230 dev->dvb_alt_isoc = i;
3232 } else {
3233 has_dvb = true;
3234 dev->dvb_ep_bulk = e->bEndpointAddress;
3237 break;
3240 /* NOTE:
3241 * Old logic with support for isoc transfers only was:
3242 * 0x82 isoc => analog
3243 * 0x83 isoc => audio
3244 * 0x84 isoc => digital
3246 * New logic with support for bulk transfers
3247 * 0x82 isoc => analog
3248 * 0x82 bulk => analog
3249 * 0x83 isoc* => audio
3250 * 0x84 isoc => digital
3251 * 0x84 bulk => analog or digital**
3252 * (*: audio should always be isoc)
3253 * (**: analog, if ep 0x82 is isoc, otherwise digital)
3255 * The new logic preserves backwards compatibility and
3256 * reflects the endpoint configurations we have seen
3257 * so far. But there might be devices for which this
3258 * logic is not sufficient...
3261 * NOTE (~): some manufacturers (e.g. Terratec) disable
3262 * endpoints by setting wMaxPacketSize to 0 bytes for
3263 * all alt settings. So far, we've seen this for
3264 * DVB isoc endpoints only.
3269 if (!(has_audio || has_video || has_dvb)) {
3270 retval = -ENODEV;
3271 goto err_free;
3274 switch (udev->speed) {
3275 case USB_SPEED_LOW:
3276 speed = "1.5";
3277 break;
3278 case USB_SPEED_UNKNOWN:
3279 case USB_SPEED_FULL:
3280 speed = "12";
3281 break;
3282 case USB_SPEED_HIGH:
3283 speed = "480";
3284 break;
3285 default:
3286 speed = "unknown";
3289 printk(KERN_INFO DRIVER_NAME
3290 ": New device %s %s @ %s Mbps "
3291 "(%04x:%04x, interface %d, class %d)\n",
3292 udev->manufacturer ? udev->manufacturer : "",
3293 udev->product ? udev->product : "",
3294 speed,
3295 le16_to_cpu(udev->descriptor.idVendor),
3296 le16_to_cpu(udev->descriptor.idProduct),
3297 ifnum,
3298 interface->altsetting->desc.bInterfaceNumber);
3301 * Make sure we have 480 Mbps of bandwidth, otherwise things like
3302 * video stream wouldn't likely work, since 12 Mbps is generally
3303 * not enough even for most Digital TV streams.
3305 if (udev->speed != USB_SPEED_HIGH && disable_usb_speed_check == 0) {
3306 printk(DRIVER_NAME ": Device initialization failed.\n");
3307 printk(DRIVER_NAME ": Device must be connected to a high-speed"
3308 " USB 2.0 port.\n");
3309 retval = -ENODEV;
3310 goto err_free;
3313 dev->devno = nr;
3314 dev->model = id->driver_info;
3315 dev->alt = -1;
3316 dev->is_audio_only = has_audio && !(has_video || has_dvb);
3317 dev->has_alsa_audio = has_audio;
3318 dev->audio_ifnum = ifnum;
3320 /* Checks if audio is provided by some interface */
3321 for (i = 0; i < udev->config->desc.bNumInterfaces; i++) {
3322 struct usb_interface *uif = udev->config->interface[i];
3323 if (uif->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
3324 dev->has_audio_class = 1;
3325 break;
3329 if (has_audio)
3330 printk(KERN_INFO DRIVER_NAME
3331 ": Audio interface %i found %s\n",
3332 ifnum,
3333 dev->has_audio_class ? "(USB Audio Class)" : "(Vendor Class)");
3334 if (has_video)
3335 printk(KERN_INFO DRIVER_NAME
3336 ": Video interface %i found:%s%s\n",
3337 ifnum,
3338 dev->analog_ep_bulk ? " bulk" : "",
3339 dev->analog_ep_isoc ? " isoc" : "");
3340 if (has_dvb)
3341 printk(KERN_INFO DRIVER_NAME
3342 ": DVB interface %i found:%s%s\n",
3343 ifnum,
3344 dev->dvb_ep_bulk ? " bulk" : "",
3345 dev->dvb_ep_isoc ? " isoc" : "");
3347 dev->num_alt = interface->num_altsetting;
3349 if ((unsigned)card[nr] < em28xx_bcount)
3350 dev->model = card[nr];
3352 /* save our data pointer in this interface device */
3353 usb_set_intfdata(interface, dev);
3355 /* initialize videobuf2 stuff */
3356 em28xx_vb2_setup(dev);
3358 /* allocate device struct */
3359 mutex_init(&dev->lock);
3360 mutex_lock(&dev->lock);
3361 retval = em28xx_init_dev(dev, udev, interface, nr);
3362 if (retval) {
3363 goto unlock_and_free;
3366 if (usb_xfer_mode < 0) {
3367 if (dev->board.is_webcam)
3368 try_bulk = 1;
3369 else
3370 try_bulk = 0;
3371 } else {
3372 try_bulk = usb_xfer_mode > 0;
3375 /* Select USB transfer types to use */
3376 if (has_video) {
3377 if (!dev->analog_ep_isoc || (try_bulk && dev->analog_ep_bulk))
3378 dev->analog_xfer_bulk = 1;
3379 em28xx_info("analog set to %s mode.\n",
3380 dev->analog_xfer_bulk ? "bulk" : "isoc");
3382 if (has_dvb) {
3383 if (!dev->dvb_ep_isoc || (try_bulk && dev->dvb_ep_bulk))
3384 dev->dvb_xfer_bulk = 1;
3386 em28xx_info("dvb set to %s mode.\n",
3387 dev->dvb_xfer_bulk ? "bulk" : "isoc");
3389 /* pre-allocate DVB usb transfer buffers */
3390 if (dev->dvb_xfer_bulk) {
3391 retval = em28xx_alloc_urbs(dev, EM28XX_DIGITAL_MODE,
3392 dev->dvb_xfer_bulk,
3393 EM28XX_DVB_NUM_BUFS,
3394 512,
3395 EM28XX_DVB_BULK_PACKET_MULTIPLIER);
3396 } else {
3397 retval = em28xx_alloc_urbs(dev, EM28XX_DIGITAL_MODE,
3398 dev->dvb_xfer_bulk,
3399 EM28XX_DVB_NUM_BUFS,
3400 dev->dvb_max_pkt_size_isoc,
3401 EM28XX_DVB_NUM_ISOC_PACKETS);
3403 if (retval) {
3404 printk(DRIVER_NAME
3405 ": Failed to pre-allocate USB transfer buffers for DVB.\n");
3406 goto unlock_and_free;
3410 request_modules(dev);
3412 /* Should be the last thing to do, to avoid newer udev's to
3413 open the device before fully initializing it
3415 mutex_unlock(&dev->lock);
3417 return 0;
3419 unlock_and_free:
3420 mutex_unlock(&dev->lock);
3422 err_free:
3423 kfree(dev->alt_max_pkt_size_isoc);
3424 kfree(dev);
3426 err:
3427 clear_bit(nr, &em28xx_devused);
3429 err_no_slot:
3430 usb_put_dev(udev);
3431 return retval;
3435 * em28xx_usb_disconnect()
3436 * called when the device gets disconnected
3437 * video device will be unregistered on v4l2_close in case it is still open
3439 static void em28xx_usb_disconnect(struct usb_interface *interface)
3441 struct em28xx *dev;
3443 dev = usb_get_intfdata(interface);
3444 usb_set_intfdata(interface, NULL);
3446 if (!dev)
3447 return;
3449 dev->disconnected = 1;
3451 if (dev->is_audio_only) {
3452 mutex_lock(&dev->lock);
3453 em28xx_close_extension(dev);
3454 mutex_unlock(&dev->lock);
3455 return;
3458 em28xx_info("disconnecting %s\n", dev->vdev->name);
3460 flush_request_modules(dev);
3462 mutex_lock(&dev->lock);
3464 v4l2_device_disconnect(&dev->v4l2_dev);
3466 if (dev->users) {
3467 em28xx_warn("device %s is open! Deregistration and memory deallocation are deferred on close.\n",
3468 video_device_node_name(dev->vdev));
3470 em28xx_uninit_usb_xfer(dev, EM28XX_ANALOG_MODE);
3471 em28xx_uninit_usb_xfer(dev, EM28XX_DIGITAL_MODE);
3474 em28xx_close_extension(dev);
3475 /* NOTE: must be called BEFORE the resources are released */
3477 if (!dev->users)
3478 em28xx_release_resources(dev);
3480 mutex_unlock(&dev->lock);
3482 if (!dev->users) {
3483 kfree(dev->alt_max_pkt_size_isoc);
3484 kfree(dev);
3488 static struct usb_driver em28xx_usb_driver = {
3489 .name = "em28xx",
3490 .probe = em28xx_usb_probe,
3491 .disconnect = em28xx_usb_disconnect,
3492 .id_table = em28xx_id_table,
3495 module_usb_driver(em28xx_usb_driver);