blob: 873b52f71ab2307e67726009e4643462dd87cce3 [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,
Martin Blumenstinglc8dce002012-06-12 18:19:28 -0300977 .ir_codes = RC_MAP_NEC_TERRATEC_CINERGY_XS,
978 .tuner_type = TUNER_ABSENT,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800979 .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT |
980 EM28XX_I2C_CLK_WAIT_ENABLE |
981 EM28XX_I2C_FREQ_400_KHZ,
982 },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300983 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900] = {
Aidan Thornton122d1582007-11-20 15:25:08 -0300984 .name = "Hauppauge WinTV HVR 900",
Aidan Thornton122d1582007-11-20 15:25:08 -0300985 .tda9887_conf = TDA9887_PRESENT,
986 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300987 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab5add9a62007-11-22 12:08:53 -0300988 .mts_firmware = 1,
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300989 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300990 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehabaf86ce72011-01-24 12:18:48 -0300991 .ir_codes = RC_MAP_HAUPPAUGE,
Aidan Thornton122d1582007-11-20 15:25:08 -0300992 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300993 .input = { {
Aidan Thornton122d1582007-11-20 15:25:08 -0300994 .type = EM28XX_VMUX_TELEVISION,
995 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300996 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300997 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300998 }, {
Aidan Thornton122d1582007-11-20 15:25:08 -0300999 .type = EM28XX_VMUX_COMPOSITE1,
1000 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001001 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001002 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001003 }, {
Aidan Thornton122d1582007-11-20 15:25:08 -03001004 .type = EM28XX_VMUX_SVIDEO,
1005 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001006 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001007 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001008 } },
Aidan Thornton122d1582007-11-20 15:25:08 -03001009 },
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001010 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2] = {
1011 .name = "Hauppauge WinTV HVR 900 (R2)",
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001012 .tda9887_conf = TDA9887_PRESENT,
1013 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001014 .tuner_gpio = default_tuner_gpio,
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001015 .mts_firmware = 1,
Devin Heitmueller75e2b862011-03-13 02:01:02 -03001016 .has_dvb = 1,
Devin Heitmueller7030f522011-03-13 02:04:53 -03001017 .dvb_gpio = hauppauge_wintv_hvr_900R2_digital,
Mauro Carvalho Chehabaf86ce72011-01-24 12:18:48 -03001018 .ir_codes = RC_MAP_HAUPPAUGE,
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001019 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001020 .input = { {
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001021 .type = EM28XX_VMUX_TELEVISION,
1022 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001023 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001024 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001025 }, {
1026 .type = EM28XX_VMUX_COMPOSITE1,
1027 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehaba5942b52008-11-27 07:44:00 -03001028 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001029 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001030 }, {
1031 .type = EM28XX_VMUX_SVIDEO,
1032 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001033 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001034 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001035 } },
1036 },
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03001037 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850] = {
1038 .name = "Hauppauge WinTV HVR 850",
1039 .tuner_type = TUNER_XC2028,
1040 .tuner_gpio = default_tuner_gpio,
1041 .mts_firmware = 1,
1042 .has_dvb = 1,
1043 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehabaf86ce72011-01-24 12:18:48 -03001044 .ir_codes = RC_MAP_HAUPPAUGE,
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03001045 .decoder = EM28XX_TVP5150,
1046 .input = { {
1047 .type = EM28XX_VMUX_TELEVISION,
1048 .vmux = TVP5150_COMPOSITE0,
1049 .amux = EM28XX_AMUX_VIDEO,
1050 .gpio = hauppauge_wintv_hvr_900_analog,
1051 }, {
1052 .type = EM28XX_VMUX_COMPOSITE1,
1053 .vmux = TVP5150_COMPOSITE1,
1054 .amux = EM28XX_AMUX_LINE_IN,
1055 .gpio = hauppauge_wintv_hvr_900_analog,
1056 }, {
1057 .type = EM28XX_VMUX_SVIDEO,
1058 .vmux = TVP5150_SVIDEO,
1059 .amux = EM28XX_AMUX_LINE_IN,
1060 .gpio = hauppauge_wintv_hvr_900_analog,
1061 } },
1062 },
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001063 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950] = {
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -03001064 .name = "Hauppauge WinTV HVR 950",
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -03001065 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001066 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -03001067 .mts_firmware = 1,
Mauro Carvalho Chehab227ad4a2008-04-17 21:37:40 -03001068 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001069 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehab15195d32011-01-24 12:18:47 -03001070 .ir_codes = RC_MAP_HAUPPAUGE,
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -03001071 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001072 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001073 .type = EM28XX_VMUX_TELEVISION,
1074 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001075 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001076 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001077 }, {
Mauro Carvalho Chehab7d070e22007-11-01 21:52:58 -03001078 .type = EM28XX_VMUX_COMPOSITE1,
1079 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001080 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001081 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001082 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001083 .type = EM28XX_VMUX_SVIDEO,
1084 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001085 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001086 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001087 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001088 },
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001089 [EM2880_BOARD_PINNACLE_PCTV_HD_PRO] = {
1090 .name = "Pinnacle PCTV HD Pro Stick",
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001091 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001092 .tuner_gpio = default_tuner_gpio,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001093 .mts_firmware = 1,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001094 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001095 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001096 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001097 .decoder = EM28XX_TVP5150,
1098 .input = { {
1099 .type = EM28XX_VMUX_TELEVISION,
1100 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001101 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001102 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001103 }, {
1104 .type = EM28XX_VMUX_COMPOSITE1,
1105 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001106 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001107 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001108 }, {
1109 .type = EM28XX_VMUX_SVIDEO,
1110 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001111 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001112 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001113 } },
1114 },
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001115 [EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600] = {
1116 .name = "AMD ATI TV Wonder HD 600",
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001117 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001118 .tuner_gpio = default_tuner_gpio,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001119 .mts_firmware = 1,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001120 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001121 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001122 .ir_codes = RC_MAP_ATI_TV_WONDER_HD_600,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001123 .decoder = EM28XX_TVP5150,
1124 .input = { {
1125 .type = EM28XX_VMUX_TELEVISION,
1126 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001127 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001128 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001129 }, {
1130 .type = EM28XX_VMUX_COMPOSITE1,
1131 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001132 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001133 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001134 }, {
1135 .type = EM28XX_VMUX_SVIDEO,
1136 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001137 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001138 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001139 } },
1140 },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001141 [EM2880_BOARD_TERRATEC_HYBRID_XS] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001142 .name = "Terratec Hybrid XS",
1143 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001144 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001145 .decoder = EM28XX_TVP5150,
reinhard schwab655b8402008-07-26 10:47:00 -03001146 .has_dvb = 1,
Devin Heitmuellerf7976082009-06-22 22:32:32 -03001147 .dvb_gpio = default_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001148 .ir_codes = RC_MAP_TERRATEC_CINERGY_XS,
Devin Heitmueller8cd9aae2009-08-03 23:56:51 -03001149 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001150 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001151 .type = EM28XX_VMUX_TELEVISION,
1152 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001153 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001154 .gpio = default_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001155 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001156 .type = EM28XX_VMUX_COMPOSITE1,
1157 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001158 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001159 .gpio = default_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001160 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001161 .type = EM28XX_VMUX_SVIDEO,
1162 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001163 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001164 .gpio = default_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001165 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001166 },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001167 /* maybe there's a reason behind it why Terratec sells the Hybrid XS
1168 as Prodigy XS with a different PID, let's keep it separated for now
1169 maybe we'll need it lateron */
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001170 [EM2880_BOARD_TERRATEC_PRODIGY_XS] = {
1171 .name = "Terratec Prodigy XS",
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001172 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001173 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001174 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001175 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001176 .type = EM28XX_VMUX_TELEVISION,
1177 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001178 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001179 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001180 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001181 .type = EM28XX_VMUX_COMPOSITE1,
1182 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001183 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001184 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001185 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001186 .type = EM28XX_VMUX_SVIDEO,
1187 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001188 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001189 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001190 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001191 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001192 [EM2820_BOARD_MSI_VOX_USB_2] = {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001193 .name = "MSI VOX USB 2.0",
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001194 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1195 .tda9887_conf = TDA9887_PRESENT |
1196 TDA9887_PORT1_ACTIVE |
1197 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001198 .max_range_640_480 = 1,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001199 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001200 .input = { {
1201 .type = EM28XX_VMUX_TELEVISION,
1202 .vmux = SAA7115_COMPOSITE4,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001203 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001204 }, {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001205 .type = EM28XX_VMUX_COMPOSITE1,
1206 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001207 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001208 }, {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001209 .type = EM28XX_VMUX_SVIDEO,
1210 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001211 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001212 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001213 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001214 [EM2800_BOARD_TERRATEC_CINERGY_200] = {
1215 .name = "Terratec Cinergy 200 USB",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001216 .is_em2800 = 1,
Mauro Carvalho Chehabac07bb72009-09-08 14:04:41 -03001217 .has_ir_i2c = 1,
Sascha Sommer53b667e2012-01-08 16:41:22 -03001218 .tuner_type = TUNER_LG_TALN,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001219 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001220 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001221 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001222 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001223 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001224 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001225 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001226 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001227 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001228 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001229 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001230 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001231 .vmux = SAA7115_SVIDEO3,
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 Chehab596d92d2005-11-08 21:37:24 -08001234 },
Aron Szabo59d07f12008-07-27 13:47:52 -03001235 [EM2800_BOARD_GRABBEEX_USB2800] = {
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03001236 .name = "eMPIA Technology, Inc. GrabBeeX+ Video Encoder",
1237 .is_em2800 = 1,
1238 .decoder = EM28XX_SAA711X,
1239 .tuner_type = TUNER_ABSENT, /* capture only board */
1240 .input = { {
Aron Szabo59d07f12008-07-27 13:47:52 -03001241 .type = EM28XX_VMUX_COMPOSITE1,
1242 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001243 .amux = EM28XX_AMUX_LINE_IN,
Aron Szabo59d07f12008-07-27 13:47:52 -03001244 }, {
1245 .type = EM28XX_VMUX_SVIDEO,
1246 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001247 .amux = EM28XX_AMUX_LINE_IN,
Aron Szabo59d07f12008-07-27 13:47:52 -03001248 } },
1249 },
Mauro Carvalho Chehab694a1012009-11-26 21:26:13 -03001250 [EM2800_BOARD_VC211A] = {
1251 .name = "Actionmaster/LinXcel/Digitus VC211A",
1252 .is_em2800 = 1,
1253 .tuner_type = TUNER_ABSENT, /* Capture-only board */
1254 .decoder = EM28XX_SAA711X,
1255 .input = { {
1256 .type = EM28XX_VMUX_COMPOSITE1,
1257 .vmux = SAA7115_COMPOSITE0,
1258 .amux = EM28XX_AMUX_LINE_IN,
1259 .gpio = vc211a_enable,
1260 }, {
1261 .type = EM28XX_VMUX_SVIDEO,
1262 .vmux = SAA7115_SVIDEO3,
1263 .amux = EM28XX_AMUX_LINE_IN,
1264 .gpio = vc211a_enable,
1265 } },
1266 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001267 [EM2800_BOARD_LEADTEK_WINFAST_USBII] = {
1268 .name = "Leadtek Winfast USB II",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001269 .is_em2800 = 1,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001270 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1271 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001272 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001273 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001274 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001275 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001276 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001277 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001278 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001279 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001280 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001281 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001282 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001283 .vmux = SAA7115_SVIDEO3,
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 Chehab596d92d2005-11-08 21:37:24 -08001286 },
1287 [EM2800_BOARD_KWORLD_USB2800] = {
1288 .name = "Kworld USB2800",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001289 .is_em2800 = 1,
Michael Krufkyab8b8702008-04-22 14:46:05 -03001290 .tuner_type = TUNER_PHILIPS_FCV1236D,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001291 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001292 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001293 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001294 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001295 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001296 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001297 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001298 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001299 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001300 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001301 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001302 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001303 .vmux = SAA7115_SVIDEO3,
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 Chehab596d92d2005-11-08 21:37:24 -08001306 },
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -08001307 [EM2820_BOARD_PINNACLE_DVC_90] = {
Douglas Schilling Landgrafea476892009-09-06 18:41:59 -03001308 .name = "Pinnacle Dazzle DVC 90/100/101/107 / Kaiser Baas Video to DVD maker "
Don Kramer74e07f32012-01-02 16:15:44 -03001309 "/ Kworld DVD Maker 2 / Plextor ConvertX PX-AV100U",
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -03001310 .tuner_type = TUNER_ABSENT, /* capture only board */
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001311 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001312 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001313 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001314 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001315 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001316 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001317 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001318 .vmux = SAA7115_SVIDEO3,
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 Chehab45632c42005-11-08 21:38:15 -08001321 },
Sascha Sommer43625592007-11-03 15:05:07 -03001322 [EM2800_BOARD_VGEAR_POCKETTV] = {
1323 .name = "V-Gear PocketTV",
1324 .is_em2800 = 1,
Sascha Sommer43625592007-11-03 15:05:07 -03001325 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1326 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001327 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001328 .input = { {
Sascha Sommer43625592007-11-03 15:05:07 -03001329 .type = EM28XX_VMUX_TELEVISION,
1330 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001331 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001332 }, {
Sascha Sommer43625592007-11-03 15:05:07 -03001333 .type = EM28XX_VMUX_COMPOSITE1,
1334 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001335 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001336 }, {
Sascha Sommer43625592007-11-03 15:05:07 -03001337 .type = EM28XX_VMUX_SVIDEO,
1338 .vmux = SAA7115_SVIDEO3,
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 },
Douglas Schilling Landgraf1e1addd2008-12-27 21:38:14 -03001342 [EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2] = {
1343 .name = "Pixelview PlayTV Box 4 USB 2.0",
1344 .tda9887_conf = TDA9887_PRESENT,
1345 .tuner_type = TUNER_YMEC_TVF_5533MF,
1346 .decoder = EM28XX_SAA711X,
1347 .input = { {
1348 .type = EM28XX_VMUX_TELEVISION,
1349 .vmux = SAA7115_COMPOSITE2,
1350 .amux = EM28XX_AMUX_VIDEO,
1351 .aout = EM28XX_AOUT_MONO | /* I2S */
1352 EM28XX_AOUT_MASTER, /* Line out pin */
1353 }, {
1354 .type = EM28XX_VMUX_COMPOSITE1,
1355 .vmux = SAA7115_COMPOSITE0,
1356 .amux = EM28XX_AMUX_LINE_IN,
1357 }, {
1358 .type = EM28XX_VMUX_SVIDEO,
1359 .vmux = SAA7115_SVIDEO3,
1360 .amux = EM28XX_AMUX_LINE_IN,
1361 } },
1362 },
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001363 [EM2820_BOARD_PROLINK_PLAYTV_USB2] = {
Douglas Schilling Landgraf1f372a92009-02-25 16:54:31 -03001364 .name = "SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0",
Douglas Schilling Landgraf5609cfd2008-12-27 21:39:35 -03001365 .has_snapshot_button = 1,
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001366 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03001367 .tuner_type = TUNER_YMEC_TVF_5533MF,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001368 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001369 .input = { {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001370 .type = EM28XX_VMUX_TELEVISION,
1371 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab30e4ac72008-11-20 13:43:05 -03001372 .amux = EM28XX_AMUX_VIDEO,
1373 .aout = EM28XX_AOUT_MONO | /* I2S */
1374 EM28XX_AOUT_MASTER, /* Line out pin */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001375 }, {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001376 .type = EM28XX_VMUX_COMPOSITE1,
1377 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab7463dda2008-02-05 22:29:26 -03001378 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001379 }, {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001380 .type = EM28XX_VMUX_SVIDEO,
1381 .vmux = SAA7115_SVIDEO3,
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 },
Devin Heitmueller3ed58ba2009-05-27 23:27:26 -03001385 [EM2860_BOARD_SAA711X_REFERENCE_DESIGN] = {
1386 .name = "EM2860/SAA711X Reference Design",
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001387 .has_snapshot_button = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001388 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001389 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001390 .input = { {
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001391 .type = EM28XX_VMUX_SVIDEO,
1392 .vmux = SAA7115_SVIDEO3,
Devin Heitmueller3ed58ba2009-05-27 23:27:26 -03001393 }, {
1394 .type = EM28XX_VMUX_COMPOSITE1,
1395 .vmux = SAA7115_COMPOSITE0,
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001396 } },
1397 },
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03001398
Mauro Carvalho Chehabebaefdb2011-06-01 10:16:25 -03001399 [EM2874_BOARD_LEADERSHIP_ISDBT] = {
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03001400 .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT |
1401 EM28XX_I2C_CLK_WAIT_ENABLE |
1402 EM28XX_I2C_FREQ_100_KHZ,
1403 .xclk = EM28XX_XCLK_FREQUENCY_10MHZ,
1404 .name = "EM2874 Leadership ISDBT",
1405 .tuner_type = TUNER_ABSENT,
1406 .tuner_gpio = leadership_reset,
1407 .dvb_gpio = leadership_digital,
1408 .has_dvb = 1,
1409 },
1410
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001411 [EM2880_BOARD_MSI_DIGIVOX_AD] = {
1412 .name = "MSI DigiVox A/D",
1413 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001414 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001415 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001416 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001417 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001418 .type = EM28XX_VMUX_TELEVISION,
1419 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001420 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001421 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001422 }, {
1423 .type = EM28XX_VMUX_COMPOSITE1,
1424 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001425 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001426 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001427 }, {
1428 .type = EM28XX_VMUX_SVIDEO,
1429 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001430 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001431 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001432 } },
1433 },
1434 [EM2880_BOARD_MSI_DIGIVOX_AD_II] = {
1435 .name = "MSI DigiVox A/D II",
1436 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001437 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001438 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001439 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001440 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001441 .type = EM28XX_VMUX_TELEVISION,
1442 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001443 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001444 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001445 }, {
1446 .type = EM28XX_VMUX_COMPOSITE1,
1447 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001448 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001449 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001450 }, {
1451 .type = EM28XX_VMUX_SVIDEO,
1452 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001453 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001454 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001455 } },
1456 },
1457 [EM2880_BOARD_KWORLD_DVB_305U] = {
1458 .name = "KWorld DVB-T 305U",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001459 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001460 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001461 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001462 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001463 .type = EM28XX_VMUX_TELEVISION,
1464 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001465 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001466 }, {
1467 .type = EM28XX_VMUX_COMPOSITE1,
1468 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001469 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001470 }, {
1471 .type = EM28XX_VMUX_SVIDEO,
1472 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001473 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001474 } },
1475 },
1476 [EM2880_BOARD_KWORLD_DVB_310U] = {
1477 .name = "KWorld DVB-T 310U",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001478 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001479 .tuner_gpio = default_tuner_gpio,
Darron Broadda3808e2008-09-30 02:46:41 -03001480 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001481 .dvb_gpio = default_digital,
Darron Broadda3808e2008-09-30 02:46:41 -03001482 .mts_firmware = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001483 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001484 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001485 .type = EM28XX_VMUX_TELEVISION,
1486 .vmux = TVP5150_COMPOSITE0,
Darron Broadda3808e2008-09-30 02:46:41 -03001487 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001488 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001489 }, {
1490 .type = EM28XX_VMUX_COMPOSITE1,
1491 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehaba42aa192008-11-19 11:08:53 -03001492 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001493 .gpio = default_analog,
Darron Broadda3808e2008-09-30 02:46:41 -03001494 }, { /* S-video has not been tested yet */
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001495 .type = EM28XX_VMUX_SVIDEO,
1496 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehaba42aa192008-11-19 11:08:53 -03001497 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001498 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001499 } },
1500 },
Franklin Mengd7de5d82009-06-06 17:05:02 -03001501 [EM2882_BOARD_KWORLD_ATSC_315U] = {
1502 .name = "KWorld ATSC 315U HDTV TV Box",
1503 .valid = EM28XX_BOARD_NOT_VALIDATED,
1504 .tuner_type = TUNER_THOMSON_DTT761X,
1505 .tuner_gpio = em2882_kworld_315u_tuner_gpio,
1506 .tda9887_conf = TDA9887_PRESENT,
1507 .decoder = EM28XX_SAA711X,
1508 .has_dvb = 1,
1509 .dvb_gpio = em2882_kworld_315u_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001510 .ir_codes = RC_MAP_KWORLD_315U,
Franklin Mengd7de5d82009-06-06 17:05:02 -03001511 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
1512 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE,
1513 /* Analog mode - still not ready */
1514 /*.input = { {
1515 .type = EM28XX_VMUX_TELEVISION,
1516 .vmux = SAA7115_COMPOSITE2,
1517 .amux = EM28XX_AMUX_VIDEO,
1518 .gpio = em2882_kworld_315u_analog,
1519 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1520 }, {
1521 .type = EM28XX_VMUX_COMPOSITE1,
1522 .vmux = SAA7115_COMPOSITE0,
1523 .amux = EM28XX_AMUX_LINE_IN,
1524 .gpio = em2882_kworld_315u_analog1,
1525 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1526 }, {
1527 .type = EM28XX_VMUX_SVIDEO,
1528 .vmux = SAA7115_SVIDEO3,
1529 .amux = EM28XX_AMUX_LINE_IN,
1530 .gpio = em2882_kworld_315u_analog1,
1531 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1532 } }, */
1533 },
Douglas Schilling Landgrafe5db5d42009-04-09 18:24:34 -03001534 [EM2880_BOARD_EMPIRE_DUAL_TV] = {
1535 .name = "Empire dual TV",
1536 .tuner_type = TUNER_XC2028,
1537 .tuner_gpio = default_tuner_gpio,
1538 .has_dvb = 1,
1539 .dvb_gpio = default_digital,
1540 .mts_firmware = 1,
1541 .decoder = EM28XX_TVP5150,
1542 .input = { {
1543 .type = EM28XX_VMUX_TELEVISION,
1544 .vmux = TVP5150_COMPOSITE0,
1545 .amux = EM28XX_AMUX_VIDEO,
1546 .gpio = default_analog,
1547 }, {
1548 .type = EM28XX_VMUX_COMPOSITE1,
1549 .vmux = TVP5150_COMPOSITE1,
1550 .amux = EM28XX_AMUX_LINE_IN,
1551 .gpio = default_analog,
1552 }, {
1553 .type = EM28XX_VMUX_SVIDEO,
1554 .vmux = TVP5150_SVIDEO,
1555 .amux = EM28XX_AMUX_LINE_IN,
1556 .gpio = default_analog,
1557 } },
1558 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001559 [EM2881_BOARD_DNT_DA2_HYBRID] = {
1560 .name = "DNT DA2 Hybrid",
1561 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001562 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001563 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001564 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001565 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001566 .type = EM28XX_VMUX_TELEVISION,
1567 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001568 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001569 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001570 }, {
1571 .type = EM28XX_VMUX_COMPOSITE1,
1572 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001573 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001574 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001575 }, {
1576 .type = EM28XX_VMUX_SVIDEO,
1577 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001578 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001579 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001580 } },
1581 },
1582 [EM2881_BOARD_PINNACLE_HYBRID_PRO] = {
1583 .name = "Pinnacle Hybrid Pro",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001584 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001585 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001586 .decoder = EM28XX_TVP5150,
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03001587 .has_dvb = 1,
1588 .dvb_gpio = pinnacle_hybrid_pro_digital,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001589 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001590 .type = EM28XX_VMUX_TELEVISION,
1591 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001592 .amux = EM28XX_AMUX_VIDEO,
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03001593 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001594 }, {
1595 .type = EM28XX_VMUX_COMPOSITE1,
1596 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001597 .amux = EM28XX_AMUX_LINE_IN,
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03001598 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001599 }, {
1600 .type = EM28XX_VMUX_SVIDEO,
1601 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001602 .amux = EM28XX_AMUX_LINE_IN,
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03001603 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001604 } },
1605 },
Devin Heitmueller09bc1942011-03-13 02:07:54 -03001606 [EM2882_BOARD_PINNACLE_HYBRID_PRO_330E] = {
1607 .name = "Pinnacle Hybrid Pro (330e)",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001608 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001609 .tuner_gpio = default_tuner_gpio,
Eugeniy Meshcheryakova674a3b2008-08-01 08:23:41 -03001610 .mts_firmware = 1,
Devin Heitmuellerad9b4bb2011-03-13 02:09:59 -03001611 .has_dvb = 1,
1612 .dvb_gpio = hauppauge_wintv_hvr_900R2_digital,
Devin Heitmueller9b316d62011-03-13 02:18:34 -03001613 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001614 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001615 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001616 .type = EM28XX_VMUX_TELEVISION,
1617 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001618 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001619 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001620 }, {
1621 .type = EM28XX_VMUX_COMPOSITE1,
1622 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001623 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001624 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001625 }, {
1626 .type = EM28XX_VMUX_SVIDEO,
1627 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001628 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001629 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001630 } },
1631 },
1632 [EM2882_BOARD_KWORLD_VS_DVBT] = {
1633 .name = "Kworld VS-DVB-T 323UR",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001634 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001635 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001636 .decoder = EM28XX_TVP5150,
Antonio Larrosa811fab62010-03-04 22:19:48 -03001637 .mts_firmware = 1,
1638 .has_dvb = 1,
1639 .dvb_gpio = kworld_330u_digital,
1640 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001641 .ir_codes = RC_MAP_KWORLD_315U,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001642 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001643 .type = EM28XX_VMUX_TELEVISION,
1644 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001645 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001646 }, {
1647 .type = EM28XX_VMUX_COMPOSITE1,
1648 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001649 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001650 }, {
1651 .type = EM28XX_VMUX_SVIDEO,
1652 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001653 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001654 } },
1655 },
1656 [EM2882_BOARD_TERRATEC_HYBRID_XS] = {
Philippe Bourdin91245442010-10-31 09:57:58 -03001657 .name = "Terratec Cinnergy Hybrid T USB XS (em2882)",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001658 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001659 .tuner_gpio = default_tuner_gpio,
Uroš Vamplec994d02009-09-30 22:53:37 -03001660 .mts_firmware = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001661 .decoder = EM28XX_TVP5150,
Uroš Vamplec994d02009-09-30 22:53:37 -03001662 .has_dvb = 1,
1663 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001664 .ir_codes = RC_MAP_TERRATEC_CINERGY_XS,
Uroš Vamplec994d02009-09-30 22:53:37 -03001665 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001666 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001667 .type = EM28XX_VMUX_TELEVISION,
1668 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001669 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001670 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001671 }, {
1672 .type = EM28XX_VMUX_COMPOSITE1,
1673 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001674 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001675 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001676 }, {
1677 .type = EM28XX_VMUX_SVIDEO,
1678 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001679 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001680 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001681 } },
1682 },
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03001683 [EM2882_BOARD_DIKOM_DK300] = {
1684 .name = "Dikom DK300",
1685 .tuner_type = TUNER_XC2028,
1686 .tuner_gpio = default_tuner_gpio,
1687 .decoder = EM28XX_TVP5150,
1688 .mts_firmware = 1,
1689 .has_dvb = 1,
1690 .dvb_gpio = dikom_dk300_digital,
1691 .input = { {
1692 .type = EM28XX_VMUX_TELEVISION,
1693 .vmux = TVP5150_COMPOSITE0,
1694 .amux = EM28XX_AMUX_VIDEO,
1695 .gpio = default_analog,
1696 } },
1697 },
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001698 [EM2883_BOARD_KWORLD_HYBRID_330U] = {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001699 .name = "Kworld PlusTV HD Hybrid 330",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001700 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001701 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001702 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabbe2c6db2008-12-09 15:43:10 -03001703 .mts_firmware = 1,
1704 .has_dvb = 1,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001705 .dvb_gpio = kworld_330u_digital,
1706 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03001707 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
1708 EM28XX_I2C_EEPROM_ON_BOARD |
1709 EM28XX_I2C_EEPROM_KEY_VALID,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001710 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001711 .type = EM28XX_VMUX_TELEVISION,
1712 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001713 .amux = EM28XX_AMUX_VIDEO,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001714 .gpio = kworld_330u_analog,
1715 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001716 }, {
1717 .type = EM28XX_VMUX_COMPOSITE1,
1718 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001719 .amux = EM28XX_AMUX_LINE_IN,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001720 .gpio = kworld_330u_analog,
1721 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001722 }, {
1723 .type = EM28XX_VMUX_SVIDEO,
1724 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001725 .amux = EM28XX_AMUX_LINE_IN,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001726 .gpio = kworld_330u_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001727 } },
1728 },
Mauro Carvalho Chehabee281b82008-07-27 16:58:04 -03001729 [EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU] = {
Vitaly Woold3603342008-07-27 14:10:11 -03001730 .name = "Compro VideoMate ForYou/Stereo",
Vitaly Woold3603342008-07-27 14:10:11 -03001731 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03001732 .tvaudio_addr = 0xb0,
Vitaly Woold3603342008-07-27 14:10:11 -03001733 .tda9887_conf = TDA9887_PRESENT,
1734 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabdf7fa092009-02-25 09:06:13 -03001735 .adecoder = EM28XX_TVAUDIO,
Vitaly Wool2bd1d9eb2009-03-04 08:27:52 -03001736 .mute_gpio = compro_mute_gpio,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001737 .input = { {
Vitaly Woold3603342008-07-27 14:10:11 -03001738 .type = EM28XX_VMUX_TELEVISION,
1739 .vmux = TVP5150_COMPOSITE0,
Vitaly Wool2bd1d9eb2009-03-04 08:27:52 -03001740 .amux = EM28XX_AMUX_VIDEO,
1741 .gpio = compro_unmute_tv_gpio,
Vitaly Woold3603342008-07-27 14:10:11 -03001742 }, {
1743 .type = EM28XX_VMUX_SVIDEO,
1744 .vmux = TVP5150_SVIDEO,
1745 .amux = EM28XX_AMUX_LINE_IN,
Vitaly Wool2bd1d9eb2009-03-04 08:27:52 -03001746 .gpio = compro_unmute_svid_gpio,
Vitaly Woold3603342008-07-27 14:10:11 -03001747 } },
1748 },
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03001749 [EM2860_BOARD_KAIOMY_TVNPC_U2] = {
1750 .name = "Kaiomy TVnPC U2",
1751 .vchannels = 3,
1752 .tuner_type = TUNER_XC2028,
1753 .tuner_addr = 0x61,
1754 .mts_firmware = 1,
1755 .decoder = EM28XX_TVP5150,
1756 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001757 .ir_codes = RC_MAP_KAIOMY,
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03001758 .input = { {
1759 .type = EM28XX_VMUX_TELEVISION,
1760 .vmux = TVP5150_COMPOSITE0,
1761 .amux = EM28XX_AMUX_VIDEO,
1762
1763 }, {
1764 .type = EM28XX_VMUX_COMPOSITE1,
1765 .vmux = TVP5150_COMPOSITE1,
1766 .amux = EM28XX_AMUX_LINE_IN,
1767 }, {
1768 .type = EM28XX_VMUX_SVIDEO,
1769 .vmux = TVP5150_SVIDEO,
1770 .amux = EM28XX_AMUX_LINE_IN,
1771 } },
1772 .radio = {
1773 .type = EM28XX_RADIO,
1774 .amux = EM28XX_AMUX_LINE_IN,
1775 }
Mauro Carvalho Chehab56ee3802009-02-11 14:18:36 -03001776 },
1777 [EM2860_BOARD_EASYCAP] = {
1778 .name = "Easy Cap Capture DC-60",
1779 .vchannels = 2,
1780 .tuner_type = TUNER_ABSENT,
1781 .decoder = EM28XX_SAA711X,
1782 .input = { {
1783 .type = EM28XX_VMUX_COMPOSITE1,
1784 .vmux = SAA7115_COMPOSITE0,
1785 .amux = EM28XX_AMUX_LINE_IN,
1786 }, {
1787 .type = EM28XX_VMUX_SVIDEO,
1788 .vmux = SAA7115_SVIDEO3,
1789 .amux = EM28XX_AMUX_LINE_IN,
1790 } },
1791 },
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03001792 [EM2820_BOARD_IODATA_GVMVP_SZ] = {
1793 .name = "IO-DATA GV-MVP/SZ",
1794 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
1795 .tuner_gpio = default_tuner_gpio,
1796 .tda9887_conf = TDA9887_PRESENT,
1797 .decoder = EM28XX_TVP5150,
1798 .input = { {
1799 .type = EM28XX_VMUX_TELEVISION,
1800 .vmux = TVP5150_COMPOSITE0,
1801 .amux = EM28XX_AMUX_VIDEO,
1802 }, { /* Composite has not been tested yet */
1803 .type = EM28XX_VMUX_COMPOSITE1,
1804 .vmux = TVP5150_COMPOSITE1,
1805 .amux = EM28XX_AMUX_VIDEO,
1806 }, { /* S-video has not been tested yet */
1807 .type = EM28XX_VMUX_SVIDEO,
1808 .vmux = TVP5150_SVIDEO,
1809 .amux = EM28XX_AMUX_VIDEO,
1810 } },
1811 },
Mauro Carvalho Chehab4557af92009-05-23 09:58:52 -03001812 [EM2860_BOARD_TERRATEC_GRABBY] = {
1813 .name = "Terratec Grabby",
1814 .vchannels = 2,
1815 .tuner_type = TUNER_ABSENT,
1816 .decoder = EM28XX_SAA711X,
1817 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
1818 .input = { {
1819 .type = EM28XX_VMUX_COMPOSITE1,
1820 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehaba3fa9042010-10-25 17:51:15 -03001821 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab4557af92009-05-23 09:58:52 -03001822 }, {
1823 .type = EM28XX_VMUX_SVIDEO,
1824 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehaba3fa9042010-10-25 17:51:15 -03001825 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab4557af92009-05-23 09:58:52 -03001826 } },
1827 },
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -03001828 [EM2860_BOARD_TERRATEC_AV350] = {
1829 .name = "Terratec AV350",
1830 .vchannels = 2,
1831 .tuner_type = TUNER_ABSENT,
1832 .decoder = EM28XX_TVP5150,
1833 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
1834 .mute_gpio = terratec_av350_mute_gpio,
1835 .input = { {
1836 .type = EM28XX_VMUX_COMPOSITE1,
1837 .vmux = TVP5150_COMPOSITE1,
1838 .amux = EM28XX_AUDIO_SRC_LINE,
Jean Delvare1df8e982009-05-13 16:48:07 -03001839 .gpio = terratec_av350_unmute_gpio,
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -03001840
1841 }, {
1842 .type = EM28XX_VMUX_SVIDEO,
1843 .vmux = TVP5150_SVIDEO,
1844 .amux = EM28XX_AUDIO_SRC_LINE,
Jean Delvare1df8e982009-05-13 16:48:07 -03001845 .gpio = terratec_av350_unmute_gpio,
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -03001846 } },
1847 },
Adrian Taylor8298f2f2010-10-20 07:55:33 -03001848
1849 [EM2860_BOARD_ELGATO_VIDEO_CAPTURE] = {
1850 .name = "Elgato Video Capture",
1851 .decoder = EM28XX_SAA711X,
1852 .tuner_type = TUNER_ABSENT, /* Capture only device */
1853 .input = { {
1854 .type = EM28XX_VMUX_COMPOSITE1,
1855 .vmux = SAA7115_COMPOSITE0,
1856 .amux = EM28XX_AMUX_LINE_IN,
1857 }, {
1858 .type = EM28XX_VMUX_SVIDEO,
1859 .vmux = SAA7115_SVIDEO3,
1860 .amux = EM28XX_AMUX_LINE_IN,
1861 } },
1862 },
1863
Devin Heitmueller19859222009-06-19 00:33:54 -03001864 [EM2882_BOARD_EVGA_INDTUBE] = {
1865 .name = "Evga inDtube",
1866 .tuner_type = TUNER_XC2028,
1867 .tuner_gpio = default_tuner_gpio,
1868 .decoder = EM28XX_TVP5150,
Devin Heitmuellera4c47302009-06-20 21:34:42 -03001869 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */
Devin Heitmueller19859222009-06-19 00:33:54 -03001870 .mts_firmware = 1,
1871 .has_dvb = 1,
1872 .dvb_gpio = evga_indtube_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001873 .ir_codes = RC_MAP_EVGA_INDTUBE,
Devin Heitmueller19859222009-06-19 00:33:54 -03001874 .input = { {
1875 .type = EM28XX_VMUX_TELEVISION,
1876 .vmux = TVP5150_COMPOSITE0,
1877 .amux = EM28XX_AMUX_VIDEO,
1878 .gpio = evga_indtube_analog,
1879 }, {
1880 .type = EM28XX_VMUX_COMPOSITE1,
1881 .vmux = TVP5150_COMPOSITE1,
1882 .amux = EM28XX_AMUX_LINE_IN,
1883 .gpio = evga_indtube_analog,
1884 }, {
1885 .type = EM28XX_VMUX_SVIDEO,
1886 .vmux = TVP5150_SVIDEO,
1887 .amux = EM28XX_AMUX_LINE_IN,
1888 .gpio = evga_indtube_analog,
1889 } },
1890 },
Antti Palosaari285eb1a2009-09-15 14:42:13 -03001891 /* eb1a:2868 Empia EM2870 + Philips CU1216L NIM (Philips TDA10023 +
1892 Infineon TUA6034) */
1893 [EM2870_BOARD_REDDO_DVB_C_USB_BOX] = {
1894 .name = "Reddo DVB-C USB TV Box",
1895 .tuner_type = TUNER_ABSENT,
Antti Palosaari28f4ddd12009-10-04 12:59:35 -03001896 .tuner_gpio = reddo_dvb_c_usb_box,
Antti Palosaari285eb1a2009-09-15 14:42:13 -03001897 .has_dvb = 1,
Antti Palosaari285eb1a2009-09-15 14:42:13 -03001898 },
Jarod Wilson7e48b302010-03-07 17:55:43 -03001899 /* 1b80:a340 - Empia EM2870, NXP TDA18271HD and LG DT3304, sold
1900 * initially as the KWorld PlusTV 340U, then as the UB435-Q.
1901 * Early variants have a TDA18271HD/C1, later ones a TDA18271HD/C2 */
1902 [EM2870_BOARD_KWORLD_A340] = {
1903 .name = "KWorld PlusTV 340U or UB435-Q (ATSC)",
1904 .tuner_type = TUNER_ABSENT, /* Digital-only TDA18271HD */
1905 .has_dvb = 1,
1906 .dvb_gpio = kworld_a340_digital,
1907 .tuner_gpio = default_tuner_gpio,
1908 },
Antti Palosaari460312e2011-05-25 17:03:50 -03001909 /* 2013:024f PCTV nanoStick T2 290e.
Antti Palosaarid6a5f922011-04-07 16:34:44 -03001910 * Empia EM28174, Sony CXD2820R and NXP TDA18271HD/C2 */
1911 [EM28174_BOARD_PCTV_290E] = {
Antti Palosaari460312e2011-05-25 17:03:50 -03001912 .name = "PCTV nanoStick T2 290e",
Antti Palosaarid6a5f922011-04-07 16:34:44 -03001913 .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT |
1914 EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_FREQ_100_KHZ,
Antti Palosaarid6a5f922011-04-07 16:34:44 -03001915 .tuner_type = TUNER_ABSENT,
1916 .tuner_gpio = pctv_290e,
1917 .has_dvb = 1,
Antti Palosaariff7b9292011-05-25 17:00:35 -03001918 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
Antti Palosaarid6a5f922011-04-07 16:34:44 -03001919 },
Antti Palosaari36588712011-08-01 01:15:30 -03001920 /* 2013:024f PCTV DVB-S2 Stick 460e
1921 * Empia EM28174, NXP TDA10071, Conexant CX24118A and Allegro A8293 */
1922 [EM28174_BOARD_PCTV_460E] = {
1923 .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT |
1924 EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_FREQ_400_KHZ,
1925 .name = "PCTV DVB-S2 Stick (460e)",
1926 .tuner_type = TUNER_ABSENT,
1927 .tuner_gpio = pctv_460e,
1928 .has_dvb = 1,
1929 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
1930 },
Gareth Williams4d28d3d2011-12-24 05:47:29 -03001931 /* eb1a:5006 Honestech VIDBOX NW03
1932 * Empia EM2860, Philips SAA7113, Empia EMP202, No Tuner */
1933 [EM2860_BOARD_HT_VIDBOX_NW03] = {
1934 .name = "Honestech Vidbox NW03",
1935 .tuner_type = TUNER_ABSENT,
1936 .decoder = EM28XX_SAA711X,
1937 .input = { {
1938 .type = EM28XX_VMUX_COMPOSITE1,
1939 .vmux = SAA7115_COMPOSITE0,
1940 .amux = EM28XX_AMUX_LINE_IN,
1941 }, {
1942 .type = EM28XX_VMUX_SVIDEO,
1943 .vmux = SAA7115_SVIDEO3, /* S-VIDEO needs confirming */
1944 .amux = EM28XX_AMUX_LINE_IN,
1945 } },
1946 },
Antti Palosaari35530852012-03-18 18:09:01 -03001947 /* 1b80:e425 MaxMedia UB425-TC
1948 * Empia EM2874B + Micronas DRX 3913KA2 + NXP TDA18271HDC2 */
1949 [EM2874_BOARD_MAXMEDIA_UB425_TC] = {
1950 .name = "MaxMedia UB425-TC",
1951 .tuner_type = TUNER_ABSENT,
1952 .tuner_gpio = maxmedia_ub425_tc,
1953 .has_dvb = 1,
1954 .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT |
1955 EM28XX_I2C_CLK_WAIT_ENABLE |
1956 EM28XX_I2C_FREQ_400_KHZ,
1957 },
Ivan Kalvachevfa5527c2012-03-19 20:09:55 -03001958 /* 2304:0242 PCTV QuatroStick (510e)
1959 * Empia EM2884 + Micronas DRX 3926K + NXP TDA18271HDC2 */
1960 [EM2884_BOARD_PCTV_510E] = {
1961 .name = "PCTV QuatroStick (510e)",
1962 .tuner_type = TUNER_ABSENT,
1963 .tuner_gpio = pctv_510e,
1964 .has_dvb = 1,
1965 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
1966 .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT |
1967 EM28XX_I2C_CLK_WAIT_ENABLE |
1968 EM28XX_I2C_FREQ_400_KHZ,
1969 },
Antti Palosaaric247d7b2012-03-19 11:48:19 -03001970 /* 2013:0251 PCTV QuatroStick nano (520e)
1971 * Empia EM2884 + Micronas DRX 3926K + NXP TDA18271HDC2 */
1972 [EM2884_BOARD_PCTV_520E] = {
1973 .name = "PCTV QuatroStick nano (520e)",
1974 .tuner_type = TUNER_ABSENT,
1975 .tuner_gpio = pctv_520e,
1976 .has_dvb = 1,
1977 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
1978 .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT |
1979 EM28XX_I2C_CLK_WAIT_ENABLE |
1980 EM28XX_I2C_FREQ_400_KHZ,
1981 },
Martin Blumenstingl89040132012-10-04 14:22:54 -03001982 [EM2884_BOARD_TERRATEC_HTC_USB_XS] = {
1983 .name = "Terratec Cinergy HTC USB XS",
1984 .has_dvb = 1,
1985 .ir_codes = RC_MAP_NEC_TERRATEC_CINERGY_XS,
1986 .tuner_type = TUNER_ABSENT,
1987 .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT |
1988 EM28XX_I2C_CLK_WAIT_ENABLE |
1989 EM28XX_I2C_FREQ_400_KHZ,
1990 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001991};
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001992const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001993
1994/* table of devices that work with this driver */
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03001995struct usb_device_id em28xx_id_table[] = {
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001996 { USB_DEVICE(0xeb1a, 0x2750),
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001997 .driver_info = EM2750_BOARD_UNKNOWN },
1998 { USB_DEVICE(0xeb1a, 0x2751),
1999 .driver_info = EM2750_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002000 { USB_DEVICE(0xeb1a, 0x2800),
2001 .driver_info = EM2800_BOARD_UNKNOWN },
Mauro Carvalho Chehab9b4e8452009-08-07 12:08:02 -03002002 { USB_DEVICE(0xeb1a, 0x2710),
2003 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002004 { USB_DEVICE(0xeb1a, 0x2820),
2005 .driver_info = EM2820_BOARD_UNKNOWN },
2006 { USB_DEVICE(0xeb1a, 0x2821),
Devin Heitmuellerc665f4d2008-12-16 23:35:23 -03002007 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002008 { USB_DEVICE(0xeb1a, 0x2860),
2009 .driver_info = EM2820_BOARD_UNKNOWN },
2010 { USB_DEVICE(0xeb1a, 0x2861),
2011 .driver_info = EM2820_BOARD_UNKNOWN },
Devin Heitmuellerf91cb652009-09-30 22:44:19 -03002012 { USB_DEVICE(0xeb1a, 0x2862),
2013 .driver_info = EM2820_BOARD_UNKNOWN },
Devin Heitmueller443fed92010-03-19 23:53:12 -03002014 { USB_DEVICE(0xeb1a, 0x2863),
2015 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002016 { USB_DEVICE(0xeb1a, 0x2870),
2017 .driver_info = EM2820_BOARD_UNKNOWN },
2018 { USB_DEVICE(0xeb1a, 0x2881),
2019 .driver_info = EM2820_BOARD_UNKNOWN },
2020 { USB_DEVICE(0xeb1a, 0x2883),
2021 .driver_info = EM2820_BOARD_UNKNOWN },
Antti Palosaari285eb1a2009-09-15 14:42:13 -03002022 { USB_DEVICE(0xeb1a, 0x2868),
2023 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03002024 { USB_DEVICE(0xeb1a, 0x2875),
2025 .driver_info = EM2820_BOARD_UNKNOWN },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002026 { USB_DEVICE(0xeb1a, 0xe300),
2027 .driver_info = EM2861_BOARD_KWORLD_PVRTV_300U },
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03002028 { USB_DEVICE(0xeb1a, 0xe303),
2029 .driver_info = EM2860_BOARD_KAIOMY_TVNPC_U2 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002030 { USB_DEVICE(0xeb1a, 0xe305),
2031 .driver_info = EM2880_BOARD_KWORLD_DVB_305U },
2032 { USB_DEVICE(0xeb1a, 0xe310),
2033 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD },
Franklin Mengd7de5d82009-06-06 17:05:02 -03002034 { USB_DEVICE(0xeb1a, 0xa313),
2035 .driver_info = EM2882_BOARD_KWORLD_ATSC_315U },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002036 { USB_DEVICE(0xeb1a, 0xa316),
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03002037 .driver_info = EM2883_BOARD_KWORLD_HYBRID_330U },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002038 { USB_DEVICE(0xeb1a, 0xe320),
2039 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD_II },
2040 { USB_DEVICE(0xeb1a, 0xe323),
2041 .driver_info = EM2882_BOARD_KWORLD_VS_DVBT },
2042 { USB_DEVICE(0xeb1a, 0xe350),
2043 .driver_info = EM2870_BOARD_KWORLD_350U },
2044 { USB_DEVICE(0xeb1a, 0xe355),
2045 .driver_info = EM2870_BOARD_KWORLD_355U },
2046 { USB_DEVICE(0xeb1a, 0x2801),
2047 .driver_info = EM2800_BOARD_GRABBEEX_USB2800 },
2048 { USB_DEVICE(0xeb1a, 0xe357),
2049 .driver_info = EM2870_BOARD_KWORLD_355U },
Aivar Päkk1985f6f2011-12-11 18:15:00 -03002050 { USB_DEVICE(0xeb1a, 0xe359),
2051 .driver_info = EM2870_BOARD_KWORLD_355U },
Douglas Schilling Landgrafac40d9e2009-02-25 16:55:48 -03002052 { USB_DEVICE(0x1b80, 0xe302),
2053 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, /* Kaiser Baas Video to DVD maker */
Douglas Schilling Landgrafea476892009-09-06 18:41:59 -03002054 { USB_DEVICE(0x1b80, 0xe304),
2055 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, /* Kworld DVD Maker 2 */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002056 { USB_DEVICE(0x0ccd, 0x0036),
2057 .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002058 { USB_DEVICE(0x0ccd, 0x004c),
2059 .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS_FR },
2060 { USB_DEVICE(0x0ccd, 0x004f),
2061 .driver_info = EM2860_BOARD_TERRATEC_HYBRID_XS },
2062 { USB_DEVICE(0x0ccd, 0x005e),
2063 .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS },
2064 { USB_DEVICE(0x0ccd, 0x0042),
Philippe Bourdin91245442010-10-31 09:57:58 -03002065 .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002066 { USB_DEVICE(0x0ccd, 0x0043),
Mauro Carvalho Chehab4e145342011-11-16 14:38:28 -02002067 .driver_info = EM2870_BOARD_TERRATEC_XS },
Holger Nelson6c3b9062011-12-23 23:15:32 -03002068 { USB_DEVICE(0x0ccd, 0x008e), /* Cinergy HTC USB XS Rev. 1 */
Martin Blumenstingl89040132012-10-04 14:22:54 -03002069 .driver_info = EM2884_BOARD_TERRATEC_HTC_USB_XS },
Holger Nelson6c3b9062011-12-23 23:15:32 -03002070 { USB_DEVICE(0x0ccd, 0x00ac), /* Cinergy HTC USB XS Rev. 2 */
Martin Blumenstingl89040132012-10-04 14:22:54 -03002071 .driver_info = EM2884_BOARD_TERRATEC_HTC_USB_XS },
Mauro Carvalho Chehab4e145342011-11-16 14:38:28 -02002072 { USB_DEVICE(0x0ccd, 0x10a2), /* H5 Rev. 1 */
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -03002073 .driver_info = EM2884_BOARD_TERRATEC_H5 },
Mauro Carvalho Chehab4e145342011-11-16 14:38:28 -02002074 { USB_DEVICE(0x0ccd, 0x10ad), /* H5 Rev. 2 */
Mauro Carvalho Chehab33ba28e2011-07-14 21:48:00 -03002075 .driver_info = EM2884_BOARD_TERRATEC_H5 },
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -03002076 { USB_DEVICE(0x0ccd, 0x0084),
2077 .driver_info = EM2860_BOARD_TERRATEC_AV350 },
Mauro Carvalho Chehab4557af92009-05-23 09:58:52 -03002078 { USB_DEVICE(0x0ccd, 0x0096),
2079 .driver_info = EM2860_BOARD_TERRATEC_GRABBY },
Tekaefabaaf2011-10-14 05:40:29 -03002080 { USB_DEVICE(0x0ccd, 0x10AF),
2081 .driver_info = EM2860_BOARD_TERRATEC_GRABBY },
Andreas Oberrittera1ed02e2011-11-16 11:06:50 -03002082 { USB_DEVICE(0x0ccd, 0x00b2),
2083 .driver_info = EM2884_BOARD_CINERGY_HTC_STICK },
Adrian Taylor8298f2f2010-10-20 07:55:33 -03002084 { USB_DEVICE(0x0fd9, 0x0033),
2085 .driver_info = EM2860_BOARD_ELGATO_VIDEO_CAPTURE},
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002086 { USB_DEVICE(0x185b, 0x2870),
2087 .driver_info = EM2870_BOARD_COMPRO_VIDEOMATE },
Vitaly Woold3603342008-07-27 14:10:11 -03002088 { USB_DEVICE(0x185b, 0x2041),
Mauro Carvalho Chehabee281b82008-07-27 16:58:04 -03002089 .driver_info = EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002090 { USB_DEVICE(0x2040, 0x4200),
2091 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
Mauro Carvalho Chehab15b9bec2008-01-13 12:02:20 -03002092 { USB_DEVICE(0x2040, 0x4201),
2093 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002094 { USB_DEVICE(0x2040, 0x6500),
2095 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 },
Luc Saillard427d20c2008-01-30 17:23:00 -03002096 { USB_DEVICE(0x2040, 0x6502),
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002097 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2 },
Michael Krufky74ee0512008-05-01 18:02:30 -03002098 { USB_DEVICE(0x2040, 0x6513), /* HCW HVR-980 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002099 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Michael Krufky74ee0512008-05-01 18:02:30 -03002100 { USB_DEVICE(0x2040, 0x6517), /* HP HVR-950 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002101 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Michael Krufky74ee0512008-05-01 18:02:30 -03002102 { USB_DEVICE(0x2040, 0x651b), /* RP HVR-950 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002103 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03002104 { USB_DEVICE(0x2040, 0x651f),
2105 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850 },
Devin Heitmuellere14b3652008-07-26 11:04:33 -03002106 { USB_DEVICE(0x0438, 0xb002),
2107 .driver_info = EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002108 { USB_DEVICE(0x2001, 0xf112),
2109 .driver_info = EM2820_BOARD_DLINK_USB_TV },
2110 { USB_DEVICE(0x2304, 0x0207),
2111 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
2112 { USB_DEVICE(0x2304, 0x0208),
2113 .driver_info = EM2820_BOARD_PINNACLE_USB_2 },
2114 { USB_DEVICE(0x2304, 0x021a),
2115 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
2116 { USB_DEVICE(0x2304, 0x0226),
Devin Heitmueller09bc1942011-03-13 02:07:54 -03002117 .driver_info = EM2882_BOARD_PINNACLE_HYBRID_PRO_330E },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002118 { USB_DEVICE(0x2304, 0x0227),
2119 .driver_info = EM2880_BOARD_PINNACLE_PCTV_HD_PRO },
2120 { USB_DEVICE(0x0413, 0x6023),
2121 .driver_info = EM2800_BOARD_LEADTEK_WINFAST_USBII },
Don Kramer74e07f32012-01-02 16:15:44 -03002122 { USB_DEVICE(0x093b, 0xa003),
2123 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002124 { USB_DEVICE(0x093b, 0xa005),
2125 .driver_info = EM2861_BOARD_PLEXTOR_PX_TV100U },
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03002126 { USB_DEVICE(0x04bb, 0x0515),
2127 .driver_info = EM2820_BOARD_IODATA_GVMVP_SZ },
Zhenyu Wang7c8b5672009-07-05 10:51:21 -03002128 { USB_DEVICE(0xeb1a, 0x50a6),
2129 .driver_info = EM2860_BOARD_GADMEI_UTV330 },
Jarod Wilson7e48b302010-03-07 17:55:43 -03002130 { USB_DEVICE(0x1b80, 0xa340),
2131 .driver_info = EM2870_BOARD_KWORLD_A340 },
Antti Palosaarid6a5f922011-04-07 16:34:44 -03002132 { USB_DEVICE(0x2013, 0x024f),
2133 .driver_info = EM28174_BOARD_PCTV_290E },
Antti Palosaari36588712011-08-01 01:15:30 -03002134 { USB_DEVICE(0x2013, 0x024c),
2135 .driver_info = EM28174_BOARD_PCTV_460E },
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -03002136 { USB_DEVICE(0x2040, 0x1605),
2137 .driver_info = EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C },
Gareth Williams4d28d3d2011-12-24 05:47:29 -03002138 { USB_DEVICE(0xeb1a, 0x5006),
2139 .driver_info = EM2860_BOARD_HT_VIDBOX_NW03 },
Mario Ceresa2f786042012-01-06 16:00:12 -03002140 { USB_DEVICE(0x1b80, 0xe309), /* Sveon STV40 */
2141 .driver_info = EM2860_BOARD_EASYCAP },
Antti Palosaari35530852012-03-18 18:09:01 -03002142 { USB_DEVICE(0x1b80, 0xe425),
2143 .driver_info = EM2874_BOARD_MAXMEDIA_UB425_TC },
Ivan Kalvachevfa5527c2012-03-19 20:09:55 -03002144 { USB_DEVICE(0x2304, 0x0242),
2145 .driver_info = EM2884_BOARD_PCTV_510E },
Antti Palosaaric247d7b2012-03-19 11:48:19 -03002146 { USB_DEVICE(0x2013, 0x0251),
2147 .driver_info = EM2884_BOARD_PCTV_520E },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002148 { },
2149};
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002150MODULE_DEVICE_TABLE(usb, em28xx_id_table);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002151
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002152/*
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002153 * EEPROM hash table for devices with generic USB IDs
2154 */
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03002155static struct em28xx_hash_table em28xx_eeprom_hash[] = {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03002156 /* P/N: SA 60002070465 Tuner: TVF7533-MF */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002157 {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF},
Douglas Schilling Landgraf1e1addd2008-12-27 21:38:14 -03002158 {0x72cc5a8b, EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2, TUNER_YMEC_TVF_5533MF},
Darron Broadda3808e2008-09-30 02:46:41 -03002159 {0x966a0441, EM2880_BOARD_KWORLD_DVB_310U, TUNER_XC2028},
Douglas Schilling Landgrafa35c87c2009-08-06 12:52:11 -03002160 {0x166a0441, EM2880_BOARD_EMPIRE_DUAL_TV, TUNER_XC2028},
Devin Heitmueller19859222009-06-19 00:33:54 -03002161 {0xcee44a99, EM2882_BOARD_EVGA_INDTUBE, TUNER_XC2028},
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03002162 {0xb8846b20, EM2881_BOARD_PINNACLE_HYBRID_PRO, TUNER_XC2028},
Antti Palosaari285eb1a2009-09-15 14:42:13 -03002163 {0x63f653bd, EM2870_BOARD_REDDO_DVB_C_USB_BOX, TUNER_ABSENT},
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03002164 {0x4e913442, EM2882_BOARD_DIKOM_DK300, TUNER_XC2028},
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002165};
2166
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03002167/* I2C devicelist hash table for devices with generic USB IDs */
Sascha Sommerfad7b952007-11-04 08:06:48 -03002168static struct em28xx_hash_table em28xx_i2c_hash[] = {
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002169 {0xb06a32c3, EM2800_BOARD_TERRATEC_CINERGY_200, TUNER_LG_PAL_NEW_TAPC},
2170 {0xf51200e3, EM2800_BOARD_VGEAR_POCKETTV, TUNER_LG_PAL_NEW_TAPC},
Devin Heitmueller3ed58ba2009-05-27 23:27:26 -03002171 {0x1ba50080, EM2860_BOARD_SAA711X_REFERENCE_DESIGN, TUNER_ABSENT},
Devin Heitmueller443fed92010-03-19 23:53:12 -03002172 {0x77800080, EM2860_BOARD_TVP5150_REFERENCE_DESIGN, TUNER_ABSENT},
Douglas Schilling Landgraff7fe3e62009-01-19 09:31:55 -03002173 {0xc51200e3, EM2820_BOARD_GADMEI_TVR200, TUNER_LG_PAL_NEW_TAPC},
Mauro Carvalho Chehab6d888a62009-08-30 13:05:56 -03002174 {0x4ba50080, EM2861_BOARD_GADMEI_UTV330PLUS, TUNER_TNF_5335MF},
Mauro Carvalho Chehabebaefdb2011-06-01 10:16:25 -03002175 {0x6b800080, EM2874_BOARD_LEADERSHIP_ISDBT, TUNER_ABSENT},
Sascha Sommerfad7b952007-11-04 08:06:48 -03002176};
2177
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002178/* I2C possible address to saa7115, tvp5150, msp3400, tvaudio */
2179static unsigned short saa711x_addrs[] = {
2180 0x4a >> 1, 0x48 >> 1, /* SAA7111, SAA7111A and SAA7113 */
2181 0x42 >> 1, 0x40 >> 1, /* SAA7114, SAA7115 and SAA7118 */
2182 I2C_CLIENT_END };
2183
2184static unsigned short tvp5150_addrs[] = {
2185 0xb8 >> 1,
2186 0xba >> 1,
2187 I2C_CLIENT_END
2188};
2189
2190static unsigned short msp3400_addrs[] = {
2191 0x80 >> 1,
2192 0x88 >> 1,
2193 I2C_CLIENT_END
2194};
2195
Michael Krufkyd7cba042008-09-12 13:31:45 -03002196int em28xx_tuner_callback(void *ptr, int component, int command, int arg)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002197{
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002198 int rc = 0;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002199 struct em28xx *dev = ptr;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002200
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -03002201 if (dev->tuner_type != TUNER_XC2028 && dev->tuner_type != TUNER_XC5000)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002202 return 0;
2203
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -03002204 if (command != XC2028_TUNER_RESET && command != XC5000_TUNER_RESET)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002205 return 0;
2206
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03002207 rc = em28xx_gpio_set(dev, dev->board.tuner_gpio);
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002208
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002209 return rc;
2210}
2211EXPORT_SYMBOL_GPL(em28xx_tuner_callback);
2212
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03002213static inline void em28xx_set_model(struct em28xx *dev)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002214{
Ezequiel Garciae0f6e4d2012-09-26 06:25:12 -03002215 dev->board = em28xx_boards[dev->model];
Devin Heitmuellered14e1c2008-12-29 22:27:30 -03002216
2217 /* Those are the default values for the majority of boards
2218 Use those values if not specified otherwise at boards entry
2219 */
2220 if (!dev->board.xclk)
2221 dev->board.xclk = EM28XX_XCLK_IR_RC5_MODE |
2222 EM28XX_XCLK_FREQUENCY_12MHZ;
2223
2224 if (!dev->board.i2c_speed)
2225 dev->board.i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
2226 EM28XX_I2C_FREQ_100_KHZ;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002227}
2228
Mauro Carvalho Chehabf2e26ae2009-08-12 20:21:44 -03002229
2230/* FIXME: Should be replaced by a proper mt9m111 driver */
2231static int em28xx_initialize_mt9m111(struct em28xx *dev)
2232{
2233 int i;
2234 unsigned char regs[][3] = {
2235 { 0x0d, 0x00, 0x01, }, /* reset and use defaults */
2236 { 0x0d, 0x00, 0x00, },
2237 { 0x0a, 0x00, 0x21, },
2238 { 0x21, 0x04, 0x00, }, /* full readout speed, no row/col skipping */
2239 };
2240
2241 for (i = 0; i < ARRAY_SIZE(regs); i++)
2242 i2c_master_send(&dev->i2c_client, &regs[i][0], 3);
2243
2244 return 0;
2245}
2246
2247
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -03002248/* FIXME: Should be replaced by a proper mt9m001 driver */
2249static int em28xx_initialize_mt9m001(struct em28xx *dev)
2250{
2251 int i;
2252 unsigned char regs[][3] = {
2253 { 0x0d, 0x00, 0x01, },
2254 { 0x0d, 0x00, 0x00, },
2255 { 0x04, 0x05, 0x00, }, /* hres = 1280 */
2256 { 0x03, 0x04, 0x00, }, /* vres = 1024 */
2257 { 0x20, 0x11, 0x00, },
2258 { 0x06, 0x00, 0x10, },
2259 { 0x2b, 0x00, 0x24, },
2260 { 0x2e, 0x00, 0x24, },
2261 { 0x35, 0x00, 0x24, },
2262 { 0x2d, 0x00, 0x20, },
2263 { 0x2c, 0x00, 0x20, },
2264 { 0x09, 0x0a, 0xd4, },
2265 { 0x35, 0x00, 0x57, },
2266 };
2267
2268 for (i = 0; i < ARRAY_SIZE(regs); i++)
2269 i2c_master_send(&dev->i2c_client, &regs[i][0], 3);
2270
2271 return 0;
2272}
2273
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002274/* HINT method: webcam I2C chips
2275 *
Mauro Carvalho Chehabf2e26ae2009-08-12 20:21:44 -03002276 * This method works for webcams with Micron sensors
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002277 */
2278static int em28xx_hint_sensor(struct em28xx *dev)
2279{
2280 int rc;
2281 char *sensor_name;
2282 unsigned char cmd;
2283 __be16 version_be;
2284 u16 version;
2285
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002286 /* Micron sensor detection */
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002287 dev->i2c_client.addr = 0xba >> 1;
2288 cmd = 0;
2289 i2c_master_send(&dev->i2c_client, &cmd, 1);
2290 rc = i2c_master_recv(&dev->i2c_client, (char *)&version_be, 2);
2291 if (rc != 2)
2292 return -EINVAL;
2293
2294 version = be16_to_cpu(version_be);
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002295 switch (version) {
Mauro Carvalho Chehab296544e2009-07-27 08:24:29 -03002296 case 0x8232: /* mt9v011 640x480 1.3 Mpix sensor */
2297 case 0x8243: /* mt9v011 rev B 640x480 1.3 Mpix sensor */
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002298 dev->model = EM2820_BOARD_SILVERCREST_WEBCAM;
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002299 em28xx_set_model(dev);
2300
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002301 sensor_name = "mt9v011";
Mauro Carvalho Chehab527f09a2009-07-12 11:04:15 -03002302 dev->em28xx_sensor = EM28XX_MT9V011;
Mauro Carvalho Chehab55699962009-07-13 20:15:02 -03002303 dev->sensor_xres = 640;
2304 dev->sensor_yres = 480;
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002305 /*
2306 * FIXME: mt9v011 uses I2S speed as xtal clk - at least with
2307 * the Silvercrest cam I have here for testing - for higher
2308 * resolutions, a high clock cause horizontal artifacts, so we
2309 * need to use a lower xclk frequency.
2310 * Yet, it would be possible to adjust xclk depending on the
2311 * desired resolution, since this affects directly the
2312 * frame rate.
2313 */
2314 dev->board.xclk = EM28XX_XCLK_FREQUENCY_4_3MHZ;
2315 dev->sensor_xtal = 4300000;
Mauro Carvalho Chehab579d3152009-07-14 12:33:25 -03002316
2317 /* probably means GRGB 16 bit bayer */
2318 dev->vinmode = 0x0d;
2319 dev->vinctl = 0x00;
2320
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002321 break;
Mauro Carvalho Chehabf2e26ae2009-08-12 20:21:44 -03002322
2323 case 0x143a: /* MT9M111 as found in the ECS G200 */
2324 dev->model = EM2750_BOARD_UNKNOWN;
2325 em28xx_set_model(dev);
2326
2327 sensor_name = "mt9m111";
2328 dev->board.xclk = EM28XX_XCLK_FREQUENCY_48MHZ;
2329 dev->em28xx_sensor = EM28XX_MT9M111;
2330 em28xx_initialize_mt9m111(dev);
2331 dev->sensor_xres = 640;
2332 dev->sensor_yres = 512;
2333
2334 dev->vinmode = 0x0a;
2335 dev->vinctl = 0x00;
2336
2337 break;
2338
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -03002339 case 0x8431:
2340 dev->model = EM2750_BOARD_UNKNOWN;
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002341 em28xx_set_model(dev);
2342
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -03002343 sensor_name = "mt9m001";
2344 dev->em28xx_sensor = EM28XX_MT9M001;
2345 em28xx_initialize_mt9m001(dev);
2346 dev->sensor_xres = 1280;
2347 dev->sensor_yres = 1024;
2348
2349 /* probably means BGGR 16 bit bayer */
2350 dev->vinmode = 0x0c;
2351 dev->vinctl = 0x00;
2352
2353 break;
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002354 default:
Mauro Carvalho Chehabf2e26ae2009-08-12 20:21:44 -03002355 printk("Unknown Micron Sensor 0x%04x\n", version);
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002356 return -EINVAL;
2357 }
2358
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002359 /* Setup webcam defaults */
2360 em28xx_pre_card_setup(dev);
2361
Mauro Carvalho Chehab8b220792009-07-12 10:56:21 -03002362 em28xx_errdev("Sensor is %s, using model %s entry.\n",
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002363 sensor_name, em28xx_boards[dev->model].name);
2364
2365 return 0;
2366}
2367
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002368/* Since em28xx_pre_card_setup() requires a proper dev->model,
2369 * this won't work for boards with generic PCI IDs
2370 */
Ezequiel Garcia60332f02012-04-28 09:57:01 -03002371static void em28xx_pre_card_setup(struct em28xx *dev)
Markus Rechbergera94e95b2006-01-23 17:11:10 -02002372{
Devin Heitmuellered14e1c2008-12-29 22:27:30 -03002373 /* Set the initial XCLK and I2C clock values based on the board
2374 definition */
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002375 em28xx_write_reg(dev, EM28XX_R0F_XCLK, dev->board.xclk & 0x7f);
Sascha Sommerca80cf62012-01-08 16:32:09 -03002376 if (!dev->board.is_em2800)
2377 em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed);
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03002378 msleep(50);
2379
Markus Rechbergera94e95b2006-01-23 17:11:10 -02002380 /* request some modules */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002381 switch (dev->model) {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002382 case EM2861_BOARD_PLEXTOR_PX_TV100U:
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -03002383 /* Sets the msp34xx I2S speed */
2384 dev->i2s_speed = 2048000;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002385 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002386 case EM2861_BOARD_KWORLD_PVRTV_300U:
2387 case EM2880_BOARD_KWORLD_DVB_305U:
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002388 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x6d);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002389 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002390 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x7d);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002391 msleep(10);
2392 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002393 case EM2870_BOARD_COMPRO_VIDEOMATE:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002394 /* TODO: someone can do some cleanup here...
2395 not everything's needed */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002396 em28xx_write_reg(dev, EM2880_R04_GPO, 0x00);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002397 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002398 em28xx_write_reg(dev, EM2880_R04_GPO, 0x01);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002399 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002400 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002401 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002402 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002403 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002404 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xdc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002405 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002406 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002407 mdelay(70);
2408 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002409 case EM2870_BOARD_TERRATEC_XS_MT2060:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002410 /* this device needs some gpio writes to get the DVB-T
2411 demod work */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002412 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002413 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002414 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xde);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002415 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002416 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002417 mdelay(70);
2418 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002419 case EM2870_BOARD_PINNACLE_PCTV_DVB:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002420 /* this device needs some gpio writes to get the
2421 DVB-T demod work */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002422 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002423 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002424 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xde);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002425 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002426 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002427 mdelay(70);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002428 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002429 case EM2820_BOARD_GADMEI_UTV310:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002430 case EM2820_BOARD_MSI_VOX_USB_2:
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03002431 /* enables audio for that devices */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002432 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002433 break;
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03002434
Franklin Mengd7de5d82009-06-06 17:05:02 -03002435 case EM2882_BOARD_KWORLD_ATSC_315U:
2436 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff);
2437 msleep(10);
2438 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
2439 msleep(10);
2440 em28xx_write_reg(dev, EM2880_R04_GPO, 0x00);
2441 msleep(10);
2442 em28xx_write_reg(dev, EM2880_R04_GPO, 0x08);
2443 msleep(10);
2444 break;
2445
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03002446 case EM2860_BOARD_KAIOMY_TVNPC_U2:
2447 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x07", 1);
2448 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
2449 em28xx_write_regs(dev, 0x0d, "\x42", 1);
2450 em28xx_write_regs(dev, 0x08, "\xfd", 1);
2451 msleep(10);
2452 em28xx_write_regs(dev, 0x08, "\xff", 1);
2453 msleep(10);
2454 em28xx_write_regs(dev, 0x08, "\x7f", 1);
2455 msleep(10);
2456 em28xx_write_regs(dev, 0x08, "\x6b", 1);
2457
2458 break;
Mauro Carvalho Chehab56ee3802009-02-11 14:18:36 -03002459 case EM2860_BOARD_EASYCAP:
2460 em28xx_write_regs(dev, 0x08, "\xf8", 1);
2461 break;
2462
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03002463 case EM2820_BOARD_IODATA_GVMVP_SZ:
2464 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff);
2465 msleep(70);
2466 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf7);
2467 msleep(10);
2468 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
2469 msleep(70);
2470 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
2471 msleep(70);
2472 break;
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002473 }
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03002474
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03002475 em28xx_gpio_set(dev, dev->board.tuner_gpio);
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03002476 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
2477
2478 /* Unlock device */
Mauro Carvalho Chehab2fe3e2e2008-11-27 09:10:40 -03002479 em28xx_set_mode(dev, EM28XX_SUSPEND);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002480}
2481
Mauro Carvalho Chehabe54318e2008-04-18 18:34:31 -03002482static void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl)
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002483{
2484 memset(ctl, 0, sizeof(*ctl));
2485
2486 ctl->fname = XC2028_DEFAULT_FIRMWARE;
2487 ctl->max_len = 64;
2488 ctl->mts = em28xx_boards[dev->model].mts_firmware;
2489
2490 switch (dev->model) {
Douglas Schilling Landgrafe5db5d42009-04-09 18:24:34 -03002491 case EM2880_BOARD_EMPIRE_DUAL_TV:
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03002492 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
Uroš Vamplec994d02009-09-30 22:53:37 -03002493 case EM2882_BOARD_TERRATEC_HYBRID_XS:
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03002494 ctl->demod = XC3028_FE_ZARLINK456;
2495 break;
reinhard schwab655b8402008-07-26 10:47:00 -03002496 case EM2880_BOARD_TERRATEC_HYBRID_XS:
Michel Garniercec4e6c2010-10-16 14:42:01 -03002497 case EM2880_BOARD_TERRATEC_HYBRID_XS_FR:
Devin Heitmuellere16e5a32009-07-15 00:37:22 -03002498 case EM2881_BOARD_PINNACLE_HYBRID_PRO:
reinhard schwab655b8402008-07-26 10:47:00 -03002499 ctl->demod = XC3028_FE_ZARLINK456;
2500 break;
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002501 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
Devin Heitmuellerad9b4bb2011-03-13 02:09:59 -03002502 case EM2882_BOARD_PINNACLE_HYBRID_PRO_330E:
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002503 ctl->demod = XC3028_FE_DEFAULT;
2504 break;
Devin Heitmueller5ea7fe42008-09-16 02:02:12 -03002505 case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600:
2506 ctl->demod = XC3028_FE_DEFAULT;
2507 ctl->fname = XC3028L_DEFAULT_FIRMWARE;
2508 break;
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03002509 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850:
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002510 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03002511 case EM2880_BOARD_PINNACLE_PCTV_HD_PRO:
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03002512 /* FIXME: Better to specify the needed IF */
Devin Heitmuellerbdfbf952008-04-17 21:38:27 -03002513 ctl->demod = XC3028_FE_DEFAULT;
2514 break;
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03002515 case EM2883_BOARD_KWORLD_HYBRID_330U:
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03002516 case EM2882_BOARD_DIKOM_DK300:
Antonio Larrosa811fab62010-03-04 22:19:48 -03002517 case EM2882_BOARD_KWORLD_VS_DVBT:
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03002518 ctl->demod = XC3028_FE_CHINA;
2519 ctl->fname = XC2028_DEFAULT_FIRMWARE;
2520 break;
Devin Heitmueller19859222009-06-19 00:33:54 -03002521 case EM2882_BOARD_EVGA_INDTUBE:
2522 ctl->demod = XC3028_FE_CHINA;
2523 ctl->fname = XC3028L_DEFAULT_FIRMWARE;
2524 break;
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002525 default:
2526 ctl->demod = XC3028_FE_OREN538;
2527 }
2528}
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002529
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002530static void em28xx_tuner_setup(struct em28xx *dev)
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002531{
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002532 struct tuner_setup tun_setup;
2533 struct v4l2_frequency f;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002534
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03002535 if (dev->tuner_type == TUNER_ABSENT)
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002536 return;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002537
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002538 memset(&tun_setup, 0, sizeof(tun_setup));
2539
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002540 tun_setup.mode_mask = T_ANALOG_TV | T_RADIO;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002541 tun_setup.tuner_callback = em28xx_tuner_callback;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002542
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002543 if (dev->board.radio.type) {
2544 tun_setup.type = dev->board.radio.type;
2545 tun_setup.addr = dev->board.radio_addr;
2546
2547 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_type_addr, &tun_setup);
2548 }
2549
2550 if ((dev->tuner_type != TUNER_ABSENT) && (dev->tuner_type)) {
2551 tun_setup.type = dev->tuner_type;
2552 tun_setup.addr = dev->tuner_addr;
2553
2554 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_type_addr, &tun_setup);
2555 }
2556
2557 if (dev->tda9887_conf) {
2558 struct v4l2_priv_tun_config tda9887_cfg;
2559
2560 tda9887_cfg.tuner = TUNER_TDA9887;
2561 tda9887_cfg.priv = &dev->tda9887_conf;
2562
2563 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_config, &tda9887_cfg);
2564 }
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002565
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002566 if (dev->tuner_type == TUNER_XC2028) {
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002567 struct v4l2_priv_tun_config xc2028_cfg;
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002568 struct xc2028_ctrl ctl;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002569
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002570 memset(&xc2028_cfg, 0, sizeof(xc2028_cfg));
2571 memset(&ctl, 0, sizeof(ctl));
2572
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002573 em28xx_setup_xc3028(dev, &ctl);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002574
2575 xc2028_cfg.tuner = TUNER_XC2028;
2576 xc2028_cfg.priv = &ctl;
2577
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002578 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_config, &xc2028_cfg);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002579 }
2580
2581 /* configure tuner */
2582 f.tuner = 0;
2583 f.type = V4L2_TUNER_ANALOG_TV;
2584 f.frequency = 9076; /* just a magic number */
2585 dev->ctl_freq = f.frequency;
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002586 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002587}
2588
2589static int em28xx_hint_board(struct em28xx *dev)
2590{
2591 int i;
2592
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03002593 /* HINT method: EEPROM
2594 *
2595 * This method works only for boards with eeprom.
2596 * Uses a hash of all eeprom bytes. The hash should be
2597 * unique for a vendor/tuner pair.
2598 * There are a high chance that tuners for different
2599 * video standards produce different hashes.
2600 */
2601 for (i = 0; i < ARRAY_SIZE(em28xx_eeprom_hash); i++) {
2602 if (dev->hash == em28xx_eeprom_hash[i].hash) {
2603 dev->model = em28xx_eeprom_hash[i].model;
2604 dev->tuner_type = em28xx_eeprom_hash[i].tuner;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002605
2606 em28xx_errdev("Your board has no unique USB ID.\n");
2607 em28xx_errdev("A hint were successfully done, "
2608 "based on eeprom hash.\n");
2609 em28xx_errdev("This method is not 100%% failproof.\n");
2610 em28xx_errdev("If the board were missdetected, "
2611 "please email this log to:\n");
2612 em28xx_errdev("\tV4L Mailing List "
Alexey Klimov51caf912009-01-25 12:53:09 -03002613 " <linux-media@vger.kernel.org>\n");
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002614 em28xx_errdev("Board detected as %s\n",
2615 em28xx_boards[dev->model].name);
2616
2617 return 0;
2618 }
2619 }
Sascha Sommerfad7b952007-11-04 08:06:48 -03002620
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03002621 /* HINT method: I2C attached devices
2622 *
2623 * This method works for all boards.
2624 * Uses a hash of i2c scanned devices.
2625 * Devices with the same i2c attached chips will
2626 * be considered equal.
2627 * This method is less precise than the eeprom one.
2628 */
2629
Sascha Sommerfad7b952007-11-04 08:06:48 -03002630 /* user did not request i2c scanning => do it now */
2631 if (!dev->i2c_hash)
2632 em28xx_do_i2c_scan(dev);
2633
2634 for (i = 0; i < ARRAY_SIZE(em28xx_i2c_hash); i++) {
2635 if (dev->i2c_hash == em28xx_i2c_hash[i].hash) {
2636 dev->model = em28xx_i2c_hash[i].model;
2637 dev->tuner_type = em28xx_i2c_hash[i].tuner;
2638 em28xx_errdev("Your board has no unique USB ID.\n");
2639 em28xx_errdev("A hint were successfully done, "
2640 "based on i2c devicelist hash.\n");
2641 em28xx_errdev("This method is not 100%% failproof.\n");
2642 em28xx_errdev("If the board were missdetected, "
2643 "please email this log to:\n");
2644 em28xx_errdev("\tV4L Mailing List "
Alexey Klimov51caf912009-01-25 12:53:09 -03002645 " <linux-media@vger.kernel.org>\n");
Sascha Sommerfad7b952007-11-04 08:06:48 -03002646 em28xx_errdev("Board detected as %s\n",
2647 em28xx_boards[dev->model].name);
2648
2649 return 0;
2650 }
2651 }
2652
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002653 em28xx_errdev("Your board has no unique USB ID and thus need a "
2654 "hint to be detected.\n");
2655 em28xx_errdev("You may try to use card=<n> insmod option to "
2656 "workaround that.\n");
2657 em28xx_errdev("Please send an email with this log to:\n");
Alexey Klimov51caf912009-01-25 12:53:09 -03002658 em28xx_errdev("\tV4L Mailing List <linux-media@vger.kernel.org>\n");
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002659 em28xx_errdev("Board eeprom hash is 0x%08lx\n", dev->hash);
Sascha Sommerfad7b952007-11-04 08:06:48 -03002660 em28xx_errdev("Board i2c devicelist hash is 0x%08lx\n", dev->i2c_hash);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002661
2662 em28xx_errdev("Here is a list of valid choices for the card=<n>"
2663 " insmod option:\n");
2664 for (i = 0; i < em28xx_bcount; i++) {
2665 em28xx_errdev(" card=%d -> %s\n",
2666 i, em28xx_boards[i].name);
2667 }
2668 return -1;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002669}
2670
Ezequiel Garcia60332f02012-04-28 09:57:01 -03002671static void em28xx_card_setup(struct em28xx *dev)
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002672{
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002673 /*
2674 * If the device can be a webcam, seek for a sensor.
2675 * If sensor is not found, then it isn't a webcam.
2676 */
2677 if (dev->board.is_webcam) {
2678 if (em28xx_hint_sensor(dev) < 0)
2679 dev->board.is_webcam = 0;
2680 else
2681 dev->progressive = 1;
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03002682 }
2683
2684 if (!dev->board.is_webcam) {
2685 switch (dev->model) {
2686 case EM2820_BOARD_UNKNOWN:
2687 case EM2800_BOARD_UNKNOWN:
2688 /*
2689 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD.
2690 *
2691 * This occurs because they share identical USB vendor and
2692 * product IDs.
2693 *
2694 * What we do here is look up the EEPROM hash of the K-WORLD
2695 * and if it is found then we decide that we do not have
2696 * a DIGIVOX and reset the device to the K-WORLD instead.
2697 *
2698 * This solution is only valid if they do not share eeprom
2699 * hash identities which has not been determined as yet.
2700 */
2701 if (em28xx_hint_board(dev) < 0)
2702 em28xx_errdev("Board not discovered\n");
2703 else {
2704 em28xx_set_model(dev);
2705 em28xx_pre_card_setup(dev);
2706 }
2707 break;
2708 default:
2709 em28xx_set_model(dev);
2710 }
2711 }
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002712
2713 em28xx_info("Identified as %s (card=%d)\n",
2714 dev->board.name, dev->model);
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002715
2716 dev->tuner_type = em28xx_boards[dev->model].tuner_type;
Mauro Carvalho Chehab31e05302008-11-20 18:47:37 -03002717 if (em28xx_boards[dev->model].tuner_addr)
2718 dev->tuner_addr = em28xx_boards[dev->model].tuner_addr;
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002719
Franklin Mengae3340c2009-06-06 16:34:01 -03002720 if (em28xx_boards[dev->model].tda9887_conf)
2721 dev->tda9887_conf = em28xx_boards[dev->model].tda9887_conf;
2722
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002723 /* request some modules */
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002724 switch (dev->model) {
2725 case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2:
Mauro Carvalho Chehab98ae1272007-11-05 09:30:39 -03002726 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002727 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03002728 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850:
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002729 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002730 {
2731 struct tveeprom tv;
Mauro Carvalho Chehabac07bb72009-09-08 14:04:41 -03002732#if defined(CONFIG_MODULES) && defined(MODULE)
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002733 request_module("tveeprom");
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002734#endif
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002735 /* Call first TVeeprom */
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002736
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002737 dev->i2c_client.addr = 0xa0 >> 1;
2738 tveeprom_hauppauge_analog(&dev->i2c_client, &tv, dev->eedata);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002739
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002740 dev->tuner_type = tv.tuner_type;
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03002741
Hans Verkuil38f9d302008-07-23 05:09:15 -03002742 if (tv.audio_processor == V4L2_IDENT_MSPX4XX) {
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002743 dev->i2s_speed = 2048000;
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002744 dev->board.has_msp34xx = 1;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002745 }
2746 break;
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002747 }
Franklin Mengd7de5d82009-06-06 17:05:02 -03002748 case EM2882_BOARD_KWORLD_ATSC_315U:
2749 em28xx_write_reg(dev, 0x0d, 0x42);
2750 msleep(10);
2751 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
2752 msleep(10);
2753 break;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002754 case EM2820_BOARD_KWORLD_PVRTV2800RF:
2755 /* GPIO enables sound on KWORLD PVR TV 2800RF */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002756 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf9);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002757 break;
2758 case EM2820_BOARD_UNKNOWN:
2759 case EM2800_BOARD_UNKNOWN:
Darron Broadda3808e2008-09-30 02:46:41 -03002760 /*
2761 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD.
2762 *
2763 * This occurs because they share identical USB vendor and
2764 * product IDs.
2765 *
2766 * What we do here is look up the EEPROM hash of the K-WORLD
2767 * and if it is found then we decide that we do not have
2768 * a DIGIVOX and reset the device to the K-WORLD instead.
2769 *
2770 * This solution is only valid if they do not share eeprom
2771 * hash identities which has not been determined as yet.
2772 */
2773 case EM2880_BOARD_MSI_DIGIVOX_AD:
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002774 if (!em28xx_hint_board(dev))
2775 em28xx_set_model(dev);
Devin Heitmuellercdf7bfa2009-06-19 00:20:28 -03002776
2777 /* In cases where we had to use a board hint, the call to
2778 em28xx_set_mode() in em28xx_pre_card_setup() was a no-op,
2779 so make the call now so the analog GPIOs are set properly
2780 before probing the i2c bus. */
Devin Heitmueller5343e442009-07-15 00:35:47 -03002781 em28xx_gpio_set(dev, dev->board.tuner_gpio);
Devin Heitmuellercdf7bfa2009-06-19 00:20:28 -03002782 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002783 break;
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03002784
2785/*
2786 * The Dikom DK300 is detected as an Kworld VS-DVB-T 323UR.
2787 *
2788 * This occurs because they share identical USB vendor and
2789 * product IDs.
2790 *
2791 * What we do here is look up the EEPROM hash of the Dikom
2792 * and if it is found then we decide that we do not have
2793 * a Kworld and reset the device to the Dikom instead.
2794 *
2795 * This solution is only valid if they do not share eeprom
2796 * hash identities which has not been determined as yet.
2797 */
2798 case EM2882_BOARD_KWORLD_VS_DVBT:
2799 if (!em28xx_hint_board(dev))
2800 em28xx_set_model(dev);
2801
2802 /* In cases where we had to use a board hint, the call to
2803 em28xx_set_mode() in em28xx_pre_card_setup() was a no-op,
2804 so make the call now so the analog GPIOs are set properly
2805 before probing the i2c bus. */
2806 em28xx_gpio_set(dev, dev->board.tuner_gpio);
2807 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
2808 break;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002809 }
2810
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002811 if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002812 em28xx_errdev("\n\n");
2813 em28xx_errdev("The support for this board weren't "
2814 "valid yet.\n");
2815 em28xx_errdev("Please send a report of having this working\n");
2816 em28xx_errdev("not to V4L mailing list (and/or to other "
2817 "addresses)\n\n");
2818 }
2819
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002820 /* Allow override tuner type by a module parameter */
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002821 if (tuner >= 0)
2822 dev->tuner_type = tuner;
2823
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002824 /* request some modules */
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002825 if (dev->board.has_msp34xx)
Hans Verkuil53dacb12009-08-10 02:49:08 -03002826 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002827 "msp3400", 0, msp3400_addrs);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002828
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03002829 if (dev->board.decoder == EM28XX_SAA711X)
Hans Verkuil53dacb12009-08-10 02:49:08 -03002830 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002831 "saa7115_auto", 0, saa711x_addrs);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002832
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002833 if (dev->board.decoder == EM28XX_TVP5150)
Hans Verkuil53dacb12009-08-10 02:49:08 -03002834 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002835 "tvp5150", 0, tvp5150_addrs);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002836
Mauro Carvalho Chehabd36bb4e2009-07-14 03:18:39 -03002837 if (dev->em28xx_sensor == EM28XX_MT9V011) {
Hans Verkuil3c7c9372011-01-08 07:08:02 -03002838 struct mt9v011_platform_data pdata;
2839 struct i2c_board_info mt9v011_info = {
2840 .type = "mt9v011",
2841 .addr = 0xba >> 1,
2842 .platform_data = &pdata,
2843 };
Mauro Carvalho Chehabd36bb4e2009-07-14 03:18:39 -03002844
Hans Verkuil3c7c9372011-01-08 07:08:02 -03002845 pdata.xtal = dev->sensor_xtal;
Mauro Carvalho Chehab00d2e7a2011-06-17 20:28:51 -03002846 v4l2_i2c_new_subdev_board(&dev->v4l2_dev, &dev->i2c_adap,
Hans Verkuil3c7c9372011-01-08 07:08:02 -03002847 &mt9v011_info, NULL);
Mauro Carvalho Chehabd36bb4e2009-07-14 03:18:39 -03002848 }
Mauro Carvalho Chehab02e78042009-06-29 11:35:05 -03002849
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -03002850
Mauro Carvalho Chehabdf7fa092009-02-25 09:06:13 -03002851 if (dev->board.adecoder == EM28XX_TVAUDIO)
Hans Verkuile6574f22009-04-01 03:57:53 -03002852 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002853 "tvaudio", dev->board.tvaudio_addr, NULL);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002854
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002855 if (dev->board.tuner_type != TUNER_ABSENT) {
2856 int has_demod = (dev->tda9887_conf & TDA9887_PRESENT);
Mauro Carvalho Chehaba924a492008-11-12 08:41:29 -03002857
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002858 if (dev->board.radio.type)
Hans Verkuile6574f22009-04-01 03:57:53 -03002859 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002860 "tuner", dev->board.radio_addr, NULL);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002861
2862 if (has_demod)
Hans Verkuil53dacb12009-08-10 02:49:08 -03002863 v4l2_i2c_new_subdev(&dev->v4l2_dev,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002864 &dev->i2c_adap, "tuner",
Hans Verkuil53dacb12009-08-10 02:49:08 -03002865 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002866 if (dev->tuner_addr == 0) {
2867 enum v4l2_i2c_tuner_type type =
2868 has_demod ? ADDRS_TV_WITH_DEMOD : ADDRS_TV;
2869 struct v4l2_subdev *sd;
2870
Hans Verkuil53dacb12009-08-10 02:49:08 -03002871 sd = v4l2_i2c_new_subdev(&dev->v4l2_dev,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002872 &dev->i2c_adap, "tuner",
Hans Verkuil53dacb12009-08-10 02:49:08 -03002873 0, v4l2_i2c_tuner_addrs(type));
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002874
2875 if (sd)
2876 dev->tuner_addr = v4l2_i2c_subdev_addr(sd);
2877 } else {
Hans Verkuile6574f22009-04-01 03:57:53 -03002878 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002879 "tuner", dev->tuner_addr, NULL);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002880 }
2881 }
2882
2883 em28xx_tuner_setup(dev);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002884}
Mauro Carvalho Chehabc8644052008-11-25 13:10:14 -03002885
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002886
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002887static void request_module_async(struct work_struct *work)
2888{
2889 struct em28xx *dev = container_of(work,
2890 struct em28xx, request_module_wk);
2891
Mauro Carvalho Chehab6ae5e062012-10-02 15:35:27 -03002892 /*
2893 * The em28xx extensions can be modules or builtin. If the
2894 * modules are already loaded or are built in, those extensions
2895 * can be initialised right now. Otherwise, the module init
2896 * code will do it.
2897 */
2898 em28xx_init_extension(dev);
2899
2900#if defined(CONFIG_MODULES) && defined(MODULE)
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002901 if (dev->has_audio_class)
2902 request_module("snd-usb-audio");
2903 else if (dev->has_alsa_audio)
2904 request_module("em28xx-alsa");
2905
2906 if (dev->board.has_dvb)
2907 request_module("em28xx-dvb");
Mauro Carvalho Chehab4dab0e52012-07-05 22:52:34 -03002908 if (dev->board.ir_codes && !disable_ir)
Ezequiel Garcíaf4d4e762012-03-26 09:13:35 -03002909 request_module("em28xx-rc");
Mauro Carvalho Chehab6ae5e062012-10-02 15:35:27 -03002910#endif /* CONFIG_MODULES */
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002911}
2912
2913static void request_modules(struct em28xx *dev)
2914{
2915 INIT_WORK(&dev->request_module_wk, request_module_async);
2916 schedule_work(&dev->request_module_wk);
2917}
Tejun Heo707bcf32010-12-24 16:14:20 +01002918
2919static void flush_request_modules(struct em28xx *dev)
2920{
Linus Torvalds0b8e74c2012-10-07 17:49:05 +09002921 flush_work(&dev->request_module_wk);
Tejun Heo707bcf32010-12-24 16:14:20 +01002922}
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002923
2924/*
Chris Rankind7222e72011-09-24 11:02:32 -03002925 * em28xx_release_resources()
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002926 * unregisters the v4l2,i2c and usb devices
Chris Rankind7222e72011-09-24 11:02:32 -03002927 * called when the device gets disconnected or at module unload
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002928*/
2929void em28xx_release_resources(struct em28xx *dev)
2930{
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002931 /*FIXME: I2C IR should be disconnected */
2932
2933 em28xx_release_analog_resources(dev);
2934
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002935 em28xx_i2c_unregister(dev);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002936
2937 v4l2_device_unregister(&dev->v4l2_dev);
2938
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002939 usb_put_dev(dev->udev);
2940
2941 /* Mark device as unused */
Chris Rankin38b61eb2011-08-20 08:21:03 -03002942 clear_bit(dev->devno, &em28xx_devused);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002943};
2944
2945/*
2946 * em28xx_init_dev()
2947 * allocates and inits the device structs, registers i2c bus and v4l device
2948 */
Thomas Petazzoni622c2fc2012-01-07 10:18:45 -03002949static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,
Mauro Carvalho Chehab36fa6742009-04-05 08:02:15 -03002950 struct usb_interface *interface,
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002951 int minor)
2952{
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002953 int retval;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002954
2955 dev->udev = udev;
2956 mutex_init(&dev->ctrl_urb_lock);
2957 spin_lock_init(&dev->slock);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002958
2959 dev->em28xx_write_regs = em28xx_write_regs;
2960 dev->em28xx_read_reg = em28xx_read_reg;
2961 dev->em28xx_read_reg_req_len = em28xx_read_reg_req_len;
2962 dev->em28xx_write_regs_req = em28xx_write_regs_req;
2963 dev->em28xx_read_reg_req = em28xx_read_reg_req;
2964 dev->board.is_em2800 = em28xx_boards[dev->model].is_em2800;
2965
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002966 em28xx_set_model(dev);
2967
2968 /* Set the default GPO/GPIO for legacy devices */
2969 dev->reg_gpo_num = EM2880_R04_GPO;
2970 dev->reg_gpio_num = EM28XX_R08_GPIO;
2971
2972 dev->wait_after_write = 5;
2973
2974 /* Based on the Chip ID, set the device configuration */
2975 retval = em28xx_read_reg(dev, EM28XX_R0A_CHIPID);
2976 if (retval > 0) {
2977 dev->chip_id = retval;
2978
2979 switch (dev->chip_id) {
Mauro Carvalho Chehabf57b17c32009-11-12 11:21:05 -03002980 case CHIP_ID_EM2800:
2981 em28xx_info("chip ID is em2800\n");
2982 break;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002983 case CHIP_ID_EM2710:
2984 em28xx_info("chip ID is em2710\n");
2985 break;
2986 case CHIP_ID_EM2750:
2987 em28xx_info("chip ID is em2750\n");
2988 break;
2989 case CHIP_ID_EM2820:
2990 em28xx_info("chip ID is em2820 (or em2710)\n");
2991 break;
2992 case CHIP_ID_EM2840:
2993 em28xx_info("chip ID is em2840\n");
2994 break;
2995 case CHIP_ID_EM2860:
2996 em28xx_info("chip ID is em2860\n");
2997 break;
2998 case CHIP_ID_EM2870:
2999 em28xx_info("chip ID is em2870\n");
3000 dev->wait_after_write = 0;
3001 break;
3002 case CHIP_ID_EM2874:
3003 em28xx_info("chip ID is em2874\n");
3004 dev->reg_gpio_num = EM2874_R80_GPIO;
3005 dev->wait_after_write = 0;
3006 break;
Antti Palosaaribc022692011-04-07 16:04:48 -03003007 case CHIP_ID_EM28174:
3008 em28xx_info("chip ID is em28174\n");
3009 dev->reg_gpio_num = EM2874_R80_GPIO;
3010 dev->wait_after_write = 0;
3011 break;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003012 case CHIP_ID_EM2883:
3013 em28xx_info("chip ID is em2882/em2883\n");
3014 dev->wait_after_write = 0;
3015 break;
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -03003016 case CHIP_ID_EM2884:
3017 em28xx_info("chip ID is em2884\n");
3018 dev->reg_gpio_num = EM2874_R80_GPIO;
3019 dev->wait_after_write = 0;
3020 break;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003021 default:
3022 em28xx_info("em28xx chip ID = %d\n", dev->chip_id);
3023 }
3024 }
3025
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003026 if (dev->is_audio_only) {
Chris Rankin6c03e382011-08-20 08:28:17 -03003027 retval = em28xx_audio_setup(dev);
3028 if (retval)
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003029 return -ENODEV;
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003030 em28xx_init_extension(dev);
3031
3032 return 0;
3033 }
3034
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003035 /* Prepopulate cached GPO register content */
3036 retval = em28xx_read_reg(dev, dev->reg_gpo_num);
3037 if (retval >= 0)
3038 dev->reg_gpo = retval;
3039
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003040 em28xx_pre_card_setup(dev);
3041
3042 if (!dev->board.is_em2800) {
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03003043 /* Resets I2C speed */
Sascha Sommer0903bb52012-01-08 16:19:30 -03003044 retval = em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003045 if (retval < 0) {
Chris Rankin6c03e382011-08-20 08:28:17 -03003046 em28xx_errdev("%s: em28xx_write_reg failed!"
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003047 " retval [%d]\n",
3048 __func__, retval);
3049 return retval;
3050 }
3051 }
3052
Mauro Carvalho Chehab36fa6742009-04-05 08:02:15 -03003053 retval = v4l2_device_register(&interface->dev, &dev->v4l2_dev);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003054 if (retval < 0) {
3055 em28xx_errdev("Call to v4l2_device_register() failed!\n");
3056 return retval;
3057 }
3058
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003059 /* register i2c bus */
Chris Rankin6c03e382011-08-20 08:28:17 -03003060 retval = em28xx_i2c_register(dev);
3061 if (retval < 0) {
3062 em28xx_errdev("%s: em28xx_i2c_register - error [%d]!\n",
3063 __func__, retval);
3064 goto unregister_dev;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003065 }
3066
Mauro Carvalho Chehabb04fb662009-07-13 01:28:21 -03003067 /*
Mauro Carvalho Chehab579d3152009-07-14 12:33:25 -03003068 * Default format, used for tvp5150 or saa711x output formats
3069 */
3070 dev->vinmode = 0x10;
Devin Heitmueller206313d2009-08-31 23:23:03 -03003071 dev->vinctl = EM28XX_VINCTRL_INTERLACED |
3072 EM28XX_VINCTRL_CCIR656_ENABLE;
Mauro Carvalho Chehab579d3152009-07-14 12:33:25 -03003073
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003074 /* Do board specific init and eeprom reading */
3075 em28xx_card_setup(dev);
3076
3077 /* Configure audio */
Chris Rankin6c03e382011-08-20 08:28:17 -03003078 retval = em28xx_audio_setup(dev);
3079 if (retval < 0) {
3080 em28xx_errdev("%s: Error while setting audio - error [%d]!\n",
3081 __func__, retval);
3082 goto fail;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003083 }
3084
3085 /* wake i2c devices */
3086 em28xx_wake_i2c(dev);
3087
3088 /* init video dma queues */
3089 INIT_LIST_HEAD(&dev->vidq.active);
Devin Heitmueller28abf0832009-09-01 01:54:54 -03003090 INIT_LIST_HEAD(&dev->vbiq.active);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003091
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003092 if (dev->board.has_msp34xx) {
3093 /* Send a reset to other chips via gpio */
Chris Rankin6c03e382011-08-20 08:28:17 -03003094 retval = em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf7);
3095 if (retval < 0) {
3096 em28xx_errdev("%s: em28xx_write_reg - "
3097 "msp34xx(1) failed! error [%d]\n",
3098 __func__, retval);
3099 goto fail;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003100 }
3101 msleep(3);
3102
Chris Rankin6c03e382011-08-20 08:28:17 -03003103 retval = em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff);
3104 if (retval < 0) {
3105 em28xx_errdev("%s: em28xx_write_reg - "
3106 "msp34xx(2) failed! error [%d]\n",
3107 __func__, retval);
3108 goto fail;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003109 }
3110 msleep(3);
3111 }
3112
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003113 retval = em28xx_register_analog_devices(dev);
3114 if (retval < 0) {
Chris Rankin6c03e382011-08-20 08:28:17 -03003115 goto fail;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003116 }
3117
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003118 /* Save some power by putting tuner to sleep */
Laurent Pinchart622b8282009-10-05 10:48:17 -03003119 v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_power, 0);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003120
3121 return 0;
3122
Chris Rankin6c03e382011-08-20 08:28:17 -03003123fail:
3124 em28xx_i2c_unregister(dev);
3125
3126unregister_dev:
3127 v4l2_device_unregister(&dev->v4l2_dev);
3128
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003129 return retval;
3130}
3131
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003132/* high bandwidth multiplier, as encoded in highspeed endpoint descriptors */
3133#define hb_mult(wMaxPacketSize) (1 + (((wMaxPacketSize) >> 11) & 0x03))
3134
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003135/*
3136 * em28xx_usb_probe()
3137 * checks for supported devices
3138 */
3139static int em28xx_usb_probe(struct usb_interface *interface,
3140 const struct usb_device_id *id)
3141{
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003142 struct usb_device *udev;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003143 struct em28xx *dev = NULL;
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003144 int retval;
Holger Nelson8ab33622011-12-28 18:55:41 -03003145 bool has_audio = false, has_video = false, has_dvb = false;
3146 int i, nr;
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003147 const int ifnum = interface->altsetting[0].desc.bInterfaceNumber;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003148 char *speed;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003149
3150 udev = usb_get_dev(interface_to_usbdev(interface));
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003151
3152 /* Check to see next free device and mark as used */
Chris Rankin38b61eb2011-08-20 08:21:03 -03003153 do {
3154 nr = find_first_zero_bit(&em28xx_devused, EM28XX_MAXBOARDS);
3155 if (nr >= EM28XX_MAXBOARDS) {
3156 /* No free device slots */
3157 printk(DRIVER_NAME ": Supports only %i em28xx boards.\n",
3158 EM28XX_MAXBOARDS);
3159 retval = -ENOMEM;
3160 goto err_no_slot;
3161 }
3162 } while (test_and_set_bit(nr, &em28xx_devused));
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003163
3164 /* Don't register audio interfaces */
3165 if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
3166 em28xx_err(DRIVER_NAME " audio device (%04x:%04x): "
3167 "interface %i, class %i\n",
3168 le16_to_cpu(udev->descriptor.idVendor),
3169 le16_to_cpu(udev->descriptor.idProduct),
3170 ifnum,
3171 interface->altsetting[0].desc.bInterfaceClass);
3172
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003173 retval = -ENODEV;
3174 goto err;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003175 }
3176
Holger Nelson8ab33622011-12-28 18:55:41 -03003177 /* allocate memory for our device state and initialize it */
3178 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
3179 if (dev == NULL) {
3180 em28xx_err(DRIVER_NAME ": out of memory!\n");
3181 retval = -ENOMEM;
3182 goto err;
3183 }
3184
3185 /* compute alternate max packet sizes */
Frank Schaefer0cf544a2012-11-08 14:11:49 -03003186 dev->alt_max_pkt_size_isoc =
3187 kmalloc(sizeof(dev->alt_max_pkt_size_isoc[0]) *
Holger Nelson8ab33622011-12-28 18:55:41 -03003188 interface->num_altsetting, GFP_KERNEL);
Frank Schaefer0cf544a2012-11-08 14:11:49 -03003189 if (dev->alt_max_pkt_size_isoc == NULL) {
Holger Nelson8ab33622011-12-28 18:55:41 -03003190 em28xx_errdev("out of memory!\n");
3191 kfree(dev);
3192 retval = -ENOMEM;
3193 goto err;
3194 }
3195
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003196 /* Get endpoints */
3197 for (i = 0; i < interface->num_altsetting; i++) {
3198 int ep;
3199
3200 for (ep = 0; ep < interface->altsetting[i].desc.bNumEndpoints; ep++) {
Holger Nelson8ab33622011-12-28 18:55:41 -03003201 const struct usb_endpoint_descriptor *e;
3202 int sizedescr, size;
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003203
Holger Nelson8ab33622011-12-28 18:55:41 -03003204 e = &interface->altsetting[i].endpoint[ep].desc;
3205
3206 sizedescr = le16_to_cpu(e->wMaxPacketSize);
3207 size = sizedescr & 0x7ff;
3208
3209 if (udev->speed == USB_SPEED_HIGH)
3210 size = size * hb_mult(sizedescr);
3211
3212 if (usb_endpoint_xfer_isoc(e) &&
3213 usb_endpoint_dir_in(e)) {
3214 switch (e->bEndpointAddress) {
3215 case EM28XX_EP_AUDIO:
3216 has_audio = true;
3217 break;
3218 case EM28XX_EP_ANALOG:
3219 has_video = true;
Frank Schaefer0cf544a2012-11-08 14:11:49 -03003220 dev->alt_max_pkt_size_isoc[i] = size;
Holger Nelson8ab33622011-12-28 18:55:41 -03003221 break;
3222 case EM28XX_EP_DIGITAL:
3223 has_dvb = true;
Frank Schaefer0cf544a2012-11-08 14:11:49 -03003224 if (size > dev->dvb_max_pkt_size_isoc) {
3225 dev->dvb_max_pkt_size_isoc =
3226 size;
3227 dev->dvb_alt_isoc = i;
Holger Nelson8ab33622011-12-28 18:55:41 -03003228 }
3229 break;
3230 }
3231 }
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003232 }
3233 }
3234
Holger Nelson8ab33622011-12-28 18:55:41 -03003235 if (!(has_audio || has_video || has_dvb)) {
3236 retval = -ENODEV;
3237 goto err_free;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003238 }
3239
3240 switch (udev->speed) {
3241 case USB_SPEED_LOW:
3242 speed = "1.5";
3243 break;
3244 case USB_SPEED_UNKNOWN:
3245 case USB_SPEED_FULL:
3246 speed = "12";
3247 break;
3248 case USB_SPEED_HIGH:
3249 speed = "480";
3250 break;
3251 default:
3252 speed = "unknown";
3253 }
3254
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003255 printk(KERN_INFO DRIVER_NAME
Ezequiel García401a5822012-03-13 10:27:09 -03003256 ": New device %s %s @ %s Mbps "
3257 "(%04x:%04x, interface %d, class %d)\n",
3258 udev->manufacturer ? udev->manufacturer : "",
3259 udev->product ? udev->product : "",
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003260 speed,
3261 le16_to_cpu(udev->descriptor.idVendor),
3262 le16_to_cpu(udev->descriptor.idProduct),
3263 ifnum,
3264 interface->altsetting->desc.bInterfaceNumber);
3265
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003266 if (has_audio)
3267 printk(KERN_INFO DRIVER_NAME
3268 ": Audio Vendor Class interface %i found\n",
3269 ifnum);
Holger Nelson8ab33622011-12-28 18:55:41 -03003270 if (has_video)
3271 printk(KERN_INFO DRIVER_NAME
3272 ": Video interface %i found\n",
3273 ifnum);
3274 if (has_dvb)
3275 printk(KERN_INFO DRIVER_NAME
3276 ": DVB interface %i found\n",
3277 ifnum);
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003278
Devin Heitmueller64a00b42009-05-27 23:23:37 -03003279 /*
3280 * Make sure we have 480 Mbps of bandwidth, otherwise things like
3281 * video stream wouldn't likely work, since 12 Mbps is generally
3282 * not enough even for most Digital TV streams.
3283 */
Devin Heitmuellere2a1b792009-05-27 23:44:10 -03003284 if (udev->speed != USB_SPEED_HIGH && disable_usb_speed_check == 0) {
Devin Heitmueller64a00b42009-05-27 23:23:37 -03003285 printk(DRIVER_NAME ": Device initialization failed.\n");
3286 printk(DRIVER_NAME ": Device must be connected to a high-speed"
3287 " USB 2.0 port.\n");
Devin Heitmueller64a00b42009-05-27 23:23:37 -03003288 retval = -ENODEV;
Holger Nelson8ab33622011-12-28 18:55:41 -03003289 goto err_free;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003290 }
3291
Chris Rankinf38f3332011-08-20 08:08:34 -03003292 snprintf(dev->name, sizeof(dev->name), "em28xx #%d", nr);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003293 dev->devno = nr;
3294 dev->model = id->driver_info;
3295 dev->alt = -1;
Holger Nelson8ab33622011-12-28 18:55:41 -03003296 dev->is_audio_only = has_audio && !(has_video || has_dvb);
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003297 dev->has_alsa_audio = has_audio;
3298 dev->audio_ifnum = ifnum;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003299
3300 /* Checks if audio is provided by some interface */
3301 for (i = 0; i < udev->config->desc.bNumInterfaces; i++) {
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003302 struct usb_interface *uif = udev->config->interface[i];
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003303 if (uif->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
3304 dev->has_audio_class = 1;
3305 break;
3306 }
3307 }
3308
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003309 dev->num_alt = interface->num_altsetting;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003310
Mauro Carvalho Chehabd3e4ea02012-10-27 16:29:20 -03003311 if ((unsigned)card[nr] < em28xx_bcount)
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003312 dev->model = card[nr];
3313
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003314 /* save our data pointer in this interface device */
3315 usb_set_intfdata(interface, dev);
3316
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003317 /* allocate device struct */
3318 mutex_init(&dev->lock);
3319 mutex_lock(&dev->lock);
Thomas Petazzoni622c2fc2012-01-07 10:18:45 -03003320 retval = em28xx_init_dev(dev, udev, interface, nr);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003321 if (retval) {
Holger Nelson8ab33622011-12-28 18:55:41 -03003322 goto unlock_and_free;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003323 }
3324
Gianluca Gennari86d38d12012-02-13 13:59:22 -03003325 if (has_dvb) {
3326 /* pre-allocate DVB isoc transfer buffers */
Frank Schaefer6ddd89d2012-11-08 14:11:41 -03003327 retval = em28xx_alloc_urbs(dev, EM28XX_DIGITAL_MODE, 0,
Gianluca Gennari86d38d12012-02-13 13:59:22 -03003328 EM28XX_DVB_NUM_BUFS,
Frank Schaefer0cf544a2012-11-08 14:11:49 -03003329 dev->dvb_max_pkt_size_isoc,
Frank Schaefer6ddd89d2012-11-08 14:11:41 -03003330 EM28XX_DVB_NUM_ISOC_PACKETS);
Gianluca Gennari86d38d12012-02-13 13:59:22 -03003331 if (retval) {
3332 goto unlock_and_free;
3333 }
3334 }
3335
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003336 request_modules(dev);
3337
3338 /* Should be the last thing to do, to avoid newer udev's to
3339 open the device before fully initializing it
3340 */
3341 mutex_unlock(&dev->lock);
3342
3343 return 0;
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003344
Holger Nelson8ab33622011-12-28 18:55:41 -03003345unlock_and_free:
3346 mutex_unlock(&dev->lock);
3347
3348err_free:
Frank Schaefer0cf544a2012-11-08 14:11:49 -03003349 kfree(dev->alt_max_pkt_size_isoc);
Holger Nelson8ab33622011-12-28 18:55:41 -03003350 kfree(dev);
3351
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003352err:
Chris Rankin38b61eb2011-08-20 08:21:03 -03003353 clear_bit(nr, &em28xx_devused);
3354
3355err_no_slot:
3356 usb_put_dev(udev);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003357 return retval;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003358}
3359
3360/*
3361 * em28xx_usb_disconnect()
Chris Rankind7222e72011-09-24 11:02:32 -03003362 * called when the device gets disconnected
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003363 * video device will be unregistered on v4l2_close in case it is still open
3364 */
3365static void em28xx_usb_disconnect(struct usb_interface *interface)
3366{
3367 struct em28xx *dev;
3368
3369 dev = usb_get_intfdata(interface);
3370 usb_set_intfdata(interface, NULL);
3371
3372 if (!dev)
3373 return;
3374
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003375 if (dev->is_audio_only) {
3376 mutex_lock(&dev->lock);
3377 em28xx_close_extension(dev);
3378 mutex_unlock(&dev->lock);
3379 return;
3380 }
3381
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003382 em28xx_info("disconnecting %s\n", dev->vdev->name);
3383
Tejun Heo707bcf32010-12-24 16:14:20 +01003384 flush_request_modules(dev);
3385
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003386 /* wait until all current v4l2 io is finished then deallocate
3387 resources */
3388 mutex_lock(&dev->lock);
3389
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003390 v4l2_device_disconnect(&dev->v4l2_dev);
3391
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003392 if (dev->users) {
3393 em28xx_warn
Laurent Pinchart38c7c032009-11-27 13:57:15 -03003394 ("device %s is open! Deregistration and memory "
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003395 "deallocation are deferred on close.\n",
Laurent Pinchart38c7c032009-11-27 13:57:15 -03003396 video_device_node_name(dev->vdev));
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003397
3398 dev->state |= DEV_MISCONFIGURED;
Frank Schaeferafb177e2012-11-08 14:11:40 -03003399 em28xx_uninit_usb_xfer(dev, dev->mode);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003400 dev->state |= DEV_DISCONNECTED;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003401 } else {
3402 dev->state |= DEV_DISCONNECTED;
3403 em28xx_release_resources(dev);
3404 }
3405
Gianluca Gennari86d38d12012-02-13 13:59:22 -03003406 /* free DVB isoc buffers */
Frank Schaeferafb177e2012-11-08 14:11:40 -03003407 em28xx_uninit_usb_xfer(dev, EM28XX_DIGITAL_MODE);
Gianluca Gennari86d38d12012-02-13 13:59:22 -03003408
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003409 mutex_unlock(&dev->lock);
3410
Chris Rankinb868a532011-09-24 16:54:58 -03003411 em28xx_close_extension(dev);
3412
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003413 if (!dev->users) {
Frank Schaefer0cf544a2012-11-08 14:11:49 -03003414 kfree(dev->alt_max_pkt_size_isoc);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003415 kfree(dev);
3416 }
3417}
3418
3419static struct usb_driver em28xx_usb_driver = {
3420 .name = "em28xx",
3421 .probe = em28xx_usb_probe,
3422 .disconnect = em28xx_usb_disconnect,
3423 .id_table = em28xx_id_table,
3424};
3425
Greg Kroah-Hartmanecb3b2b2011-11-18 09:46:12 -08003426module_usb_driver(em28xx_usb_driver);