blob: 20a7e24de6fba66e3ce806153a3dda5995c34fed [file] [log] [blame]
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001/*
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002 em28xx-cards.c - driver for Empia EM2800/EM2820/2840 USB
3 video capture devices
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08004
Mauro Carvalho Chehabf7abcd32005-11-08 21:38:25 -08005 Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it>
6 Markus Rechberger <mrechberger@gmail.com>
Mauro Carvalho Chehab2e7c6dc2006-04-03 07:53:40 -03007 Mauro Carvalho Chehab <mchehab@infradead.org>
Mauro Carvalho Chehabf7abcd32005-11-08 21:38:25 -08008 Sascha Sommer <saschasommer@freenet.de>
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08009
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 */
24
25#include <linux/init.h>
26#include <linux/module.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090027#include <linux/slab.h>
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -080028#include <linux/delay.h>
29#include <linux/i2c.h>
30#include <linux/usb.h>
31#include <media/tuner.h>
Hans Verkuil2474ed42006-03-19 12:35:57 -030032#include <media/msp3400.h>
Hans Verkuilc7c0b342006-04-02 13:35:00 -030033#include <media/saa7115.h>
34#include <media/tvp5150.h>
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -030035#include <media/tvaudio.h>
Hans Verkuil3c7c9372011-01-08 07:08:02 -030036#include <media/mt9v011.h>
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -030037#include <media/i2c-addr.h>
Mauro Carvalho Chehab1f6173e2005-11-08 21:37:16 -080038#include <media/tveeprom.h>
Mauro Carvalho Chehab9bb13a62006-01-09 15:25:37 -020039#include <media/v4l2-common.h>
Hans Verkuil38f9d302008-07-23 05:09:15 -030040#include <media/v4l2-chip-ident.h>
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -080041
Mauro Carvalho Chehabf7abcd32005-11-08 21:38:25 -080042#include "em28xx.h"
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -080043
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -030044#define DRIVER_NAME "em28xx"
45
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -030046static int tuner = -1;
47module_param(tuner, int, 0444);
48MODULE_PARM_DESC(tuner, "tuner type");
49
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -030050static unsigned int disable_ir;
51module_param(disable_ir, int, 0444);
52MODULE_PARM_DESC(disable_ir, "disable infrared remote support");
53
Devin Heitmuellere2a1b792009-05-27 23:44:10 -030054static unsigned int disable_usb_speed_check;
55module_param(disable_usb_speed_check, int, 0444);
56MODULE_PARM_DESC(disable_usb_speed_check,
57 "override min bandwidth requirement of 480M bps");
58
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -030059static unsigned int card[] = {[0 ... (EM28XX_MAXBOARDS - 1)] = UNSET };
60module_param_array(card, int, NULL, 0444);
61MODULE_PARM_DESC(card, "card type");
62
Chris Rankin38b61eb2011-08-20 08:21:03 -030063/* Bitmask marking allocated devices from 0 to EM28XX_MAXBOARDS - 1 */
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -030064static unsigned long em28xx_devused;
65
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -030066struct em28xx_hash_table {
67 unsigned long hash;
68 unsigned int model;
69 unsigned int tuner;
70};
71
Ezequiel Garcia60332f02012-04-28 09:57:01 -030072static void em28xx_pre_card_setup(struct em28xx *dev);
73
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -030074/*
75 * Reset sequences for analog/digital modes
76 */
77
78/* Reset for the most [analog] boards */
79static struct em28xx_reg_seq default_analog[] = {
80 {EM28XX_R08_GPIO, 0x6d, ~EM_GPIO_4, 10},
81 { -1, -1, -1, -1},
82};
83
84/* Reset for the most [digital] boards */
85static struct em28xx_reg_seq default_digital[] = {
86 {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
87 { -1, -1, -1, -1},
88};
89
90/* Board Hauppauge WinTV HVR 900 analog */
91static struct em28xx_reg_seq hauppauge_wintv_hvr_900_analog[] = {
92 {EM28XX_R08_GPIO, 0x2d, ~EM_GPIO_4, 10},
93 {0x05, 0xff, 0x10, 10},
94 { -1, -1, -1, -1},
95};
96
97/* Board Hauppauge WinTV HVR 900 digital */
98static struct em28xx_reg_seq hauppauge_wintv_hvr_900_digital[] = {
99 {EM28XX_R08_GPIO, 0x2e, ~EM_GPIO_4, 10},
100 {EM2880_R04_GPO, 0x04, 0x0f, 10},
101 {EM2880_R04_GPO, 0x0c, 0x0f, 10},
102 { -1, -1, -1, -1},
103};
104
Devin Heitmueller7030f522011-03-13 02:04:53 -0300105/* Board Hauppauge WinTV HVR 900 (R2) digital */
106static struct em28xx_reg_seq hauppauge_wintv_hvr_900R2_digital[] = {
107 {EM28XX_R08_GPIO, 0x2e, ~EM_GPIO_4, 10},
108 {EM2880_R04_GPO, 0x0c, 0x0f, 10},
109 { -1, -1, -1, -1},
110};
111
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300112/* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
113static struct em28xx_reg_seq em2880_msi_digivox_ad_analog[] = {
114 {EM28XX_R08_GPIO, 0x69, ~EM_GPIO_4, 10},
115 { -1, -1, -1, -1},
116};
117
118/* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300119
120/* Board - EM2870 Kworld 355u
121 Analog - No input analog */
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300122
Franklin Mengd7de5d82009-06-06 17:05:02 -0300123/* Board - EM2882 Kworld 315U digital */
124static struct em28xx_reg_seq em2882_kworld_315u_digital[] = {
125 {EM28XX_R08_GPIO, 0xff, 0xff, 10},
126 {EM28XX_R08_GPIO, 0xfe, 0xff, 10},
127 {EM2880_R04_GPO, 0x04, 0xff, 10},
128 {EM2880_R04_GPO, 0x0c, 0xff, 10},
129 {EM28XX_R08_GPIO, 0x7e, 0xff, 10},
130 { -1, -1, -1, -1},
131};
132
133static struct em28xx_reg_seq em2882_kworld_315u_tuner_gpio[] = {
134 {EM2880_R04_GPO, 0x08, 0xff, 10},
135 {EM2880_R04_GPO, 0x0c, 0xff, 10},
136 {EM2880_R04_GPO, 0x08, 0xff, 10},
137 {EM2880_R04_GPO, 0x0c, 0xff, 10},
138 { -1, -1, -1, -1},
139};
140
Robert Krakora6e7b9ea2009-01-18 21:59:34 -0300141static struct em28xx_reg_seq kworld_330u_analog[] = {
142 {EM28XX_R08_GPIO, 0x6d, ~EM_GPIO_4, 10},
143 {EM2880_R04_GPO, 0x00, 0xff, 10},
144 { -1, -1, -1, -1},
145};
146
147static struct em28xx_reg_seq kworld_330u_digital[] = {
148 {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
149 {EM2880_R04_GPO, 0x08, 0xff, 10},
150 { -1, -1, -1, -1},
151};
152
Devin Heitmueller19859222009-06-19 00:33:54 -0300153/* Evga inDtube
154 GPIO0 - Enable digital power (s5h1409) - low to enable
155 GPIO1 - Enable analog power (tvp5150/emp202) - low to enable
156 GPIO4 - xc3028 reset
157 GOP3 - s5h1409 reset
158 */
159static struct em28xx_reg_seq evga_indtube_analog[] = {
160 {EM28XX_R08_GPIO, 0x79, 0xff, 60},
161 { -1, -1, -1, -1},
162};
163
164static struct em28xx_reg_seq evga_indtube_digital[] = {
165 {EM28XX_R08_GPIO, 0x7a, 0xff, 1},
166 {EM2880_R04_GPO, 0x04, 0xff, 10},
167 {EM2880_R04_GPO, 0x0c, 0xff, 1},
168 { -1, -1, -1, -1},
169};
170
Jarod Wilson7e48b302010-03-07 17:55:43 -0300171/*
172 * KWorld PlusTV 340U and UB435-Q (ATSC) GPIOs map:
173 * EM_GPIO_0 - currently unknown
174 * EM_GPIO_1 - LED disable/enable (1 = off, 0 = on)
175 * EM_GPIO_2 - currently unknown
176 * EM_GPIO_3 - currently unknown
177 * EM_GPIO_4 - TDA18271HD/C1 tuner (1 = active, 0 = in reset)
178 * EM_GPIO_5 - LGDT3304 ATSC/QAM demod (1 = active, 0 = in reset)
179 * EM_GPIO_6 - currently unknown
180 * EM_GPIO_7 - currently unknown
181 */
182static struct em28xx_reg_seq kworld_a340_digital[] = {
183 {EM28XX_R08_GPIO, 0x6d, ~EM_GPIO_4, 10},
184 { -1, -1, -1, -1},
185};
186
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -0300187/* Pinnacle Hybrid Pro eb1a:2881 */
188static struct em28xx_reg_seq pinnacle_hybrid_pro_analog[] = {
Devin Heitmueller44010442009-07-08 22:18:15 -0300189 {EM28XX_R08_GPIO, 0xfd, ~EM_GPIO_4, 10},
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -0300190 { -1, -1, -1, -1},
191};
192
193static struct em28xx_reg_seq pinnacle_hybrid_pro_digital[] = {
194 {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
195 {EM2880_R04_GPO, 0x04, 0xff, 100},/* zl10353 reset */
196 {EM2880_R04_GPO, 0x0c, 0xff, 1},
197 { -1, -1, -1, -1},
198};
199
Michel Garniercec4e6c2010-10-16 14:42:01 -0300200static struct em28xx_reg_seq terratec_cinergy_USB_XS_FR_analog[] = {
201 {EM28XX_R08_GPIO, 0x6d, ~EM_GPIO_4, 10},
202 {EM2880_R04_GPO, 0x00, 0xff, 10},
203 { -1, -1, -1, -1},
204};
205
206static struct em28xx_reg_seq terratec_cinergy_USB_XS_FR_digital[] = {
207 {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
208 {EM2880_R04_GPO, 0x08, 0xff, 10},
209 { -1, -1, -1, -1},
210};
211
Antti Palosaari285eb1a2009-09-15 14:42:13 -0300212/* eb1a:2868 Reddo DVB-C USB TV Box
213 GPIO4 - CU1216L NIM
214 Other GPIOs seems to be don't care. */
215static struct em28xx_reg_seq reddo_dvb_c_usb_box[] = {
216 {EM28XX_R08_GPIO, 0xfe, 0xff, 10},
217 {EM28XX_R08_GPIO, 0xde, 0xff, 10},
218 {EM28XX_R08_GPIO, 0xfe, 0xff, 10},
219 {EM28XX_R08_GPIO, 0xff, 0xff, 10},
220 {EM28XX_R08_GPIO, 0x7f, 0xff, 10},
221 {EM28XX_R08_GPIO, 0x6f, 0xff, 10},
222 {EM28XX_R08_GPIO, 0xff, 0xff, 10},
223 {-1, -1, -1, -1},
224};
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -0300225
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300226/* Callback for the most boards */
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300227static struct em28xx_reg_seq default_tuner_gpio[] = {
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300228 {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10},
229 {EM28XX_R08_GPIO, 0, EM_GPIO_4, 10},
230 {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10},
231 { -1, -1, -1, -1},
232};
233
Vitaly Wool2bd1d9eb2009-03-04 08:27:52 -0300234/* Mute/unmute */
235static struct em28xx_reg_seq compro_unmute_tv_gpio[] = {
236 {EM28XX_R08_GPIO, 5, 7, 10},
237 { -1, -1, -1, -1},
238};
239
240static struct em28xx_reg_seq compro_unmute_svid_gpio[] = {
241 {EM28XX_R08_GPIO, 4, 7, 10},
242 { -1, -1, -1, -1},
243};
244
245static struct em28xx_reg_seq compro_mute_gpio[] = {
246 {EM28XX_R08_GPIO, 6, 7, 10},
247 { -1, -1, -1, -1},
248};
249
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -0300250/* Terratec AV350 */
251static struct em28xx_reg_seq terratec_av350_mute_gpio[] = {
252 {EM28XX_R08_GPIO, 0xff, 0x7f, 10},
253 { -1, -1, -1, -1},
254};
255
256static struct em28xx_reg_seq terratec_av350_unmute_gpio[] = {
257 {EM28XX_R08_GPIO, 0xff, 0xff, 10},
258 { -1, -1, -1, -1},
259};
Mauro Carvalho Chehab02e78042009-06-29 11:35:05 -0300260
261static struct em28xx_reg_seq silvercrest_reg_seq[] = {
262 {EM28XX_R08_GPIO, 0xff, 0xff, 10},
263 {EM28XX_R08_GPIO, 0x01, 0xf7, 10},
264 { -1, -1, -1, -1},
265};
266
Mauro Carvalho Chehab694a1012009-11-26 21:26:13 -0300267static struct em28xx_reg_seq vc211a_enable[] = {
268 {EM28XX_R08_GPIO, 0xff, 0x07, 10},
269 {EM28XX_R08_GPIO, 0xff, 0x0f, 10},
270 {EM28XX_R08_GPIO, 0xff, 0x0b, 10},
271 { -1, -1, -1, -1},
272};
273
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -0300274static struct em28xx_reg_seq dikom_dk300_digital[] = {
275 {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
276 {EM2880_R04_GPO, 0x08, 0xff, 10},
277 { -1, -1, -1, -1},
278};
279
Mauro Carvalho Chehab694a1012009-11-26 21:26:13 -0300280
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -0300281/* Reset for the most [digital] boards */
282static struct em28xx_reg_seq leadership_digital[] = {
283 {EM2874_R80_GPIO, 0x70, 0xff, 10},
284 { -1, -1, -1, -1},
285};
286
287static struct em28xx_reg_seq leadership_reset[] = {
288 {EM2874_R80_GPIO, 0xf0, 0xff, 10},
289 {EM2874_R80_GPIO, 0xb0, 0xff, 10},
290 {EM2874_R80_GPIO, 0xf0, 0xff, 10},
291 { -1, -1, -1, -1},
292};
293
Antti Palosaari460312e2011-05-25 17:03:50 -0300294/* 2013:024f PCTV nanoStick T2 290e
Antti Palosaarid6a5f922011-04-07 16:34:44 -0300295 * GPIO_6 - demod reset
296 * GPIO_7 - LED
297 */
298static struct em28xx_reg_seq pctv_290e[] = {
299 {EM2874_R80_GPIO, 0x00, 0xff, 80},
300 {EM2874_R80_GPIO, 0x40, 0xff, 80}, /* GPIO_6 = 1 */
301 {EM2874_R80_GPIO, 0xc0, 0xff, 80}, /* GPIO_7 = 1 */
302 {-1, -1, -1, -1},
303};
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -0300304
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -0300305#if 0
306static struct em28xx_reg_seq terratec_h5_gpio[] = {
307 {EM28XX_R08_GPIO, 0xff, 0xff, 10},
308 {EM2874_R80_GPIO, 0xf6, 0xff, 100},
309 {EM2874_R80_GPIO, 0xf2, 0xff, 50},
310 {EM2874_R80_GPIO, 0xf6, 0xff, 50},
311 { -1, -1, -1, -1},
312};
313
314static struct em28xx_reg_seq terratec_h5_digital[] = {
315 {EM2874_R80_GPIO, 0xf6, 0xff, 10},
316 {EM2874_R80_GPIO, 0xe6, 0xff, 100},
317 {EM2874_R80_GPIO, 0xa6, 0xff, 10},
318 { -1, -1, -1, -1},
319};
320#endif
321
Antti Palosaari36588712011-08-01 01:15:30 -0300322/* 2013:024f PCTV DVB-S2 Stick 460e
323 * GPIO_0 - POWER_ON
324 * GPIO_1 - BOOST
325 * GPIO_2 - VUV_LNB (red LED)
326 * GPIO_3 - EXT_12V
327 * GPIO_4 - INT_DEM (DEMOD GPIO_0)
328 * GPIO_5 - INT_LNB
329 * GPIO_6 - RESET_DEM
330 * GPIO_7 - LED (green LED)
331 */
332static struct em28xx_reg_seq pctv_460e[] = {
333 {EM2874_R80_GPIO, 0x01, 0xff, 50},
334 {0x0d, 0xff, 0xff, 50},
335 {EM2874_R80_GPIO, 0x41, 0xff, 50}, /* GPIO_6=1 */
336 {0x0d, 0x42, 0xff, 50},
337 {EM2874_R80_GPIO, 0x61, 0xff, 50}, /* GPIO_5=1 */
338 { -1, -1, -1, -1},
339};
340
Mauro Carvalho Chehab85032322011-11-24 15:01:45 -0200341#if 0
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -0300342static struct em28xx_reg_seq hauppauge_930c_gpio[] = {
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -0300343 {EM2874_R80_GPIO, 0x6f, 0xff, 10},
Mauro Carvalho Chehabde724052011-11-20 11:23:24 -0200344 {EM2874_R80_GPIO, 0x4f, 0xff, 10}, /* xc5000 reset */
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -0300345 {EM2874_R80_GPIO, 0x6f, 0xff, 10},
346 {EM2874_R80_GPIO, 0x4f, 0xff, 10},
347 { -1, -1, -1, -1},
348};
349
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -0300350static struct em28xx_reg_seq hauppauge_930c_digital[] = {
351 {EM2874_R80_GPIO, 0xf6, 0xff, 10},
352 {EM2874_R80_GPIO, 0xe6, 0xff, 100},
353 {EM2874_R80_GPIO, 0xa6, 0xff, 10},
354 { -1, -1, -1, -1},
355};
356#endif
357
Antti Palosaari35530852012-03-18 18:09:01 -0300358/* 1b80:e425 MaxMedia UB425-TC
359 * GPIO_6 - demod reset, 0=active
360 * GPIO_7 - LED, 0=active
361 */
362static struct em28xx_reg_seq maxmedia_ub425_tc[] = {
363 {EM2874_R80_GPIO, 0x83, 0xff, 100},
364 {EM2874_R80_GPIO, 0xc3, 0xff, 100}, /* GPIO_6 = 1 */
365 {EM2874_R80_GPIO, 0x43, 0xff, 000}, /* GPIO_7 = 0 */
366 {-1, -1, -1, -1},
367};
368
Ivan Kalvachevfa5527c2012-03-19 20:09:55 -0300369/* 2304:0242 PCTV QuatroStick (510e)
370 * GPIO_2: decoder reset, 0=active
371 * GPIO_4: decoder suspend, 0=active
372 * GPIO_6: demod reset, 0=active
373 * GPIO_7: LED, 1=active
374 */
375static struct em28xx_reg_seq pctv_510e[] = {
376 {EM2874_R80_GPIO, 0x10, 0xff, 100},
377 {EM2874_R80_GPIO, 0x14, 0xff, 100}, /* GPIO_2 = 1 */
378 {EM2874_R80_GPIO, 0x54, 0xff, 050}, /* GPIO_6 = 1 */
379 { -1, -1, -1, -1},
380};
381
Antti Palosaaric247d7b2012-03-19 11:48:19 -0300382/* 2013:0251 PCTV QuatroStick nano (520e)
383 * GPIO_2: decoder reset, 0=active
384 * GPIO_4: decoder suspend, 0=active
385 * GPIO_6: demod reset, 0=active
386 * GPIO_7: LED, 1=active
387 */
388static struct em28xx_reg_seq pctv_520e[] = {
389 {EM2874_R80_GPIO, 0x10, 0xff, 100},
390 {EM2874_R80_GPIO, 0x14, 0xff, 100}, /* GPIO_2 = 1 */
391 {EM2874_R80_GPIO, 0x54, 0xff, 050}, /* GPIO_6 = 1 */
392 {EM2874_R80_GPIO, 0xd4, 0xff, 000}, /* GPIO_7 = 1 */
393 { -1, -1, -1, -1},
394};
395
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300396/*
397 * Board definitions
398 */
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800399struct em28xx_board em28xx_boards[] = {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300400 [EM2750_BOARD_UNKNOWN] = {
Mauro Carvalho Chehab8b220792009-07-12 10:56:21 -0300401 .name = "EM2710/EM2750/EM2751 webcam grabber",
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -0300402 .xclk = EM28XX_XCLK_FREQUENCY_20MHZ,
Mauro Carvalho Chehab8a2e6992009-07-12 10:26:36 -0300403 .tuner_type = TUNER_ABSENT,
404 .is_webcam = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300405 .input = { {
406 .type = EM28XX_VMUX_COMPOSITE1,
407 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300408 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -0300409 .gpio = silvercrest_reg_seq,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300410 } },
411 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800412 [EM2800_BOARD_UNKNOWN] = {
413 .name = "Unknown EM2800 video grabber",
414 .is_em2800 = 1,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800415 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300416 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300417 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300418 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800419 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300420 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300421 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300422 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800423 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300424 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300425 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300426 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800427 },
428 [EM2820_BOARD_UNKNOWN] = {
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300429 .name = "Unknown EM2750/28xx video grabber",
430 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabb04fb662009-07-13 01:28:21 -0300431 .is_webcam = 1, /* To enable sensor probe */
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800432 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300433 [EM2750_BOARD_DLCW_130] = {
434 /* Beijing Huaqi Information Digital Technology Co., Ltd */
435 .name = "Huaqi DLCW-130",
436 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300437 .xclk = EM28XX_XCLK_FREQUENCY_48MHZ,
Mauro Carvalho Chehab8a2e6992009-07-12 10:26:36 -0300438 .tuner_type = TUNER_ABSENT,
439 .is_webcam = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300440 .input = { {
441 .type = EM28XX_VMUX_COMPOSITE1,
442 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300443 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300444 } },
445 },
Markus Rechberger4d17d082006-02-07 06:25:39 -0200446 [EM2820_BOARD_KWORLD_PVRTV2800RF] = {
Markus Rechberger33ccaa32006-02-07 06:25:41 -0200447 .name = "Kworld PVR TV 2800 RF",
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -0300448 .tuner_type = TUNER_TEMIC_PAL,
Markus Rechberger4d17d082006-02-07 06:25:39 -0200449 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300450 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300451 .input = { {
Markus Rechberger4d17d082006-02-07 06:25:39 -0200452 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300453 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300454 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300455 }, {
Markus Rechberger4d17d082006-02-07 06:25:39 -0200456 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300457 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300458 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300459 } },
Markus Rechberger4d17d082006-02-07 06:25:39 -0200460 },
Douglas Schilling Landgraff7fe3e62009-01-19 09:31:55 -0300461 [EM2820_BOARD_GADMEI_TVR200] = {
462 .name = "Gadmei TVR200",
463 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
464 .tda9887_conf = TDA9887_PRESENT,
465 .decoder = EM28XX_SAA711X,
466 .input = { {
467 .type = EM28XX_VMUX_TELEVISION,
468 .vmux = SAA7115_COMPOSITE2,
469 .amux = EM28XX_AMUX_LINE_IN,
470 }, {
471 .type = EM28XX_VMUX_COMPOSITE1,
472 .vmux = SAA7115_COMPOSITE0,
473 .amux = EM28XX_AMUX_LINE_IN,
474 }, {
475 .type = EM28XX_VMUX_SVIDEO,
476 .vmux = SAA7115_SVIDEO3,
477 .amux = EM28XX_AMUX_LINE_IN,
478 } },
479 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800480 [EM2820_BOARD_TERRATEC_CINERGY_250] = {
481 .name = "Terratec Cinergy 250 USB",
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800482 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
Mauro Carvalho Chehabac07bb72009-09-08 14:04:41 -0300483 .has_ir_i2c = 1,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800484 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300485 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300486 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800487 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300488 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300489 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300490 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800491 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300492 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300493 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300494 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800495 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300496 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300497 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300498 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800499 },
500 [EM2820_BOARD_PINNACLE_USB_2] = {
501 .name = "Pinnacle PCTV USB 2",
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800502 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
Mauro Carvalho Chehabac07bb72009-09-08 14:04:41 -0300503 .has_ir_i2c = 1,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800504 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300505 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300506 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800507 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300508 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300509 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300510 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800511 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300512 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300513 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300514 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800515 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300516 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300517 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300518 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800519 },
520 [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2] = {
521 .name = "Hauppauge WinTV USB 2",
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800522 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300523 .tda9887_conf = TDA9887_PRESENT |
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -0300524 TDA9887_PORT1_ACTIVE |
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300525 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800526 .decoder = EM28XX_TVP5150,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800527 .has_msp34xx = 1,
Mauro Carvalho Chehabac07bb72009-09-08 14:04:41 -0300528 .has_ir_i2c = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300529 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800530 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300531 .vmux = TVP5150_COMPOSITE0,
Hans Verkuil2474ed42006-03-19 12:35:57 -0300532 .amux = MSP_INPUT_DEFAULT,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300533 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800534 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300535 .vmux = TVP5150_SVIDEO,
Hans Verkuil07151722006-04-01 18:03:23 -0300536 .amux = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1,
537 MSP_DSP_IN_SCART, MSP_DSP_IN_SCART),
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300538 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800539 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300540 [EM2820_BOARD_DLINK_USB_TV] = {
541 .name = "D-Link DUB-T210 TV Tuner",
542 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300543 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
544 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300545 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300546 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300547 .type = EM28XX_VMUX_TELEVISION,
548 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300549 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300550 }, {
551 .type = EM28XX_VMUX_COMPOSITE1,
552 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300553 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300554 }, {
555 .type = EM28XX_VMUX_SVIDEO,
556 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300557 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300558 } },
559 },
560 [EM2820_BOARD_HERCULES_SMART_TV_USB2] = {
561 .name = "Hercules Smart TV USB 2.0",
562 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300563 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
564 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300565 .decoder = EM28XX_SAA711X,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300566 .input = { {
567 .type = EM28XX_VMUX_TELEVISION,
568 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300569 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300570 }, {
571 .type = EM28XX_VMUX_COMPOSITE1,
572 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300573 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300574 }, {
575 .type = EM28XX_VMUX_SVIDEO,
576 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300577 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300578 } },
579 },
580 [EM2820_BOARD_PINNACLE_USB_2_FM1216ME] = {
581 .name = "Pinnacle PCTV USB 2 (Philips FM1216ME)",
582 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300583 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
584 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300585 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300586 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300587 .type = EM28XX_VMUX_TELEVISION,
588 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300589 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300590 }, {
591 .type = EM28XX_VMUX_COMPOSITE1,
592 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300593 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300594 }, {
595 .type = EM28XX_VMUX_SVIDEO,
596 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300597 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300598 } },
599 },
600 [EM2820_BOARD_GADMEI_UTV310] = {
601 .name = "Gadmei UTV310",
602 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300603 .tuner_type = TUNER_TNF_5335MF,
604 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300605 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300606 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300607 .type = EM28XX_VMUX_TELEVISION,
608 .vmux = SAA7115_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300609 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300610 }, {
611 .type = EM28XX_VMUX_COMPOSITE1,
612 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300613 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300614 }, {
615 .type = EM28XX_VMUX_SVIDEO,
616 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300617 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300618 } },
619 },
620 [EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE] = {
621 .name = "Leadtek Winfast USB II Deluxe",
622 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300623 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
Magnus Almca39d842009-11-13 05:48:24 -0300624 .has_ir_i2c = 1,
625 .tvaudio_addr = 0x58,
626 .tda9887_conf = TDA9887_PRESENT |
627 TDA9887_PORT2_ACTIVE |
628 TDA9887_QSS,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300629 .decoder = EM28XX_SAA711X,
Magnus Almca39d842009-11-13 05:48:24 -0300630 .adecoder = EM28XX_TVAUDIO,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300631 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300632 .type = EM28XX_VMUX_TELEVISION,
Magnus Almca39d842009-11-13 05:48:24 -0300633 .vmux = SAA7115_COMPOSITE4,
634 .amux = EM28XX_AMUX_AUX,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300635 }, {
636 .type = EM28XX_VMUX_COMPOSITE1,
Magnus Almca39d842009-11-13 05:48:24 -0300637 .vmux = SAA7115_COMPOSITE5,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300638 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300639 }, {
640 .type = EM28XX_VMUX_SVIDEO,
Magnus Almca39d842009-11-13 05:48:24 -0300641 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300642 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300643 } },
Magnus Almca39d842009-11-13 05:48:24 -0300644 .radio = {
645 .type = EM28XX_RADIO,
646 .amux = EM28XX_AMUX_AUX,
647 }
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300648 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300649 [EM2820_BOARD_VIDEOLOGY_20K14XUSB] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300650 .name = "Videology 20K14XUSB USB2.0",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300651 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehab8a2e6992009-07-12 10:26:36 -0300652 .tuner_type = TUNER_ABSENT,
653 .is_webcam = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300654 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300655 .type = EM28XX_VMUX_COMPOSITE1,
656 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300657 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300658 } },
659 },
Mauro Carvalho Chehab02e78042009-06-29 11:35:05 -0300660 [EM2820_BOARD_SILVERCREST_WEBCAM] = {
661 .name = "Silvercrest Webcam 1.3mpix",
662 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabc43221d2009-07-12 10:23:23 -0300663 .is_webcam = 1,
Mauro Carvalho Chehab02e78042009-06-29 11:35:05 -0300664 .input = { {
665 .type = EM28XX_VMUX_COMPOSITE1,
666 .vmux = 0,
667 .amux = EM28XX_AMUX_VIDEO,
668 .gpio = silvercrest_reg_seq,
669 } },
670 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300671 [EM2821_BOARD_SUPERCOMP_USB_2] = {
672 .name = "Supercomp USB 2.0 TV",
673 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300674 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
675 .tda9887_conf = TDA9887_PRESENT |
676 TDA9887_PORT1_ACTIVE |
677 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300678 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300679 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300680 .type = EM28XX_VMUX_TELEVISION,
681 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300682 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300683 }, {
684 .type = EM28XX_VMUX_COMPOSITE1,
685 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300686 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300687 }, {
688 .type = EM28XX_VMUX_SVIDEO,
689 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300690 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300691 } },
692 },
693 [EM2821_BOARD_USBGEAR_VD204] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300694 .name = "Usbgear VD204v9",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300695 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300696 .tuner_type = TUNER_ABSENT, /* Capture only device */
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300697 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300698 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300699 .type = EM28XX_VMUX_COMPOSITE1,
700 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300701 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300702 }, {
703 .type = EM28XX_VMUX_SVIDEO,
704 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300705 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300706 } },
707 },
708 [EM2860_BOARD_NETGMBH_CAM] = {
709 /* Beijing Huaqi Information Digital Technology Co., Ltd */
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300710 .name = "NetGMBH Cam",
711 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehab8a2e6992009-07-12 10:26:36 -0300712 .tuner_type = TUNER_ABSENT,
713 .is_webcam = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300714 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300715 .type = EM28XX_VMUX_COMPOSITE1,
716 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300717 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300718 } },
719 },
720 [EM2860_BOARD_TYPHOON_DVD_MAKER] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300721 .name = "Typhoon DVD Maker",
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300722 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300723 .tuner_type = TUNER_ABSENT, /* Capture only device */
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300724 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300725 .type = EM28XX_VMUX_COMPOSITE1,
726 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300727 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300728 }, {
729 .type = EM28XX_VMUX_SVIDEO,
730 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300731 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300732 } },
733 },
734 [EM2860_BOARD_GADMEI_UTV330] = {
735 .name = "Gadmei UTV330",
736 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300737 .tuner_type = TUNER_TNF_5335MF,
738 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300739 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300740 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300741 .type = EM28XX_VMUX_TELEVISION,
742 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300743 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300744 }, {
745 .type = EM28XX_VMUX_COMPOSITE1,
746 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300747 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300748 }, {
749 .type = EM28XX_VMUX_SVIDEO,
750 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300751 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300752 } },
753 },
Mauro Carvalho Chehab6d888a62009-08-30 13:05:56 -0300754 [EM2861_BOARD_GADMEI_UTV330PLUS] = {
755 .name = "Gadmei UTV330+",
756 .tuner_type = TUNER_TNF_5335MF,
757 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -0300758 .ir_codes = RC_MAP_GADMEI_RM008Z,
Mauro Carvalho Chehab6d888a62009-08-30 13:05:56 -0300759 .decoder = EM28XX_SAA711X,
760 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
761 .input = { {
762 .type = EM28XX_VMUX_TELEVISION,
763 .vmux = SAA7115_COMPOSITE2,
764 .amux = EM28XX_AMUX_VIDEO,
765 }, {
766 .type = EM28XX_VMUX_COMPOSITE1,
767 .vmux = SAA7115_COMPOSITE0,
768 .amux = EM28XX_AMUX_LINE_IN,
769 }, {
770 .type = EM28XX_VMUX_SVIDEO,
771 .vmux = SAA7115_SVIDEO3,
772 .amux = EM28XX_AMUX_LINE_IN,
773 } },
774 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300775 [EM2860_BOARD_TERRATEC_HYBRID_XS] = {
776 .name = "Terratec Cinergy A Hybrid XS",
777 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300778 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300779 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300780 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300781
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300782 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300783 .type = EM28XX_VMUX_TELEVISION,
784 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300785 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300786 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300787 }, {
788 .type = EM28XX_VMUX_COMPOSITE1,
789 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300790 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300791 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300792 }, {
793 .type = EM28XX_VMUX_SVIDEO,
794 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300795 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300796 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300797 } },
798 },
799 [EM2861_BOARD_KWORLD_PVRTV_300U] = {
800 .name = "KWorld PVRTV 300U",
801 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300802 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300803 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300804 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300805 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300806 .type = EM28XX_VMUX_TELEVISION,
807 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300808 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300809 }, {
810 .type = EM28XX_VMUX_COMPOSITE1,
811 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300812 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300813 }, {
814 .type = EM28XX_VMUX_SVIDEO,
815 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300816 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300817 } },
818 },
819 [EM2861_BOARD_YAKUMO_MOVIE_MIXER] = {
820 .name = "Yakumo MovieMixer",
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -0300821 .tuner_type = TUNER_ABSENT, /* Capture only device */
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300822 .decoder = EM28XX_TVP5150,
823 .input = { {
824 .type = EM28XX_VMUX_TELEVISION,
825 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300826 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300827 }, {
828 .type = EM28XX_VMUX_COMPOSITE1,
829 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300830 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300831 }, {
832 .type = EM28XX_VMUX_SVIDEO,
833 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300834 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300835 } },
836 },
Devin Heitmueller443fed92010-03-19 23:53:12 -0300837 [EM2860_BOARD_TVP5150_REFERENCE_DESIGN] = {
838 .name = "EM2860/TVP5150 Reference Design",
839 .tuner_type = TUNER_ABSENT, /* Capture only device */
840 .decoder = EM28XX_TVP5150,
841 .input = { {
842 .type = EM28XX_VMUX_COMPOSITE1,
843 .vmux = TVP5150_COMPOSITE1,
844 .amux = EM28XX_AMUX_LINE_IN,
845 }, {
846 .type = EM28XX_VMUX_SVIDEO,
847 .vmux = TVP5150_SVIDEO,
848 .amux = EM28XX_AMUX_LINE_IN,
849 } },
850 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300851 [EM2861_BOARD_PLEXTOR_PX_TV100U] = {
852 .name = "Plextor ConvertX PX-TV100U",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300853 .tuner_type = TUNER_TNF_5335MF,
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -0300854 .xclk = EM28XX_XCLK_I2S_MSB_TIMING |
855 EM28XX_XCLK_FREQUENCY_12MHZ,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300856 .tda9887_conf = TDA9887_PRESENT,
857 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -0300858 .has_msp34xx = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300859 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300860 .type = EM28XX_VMUX_TELEVISION,
861 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300862 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -0300863 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300864 }, {
865 .type = EM28XX_VMUX_COMPOSITE1,
866 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300867 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -0300868 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300869 }, {
870 .type = EM28XX_VMUX_SVIDEO,
871 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300872 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -0300873 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300874 } },
875 },
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300876
877 /* Those boards with em2870 are DVB Only*/
878
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300879 [EM2870_BOARD_TERRATEC_XS] = {
880 .name = "Terratec Cinergy T XS",
881 .valid = EM28XX_BOARD_NOT_VALIDATED,
882 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300883 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300884 },
885 [EM2870_BOARD_TERRATEC_XS_MT2060] = {
886 .name = "Terratec Cinergy T XS (MT2060)",
887 .valid = EM28XX_BOARD_NOT_VALIDATED,
888 .tuner_type = TUNER_ABSENT, /* MT2060 */
889 },
890 [EM2870_BOARD_KWORLD_350U] = {
891 .name = "Kworld 350 U DVB-T",
892 .valid = EM28XX_BOARD_NOT_VALIDATED,
893 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300894 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300895 },
896 [EM2870_BOARD_KWORLD_355U] = {
897 .name = "Kworld 355 U DVB-T",
898 .valid = EM28XX_BOARD_NOT_VALIDATED,
Aivar Päkk1985f6f2011-12-11 18:15:00 -0300899 .tuner_type = TUNER_ABSENT,
900 .tuner_gpio = default_tuner_gpio,
901 .has_dvb = 1,
902 .dvb_gpio = default_digital,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300903 },
904 [EM2870_BOARD_PINNACLE_PCTV_DVB] = {
905 .name = "Pinnacle PCTV DVB-T",
906 .valid = EM28XX_BOARD_NOT_VALIDATED,
907 .tuner_type = TUNER_ABSENT, /* MT2060 */
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300908 /* djh - I have serious doubts this is right... */
909 .xclk = EM28XX_XCLK_IR_RC5_MODE |
910 EM28XX_XCLK_FREQUENCY_10MHZ,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300911 },
912 [EM2870_BOARD_COMPRO_VIDEOMATE] = {
913 .name = "Compro, VideoMate U3",
914 .valid = EM28XX_BOARD_NOT_VALIDATED,
915 .tuner_type = TUNER_ABSENT, /* MT2060 */
916 },
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300917
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300918 [EM2880_BOARD_TERRATEC_HYBRID_XS_FR] = {
919 .name = "Terratec Hybrid XS Secam",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300920 .has_msp34xx = 1,
921 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300922 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300923 .decoder = EM28XX_TVP5150,
Catimimi65638012010-02-18 18:06:32 -0300924 .has_dvb = 1,
Michel Garniercec4e6c2010-10-16 14:42:01 -0300925 .dvb_gpio = terratec_cinergy_USB_XS_FR_digital,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300926 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300927 .type = EM28XX_VMUX_TELEVISION,
928 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300929 .amux = EM28XX_AMUX_VIDEO,
Michel Garniercec4e6c2010-10-16 14:42:01 -0300930 .gpio = terratec_cinergy_USB_XS_FR_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300931 }, {
932 .type = EM28XX_VMUX_COMPOSITE1,
933 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300934 .amux = EM28XX_AMUX_LINE_IN,
Michel Garniercec4e6c2010-10-16 14:42:01 -0300935 .gpio = terratec_cinergy_USB_XS_FR_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300936 }, {
937 .type = EM28XX_VMUX_SVIDEO,
938 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300939 .amux = EM28XX_AMUX_LINE_IN,
Michel Garniercec4e6c2010-10-16 14:42:01 -0300940 .gpio = terratec_cinergy_USB_XS_FR_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300941 } },
942 },
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -0300943 [EM2884_BOARD_TERRATEC_H5] = {
944 .name = "Terratec Cinergy H5",
945 .has_dvb = 1,
946#if 0
947 .tuner_type = TUNER_PHILIPS_TDA8290,
948 .tuner_addr = 0x41,
949 .dvb_gpio = terratec_h5_digital, /* FIXME: probably wrong */
950 .tuner_gpio = terratec_h5_gpio,
Mauro Carvalho Chehabde724052011-11-20 11:23:24 -0200951#else
952 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -0300953#endif
954 .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT |
955 EM28XX_I2C_CLK_WAIT_ENABLE |
956 EM28XX_I2C_FREQ_400_KHZ,
957 },
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -0300958 [EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C] = {
959 .name = "Hauppauge WinTV HVR 930C",
960 .has_dvb = 1,
Mauro Carvalho Chehabde724052011-11-20 11:23:24 -0200961#if 0 /* FIXME: Add analog support */
962 .tuner_type = TUNER_XC5000,
963 .tuner_addr = 0x41,
964 .dvb_gpio = hauppauge_930c_digital,
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -0300965 .tuner_gpio = hauppauge_930c_gpio,
Mauro Carvalho Chehabde724052011-11-20 11:23:24 -0200966#else
967 .tuner_type = TUNER_ABSENT,
968#endif
Mauro Carvalho Chehabdfbbf5da2011-11-20 12:16:25 -0200969 .ir_codes = RC_MAP_HAUPPAUGE,
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -0300970 .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT |
971 EM28XX_I2C_CLK_WAIT_ENABLE |
972 EM28XX_I2C_FREQ_400_KHZ,
973 },
Andreas Oberrittera1ed02e2011-11-16 11:06:50 -0300974 [EM2884_BOARD_CINERGY_HTC_STICK] = {
975 .name = "Terratec Cinergy HTC Stick",
976 .has_dvb = 1,
977#if 0
978 .tuner_type = TUNER_PHILIPS_TDA8290,
979 .tuner_addr = 0x41,
980 .dvb_gpio = terratec_h5_digital, /* FIXME: probably wrong */
981 .tuner_gpio = terratec_h5_gpio,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800982#endif
983 .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT |
984 EM28XX_I2C_CLK_WAIT_ENABLE |
985 EM28XX_I2C_FREQ_400_KHZ,
986 },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300987 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900] = {
Aidan Thornton122d1582007-11-20 15:25:08 -0300988 .name = "Hauppauge WinTV HVR 900",
Aidan Thornton122d1582007-11-20 15:25:08 -0300989 .tda9887_conf = TDA9887_PRESENT,
990 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300991 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab5add9a62007-11-22 12:08:53 -0300992 .mts_firmware = 1,
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300993 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300994 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehabaf86ce72011-01-24 12:18:48 -0300995 .ir_codes = RC_MAP_HAUPPAUGE,
Aidan Thornton122d1582007-11-20 15:25:08 -0300996 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300997 .input = { {
Aidan Thornton122d1582007-11-20 15:25:08 -0300998 .type = EM28XX_VMUX_TELEVISION,
999 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001000 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001001 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001002 }, {
Aidan Thornton122d1582007-11-20 15:25:08 -03001003 .type = EM28XX_VMUX_COMPOSITE1,
1004 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001005 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001006 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001007 }, {
Aidan Thornton122d1582007-11-20 15:25:08 -03001008 .type = EM28XX_VMUX_SVIDEO,
1009 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001010 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001011 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001012 } },
Aidan Thornton122d1582007-11-20 15:25:08 -03001013 },
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001014 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2] = {
1015 .name = "Hauppauge WinTV HVR 900 (R2)",
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001016 .tda9887_conf = TDA9887_PRESENT,
1017 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001018 .tuner_gpio = default_tuner_gpio,
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001019 .mts_firmware = 1,
Devin Heitmueller75e2b862011-03-13 02:01:02 -03001020 .has_dvb = 1,
Devin Heitmueller7030f522011-03-13 02:04:53 -03001021 .dvb_gpio = hauppauge_wintv_hvr_900R2_digital,
Mauro Carvalho Chehabaf86ce72011-01-24 12:18:48 -03001022 .ir_codes = RC_MAP_HAUPPAUGE,
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001023 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001024 .input = { {
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001025 .type = EM28XX_VMUX_TELEVISION,
1026 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001027 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001028 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001029 }, {
1030 .type = EM28XX_VMUX_COMPOSITE1,
1031 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehaba5942b52008-11-27 07:44:00 -03001032 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001033 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001034 }, {
1035 .type = EM28XX_VMUX_SVIDEO,
1036 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001037 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001038 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001039 } },
1040 },
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03001041 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850] = {
1042 .name = "Hauppauge WinTV HVR 850",
1043 .tuner_type = TUNER_XC2028,
1044 .tuner_gpio = default_tuner_gpio,
1045 .mts_firmware = 1,
1046 .has_dvb = 1,
1047 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehabaf86ce72011-01-24 12:18:48 -03001048 .ir_codes = RC_MAP_HAUPPAUGE,
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03001049 .decoder = EM28XX_TVP5150,
1050 .input = { {
1051 .type = EM28XX_VMUX_TELEVISION,
1052 .vmux = TVP5150_COMPOSITE0,
1053 .amux = EM28XX_AMUX_VIDEO,
1054 .gpio = hauppauge_wintv_hvr_900_analog,
1055 }, {
1056 .type = EM28XX_VMUX_COMPOSITE1,
1057 .vmux = TVP5150_COMPOSITE1,
1058 .amux = EM28XX_AMUX_LINE_IN,
1059 .gpio = hauppauge_wintv_hvr_900_analog,
1060 }, {
1061 .type = EM28XX_VMUX_SVIDEO,
1062 .vmux = TVP5150_SVIDEO,
1063 .amux = EM28XX_AMUX_LINE_IN,
1064 .gpio = hauppauge_wintv_hvr_900_analog,
1065 } },
1066 },
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001067 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950] = {
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -03001068 .name = "Hauppauge WinTV HVR 950",
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -03001069 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001070 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -03001071 .mts_firmware = 1,
Mauro Carvalho Chehab227ad4a2008-04-17 21:37:40 -03001072 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001073 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehab15195d32011-01-24 12:18:47 -03001074 .ir_codes = RC_MAP_HAUPPAUGE,
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -03001075 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001076 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001077 .type = EM28XX_VMUX_TELEVISION,
1078 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001079 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001080 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001081 }, {
Mauro Carvalho Chehab7d070e22007-11-01 21:52:58 -03001082 .type = EM28XX_VMUX_COMPOSITE1,
1083 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001084 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001085 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001086 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001087 .type = EM28XX_VMUX_SVIDEO,
1088 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001089 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001090 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001091 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001092 },
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001093 [EM2880_BOARD_PINNACLE_PCTV_HD_PRO] = {
1094 .name = "Pinnacle PCTV HD Pro Stick",
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001095 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001096 .tuner_gpio = default_tuner_gpio,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001097 .mts_firmware = 1,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001098 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001099 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001100 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001101 .decoder = EM28XX_TVP5150,
1102 .input = { {
1103 .type = EM28XX_VMUX_TELEVISION,
1104 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001105 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001106 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001107 }, {
1108 .type = EM28XX_VMUX_COMPOSITE1,
1109 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001110 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001111 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001112 }, {
1113 .type = EM28XX_VMUX_SVIDEO,
1114 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001115 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001116 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001117 } },
1118 },
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001119 [EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600] = {
1120 .name = "AMD ATI TV Wonder HD 600",
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001121 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001122 .tuner_gpio = default_tuner_gpio,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001123 .mts_firmware = 1,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001124 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001125 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001126 .ir_codes = RC_MAP_ATI_TV_WONDER_HD_600,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001127 .decoder = EM28XX_TVP5150,
1128 .input = { {
1129 .type = EM28XX_VMUX_TELEVISION,
1130 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001131 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001132 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001133 }, {
1134 .type = EM28XX_VMUX_COMPOSITE1,
1135 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001136 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001137 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001138 }, {
1139 .type = EM28XX_VMUX_SVIDEO,
1140 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001141 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001142 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001143 } },
1144 },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001145 [EM2880_BOARD_TERRATEC_HYBRID_XS] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001146 .name = "Terratec Hybrid XS",
1147 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001148 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001149 .decoder = EM28XX_TVP5150,
reinhard schwab655b8402008-07-26 10:47:00 -03001150 .has_dvb = 1,
Devin Heitmuellerf7976082009-06-22 22:32:32 -03001151 .dvb_gpio = default_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001152 .ir_codes = RC_MAP_TERRATEC_CINERGY_XS,
Devin Heitmueller8cd9aae2009-08-03 23:56:51 -03001153 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001154 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001155 .type = EM28XX_VMUX_TELEVISION,
1156 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001157 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001158 .gpio = default_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001159 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001160 .type = EM28XX_VMUX_COMPOSITE1,
1161 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001162 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001163 .gpio = default_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001164 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001165 .type = EM28XX_VMUX_SVIDEO,
1166 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001167 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001168 .gpio = default_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001169 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001170 },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001171 /* maybe there's a reason behind it why Terratec sells the Hybrid XS
1172 as Prodigy XS with a different PID, let's keep it separated for now
1173 maybe we'll need it lateron */
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001174 [EM2880_BOARD_TERRATEC_PRODIGY_XS] = {
1175 .name = "Terratec Prodigy XS",
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001176 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001177 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001178 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001179 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001180 .type = EM28XX_VMUX_TELEVISION,
1181 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001182 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001183 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001184 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001185 .type = EM28XX_VMUX_COMPOSITE1,
1186 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001187 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001188 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001189 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001190 .type = EM28XX_VMUX_SVIDEO,
1191 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001192 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001193 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001194 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001195 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001196 [EM2820_BOARD_MSI_VOX_USB_2] = {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001197 .name = "MSI VOX USB 2.0",
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001198 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1199 .tda9887_conf = TDA9887_PRESENT |
1200 TDA9887_PORT1_ACTIVE |
1201 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001202 .max_range_640_480 = 1,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001203 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001204 .input = { {
1205 .type = EM28XX_VMUX_TELEVISION,
1206 .vmux = SAA7115_COMPOSITE4,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001207 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001208 }, {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001209 .type = EM28XX_VMUX_COMPOSITE1,
1210 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001211 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001212 }, {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001213 .type = EM28XX_VMUX_SVIDEO,
1214 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001215 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001216 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001217 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001218 [EM2800_BOARD_TERRATEC_CINERGY_200] = {
1219 .name = "Terratec Cinergy 200 USB",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001220 .is_em2800 = 1,
Mauro Carvalho Chehabac07bb72009-09-08 14:04:41 -03001221 .has_ir_i2c = 1,
Sascha Sommer53b667e2012-01-08 16:41:22 -03001222 .tuner_type = TUNER_LG_TALN,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001223 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001224 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001225 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001226 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001227 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001228 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001229 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001230 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001231 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001232 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001233 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001234 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001235 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001236 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001237 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001238 },
Aron Szabo59d07f12008-07-27 13:47:52 -03001239 [EM2800_BOARD_GRABBEEX_USB2800] = {
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03001240 .name = "eMPIA Technology, Inc. GrabBeeX+ Video Encoder",
1241 .is_em2800 = 1,
1242 .decoder = EM28XX_SAA711X,
1243 .tuner_type = TUNER_ABSENT, /* capture only board */
1244 .input = { {
Aron Szabo59d07f12008-07-27 13:47:52 -03001245 .type = EM28XX_VMUX_COMPOSITE1,
1246 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001247 .amux = EM28XX_AMUX_LINE_IN,
Aron Szabo59d07f12008-07-27 13:47:52 -03001248 }, {
1249 .type = EM28XX_VMUX_SVIDEO,
1250 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001251 .amux = EM28XX_AMUX_LINE_IN,
Aron Szabo59d07f12008-07-27 13:47:52 -03001252 } },
1253 },
Mauro Carvalho Chehab694a1012009-11-26 21:26:13 -03001254 [EM2800_BOARD_VC211A] = {
1255 .name = "Actionmaster/LinXcel/Digitus VC211A",
1256 .is_em2800 = 1,
1257 .tuner_type = TUNER_ABSENT, /* Capture-only board */
1258 .decoder = EM28XX_SAA711X,
1259 .input = { {
1260 .type = EM28XX_VMUX_COMPOSITE1,
1261 .vmux = SAA7115_COMPOSITE0,
1262 .amux = EM28XX_AMUX_LINE_IN,
1263 .gpio = vc211a_enable,
1264 }, {
1265 .type = EM28XX_VMUX_SVIDEO,
1266 .vmux = SAA7115_SVIDEO3,
1267 .amux = EM28XX_AMUX_LINE_IN,
1268 .gpio = vc211a_enable,
1269 } },
1270 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001271 [EM2800_BOARD_LEADTEK_WINFAST_USBII] = {
1272 .name = "Leadtek Winfast USB II",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001273 .is_em2800 = 1,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001274 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1275 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001276 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001277 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001278 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001279 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001280 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001281 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001282 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001283 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001284 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001285 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001286 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001287 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001288 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001289 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001290 },
1291 [EM2800_BOARD_KWORLD_USB2800] = {
1292 .name = "Kworld USB2800",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001293 .is_em2800 = 1,
Michael Krufkyab8b8702008-04-22 14:46:05 -03001294 .tuner_type = TUNER_PHILIPS_FCV1236D,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001295 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001296 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001297 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001298 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001299 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001300 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001301 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001302 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001303 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001304 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001305 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001306 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001307 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001308 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001309 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001310 },
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -08001311 [EM2820_BOARD_PINNACLE_DVC_90] = {
Douglas Schilling Landgrafea476892009-09-06 18:41:59 -03001312 .name = "Pinnacle Dazzle DVC 90/100/101/107 / Kaiser Baas Video to DVD maker "
Don Kramer74e07f32012-01-02 16:15:44 -03001313 "/ Kworld DVD Maker 2 / Plextor ConvertX PX-AV100U",
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -03001314 .tuner_type = TUNER_ABSENT, /* capture only board */
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001315 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001316 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001317 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001318 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001319 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001320 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001321 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001322 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001323 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001324 } },
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -08001325 },
Sascha Sommer43625592007-11-03 15:05:07 -03001326 [EM2800_BOARD_VGEAR_POCKETTV] = {
1327 .name = "V-Gear PocketTV",
1328 .is_em2800 = 1,
Sascha Sommer43625592007-11-03 15:05:07 -03001329 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1330 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001331 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001332 .input = { {
Sascha Sommer43625592007-11-03 15:05:07 -03001333 .type = EM28XX_VMUX_TELEVISION,
1334 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001335 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001336 }, {
Sascha Sommer43625592007-11-03 15:05:07 -03001337 .type = EM28XX_VMUX_COMPOSITE1,
1338 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001339 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001340 }, {
Sascha Sommer43625592007-11-03 15:05:07 -03001341 .type = EM28XX_VMUX_SVIDEO,
1342 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001343 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001344 } },
Sascha Sommer43625592007-11-03 15:05:07 -03001345 },
Douglas Schilling Landgraf1e1addd2008-12-27 21:38:14 -03001346 [EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2] = {
1347 .name = "Pixelview PlayTV Box 4 USB 2.0",
1348 .tda9887_conf = TDA9887_PRESENT,
1349 .tuner_type = TUNER_YMEC_TVF_5533MF,
1350 .decoder = EM28XX_SAA711X,
1351 .input = { {
1352 .type = EM28XX_VMUX_TELEVISION,
1353 .vmux = SAA7115_COMPOSITE2,
1354 .amux = EM28XX_AMUX_VIDEO,
1355 .aout = EM28XX_AOUT_MONO | /* I2S */
1356 EM28XX_AOUT_MASTER, /* Line out pin */
1357 }, {
1358 .type = EM28XX_VMUX_COMPOSITE1,
1359 .vmux = SAA7115_COMPOSITE0,
1360 .amux = EM28XX_AMUX_LINE_IN,
1361 }, {
1362 .type = EM28XX_VMUX_SVIDEO,
1363 .vmux = SAA7115_SVIDEO3,
1364 .amux = EM28XX_AMUX_LINE_IN,
1365 } },
1366 },
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001367 [EM2820_BOARD_PROLINK_PLAYTV_USB2] = {
Douglas Schilling Landgraf1f372a92009-02-25 16:54:31 -03001368 .name = "SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0",
Douglas Schilling Landgraf5609cfd2008-12-27 21:39:35 -03001369 .has_snapshot_button = 1,
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001370 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03001371 .tuner_type = TUNER_YMEC_TVF_5533MF,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001372 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001373 .input = { {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001374 .type = EM28XX_VMUX_TELEVISION,
1375 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab30e4ac72008-11-20 13:43:05 -03001376 .amux = EM28XX_AMUX_VIDEO,
1377 .aout = EM28XX_AOUT_MONO | /* I2S */
1378 EM28XX_AOUT_MASTER, /* Line out pin */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001379 }, {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001380 .type = EM28XX_VMUX_COMPOSITE1,
1381 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab7463dda2008-02-05 22:29:26 -03001382 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001383 }, {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001384 .type = EM28XX_VMUX_SVIDEO,
1385 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab7463dda2008-02-05 22:29:26 -03001386 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001387 } },
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001388 },
Devin Heitmueller3ed58ba2009-05-27 23:27:26 -03001389 [EM2860_BOARD_SAA711X_REFERENCE_DESIGN] = {
1390 .name = "EM2860/SAA711X Reference Design",
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001391 .has_snapshot_button = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001392 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001393 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001394 .input = { {
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001395 .type = EM28XX_VMUX_SVIDEO,
1396 .vmux = SAA7115_SVIDEO3,
Devin Heitmueller3ed58ba2009-05-27 23:27:26 -03001397 }, {
1398 .type = EM28XX_VMUX_COMPOSITE1,
1399 .vmux = SAA7115_COMPOSITE0,
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001400 } },
1401 },
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03001402
Mauro Carvalho Chehabebaefdb2011-06-01 10:16:25 -03001403 [EM2874_BOARD_LEADERSHIP_ISDBT] = {
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03001404 .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT |
1405 EM28XX_I2C_CLK_WAIT_ENABLE |
1406 EM28XX_I2C_FREQ_100_KHZ,
1407 .xclk = EM28XX_XCLK_FREQUENCY_10MHZ,
1408 .name = "EM2874 Leadership ISDBT",
1409 .tuner_type = TUNER_ABSENT,
1410 .tuner_gpio = leadership_reset,
1411 .dvb_gpio = leadership_digital,
1412 .has_dvb = 1,
1413 },
1414
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001415 [EM2880_BOARD_MSI_DIGIVOX_AD] = {
1416 .name = "MSI DigiVox A/D",
1417 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001418 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001419 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001420 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001421 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001422 .type = EM28XX_VMUX_TELEVISION,
1423 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001424 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001425 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001426 }, {
1427 .type = EM28XX_VMUX_COMPOSITE1,
1428 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001429 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001430 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001431 }, {
1432 .type = EM28XX_VMUX_SVIDEO,
1433 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001434 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001435 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001436 } },
1437 },
1438 [EM2880_BOARD_MSI_DIGIVOX_AD_II] = {
1439 .name = "MSI DigiVox A/D II",
1440 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001441 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001442 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001443 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001444 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001445 .type = EM28XX_VMUX_TELEVISION,
1446 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001447 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001448 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001449 }, {
1450 .type = EM28XX_VMUX_COMPOSITE1,
1451 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001452 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001453 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001454 }, {
1455 .type = EM28XX_VMUX_SVIDEO,
1456 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001457 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001458 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001459 } },
1460 },
1461 [EM2880_BOARD_KWORLD_DVB_305U] = {
1462 .name = "KWorld DVB-T 305U",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001463 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001464 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001465 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001466 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001467 .type = EM28XX_VMUX_TELEVISION,
1468 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001469 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001470 }, {
1471 .type = EM28XX_VMUX_COMPOSITE1,
1472 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001473 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001474 }, {
1475 .type = EM28XX_VMUX_SVIDEO,
1476 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001477 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001478 } },
1479 },
1480 [EM2880_BOARD_KWORLD_DVB_310U] = {
1481 .name = "KWorld DVB-T 310U",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001482 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001483 .tuner_gpio = default_tuner_gpio,
Darron Broadda3808e2008-09-30 02:46:41 -03001484 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001485 .dvb_gpio = default_digital,
Darron Broadda3808e2008-09-30 02:46:41 -03001486 .mts_firmware = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001487 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001488 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001489 .type = EM28XX_VMUX_TELEVISION,
1490 .vmux = TVP5150_COMPOSITE0,
Darron Broadda3808e2008-09-30 02:46:41 -03001491 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001492 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001493 }, {
1494 .type = EM28XX_VMUX_COMPOSITE1,
1495 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehaba42aa192008-11-19 11:08:53 -03001496 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001497 .gpio = default_analog,
Darron Broadda3808e2008-09-30 02:46:41 -03001498 }, { /* S-video has not been tested yet */
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001499 .type = EM28XX_VMUX_SVIDEO,
1500 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehaba42aa192008-11-19 11:08:53 -03001501 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001502 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001503 } },
1504 },
Franklin Mengd7de5d82009-06-06 17:05:02 -03001505 [EM2882_BOARD_KWORLD_ATSC_315U] = {
1506 .name = "KWorld ATSC 315U HDTV TV Box",
1507 .valid = EM28XX_BOARD_NOT_VALIDATED,
1508 .tuner_type = TUNER_THOMSON_DTT761X,
1509 .tuner_gpio = em2882_kworld_315u_tuner_gpio,
1510 .tda9887_conf = TDA9887_PRESENT,
1511 .decoder = EM28XX_SAA711X,
1512 .has_dvb = 1,
1513 .dvb_gpio = em2882_kworld_315u_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001514 .ir_codes = RC_MAP_KWORLD_315U,
Franklin Mengd7de5d82009-06-06 17:05:02 -03001515 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
1516 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE,
1517 /* Analog mode - still not ready */
1518 /*.input = { {
1519 .type = EM28XX_VMUX_TELEVISION,
1520 .vmux = SAA7115_COMPOSITE2,
1521 .amux = EM28XX_AMUX_VIDEO,
1522 .gpio = em2882_kworld_315u_analog,
1523 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1524 }, {
1525 .type = EM28XX_VMUX_COMPOSITE1,
1526 .vmux = SAA7115_COMPOSITE0,
1527 .amux = EM28XX_AMUX_LINE_IN,
1528 .gpio = em2882_kworld_315u_analog1,
1529 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1530 }, {
1531 .type = EM28XX_VMUX_SVIDEO,
1532 .vmux = SAA7115_SVIDEO3,
1533 .amux = EM28XX_AMUX_LINE_IN,
1534 .gpio = em2882_kworld_315u_analog1,
1535 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1536 } }, */
1537 },
Douglas Schilling Landgrafe5db5d42009-04-09 18:24:34 -03001538 [EM2880_BOARD_EMPIRE_DUAL_TV] = {
1539 .name = "Empire dual TV",
1540 .tuner_type = TUNER_XC2028,
1541 .tuner_gpio = default_tuner_gpio,
1542 .has_dvb = 1,
1543 .dvb_gpio = default_digital,
1544 .mts_firmware = 1,
1545 .decoder = EM28XX_TVP5150,
1546 .input = { {
1547 .type = EM28XX_VMUX_TELEVISION,
1548 .vmux = TVP5150_COMPOSITE0,
1549 .amux = EM28XX_AMUX_VIDEO,
1550 .gpio = default_analog,
1551 }, {
1552 .type = EM28XX_VMUX_COMPOSITE1,
1553 .vmux = TVP5150_COMPOSITE1,
1554 .amux = EM28XX_AMUX_LINE_IN,
1555 .gpio = default_analog,
1556 }, {
1557 .type = EM28XX_VMUX_SVIDEO,
1558 .vmux = TVP5150_SVIDEO,
1559 .amux = EM28XX_AMUX_LINE_IN,
1560 .gpio = default_analog,
1561 } },
1562 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001563 [EM2881_BOARD_DNT_DA2_HYBRID] = {
1564 .name = "DNT DA2 Hybrid",
1565 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001566 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001567 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001568 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001569 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001570 .type = EM28XX_VMUX_TELEVISION,
1571 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001572 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001573 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001574 }, {
1575 .type = EM28XX_VMUX_COMPOSITE1,
1576 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001577 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001578 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001579 }, {
1580 .type = EM28XX_VMUX_SVIDEO,
1581 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001582 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001583 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001584 } },
1585 },
1586 [EM2881_BOARD_PINNACLE_HYBRID_PRO] = {
1587 .name = "Pinnacle Hybrid Pro",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001588 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001589 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001590 .decoder = EM28XX_TVP5150,
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03001591 .has_dvb = 1,
1592 .dvb_gpio = pinnacle_hybrid_pro_digital,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001593 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001594 .type = EM28XX_VMUX_TELEVISION,
1595 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001596 .amux = EM28XX_AMUX_VIDEO,
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03001597 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001598 }, {
1599 .type = EM28XX_VMUX_COMPOSITE1,
1600 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001601 .amux = EM28XX_AMUX_LINE_IN,
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03001602 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001603 }, {
1604 .type = EM28XX_VMUX_SVIDEO,
1605 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001606 .amux = EM28XX_AMUX_LINE_IN,
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03001607 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001608 } },
1609 },
Devin Heitmueller09bc1942011-03-13 02:07:54 -03001610 [EM2882_BOARD_PINNACLE_HYBRID_PRO_330E] = {
1611 .name = "Pinnacle Hybrid Pro (330e)",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001612 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001613 .tuner_gpio = default_tuner_gpio,
Eugeniy Meshcheryakova674a3b2008-08-01 08:23:41 -03001614 .mts_firmware = 1,
Devin Heitmuellerad9b4bb2011-03-13 02:09:59 -03001615 .has_dvb = 1,
1616 .dvb_gpio = hauppauge_wintv_hvr_900R2_digital,
Devin Heitmueller9b316d62011-03-13 02:18:34 -03001617 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001618 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001619 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001620 .type = EM28XX_VMUX_TELEVISION,
1621 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001622 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001623 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001624 }, {
1625 .type = EM28XX_VMUX_COMPOSITE1,
1626 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001627 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001628 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001629 }, {
1630 .type = EM28XX_VMUX_SVIDEO,
1631 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001632 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001633 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001634 } },
1635 },
1636 [EM2882_BOARD_KWORLD_VS_DVBT] = {
1637 .name = "Kworld VS-DVB-T 323UR",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001638 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001639 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001640 .decoder = EM28XX_TVP5150,
Antonio Larrosa811fab62010-03-04 22:19:48 -03001641 .mts_firmware = 1,
1642 .has_dvb = 1,
1643 .dvb_gpio = kworld_330u_digital,
1644 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001645 .ir_codes = RC_MAP_KWORLD_315U,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001646 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001647 .type = EM28XX_VMUX_TELEVISION,
1648 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001649 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001650 }, {
1651 .type = EM28XX_VMUX_COMPOSITE1,
1652 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001653 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001654 }, {
1655 .type = EM28XX_VMUX_SVIDEO,
1656 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001657 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001658 } },
1659 },
1660 [EM2882_BOARD_TERRATEC_HYBRID_XS] = {
Philippe Bourdin91245442010-10-31 09:57:58 -03001661 .name = "Terratec Cinnergy Hybrid T USB XS (em2882)",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001662 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001663 .tuner_gpio = default_tuner_gpio,
Uroš Vamplec994d02009-09-30 22:53:37 -03001664 .mts_firmware = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001665 .decoder = EM28XX_TVP5150,
Uroš Vamplec994d02009-09-30 22:53:37 -03001666 .has_dvb = 1,
1667 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001668 .ir_codes = RC_MAP_TERRATEC_CINERGY_XS,
Uroš Vamplec994d02009-09-30 22:53:37 -03001669 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001670 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001671 .type = EM28XX_VMUX_TELEVISION,
1672 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001673 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001674 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001675 }, {
1676 .type = EM28XX_VMUX_COMPOSITE1,
1677 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001678 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001679 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001680 }, {
1681 .type = EM28XX_VMUX_SVIDEO,
1682 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001683 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001684 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001685 } },
1686 },
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03001687 [EM2882_BOARD_DIKOM_DK300] = {
1688 .name = "Dikom DK300",
1689 .tuner_type = TUNER_XC2028,
1690 .tuner_gpio = default_tuner_gpio,
1691 .decoder = EM28XX_TVP5150,
1692 .mts_firmware = 1,
1693 .has_dvb = 1,
1694 .dvb_gpio = dikom_dk300_digital,
1695 .input = { {
1696 .type = EM28XX_VMUX_TELEVISION,
1697 .vmux = TVP5150_COMPOSITE0,
1698 .amux = EM28XX_AMUX_VIDEO,
1699 .gpio = default_analog,
1700 } },
1701 },
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001702 [EM2883_BOARD_KWORLD_HYBRID_330U] = {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001703 .name = "Kworld PlusTV HD Hybrid 330",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001704 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001705 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001706 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabbe2c6db2008-12-09 15:43:10 -03001707 .mts_firmware = 1,
1708 .has_dvb = 1,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001709 .dvb_gpio = kworld_330u_digital,
1710 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03001711 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
1712 EM28XX_I2C_EEPROM_ON_BOARD |
1713 EM28XX_I2C_EEPROM_KEY_VALID,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001714 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001715 .type = EM28XX_VMUX_TELEVISION,
1716 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001717 .amux = EM28XX_AMUX_VIDEO,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001718 .gpio = kworld_330u_analog,
1719 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001720 }, {
1721 .type = EM28XX_VMUX_COMPOSITE1,
1722 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001723 .amux = EM28XX_AMUX_LINE_IN,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001724 .gpio = kworld_330u_analog,
1725 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001726 }, {
1727 .type = EM28XX_VMUX_SVIDEO,
1728 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001729 .amux = EM28XX_AMUX_LINE_IN,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001730 .gpio = kworld_330u_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001731 } },
1732 },
Mauro Carvalho Chehabee281b82008-07-27 16:58:04 -03001733 [EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU] = {
Vitaly Woold3603342008-07-27 14:10:11 -03001734 .name = "Compro VideoMate ForYou/Stereo",
Vitaly Woold3603342008-07-27 14:10:11 -03001735 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03001736 .tvaudio_addr = 0xb0,
Vitaly Woold3603342008-07-27 14:10:11 -03001737 .tda9887_conf = TDA9887_PRESENT,
1738 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabdf7fa092009-02-25 09:06:13 -03001739 .adecoder = EM28XX_TVAUDIO,
Vitaly Wool2bd1d9eb2009-03-04 08:27:52 -03001740 .mute_gpio = compro_mute_gpio,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001741 .input = { {
Vitaly Woold3603342008-07-27 14:10:11 -03001742 .type = EM28XX_VMUX_TELEVISION,
1743 .vmux = TVP5150_COMPOSITE0,
Vitaly Wool2bd1d9eb2009-03-04 08:27:52 -03001744 .amux = EM28XX_AMUX_VIDEO,
1745 .gpio = compro_unmute_tv_gpio,
Vitaly Woold3603342008-07-27 14:10:11 -03001746 }, {
1747 .type = EM28XX_VMUX_SVIDEO,
1748 .vmux = TVP5150_SVIDEO,
1749 .amux = EM28XX_AMUX_LINE_IN,
Vitaly Wool2bd1d9eb2009-03-04 08:27:52 -03001750 .gpio = compro_unmute_svid_gpio,
Vitaly Woold3603342008-07-27 14:10:11 -03001751 } },
1752 },
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03001753 [EM2860_BOARD_KAIOMY_TVNPC_U2] = {
1754 .name = "Kaiomy TVnPC U2",
1755 .vchannels = 3,
1756 .tuner_type = TUNER_XC2028,
1757 .tuner_addr = 0x61,
1758 .mts_firmware = 1,
1759 .decoder = EM28XX_TVP5150,
1760 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001761 .ir_codes = RC_MAP_KAIOMY,
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03001762 .input = { {
1763 .type = EM28XX_VMUX_TELEVISION,
1764 .vmux = TVP5150_COMPOSITE0,
1765 .amux = EM28XX_AMUX_VIDEO,
1766
1767 }, {
1768 .type = EM28XX_VMUX_COMPOSITE1,
1769 .vmux = TVP5150_COMPOSITE1,
1770 .amux = EM28XX_AMUX_LINE_IN,
1771 }, {
1772 .type = EM28XX_VMUX_SVIDEO,
1773 .vmux = TVP5150_SVIDEO,
1774 .amux = EM28XX_AMUX_LINE_IN,
1775 } },
1776 .radio = {
1777 .type = EM28XX_RADIO,
1778 .amux = EM28XX_AMUX_LINE_IN,
1779 }
Mauro Carvalho Chehab56ee3802009-02-11 14:18:36 -03001780 },
1781 [EM2860_BOARD_EASYCAP] = {
1782 .name = "Easy Cap Capture DC-60",
1783 .vchannels = 2,
1784 .tuner_type = TUNER_ABSENT,
1785 .decoder = EM28XX_SAA711X,
1786 .input = { {
1787 .type = EM28XX_VMUX_COMPOSITE1,
1788 .vmux = SAA7115_COMPOSITE0,
1789 .amux = EM28XX_AMUX_LINE_IN,
1790 }, {
1791 .type = EM28XX_VMUX_SVIDEO,
1792 .vmux = SAA7115_SVIDEO3,
1793 .amux = EM28XX_AMUX_LINE_IN,
1794 } },
1795 },
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03001796 [EM2820_BOARD_IODATA_GVMVP_SZ] = {
1797 .name = "IO-DATA GV-MVP/SZ",
1798 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
1799 .tuner_gpio = default_tuner_gpio,
1800 .tda9887_conf = TDA9887_PRESENT,
1801 .decoder = EM28XX_TVP5150,
1802 .input = { {
1803 .type = EM28XX_VMUX_TELEVISION,
1804 .vmux = TVP5150_COMPOSITE0,
1805 .amux = EM28XX_AMUX_VIDEO,
1806 }, { /* Composite has not been tested yet */
1807 .type = EM28XX_VMUX_COMPOSITE1,
1808 .vmux = TVP5150_COMPOSITE1,
1809 .amux = EM28XX_AMUX_VIDEO,
1810 }, { /* S-video has not been tested yet */
1811 .type = EM28XX_VMUX_SVIDEO,
1812 .vmux = TVP5150_SVIDEO,
1813 .amux = EM28XX_AMUX_VIDEO,
1814 } },
1815 },
Mauro Carvalho Chehab4557af92009-05-23 09:58:52 -03001816 [EM2860_BOARD_TERRATEC_GRABBY] = {
1817 .name = "Terratec Grabby",
1818 .vchannels = 2,
1819 .tuner_type = TUNER_ABSENT,
1820 .decoder = EM28XX_SAA711X,
1821 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
1822 .input = { {
1823 .type = EM28XX_VMUX_COMPOSITE1,
1824 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehaba3fa9042010-10-25 17:51:15 -03001825 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab4557af92009-05-23 09:58:52 -03001826 }, {
1827 .type = EM28XX_VMUX_SVIDEO,
1828 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehaba3fa9042010-10-25 17:51:15 -03001829 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab4557af92009-05-23 09:58:52 -03001830 } },
1831 },
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -03001832 [EM2860_BOARD_TERRATEC_AV350] = {
1833 .name = "Terratec AV350",
1834 .vchannels = 2,
1835 .tuner_type = TUNER_ABSENT,
1836 .decoder = EM28XX_TVP5150,
1837 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
1838 .mute_gpio = terratec_av350_mute_gpio,
1839 .input = { {
1840 .type = EM28XX_VMUX_COMPOSITE1,
1841 .vmux = TVP5150_COMPOSITE1,
1842 .amux = EM28XX_AUDIO_SRC_LINE,
Jean Delvare1df8e982009-05-13 16:48:07 -03001843 .gpio = terratec_av350_unmute_gpio,
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -03001844
1845 }, {
1846 .type = EM28XX_VMUX_SVIDEO,
1847 .vmux = TVP5150_SVIDEO,
1848 .amux = EM28XX_AUDIO_SRC_LINE,
Jean Delvare1df8e982009-05-13 16:48:07 -03001849 .gpio = terratec_av350_unmute_gpio,
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -03001850 } },
1851 },
Adrian Taylor8298f2f2010-10-20 07:55:33 -03001852
1853 [EM2860_BOARD_ELGATO_VIDEO_CAPTURE] = {
1854 .name = "Elgato Video Capture",
1855 .decoder = EM28XX_SAA711X,
1856 .tuner_type = TUNER_ABSENT, /* Capture only device */
1857 .input = { {
1858 .type = EM28XX_VMUX_COMPOSITE1,
1859 .vmux = SAA7115_COMPOSITE0,
1860 .amux = EM28XX_AMUX_LINE_IN,
1861 }, {
1862 .type = EM28XX_VMUX_SVIDEO,
1863 .vmux = SAA7115_SVIDEO3,
1864 .amux = EM28XX_AMUX_LINE_IN,
1865 } },
1866 },
1867
Devin Heitmueller19859222009-06-19 00:33:54 -03001868 [EM2882_BOARD_EVGA_INDTUBE] = {
1869 .name = "Evga inDtube",
1870 .tuner_type = TUNER_XC2028,
1871 .tuner_gpio = default_tuner_gpio,
1872 .decoder = EM28XX_TVP5150,
Devin Heitmuellera4c47302009-06-20 21:34:42 -03001873 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */
Devin Heitmueller19859222009-06-19 00:33:54 -03001874 .mts_firmware = 1,
1875 .has_dvb = 1,
1876 .dvb_gpio = evga_indtube_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001877 .ir_codes = RC_MAP_EVGA_INDTUBE,
Devin Heitmueller19859222009-06-19 00:33:54 -03001878 .input = { {
1879 .type = EM28XX_VMUX_TELEVISION,
1880 .vmux = TVP5150_COMPOSITE0,
1881 .amux = EM28XX_AMUX_VIDEO,
1882 .gpio = evga_indtube_analog,
1883 }, {
1884 .type = EM28XX_VMUX_COMPOSITE1,
1885 .vmux = TVP5150_COMPOSITE1,
1886 .amux = EM28XX_AMUX_LINE_IN,
1887 .gpio = evga_indtube_analog,
1888 }, {
1889 .type = EM28XX_VMUX_SVIDEO,
1890 .vmux = TVP5150_SVIDEO,
1891 .amux = EM28XX_AMUX_LINE_IN,
1892 .gpio = evga_indtube_analog,
1893 } },
1894 },
Antti Palosaari285eb1a2009-09-15 14:42:13 -03001895 /* eb1a:2868 Empia EM2870 + Philips CU1216L NIM (Philips TDA10023 +
1896 Infineon TUA6034) */
1897 [EM2870_BOARD_REDDO_DVB_C_USB_BOX] = {
1898 .name = "Reddo DVB-C USB TV Box",
1899 .tuner_type = TUNER_ABSENT,
Antti Palosaari28f4ddd12009-10-04 12:59:35 -03001900 .tuner_gpio = reddo_dvb_c_usb_box,
Antti Palosaari285eb1a2009-09-15 14:42:13 -03001901 .has_dvb = 1,
Antti Palosaari285eb1a2009-09-15 14:42:13 -03001902 },
Jarod Wilson7e48b302010-03-07 17:55:43 -03001903 /* 1b80:a340 - Empia EM2870, NXP TDA18271HD and LG DT3304, sold
1904 * initially as the KWorld PlusTV 340U, then as the UB435-Q.
1905 * Early variants have a TDA18271HD/C1, later ones a TDA18271HD/C2 */
1906 [EM2870_BOARD_KWORLD_A340] = {
1907 .name = "KWorld PlusTV 340U or UB435-Q (ATSC)",
1908 .tuner_type = TUNER_ABSENT, /* Digital-only TDA18271HD */
1909 .has_dvb = 1,
1910 .dvb_gpio = kworld_a340_digital,
1911 .tuner_gpio = default_tuner_gpio,
1912 },
Antti Palosaari460312e2011-05-25 17:03:50 -03001913 /* 2013:024f PCTV nanoStick T2 290e.
Antti Palosaarid6a5f922011-04-07 16:34:44 -03001914 * Empia EM28174, Sony CXD2820R and NXP TDA18271HD/C2 */
1915 [EM28174_BOARD_PCTV_290E] = {
Antti Palosaari460312e2011-05-25 17:03:50 -03001916 .name = "PCTV nanoStick T2 290e",
Antti Palosaarid6a5f922011-04-07 16:34:44 -03001917 .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT |
1918 EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_FREQ_100_KHZ,
Antti Palosaarid6a5f922011-04-07 16:34:44 -03001919 .tuner_type = TUNER_ABSENT,
1920 .tuner_gpio = pctv_290e,
1921 .has_dvb = 1,
Antti Palosaariff7b9292011-05-25 17:00:35 -03001922 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
Antti Palosaarid6a5f922011-04-07 16:34:44 -03001923 },
Antti Palosaari36588712011-08-01 01:15:30 -03001924 /* 2013:024f PCTV DVB-S2 Stick 460e
1925 * Empia EM28174, NXP TDA10071, Conexant CX24118A and Allegro A8293 */
1926 [EM28174_BOARD_PCTV_460E] = {
1927 .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT |
1928 EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_FREQ_400_KHZ,
1929 .name = "PCTV DVB-S2 Stick (460e)",
1930 .tuner_type = TUNER_ABSENT,
1931 .tuner_gpio = pctv_460e,
1932 .has_dvb = 1,
1933 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
1934 },
Gareth Williams4d28d3d2011-12-24 05:47:29 -03001935 /* eb1a:5006 Honestech VIDBOX NW03
1936 * Empia EM2860, Philips SAA7113, Empia EMP202, No Tuner */
1937 [EM2860_BOARD_HT_VIDBOX_NW03] = {
1938 .name = "Honestech Vidbox NW03",
1939 .tuner_type = TUNER_ABSENT,
1940 .decoder = EM28XX_SAA711X,
1941 .input = { {
1942 .type = EM28XX_VMUX_COMPOSITE1,
1943 .vmux = SAA7115_COMPOSITE0,
1944 .amux = EM28XX_AMUX_LINE_IN,
1945 }, {
1946 .type = EM28XX_VMUX_SVIDEO,
1947 .vmux = SAA7115_SVIDEO3, /* S-VIDEO needs confirming */
1948 .amux = EM28XX_AMUX_LINE_IN,
1949 } },
1950 },
Antti Palosaari35530852012-03-18 18:09:01 -03001951 /* 1b80:e425 MaxMedia UB425-TC
1952 * Empia EM2874B + Micronas DRX 3913KA2 + NXP TDA18271HDC2 */
1953 [EM2874_BOARD_MAXMEDIA_UB425_TC] = {
1954 .name = "MaxMedia UB425-TC",
1955 .tuner_type = TUNER_ABSENT,
1956 .tuner_gpio = maxmedia_ub425_tc,
1957 .has_dvb = 1,
1958 .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT |
1959 EM28XX_I2C_CLK_WAIT_ENABLE |
1960 EM28XX_I2C_FREQ_400_KHZ,
1961 },
Ivan Kalvachevfa5527c2012-03-19 20:09:55 -03001962 /* 2304:0242 PCTV QuatroStick (510e)
1963 * Empia EM2884 + Micronas DRX 3926K + NXP TDA18271HDC2 */
1964 [EM2884_BOARD_PCTV_510E] = {
1965 .name = "PCTV QuatroStick (510e)",
1966 .tuner_type = TUNER_ABSENT,
1967 .tuner_gpio = pctv_510e,
1968 .has_dvb = 1,
1969 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
1970 .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT |
1971 EM28XX_I2C_CLK_WAIT_ENABLE |
1972 EM28XX_I2C_FREQ_400_KHZ,
1973 },
Antti Palosaaric247d7b2012-03-19 11:48:19 -03001974 /* 2013:0251 PCTV QuatroStick nano (520e)
1975 * Empia EM2884 + Micronas DRX 3926K + NXP TDA18271HDC2 */
1976 [EM2884_BOARD_PCTV_520E] = {
1977 .name = "PCTV QuatroStick nano (520e)",
1978 .tuner_type = TUNER_ABSENT,
1979 .tuner_gpio = pctv_520e,
1980 .has_dvb = 1,
1981 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
1982 .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT |
1983 EM28XX_I2C_CLK_WAIT_ENABLE |
1984 EM28XX_I2C_FREQ_400_KHZ,
1985 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001986};
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001987const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001988
1989/* table of devices that work with this driver */
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03001990struct usb_device_id em28xx_id_table[] = {
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001991 { USB_DEVICE(0xeb1a, 0x2750),
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001992 .driver_info = EM2750_BOARD_UNKNOWN },
1993 { USB_DEVICE(0xeb1a, 0x2751),
1994 .driver_info = EM2750_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001995 { USB_DEVICE(0xeb1a, 0x2800),
1996 .driver_info = EM2800_BOARD_UNKNOWN },
Mauro Carvalho Chehab9b4e8452009-08-07 12:08:02 -03001997 { USB_DEVICE(0xeb1a, 0x2710),
1998 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001999 { USB_DEVICE(0xeb1a, 0x2820),
2000 .driver_info = EM2820_BOARD_UNKNOWN },
2001 { USB_DEVICE(0xeb1a, 0x2821),
Devin Heitmuellerc665f4d2008-12-16 23:35:23 -03002002 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002003 { USB_DEVICE(0xeb1a, 0x2860),
2004 .driver_info = EM2820_BOARD_UNKNOWN },
2005 { USB_DEVICE(0xeb1a, 0x2861),
2006 .driver_info = EM2820_BOARD_UNKNOWN },
Devin Heitmuellerf91cb652009-09-30 22:44:19 -03002007 { USB_DEVICE(0xeb1a, 0x2862),
2008 .driver_info = EM2820_BOARD_UNKNOWN },
Devin Heitmueller443fed92010-03-19 23:53:12 -03002009 { USB_DEVICE(0xeb1a, 0x2863),
2010 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002011 { USB_DEVICE(0xeb1a, 0x2870),
2012 .driver_info = EM2820_BOARD_UNKNOWN },
2013 { USB_DEVICE(0xeb1a, 0x2881),
2014 .driver_info = EM2820_BOARD_UNKNOWN },
2015 { USB_DEVICE(0xeb1a, 0x2883),
2016 .driver_info = EM2820_BOARD_UNKNOWN },
Antti Palosaari285eb1a2009-09-15 14:42:13 -03002017 { USB_DEVICE(0xeb1a, 0x2868),
2018 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03002019 { USB_DEVICE(0xeb1a, 0x2875),
2020 .driver_info = EM2820_BOARD_UNKNOWN },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002021 { USB_DEVICE(0xeb1a, 0xe300),
2022 .driver_info = EM2861_BOARD_KWORLD_PVRTV_300U },
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03002023 { USB_DEVICE(0xeb1a, 0xe303),
2024 .driver_info = EM2860_BOARD_KAIOMY_TVNPC_U2 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002025 { USB_DEVICE(0xeb1a, 0xe305),
2026 .driver_info = EM2880_BOARD_KWORLD_DVB_305U },
2027 { USB_DEVICE(0xeb1a, 0xe310),
2028 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD },
Franklin Mengd7de5d82009-06-06 17:05:02 -03002029 { USB_DEVICE(0xeb1a, 0xa313),
2030 .driver_info = EM2882_BOARD_KWORLD_ATSC_315U },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002031 { USB_DEVICE(0xeb1a, 0xa316),
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03002032 .driver_info = EM2883_BOARD_KWORLD_HYBRID_330U },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002033 { USB_DEVICE(0xeb1a, 0xe320),
2034 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD_II },
2035 { USB_DEVICE(0xeb1a, 0xe323),
2036 .driver_info = EM2882_BOARD_KWORLD_VS_DVBT },
2037 { USB_DEVICE(0xeb1a, 0xe350),
2038 .driver_info = EM2870_BOARD_KWORLD_350U },
2039 { USB_DEVICE(0xeb1a, 0xe355),
2040 .driver_info = EM2870_BOARD_KWORLD_355U },
2041 { USB_DEVICE(0xeb1a, 0x2801),
2042 .driver_info = EM2800_BOARD_GRABBEEX_USB2800 },
2043 { USB_DEVICE(0xeb1a, 0xe357),
2044 .driver_info = EM2870_BOARD_KWORLD_355U },
Aivar Päkk1985f6f2011-12-11 18:15:00 -03002045 { USB_DEVICE(0xeb1a, 0xe359),
2046 .driver_info = EM2870_BOARD_KWORLD_355U },
Douglas Schilling Landgrafac40d9e2009-02-25 16:55:48 -03002047 { USB_DEVICE(0x1b80, 0xe302),
2048 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, /* Kaiser Baas Video to DVD maker */
Douglas Schilling Landgrafea476892009-09-06 18:41:59 -03002049 { USB_DEVICE(0x1b80, 0xe304),
2050 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, /* Kworld DVD Maker 2 */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002051 { USB_DEVICE(0x0ccd, 0x0036),
2052 .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002053 { USB_DEVICE(0x0ccd, 0x004c),
2054 .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS_FR },
2055 { USB_DEVICE(0x0ccd, 0x004f),
2056 .driver_info = EM2860_BOARD_TERRATEC_HYBRID_XS },
2057 { USB_DEVICE(0x0ccd, 0x005e),
2058 .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS },
2059 { USB_DEVICE(0x0ccd, 0x0042),
Philippe Bourdin91245442010-10-31 09:57:58 -03002060 .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002061 { USB_DEVICE(0x0ccd, 0x0043),
Mauro Carvalho Chehab4e145342011-11-16 14:38:28 -02002062 .driver_info = EM2870_BOARD_TERRATEC_XS },
Holger Nelson6c3b9062011-12-23 23:15:32 -03002063 { USB_DEVICE(0x0ccd, 0x008e), /* Cinergy HTC USB XS Rev. 1 */
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -03002064 .driver_info = EM2884_BOARD_TERRATEC_H5 },
Holger Nelson6c3b9062011-12-23 23:15:32 -03002065 { USB_DEVICE(0x0ccd, 0x00ac), /* Cinergy HTC USB XS Rev. 2 */
Mauro Carvalho Chehab33ba28e2011-07-14 21:48:00 -03002066 .driver_info = EM2884_BOARD_TERRATEC_H5 },
Mauro Carvalho Chehab4e145342011-11-16 14:38:28 -02002067 { USB_DEVICE(0x0ccd, 0x10a2), /* H5 Rev. 1 */
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002068 .driver_info = EM2884_BOARD_TERRATEC_H5 },
Mauro Carvalho Chehab4e145342011-11-16 14:38:28 -02002069 { USB_DEVICE(0x0ccd, 0x10ad), /* H5 Rev. 2 */
Mauro Carvalho Chehab33ba28e2011-07-14 21:48:00 -03002070 .driver_info = EM2884_BOARD_TERRATEC_H5 },
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -03002071 { USB_DEVICE(0x0ccd, 0x0084),
2072 .driver_info = EM2860_BOARD_TERRATEC_AV350 },
Mauro Carvalho Chehab4557af92009-05-23 09:58:52 -03002073 { USB_DEVICE(0x0ccd, 0x0096),
2074 .driver_info = EM2860_BOARD_TERRATEC_GRABBY },
Tekaefabaaf2011-10-14 05:40:29 -03002075 { USB_DEVICE(0x0ccd, 0x10AF),
2076 .driver_info = EM2860_BOARD_TERRATEC_GRABBY },
Andreas Oberrittera1ed02e2011-11-16 11:06:50 -03002077 { USB_DEVICE(0x0ccd, 0x00b2),
2078 .driver_info = EM2884_BOARD_CINERGY_HTC_STICK },
Adrian Taylor8298f2f2010-10-20 07:55:33 -03002079 { USB_DEVICE(0x0fd9, 0x0033),
2080 .driver_info = EM2860_BOARD_ELGATO_VIDEO_CAPTURE},
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002081 { USB_DEVICE(0x185b, 0x2870),
2082 .driver_info = EM2870_BOARD_COMPRO_VIDEOMATE },
Vitaly Woold3603342008-07-27 14:10:11 -03002083 { USB_DEVICE(0x185b, 0x2041),
Mauro Carvalho Chehabee281b82008-07-27 16:58:04 -03002084 .driver_info = EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002085 { USB_DEVICE(0x2040, 0x4200),
2086 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
Mauro Carvalho Chehab15b9bec2008-01-13 12:02:20 -03002087 { USB_DEVICE(0x2040, 0x4201),
2088 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002089 { USB_DEVICE(0x2040, 0x6500),
2090 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 },
Luc Saillard427d20c2008-01-30 17:23:00 -03002091 { USB_DEVICE(0x2040, 0x6502),
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002092 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2 },
Michael Krufky74ee0512008-05-01 18:02:30 -03002093 { USB_DEVICE(0x2040, 0x6513), /* HCW HVR-980 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002094 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Michael Krufky74ee0512008-05-01 18:02:30 -03002095 { USB_DEVICE(0x2040, 0x6517), /* HP HVR-950 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002096 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Michael Krufky74ee0512008-05-01 18:02:30 -03002097 { USB_DEVICE(0x2040, 0x651b), /* RP HVR-950 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002098 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03002099 { USB_DEVICE(0x2040, 0x651f),
2100 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850 },
Devin Heitmuellere14b3652008-07-26 11:04:33 -03002101 { USB_DEVICE(0x0438, 0xb002),
2102 .driver_info = EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002103 { USB_DEVICE(0x2001, 0xf112),
2104 .driver_info = EM2820_BOARD_DLINK_USB_TV },
2105 { USB_DEVICE(0x2304, 0x0207),
2106 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
2107 { USB_DEVICE(0x2304, 0x0208),
2108 .driver_info = EM2820_BOARD_PINNACLE_USB_2 },
2109 { USB_DEVICE(0x2304, 0x021a),
2110 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
2111 { USB_DEVICE(0x2304, 0x0226),
Devin Heitmueller09bc1942011-03-13 02:07:54 -03002112 .driver_info = EM2882_BOARD_PINNACLE_HYBRID_PRO_330E },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002113 { USB_DEVICE(0x2304, 0x0227),
2114 .driver_info = EM2880_BOARD_PINNACLE_PCTV_HD_PRO },
2115 { USB_DEVICE(0x0413, 0x6023),
2116 .driver_info = EM2800_BOARD_LEADTEK_WINFAST_USBII },
Don Kramer74e07f32012-01-02 16:15:44 -03002117 { USB_DEVICE(0x093b, 0xa003),
2118 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002119 { USB_DEVICE(0x093b, 0xa005),
2120 .driver_info = EM2861_BOARD_PLEXTOR_PX_TV100U },
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03002121 { USB_DEVICE(0x04bb, 0x0515),
2122 .driver_info = EM2820_BOARD_IODATA_GVMVP_SZ },
Zhenyu Wang7c8b5672009-07-05 10:51:21 -03002123 { USB_DEVICE(0xeb1a, 0x50a6),
2124 .driver_info = EM2860_BOARD_GADMEI_UTV330 },
Jarod Wilson7e48b302010-03-07 17:55:43 -03002125 { USB_DEVICE(0x1b80, 0xa340),
2126 .driver_info = EM2870_BOARD_KWORLD_A340 },
Antti Palosaarid6a5f922011-04-07 16:34:44 -03002127 { USB_DEVICE(0x2013, 0x024f),
2128 .driver_info = EM28174_BOARD_PCTV_290E },
Antti Palosaari36588712011-08-01 01:15:30 -03002129 { USB_DEVICE(0x2013, 0x024c),
2130 .driver_info = EM28174_BOARD_PCTV_460E },
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -03002131 { USB_DEVICE(0x2040, 0x1605),
2132 .driver_info = EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C },
Gareth Williams4d28d3d2011-12-24 05:47:29 -03002133 { USB_DEVICE(0xeb1a, 0x5006),
2134 .driver_info = EM2860_BOARD_HT_VIDBOX_NW03 },
Mario Ceresa2f786042012-01-06 16:00:12 -03002135 { USB_DEVICE(0x1b80, 0xe309), /* Sveon STV40 */
2136 .driver_info = EM2860_BOARD_EASYCAP },
Antti Palosaari35530852012-03-18 18:09:01 -03002137 { USB_DEVICE(0x1b80, 0xe425),
2138 .driver_info = EM2874_BOARD_MAXMEDIA_UB425_TC },
Ivan Kalvachevfa5527c2012-03-19 20:09:55 -03002139 { USB_DEVICE(0x2304, 0x0242),
2140 .driver_info = EM2884_BOARD_PCTV_510E },
Antti Palosaaric247d7b2012-03-19 11:48:19 -03002141 { USB_DEVICE(0x2013, 0x0251),
2142 .driver_info = EM2884_BOARD_PCTV_520E },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002143 { },
2144};
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002145MODULE_DEVICE_TABLE(usb, em28xx_id_table);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002146
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002147/*
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002148 * EEPROM hash table for devices with generic USB IDs
2149 */
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03002150static struct em28xx_hash_table em28xx_eeprom_hash[] = {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03002151 /* P/N: SA 60002070465 Tuner: TVF7533-MF */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002152 {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF},
Douglas Schilling Landgraf1e1addd2008-12-27 21:38:14 -03002153 {0x72cc5a8b, EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2, TUNER_YMEC_TVF_5533MF},
Darron Broadda3808e2008-09-30 02:46:41 -03002154 {0x966a0441, EM2880_BOARD_KWORLD_DVB_310U, TUNER_XC2028},
Douglas Schilling Landgrafa35c87c2009-08-06 12:52:11 -03002155 {0x166a0441, EM2880_BOARD_EMPIRE_DUAL_TV, TUNER_XC2028},
Devin Heitmueller19859222009-06-19 00:33:54 -03002156 {0xcee44a99, EM2882_BOARD_EVGA_INDTUBE, TUNER_XC2028},
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03002157 {0xb8846b20, EM2881_BOARD_PINNACLE_HYBRID_PRO, TUNER_XC2028},
Antti Palosaari285eb1a2009-09-15 14:42:13 -03002158 {0x63f653bd, EM2870_BOARD_REDDO_DVB_C_USB_BOX, TUNER_ABSENT},
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03002159 {0x4e913442, EM2882_BOARD_DIKOM_DK300, TUNER_XC2028},
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002160};
2161
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03002162/* I2C devicelist hash table for devices with generic USB IDs */
Sascha Sommerfad7b952007-11-04 08:06:48 -03002163static struct em28xx_hash_table em28xx_i2c_hash[] = {
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002164 {0xb06a32c3, EM2800_BOARD_TERRATEC_CINERGY_200, TUNER_LG_PAL_NEW_TAPC},
2165 {0xf51200e3, EM2800_BOARD_VGEAR_POCKETTV, TUNER_LG_PAL_NEW_TAPC},
Devin Heitmueller3ed58ba2009-05-27 23:27:26 -03002166 {0x1ba50080, EM2860_BOARD_SAA711X_REFERENCE_DESIGN, TUNER_ABSENT},
Devin Heitmueller443fed92010-03-19 23:53:12 -03002167 {0x77800080, EM2860_BOARD_TVP5150_REFERENCE_DESIGN, TUNER_ABSENT},
Douglas Schilling Landgraff7fe3e62009-01-19 09:31:55 -03002168 {0xc51200e3, EM2820_BOARD_GADMEI_TVR200, TUNER_LG_PAL_NEW_TAPC},
Mauro Carvalho Chehab6d888a62009-08-30 13:05:56 -03002169 {0x4ba50080, EM2861_BOARD_GADMEI_UTV330PLUS, TUNER_TNF_5335MF},
Mauro Carvalho Chehabebaefdb2011-06-01 10:16:25 -03002170 {0x6b800080, EM2874_BOARD_LEADERSHIP_ISDBT, TUNER_ABSENT},
Sascha Sommerfad7b952007-11-04 08:06:48 -03002171};
2172
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002173/* I2C possible address to saa7115, tvp5150, msp3400, tvaudio */
2174static unsigned short saa711x_addrs[] = {
2175 0x4a >> 1, 0x48 >> 1, /* SAA7111, SAA7111A and SAA7113 */
2176 0x42 >> 1, 0x40 >> 1, /* SAA7114, SAA7115 and SAA7118 */
2177 I2C_CLIENT_END };
2178
2179static unsigned short tvp5150_addrs[] = {
2180 0xb8 >> 1,
2181 0xba >> 1,
2182 I2C_CLIENT_END
2183};
2184
2185static unsigned short msp3400_addrs[] = {
2186 0x80 >> 1,
2187 0x88 >> 1,
2188 I2C_CLIENT_END
2189};
2190
Michael Krufkyd7cba042008-09-12 13:31:45 -03002191int em28xx_tuner_callback(void *ptr, int component, int command, int arg)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002192{
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002193 int rc = 0;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002194 struct em28xx *dev = ptr;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002195
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -03002196 if (dev->tuner_type != TUNER_XC2028 && dev->tuner_type != TUNER_XC5000)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002197 return 0;
2198
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -03002199 if (command != XC2028_TUNER_RESET && command != XC5000_TUNER_RESET)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002200 return 0;
2201
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03002202 rc = em28xx_gpio_set(dev, dev->board.tuner_gpio);
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002203
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002204 return rc;
2205}
2206EXPORT_SYMBOL_GPL(em28xx_tuner_callback);
2207
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03002208static inline void em28xx_set_model(struct em28xx *dev)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002209{
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002210 memcpy(&dev->board, &em28xx_boards[dev->model], sizeof(dev->board));
Devin Heitmuellered14e1c2008-12-29 22:27:30 -03002211
2212 /* Those are the default values for the majority of boards
2213 Use those values if not specified otherwise at boards entry
2214 */
2215 if (!dev->board.xclk)
2216 dev->board.xclk = EM28XX_XCLK_IR_RC5_MODE |
2217 EM28XX_XCLK_FREQUENCY_12MHZ;
2218
2219 if (!dev->board.i2c_speed)
2220 dev->board.i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
2221 EM28XX_I2C_FREQ_100_KHZ;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002222}
2223
Mauro Carvalho Chehabf2e26ae2009-08-12 20:21:44 -03002224
2225/* FIXME: Should be replaced by a proper mt9m111 driver */
2226static int em28xx_initialize_mt9m111(struct em28xx *dev)
2227{
2228 int i;
2229 unsigned char regs[][3] = {
2230 { 0x0d, 0x00, 0x01, }, /* reset and use defaults */
2231 { 0x0d, 0x00, 0x00, },
2232 { 0x0a, 0x00, 0x21, },
2233 { 0x21, 0x04, 0x00, }, /* full readout speed, no row/col skipping */
2234 };
2235
2236 for (i = 0; i < ARRAY_SIZE(regs); i++)
2237 i2c_master_send(&dev->i2c_client, &regs[i][0], 3);
2238
2239 return 0;
2240}
2241
2242
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -03002243/* FIXME: Should be replaced by a proper mt9m001 driver */
2244static int em28xx_initialize_mt9m001(struct em28xx *dev)
2245{
2246 int i;
2247 unsigned char regs[][3] = {
2248 { 0x0d, 0x00, 0x01, },
2249 { 0x0d, 0x00, 0x00, },
2250 { 0x04, 0x05, 0x00, }, /* hres = 1280 */
2251 { 0x03, 0x04, 0x00, }, /* vres = 1024 */
2252 { 0x20, 0x11, 0x00, },
2253 { 0x06, 0x00, 0x10, },
2254 { 0x2b, 0x00, 0x24, },
2255 { 0x2e, 0x00, 0x24, },
2256 { 0x35, 0x00, 0x24, },
2257 { 0x2d, 0x00, 0x20, },
2258 { 0x2c, 0x00, 0x20, },
2259 { 0x09, 0x0a, 0xd4, },
2260 { 0x35, 0x00, 0x57, },
2261 };
2262
2263 for (i = 0; i < ARRAY_SIZE(regs); i++)
2264 i2c_master_send(&dev->i2c_client, &regs[i][0], 3);
2265
2266 return 0;
2267}
2268
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002269/* HINT method: webcam I2C chips
2270 *
Mauro Carvalho Chehabf2e26ae2009-08-12 20:21:44 -03002271 * This method works for webcams with Micron sensors
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002272 */
2273static int em28xx_hint_sensor(struct em28xx *dev)
2274{
2275 int rc;
2276 char *sensor_name;
2277 unsigned char cmd;
2278 __be16 version_be;
2279 u16 version;
2280
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002281 /* Micron sensor detection */
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002282 dev->i2c_client.addr = 0xba >> 1;
2283 cmd = 0;
2284 i2c_master_send(&dev->i2c_client, &cmd, 1);
2285 rc = i2c_master_recv(&dev->i2c_client, (char *)&version_be, 2);
2286 if (rc != 2)
2287 return -EINVAL;
2288
2289 version = be16_to_cpu(version_be);
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002290 switch (version) {
Mauro Carvalho Chehab296544e2009-07-27 08:24:29 -03002291 case 0x8232: /* mt9v011 640x480 1.3 Mpix sensor */
2292 case 0x8243: /* mt9v011 rev B 640x480 1.3 Mpix sensor */
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002293 dev->model = EM2820_BOARD_SILVERCREST_WEBCAM;
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002294 em28xx_set_model(dev);
2295
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002296 sensor_name = "mt9v011";
Mauro Carvalho Chehab527f09a2009-07-12 11:04:15 -03002297 dev->em28xx_sensor = EM28XX_MT9V011;
Mauro Carvalho Chehab55699962009-07-13 20:15:02 -03002298 dev->sensor_xres = 640;
2299 dev->sensor_yres = 480;
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002300 /*
2301 * FIXME: mt9v011 uses I2S speed as xtal clk - at least with
2302 * the Silvercrest cam I have here for testing - for higher
2303 * resolutions, a high clock cause horizontal artifacts, so we
2304 * need to use a lower xclk frequency.
2305 * Yet, it would be possible to adjust xclk depending on the
2306 * desired resolution, since this affects directly the
2307 * frame rate.
2308 */
2309 dev->board.xclk = EM28XX_XCLK_FREQUENCY_4_3MHZ;
2310 dev->sensor_xtal = 4300000;
Mauro Carvalho Chehab579d3152009-07-14 12:33:25 -03002311
2312 /* probably means GRGB 16 bit bayer */
2313 dev->vinmode = 0x0d;
2314 dev->vinctl = 0x00;
2315
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002316 break;
Mauro Carvalho Chehabf2e26ae2009-08-12 20:21:44 -03002317
2318 case 0x143a: /* MT9M111 as found in the ECS G200 */
2319 dev->model = EM2750_BOARD_UNKNOWN;
2320 em28xx_set_model(dev);
2321
2322 sensor_name = "mt9m111";
2323 dev->board.xclk = EM28XX_XCLK_FREQUENCY_48MHZ;
2324 dev->em28xx_sensor = EM28XX_MT9M111;
2325 em28xx_initialize_mt9m111(dev);
2326 dev->sensor_xres = 640;
2327 dev->sensor_yres = 512;
2328
2329 dev->vinmode = 0x0a;
2330 dev->vinctl = 0x00;
2331
2332 break;
2333
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -03002334 case 0x8431:
2335 dev->model = EM2750_BOARD_UNKNOWN;
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002336 em28xx_set_model(dev);
2337
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -03002338 sensor_name = "mt9m001";
2339 dev->em28xx_sensor = EM28XX_MT9M001;
2340 em28xx_initialize_mt9m001(dev);
2341 dev->sensor_xres = 1280;
2342 dev->sensor_yres = 1024;
2343
2344 /* probably means BGGR 16 bit bayer */
2345 dev->vinmode = 0x0c;
2346 dev->vinctl = 0x00;
2347
2348 break;
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002349 default:
Mauro Carvalho Chehabf2e26ae2009-08-12 20:21:44 -03002350 printk("Unknown Micron Sensor 0x%04x\n", version);
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002351 return -EINVAL;
2352 }
2353
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002354 /* Setup webcam defaults */
2355 em28xx_pre_card_setup(dev);
2356
Mauro Carvalho Chehab8b220792009-07-12 10:56:21 -03002357 em28xx_errdev("Sensor is %s, using model %s entry.\n",
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002358 sensor_name, em28xx_boards[dev->model].name);
2359
2360 return 0;
2361}
2362
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002363/* Since em28xx_pre_card_setup() requires a proper dev->model,
2364 * this won't work for boards with generic PCI IDs
2365 */
Ezequiel Garcia60332f02012-04-28 09:57:01 -03002366static void em28xx_pre_card_setup(struct em28xx *dev)
Markus Rechbergera94e95b2006-01-23 17:11:10 -02002367{
Devin Heitmuellered14e1c2008-12-29 22:27:30 -03002368 /* Set the initial XCLK and I2C clock values based on the board
2369 definition */
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002370 em28xx_write_reg(dev, EM28XX_R0F_XCLK, dev->board.xclk & 0x7f);
Sascha Sommerca80cf62012-01-08 16:32:09 -03002371 if (!dev->board.is_em2800)
2372 em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed);
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03002373 msleep(50);
2374
Markus Rechbergera94e95b2006-01-23 17:11:10 -02002375 /* request some modules */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002376 switch (dev->model) {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002377 case EM2861_BOARD_PLEXTOR_PX_TV100U:
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -03002378 /* Sets the msp34xx I2S speed */
2379 dev->i2s_speed = 2048000;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002380 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002381 case EM2861_BOARD_KWORLD_PVRTV_300U:
2382 case EM2880_BOARD_KWORLD_DVB_305U:
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002383 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x6d);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002384 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002385 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x7d);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002386 msleep(10);
2387 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002388 case EM2870_BOARD_COMPRO_VIDEOMATE:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002389 /* TODO: someone can do some cleanup here...
2390 not everything's needed */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002391 em28xx_write_reg(dev, EM2880_R04_GPO, 0x00);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002392 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002393 em28xx_write_reg(dev, EM2880_R04_GPO, 0x01);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002394 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002395 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002396 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002397 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002398 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002399 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xdc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002400 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002401 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002402 mdelay(70);
2403 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002404 case EM2870_BOARD_TERRATEC_XS_MT2060:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002405 /* this device needs some gpio writes to get the DVB-T
2406 demod work */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002407 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002408 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002409 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xde);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002410 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002411 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002412 mdelay(70);
2413 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002414 case EM2870_BOARD_PINNACLE_PCTV_DVB:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002415 /* this device needs some gpio writes to get the
2416 DVB-T demod work */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002417 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002418 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002419 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xde);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002420 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002421 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002422 mdelay(70);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002423 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002424 case EM2820_BOARD_GADMEI_UTV310:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002425 case EM2820_BOARD_MSI_VOX_USB_2:
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03002426 /* enables audio for that devices */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002427 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002428 break;
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03002429
Franklin Mengd7de5d82009-06-06 17:05:02 -03002430 case EM2882_BOARD_KWORLD_ATSC_315U:
2431 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff);
2432 msleep(10);
2433 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
2434 msleep(10);
2435 em28xx_write_reg(dev, EM2880_R04_GPO, 0x00);
2436 msleep(10);
2437 em28xx_write_reg(dev, EM2880_R04_GPO, 0x08);
2438 msleep(10);
2439 break;
2440
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03002441 case EM2860_BOARD_KAIOMY_TVNPC_U2:
2442 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x07", 1);
2443 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
2444 em28xx_write_regs(dev, 0x0d, "\x42", 1);
2445 em28xx_write_regs(dev, 0x08, "\xfd", 1);
2446 msleep(10);
2447 em28xx_write_regs(dev, 0x08, "\xff", 1);
2448 msleep(10);
2449 em28xx_write_regs(dev, 0x08, "\x7f", 1);
2450 msleep(10);
2451 em28xx_write_regs(dev, 0x08, "\x6b", 1);
2452
2453 break;
Mauro Carvalho Chehab56ee3802009-02-11 14:18:36 -03002454 case EM2860_BOARD_EASYCAP:
2455 em28xx_write_regs(dev, 0x08, "\xf8", 1);
2456 break;
2457
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03002458 case EM2820_BOARD_IODATA_GVMVP_SZ:
2459 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff);
2460 msleep(70);
2461 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf7);
2462 msleep(10);
2463 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
2464 msleep(70);
2465 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
2466 msleep(70);
2467 break;
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002468 }
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03002469
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03002470 em28xx_gpio_set(dev, dev->board.tuner_gpio);
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03002471 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
2472
2473 /* Unlock device */
Mauro Carvalho Chehab2fe3e2e2008-11-27 09:10:40 -03002474 em28xx_set_mode(dev, EM28XX_SUSPEND);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002475}
2476
Mauro Carvalho Chehabe54318e2008-04-18 18:34:31 -03002477static void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl)
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002478{
2479 memset(ctl, 0, sizeof(*ctl));
2480
2481 ctl->fname = XC2028_DEFAULT_FIRMWARE;
2482 ctl->max_len = 64;
2483 ctl->mts = em28xx_boards[dev->model].mts_firmware;
2484
2485 switch (dev->model) {
Douglas Schilling Landgrafe5db5d42009-04-09 18:24:34 -03002486 case EM2880_BOARD_EMPIRE_DUAL_TV:
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03002487 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
Uroš Vamplec994d02009-09-30 22:53:37 -03002488 case EM2882_BOARD_TERRATEC_HYBRID_XS:
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03002489 ctl->demod = XC3028_FE_ZARLINK456;
2490 break;
reinhard schwab655b8402008-07-26 10:47:00 -03002491 case EM2880_BOARD_TERRATEC_HYBRID_XS:
Michel Garniercec4e6c2010-10-16 14:42:01 -03002492 case EM2880_BOARD_TERRATEC_HYBRID_XS_FR:
Devin Heitmuellere16e5a32009-07-15 00:37:22 -03002493 case EM2881_BOARD_PINNACLE_HYBRID_PRO:
reinhard schwab655b8402008-07-26 10:47:00 -03002494 ctl->demod = XC3028_FE_ZARLINK456;
2495 break;
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002496 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
Devin Heitmuellerad9b4bb2011-03-13 02:09:59 -03002497 case EM2882_BOARD_PINNACLE_HYBRID_PRO_330E:
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002498 ctl->demod = XC3028_FE_DEFAULT;
2499 break;
Devin Heitmueller5ea7fe42008-09-16 02:02:12 -03002500 case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600:
2501 ctl->demod = XC3028_FE_DEFAULT;
2502 ctl->fname = XC3028L_DEFAULT_FIRMWARE;
2503 break;
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03002504 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850:
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002505 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03002506 case EM2880_BOARD_PINNACLE_PCTV_HD_PRO:
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03002507 /* FIXME: Better to specify the needed IF */
Devin Heitmuellerbdfbf952008-04-17 21:38:27 -03002508 ctl->demod = XC3028_FE_DEFAULT;
2509 break;
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03002510 case EM2883_BOARD_KWORLD_HYBRID_330U:
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03002511 case EM2882_BOARD_DIKOM_DK300:
Antonio Larrosa811fab62010-03-04 22:19:48 -03002512 case EM2882_BOARD_KWORLD_VS_DVBT:
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03002513 ctl->demod = XC3028_FE_CHINA;
2514 ctl->fname = XC2028_DEFAULT_FIRMWARE;
2515 break;
Devin Heitmueller19859222009-06-19 00:33:54 -03002516 case EM2882_BOARD_EVGA_INDTUBE:
2517 ctl->demod = XC3028_FE_CHINA;
2518 ctl->fname = XC3028L_DEFAULT_FIRMWARE;
2519 break;
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002520 default:
2521 ctl->demod = XC3028_FE_OREN538;
2522 }
2523}
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002524
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002525static void em28xx_tuner_setup(struct em28xx *dev)
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002526{
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002527 struct tuner_setup tun_setup;
2528 struct v4l2_frequency f;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002529
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03002530 if (dev->tuner_type == TUNER_ABSENT)
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002531 return;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002532
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002533 memset(&tun_setup, 0, sizeof(tun_setup));
2534
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002535 tun_setup.mode_mask = T_ANALOG_TV | T_RADIO;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002536 tun_setup.tuner_callback = em28xx_tuner_callback;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002537
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002538 if (dev->board.radio.type) {
2539 tun_setup.type = dev->board.radio.type;
2540 tun_setup.addr = dev->board.radio_addr;
2541
2542 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_type_addr, &tun_setup);
2543 }
2544
2545 if ((dev->tuner_type != TUNER_ABSENT) && (dev->tuner_type)) {
2546 tun_setup.type = dev->tuner_type;
2547 tun_setup.addr = dev->tuner_addr;
2548
2549 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_type_addr, &tun_setup);
2550 }
2551
2552 if (dev->tda9887_conf) {
2553 struct v4l2_priv_tun_config tda9887_cfg;
2554
2555 tda9887_cfg.tuner = TUNER_TDA9887;
2556 tda9887_cfg.priv = &dev->tda9887_conf;
2557
2558 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_config, &tda9887_cfg);
2559 }
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002560
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002561 if (dev->tuner_type == TUNER_XC2028) {
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002562 struct v4l2_priv_tun_config xc2028_cfg;
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002563 struct xc2028_ctrl ctl;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002564
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002565 memset(&xc2028_cfg, 0, sizeof(xc2028_cfg));
2566 memset(&ctl, 0, sizeof(ctl));
2567
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002568 em28xx_setup_xc3028(dev, &ctl);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002569
2570 xc2028_cfg.tuner = TUNER_XC2028;
2571 xc2028_cfg.priv = &ctl;
2572
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002573 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_config, &xc2028_cfg);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002574 }
2575
2576 /* configure tuner */
2577 f.tuner = 0;
2578 f.type = V4L2_TUNER_ANALOG_TV;
2579 f.frequency = 9076; /* just a magic number */
2580 dev->ctl_freq = f.frequency;
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002581 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002582}
2583
2584static int em28xx_hint_board(struct em28xx *dev)
2585{
2586 int i;
2587
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03002588 /* HINT method: EEPROM
2589 *
2590 * This method works only for boards with eeprom.
2591 * Uses a hash of all eeprom bytes. The hash should be
2592 * unique for a vendor/tuner pair.
2593 * There are a high chance that tuners for different
2594 * video standards produce different hashes.
2595 */
2596 for (i = 0; i < ARRAY_SIZE(em28xx_eeprom_hash); i++) {
2597 if (dev->hash == em28xx_eeprom_hash[i].hash) {
2598 dev->model = em28xx_eeprom_hash[i].model;
2599 dev->tuner_type = em28xx_eeprom_hash[i].tuner;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002600
2601 em28xx_errdev("Your board has no unique USB ID.\n");
2602 em28xx_errdev("A hint were successfully done, "
2603 "based on eeprom hash.\n");
2604 em28xx_errdev("This method is not 100%% failproof.\n");
2605 em28xx_errdev("If the board were missdetected, "
2606 "please email this log to:\n");
2607 em28xx_errdev("\tV4L Mailing List "
Alexey Klimov51caf912009-01-25 12:53:09 -03002608 " <linux-media@vger.kernel.org>\n");
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002609 em28xx_errdev("Board detected as %s\n",
2610 em28xx_boards[dev->model].name);
2611
2612 return 0;
2613 }
2614 }
Sascha Sommerfad7b952007-11-04 08:06:48 -03002615
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03002616 /* HINT method: I2C attached devices
2617 *
2618 * This method works for all boards.
2619 * Uses a hash of i2c scanned devices.
2620 * Devices with the same i2c attached chips will
2621 * be considered equal.
2622 * This method is less precise than the eeprom one.
2623 */
2624
Sascha Sommerfad7b952007-11-04 08:06:48 -03002625 /* user did not request i2c scanning => do it now */
2626 if (!dev->i2c_hash)
2627 em28xx_do_i2c_scan(dev);
2628
2629 for (i = 0; i < ARRAY_SIZE(em28xx_i2c_hash); i++) {
2630 if (dev->i2c_hash == em28xx_i2c_hash[i].hash) {
2631 dev->model = em28xx_i2c_hash[i].model;
2632 dev->tuner_type = em28xx_i2c_hash[i].tuner;
2633 em28xx_errdev("Your board has no unique USB ID.\n");
2634 em28xx_errdev("A hint were successfully done, "
2635 "based on i2c devicelist hash.\n");
2636 em28xx_errdev("This method is not 100%% failproof.\n");
2637 em28xx_errdev("If the board were missdetected, "
2638 "please email this log to:\n");
2639 em28xx_errdev("\tV4L Mailing List "
Alexey Klimov51caf912009-01-25 12:53:09 -03002640 " <linux-media@vger.kernel.org>\n");
Sascha Sommerfad7b952007-11-04 08:06:48 -03002641 em28xx_errdev("Board detected as %s\n",
2642 em28xx_boards[dev->model].name);
2643
2644 return 0;
2645 }
2646 }
2647
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002648 em28xx_errdev("Your board has no unique USB ID and thus need a "
2649 "hint to be detected.\n");
2650 em28xx_errdev("You may try to use card=<n> insmod option to "
2651 "workaround that.\n");
2652 em28xx_errdev("Please send an email with this log to:\n");
Alexey Klimov51caf912009-01-25 12:53:09 -03002653 em28xx_errdev("\tV4L Mailing List <linux-media@vger.kernel.org>\n");
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002654 em28xx_errdev("Board eeprom hash is 0x%08lx\n", dev->hash);
Sascha Sommerfad7b952007-11-04 08:06:48 -03002655 em28xx_errdev("Board i2c devicelist hash is 0x%08lx\n", dev->i2c_hash);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002656
2657 em28xx_errdev("Here is a list of valid choices for the card=<n>"
2658 " insmod option:\n");
2659 for (i = 0; i < em28xx_bcount; i++) {
2660 em28xx_errdev(" card=%d -> %s\n",
2661 i, em28xx_boards[i].name);
2662 }
2663 return -1;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002664}
2665
Ezequiel Garcia60332f02012-04-28 09:57:01 -03002666static void em28xx_card_setup(struct em28xx *dev)
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002667{
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002668 /*
2669 * If the device can be a webcam, seek for a sensor.
2670 * If sensor is not found, then it isn't a webcam.
2671 */
2672 if (dev->board.is_webcam) {
2673 if (em28xx_hint_sensor(dev) < 0)
2674 dev->board.is_webcam = 0;
2675 else
2676 dev->progressive = 1;
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03002677 }
2678
2679 if (!dev->board.is_webcam) {
2680 switch (dev->model) {
2681 case EM2820_BOARD_UNKNOWN:
2682 case EM2800_BOARD_UNKNOWN:
2683 /*
2684 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD.
2685 *
2686 * This occurs because they share identical USB vendor and
2687 * product IDs.
2688 *
2689 * What we do here is look up the EEPROM hash of the K-WORLD
2690 * and if it is found then we decide that we do not have
2691 * a DIGIVOX and reset the device to the K-WORLD instead.
2692 *
2693 * This solution is only valid if they do not share eeprom
2694 * hash identities which has not been determined as yet.
2695 */
2696 if (em28xx_hint_board(dev) < 0)
2697 em28xx_errdev("Board not discovered\n");
2698 else {
2699 em28xx_set_model(dev);
2700 em28xx_pre_card_setup(dev);
2701 }
2702 break;
2703 default:
2704 em28xx_set_model(dev);
2705 }
2706 }
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002707
2708 em28xx_info("Identified as %s (card=%d)\n",
2709 dev->board.name, dev->model);
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002710
2711 dev->tuner_type = em28xx_boards[dev->model].tuner_type;
Mauro Carvalho Chehab31e05302008-11-20 18:47:37 -03002712 if (em28xx_boards[dev->model].tuner_addr)
2713 dev->tuner_addr = em28xx_boards[dev->model].tuner_addr;
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002714
Franklin Mengae3340c2009-06-06 16:34:01 -03002715 if (em28xx_boards[dev->model].tda9887_conf)
2716 dev->tda9887_conf = em28xx_boards[dev->model].tda9887_conf;
2717
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002718 /* request some modules */
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002719 switch (dev->model) {
2720 case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2:
Mauro Carvalho Chehab98ae1272007-11-05 09:30:39 -03002721 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002722 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03002723 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850:
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002724 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002725 {
2726 struct tveeprom tv;
Mauro Carvalho Chehabac07bb72009-09-08 14:04:41 -03002727#if defined(CONFIG_MODULES) && defined(MODULE)
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002728 request_module("tveeprom");
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002729#endif
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002730 /* Call first TVeeprom */
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002731
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002732 dev->i2c_client.addr = 0xa0 >> 1;
2733 tveeprom_hauppauge_analog(&dev->i2c_client, &tv, dev->eedata);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002734
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002735 dev->tuner_type = tv.tuner_type;
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03002736
Hans Verkuil38f9d302008-07-23 05:09:15 -03002737 if (tv.audio_processor == V4L2_IDENT_MSPX4XX) {
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002738 dev->i2s_speed = 2048000;
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002739 dev->board.has_msp34xx = 1;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002740 }
2741 break;
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002742 }
Franklin Mengd7de5d82009-06-06 17:05:02 -03002743 case EM2882_BOARD_KWORLD_ATSC_315U:
2744 em28xx_write_reg(dev, 0x0d, 0x42);
2745 msleep(10);
2746 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
2747 msleep(10);
2748 break;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002749 case EM2820_BOARD_KWORLD_PVRTV2800RF:
2750 /* GPIO enables sound on KWORLD PVR TV 2800RF */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002751 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf9);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002752 break;
2753 case EM2820_BOARD_UNKNOWN:
2754 case EM2800_BOARD_UNKNOWN:
Darron Broadda3808e2008-09-30 02:46:41 -03002755 /*
2756 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD.
2757 *
2758 * This occurs because they share identical USB vendor and
2759 * product IDs.
2760 *
2761 * What we do here is look up the EEPROM hash of the K-WORLD
2762 * and if it is found then we decide that we do not have
2763 * a DIGIVOX and reset the device to the K-WORLD instead.
2764 *
2765 * This solution is only valid if they do not share eeprom
2766 * hash identities which has not been determined as yet.
2767 */
2768 case EM2880_BOARD_MSI_DIGIVOX_AD:
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002769 if (!em28xx_hint_board(dev))
2770 em28xx_set_model(dev);
Devin Heitmuellercdf7bfa2009-06-19 00:20:28 -03002771
2772 /* In cases where we had to use a board hint, the call to
2773 em28xx_set_mode() in em28xx_pre_card_setup() was a no-op,
2774 so make the call now so the analog GPIOs are set properly
2775 before probing the i2c bus. */
Devin Heitmueller5343e442009-07-15 00:35:47 -03002776 em28xx_gpio_set(dev, dev->board.tuner_gpio);
Devin Heitmuellercdf7bfa2009-06-19 00:20:28 -03002777 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002778 break;
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03002779
2780/*
2781 * The Dikom DK300 is detected as an Kworld VS-DVB-T 323UR.
2782 *
2783 * This occurs because they share identical USB vendor and
2784 * product IDs.
2785 *
2786 * What we do here is look up the EEPROM hash of the Dikom
2787 * and if it is found then we decide that we do not have
2788 * a Kworld and reset the device to the Dikom instead.
2789 *
2790 * This solution is only valid if they do not share eeprom
2791 * hash identities which has not been determined as yet.
2792 */
2793 case EM2882_BOARD_KWORLD_VS_DVBT:
2794 if (!em28xx_hint_board(dev))
2795 em28xx_set_model(dev);
2796
2797 /* In cases where we had to use a board hint, the call to
2798 em28xx_set_mode() in em28xx_pre_card_setup() was a no-op,
2799 so make the call now so the analog GPIOs are set properly
2800 before probing the i2c bus. */
2801 em28xx_gpio_set(dev, dev->board.tuner_gpio);
2802 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
2803 break;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002804 }
2805
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002806 if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002807 em28xx_errdev("\n\n");
2808 em28xx_errdev("The support for this board weren't "
2809 "valid yet.\n");
2810 em28xx_errdev("Please send a report of having this working\n");
2811 em28xx_errdev("not to V4L mailing list (and/or to other "
2812 "addresses)\n\n");
2813 }
2814
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002815 /* Allow override tuner type by a module parameter */
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002816 if (tuner >= 0)
2817 dev->tuner_type = tuner;
2818
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002819 /* request some modules */
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002820 if (dev->board.has_msp34xx)
Hans Verkuil53dacb12009-08-10 02:49:08 -03002821 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002822 "msp3400", 0, msp3400_addrs);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002823
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03002824 if (dev->board.decoder == EM28XX_SAA711X)
Hans Verkuil53dacb12009-08-10 02:49:08 -03002825 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002826 "saa7115_auto", 0, saa711x_addrs);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002827
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002828 if (dev->board.decoder == EM28XX_TVP5150)
Hans Verkuil53dacb12009-08-10 02:49:08 -03002829 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002830 "tvp5150", 0, tvp5150_addrs);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002831
Mauro Carvalho Chehabd36bb4e2009-07-14 03:18:39 -03002832 if (dev->em28xx_sensor == EM28XX_MT9V011) {
Hans Verkuil3c7c9372011-01-08 07:08:02 -03002833 struct mt9v011_platform_data pdata;
2834 struct i2c_board_info mt9v011_info = {
2835 .type = "mt9v011",
2836 .addr = 0xba >> 1,
2837 .platform_data = &pdata,
2838 };
Mauro Carvalho Chehabd36bb4e2009-07-14 03:18:39 -03002839
Hans Verkuil3c7c9372011-01-08 07:08:02 -03002840 pdata.xtal = dev->sensor_xtal;
Mauro Carvalho Chehab00d2e7a2011-06-17 20:28:51 -03002841 v4l2_i2c_new_subdev_board(&dev->v4l2_dev, &dev->i2c_adap,
Hans Verkuil3c7c9372011-01-08 07:08:02 -03002842 &mt9v011_info, NULL);
Mauro Carvalho Chehabd36bb4e2009-07-14 03:18:39 -03002843 }
Mauro Carvalho Chehab02e78042009-06-29 11:35:05 -03002844
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -03002845
Mauro Carvalho Chehabdf7fa092009-02-25 09:06:13 -03002846 if (dev->board.adecoder == EM28XX_TVAUDIO)
Hans Verkuile6574f22009-04-01 03:57:53 -03002847 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002848 "tvaudio", dev->board.tvaudio_addr, NULL);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002849
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002850 if (dev->board.tuner_type != TUNER_ABSENT) {
2851 int has_demod = (dev->tda9887_conf & TDA9887_PRESENT);
Mauro Carvalho Chehaba924a492008-11-12 08:41:29 -03002852
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002853 if (dev->board.radio.type)
Hans Verkuile6574f22009-04-01 03:57:53 -03002854 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002855 "tuner", dev->board.radio_addr, NULL);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002856
2857 if (has_demod)
Hans Verkuil53dacb12009-08-10 02:49:08 -03002858 v4l2_i2c_new_subdev(&dev->v4l2_dev,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002859 &dev->i2c_adap, "tuner",
Hans Verkuil53dacb12009-08-10 02:49:08 -03002860 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002861 if (dev->tuner_addr == 0) {
2862 enum v4l2_i2c_tuner_type type =
2863 has_demod ? ADDRS_TV_WITH_DEMOD : ADDRS_TV;
2864 struct v4l2_subdev *sd;
2865
Hans Verkuil53dacb12009-08-10 02:49:08 -03002866 sd = v4l2_i2c_new_subdev(&dev->v4l2_dev,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002867 &dev->i2c_adap, "tuner",
Hans Verkuil53dacb12009-08-10 02:49:08 -03002868 0, v4l2_i2c_tuner_addrs(type));
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002869
2870 if (sd)
2871 dev->tuner_addr = v4l2_i2c_subdev_addr(sd);
2872 } else {
Hans Verkuile6574f22009-04-01 03:57:53 -03002873 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002874 "tuner", dev->tuner_addr, NULL);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002875 }
2876 }
2877
2878 em28xx_tuner_setup(dev);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002879}
Mauro Carvalho Chehabc8644052008-11-25 13:10:14 -03002880
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002881
2882#if defined(CONFIG_MODULES) && defined(MODULE)
2883static void request_module_async(struct work_struct *work)
2884{
2885 struct em28xx *dev = container_of(work,
2886 struct em28xx, request_module_wk);
2887
2888 if (dev->has_audio_class)
2889 request_module("snd-usb-audio");
2890 else if (dev->has_alsa_audio)
2891 request_module("em28xx-alsa");
2892
2893 if (dev->board.has_dvb)
2894 request_module("em28xx-dvb");
Ezequiel Garcíaf4d4e762012-03-26 09:13:35 -03002895 if (dev->board.has_ir_i2c && !disable_ir)
2896 request_module("em28xx-rc");
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002897}
2898
2899static void request_modules(struct em28xx *dev)
2900{
2901 INIT_WORK(&dev->request_module_wk, request_module_async);
2902 schedule_work(&dev->request_module_wk);
2903}
Tejun Heo707bcf32010-12-24 16:14:20 +01002904
2905static void flush_request_modules(struct em28xx *dev)
2906{
2907 flush_work_sync(&dev->request_module_wk);
2908}
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002909#else
2910#define request_modules(dev)
Tejun Heo707bcf32010-12-24 16:14:20 +01002911#define flush_request_modules(dev)
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002912#endif /* CONFIG_MODULES */
2913
2914/*
Chris Rankind7222e72011-09-24 11:02:32 -03002915 * em28xx_release_resources()
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002916 * unregisters the v4l2,i2c and usb devices
Chris Rankind7222e72011-09-24 11:02:32 -03002917 * called when the device gets disconnected or at module unload
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002918*/
2919void em28xx_release_resources(struct em28xx *dev)
2920{
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002921 /*FIXME: I2C IR should be disconnected */
2922
2923 em28xx_release_analog_resources(dev);
2924
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002925 em28xx_i2c_unregister(dev);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002926
2927 v4l2_device_unregister(&dev->v4l2_dev);
2928
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002929 usb_put_dev(dev->udev);
2930
2931 /* Mark device as unused */
Chris Rankin38b61eb2011-08-20 08:21:03 -03002932 clear_bit(dev->devno, &em28xx_devused);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002933};
2934
2935/*
2936 * em28xx_init_dev()
2937 * allocates and inits the device structs, registers i2c bus and v4l device
2938 */
Thomas Petazzoni622c2fc2012-01-07 10:18:45 -03002939static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,
Mauro Carvalho Chehab36fa6742009-04-05 08:02:15 -03002940 struct usb_interface *interface,
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002941 int minor)
2942{
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002943 int retval;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002944
2945 dev->udev = udev;
2946 mutex_init(&dev->ctrl_urb_lock);
2947 spin_lock_init(&dev->slock);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002948
2949 dev->em28xx_write_regs = em28xx_write_regs;
2950 dev->em28xx_read_reg = em28xx_read_reg;
2951 dev->em28xx_read_reg_req_len = em28xx_read_reg_req_len;
2952 dev->em28xx_write_regs_req = em28xx_write_regs_req;
2953 dev->em28xx_read_reg_req = em28xx_read_reg_req;
2954 dev->board.is_em2800 = em28xx_boards[dev->model].is_em2800;
2955
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002956 em28xx_set_model(dev);
2957
2958 /* Set the default GPO/GPIO for legacy devices */
2959 dev->reg_gpo_num = EM2880_R04_GPO;
2960 dev->reg_gpio_num = EM28XX_R08_GPIO;
2961
2962 dev->wait_after_write = 5;
2963
2964 /* Based on the Chip ID, set the device configuration */
2965 retval = em28xx_read_reg(dev, EM28XX_R0A_CHIPID);
2966 if (retval > 0) {
2967 dev->chip_id = retval;
2968
2969 switch (dev->chip_id) {
Mauro Carvalho Chehabf57b17c32009-11-12 11:21:05 -03002970 case CHIP_ID_EM2800:
2971 em28xx_info("chip ID is em2800\n");
2972 break;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002973 case CHIP_ID_EM2710:
2974 em28xx_info("chip ID is em2710\n");
2975 break;
2976 case CHIP_ID_EM2750:
2977 em28xx_info("chip ID is em2750\n");
2978 break;
2979 case CHIP_ID_EM2820:
2980 em28xx_info("chip ID is em2820 (or em2710)\n");
2981 break;
2982 case CHIP_ID_EM2840:
2983 em28xx_info("chip ID is em2840\n");
2984 break;
2985 case CHIP_ID_EM2860:
2986 em28xx_info("chip ID is em2860\n");
2987 break;
2988 case CHIP_ID_EM2870:
2989 em28xx_info("chip ID is em2870\n");
2990 dev->wait_after_write = 0;
2991 break;
2992 case CHIP_ID_EM2874:
2993 em28xx_info("chip ID is em2874\n");
2994 dev->reg_gpio_num = EM2874_R80_GPIO;
2995 dev->wait_after_write = 0;
2996 break;
Antti Palosaaribc022692011-04-07 16:04:48 -03002997 case CHIP_ID_EM28174:
2998 em28xx_info("chip ID is em28174\n");
2999 dev->reg_gpio_num = EM2874_R80_GPIO;
3000 dev->wait_after_write = 0;
3001 break;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003002 case CHIP_ID_EM2883:
3003 em28xx_info("chip ID is em2882/em2883\n");
3004 dev->wait_after_write = 0;
3005 break;
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -03003006 case CHIP_ID_EM2884:
3007 em28xx_info("chip ID is em2884\n");
3008 dev->reg_gpio_num = EM2874_R80_GPIO;
3009 dev->wait_after_write = 0;
3010 break;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003011 default:
3012 em28xx_info("em28xx chip ID = %d\n", dev->chip_id);
3013 }
3014 }
3015
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003016 if (dev->is_audio_only) {
Chris Rankin6c03e382011-08-20 08:28:17 -03003017 retval = em28xx_audio_setup(dev);
3018 if (retval)
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003019 return -ENODEV;
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003020 em28xx_init_extension(dev);
3021
3022 return 0;
3023 }
3024
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003025 /* Prepopulate cached GPO register content */
3026 retval = em28xx_read_reg(dev, dev->reg_gpo_num);
3027 if (retval >= 0)
3028 dev->reg_gpo = retval;
3029
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003030 em28xx_pre_card_setup(dev);
3031
3032 if (!dev->board.is_em2800) {
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03003033 /* Resets I2C speed */
Sascha Sommer0903bb52012-01-08 16:19:30 -03003034 retval = em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003035 if (retval < 0) {
Chris Rankin6c03e382011-08-20 08:28:17 -03003036 em28xx_errdev("%s: em28xx_write_reg failed!"
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003037 " retval [%d]\n",
3038 __func__, retval);
3039 return retval;
3040 }
3041 }
3042
Mauro Carvalho Chehab36fa6742009-04-05 08:02:15 -03003043 retval = v4l2_device_register(&interface->dev, &dev->v4l2_dev);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003044 if (retval < 0) {
3045 em28xx_errdev("Call to v4l2_device_register() failed!\n");
3046 return retval;
3047 }
3048
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003049 /* register i2c bus */
Chris Rankin6c03e382011-08-20 08:28:17 -03003050 retval = em28xx_i2c_register(dev);
3051 if (retval < 0) {
3052 em28xx_errdev("%s: em28xx_i2c_register - error [%d]!\n",
3053 __func__, retval);
3054 goto unregister_dev;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003055 }
3056
Mauro Carvalho Chehabb04fb662009-07-13 01:28:21 -03003057 /*
Mauro Carvalho Chehab579d3152009-07-14 12:33:25 -03003058 * Default format, used for tvp5150 or saa711x output formats
3059 */
3060 dev->vinmode = 0x10;
Devin Heitmueller206313d2009-08-31 23:23:03 -03003061 dev->vinctl = EM28XX_VINCTRL_INTERLACED |
3062 EM28XX_VINCTRL_CCIR656_ENABLE;
Mauro Carvalho Chehab579d3152009-07-14 12:33:25 -03003063
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003064 /* Do board specific init and eeprom reading */
3065 em28xx_card_setup(dev);
3066
3067 /* Configure audio */
Chris Rankin6c03e382011-08-20 08:28:17 -03003068 retval = em28xx_audio_setup(dev);
3069 if (retval < 0) {
3070 em28xx_errdev("%s: Error while setting audio - error [%d]!\n",
3071 __func__, retval);
3072 goto fail;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003073 }
3074
3075 /* wake i2c devices */
3076 em28xx_wake_i2c(dev);
3077
3078 /* init video dma queues */
3079 INIT_LIST_HEAD(&dev->vidq.active);
Devin Heitmueller28abf0832009-09-01 01:54:54 -03003080 INIT_LIST_HEAD(&dev->vbiq.active);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003081
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003082 if (dev->board.has_msp34xx) {
3083 /* Send a reset to other chips via gpio */
Chris Rankin6c03e382011-08-20 08:28:17 -03003084 retval = em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf7);
3085 if (retval < 0) {
3086 em28xx_errdev("%s: em28xx_write_reg - "
3087 "msp34xx(1) failed! error [%d]\n",
3088 __func__, retval);
3089 goto fail;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003090 }
3091 msleep(3);
3092
Chris Rankin6c03e382011-08-20 08:28:17 -03003093 retval = em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff);
3094 if (retval < 0) {
3095 em28xx_errdev("%s: em28xx_write_reg - "
3096 "msp34xx(2) failed! error [%d]\n",
3097 __func__, retval);
3098 goto fail;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003099 }
3100 msleep(3);
3101 }
3102
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003103 retval = em28xx_register_analog_devices(dev);
3104 if (retval < 0) {
Chris Rankin6c03e382011-08-20 08:28:17 -03003105 goto fail;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003106 }
3107
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003108 /* Save some power by putting tuner to sleep */
Laurent Pinchart622b8282009-10-05 10:48:17 -03003109 v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_power, 0);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003110
3111 return 0;
3112
Chris Rankin6c03e382011-08-20 08:28:17 -03003113fail:
3114 em28xx_i2c_unregister(dev);
3115
3116unregister_dev:
3117 v4l2_device_unregister(&dev->v4l2_dev);
3118
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003119 return retval;
3120}
3121
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003122/* high bandwidth multiplier, as encoded in highspeed endpoint descriptors */
3123#define hb_mult(wMaxPacketSize) (1 + (((wMaxPacketSize) >> 11) & 0x03))
3124
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003125/*
3126 * em28xx_usb_probe()
3127 * checks for supported devices
3128 */
3129static int em28xx_usb_probe(struct usb_interface *interface,
3130 const struct usb_device_id *id)
3131{
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003132 struct usb_device *udev;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003133 struct em28xx *dev = NULL;
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003134 int retval;
Holger Nelson8ab33622011-12-28 18:55:41 -03003135 bool has_audio = false, has_video = false, has_dvb = false;
3136 int i, nr;
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003137 const int ifnum = interface->altsetting[0].desc.bInterfaceNumber;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003138 char *speed;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003139
3140 udev = usb_get_dev(interface_to_usbdev(interface));
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003141
3142 /* Check to see next free device and mark as used */
Chris Rankin38b61eb2011-08-20 08:21:03 -03003143 do {
3144 nr = find_first_zero_bit(&em28xx_devused, EM28XX_MAXBOARDS);
3145 if (nr >= EM28XX_MAXBOARDS) {
3146 /* No free device slots */
3147 printk(DRIVER_NAME ": Supports only %i em28xx boards.\n",
3148 EM28XX_MAXBOARDS);
3149 retval = -ENOMEM;
3150 goto err_no_slot;
3151 }
3152 } while (test_and_set_bit(nr, &em28xx_devused));
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003153
3154 /* Don't register audio interfaces */
3155 if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
3156 em28xx_err(DRIVER_NAME " audio device (%04x:%04x): "
3157 "interface %i, class %i\n",
3158 le16_to_cpu(udev->descriptor.idVendor),
3159 le16_to_cpu(udev->descriptor.idProduct),
3160 ifnum,
3161 interface->altsetting[0].desc.bInterfaceClass);
3162
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003163 retval = -ENODEV;
3164 goto err;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003165 }
3166
Holger Nelson8ab33622011-12-28 18:55:41 -03003167 /* allocate memory for our device state and initialize it */
3168 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
3169 if (dev == NULL) {
3170 em28xx_err(DRIVER_NAME ": out of memory!\n");
3171 retval = -ENOMEM;
3172 goto err;
3173 }
3174
3175 /* compute alternate max packet sizes */
3176 dev->alt_max_pkt_size = kmalloc(sizeof(dev->alt_max_pkt_size[0]) *
3177 interface->num_altsetting, GFP_KERNEL);
3178 if (dev->alt_max_pkt_size == NULL) {
3179 em28xx_errdev("out of memory!\n");
3180 kfree(dev);
3181 retval = -ENOMEM;
3182 goto err;
3183 }
3184
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003185 /* Get endpoints */
3186 for (i = 0; i < interface->num_altsetting; i++) {
3187 int ep;
3188
3189 for (ep = 0; ep < interface->altsetting[i].desc.bNumEndpoints; ep++) {
Holger Nelson8ab33622011-12-28 18:55:41 -03003190 const struct usb_endpoint_descriptor *e;
3191 int sizedescr, size;
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003192
Holger Nelson8ab33622011-12-28 18:55:41 -03003193 e = &interface->altsetting[i].endpoint[ep].desc;
3194
3195 sizedescr = le16_to_cpu(e->wMaxPacketSize);
3196 size = sizedescr & 0x7ff;
3197
3198 if (udev->speed == USB_SPEED_HIGH)
3199 size = size * hb_mult(sizedescr);
3200
3201 if (usb_endpoint_xfer_isoc(e) &&
3202 usb_endpoint_dir_in(e)) {
3203 switch (e->bEndpointAddress) {
3204 case EM28XX_EP_AUDIO:
3205 has_audio = true;
3206 break;
3207 case EM28XX_EP_ANALOG:
3208 has_video = true;
3209 dev->alt_max_pkt_size[i] = size;
3210 break;
3211 case EM28XX_EP_DIGITAL:
3212 has_dvb = true;
3213 if (size > dev->dvb_max_pkt_size) {
3214 dev->dvb_max_pkt_size = size;
3215 dev->dvb_alt = i;
3216 }
3217 break;
3218 }
3219 }
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003220 }
3221 }
3222
Holger Nelson8ab33622011-12-28 18:55:41 -03003223 if (!(has_audio || has_video || has_dvb)) {
3224 retval = -ENODEV;
3225 goto err_free;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003226 }
3227
3228 switch (udev->speed) {
3229 case USB_SPEED_LOW:
3230 speed = "1.5";
3231 break;
3232 case USB_SPEED_UNKNOWN:
3233 case USB_SPEED_FULL:
3234 speed = "12";
3235 break;
3236 case USB_SPEED_HIGH:
3237 speed = "480";
3238 break;
3239 default:
3240 speed = "unknown";
3241 }
3242
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003243 printk(KERN_INFO DRIVER_NAME
Ezequiel García401a5822012-03-13 10:27:09 -03003244 ": New device %s %s @ %s Mbps "
3245 "(%04x:%04x, interface %d, class %d)\n",
3246 udev->manufacturer ? udev->manufacturer : "",
3247 udev->product ? udev->product : "",
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003248 speed,
3249 le16_to_cpu(udev->descriptor.idVendor),
3250 le16_to_cpu(udev->descriptor.idProduct),
3251 ifnum,
3252 interface->altsetting->desc.bInterfaceNumber);
3253
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003254 if (has_audio)
3255 printk(KERN_INFO DRIVER_NAME
3256 ": Audio Vendor Class interface %i found\n",
3257 ifnum);
Holger Nelson8ab33622011-12-28 18:55:41 -03003258 if (has_video)
3259 printk(KERN_INFO DRIVER_NAME
3260 ": Video interface %i found\n",
3261 ifnum);
3262 if (has_dvb)
3263 printk(KERN_INFO DRIVER_NAME
3264 ": DVB interface %i found\n",
3265 ifnum);
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003266
Devin Heitmueller64a00b42009-05-27 23:23:37 -03003267 /*
3268 * Make sure we have 480 Mbps of bandwidth, otherwise things like
3269 * video stream wouldn't likely work, since 12 Mbps is generally
3270 * not enough even for most Digital TV streams.
3271 */
Devin Heitmuellere2a1b792009-05-27 23:44:10 -03003272 if (udev->speed != USB_SPEED_HIGH && disable_usb_speed_check == 0) {
Devin Heitmueller64a00b42009-05-27 23:23:37 -03003273 printk(DRIVER_NAME ": Device initialization failed.\n");
3274 printk(DRIVER_NAME ": Device must be connected to a high-speed"
3275 " USB 2.0 port.\n");
Devin Heitmueller64a00b42009-05-27 23:23:37 -03003276 retval = -ENODEV;
Holger Nelson8ab33622011-12-28 18:55:41 -03003277 goto err_free;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003278 }
3279
Chris Rankinf38f3332011-08-20 08:08:34 -03003280 snprintf(dev->name, sizeof(dev->name), "em28xx #%d", nr);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003281 dev->devno = nr;
3282 dev->model = id->driver_info;
3283 dev->alt = -1;
Holger Nelson8ab33622011-12-28 18:55:41 -03003284 dev->is_audio_only = has_audio && !(has_video || has_dvb);
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003285 dev->has_alsa_audio = has_audio;
3286 dev->audio_ifnum = ifnum;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003287
3288 /* Checks if audio is provided by some interface */
3289 for (i = 0; i < udev->config->desc.bNumInterfaces; i++) {
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003290 struct usb_interface *uif = udev->config->interface[i];
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003291 if (uif->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
3292 dev->has_audio_class = 1;
3293 break;
3294 }
3295 }
3296
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003297 dev->num_alt = interface->num_altsetting;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003298
3299 if ((card[nr] >= 0) && (card[nr] < em28xx_bcount))
3300 dev->model = card[nr];
3301
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003302 /* save our data pointer in this interface device */
3303 usb_set_intfdata(interface, dev);
3304
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003305 /* allocate device struct */
3306 mutex_init(&dev->lock);
3307 mutex_lock(&dev->lock);
Thomas Petazzoni622c2fc2012-01-07 10:18:45 -03003308 retval = em28xx_init_dev(dev, udev, interface, nr);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003309 if (retval) {
Holger Nelson8ab33622011-12-28 18:55:41 -03003310 goto unlock_and_free;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003311 }
3312
Gianluca Gennari86d38d12012-02-13 13:59:22 -03003313 if (has_dvb) {
3314 /* pre-allocate DVB isoc transfer buffers */
3315 retval = em28xx_alloc_isoc(dev, EM28XX_DIGITAL_MODE,
3316 EM28XX_DVB_MAX_PACKETS,
3317 EM28XX_DVB_NUM_BUFS,
3318 dev->dvb_max_pkt_size);
3319 if (retval) {
3320 goto unlock_and_free;
3321 }
3322 }
3323
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003324 request_modules(dev);
3325
3326 /* Should be the last thing to do, to avoid newer udev's to
3327 open the device before fully initializing it
3328 */
3329 mutex_unlock(&dev->lock);
3330
Chris Rankin778f2952011-09-25 18:43:12 -03003331 /*
3332 * These extensions can be modules. If the modules are already
3333 * loaded then we can initialise the device now, otherwise we
3334 * will initialise it when the modules load instead.
3335 */
3336 em28xx_init_extension(dev);
3337
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003338 return 0;
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003339
Holger Nelson8ab33622011-12-28 18:55:41 -03003340unlock_and_free:
3341 mutex_unlock(&dev->lock);
3342
3343err_free:
3344 kfree(dev->alt_max_pkt_size);
3345 kfree(dev);
3346
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003347err:
Chris Rankin38b61eb2011-08-20 08:21:03 -03003348 clear_bit(nr, &em28xx_devused);
3349
3350err_no_slot:
3351 usb_put_dev(udev);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003352 return retval;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003353}
3354
3355/*
3356 * em28xx_usb_disconnect()
Chris Rankind7222e72011-09-24 11:02:32 -03003357 * called when the device gets disconnected
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003358 * video device will be unregistered on v4l2_close in case it is still open
3359 */
3360static void em28xx_usb_disconnect(struct usb_interface *interface)
3361{
3362 struct em28xx *dev;
3363
3364 dev = usb_get_intfdata(interface);
3365 usb_set_intfdata(interface, NULL);
3366
3367 if (!dev)
3368 return;
3369
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003370 if (dev->is_audio_only) {
3371 mutex_lock(&dev->lock);
3372 em28xx_close_extension(dev);
3373 mutex_unlock(&dev->lock);
3374 return;
3375 }
3376
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003377 em28xx_info("disconnecting %s\n", dev->vdev->name);
3378
Tejun Heo707bcf32010-12-24 16:14:20 +01003379 flush_request_modules(dev);
3380
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003381 /* wait until all current v4l2 io is finished then deallocate
3382 resources */
3383 mutex_lock(&dev->lock);
3384
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003385 v4l2_device_disconnect(&dev->v4l2_dev);
3386
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003387 if (dev->users) {
3388 em28xx_warn
Laurent Pinchart38c7c032009-11-27 13:57:15 -03003389 ("device %s is open! Deregistration and memory "
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003390 "deallocation are deferred on close.\n",
Laurent Pinchart38c7c032009-11-27 13:57:15 -03003391 video_device_node_name(dev->vdev));
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003392
3393 dev->state |= DEV_MISCONFIGURED;
Gianluca Gennari86d38d12012-02-13 13:59:22 -03003394 em28xx_uninit_isoc(dev, dev->mode);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003395 dev->state |= DEV_DISCONNECTED;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003396 } else {
3397 dev->state |= DEV_DISCONNECTED;
3398 em28xx_release_resources(dev);
3399 }
3400
Gianluca Gennari86d38d12012-02-13 13:59:22 -03003401 /* free DVB isoc buffers */
3402 em28xx_uninit_isoc(dev, EM28XX_DIGITAL_MODE);
3403
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003404 mutex_unlock(&dev->lock);
3405
Chris Rankinb868a532011-09-24 16:54:58 -03003406 em28xx_close_extension(dev);
3407
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003408 if (!dev->users) {
3409 kfree(dev->alt_max_pkt_size);
3410 kfree(dev);
3411 }
3412}
3413
3414static struct usb_driver em28xx_usb_driver = {
3415 .name = "em28xx",
3416 .probe = em28xx_usb_probe,
3417 .disconnect = em28xx_usb_disconnect,
3418 .id_table = em28xx_id_table,
3419};
3420
Greg Kroah-Hartmanecb3b2b2011-11-18 09:46:12 -08003421module_usb_driver(em28xx_usb_driver);