blob: f7297ae76b4888f8a8aafc3b52e09f4b0066fd3d [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 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001982};
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001983const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001984
1985/* table of devices that work with this driver */
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03001986struct usb_device_id em28xx_id_table[] = {
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001987 { USB_DEVICE(0xeb1a, 0x2750),
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001988 .driver_info = EM2750_BOARD_UNKNOWN },
1989 { USB_DEVICE(0xeb1a, 0x2751),
1990 .driver_info = EM2750_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001991 { USB_DEVICE(0xeb1a, 0x2800),
1992 .driver_info = EM2800_BOARD_UNKNOWN },
Mauro Carvalho Chehab9b4e8452009-08-07 12:08:02 -03001993 { USB_DEVICE(0xeb1a, 0x2710),
1994 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001995 { USB_DEVICE(0xeb1a, 0x2820),
1996 .driver_info = EM2820_BOARD_UNKNOWN },
1997 { USB_DEVICE(0xeb1a, 0x2821),
Devin Heitmuellerc665f4d2008-12-16 23:35:23 -03001998 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001999 { USB_DEVICE(0xeb1a, 0x2860),
2000 .driver_info = EM2820_BOARD_UNKNOWN },
2001 { USB_DEVICE(0xeb1a, 0x2861),
2002 .driver_info = EM2820_BOARD_UNKNOWN },
Devin Heitmuellerf91cb652009-09-30 22:44:19 -03002003 { USB_DEVICE(0xeb1a, 0x2862),
2004 .driver_info = EM2820_BOARD_UNKNOWN },
Devin Heitmueller443fed92010-03-19 23:53:12 -03002005 { USB_DEVICE(0xeb1a, 0x2863),
2006 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002007 { USB_DEVICE(0xeb1a, 0x2870),
2008 .driver_info = EM2820_BOARD_UNKNOWN },
2009 { USB_DEVICE(0xeb1a, 0x2881),
2010 .driver_info = EM2820_BOARD_UNKNOWN },
2011 { USB_DEVICE(0xeb1a, 0x2883),
2012 .driver_info = EM2820_BOARD_UNKNOWN },
Antti Palosaari285eb1a2009-09-15 14:42:13 -03002013 { USB_DEVICE(0xeb1a, 0x2868),
2014 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03002015 { USB_DEVICE(0xeb1a, 0x2875),
2016 .driver_info = EM2820_BOARD_UNKNOWN },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002017 { USB_DEVICE(0xeb1a, 0xe300),
2018 .driver_info = EM2861_BOARD_KWORLD_PVRTV_300U },
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03002019 { USB_DEVICE(0xeb1a, 0xe303),
2020 .driver_info = EM2860_BOARD_KAIOMY_TVNPC_U2 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002021 { USB_DEVICE(0xeb1a, 0xe305),
2022 .driver_info = EM2880_BOARD_KWORLD_DVB_305U },
2023 { USB_DEVICE(0xeb1a, 0xe310),
2024 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD },
Franklin Mengd7de5d82009-06-06 17:05:02 -03002025 { USB_DEVICE(0xeb1a, 0xa313),
2026 .driver_info = EM2882_BOARD_KWORLD_ATSC_315U },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002027 { USB_DEVICE(0xeb1a, 0xa316),
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03002028 .driver_info = EM2883_BOARD_KWORLD_HYBRID_330U },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002029 { USB_DEVICE(0xeb1a, 0xe320),
2030 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD_II },
2031 { USB_DEVICE(0xeb1a, 0xe323),
2032 .driver_info = EM2882_BOARD_KWORLD_VS_DVBT },
2033 { USB_DEVICE(0xeb1a, 0xe350),
2034 .driver_info = EM2870_BOARD_KWORLD_350U },
2035 { USB_DEVICE(0xeb1a, 0xe355),
2036 .driver_info = EM2870_BOARD_KWORLD_355U },
2037 { USB_DEVICE(0xeb1a, 0x2801),
2038 .driver_info = EM2800_BOARD_GRABBEEX_USB2800 },
2039 { USB_DEVICE(0xeb1a, 0xe357),
2040 .driver_info = EM2870_BOARD_KWORLD_355U },
Aivar Päkk1985f6f2011-12-11 18:15:00 -03002041 { USB_DEVICE(0xeb1a, 0xe359),
2042 .driver_info = EM2870_BOARD_KWORLD_355U },
Douglas Schilling Landgrafac40d9e2009-02-25 16:55:48 -03002043 { USB_DEVICE(0x1b80, 0xe302),
2044 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, /* Kaiser Baas Video to DVD maker */
Douglas Schilling Landgrafea476892009-09-06 18:41:59 -03002045 { USB_DEVICE(0x1b80, 0xe304),
2046 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, /* Kworld DVD Maker 2 */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002047 { USB_DEVICE(0x0ccd, 0x0036),
2048 .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002049 { USB_DEVICE(0x0ccd, 0x004c),
2050 .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS_FR },
2051 { USB_DEVICE(0x0ccd, 0x004f),
2052 .driver_info = EM2860_BOARD_TERRATEC_HYBRID_XS },
2053 { USB_DEVICE(0x0ccd, 0x005e),
2054 .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS },
2055 { USB_DEVICE(0x0ccd, 0x0042),
Philippe Bourdin91245442010-10-31 09:57:58 -03002056 .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002057 { USB_DEVICE(0x0ccd, 0x0043),
Mauro Carvalho Chehab4e145342011-11-16 14:38:28 -02002058 .driver_info = EM2870_BOARD_TERRATEC_XS },
Holger Nelson6c3b9062011-12-23 23:15:32 -03002059 { USB_DEVICE(0x0ccd, 0x008e), /* Cinergy HTC USB XS Rev. 1 */
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -03002060 .driver_info = EM2884_BOARD_TERRATEC_H5 },
Holger Nelson6c3b9062011-12-23 23:15:32 -03002061 { USB_DEVICE(0x0ccd, 0x00ac), /* Cinergy HTC USB XS Rev. 2 */
Mauro Carvalho Chehab33ba28e2011-07-14 21:48:00 -03002062 .driver_info = EM2884_BOARD_TERRATEC_H5 },
Mauro Carvalho Chehab4e145342011-11-16 14:38:28 -02002063 { USB_DEVICE(0x0ccd, 0x10a2), /* H5 Rev. 1 */
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002064 .driver_info = EM2884_BOARD_TERRATEC_H5 },
Mauro Carvalho Chehab4e145342011-11-16 14:38:28 -02002065 { USB_DEVICE(0x0ccd, 0x10ad), /* H5 Rev. 2 */
Mauro Carvalho Chehab33ba28e2011-07-14 21:48:00 -03002066 .driver_info = EM2884_BOARD_TERRATEC_H5 },
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -03002067 { USB_DEVICE(0x0ccd, 0x0084),
2068 .driver_info = EM2860_BOARD_TERRATEC_AV350 },
Mauro Carvalho Chehab4557af92009-05-23 09:58:52 -03002069 { USB_DEVICE(0x0ccd, 0x0096),
2070 .driver_info = EM2860_BOARD_TERRATEC_GRABBY },
Tekaefabaaf2011-10-14 05:40:29 -03002071 { USB_DEVICE(0x0ccd, 0x10AF),
2072 .driver_info = EM2860_BOARD_TERRATEC_GRABBY },
Andreas Oberrittera1ed02e2011-11-16 11:06:50 -03002073 { USB_DEVICE(0x0ccd, 0x00b2),
2074 .driver_info = EM2884_BOARD_CINERGY_HTC_STICK },
Adrian Taylor8298f2f2010-10-20 07:55:33 -03002075 { USB_DEVICE(0x0fd9, 0x0033),
2076 .driver_info = EM2860_BOARD_ELGATO_VIDEO_CAPTURE},
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002077 { USB_DEVICE(0x185b, 0x2870),
2078 .driver_info = EM2870_BOARD_COMPRO_VIDEOMATE },
Vitaly Woold3603342008-07-27 14:10:11 -03002079 { USB_DEVICE(0x185b, 0x2041),
Mauro Carvalho Chehabee281b82008-07-27 16:58:04 -03002080 .driver_info = EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002081 { USB_DEVICE(0x2040, 0x4200),
2082 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
Mauro Carvalho Chehab15b9bec2008-01-13 12:02:20 -03002083 { USB_DEVICE(0x2040, 0x4201),
2084 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002085 { USB_DEVICE(0x2040, 0x6500),
2086 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 },
Luc Saillard427d20c2008-01-30 17:23:00 -03002087 { USB_DEVICE(0x2040, 0x6502),
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002088 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2 },
Michael Krufky74ee0512008-05-01 18:02:30 -03002089 { USB_DEVICE(0x2040, 0x6513), /* HCW HVR-980 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002090 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Michael Krufky74ee0512008-05-01 18:02:30 -03002091 { USB_DEVICE(0x2040, 0x6517), /* HP HVR-950 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002092 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Michael Krufky74ee0512008-05-01 18:02:30 -03002093 { USB_DEVICE(0x2040, 0x651b), /* RP HVR-950 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002094 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03002095 { USB_DEVICE(0x2040, 0x651f),
2096 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850 },
Devin Heitmuellere14b3652008-07-26 11:04:33 -03002097 { USB_DEVICE(0x0438, 0xb002),
2098 .driver_info = EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002099 { USB_DEVICE(0x2001, 0xf112),
2100 .driver_info = EM2820_BOARD_DLINK_USB_TV },
2101 { USB_DEVICE(0x2304, 0x0207),
2102 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
2103 { USB_DEVICE(0x2304, 0x0208),
2104 .driver_info = EM2820_BOARD_PINNACLE_USB_2 },
2105 { USB_DEVICE(0x2304, 0x021a),
2106 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
2107 { USB_DEVICE(0x2304, 0x0226),
Devin Heitmueller09bc1942011-03-13 02:07:54 -03002108 .driver_info = EM2882_BOARD_PINNACLE_HYBRID_PRO_330E },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002109 { USB_DEVICE(0x2304, 0x0227),
2110 .driver_info = EM2880_BOARD_PINNACLE_PCTV_HD_PRO },
2111 { USB_DEVICE(0x0413, 0x6023),
2112 .driver_info = EM2800_BOARD_LEADTEK_WINFAST_USBII },
Don Kramer74e07f32012-01-02 16:15:44 -03002113 { USB_DEVICE(0x093b, 0xa003),
2114 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002115 { USB_DEVICE(0x093b, 0xa005),
2116 .driver_info = EM2861_BOARD_PLEXTOR_PX_TV100U },
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03002117 { USB_DEVICE(0x04bb, 0x0515),
2118 .driver_info = EM2820_BOARD_IODATA_GVMVP_SZ },
Zhenyu Wang7c8b5672009-07-05 10:51:21 -03002119 { USB_DEVICE(0xeb1a, 0x50a6),
2120 .driver_info = EM2860_BOARD_GADMEI_UTV330 },
Jarod Wilson7e48b302010-03-07 17:55:43 -03002121 { USB_DEVICE(0x1b80, 0xa340),
2122 .driver_info = EM2870_BOARD_KWORLD_A340 },
Antti Palosaarid6a5f922011-04-07 16:34:44 -03002123 { USB_DEVICE(0x2013, 0x024f),
2124 .driver_info = EM28174_BOARD_PCTV_290E },
Antti Palosaari36588712011-08-01 01:15:30 -03002125 { USB_DEVICE(0x2013, 0x024c),
2126 .driver_info = EM28174_BOARD_PCTV_460E },
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -03002127 { USB_DEVICE(0x2040, 0x1605),
2128 .driver_info = EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C },
Gareth Williams4d28d3d2011-12-24 05:47:29 -03002129 { USB_DEVICE(0xeb1a, 0x5006),
2130 .driver_info = EM2860_BOARD_HT_VIDBOX_NW03 },
Mario Ceresa2f786042012-01-06 16:00:12 -03002131 { USB_DEVICE(0x1b80, 0xe309), /* Sveon STV40 */
2132 .driver_info = EM2860_BOARD_EASYCAP },
Antti Palosaari35530852012-03-18 18:09:01 -03002133 { USB_DEVICE(0x1b80, 0xe425),
2134 .driver_info = EM2874_BOARD_MAXMEDIA_UB425_TC },
Ivan Kalvachevfa5527c2012-03-19 20:09:55 -03002135 { USB_DEVICE(0x2304, 0x0242),
2136 .driver_info = EM2884_BOARD_PCTV_510E },
Antti Palosaaric247d7b2012-03-19 11:48:19 -03002137 { USB_DEVICE(0x2013, 0x0251),
2138 .driver_info = EM2884_BOARD_PCTV_520E },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002139 { },
2140};
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002141MODULE_DEVICE_TABLE(usb, em28xx_id_table);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002142
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002143/*
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002144 * EEPROM hash table for devices with generic USB IDs
2145 */
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03002146static struct em28xx_hash_table em28xx_eeprom_hash[] = {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03002147 /* P/N: SA 60002070465 Tuner: TVF7533-MF */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002148 {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF},
Douglas Schilling Landgraf1e1addd2008-12-27 21:38:14 -03002149 {0x72cc5a8b, EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2, TUNER_YMEC_TVF_5533MF},
Darron Broadda3808e2008-09-30 02:46:41 -03002150 {0x966a0441, EM2880_BOARD_KWORLD_DVB_310U, TUNER_XC2028},
Douglas Schilling Landgrafa35c87c2009-08-06 12:52:11 -03002151 {0x166a0441, EM2880_BOARD_EMPIRE_DUAL_TV, TUNER_XC2028},
Devin Heitmueller19859222009-06-19 00:33:54 -03002152 {0xcee44a99, EM2882_BOARD_EVGA_INDTUBE, TUNER_XC2028},
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03002153 {0xb8846b20, EM2881_BOARD_PINNACLE_HYBRID_PRO, TUNER_XC2028},
Antti Palosaari285eb1a2009-09-15 14:42:13 -03002154 {0x63f653bd, EM2870_BOARD_REDDO_DVB_C_USB_BOX, TUNER_ABSENT},
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03002155 {0x4e913442, EM2882_BOARD_DIKOM_DK300, TUNER_XC2028},
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002156};
2157
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03002158/* I2C devicelist hash table for devices with generic USB IDs */
Sascha Sommerfad7b952007-11-04 08:06:48 -03002159static struct em28xx_hash_table em28xx_i2c_hash[] = {
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002160 {0xb06a32c3, EM2800_BOARD_TERRATEC_CINERGY_200, TUNER_LG_PAL_NEW_TAPC},
2161 {0xf51200e3, EM2800_BOARD_VGEAR_POCKETTV, TUNER_LG_PAL_NEW_TAPC},
Devin Heitmueller3ed58ba2009-05-27 23:27:26 -03002162 {0x1ba50080, EM2860_BOARD_SAA711X_REFERENCE_DESIGN, TUNER_ABSENT},
Devin Heitmueller443fed92010-03-19 23:53:12 -03002163 {0x77800080, EM2860_BOARD_TVP5150_REFERENCE_DESIGN, TUNER_ABSENT},
Douglas Schilling Landgraff7fe3e62009-01-19 09:31:55 -03002164 {0xc51200e3, EM2820_BOARD_GADMEI_TVR200, TUNER_LG_PAL_NEW_TAPC},
Mauro Carvalho Chehab6d888a62009-08-30 13:05:56 -03002165 {0x4ba50080, EM2861_BOARD_GADMEI_UTV330PLUS, TUNER_TNF_5335MF},
Mauro Carvalho Chehabebaefdb2011-06-01 10:16:25 -03002166 {0x6b800080, EM2874_BOARD_LEADERSHIP_ISDBT, TUNER_ABSENT},
Sascha Sommerfad7b952007-11-04 08:06:48 -03002167};
2168
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002169/* I2C possible address to saa7115, tvp5150, msp3400, tvaudio */
2170static unsigned short saa711x_addrs[] = {
2171 0x4a >> 1, 0x48 >> 1, /* SAA7111, SAA7111A and SAA7113 */
2172 0x42 >> 1, 0x40 >> 1, /* SAA7114, SAA7115 and SAA7118 */
2173 I2C_CLIENT_END };
2174
2175static unsigned short tvp5150_addrs[] = {
2176 0xb8 >> 1,
2177 0xba >> 1,
2178 I2C_CLIENT_END
2179};
2180
2181static unsigned short msp3400_addrs[] = {
2182 0x80 >> 1,
2183 0x88 >> 1,
2184 I2C_CLIENT_END
2185};
2186
Michael Krufkyd7cba042008-09-12 13:31:45 -03002187int em28xx_tuner_callback(void *ptr, int component, int command, int arg)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002188{
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002189 int rc = 0;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002190 struct em28xx *dev = ptr;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002191
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -03002192 if (dev->tuner_type != TUNER_XC2028 && dev->tuner_type != TUNER_XC5000)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002193 return 0;
2194
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -03002195 if (command != XC2028_TUNER_RESET && command != XC5000_TUNER_RESET)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002196 return 0;
2197
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03002198 rc = em28xx_gpio_set(dev, dev->board.tuner_gpio);
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002199
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002200 return rc;
2201}
2202EXPORT_SYMBOL_GPL(em28xx_tuner_callback);
2203
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03002204static inline void em28xx_set_model(struct em28xx *dev)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002205{
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002206 memcpy(&dev->board, &em28xx_boards[dev->model], sizeof(dev->board));
Devin Heitmuellered14e1c2008-12-29 22:27:30 -03002207
2208 /* Those are the default values for the majority of boards
2209 Use those values if not specified otherwise at boards entry
2210 */
2211 if (!dev->board.xclk)
2212 dev->board.xclk = EM28XX_XCLK_IR_RC5_MODE |
2213 EM28XX_XCLK_FREQUENCY_12MHZ;
2214
2215 if (!dev->board.i2c_speed)
2216 dev->board.i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
2217 EM28XX_I2C_FREQ_100_KHZ;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002218}
2219
Mauro Carvalho Chehabf2e26ae2009-08-12 20:21:44 -03002220
2221/* FIXME: Should be replaced by a proper mt9m111 driver */
2222static int em28xx_initialize_mt9m111(struct em28xx *dev)
2223{
2224 int i;
2225 unsigned char regs[][3] = {
2226 { 0x0d, 0x00, 0x01, }, /* reset and use defaults */
2227 { 0x0d, 0x00, 0x00, },
2228 { 0x0a, 0x00, 0x21, },
2229 { 0x21, 0x04, 0x00, }, /* full readout speed, no row/col skipping */
2230 };
2231
2232 for (i = 0; i < ARRAY_SIZE(regs); i++)
2233 i2c_master_send(&dev->i2c_client, &regs[i][0], 3);
2234
2235 return 0;
2236}
2237
2238
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -03002239/* FIXME: Should be replaced by a proper mt9m001 driver */
2240static int em28xx_initialize_mt9m001(struct em28xx *dev)
2241{
2242 int i;
2243 unsigned char regs[][3] = {
2244 { 0x0d, 0x00, 0x01, },
2245 { 0x0d, 0x00, 0x00, },
2246 { 0x04, 0x05, 0x00, }, /* hres = 1280 */
2247 { 0x03, 0x04, 0x00, }, /* vres = 1024 */
2248 { 0x20, 0x11, 0x00, },
2249 { 0x06, 0x00, 0x10, },
2250 { 0x2b, 0x00, 0x24, },
2251 { 0x2e, 0x00, 0x24, },
2252 { 0x35, 0x00, 0x24, },
2253 { 0x2d, 0x00, 0x20, },
2254 { 0x2c, 0x00, 0x20, },
2255 { 0x09, 0x0a, 0xd4, },
2256 { 0x35, 0x00, 0x57, },
2257 };
2258
2259 for (i = 0; i < ARRAY_SIZE(regs); i++)
2260 i2c_master_send(&dev->i2c_client, &regs[i][0], 3);
2261
2262 return 0;
2263}
2264
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002265/* HINT method: webcam I2C chips
2266 *
Mauro Carvalho Chehabf2e26ae2009-08-12 20:21:44 -03002267 * This method works for webcams with Micron sensors
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002268 */
2269static int em28xx_hint_sensor(struct em28xx *dev)
2270{
2271 int rc;
2272 char *sensor_name;
2273 unsigned char cmd;
2274 __be16 version_be;
2275 u16 version;
2276
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002277 /* Micron sensor detection */
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002278 dev->i2c_client.addr = 0xba >> 1;
2279 cmd = 0;
2280 i2c_master_send(&dev->i2c_client, &cmd, 1);
2281 rc = i2c_master_recv(&dev->i2c_client, (char *)&version_be, 2);
2282 if (rc != 2)
2283 return -EINVAL;
2284
2285 version = be16_to_cpu(version_be);
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002286 switch (version) {
Mauro Carvalho Chehab296544e2009-07-27 08:24:29 -03002287 case 0x8232: /* mt9v011 640x480 1.3 Mpix sensor */
2288 case 0x8243: /* mt9v011 rev B 640x480 1.3 Mpix sensor */
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002289 dev->model = EM2820_BOARD_SILVERCREST_WEBCAM;
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002290 em28xx_set_model(dev);
2291
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002292 sensor_name = "mt9v011";
Mauro Carvalho Chehab527f09a2009-07-12 11:04:15 -03002293 dev->em28xx_sensor = EM28XX_MT9V011;
Mauro Carvalho Chehab55699962009-07-13 20:15:02 -03002294 dev->sensor_xres = 640;
2295 dev->sensor_yres = 480;
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002296 /*
2297 * FIXME: mt9v011 uses I2S speed as xtal clk - at least with
2298 * the Silvercrest cam I have here for testing - for higher
2299 * resolutions, a high clock cause horizontal artifacts, so we
2300 * need to use a lower xclk frequency.
2301 * Yet, it would be possible to adjust xclk depending on the
2302 * desired resolution, since this affects directly the
2303 * frame rate.
2304 */
2305 dev->board.xclk = EM28XX_XCLK_FREQUENCY_4_3MHZ;
2306 dev->sensor_xtal = 4300000;
Mauro Carvalho Chehab579d3152009-07-14 12:33:25 -03002307
2308 /* probably means GRGB 16 bit bayer */
2309 dev->vinmode = 0x0d;
2310 dev->vinctl = 0x00;
2311
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002312 break;
Mauro Carvalho Chehabf2e26ae2009-08-12 20:21:44 -03002313
2314 case 0x143a: /* MT9M111 as found in the ECS G200 */
2315 dev->model = EM2750_BOARD_UNKNOWN;
2316 em28xx_set_model(dev);
2317
2318 sensor_name = "mt9m111";
2319 dev->board.xclk = EM28XX_XCLK_FREQUENCY_48MHZ;
2320 dev->em28xx_sensor = EM28XX_MT9M111;
2321 em28xx_initialize_mt9m111(dev);
2322 dev->sensor_xres = 640;
2323 dev->sensor_yres = 512;
2324
2325 dev->vinmode = 0x0a;
2326 dev->vinctl = 0x00;
2327
2328 break;
2329
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -03002330 case 0x8431:
2331 dev->model = EM2750_BOARD_UNKNOWN;
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002332 em28xx_set_model(dev);
2333
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -03002334 sensor_name = "mt9m001";
2335 dev->em28xx_sensor = EM28XX_MT9M001;
2336 em28xx_initialize_mt9m001(dev);
2337 dev->sensor_xres = 1280;
2338 dev->sensor_yres = 1024;
2339
2340 /* probably means BGGR 16 bit bayer */
2341 dev->vinmode = 0x0c;
2342 dev->vinctl = 0x00;
2343
2344 break;
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002345 default:
Mauro Carvalho Chehabf2e26ae2009-08-12 20:21:44 -03002346 printk("Unknown Micron Sensor 0x%04x\n", version);
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002347 return -EINVAL;
2348 }
2349
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002350 /* Setup webcam defaults */
2351 em28xx_pre_card_setup(dev);
2352
Mauro Carvalho Chehab8b220792009-07-12 10:56:21 -03002353 em28xx_errdev("Sensor is %s, using model %s entry.\n",
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002354 sensor_name, em28xx_boards[dev->model].name);
2355
2356 return 0;
2357}
2358
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002359/* Since em28xx_pre_card_setup() requires a proper dev->model,
2360 * this won't work for boards with generic PCI IDs
2361 */
Ezequiel Garcia60332f02012-04-28 09:57:01 -03002362static void em28xx_pre_card_setup(struct em28xx *dev)
Markus Rechbergera94e95b2006-01-23 17:11:10 -02002363{
Devin Heitmuellered14e1c2008-12-29 22:27:30 -03002364 /* Set the initial XCLK and I2C clock values based on the board
2365 definition */
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002366 em28xx_write_reg(dev, EM28XX_R0F_XCLK, dev->board.xclk & 0x7f);
Sascha Sommerca80cf62012-01-08 16:32:09 -03002367 if (!dev->board.is_em2800)
2368 em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed);
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03002369 msleep(50);
2370
Markus Rechbergera94e95b2006-01-23 17:11:10 -02002371 /* request some modules */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002372 switch (dev->model) {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002373 case EM2861_BOARD_PLEXTOR_PX_TV100U:
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -03002374 /* Sets the msp34xx I2S speed */
2375 dev->i2s_speed = 2048000;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002376 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002377 case EM2861_BOARD_KWORLD_PVRTV_300U:
2378 case EM2880_BOARD_KWORLD_DVB_305U:
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002379 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x6d);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002380 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002381 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x7d);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002382 msleep(10);
2383 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002384 case EM2870_BOARD_COMPRO_VIDEOMATE:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002385 /* TODO: someone can do some cleanup here...
2386 not everything's needed */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002387 em28xx_write_reg(dev, EM2880_R04_GPO, 0x00);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002388 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002389 em28xx_write_reg(dev, EM2880_R04_GPO, 0x01);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002390 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002391 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002392 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002393 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002394 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002395 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xdc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002396 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002397 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002398 mdelay(70);
2399 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002400 case EM2870_BOARD_TERRATEC_XS_MT2060:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002401 /* this device needs some gpio writes to get the DVB-T
2402 demod work */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002403 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002404 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002405 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xde);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002406 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002407 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002408 mdelay(70);
2409 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002410 case EM2870_BOARD_PINNACLE_PCTV_DVB:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002411 /* this device needs some gpio writes to get the
2412 DVB-T demod work */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002413 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002414 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002415 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xde);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002416 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002417 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002418 mdelay(70);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002419 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002420 case EM2820_BOARD_GADMEI_UTV310:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002421 case EM2820_BOARD_MSI_VOX_USB_2:
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03002422 /* enables audio for that devices */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002423 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002424 break;
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03002425
Franklin Mengd7de5d82009-06-06 17:05:02 -03002426 case EM2882_BOARD_KWORLD_ATSC_315U:
2427 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff);
2428 msleep(10);
2429 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
2430 msleep(10);
2431 em28xx_write_reg(dev, EM2880_R04_GPO, 0x00);
2432 msleep(10);
2433 em28xx_write_reg(dev, EM2880_R04_GPO, 0x08);
2434 msleep(10);
2435 break;
2436
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03002437 case EM2860_BOARD_KAIOMY_TVNPC_U2:
2438 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x07", 1);
2439 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
2440 em28xx_write_regs(dev, 0x0d, "\x42", 1);
2441 em28xx_write_regs(dev, 0x08, "\xfd", 1);
2442 msleep(10);
2443 em28xx_write_regs(dev, 0x08, "\xff", 1);
2444 msleep(10);
2445 em28xx_write_regs(dev, 0x08, "\x7f", 1);
2446 msleep(10);
2447 em28xx_write_regs(dev, 0x08, "\x6b", 1);
2448
2449 break;
Mauro Carvalho Chehab56ee3802009-02-11 14:18:36 -03002450 case EM2860_BOARD_EASYCAP:
2451 em28xx_write_regs(dev, 0x08, "\xf8", 1);
2452 break;
2453
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03002454 case EM2820_BOARD_IODATA_GVMVP_SZ:
2455 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff);
2456 msleep(70);
2457 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf7);
2458 msleep(10);
2459 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
2460 msleep(70);
2461 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
2462 msleep(70);
2463 break;
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002464 }
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03002465
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03002466 em28xx_gpio_set(dev, dev->board.tuner_gpio);
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03002467 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
2468
2469 /* Unlock device */
Mauro Carvalho Chehab2fe3e2e2008-11-27 09:10:40 -03002470 em28xx_set_mode(dev, EM28XX_SUSPEND);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002471}
2472
Mauro Carvalho Chehabe54318e2008-04-18 18:34:31 -03002473static void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl)
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002474{
2475 memset(ctl, 0, sizeof(*ctl));
2476
2477 ctl->fname = XC2028_DEFAULT_FIRMWARE;
2478 ctl->max_len = 64;
2479 ctl->mts = em28xx_boards[dev->model].mts_firmware;
2480
2481 switch (dev->model) {
Douglas Schilling Landgrafe5db5d42009-04-09 18:24:34 -03002482 case EM2880_BOARD_EMPIRE_DUAL_TV:
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03002483 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
Uroš Vamplec994d02009-09-30 22:53:37 -03002484 case EM2882_BOARD_TERRATEC_HYBRID_XS:
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03002485 ctl->demod = XC3028_FE_ZARLINK456;
2486 break;
reinhard schwab655b8402008-07-26 10:47:00 -03002487 case EM2880_BOARD_TERRATEC_HYBRID_XS:
Michel Garniercec4e6c2010-10-16 14:42:01 -03002488 case EM2880_BOARD_TERRATEC_HYBRID_XS_FR:
Devin Heitmuellere16e5a32009-07-15 00:37:22 -03002489 case EM2881_BOARD_PINNACLE_HYBRID_PRO:
reinhard schwab655b8402008-07-26 10:47:00 -03002490 ctl->demod = XC3028_FE_ZARLINK456;
2491 break;
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002492 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
Devin Heitmuellerad9b4bb2011-03-13 02:09:59 -03002493 case EM2882_BOARD_PINNACLE_HYBRID_PRO_330E:
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002494 ctl->demod = XC3028_FE_DEFAULT;
2495 break;
Devin Heitmueller5ea7fe42008-09-16 02:02:12 -03002496 case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600:
2497 ctl->demod = XC3028_FE_DEFAULT;
2498 ctl->fname = XC3028L_DEFAULT_FIRMWARE;
2499 break;
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03002500 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850:
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002501 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03002502 case EM2880_BOARD_PINNACLE_PCTV_HD_PRO:
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03002503 /* FIXME: Better to specify the needed IF */
Devin Heitmuellerbdfbf952008-04-17 21:38:27 -03002504 ctl->demod = XC3028_FE_DEFAULT;
2505 break;
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03002506 case EM2883_BOARD_KWORLD_HYBRID_330U:
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03002507 case EM2882_BOARD_DIKOM_DK300:
Antonio Larrosa811fab62010-03-04 22:19:48 -03002508 case EM2882_BOARD_KWORLD_VS_DVBT:
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03002509 ctl->demod = XC3028_FE_CHINA;
2510 ctl->fname = XC2028_DEFAULT_FIRMWARE;
2511 break;
Devin Heitmueller19859222009-06-19 00:33:54 -03002512 case EM2882_BOARD_EVGA_INDTUBE:
2513 ctl->demod = XC3028_FE_CHINA;
2514 ctl->fname = XC3028L_DEFAULT_FIRMWARE;
2515 break;
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002516 default:
2517 ctl->demod = XC3028_FE_OREN538;
2518 }
2519}
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002520
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002521static void em28xx_tuner_setup(struct em28xx *dev)
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002522{
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002523 struct tuner_setup tun_setup;
2524 struct v4l2_frequency f;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002525
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03002526 if (dev->tuner_type == TUNER_ABSENT)
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002527 return;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002528
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002529 memset(&tun_setup, 0, sizeof(tun_setup));
2530
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002531 tun_setup.mode_mask = T_ANALOG_TV | T_RADIO;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002532 tun_setup.tuner_callback = em28xx_tuner_callback;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002533
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002534 if (dev->board.radio.type) {
2535 tun_setup.type = dev->board.radio.type;
2536 tun_setup.addr = dev->board.radio_addr;
2537
2538 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_type_addr, &tun_setup);
2539 }
2540
2541 if ((dev->tuner_type != TUNER_ABSENT) && (dev->tuner_type)) {
2542 tun_setup.type = dev->tuner_type;
2543 tun_setup.addr = dev->tuner_addr;
2544
2545 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_type_addr, &tun_setup);
2546 }
2547
2548 if (dev->tda9887_conf) {
2549 struct v4l2_priv_tun_config tda9887_cfg;
2550
2551 tda9887_cfg.tuner = TUNER_TDA9887;
2552 tda9887_cfg.priv = &dev->tda9887_conf;
2553
2554 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_config, &tda9887_cfg);
2555 }
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002556
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002557 if (dev->tuner_type == TUNER_XC2028) {
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002558 struct v4l2_priv_tun_config xc2028_cfg;
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002559 struct xc2028_ctrl ctl;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002560
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002561 memset(&xc2028_cfg, 0, sizeof(xc2028_cfg));
2562 memset(&ctl, 0, sizeof(ctl));
2563
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002564 em28xx_setup_xc3028(dev, &ctl);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002565
2566 xc2028_cfg.tuner = TUNER_XC2028;
2567 xc2028_cfg.priv = &ctl;
2568
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002569 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_config, &xc2028_cfg);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002570 }
2571
2572 /* configure tuner */
2573 f.tuner = 0;
2574 f.type = V4L2_TUNER_ANALOG_TV;
2575 f.frequency = 9076; /* just a magic number */
2576 dev->ctl_freq = f.frequency;
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002577 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002578}
2579
2580static int em28xx_hint_board(struct em28xx *dev)
2581{
2582 int i;
2583
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03002584 /* HINT method: EEPROM
2585 *
2586 * This method works only for boards with eeprom.
2587 * Uses a hash of all eeprom bytes. The hash should be
2588 * unique for a vendor/tuner pair.
2589 * There are a high chance that tuners for different
2590 * video standards produce different hashes.
2591 */
2592 for (i = 0; i < ARRAY_SIZE(em28xx_eeprom_hash); i++) {
2593 if (dev->hash == em28xx_eeprom_hash[i].hash) {
2594 dev->model = em28xx_eeprom_hash[i].model;
2595 dev->tuner_type = em28xx_eeprom_hash[i].tuner;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002596
2597 em28xx_errdev("Your board has no unique USB ID.\n");
2598 em28xx_errdev("A hint were successfully done, "
2599 "based on eeprom hash.\n");
2600 em28xx_errdev("This method is not 100%% failproof.\n");
2601 em28xx_errdev("If the board were missdetected, "
2602 "please email this log to:\n");
2603 em28xx_errdev("\tV4L Mailing List "
Alexey Klimov51caf912009-01-25 12:53:09 -03002604 " <linux-media@vger.kernel.org>\n");
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002605 em28xx_errdev("Board detected as %s\n",
2606 em28xx_boards[dev->model].name);
2607
2608 return 0;
2609 }
2610 }
Sascha Sommerfad7b952007-11-04 08:06:48 -03002611
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03002612 /* HINT method: I2C attached devices
2613 *
2614 * This method works for all boards.
2615 * Uses a hash of i2c scanned devices.
2616 * Devices with the same i2c attached chips will
2617 * be considered equal.
2618 * This method is less precise than the eeprom one.
2619 */
2620
Sascha Sommerfad7b952007-11-04 08:06:48 -03002621 /* user did not request i2c scanning => do it now */
2622 if (!dev->i2c_hash)
2623 em28xx_do_i2c_scan(dev);
2624
2625 for (i = 0; i < ARRAY_SIZE(em28xx_i2c_hash); i++) {
2626 if (dev->i2c_hash == em28xx_i2c_hash[i].hash) {
2627 dev->model = em28xx_i2c_hash[i].model;
2628 dev->tuner_type = em28xx_i2c_hash[i].tuner;
2629 em28xx_errdev("Your board has no unique USB ID.\n");
2630 em28xx_errdev("A hint were successfully done, "
2631 "based on i2c devicelist hash.\n");
2632 em28xx_errdev("This method is not 100%% failproof.\n");
2633 em28xx_errdev("If the board were missdetected, "
2634 "please email this log to:\n");
2635 em28xx_errdev("\tV4L Mailing List "
Alexey Klimov51caf912009-01-25 12:53:09 -03002636 " <linux-media@vger.kernel.org>\n");
Sascha Sommerfad7b952007-11-04 08:06:48 -03002637 em28xx_errdev("Board detected as %s\n",
2638 em28xx_boards[dev->model].name);
2639
2640 return 0;
2641 }
2642 }
2643
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002644 em28xx_errdev("Your board has no unique USB ID and thus need a "
2645 "hint to be detected.\n");
2646 em28xx_errdev("You may try to use card=<n> insmod option to "
2647 "workaround that.\n");
2648 em28xx_errdev("Please send an email with this log to:\n");
Alexey Klimov51caf912009-01-25 12:53:09 -03002649 em28xx_errdev("\tV4L Mailing List <linux-media@vger.kernel.org>\n");
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002650 em28xx_errdev("Board eeprom hash is 0x%08lx\n", dev->hash);
Sascha Sommerfad7b952007-11-04 08:06:48 -03002651 em28xx_errdev("Board i2c devicelist hash is 0x%08lx\n", dev->i2c_hash);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002652
2653 em28xx_errdev("Here is a list of valid choices for the card=<n>"
2654 " insmod option:\n");
2655 for (i = 0; i < em28xx_bcount; i++) {
2656 em28xx_errdev(" card=%d -> %s\n",
2657 i, em28xx_boards[i].name);
2658 }
2659 return -1;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002660}
2661
Ezequiel Garcia60332f02012-04-28 09:57:01 -03002662static void em28xx_card_setup(struct em28xx *dev)
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002663{
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002664 /*
2665 * If the device can be a webcam, seek for a sensor.
2666 * If sensor is not found, then it isn't a webcam.
2667 */
2668 if (dev->board.is_webcam) {
2669 if (em28xx_hint_sensor(dev) < 0)
2670 dev->board.is_webcam = 0;
2671 else
2672 dev->progressive = 1;
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03002673 }
2674
2675 if (!dev->board.is_webcam) {
2676 switch (dev->model) {
2677 case EM2820_BOARD_UNKNOWN:
2678 case EM2800_BOARD_UNKNOWN:
2679 /*
2680 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD.
2681 *
2682 * This occurs because they share identical USB vendor and
2683 * product IDs.
2684 *
2685 * What we do here is look up the EEPROM hash of the K-WORLD
2686 * and if it is found then we decide that we do not have
2687 * a DIGIVOX and reset the device to the K-WORLD instead.
2688 *
2689 * This solution is only valid if they do not share eeprom
2690 * hash identities which has not been determined as yet.
2691 */
2692 if (em28xx_hint_board(dev) < 0)
2693 em28xx_errdev("Board not discovered\n");
2694 else {
2695 em28xx_set_model(dev);
2696 em28xx_pre_card_setup(dev);
2697 }
2698 break;
2699 default:
2700 em28xx_set_model(dev);
2701 }
2702 }
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002703
2704 em28xx_info("Identified as %s (card=%d)\n",
2705 dev->board.name, dev->model);
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002706
2707 dev->tuner_type = em28xx_boards[dev->model].tuner_type;
Mauro Carvalho Chehab31e05302008-11-20 18:47:37 -03002708 if (em28xx_boards[dev->model].tuner_addr)
2709 dev->tuner_addr = em28xx_boards[dev->model].tuner_addr;
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002710
Franklin Mengae3340c2009-06-06 16:34:01 -03002711 if (em28xx_boards[dev->model].tda9887_conf)
2712 dev->tda9887_conf = em28xx_boards[dev->model].tda9887_conf;
2713
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002714 /* request some modules */
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002715 switch (dev->model) {
2716 case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2:
Mauro Carvalho Chehab98ae1272007-11-05 09:30:39 -03002717 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002718 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03002719 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850:
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002720 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002721 {
2722 struct tveeprom tv;
Mauro Carvalho Chehabac07bb72009-09-08 14:04:41 -03002723#if defined(CONFIG_MODULES) && defined(MODULE)
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002724 request_module("tveeprom");
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002725#endif
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002726 /* Call first TVeeprom */
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002727
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002728 dev->i2c_client.addr = 0xa0 >> 1;
2729 tveeprom_hauppauge_analog(&dev->i2c_client, &tv, dev->eedata);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002730
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002731 dev->tuner_type = tv.tuner_type;
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03002732
Hans Verkuil38f9d302008-07-23 05:09:15 -03002733 if (tv.audio_processor == V4L2_IDENT_MSPX4XX) {
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002734 dev->i2s_speed = 2048000;
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002735 dev->board.has_msp34xx = 1;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002736 }
2737 break;
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002738 }
Franklin Mengd7de5d82009-06-06 17:05:02 -03002739 case EM2882_BOARD_KWORLD_ATSC_315U:
2740 em28xx_write_reg(dev, 0x0d, 0x42);
2741 msleep(10);
2742 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
2743 msleep(10);
2744 break;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002745 case EM2820_BOARD_KWORLD_PVRTV2800RF:
2746 /* GPIO enables sound on KWORLD PVR TV 2800RF */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002747 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf9);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002748 break;
2749 case EM2820_BOARD_UNKNOWN:
2750 case EM2800_BOARD_UNKNOWN:
Darron Broadda3808e2008-09-30 02:46:41 -03002751 /*
2752 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD.
2753 *
2754 * This occurs because they share identical USB vendor and
2755 * product IDs.
2756 *
2757 * What we do here is look up the EEPROM hash of the K-WORLD
2758 * and if it is found then we decide that we do not have
2759 * a DIGIVOX and reset the device to the K-WORLD instead.
2760 *
2761 * This solution is only valid if they do not share eeprom
2762 * hash identities which has not been determined as yet.
2763 */
2764 case EM2880_BOARD_MSI_DIGIVOX_AD:
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002765 if (!em28xx_hint_board(dev))
2766 em28xx_set_model(dev);
Devin Heitmuellercdf7bfa2009-06-19 00:20:28 -03002767
2768 /* In cases where we had to use a board hint, the call to
2769 em28xx_set_mode() in em28xx_pre_card_setup() was a no-op,
2770 so make the call now so the analog GPIOs are set properly
2771 before probing the i2c bus. */
Devin Heitmueller5343e442009-07-15 00:35:47 -03002772 em28xx_gpio_set(dev, dev->board.tuner_gpio);
Devin Heitmuellercdf7bfa2009-06-19 00:20:28 -03002773 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002774 break;
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03002775
2776/*
2777 * The Dikom DK300 is detected as an Kworld VS-DVB-T 323UR.
2778 *
2779 * This occurs because they share identical USB vendor and
2780 * product IDs.
2781 *
2782 * What we do here is look up the EEPROM hash of the Dikom
2783 * and if it is found then we decide that we do not have
2784 * a Kworld and reset the device to the Dikom instead.
2785 *
2786 * This solution is only valid if they do not share eeprom
2787 * hash identities which has not been determined as yet.
2788 */
2789 case EM2882_BOARD_KWORLD_VS_DVBT:
2790 if (!em28xx_hint_board(dev))
2791 em28xx_set_model(dev);
2792
2793 /* In cases where we had to use a board hint, the call to
2794 em28xx_set_mode() in em28xx_pre_card_setup() was a no-op,
2795 so make the call now so the analog GPIOs are set properly
2796 before probing the i2c bus. */
2797 em28xx_gpio_set(dev, dev->board.tuner_gpio);
2798 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
2799 break;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002800 }
2801
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002802 if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002803 em28xx_errdev("\n\n");
2804 em28xx_errdev("The support for this board weren't "
2805 "valid yet.\n");
2806 em28xx_errdev("Please send a report of having this working\n");
2807 em28xx_errdev("not to V4L mailing list (and/or to other "
2808 "addresses)\n\n");
2809 }
2810
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002811 /* Allow override tuner type by a module parameter */
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002812 if (tuner >= 0)
2813 dev->tuner_type = tuner;
2814
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002815 /* request some modules */
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002816 if (dev->board.has_msp34xx)
Hans Verkuil53dacb12009-08-10 02:49:08 -03002817 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002818 "msp3400", 0, msp3400_addrs);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002819
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03002820 if (dev->board.decoder == EM28XX_SAA711X)
Hans Verkuil53dacb12009-08-10 02:49:08 -03002821 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002822 "saa7115_auto", 0, saa711x_addrs);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002823
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002824 if (dev->board.decoder == EM28XX_TVP5150)
Hans Verkuil53dacb12009-08-10 02:49:08 -03002825 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002826 "tvp5150", 0, tvp5150_addrs);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002827
Mauro Carvalho Chehabd36bb4e2009-07-14 03:18:39 -03002828 if (dev->em28xx_sensor == EM28XX_MT9V011) {
Hans Verkuil3c7c9372011-01-08 07:08:02 -03002829 struct mt9v011_platform_data pdata;
2830 struct i2c_board_info mt9v011_info = {
2831 .type = "mt9v011",
2832 .addr = 0xba >> 1,
2833 .platform_data = &pdata,
2834 };
Mauro Carvalho Chehabd36bb4e2009-07-14 03:18:39 -03002835
Hans Verkuil3c7c9372011-01-08 07:08:02 -03002836 pdata.xtal = dev->sensor_xtal;
Mauro Carvalho Chehab00d2e7a2011-06-17 20:28:51 -03002837 v4l2_i2c_new_subdev_board(&dev->v4l2_dev, &dev->i2c_adap,
Hans Verkuil3c7c9372011-01-08 07:08:02 -03002838 &mt9v011_info, NULL);
Mauro Carvalho Chehabd36bb4e2009-07-14 03:18:39 -03002839 }
Mauro Carvalho Chehab02e78042009-06-29 11:35:05 -03002840
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -03002841
Mauro Carvalho Chehabdf7fa092009-02-25 09:06:13 -03002842 if (dev->board.adecoder == EM28XX_TVAUDIO)
Hans Verkuile6574f22009-04-01 03:57:53 -03002843 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002844 "tvaudio", dev->board.tvaudio_addr, NULL);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002845
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002846 if (dev->board.tuner_type != TUNER_ABSENT) {
2847 int has_demod = (dev->tda9887_conf & TDA9887_PRESENT);
Mauro Carvalho Chehaba924a492008-11-12 08:41:29 -03002848
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002849 if (dev->board.radio.type)
Hans Verkuile6574f22009-04-01 03:57:53 -03002850 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002851 "tuner", dev->board.radio_addr, NULL);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002852
2853 if (has_demod)
Hans Verkuil53dacb12009-08-10 02:49:08 -03002854 v4l2_i2c_new_subdev(&dev->v4l2_dev,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002855 &dev->i2c_adap, "tuner",
Hans Verkuil53dacb12009-08-10 02:49:08 -03002856 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002857 if (dev->tuner_addr == 0) {
2858 enum v4l2_i2c_tuner_type type =
2859 has_demod ? ADDRS_TV_WITH_DEMOD : ADDRS_TV;
2860 struct v4l2_subdev *sd;
2861
Hans Verkuil53dacb12009-08-10 02:49:08 -03002862 sd = v4l2_i2c_new_subdev(&dev->v4l2_dev,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002863 &dev->i2c_adap, "tuner",
Hans Verkuil53dacb12009-08-10 02:49:08 -03002864 0, v4l2_i2c_tuner_addrs(type));
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002865
2866 if (sd)
2867 dev->tuner_addr = v4l2_i2c_subdev_addr(sd);
2868 } else {
Hans Verkuile6574f22009-04-01 03:57:53 -03002869 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002870 "tuner", dev->tuner_addr, NULL);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002871 }
2872 }
2873
2874 em28xx_tuner_setup(dev);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002875}
Mauro Carvalho Chehabc8644052008-11-25 13:10:14 -03002876
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002877
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002878static void request_module_async(struct work_struct *work)
2879{
2880 struct em28xx *dev = container_of(work,
2881 struct em28xx, request_module_wk);
2882
Mauro Carvalho Chehab6ae5e062012-10-02 15:35:27 -03002883 /*
2884 * The em28xx extensions can be modules or builtin. If the
2885 * modules are already loaded or are built in, those extensions
2886 * can be initialised right now. Otherwise, the module init
2887 * code will do it.
2888 */
2889 em28xx_init_extension(dev);
2890
2891#if defined(CONFIG_MODULES) && defined(MODULE)
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002892 if (dev->has_audio_class)
2893 request_module("snd-usb-audio");
2894 else if (dev->has_alsa_audio)
2895 request_module("em28xx-alsa");
2896
2897 if (dev->board.has_dvb)
2898 request_module("em28xx-dvb");
Mauro Carvalho Chehab4dab0e52012-07-05 22:52:34 -03002899 if (dev->board.ir_codes && !disable_ir)
Ezequiel Garcíaf4d4e762012-03-26 09:13:35 -03002900 request_module("em28xx-rc");
Mauro Carvalho Chehab6ae5e062012-10-02 15:35:27 -03002901#endif /* CONFIG_MODULES */
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002902}
2903
2904static void request_modules(struct em28xx *dev)
2905{
2906 INIT_WORK(&dev->request_module_wk, request_module_async);
2907 schedule_work(&dev->request_module_wk);
2908}
Tejun Heo707bcf32010-12-24 16:14:20 +01002909
2910static void flush_request_modules(struct em28xx *dev)
2911{
Linus Torvalds0b8e74c2012-10-07 17:49:05 +09002912 flush_work(&dev->request_module_wk);
Tejun Heo707bcf32010-12-24 16:14:20 +01002913}
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002914
2915/*
Chris Rankind7222e72011-09-24 11:02:32 -03002916 * em28xx_release_resources()
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002917 * unregisters the v4l2,i2c and usb devices
Chris Rankind7222e72011-09-24 11:02:32 -03002918 * called when the device gets disconnected or at module unload
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002919*/
2920void em28xx_release_resources(struct em28xx *dev)
2921{
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002922 /*FIXME: I2C IR should be disconnected */
2923
2924 em28xx_release_analog_resources(dev);
2925
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002926 em28xx_i2c_unregister(dev);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002927
2928 v4l2_device_unregister(&dev->v4l2_dev);
2929
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002930 usb_put_dev(dev->udev);
2931
2932 /* Mark device as unused */
Chris Rankin38b61eb2011-08-20 08:21:03 -03002933 clear_bit(dev->devno, &em28xx_devused);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002934};
2935
2936/*
2937 * em28xx_init_dev()
2938 * allocates and inits the device structs, registers i2c bus and v4l device
2939 */
Thomas Petazzoni622c2fc2012-01-07 10:18:45 -03002940static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,
Mauro Carvalho Chehab36fa6742009-04-05 08:02:15 -03002941 struct usb_interface *interface,
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002942 int minor)
2943{
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002944 int retval;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002945
2946 dev->udev = udev;
2947 mutex_init(&dev->ctrl_urb_lock);
2948 spin_lock_init(&dev->slock);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002949
2950 dev->em28xx_write_regs = em28xx_write_regs;
2951 dev->em28xx_read_reg = em28xx_read_reg;
2952 dev->em28xx_read_reg_req_len = em28xx_read_reg_req_len;
2953 dev->em28xx_write_regs_req = em28xx_write_regs_req;
2954 dev->em28xx_read_reg_req = em28xx_read_reg_req;
2955 dev->board.is_em2800 = em28xx_boards[dev->model].is_em2800;
2956
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002957 em28xx_set_model(dev);
2958
2959 /* Set the default GPO/GPIO for legacy devices */
2960 dev->reg_gpo_num = EM2880_R04_GPO;
2961 dev->reg_gpio_num = EM28XX_R08_GPIO;
2962
2963 dev->wait_after_write = 5;
2964
2965 /* Based on the Chip ID, set the device configuration */
2966 retval = em28xx_read_reg(dev, EM28XX_R0A_CHIPID);
2967 if (retval > 0) {
2968 dev->chip_id = retval;
2969
2970 switch (dev->chip_id) {
Mauro Carvalho Chehabf57b17c32009-11-12 11:21:05 -03002971 case CHIP_ID_EM2800:
2972 em28xx_info("chip ID is em2800\n");
2973 break;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002974 case CHIP_ID_EM2710:
2975 em28xx_info("chip ID is em2710\n");
2976 break;
2977 case CHIP_ID_EM2750:
2978 em28xx_info("chip ID is em2750\n");
2979 break;
2980 case CHIP_ID_EM2820:
2981 em28xx_info("chip ID is em2820 (or em2710)\n");
2982 break;
2983 case CHIP_ID_EM2840:
2984 em28xx_info("chip ID is em2840\n");
2985 break;
2986 case CHIP_ID_EM2860:
2987 em28xx_info("chip ID is em2860\n");
2988 break;
2989 case CHIP_ID_EM2870:
2990 em28xx_info("chip ID is em2870\n");
2991 dev->wait_after_write = 0;
2992 break;
2993 case CHIP_ID_EM2874:
2994 em28xx_info("chip ID is em2874\n");
2995 dev->reg_gpio_num = EM2874_R80_GPIO;
2996 dev->wait_after_write = 0;
2997 break;
Antti Palosaaribc022692011-04-07 16:04:48 -03002998 case CHIP_ID_EM28174:
2999 em28xx_info("chip ID is em28174\n");
3000 dev->reg_gpio_num = EM2874_R80_GPIO;
3001 dev->wait_after_write = 0;
3002 break;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003003 case CHIP_ID_EM2883:
3004 em28xx_info("chip ID is em2882/em2883\n");
3005 dev->wait_after_write = 0;
3006 break;
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -03003007 case CHIP_ID_EM2884:
3008 em28xx_info("chip ID is em2884\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 default:
3013 em28xx_info("em28xx chip ID = %d\n", dev->chip_id);
3014 }
3015 }
3016
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003017 if (dev->is_audio_only) {
Chris Rankin6c03e382011-08-20 08:28:17 -03003018 retval = em28xx_audio_setup(dev);
3019 if (retval)
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003020 return -ENODEV;
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003021 em28xx_init_extension(dev);
3022
3023 return 0;
3024 }
3025
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003026 /* Prepopulate cached GPO register content */
3027 retval = em28xx_read_reg(dev, dev->reg_gpo_num);
3028 if (retval >= 0)
3029 dev->reg_gpo = retval;
3030
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003031 em28xx_pre_card_setup(dev);
3032
3033 if (!dev->board.is_em2800) {
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03003034 /* Resets I2C speed */
Sascha Sommer0903bb52012-01-08 16:19:30 -03003035 retval = em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003036 if (retval < 0) {
Chris Rankin6c03e382011-08-20 08:28:17 -03003037 em28xx_errdev("%s: em28xx_write_reg failed!"
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003038 " retval [%d]\n",
3039 __func__, retval);
3040 return retval;
3041 }
3042 }
3043
Mauro Carvalho Chehab36fa6742009-04-05 08:02:15 -03003044 retval = v4l2_device_register(&interface->dev, &dev->v4l2_dev);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003045 if (retval < 0) {
3046 em28xx_errdev("Call to v4l2_device_register() failed!\n");
3047 return retval;
3048 }
3049
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003050 /* register i2c bus */
Chris Rankin6c03e382011-08-20 08:28:17 -03003051 retval = em28xx_i2c_register(dev);
3052 if (retval < 0) {
3053 em28xx_errdev("%s: em28xx_i2c_register - error [%d]!\n",
3054 __func__, retval);
3055 goto unregister_dev;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003056 }
3057
Mauro Carvalho Chehabb04fb662009-07-13 01:28:21 -03003058 /*
Mauro Carvalho Chehab579d3152009-07-14 12:33:25 -03003059 * Default format, used for tvp5150 or saa711x output formats
3060 */
3061 dev->vinmode = 0x10;
Devin Heitmueller206313d2009-08-31 23:23:03 -03003062 dev->vinctl = EM28XX_VINCTRL_INTERLACED |
3063 EM28XX_VINCTRL_CCIR656_ENABLE;
Mauro Carvalho Chehab579d3152009-07-14 12:33:25 -03003064
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003065 /* Do board specific init and eeprom reading */
3066 em28xx_card_setup(dev);
3067
3068 /* Configure audio */
Chris Rankin6c03e382011-08-20 08:28:17 -03003069 retval = em28xx_audio_setup(dev);
3070 if (retval < 0) {
3071 em28xx_errdev("%s: Error while setting audio - error [%d]!\n",
3072 __func__, retval);
3073 goto fail;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003074 }
3075
3076 /* wake i2c devices */
3077 em28xx_wake_i2c(dev);
3078
3079 /* init video dma queues */
3080 INIT_LIST_HEAD(&dev->vidq.active);
Devin Heitmueller28abf0832009-09-01 01:54:54 -03003081 INIT_LIST_HEAD(&dev->vbiq.active);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003082
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003083 if (dev->board.has_msp34xx) {
3084 /* Send a reset to other chips via gpio */
Chris Rankin6c03e382011-08-20 08:28:17 -03003085 retval = em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf7);
3086 if (retval < 0) {
3087 em28xx_errdev("%s: em28xx_write_reg - "
3088 "msp34xx(1) failed! error [%d]\n",
3089 __func__, retval);
3090 goto fail;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003091 }
3092 msleep(3);
3093
Chris Rankin6c03e382011-08-20 08:28:17 -03003094 retval = em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff);
3095 if (retval < 0) {
3096 em28xx_errdev("%s: em28xx_write_reg - "
3097 "msp34xx(2) failed! error [%d]\n",
3098 __func__, retval);
3099 goto fail;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003100 }
3101 msleep(3);
3102 }
3103
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003104 retval = em28xx_register_analog_devices(dev);
3105 if (retval < 0) {
Chris Rankin6c03e382011-08-20 08:28:17 -03003106 goto fail;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003107 }
3108
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003109 /* Save some power by putting tuner to sleep */
Laurent Pinchart622b8282009-10-05 10:48:17 -03003110 v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_power, 0);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003111
3112 return 0;
3113
Chris Rankin6c03e382011-08-20 08:28:17 -03003114fail:
3115 em28xx_i2c_unregister(dev);
3116
3117unregister_dev:
3118 v4l2_device_unregister(&dev->v4l2_dev);
3119
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003120 return retval;
3121}
3122
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003123/* high bandwidth multiplier, as encoded in highspeed endpoint descriptors */
3124#define hb_mult(wMaxPacketSize) (1 + (((wMaxPacketSize) >> 11) & 0x03))
3125
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003126/*
3127 * em28xx_usb_probe()
3128 * checks for supported devices
3129 */
3130static int em28xx_usb_probe(struct usb_interface *interface,
3131 const struct usb_device_id *id)
3132{
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003133 struct usb_device *udev;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003134 struct em28xx *dev = NULL;
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003135 int retval;
Holger Nelson8ab33622011-12-28 18:55:41 -03003136 bool has_audio = false, has_video = false, has_dvb = false;
3137 int i, nr;
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003138 const int ifnum = interface->altsetting[0].desc.bInterfaceNumber;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003139 char *speed;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003140
3141 udev = usb_get_dev(interface_to_usbdev(interface));
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003142
3143 /* Check to see next free device and mark as used */
Chris Rankin38b61eb2011-08-20 08:21:03 -03003144 do {
3145 nr = find_first_zero_bit(&em28xx_devused, EM28XX_MAXBOARDS);
3146 if (nr >= EM28XX_MAXBOARDS) {
3147 /* No free device slots */
3148 printk(DRIVER_NAME ": Supports only %i em28xx boards.\n",
3149 EM28XX_MAXBOARDS);
3150 retval = -ENOMEM;
3151 goto err_no_slot;
3152 }
3153 } while (test_and_set_bit(nr, &em28xx_devused));
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003154
3155 /* Don't register audio interfaces */
3156 if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
3157 em28xx_err(DRIVER_NAME " audio device (%04x:%04x): "
3158 "interface %i, class %i\n",
3159 le16_to_cpu(udev->descriptor.idVendor),
3160 le16_to_cpu(udev->descriptor.idProduct),
3161 ifnum,
3162 interface->altsetting[0].desc.bInterfaceClass);
3163
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003164 retval = -ENODEV;
3165 goto err;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003166 }
3167
Holger Nelson8ab33622011-12-28 18:55:41 -03003168 /* allocate memory for our device state and initialize it */
3169 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
3170 if (dev == NULL) {
3171 em28xx_err(DRIVER_NAME ": out of memory!\n");
3172 retval = -ENOMEM;
3173 goto err;
3174 }
3175
3176 /* compute alternate max packet sizes */
3177 dev->alt_max_pkt_size = kmalloc(sizeof(dev->alt_max_pkt_size[0]) *
3178 interface->num_altsetting, GFP_KERNEL);
3179 if (dev->alt_max_pkt_size == NULL) {
3180 em28xx_errdev("out of memory!\n");
3181 kfree(dev);
3182 retval = -ENOMEM;
3183 goto err;
3184 }
3185
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003186 /* Get endpoints */
3187 for (i = 0; i < interface->num_altsetting; i++) {
3188 int ep;
3189
3190 for (ep = 0; ep < interface->altsetting[i].desc.bNumEndpoints; ep++) {
Holger Nelson8ab33622011-12-28 18:55:41 -03003191 const struct usb_endpoint_descriptor *e;
3192 int sizedescr, size;
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003193
Holger Nelson8ab33622011-12-28 18:55:41 -03003194 e = &interface->altsetting[i].endpoint[ep].desc;
3195
3196 sizedescr = le16_to_cpu(e->wMaxPacketSize);
3197 size = sizedescr & 0x7ff;
3198
3199 if (udev->speed == USB_SPEED_HIGH)
3200 size = size * hb_mult(sizedescr);
3201
3202 if (usb_endpoint_xfer_isoc(e) &&
3203 usb_endpoint_dir_in(e)) {
3204 switch (e->bEndpointAddress) {
3205 case EM28XX_EP_AUDIO:
3206 has_audio = true;
3207 break;
3208 case EM28XX_EP_ANALOG:
3209 has_video = true;
3210 dev->alt_max_pkt_size[i] = size;
3211 break;
3212 case EM28XX_EP_DIGITAL:
3213 has_dvb = true;
3214 if (size > dev->dvb_max_pkt_size) {
3215 dev->dvb_max_pkt_size = size;
3216 dev->dvb_alt = i;
3217 }
3218 break;
3219 }
3220 }
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003221 }
3222 }
3223
Holger Nelson8ab33622011-12-28 18:55:41 -03003224 if (!(has_audio || has_video || has_dvb)) {
3225 retval = -ENODEV;
3226 goto err_free;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003227 }
3228
3229 switch (udev->speed) {
3230 case USB_SPEED_LOW:
3231 speed = "1.5";
3232 break;
3233 case USB_SPEED_UNKNOWN:
3234 case USB_SPEED_FULL:
3235 speed = "12";
3236 break;
3237 case USB_SPEED_HIGH:
3238 speed = "480";
3239 break;
3240 default:
3241 speed = "unknown";
3242 }
3243
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003244 printk(KERN_INFO DRIVER_NAME
Ezequiel García401a5822012-03-13 10:27:09 -03003245 ": New device %s %s @ %s Mbps "
3246 "(%04x:%04x, interface %d, class %d)\n",
3247 udev->manufacturer ? udev->manufacturer : "",
3248 udev->product ? udev->product : "",
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003249 speed,
3250 le16_to_cpu(udev->descriptor.idVendor),
3251 le16_to_cpu(udev->descriptor.idProduct),
3252 ifnum,
3253 interface->altsetting->desc.bInterfaceNumber);
3254
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003255 if (has_audio)
3256 printk(KERN_INFO DRIVER_NAME
3257 ": Audio Vendor Class interface %i found\n",
3258 ifnum);
Holger Nelson8ab33622011-12-28 18:55:41 -03003259 if (has_video)
3260 printk(KERN_INFO DRIVER_NAME
3261 ": Video interface %i found\n",
3262 ifnum);
3263 if (has_dvb)
3264 printk(KERN_INFO DRIVER_NAME
3265 ": DVB interface %i found\n",
3266 ifnum);
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003267
Devin Heitmueller64a00b42009-05-27 23:23:37 -03003268 /*
3269 * Make sure we have 480 Mbps of bandwidth, otherwise things like
3270 * video stream wouldn't likely work, since 12 Mbps is generally
3271 * not enough even for most Digital TV streams.
3272 */
Devin Heitmuellere2a1b792009-05-27 23:44:10 -03003273 if (udev->speed != USB_SPEED_HIGH && disable_usb_speed_check == 0) {
Devin Heitmueller64a00b42009-05-27 23:23:37 -03003274 printk(DRIVER_NAME ": Device initialization failed.\n");
3275 printk(DRIVER_NAME ": Device must be connected to a high-speed"
3276 " USB 2.0 port.\n");
Devin Heitmueller64a00b42009-05-27 23:23:37 -03003277 retval = -ENODEV;
Holger Nelson8ab33622011-12-28 18:55:41 -03003278 goto err_free;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003279 }
3280
Chris Rankinf38f3332011-08-20 08:08:34 -03003281 snprintf(dev->name, sizeof(dev->name), "em28xx #%d", nr);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003282 dev->devno = nr;
3283 dev->model = id->driver_info;
3284 dev->alt = -1;
Holger Nelson8ab33622011-12-28 18:55:41 -03003285 dev->is_audio_only = has_audio && !(has_video || has_dvb);
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003286 dev->has_alsa_audio = has_audio;
3287 dev->audio_ifnum = ifnum;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003288
3289 /* Checks if audio is provided by some interface */
3290 for (i = 0; i < udev->config->desc.bNumInterfaces; i++) {
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003291 struct usb_interface *uif = udev->config->interface[i];
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003292 if (uif->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
3293 dev->has_audio_class = 1;
3294 break;
3295 }
3296 }
3297
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003298 dev->num_alt = interface->num_altsetting;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003299
3300 if ((card[nr] >= 0) && (card[nr] < em28xx_bcount))
3301 dev->model = card[nr];
3302
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003303 /* save our data pointer in this interface device */
3304 usb_set_intfdata(interface, dev);
3305
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003306 /* allocate device struct */
3307 mutex_init(&dev->lock);
3308 mutex_lock(&dev->lock);
Thomas Petazzoni622c2fc2012-01-07 10:18:45 -03003309 retval = em28xx_init_dev(dev, udev, interface, nr);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003310 if (retval) {
Holger Nelson8ab33622011-12-28 18:55:41 -03003311 goto unlock_and_free;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003312 }
3313
Gianluca Gennari86d38d12012-02-13 13:59:22 -03003314 if (has_dvb) {
3315 /* pre-allocate DVB isoc transfer buffers */
3316 retval = em28xx_alloc_isoc(dev, EM28XX_DIGITAL_MODE,
3317 EM28XX_DVB_MAX_PACKETS,
3318 EM28XX_DVB_NUM_BUFS,
3319 dev->dvb_max_pkt_size);
3320 if (retval) {
3321 goto unlock_and_free;
3322 }
3323 }
3324
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003325 request_modules(dev);
3326
3327 /* Should be the last thing to do, to avoid newer udev's to
3328 open the device before fully initializing it
3329 */
3330 mutex_unlock(&dev->lock);
3331
3332 return 0;
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003333
Holger Nelson8ab33622011-12-28 18:55:41 -03003334unlock_and_free:
3335 mutex_unlock(&dev->lock);
3336
3337err_free:
3338 kfree(dev->alt_max_pkt_size);
3339 kfree(dev);
3340
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003341err:
Chris Rankin38b61eb2011-08-20 08:21:03 -03003342 clear_bit(nr, &em28xx_devused);
3343
3344err_no_slot:
3345 usb_put_dev(udev);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003346 return retval;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003347}
3348
3349/*
3350 * em28xx_usb_disconnect()
Chris Rankind7222e72011-09-24 11:02:32 -03003351 * called when the device gets disconnected
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003352 * video device will be unregistered on v4l2_close in case it is still open
3353 */
3354static void em28xx_usb_disconnect(struct usb_interface *interface)
3355{
3356 struct em28xx *dev;
3357
3358 dev = usb_get_intfdata(interface);
3359 usb_set_intfdata(interface, NULL);
3360
3361 if (!dev)
3362 return;
3363
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003364 if (dev->is_audio_only) {
3365 mutex_lock(&dev->lock);
3366 em28xx_close_extension(dev);
3367 mutex_unlock(&dev->lock);
3368 return;
3369 }
3370
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003371 em28xx_info("disconnecting %s\n", dev->vdev->name);
3372
Tejun Heo707bcf32010-12-24 16:14:20 +01003373 flush_request_modules(dev);
3374
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003375 /* wait until all current v4l2 io is finished then deallocate
3376 resources */
3377 mutex_lock(&dev->lock);
3378
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003379 v4l2_device_disconnect(&dev->v4l2_dev);
3380
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003381 if (dev->users) {
3382 em28xx_warn
Laurent Pinchart38c7c032009-11-27 13:57:15 -03003383 ("device %s is open! Deregistration and memory "
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003384 "deallocation are deferred on close.\n",
Laurent Pinchart38c7c032009-11-27 13:57:15 -03003385 video_device_node_name(dev->vdev));
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003386
3387 dev->state |= DEV_MISCONFIGURED;
Gianluca Gennari86d38d12012-02-13 13:59:22 -03003388 em28xx_uninit_isoc(dev, dev->mode);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003389 dev->state |= DEV_DISCONNECTED;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003390 } else {
3391 dev->state |= DEV_DISCONNECTED;
3392 em28xx_release_resources(dev);
3393 }
3394
Gianluca Gennari86d38d12012-02-13 13:59:22 -03003395 /* free DVB isoc buffers */
3396 em28xx_uninit_isoc(dev, EM28XX_DIGITAL_MODE);
3397
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003398 mutex_unlock(&dev->lock);
3399
Chris Rankinb868a532011-09-24 16:54:58 -03003400 em28xx_close_extension(dev);
3401
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003402 if (!dev->users) {
3403 kfree(dev->alt_max_pkt_size);
3404 kfree(dev);
3405 }
3406}
3407
3408static struct usb_driver em28xx_usb_driver = {
3409 .name = "em28xx",
3410 .probe = em28xx_usb_probe,
3411 .disconnect = em28xx_usb_disconnect,
3412 .id_table = em28xx_id_table,
3413};
3414
Greg Kroah-Hartmanecb3b2b2011-11-18 09:46:12 -08003415module_usb_driver(em28xx_usb_driver);