blob: e4b0669d49dd783efb5628014ee93ec17891177a [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>
Frank Schaeferc647a912012-11-08 14:11:52 -03009 Copyright (C) 2012 Frank Schäfer <fschaefer.oss@googlemail.com>
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -080010
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 */
25
26#include <linux/init.h>
27#include <linux/module.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090028#include <linux/slab.h>
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -080029#include <linux/delay.h>
30#include <linux/i2c.h>
31#include <linux/usb.h>
32#include <media/tuner.h>
Hans Verkuil2474ed42006-03-19 12:35:57 -030033#include <media/msp3400.h>
Hans Verkuilc7c0b342006-04-02 13:35:00 -030034#include <media/saa7115.h>
35#include <media/tvp5150.h>
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -030036#include <media/tvaudio.h>
37#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>
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -080040
Mauro Carvalho Chehabf7abcd32005-11-08 21:38:25 -080041#include "em28xx.h"
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -080042
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -030043#define DRIVER_NAME "em28xx"
44
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -030045static int tuner = -1;
46module_param(tuner, int, 0444);
47MODULE_PARM_DESC(tuner, "tuner type");
48
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -030049static unsigned int disable_ir;
50module_param(disable_ir, int, 0444);
51MODULE_PARM_DESC(disable_ir, "disable infrared remote support");
52
Devin Heitmuellere2a1b792009-05-27 23:44:10 -030053static unsigned int disable_usb_speed_check;
54module_param(disable_usb_speed_check, int, 0444);
55MODULE_PARM_DESC(disable_usb_speed_check,
56 "override min bandwidth requirement of 480M bps");
57
Devin Heitmuellerd3829fa2013-01-04 16:16:24 -030058static unsigned int card[] = {[0 ... (EM28XX_MAXBOARDS - 1)] = -1U };
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -030059module_param_array(card, int, NULL, 0444);
60MODULE_PARM_DESC(card, "card type");
61
Frank Schaefer7e5d74e2012-12-26 15:12:37 -030062static int usb_xfer_mode = -1;
63module_param(usb_xfer_mode, int, 0444);
64MODULE_PARM_DESC(usb_xfer_mode,
65 "USB transfer mode for frame data (-1 = auto, 0 = prefer isoc, 1 = prefer bulk)");
Frank Schaefer454fe922012-11-08 14:11:53 -030066
67
Chris Rankin38b61eb2011-08-20 08:21:03 -030068/* Bitmask marking allocated devices from 0 to EM28XX_MAXBOARDS - 1 */
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -030069static unsigned long em28xx_devused;
70
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -030071struct em28xx_hash_table {
72 unsigned long hash;
73 unsigned int model;
74 unsigned int tuner;
75};
76
Ezequiel Garcia60332f02012-04-28 09:57:01 -030077static void em28xx_pre_card_setup(struct em28xx *dev);
78
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -030079/*
80 * Reset sequences for analog/digital modes
81 */
82
83/* Reset for the most [analog] boards */
84static struct em28xx_reg_seq default_analog[] = {
85 {EM28XX_R08_GPIO, 0x6d, ~EM_GPIO_4, 10},
86 { -1, -1, -1, -1},
87};
88
89/* Reset for the most [digital] boards */
90static struct em28xx_reg_seq default_digital[] = {
91 {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
92 { -1, -1, -1, -1},
93};
94
95/* Board Hauppauge WinTV HVR 900 analog */
96static struct em28xx_reg_seq hauppauge_wintv_hvr_900_analog[] = {
97 {EM28XX_R08_GPIO, 0x2d, ~EM_GPIO_4, 10},
98 {0x05, 0xff, 0x10, 10},
99 { -1, -1, -1, -1},
100};
101
102/* Board Hauppauge WinTV HVR 900 digital */
103static struct em28xx_reg_seq hauppauge_wintv_hvr_900_digital[] = {
104 {EM28XX_R08_GPIO, 0x2e, ~EM_GPIO_4, 10},
105 {EM2880_R04_GPO, 0x04, 0x0f, 10},
106 {EM2880_R04_GPO, 0x0c, 0x0f, 10},
107 { -1, -1, -1, -1},
108};
109
Devin Heitmueller7030f522011-03-13 02:04:53 -0300110/* Board Hauppauge WinTV HVR 900 (R2) digital */
111static struct em28xx_reg_seq hauppauge_wintv_hvr_900R2_digital[] = {
112 {EM28XX_R08_GPIO, 0x2e, ~EM_GPIO_4, 10},
113 {EM2880_R04_GPO, 0x0c, 0x0f, 10},
114 { -1, -1, -1, -1},
115};
116
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300117/* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
118static struct em28xx_reg_seq em2880_msi_digivox_ad_analog[] = {
119 {EM28XX_R08_GPIO, 0x69, ~EM_GPIO_4, 10},
120 { -1, -1, -1, -1},
121};
122
123/* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300124
125/* Board - EM2870 Kworld 355u
126 Analog - No input analog */
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300127
Franklin Mengd7de5d82009-06-06 17:05:02 -0300128/* Board - EM2882 Kworld 315U digital */
129static struct em28xx_reg_seq em2882_kworld_315u_digital[] = {
130 {EM28XX_R08_GPIO, 0xff, 0xff, 10},
131 {EM28XX_R08_GPIO, 0xfe, 0xff, 10},
132 {EM2880_R04_GPO, 0x04, 0xff, 10},
133 {EM2880_R04_GPO, 0x0c, 0xff, 10},
134 {EM28XX_R08_GPIO, 0x7e, 0xff, 10},
135 { -1, -1, -1, -1},
136};
137
138static struct em28xx_reg_seq em2882_kworld_315u_tuner_gpio[] = {
139 {EM2880_R04_GPO, 0x08, 0xff, 10},
140 {EM2880_R04_GPO, 0x0c, 0xff, 10},
141 {EM2880_R04_GPO, 0x08, 0xff, 10},
142 {EM2880_R04_GPO, 0x0c, 0xff, 10},
143 { -1, -1, -1, -1},
144};
145
Robert Krakora6e7b9ea2009-01-18 21:59:34 -0300146static struct em28xx_reg_seq kworld_330u_analog[] = {
147 {EM28XX_R08_GPIO, 0x6d, ~EM_GPIO_4, 10},
148 {EM2880_R04_GPO, 0x00, 0xff, 10},
149 { -1, -1, -1, -1},
150};
151
152static struct em28xx_reg_seq kworld_330u_digital[] = {
153 {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
154 {EM2880_R04_GPO, 0x08, 0xff, 10},
155 { -1, -1, -1, -1},
156};
157
Devin Heitmueller19859222009-06-19 00:33:54 -0300158/* Evga inDtube
159 GPIO0 - Enable digital power (s5h1409) - low to enable
160 GPIO1 - Enable analog power (tvp5150/emp202) - low to enable
161 GPIO4 - xc3028 reset
162 GOP3 - s5h1409 reset
163 */
164static struct em28xx_reg_seq evga_indtube_analog[] = {
165 {EM28XX_R08_GPIO, 0x79, 0xff, 60},
166 { -1, -1, -1, -1},
167};
168
169static struct em28xx_reg_seq evga_indtube_digital[] = {
170 {EM28XX_R08_GPIO, 0x7a, 0xff, 1},
171 {EM2880_R04_GPO, 0x04, 0xff, 10},
172 {EM2880_R04_GPO, 0x0c, 0xff, 1},
173 { -1, -1, -1, -1},
174};
175
Jarod Wilson7e48b302010-03-07 17:55:43 -0300176/*
177 * KWorld PlusTV 340U and UB435-Q (ATSC) GPIOs map:
178 * EM_GPIO_0 - currently unknown
179 * EM_GPIO_1 - LED disable/enable (1 = off, 0 = on)
180 * EM_GPIO_2 - currently unknown
181 * EM_GPIO_3 - currently unknown
182 * EM_GPIO_4 - TDA18271HD/C1 tuner (1 = active, 0 = in reset)
183 * EM_GPIO_5 - LGDT3304 ATSC/QAM demod (1 = active, 0 = in reset)
184 * EM_GPIO_6 - currently unknown
185 * EM_GPIO_7 - currently unknown
186 */
187static struct em28xx_reg_seq kworld_a340_digital[] = {
188 {EM28XX_R08_GPIO, 0x6d, ~EM_GPIO_4, 10},
189 { -1, -1, -1, -1},
190};
191
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -0300192/* Pinnacle Hybrid Pro eb1a:2881 */
193static struct em28xx_reg_seq pinnacle_hybrid_pro_analog[] = {
Devin Heitmueller44010442009-07-08 22:18:15 -0300194 {EM28XX_R08_GPIO, 0xfd, ~EM_GPIO_4, 10},
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -0300195 { -1, -1, -1, -1},
196};
197
198static struct em28xx_reg_seq pinnacle_hybrid_pro_digital[] = {
199 {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
200 {EM2880_R04_GPO, 0x04, 0xff, 100},/* zl10353 reset */
201 {EM2880_R04_GPO, 0x0c, 0xff, 1},
202 { -1, -1, -1, -1},
203};
204
Michel Garniercec4e6c2010-10-16 14:42:01 -0300205static struct em28xx_reg_seq terratec_cinergy_USB_XS_FR_analog[] = {
206 {EM28XX_R08_GPIO, 0x6d, ~EM_GPIO_4, 10},
207 {EM2880_R04_GPO, 0x00, 0xff, 10},
208 { -1, -1, -1, -1},
209};
210
211static struct em28xx_reg_seq terratec_cinergy_USB_XS_FR_digital[] = {
212 {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
213 {EM2880_R04_GPO, 0x08, 0xff, 10},
214 { -1, -1, -1, -1},
215};
216
Antti Palosaari285eb1a2009-09-15 14:42:13 -0300217/* eb1a:2868 Reddo DVB-C USB TV Box
218 GPIO4 - CU1216L NIM
219 Other GPIOs seems to be don't care. */
220static struct em28xx_reg_seq reddo_dvb_c_usb_box[] = {
221 {EM28XX_R08_GPIO, 0xfe, 0xff, 10},
222 {EM28XX_R08_GPIO, 0xde, 0xff, 10},
223 {EM28XX_R08_GPIO, 0xfe, 0xff, 10},
224 {EM28XX_R08_GPIO, 0xff, 0xff, 10},
225 {EM28XX_R08_GPIO, 0x7f, 0xff, 10},
226 {EM28XX_R08_GPIO, 0x6f, 0xff, 10},
227 {EM28XX_R08_GPIO, 0xff, 0xff, 10},
228 {-1, -1, -1, -1},
229};
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -0300230
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300231/* Callback for the most boards */
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300232static struct em28xx_reg_seq default_tuner_gpio[] = {
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300233 {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10},
234 {EM28XX_R08_GPIO, 0, EM_GPIO_4, 10},
235 {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10},
236 { -1, -1, -1, -1},
237};
238
Vitaly Wool2bd1d9e2009-03-04 08:27:52 -0300239/* Mute/unmute */
240static struct em28xx_reg_seq compro_unmute_tv_gpio[] = {
241 {EM28XX_R08_GPIO, 5, 7, 10},
242 { -1, -1, -1, -1},
243};
244
245static struct em28xx_reg_seq compro_unmute_svid_gpio[] = {
246 {EM28XX_R08_GPIO, 4, 7, 10},
247 { -1, -1, -1, -1},
248};
249
250static struct em28xx_reg_seq compro_mute_gpio[] = {
251 {EM28XX_R08_GPIO, 6, 7, 10},
252 { -1, -1, -1, -1},
253};
254
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -0300255/* Terratec AV350 */
256static struct em28xx_reg_seq terratec_av350_mute_gpio[] = {
257 {EM28XX_R08_GPIO, 0xff, 0x7f, 10},
258 { -1, -1, -1, -1},
259};
260
261static struct em28xx_reg_seq terratec_av350_unmute_gpio[] = {
262 {EM28XX_R08_GPIO, 0xff, 0xff, 10},
263 { -1, -1, -1, -1},
264};
Mauro Carvalho Chehab02e78042009-06-29 11:35:05 -0300265
266static struct em28xx_reg_seq silvercrest_reg_seq[] = {
267 {EM28XX_R08_GPIO, 0xff, 0xff, 10},
268 {EM28XX_R08_GPIO, 0x01, 0xf7, 10},
269 { -1, -1, -1, -1},
270};
271
Mauro Carvalho Chehab694a1012009-11-26 21:26:13 -0300272static struct em28xx_reg_seq vc211a_enable[] = {
273 {EM28XX_R08_GPIO, 0xff, 0x07, 10},
274 {EM28XX_R08_GPIO, 0xff, 0x0f, 10},
275 {EM28XX_R08_GPIO, 0xff, 0x0b, 10},
276 { -1, -1, -1, -1},
277};
278
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -0300279static struct em28xx_reg_seq dikom_dk300_digital[] = {
280 {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
281 {EM2880_R04_GPO, 0x08, 0xff, 10},
282 { -1, -1, -1, -1},
283};
284
Mauro Carvalho Chehab694a1012009-11-26 21:26:13 -0300285
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -0300286/* Reset for the most [digital] boards */
287static struct em28xx_reg_seq leadership_digital[] = {
288 {EM2874_R80_GPIO, 0x70, 0xff, 10},
289 { -1, -1, -1, -1},
290};
291
292static struct em28xx_reg_seq leadership_reset[] = {
293 {EM2874_R80_GPIO, 0xf0, 0xff, 10},
294 {EM2874_R80_GPIO, 0xb0, 0xff, 10},
295 {EM2874_R80_GPIO, 0xf0, 0xff, 10},
296 { -1, -1, -1, -1},
297};
298
Antti Palosaari460312e2011-05-25 17:03:50 -0300299/* 2013:024f PCTV nanoStick T2 290e
Antti Palosaarid6a5f922011-04-07 16:34:44 -0300300 * GPIO_6 - demod reset
301 * GPIO_7 - LED
302 */
303static struct em28xx_reg_seq pctv_290e[] = {
304 {EM2874_R80_GPIO, 0x00, 0xff, 80},
305 {EM2874_R80_GPIO, 0x40, 0xff, 80}, /* GPIO_6 = 1 */
306 {EM2874_R80_GPIO, 0xc0, 0xff, 80}, /* GPIO_7 = 1 */
307 {-1, -1, -1, -1},
308};
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -0300309
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -0300310#if 0
311static struct em28xx_reg_seq terratec_h5_gpio[] = {
312 {EM28XX_R08_GPIO, 0xff, 0xff, 10},
313 {EM2874_R80_GPIO, 0xf6, 0xff, 100},
314 {EM2874_R80_GPIO, 0xf2, 0xff, 50},
315 {EM2874_R80_GPIO, 0xf6, 0xff, 50},
316 { -1, -1, -1, -1},
317};
318
319static struct em28xx_reg_seq terratec_h5_digital[] = {
320 {EM2874_R80_GPIO, 0xf6, 0xff, 10},
321 {EM2874_R80_GPIO, 0xe6, 0xff, 100},
322 {EM2874_R80_GPIO, 0xa6, 0xff, 10},
323 { -1, -1, -1, -1},
324};
325#endif
326
Antti Palosaari36588712011-08-01 01:15:30 -0300327/* 2013:024f PCTV DVB-S2 Stick 460e
328 * GPIO_0 - POWER_ON
329 * GPIO_1 - BOOST
330 * GPIO_2 - VUV_LNB (red LED)
331 * GPIO_3 - EXT_12V
332 * GPIO_4 - INT_DEM (DEMOD GPIO_0)
333 * GPIO_5 - INT_LNB
334 * GPIO_6 - RESET_DEM
335 * GPIO_7 - LED (green LED)
336 */
337static struct em28xx_reg_seq pctv_460e[] = {
338 {EM2874_R80_GPIO, 0x01, 0xff, 50},
339 {0x0d, 0xff, 0xff, 50},
340 {EM2874_R80_GPIO, 0x41, 0xff, 50}, /* GPIO_6=1 */
341 {0x0d, 0x42, 0xff, 50},
342 {EM2874_R80_GPIO, 0x61, 0xff, 50}, /* GPIO_5=1 */
343 { -1, -1, -1, -1},
344};
345
Mauro Carvalho Chehab4159d012013-02-28 10:35:56 -0300346static struct em28xx_reg_seq c3tech_digital_duo_digital[] = {
347 {EM2874_R80_GPIO, 0xff, 0xff, 10},
348 {EM2874_R80_GPIO, 0xfd, 0xff, 10}, /* xc5000 reset */
349 {EM2874_R80_GPIO, 0xf9, 0xff, 35},
350 {EM2874_R80_GPIO, 0xfd, 0xff, 10},
351 {EM2874_R80_GPIO, 0xff, 0xff, 10},
352 {EM2874_R80_GPIO, 0xfe, 0xff, 10},
353 {EM2874_R80_GPIO, 0xbe, 0xff, 10},
354 {EM2874_R80_GPIO, 0xfe, 0xff, 20},
355 { -1, -1, -1, -1},
356};
357
Mauro Carvalho Chehab85032322011-11-24 15:01:45 -0200358#if 0
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -0300359static struct em28xx_reg_seq hauppauge_930c_gpio[] = {
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -0300360 {EM2874_R80_GPIO, 0x6f, 0xff, 10},
Mauro Carvalho Chehabde724052011-11-20 11:23:24 -0200361 {EM2874_R80_GPIO, 0x4f, 0xff, 10}, /* xc5000 reset */
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -0300362 {EM2874_R80_GPIO, 0x6f, 0xff, 10},
363 {EM2874_R80_GPIO, 0x4f, 0xff, 10},
364 { -1, -1, -1, -1},
365};
366
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -0300367static struct em28xx_reg_seq hauppauge_930c_digital[] = {
368 {EM2874_R80_GPIO, 0xf6, 0xff, 10},
369 {EM2874_R80_GPIO, 0xe6, 0xff, 100},
370 {EM2874_R80_GPIO, 0xa6, 0xff, 10},
371 { -1, -1, -1, -1},
372};
373#endif
374
Antti Palosaari35530852012-03-18 18:09:01 -0300375/* 1b80:e425 MaxMedia UB425-TC
Jakob Haufe7c1dfdb2013-04-13 11:03:37 -0300376 * 1b80:e1cc Delock 61959
Antti Palosaari35530852012-03-18 18:09:01 -0300377 * GPIO_6 - demod reset, 0=active
378 * GPIO_7 - LED, 0=active
379 */
380static struct em28xx_reg_seq maxmedia_ub425_tc[] = {
381 {EM2874_R80_GPIO, 0x83, 0xff, 100},
382 {EM2874_R80_GPIO, 0xc3, 0xff, 100}, /* GPIO_6 = 1 */
383 {EM2874_R80_GPIO, 0x43, 0xff, 000}, /* GPIO_7 = 0 */
384 {-1, -1, -1, -1},
385};
386
Ivan Kalvachevfa5527c2012-03-19 20:09:55 -0300387/* 2304:0242 PCTV QuatroStick (510e)
388 * GPIO_2: decoder reset, 0=active
389 * GPIO_4: decoder suspend, 0=active
390 * GPIO_6: demod reset, 0=active
391 * GPIO_7: LED, 1=active
392 */
393static struct em28xx_reg_seq pctv_510e[] = {
394 {EM2874_R80_GPIO, 0x10, 0xff, 100},
395 {EM2874_R80_GPIO, 0x14, 0xff, 100}, /* GPIO_2 = 1 */
396 {EM2874_R80_GPIO, 0x54, 0xff, 050}, /* GPIO_6 = 1 */
397 { -1, -1, -1, -1},
398};
399
Antti Palosaaric247d7b2012-03-19 11:48:19 -0300400/* 2013:0251 PCTV QuatroStick nano (520e)
401 * GPIO_2: decoder reset, 0=active
402 * GPIO_4: decoder suspend, 0=active
403 * GPIO_6: demod reset, 0=active
404 * GPIO_7: LED, 1=active
405 */
406static struct em28xx_reg_seq pctv_520e[] = {
407 {EM2874_R80_GPIO, 0x10, 0xff, 100},
408 {EM2874_R80_GPIO, 0x14, 0xff, 100}, /* GPIO_2 = 1 */
409 {EM2874_R80_GPIO, 0x54, 0xff, 050}, /* GPIO_6 = 1 */
410 {EM2874_R80_GPIO, 0xd4, 0xff, 000}, /* GPIO_7 = 1 */
411 { -1, -1, -1, -1},
412};
413
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300414/*
415 * Board definitions
416 */
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800417struct em28xx_board em28xx_boards[] = {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300418 [EM2750_BOARD_UNKNOWN] = {
Mauro Carvalho Chehab8b220792009-07-12 10:56:21 -0300419 .name = "EM2710/EM2750/EM2751 webcam grabber",
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -0300420 .xclk = EM28XX_XCLK_FREQUENCY_20MHZ,
Mauro Carvalho Chehab8a2e6992009-07-12 10:26:36 -0300421 .tuner_type = TUNER_ABSENT,
422 .is_webcam = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300423 .input = { {
424 .type = EM28XX_VMUX_COMPOSITE1,
425 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300426 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -0300427 .gpio = silvercrest_reg_seq,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300428 } },
429 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800430 [EM2800_BOARD_UNKNOWN] = {
431 .name = "Unknown EM2800 video grabber",
432 .is_em2800 = 1,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800433 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300434 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300435 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300436 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800437 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300438 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300439 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300440 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800441 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300442 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300443 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300444 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800445 },
446 [EM2820_BOARD_UNKNOWN] = {
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300447 .name = "Unknown EM2750/28xx video grabber",
448 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabb04fb662009-07-13 01:28:21 -0300449 .is_webcam = 1, /* To enable sensor probe */
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800450 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300451 [EM2750_BOARD_DLCW_130] = {
452 /* Beijing Huaqi Information Digital Technology Co., Ltd */
453 .name = "Huaqi DLCW-130",
454 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300455 .xclk = EM28XX_XCLK_FREQUENCY_48MHZ,
Mauro Carvalho Chehab8a2e6992009-07-12 10:26:36 -0300456 .tuner_type = TUNER_ABSENT,
457 .is_webcam = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300458 .input = { {
459 .type = EM28XX_VMUX_COMPOSITE1,
460 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300461 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300462 } },
463 },
Markus Rechberger4d17d082006-02-07 06:25:39 -0200464 [EM2820_BOARD_KWORLD_PVRTV2800RF] = {
Markus Rechberger33ccaa32006-02-07 06:25:41 -0200465 .name = "Kworld PVR TV 2800 RF",
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -0300466 .tuner_type = TUNER_TEMIC_PAL,
Markus Rechberger4d17d082006-02-07 06:25:39 -0200467 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300468 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300469 .input = { {
Markus Rechberger4d17d082006-02-07 06:25:39 -0200470 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300471 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300472 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300473 }, {
Markus Rechberger4d17d082006-02-07 06:25:39 -0200474 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300475 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300476 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300477 } },
Markus Rechberger4d17d082006-02-07 06:25:39 -0200478 },
Douglas Schilling Landgraff7fe3e62009-01-19 09:31:55 -0300479 [EM2820_BOARD_GADMEI_TVR200] = {
480 .name = "Gadmei TVR200",
481 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
482 .tda9887_conf = TDA9887_PRESENT,
483 .decoder = EM28XX_SAA711X,
484 .input = { {
485 .type = EM28XX_VMUX_TELEVISION,
486 .vmux = SAA7115_COMPOSITE2,
487 .amux = EM28XX_AMUX_LINE_IN,
488 }, {
489 .type = EM28XX_VMUX_COMPOSITE1,
490 .vmux = SAA7115_COMPOSITE0,
491 .amux = EM28XX_AMUX_LINE_IN,
492 }, {
493 .type = EM28XX_VMUX_SVIDEO,
494 .vmux = SAA7115_SVIDEO3,
495 .amux = EM28XX_AMUX_LINE_IN,
496 } },
497 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800498 [EM2820_BOARD_TERRATEC_CINERGY_250] = {
499 .name = "Terratec Cinergy 250 USB",
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800500 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
Mauro Carvalho Chehabac07bb72009-09-08 14:04:41 -0300501 .has_ir_i2c = 1,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800502 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300503 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300504 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800505 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300506 .vmux = SAA7115_COMPOSITE2,
Frank Schaefer5e8d02b2013-01-05 08:44:09 -0300507 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300508 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800509 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300510 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300511 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300512 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800513 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300514 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300515 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300516 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800517 },
518 [EM2820_BOARD_PINNACLE_USB_2] = {
519 .name = "Pinnacle PCTV USB 2",
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800520 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
Mauro Carvalho Chehabac07bb72009-09-08 14:04:41 -0300521 .has_ir_i2c = 1,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800522 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300523 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300524 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800525 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300526 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300527 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300528 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800529 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300530 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300531 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300532 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800533 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300534 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300535 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300536 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800537 },
538 [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2] = {
539 .name = "Hauppauge WinTV USB 2",
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800540 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300541 .tda9887_conf = TDA9887_PRESENT |
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -0300542 TDA9887_PORT1_ACTIVE |
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300543 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800544 .decoder = EM28XX_TVP5150,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800545 .has_msp34xx = 1,
Mauro Carvalho Chehabac07bb72009-09-08 14:04:41 -0300546 .has_ir_i2c = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300547 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800548 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300549 .vmux = TVP5150_COMPOSITE0,
Hans Verkuil2474ed42006-03-19 12:35:57 -0300550 .amux = MSP_INPUT_DEFAULT,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300551 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800552 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300553 .vmux = TVP5150_SVIDEO,
Hans Verkuil07151722006-04-01 18:03:23 -0300554 .amux = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1,
555 MSP_DSP_IN_SCART, MSP_DSP_IN_SCART),
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300556 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800557 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300558 [EM2820_BOARD_DLINK_USB_TV] = {
559 .name = "D-Link DUB-T210 TV Tuner",
560 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300561 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
562 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300563 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300564 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300565 .type = EM28XX_VMUX_TELEVISION,
566 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300567 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300568 }, {
569 .type = EM28XX_VMUX_COMPOSITE1,
570 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300571 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300572 }, {
573 .type = EM28XX_VMUX_SVIDEO,
574 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300575 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300576 } },
577 },
578 [EM2820_BOARD_HERCULES_SMART_TV_USB2] = {
579 .name = "Hercules Smart TV USB 2.0",
580 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300581 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
582 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300583 .decoder = EM28XX_SAA711X,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300584 .input = { {
585 .type = EM28XX_VMUX_TELEVISION,
586 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300587 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300588 }, {
589 .type = EM28XX_VMUX_COMPOSITE1,
590 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300591 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300592 }, {
593 .type = EM28XX_VMUX_SVIDEO,
594 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300595 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300596 } },
597 },
598 [EM2820_BOARD_PINNACLE_USB_2_FM1216ME] = {
599 .name = "Pinnacle PCTV USB 2 (Philips FM1216ME)",
600 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300601 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
602 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300603 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300604 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300605 .type = EM28XX_VMUX_TELEVISION,
606 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300607 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300608 }, {
609 .type = EM28XX_VMUX_COMPOSITE1,
610 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300611 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300612 }, {
613 .type = EM28XX_VMUX_SVIDEO,
614 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300615 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300616 } },
617 },
618 [EM2820_BOARD_GADMEI_UTV310] = {
619 .name = "Gadmei UTV310",
620 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300621 .tuner_type = TUNER_TNF_5335MF,
622 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300623 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300624 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300625 .type = EM28XX_VMUX_TELEVISION,
626 .vmux = SAA7115_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300627 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300628 }, {
629 .type = EM28XX_VMUX_COMPOSITE1,
630 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300631 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300632 }, {
633 .type = EM28XX_VMUX_SVIDEO,
634 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300635 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300636 } },
637 },
638 [EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE] = {
639 .name = "Leadtek Winfast USB II Deluxe",
640 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300641 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
Magnus Almca39d842009-11-13 05:48:24 -0300642 .has_ir_i2c = 1,
643 .tvaudio_addr = 0x58,
644 .tda9887_conf = TDA9887_PRESENT |
645 TDA9887_PORT2_ACTIVE |
646 TDA9887_QSS,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300647 .decoder = EM28XX_SAA711X,
Magnus Almca39d842009-11-13 05:48:24 -0300648 .adecoder = EM28XX_TVAUDIO,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300649 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300650 .type = EM28XX_VMUX_TELEVISION,
Magnus Almca39d842009-11-13 05:48:24 -0300651 .vmux = SAA7115_COMPOSITE4,
652 .amux = EM28XX_AMUX_AUX,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300653 }, {
654 .type = EM28XX_VMUX_COMPOSITE1,
Magnus Almca39d842009-11-13 05:48:24 -0300655 .vmux = SAA7115_COMPOSITE5,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300656 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300657 }, {
658 .type = EM28XX_VMUX_SVIDEO,
Magnus Almca39d842009-11-13 05:48:24 -0300659 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300660 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300661 } },
Magnus Almca39d842009-11-13 05:48:24 -0300662 .radio = {
663 .type = EM28XX_RADIO,
664 .amux = EM28XX_AMUX_AUX,
665 }
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300666 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300667 [EM2820_BOARD_VIDEOLOGY_20K14XUSB] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300668 .name = "Videology 20K14XUSB USB2.0",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300669 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehab8a2e6992009-07-12 10:26:36 -0300670 .tuner_type = TUNER_ABSENT,
671 .is_webcam = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300672 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300673 .type = EM28XX_VMUX_COMPOSITE1,
674 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300675 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300676 } },
677 },
Mauro Carvalho Chehab02e78042009-06-29 11:35:05 -0300678 [EM2820_BOARD_SILVERCREST_WEBCAM] = {
679 .name = "Silvercrest Webcam 1.3mpix",
680 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabc43221d2009-07-12 10:23:23 -0300681 .is_webcam = 1,
Mauro Carvalho Chehab02e78042009-06-29 11:35:05 -0300682 .input = { {
683 .type = EM28XX_VMUX_COMPOSITE1,
684 .vmux = 0,
685 .amux = EM28XX_AMUX_VIDEO,
686 .gpio = silvercrest_reg_seq,
687 } },
688 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300689 [EM2821_BOARD_SUPERCOMP_USB_2] = {
690 .name = "Supercomp USB 2.0 TV",
691 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300692 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
693 .tda9887_conf = TDA9887_PRESENT |
694 TDA9887_PORT1_ACTIVE |
695 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300696 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300697 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300698 .type = EM28XX_VMUX_TELEVISION,
699 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300700 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300701 }, {
702 .type = EM28XX_VMUX_COMPOSITE1,
703 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300704 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300705 }, {
706 .type = EM28XX_VMUX_SVIDEO,
707 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300708 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300709 } },
710 },
711 [EM2821_BOARD_USBGEAR_VD204] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300712 .name = "Usbgear VD204v9",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300713 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300714 .tuner_type = TUNER_ABSENT, /* Capture only device */
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300715 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300716 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300717 .type = EM28XX_VMUX_COMPOSITE1,
718 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300719 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300720 }, {
721 .type = EM28XX_VMUX_SVIDEO,
722 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300723 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300724 } },
725 },
726 [EM2860_BOARD_NETGMBH_CAM] = {
727 /* Beijing Huaqi Information Digital Technology Co., Ltd */
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300728 .name = "NetGMBH Cam",
729 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehab8a2e6992009-07-12 10:26:36 -0300730 .tuner_type = TUNER_ABSENT,
731 .is_webcam = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300732 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300733 .type = EM28XX_VMUX_COMPOSITE1,
734 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300735 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300736 } },
737 },
738 [EM2860_BOARD_TYPHOON_DVD_MAKER] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300739 .name = "Typhoon DVD Maker",
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300740 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300741 .tuner_type = TUNER_ABSENT, /* Capture only device */
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300742 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300743 .type = EM28XX_VMUX_COMPOSITE1,
744 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300745 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300746 }, {
747 .type = EM28XX_VMUX_SVIDEO,
748 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300749 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300750 } },
751 },
752 [EM2860_BOARD_GADMEI_UTV330] = {
753 .name = "Gadmei UTV330",
754 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300755 .tuner_type = TUNER_TNF_5335MF,
756 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300757 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300758 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300759 .type = EM28XX_VMUX_TELEVISION,
760 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300761 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300762 }, {
763 .type = EM28XX_VMUX_COMPOSITE1,
764 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300765 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300766 }, {
767 .type = EM28XX_VMUX_SVIDEO,
768 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300769 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300770 } },
771 },
Mauro Carvalho Chehab6d888a62009-08-30 13:05:56 -0300772 [EM2861_BOARD_GADMEI_UTV330PLUS] = {
773 .name = "Gadmei UTV330+",
774 .tuner_type = TUNER_TNF_5335MF,
775 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -0300776 .ir_codes = RC_MAP_GADMEI_RM008Z,
Mauro Carvalho Chehab6d888a62009-08-30 13:05:56 -0300777 .decoder = EM28XX_SAA711X,
778 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
779 .input = { {
780 .type = EM28XX_VMUX_TELEVISION,
781 .vmux = SAA7115_COMPOSITE2,
782 .amux = EM28XX_AMUX_VIDEO,
783 }, {
784 .type = EM28XX_VMUX_COMPOSITE1,
785 .vmux = SAA7115_COMPOSITE0,
786 .amux = EM28XX_AMUX_LINE_IN,
787 }, {
788 .type = EM28XX_VMUX_SVIDEO,
789 .vmux = SAA7115_SVIDEO3,
790 .amux = EM28XX_AMUX_LINE_IN,
791 } },
792 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300793 [EM2860_BOARD_TERRATEC_HYBRID_XS] = {
794 .name = "Terratec Cinergy A Hybrid XS",
795 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300796 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300797 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300798 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300799
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300800 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300801 .type = EM28XX_VMUX_TELEVISION,
802 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300803 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300804 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300805 }, {
806 .type = EM28XX_VMUX_COMPOSITE1,
807 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300808 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300809 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300810 }, {
811 .type = EM28XX_VMUX_SVIDEO,
812 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300813 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300814 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300815 } },
816 },
817 [EM2861_BOARD_KWORLD_PVRTV_300U] = {
818 .name = "KWorld PVRTV 300U",
819 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300820 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300821 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300822 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300823 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300824 .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 },
837 [EM2861_BOARD_YAKUMO_MOVIE_MIXER] = {
838 .name = "Yakumo MovieMixer",
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -0300839 .tuner_type = TUNER_ABSENT, /* Capture only device */
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300840 .decoder = EM28XX_TVP5150,
841 .input = { {
842 .type = EM28XX_VMUX_TELEVISION,
843 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300844 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300845 }, {
846 .type = EM28XX_VMUX_COMPOSITE1,
847 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300848 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300849 }, {
850 .type = EM28XX_VMUX_SVIDEO,
851 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300852 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300853 } },
854 },
Devin Heitmueller443fed92010-03-19 23:53:12 -0300855 [EM2860_BOARD_TVP5150_REFERENCE_DESIGN] = {
856 .name = "EM2860/TVP5150 Reference Design",
857 .tuner_type = TUNER_ABSENT, /* Capture only device */
858 .decoder = EM28XX_TVP5150,
859 .input = { {
860 .type = EM28XX_VMUX_COMPOSITE1,
861 .vmux = TVP5150_COMPOSITE1,
862 .amux = EM28XX_AMUX_LINE_IN,
863 }, {
864 .type = EM28XX_VMUX_SVIDEO,
865 .vmux = TVP5150_SVIDEO,
866 .amux = EM28XX_AMUX_LINE_IN,
867 } },
868 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300869 [EM2861_BOARD_PLEXTOR_PX_TV100U] = {
870 .name = "Plextor ConvertX PX-TV100U",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300871 .tuner_type = TUNER_TNF_5335MF,
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -0300872 .xclk = EM28XX_XCLK_I2S_MSB_TIMING |
873 EM28XX_XCLK_FREQUENCY_12MHZ,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300874 .tda9887_conf = TDA9887_PRESENT,
875 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -0300876 .has_msp34xx = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300877 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300878 .type = EM28XX_VMUX_TELEVISION,
879 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300880 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -0300881 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300882 }, {
883 .type = EM28XX_VMUX_COMPOSITE1,
884 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300885 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -0300886 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300887 }, {
888 .type = EM28XX_VMUX_SVIDEO,
889 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300890 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -0300891 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300892 } },
893 },
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300894
895 /* Those boards with em2870 are DVB Only*/
896
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300897 [EM2870_BOARD_TERRATEC_XS] = {
898 .name = "Terratec Cinergy T XS",
899 .valid = EM28XX_BOARD_NOT_VALIDATED,
900 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300901 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300902 },
903 [EM2870_BOARD_TERRATEC_XS_MT2060] = {
904 .name = "Terratec Cinergy T XS (MT2060)",
905 .valid = EM28XX_BOARD_NOT_VALIDATED,
906 .tuner_type = TUNER_ABSENT, /* MT2060 */
907 },
908 [EM2870_BOARD_KWORLD_350U] = {
909 .name = "Kworld 350 U DVB-T",
910 .valid = EM28XX_BOARD_NOT_VALIDATED,
911 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300912 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300913 },
914 [EM2870_BOARD_KWORLD_355U] = {
915 .name = "Kworld 355 U DVB-T",
916 .valid = EM28XX_BOARD_NOT_VALIDATED,
Aivar Päkk1985f6f2011-12-11 18:15:00 -0300917 .tuner_type = TUNER_ABSENT,
918 .tuner_gpio = default_tuner_gpio,
919 .has_dvb = 1,
920 .dvb_gpio = default_digital,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300921 },
922 [EM2870_BOARD_PINNACLE_PCTV_DVB] = {
923 .name = "Pinnacle PCTV DVB-T",
924 .valid = EM28XX_BOARD_NOT_VALIDATED,
925 .tuner_type = TUNER_ABSENT, /* MT2060 */
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300926 /* djh - I have serious doubts this is right... */
927 .xclk = EM28XX_XCLK_IR_RC5_MODE |
928 EM28XX_XCLK_FREQUENCY_10MHZ,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300929 },
930 [EM2870_BOARD_COMPRO_VIDEOMATE] = {
931 .name = "Compro, VideoMate U3",
932 .valid = EM28XX_BOARD_NOT_VALIDATED,
933 .tuner_type = TUNER_ABSENT, /* MT2060 */
934 },
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300935
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300936 [EM2880_BOARD_TERRATEC_HYBRID_XS_FR] = {
937 .name = "Terratec Hybrid XS Secam",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300938 .has_msp34xx = 1,
939 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300940 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300941 .decoder = EM28XX_TVP5150,
Catimimi65638012010-02-18 18:06:32 -0300942 .has_dvb = 1,
Michel Garniercec4e6c2010-10-16 14:42:01 -0300943 .dvb_gpio = terratec_cinergy_USB_XS_FR_digital,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300944 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300945 .type = EM28XX_VMUX_TELEVISION,
946 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300947 .amux = EM28XX_AMUX_VIDEO,
Michel Garniercec4e6c2010-10-16 14:42:01 -0300948 .gpio = terratec_cinergy_USB_XS_FR_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300949 }, {
950 .type = EM28XX_VMUX_COMPOSITE1,
951 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300952 .amux = EM28XX_AMUX_LINE_IN,
Michel Garniercec4e6c2010-10-16 14:42:01 -0300953 .gpio = terratec_cinergy_USB_XS_FR_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300954 }, {
955 .type = EM28XX_VMUX_SVIDEO,
956 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300957 .amux = EM28XX_AMUX_LINE_IN,
Michel Garniercec4e6c2010-10-16 14:42:01 -0300958 .gpio = terratec_cinergy_USB_XS_FR_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300959 } },
960 },
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -0300961 [EM2884_BOARD_TERRATEC_H5] = {
962 .name = "Terratec Cinergy H5",
963 .has_dvb = 1,
964#if 0
965 .tuner_type = TUNER_PHILIPS_TDA8290,
966 .tuner_addr = 0x41,
967 .dvb_gpio = terratec_h5_digital, /* FIXME: probably wrong */
968 .tuner_gpio = terratec_h5_gpio,
Mauro Carvalho Chehabde724052011-11-20 11:23:24 -0200969#else
970 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -0300971#endif
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -0300972 .def_i2c_bus = 1,
973 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -0300974 EM28XX_I2C_FREQ_400_KHZ,
975 },
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -0300976 [EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C] = {
977 .name = "Hauppauge WinTV HVR 930C",
978 .has_dvb = 1,
Mauro Carvalho Chehabde724052011-11-20 11:23:24 -0200979#if 0 /* FIXME: Add analog support */
980 .tuner_type = TUNER_XC5000,
981 .tuner_addr = 0x41,
982 .dvb_gpio = hauppauge_930c_digital,
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -0300983 .tuner_gpio = hauppauge_930c_gpio,
Mauro Carvalho Chehabde724052011-11-20 11:23:24 -0200984#else
985 .tuner_type = TUNER_ABSENT,
986#endif
Mauro Carvalho Chehabdfbbf5d2011-11-20 12:16:25 -0200987 .ir_codes = RC_MAP_HAUPPAUGE,
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -0300988 .def_i2c_bus = 1,
989 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -0300990 EM28XX_I2C_FREQ_400_KHZ,
991 },
Mauro Carvalho Chehab4159d012013-02-28 10:35:56 -0300992 [EM2884_BOARD_C3TECH_DIGITAL_DUO] = {
993 .name = "C3 Tech Digital Duo HDTV/SDTV USB",
994 .has_dvb = 1,
995 /* FIXME: Add analog support - need a saa7136 driver */
996 .tuner_type = TUNER_ABSENT, /* Digital-only TDA18271HD */
997 .ir_codes = RC_MAP_EMPTY,
998 .def_i2c_bus = 1,
999 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE,
1000 .dvb_gpio = c3tech_digital_duo_digital,
1001 },
Andreas Oberrittera1ed02e2011-11-16 11:06:50 -03001002 [EM2884_BOARD_CINERGY_HTC_STICK] = {
1003 .name = "Terratec Cinergy HTC Stick",
1004 .has_dvb = 1,
Martin Blumenstinglc8dce002012-06-12 18:19:28 -03001005 .ir_codes = RC_MAP_NEC_TERRATEC_CINERGY_XS,
1006 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -03001007 .def_i2c_bus = 1,
1008 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001009 EM28XX_I2C_FREQ_400_KHZ,
1010 },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001011 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900] = {
Aidan Thornton122d1582007-11-20 15:25:08 -03001012 .name = "Hauppauge WinTV HVR 900",
Aidan Thornton122d1582007-11-20 15:25:08 -03001013 .tda9887_conf = TDA9887_PRESENT,
1014 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001015 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab5add9a62007-11-22 12:08:53 -03001016 .mts_firmware = 1,
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03001017 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001018 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehabaf86ce72011-01-24 12:18:48 -03001019 .ir_codes = RC_MAP_HAUPPAUGE,
Aidan Thornton122d1582007-11-20 15:25:08 -03001020 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001021 .input = { {
Aidan Thornton122d1582007-11-20 15:25:08 -03001022 .type = EM28XX_VMUX_TELEVISION,
1023 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001024 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001025 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001026 }, {
Aidan Thornton122d1582007-11-20 15:25:08 -03001027 .type = EM28XX_VMUX_COMPOSITE1,
1028 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001029 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001030 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001031 }, {
Aidan Thornton122d1582007-11-20 15:25:08 -03001032 .type = EM28XX_VMUX_SVIDEO,
1033 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001034 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001035 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001036 } },
Aidan Thornton122d1582007-11-20 15:25:08 -03001037 },
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001038 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2] = {
1039 .name = "Hauppauge WinTV HVR 900 (R2)",
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001040 .tda9887_conf = TDA9887_PRESENT,
1041 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001042 .tuner_gpio = default_tuner_gpio,
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001043 .mts_firmware = 1,
Devin Heitmueller75e2b862011-03-13 02:01:02 -03001044 .has_dvb = 1,
Devin Heitmueller7030f522011-03-13 02:04:53 -03001045 .dvb_gpio = hauppauge_wintv_hvr_900R2_digital,
Mauro Carvalho Chehabaf86ce72011-01-24 12:18:48 -03001046 .ir_codes = RC_MAP_HAUPPAUGE,
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001047 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001048 .input = { {
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001049 .type = EM28XX_VMUX_TELEVISION,
1050 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001051 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001052 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001053 }, {
1054 .type = EM28XX_VMUX_COMPOSITE1,
1055 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehaba5942b52008-11-27 07:44:00 -03001056 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001057 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001058 }, {
1059 .type = EM28XX_VMUX_SVIDEO,
1060 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001061 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001062 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001063 } },
1064 },
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03001065 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850] = {
1066 .name = "Hauppauge WinTV HVR 850",
1067 .tuner_type = TUNER_XC2028,
1068 .tuner_gpio = default_tuner_gpio,
1069 .mts_firmware = 1,
1070 .has_dvb = 1,
1071 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehabaf86ce72011-01-24 12:18:48 -03001072 .ir_codes = RC_MAP_HAUPPAUGE,
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03001073 .decoder = EM28XX_TVP5150,
1074 .input = { {
1075 .type = EM28XX_VMUX_TELEVISION,
1076 .vmux = TVP5150_COMPOSITE0,
1077 .amux = EM28XX_AMUX_VIDEO,
1078 .gpio = hauppauge_wintv_hvr_900_analog,
1079 }, {
1080 .type = EM28XX_VMUX_COMPOSITE1,
1081 .vmux = TVP5150_COMPOSITE1,
1082 .amux = EM28XX_AMUX_LINE_IN,
1083 .gpio = hauppauge_wintv_hvr_900_analog,
1084 }, {
1085 .type = EM28XX_VMUX_SVIDEO,
1086 .vmux = TVP5150_SVIDEO,
1087 .amux = EM28XX_AMUX_LINE_IN,
1088 .gpio = hauppauge_wintv_hvr_900_analog,
1089 } },
1090 },
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001091 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950] = {
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -03001092 .name = "Hauppauge WinTV HVR 950",
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -03001093 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001094 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -03001095 .mts_firmware = 1,
Mauro Carvalho Chehab227ad4a2008-04-17 21:37:40 -03001096 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001097 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehab15195d32011-01-24 12:18:47 -03001098 .ir_codes = RC_MAP_HAUPPAUGE,
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -03001099 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001100 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001101 .type = EM28XX_VMUX_TELEVISION,
1102 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001103 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001104 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001105 }, {
Mauro Carvalho Chehab7d070e22007-11-01 21:52:58 -03001106 .type = EM28XX_VMUX_COMPOSITE1,
1107 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001108 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001109 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001110 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001111 .type = EM28XX_VMUX_SVIDEO,
1112 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001113 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001114 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001115 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001116 },
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001117 [EM2880_BOARD_PINNACLE_PCTV_HD_PRO] = {
1118 .name = "Pinnacle PCTV HD Pro Stick",
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001119 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001120 .tuner_gpio = default_tuner_gpio,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001121 .mts_firmware = 1,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001122 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001123 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001124 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001125 .decoder = EM28XX_TVP5150,
1126 .input = { {
1127 .type = EM28XX_VMUX_TELEVISION,
1128 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001129 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001130 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001131 }, {
1132 .type = EM28XX_VMUX_COMPOSITE1,
1133 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001134 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001135 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001136 }, {
1137 .type = EM28XX_VMUX_SVIDEO,
1138 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001139 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001140 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001141 } },
1142 },
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001143 [EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600] = {
1144 .name = "AMD ATI TV Wonder HD 600",
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001145 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001146 .tuner_gpio = default_tuner_gpio,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001147 .mts_firmware = 1,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001148 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001149 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001150 .ir_codes = RC_MAP_ATI_TV_WONDER_HD_600,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001151 .decoder = EM28XX_TVP5150,
1152 .input = { {
1153 .type = EM28XX_VMUX_TELEVISION,
1154 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001155 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001156 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001157 }, {
1158 .type = EM28XX_VMUX_COMPOSITE1,
1159 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001160 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001161 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001162 }, {
1163 .type = EM28XX_VMUX_SVIDEO,
1164 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001165 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001166 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001167 } },
1168 },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001169 [EM2880_BOARD_TERRATEC_HYBRID_XS] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001170 .name = "Terratec Hybrid XS",
1171 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001172 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001173 .decoder = EM28XX_TVP5150,
reinhard schwab655b8402008-07-26 10:47:00 -03001174 .has_dvb = 1,
Devin Heitmuellerf7976082009-06-22 22:32:32 -03001175 .dvb_gpio = default_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001176 .ir_codes = RC_MAP_TERRATEC_CINERGY_XS,
Devin Heitmueller8cd9aae2009-08-03 23:56:51 -03001177 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001178 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001179 .type = EM28XX_VMUX_TELEVISION,
1180 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001181 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001182 .gpio = default_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001183 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001184 .type = EM28XX_VMUX_COMPOSITE1,
1185 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001186 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001187 .gpio = default_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001188 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001189 .type = EM28XX_VMUX_SVIDEO,
1190 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001191 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001192 .gpio = default_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001193 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001194 },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001195 /* maybe there's a reason behind it why Terratec sells the Hybrid XS
1196 as Prodigy XS with a different PID, let's keep it separated for now
1197 maybe we'll need it lateron */
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001198 [EM2880_BOARD_TERRATEC_PRODIGY_XS] = {
1199 .name = "Terratec Prodigy XS",
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001200 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001201 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001202 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001203 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001204 .type = EM28XX_VMUX_TELEVISION,
1205 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001206 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001207 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001208 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001209 .type = EM28XX_VMUX_COMPOSITE1,
1210 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001211 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001212 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001213 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001214 .type = EM28XX_VMUX_SVIDEO,
1215 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001216 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001217 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001218 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001219 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001220 [EM2820_BOARD_MSI_VOX_USB_2] = {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001221 .name = "MSI VOX USB 2.0",
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001222 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1223 .tda9887_conf = TDA9887_PRESENT |
1224 TDA9887_PORT1_ACTIVE |
1225 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001226 .max_range_640_480 = 1,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001227 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001228 .input = { {
1229 .type = EM28XX_VMUX_TELEVISION,
1230 .vmux = SAA7115_COMPOSITE4,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001231 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001232 }, {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001233 .type = EM28XX_VMUX_COMPOSITE1,
1234 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001235 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001236 }, {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001237 .type = EM28XX_VMUX_SVIDEO,
1238 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001239 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001240 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001241 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001242 [EM2800_BOARD_TERRATEC_CINERGY_200] = {
1243 .name = "Terratec Cinergy 200 USB",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001244 .is_em2800 = 1,
Mauro Carvalho Chehabac07bb72009-09-08 14:04:41 -03001245 .has_ir_i2c = 1,
Sascha Sommer53b667e2012-01-08 16:41:22 -03001246 .tuner_type = TUNER_LG_TALN,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001247 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001248 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001249 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001250 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001251 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001252 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001253 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001254 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001255 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001256 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001257 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001258 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001259 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001260 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001261 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001262 },
Aron Szabo59d07f12008-07-27 13:47:52 -03001263 [EM2800_BOARD_GRABBEEX_USB2800] = {
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03001264 .name = "eMPIA Technology, Inc. GrabBeeX+ Video Encoder",
1265 .is_em2800 = 1,
1266 .decoder = EM28XX_SAA711X,
1267 .tuner_type = TUNER_ABSENT, /* capture only board */
1268 .input = { {
Aron Szabo59d07f12008-07-27 13:47:52 -03001269 .type = EM28XX_VMUX_COMPOSITE1,
1270 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001271 .amux = EM28XX_AMUX_LINE_IN,
Aron Szabo59d07f12008-07-27 13:47:52 -03001272 }, {
1273 .type = EM28XX_VMUX_SVIDEO,
1274 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001275 .amux = EM28XX_AMUX_LINE_IN,
Aron Szabo59d07f12008-07-27 13:47:52 -03001276 } },
1277 },
Mauro Carvalho Chehab694a1012009-11-26 21:26:13 -03001278 [EM2800_BOARD_VC211A] = {
1279 .name = "Actionmaster/LinXcel/Digitus VC211A",
1280 .is_em2800 = 1,
1281 .tuner_type = TUNER_ABSENT, /* Capture-only board */
1282 .decoder = EM28XX_SAA711X,
1283 .input = { {
1284 .type = EM28XX_VMUX_COMPOSITE1,
1285 .vmux = SAA7115_COMPOSITE0,
1286 .amux = EM28XX_AMUX_LINE_IN,
1287 .gpio = vc211a_enable,
1288 }, {
1289 .type = EM28XX_VMUX_SVIDEO,
1290 .vmux = SAA7115_SVIDEO3,
1291 .amux = EM28XX_AMUX_LINE_IN,
1292 .gpio = vc211a_enable,
1293 } },
1294 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001295 [EM2800_BOARD_LEADTEK_WINFAST_USBII] = {
1296 .name = "Leadtek Winfast USB II",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001297 .is_em2800 = 1,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001298 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1299 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001300 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001301 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001302 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001303 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001304 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001305 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001306 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001307 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001308 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001309 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001310 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001311 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001312 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001313 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001314 },
1315 [EM2800_BOARD_KWORLD_USB2800] = {
1316 .name = "Kworld USB2800",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001317 .is_em2800 = 1,
Michael Krufkyab8b8702008-04-22 14:46:05 -03001318 .tuner_type = TUNER_PHILIPS_FCV1236D,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001319 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001320 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001321 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001322 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001323 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001324 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001325 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001326 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001327 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001328 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001329 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001330 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001331 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001332 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001333 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001334 },
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -08001335 [EM2820_BOARD_PINNACLE_DVC_90] = {
Douglas Schilling Landgrafea476892009-09-06 18:41:59 -03001336 .name = "Pinnacle Dazzle DVC 90/100/101/107 / Kaiser Baas Video to DVD maker "
Don Kramer74e07f32012-01-02 16:15:44 -03001337 "/ Kworld DVD Maker 2 / Plextor ConvertX PX-AV100U",
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -03001338 .tuner_type = TUNER_ABSENT, /* capture only board */
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001339 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001340 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001341 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001342 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001343 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001344 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001345 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001346 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001347 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001348 } },
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -08001349 },
Sascha Sommer43625592007-11-03 15:05:07 -03001350 [EM2800_BOARD_VGEAR_POCKETTV] = {
1351 .name = "V-Gear PocketTV",
1352 .is_em2800 = 1,
Sascha Sommer43625592007-11-03 15:05:07 -03001353 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1354 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001355 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001356 .input = { {
Sascha Sommer43625592007-11-03 15:05:07 -03001357 .type = EM28XX_VMUX_TELEVISION,
1358 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001359 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001360 }, {
Sascha Sommer43625592007-11-03 15:05:07 -03001361 .type = EM28XX_VMUX_COMPOSITE1,
1362 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001363 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001364 }, {
Sascha Sommer43625592007-11-03 15:05:07 -03001365 .type = EM28XX_VMUX_SVIDEO,
1366 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001367 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001368 } },
Sascha Sommer43625592007-11-03 15:05:07 -03001369 },
Douglas Schilling Landgraf1e1addd2008-12-27 21:38:14 -03001370 [EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2] = {
1371 .name = "Pixelview PlayTV Box 4 USB 2.0",
1372 .tda9887_conf = TDA9887_PRESENT,
1373 .tuner_type = TUNER_YMEC_TVF_5533MF,
1374 .decoder = EM28XX_SAA711X,
1375 .input = { {
1376 .type = EM28XX_VMUX_TELEVISION,
1377 .vmux = SAA7115_COMPOSITE2,
1378 .amux = EM28XX_AMUX_VIDEO,
1379 .aout = EM28XX_AOUT_MONO | /* I2S */
1380 EM28XX_AOUT_MASTER, /* Line out pin */
1381 }, {
1382 .type = EM28XX_VMUX_COMPOSITE1,
1383 .vmux = SAA7115_COMPOSITE0,
1384 .amux = EM28XX_AMUX_LINE_IN,
1385 }, {
1386 .type = EM28XX_VMUX_SVIDEO,
1387 .vmux = SAA7115_SVIDEO3,
1388 .amux = EM28XX_AMUX_LINE_IN,
1389 } },
1390 },
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001391 [EM2820_BOARD_PROLINK_PLAYTV_USB2] = {
Douglas Schilling Landgraf1f372a92009-02-25 16:54:31 -03001392 .name = "SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0",
Douglas Schilling Landgraf5609cfd2008-12-27 21:39:35 -03001393 .has_snapshot_button = 1,
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001394 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03001395 .tuner_type = TUNER_YMEC_TVF_5533MF,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001396 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001397 .input = { {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001398 .type = EM28XX_VMUX_TELEVISION,
1399 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab30e4ac72008-11-20 13:43:05 -03001400 .amux = EM28XX_AMUX_VIDEO,
1401 .aout = EM28XX_AOUT_MONO | /* I2S */
1402 EM28XX_AOUT_MASTER, /* Line out pin */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001403 }, {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001404 .type = EM28XX_VMUX_COMPOSITE1,
1405 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab7463dda2008-02-05 22:29:26 -03001406 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001407 }, {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001408 .type = EM28XX_VMUX_SVIDEO,
1409 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab7463dda2008-02-05 22:29:26 -03001410 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001411 } },
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001412 },
Devin Heitmueller3ed58ba2009-05-27 23:27:26 -03001413 [EM2860_BOARD_SAA711X_REFERENCE_DESIGN] = {
1414 .name = "EM2860/SAA711X Reference Design",
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001415 .has_snapshot_button = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001416 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001417 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001418 .input = { {
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001419 .type = EM28XX_VMUX_SVIDEO,
1420 .vmux = SAA7115_SVIDEO3,
Devin Heitmueller3ed58ba2009-05-27 23:27:26 -03001421 }, {
1422 .type = EM28XX_VMUX_COMPOSITE1,
1423 .vmux = SAA7115_COMPOSITE0,
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001424 } },
1425 },
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03001426
Mauro Carvalho Chehabebaefdb2011-06-01 10:16:25 -03001427 [EM2874_BOARD_LEADERSHIP_ISDBT] = {
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -03001428 .def_i2c_bus = 1,
1429 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03001430 EM28XX_I2C_FREQ_100_KHZ,
1431 .xclk = EM28XX_XCLK_FREQUENCY_10MHZ,
1432 .name = "EM2874 Leadership ISDBT",
1433 .tuner_type = TUNER_ABSENT,
1434 .tuner_gpio = leadership_reset,
1435 .dvb_gpio = leadership_digital,
1436 .has_dvb = 1,
1437 },
1438
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001439 [EM2880_BOARD_MSI_DIGIVOX_AD] = {
1440 .name = "MSI DigiVox A/D",
1441 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001442 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001443 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001444 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001445 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001446 .type = EM28XX_VMUX_TELEVISION,
1447 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001448 .amux = EM28XX_AMUX_VIDEO,
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_COMPOSITE1,
1452 .vmux = TVP5150_COMPOSITE1,
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 .type = EM28XX_VMUX_SVIDEO,
1457 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001458 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001459 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001460 } },
1461 },
1462 [EM2880_BOARD_MSI_DIGIVOX_AD_II] = {
1463 .name = "MSI DigiVox A/D II",
1464 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001465 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001466 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001467 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001468 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001469 .type = EM28XX_VMUX_TELEVISION,
1470 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001471 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001472 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001473 }, {
1474 .type = EM28XX_VMUX_COMPOSITE1,
1475 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001476 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001477 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001478 }, {
1479 .type = EM28XX_VMUX_SVIDEO,
1480 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001481 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001482 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001483 } },
1484 },
1485 [EM2880_BOARD_KWORLD_DVB_305U] = {
1486 .name = "KWorld DVB-T 305U",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001487 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001488 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001489 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001490 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001491 .type = EM28XX_VMUX_TELEVISION,
1492 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001493 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001494 }, {
1495 .type = EM28XX_VMUX_COMPOSITE1,
1496 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001497 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001498 }, {
1499 .type = EM28XX_VMUX_SVIDEO,
1500 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001501 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001502 } },
1503 },
1504 [EM2880_BOARD_KWORLD_DVB_310U] = {
1505 .name = "KWorld DVB-T 310U",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001506 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001507 .tuner_gpio = default_tuner_gpio,
Darron Broadda3808e2008-09-30 02:46:41 -03001508 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001509 .dvb_gpio = default_digital,
Darron Broadda3808e2008-09-30 02:46:41 -03001510 .mts_firmware = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001511 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001512 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001513 .type = EM28XX_VMUX_TELEVISION,
1514 .vmux = TVP5150_COMPOSITE0,
Darron Broadda3808e2008-09-30 02:46:41 -03001515 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001516 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001517 }, {
1518 .type = EM28XX_VMUX_COMPOSITE1,
1519 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehaba42aa192008-11-19 11:08:53 -03001520 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001521 .gpio = default_analog,
Darron Broadda3808e2008-09-30 02:46:41 -03001522 }, { /* S-video has not been tested yet */
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001523 .type = EM28XX_VMUX_SVIDEO,
1524 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehaba42aa192008-11-19 11:08:53 -03001525 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001526 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001527 } },
1528 },
Franklin Mengd7de5d82009-06-06 17:05:02 -03001529 [EM2882_BOARD_KWORLD_ATSC_315U] = {
1530 .name = "KWorld ATSC 315U HDTV TV Box",
1531 .valid = EM28XX_BOARD_NOT_VALIDATED,
1532 .tuner_type = TUNER_THOMSON_DTT761X,
1533 .tuner_gpio = em2882_kworld_315u_tuner_gpio,
1534 .tda9887_conf = TDA9887_PRESENT,
1535 .decoder = EM28XX_SAA711X,
1536 .has_dvb = 1,
1537 .dvb_gpio = em2882_kworld_315u_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001538 .ir_codes = RC_MAP_KWORLD_315U,
Franklin Mengd7de5d82009-06-06 17:05:02 -03001539 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
1540 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE,
1541 /* Analog mode - still not ready */
1542 /*.input = { {
1543 .type = EM28XX_VMUX_TELEVISION,
1544 .vmux = SAA7115_COMPOSITE2,
1545 .amux = EM28XX_AMUX_VIDEO,
1546 .gpio = em2882_kworld_315u_analog,
1547 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1548 }, {
1549 .type = EM28XX_VMUX_COMPOSITE1,
1550 .vmux = SAA7115_COMPOSITE0,
1551 .amux = EM28XX_AMUX_LINE_IN,
1552 .gpio = em2882_kworld_315u_analog1,
1553 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1554 }, {
1555 .type = EM28XX_VMUX_SVIDEO,
1556 .vmux = SAA7115_SVIDEO3,
1557 .amux = EM28XX_AMUX_LINE_IN,
1558 .gpio = em2882_kworld_315u_analog1,
1559 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1560 } }, */
1561 },
Douglas Schilling Landgrafe5db5d42009-04-09 18:24:34 -03001562 [EM2880_BOARD_EMPIRE_DUAL_TV] = {
1563 .name = "Empire dual TV",
1564 .tuner_type = TUNER_XC2028,
1565 .tuner_gpio = default_tuner_gpio,
1566 .has_dvb = 1,
1567 .dvb_gpio = default_digital,
1568 .mts_firmware = 1,
1569 .decoder = EM28XX_TVP5150,
1570 .input = { {
1571 .type = EM28XX_VMUX_TELEVISION,
1572 .vmux = TVP5150_COMPOSITE0,
1573 .amux = EM28XX_AMUX_VIDEO,
1574 .gpio = default_analog,
1575 }, {
1576 .type = EM28XX_VMUX_COMPOSITE1,
1577 .vmux = TVP5150_COMPOSITE1,
1578 .amux = EM28XX_AMUX_LINE_IN,
1579 .gpio = default_analog,
1580 }, {
1581 .type = EM28XX_VMUX_SVIDEO,
1582 .vmux = TVP5150_SVIDEO,
1583 .amux = EM28XX_AMUX_LINE_IN,
1584 .gpio = default_analog,
1585 } },
1586 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001587 [EM2881_BOARD_DNT_DA2_HYBRID] = {
1588 .name = "DNT DA2 Hybrid",
1589 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001590 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001591 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001592 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001593 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001594 .type = EM28XX_VMUX_TELEVISION,
1595 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001596 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001597 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001598 }, {
1599 .type = EM28XX_VMUX_COMPOSITE1,
1600 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001601 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001602 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001603 }, {
1604 .type = EM28XX_VMUX_SVIDEO,
1605 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001606 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001607 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001608 } },
1609 },
1610 [EM2881_BOARD_PINNACLE_HYBRID_PRO] = {
1611 .name = "Pinnacle Hybrid Pro",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001612 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001613 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001614 .decoder = EM28XX_TVP5150,
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03001615 .has_dvb = 1,
1616 .dvb_gpio = pinnacle_hybrid_pro_digital,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001617 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001618 .type = EM28XX_VMUX_TELEVISION,
1619 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001620 .amux = EM28XX_AMUX_VIDEO,
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03001621 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001622 }, {
1623 .type = EM28XX_VMUX_COMPOSITE1,
1624 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001625 .amux = EM28XX_AMUX_LINE_IN,
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03001626 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001627 }, {
1628 .type = EM28XX_VMUX_SVIDEO,
1629 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001630 .amux = EM28XX_AMUX_LINE_IN,
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03001631 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001632 } },
1633 },
Devin Heitmueller09bc1942011-03-13 02:07:54 -03001634 [EM2882_BOARD_PINNACLE_HYBRID_PRO_330E] = {
1635 .name = "Pinnacle Hybrid Pro (330e)",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001636 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001637 .tuner_gpio = default_tuner_gpio,
Eugeniy Meshcheryakova674a3b2008-08-01 08:23:41 -03001638 .mts_firmware = 1,
Devin Heitmuellerad9b4bb2011-03-13 02:09:59 -03001639 .has_dvb = 1,
1640 .dvb_gpio = hauppauge_wintv_hvr_900R2_digital,
Devin Heitmueller9b316d62011-03-13 02:18:34 -03001641 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001642 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001643 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001644 .type = EM28XX_VMUX_TELEVISION,
1645 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001646 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001647 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001648 }, {
1649 .type = EM28XX_VMUX_COMPOSITE1,
1650 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001651 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001652 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001653 }, {
1654 .type = EM28XX_VMUX_SVIDEO,
1655 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001656 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001657 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001658 } },
1659 },
1660 [EM2882_BOARD_KWORLD_VS_DVBT] = {
1661 .name = "Kworld VS-DVB-T 323UR",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001662 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001663 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001664 .decoder = EM28XX_TVP5150,
Antonio Larrosa811fab62010-03-04 22:19:48 -03001665 .mts_firmware = 1,
1666 .has_dvb = 1,
1667 .dvb_gpio = kworld_330u_digital,
1668 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001669 .ir_codes = RC_MAP_KWORLD_315U,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001670 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001671 .type = EM28XX_VMUX_TELEVISION,
1672 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001673 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001674 }, {
1675 .type = EM28XX_VMUX_COMPOSITE1,
1676 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001677 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001678 }, {
1679 .type = EM28XX_VMUX_SVIDEO,
1680 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001681 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001682 } },
1683 },
1684 [EM2882_BOARD_TERRATEC_HYBRID_XS] = {
Philippe Bourdin91245442010-10-31 09:57:58 -03001685 .name = "Terratec Cinnergy Hybrid T USB XS (em2882)",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001686 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001687 .tuner_gpio = default_tuner_gpio,
Uroš Vamplec994d02009-09-30 22:53:37 -03001688 .mts_firmware = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001689 .decoder = EM28XX_TVP5150,
Uroš Vamplec994d02009-09-30 22:53:37 -03001690 .has_dvb = 1,
1691 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001692 .ir_codes = RC_MAP_TERRATEC_CINERGY_XS,
Uroš Vamplec994d02009-09-30 22:53:37 -03001693 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001694 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001695 .type = EM28XX_VMUX_TELEVISION,
1696 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001697 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001698 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001699 }, {
1700 .type = EM28XX_VMUX_COMPOSITE1,
1701 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001702 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001703 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001704 }, {
1705 .type = EM28XX_VMUX_SVIDEO,
1706 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001707 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001708 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001709 } },
1710 },
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03001711 [EM2882_BOARD_DIKOM_DK300] = {
1712 .name = "Dikom DK300",
1713 .tuner_type = TUNER_XC2028,
1714 .tuner_gpio = default_tuner_gpio,
1715 .decoder = EM28XX_TVP5150,
1716 .mts_firmware = 1,
1717 .has_dvb = 1,
1718 .dvb_gpio = dikom_dk300_digital,
1719 .input = { {
1720 .type = EM28XX_VMUX_TELEVISION,
1721 .vmux = TVP5150_COMPOSITE0,
1722 .amux = EM28XX_AMUX_VIDEO,
1723 .gpio = default_analog,
1724 } },
1725 },
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001726 [EM2883_BOARD_KWORLD_HYBRID_330U] = {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001727 .name = "Kworld PlusTV HD Hybrid 330",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001728 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001729 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001730 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabbe2c6db2008-12-09 15:43:10 -03001731 .mts_firmware = 1,
1732 .has_dvb = 1,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001733 .dvb_gpio = kworld_330u_digital,
1734 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03001735 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
1736 EM28XX_I2C_EEPROM_ON_BOARD |
1737 EM28XX_I2C_EEPROM_KEY_VALID,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001738 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001739 .type = EM28XX_VMUX_TELEVISION,
1740 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001741 .amux = EM28XX_AMUX_VIDEO,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001742 .gpio = kworld_330u_analog,
1743 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001744 }, {
1745 .type = EM28XX_VMUX_COMPOSITE1,
1746 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001747 .amux = EM28XX_AMUX_LINE_IN,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001748 .gpio = kworld_330u_analog,
1749 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001750 }, {
1751 .type = EM28XX_VMUX_SVIDEO,
1752 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001753 .amux = EM28XX_AMUX_LINE_IN,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001754 .gpio = kworld_330u_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001755 } },
1756 },
Mauro Carvalho Chehabee281b82008-07-27 16:58:04 -03001757 [EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU] = {
Vitaly Woold3603342008-07-27 14:10:11 -03001758 .name = "Compro VideoMate ForYou/Stereo",
Vitaly Woold3603342008-07-27 14:10:11 -03001759 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03001760 .tvaudio_addr = 0xb0,
Vitaly Woold3603342008-07-27 14:10:11 -03001761 .tda9887_conf = TDA9887_PRESENT,
1762 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabdf7fa092009-02-25 09:06:13 -03001763 .adecoder = EM28XX_TVAUDIO,
Vitaly Wool2bd1d9e2009-03-04 08:27:52 -03001764 .mute_gpio = compro_mute_gpio,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001765 .input = { {
Vitaly Woold3603342008-07-27 14:10:11 -03001766 .type = EM28XX_VMUX_TELEVISION,
1767 .vmux = TVP5150_COMPOSITE0,
Vitaly Wool2bd1d9e2009-03-04 08:27:52 -03001768 .amux = EM28XX_AMUX_VIDEO,
1769 .gpio = compro_unmute_tv_gpio,
Vitaly Woold3603342008-07-27 14:10:11 -03001770 }, {
1771 .type = EM28XX_VMUX_SVIDEO,
1772 .vmux = TVP5150_SVIDEO,
1773 .amux = EM28XX_AMUX_LINE_IN,
Vitaly Wool2bd1d9e2009-03-04 08:27:52 -03001774 .gpio = compro_unmute_svid_gpio,
Vitaly Woold3603342008-07-27 14:10:11 -03001775 } },
1776 },
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03001777 [EM2860_BOARD_KAIOMY_TVNPC_U2] = {
1778 .name = "Kaiomy TVnPC U2",
1779 .vchannels = 3,
1780 .tuner_type = TUNER_XC2028,
1781 .tuner_addr = 0x61,
1782 .mts_firmware = 1,
1783 .decoder = EM28XX_TVP5150,
1784 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001785 .ir_codes = RC_MAP_KAIOMY,
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03001786 .input = { {
1787 .type = EM28XX_VMUX_TELEVISION,
1788 .vmux = TVP5150_COMPOSITE0,
1789 .amux = EM28XX_AMUX_VIDEO,
1790
1791 }, {
1792 .type = EM28XX_VMUX_COMPOSITE1,
1793 .vmux = TVP5150_COMPOSITE1,
1794 .amux = EM28XX_AMUX_LINE_IN,
1795 }, {
1796 .type = EM28XX_VMUX_SVIDEO,
1797 .vmux = TVP5150_SVIDEO,
1798 .amux = EM28XX_AMUX_LINE_IN,
1799 } },
1800 .radio = {
1801 .type = EM28XX_RADIO,
1802 .amux = EM28XX_AMUX_LINE_IN,
1803 }
Mauro Carvalho Chehab56ee3802009-02-11 14:18:36 -03001804 },
1805 [EM2860_BOARD_EASYCAP] = {
1806 .name = "Easy Cap Capture DC-60",
1807 .vchannels = 2,
1808 .tuner_type = TUNER_ABSENT,
1809 .decoder = EM28XX_SAA711X,
1810 .input = { {
1811 .type = EM28XX_VMUX_COMPOSITE1,
1812 .vmux = SAA7115_COMPOSITE0,
1813 .amux = EM28XX_AMUX_LINE_IN,
1814 }, {
1815 .type = EM28XX_VMUX_SVIDEO,
1816 .vmux = SAA7115_SVIDEO3,
1817 .amux = EM28XX_AMUX_LINE_IN,
1818 } },
1819 },
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03001820 [EM2820_BOARD_IODATA_GVMVP_SZ] = {
1821 .name = "IO-DATA GV-MVP/SZ",
1822 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
1823 .tuner_gpio = default_tuner_gpio,
1824 .tda9887_conf = TDA9887_PRESENT,
1825 .decoder = EM28XX_TVP5150,
1826 .input = { {
1827 .type = EM28XX_VMUX_TELEVISION,
1828 .vmux = TVP5150_COMPOSITE0,
1829 .amux = EM28XX_AMUX_VIDEO,
1830 }, { /* Composite has not been tested yet */
1831 .type = EM28XX_VMUX_COMPOSITE1,
1832 .vmux = TVP5150_COMPOSITE1,
1833 .amux = EM28XX_AMUX_VIDEO,
1834 }, { /* S-video has not been tested yet */
1835 .type = EM28XX_VMUX_SVIDEO,
1836 .vmux = TVP5150_SVIDEO,
1837 .amux = EM28XX_AMUX_VIDEO,
1838 } },
1839 },
Mauro Carvalho Chehab4557af92009-05-23 09:58:52 -03001840 [EM2860_BOARD_TERRATEC_GRABBY] = {
1841 .name = "Terratec Grabby",
1842 .vchannels = 2,
1843 .tuner_type = TUNER_ABSENT,
1844 .decoder = EM28XX_SAA711X,
1845 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
1846 .input = { {
1847 .type = EM28XX_VMUX_COMPOSITE1,
1848 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehaba3fa9042010-10-25 17:51:15 -03001849 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab4557af92009-05-23 09:58:52 -03001850 }, {
1851 .type = EM28XX_VMUX_SVIDEO,
1852 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehaba3fa9042010-10-25 17:51:15 -03001853 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab4557af92009-05-23 09:58:52 -03001854 } },
1855 },
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -03001856 [EM2860_BOARD_TERRATEC_AV350] = {
1857 .name = "Terratec AV350",
1858 .vchannels = 2,
1859 .tuner_type = TUNER_ABSENT,
1860 .decoder = EM28XX_TVP5150,
1861 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
1862 .mute_gpio = terratec_av350_mute_gpio,
1863 .input = { {
1864 .type = EM28XX_VMUX_COMPOSITE1,
1865 .vmux = TVP5150_COMPOSITE1,
1866 .amux = EM28XX_AUDIO_SRC_LINE,
Jean Delvare1df8e982009-05-13 16:48:07 -03001867 .gpio = terratec_av350_unmute_gpio,
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -03001868
1869 }, {
1870 .type = EM28XX_VMUX_SVIDEO,
1871 .vmux = TVP5150_SVIDEO,
1872 .amux = EM28XX_AUDIO_SRC_LINE,
Jean Delvare1df8e982009-05-13 16:48:07 -03001873 .gpio = terratec_av350_unmute_gpio,
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -03001874 } },
1875 },
Adrian Taylor8298f2f2010-10-20 07:55:33 -03001876
1877 [EM2860_BOARD_ELGATO_VIDEO_CAPTURE] = {
1878 .name = "Elgato Video Capture",
1879 .decoder = EM28XX_SAA711X,
1880 .tuner_type = TUNER_ABSENT, /* Capture only device */
1881 .input = { {
1882 .type = EM28XX_VMUX_COMPOSITE1,
1883 .vmux = SAA7115_COMPOSITE0,
1884 .amux = EM28XX_AMUX_LINE_IN,
1885 }, {
1886 .type = EM28XX_VMUX_SVIDEO,
1887 .vmux = SAA7115_SVIDEO3,
1888 .amux = EM28XX_AMUX_LINE_IN,
1889 } },
1890 },
1891
Devin Heitmueller19859222009-06-19 00:33:54 -03001892 [EM2882_BOARD_EVGA_INDTUBE] = {
1893 .name = "Evga inDtube",
1894 .tuner_type = TUNER_XC2028,
1895 .tuner_gpio = default_tuner_gpio,
1896 .decoder = EM28XX_TVP5150,
Devin Heitmuellera4c47302009-06-20 21:34:42 -03001897 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */
Devin Heitmueller19859222009-06-19 00:33:54 -03001898 .mts_firmware = 1,
1899 .has_dvb = 1,
1900 .dvb_gpio = evga_indtube_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001901 .ir_codes = RC_MAP_EVGA_INDTUBE,
Devin Heitmueller19859222009-06-19 00:33:54 -03001902 .input = { {
1903 .type = EM28XX_VMUX_TELEVISION,
1904 .vmux = TVP5150_COMPOSITE0,
1905 .amux = EM28XX_AMUX_VIDEO,
1906 .gpio = evga_indtube_analog,
1907 }, {
1908 .type = EM28XX_VMUX_COMPOSITE1,
1909 .vmux = TVP5150_COMPOSITE1,
1910 .amux = EM28XX_AMUX_LINE_IN,
1911 .gpio = evga_indtube_analog,
1912 }, {
1913 .type = EM28XX_VMUX_SVIDEO,
1914 .vmux = TVP5150_SVIDEO,
1915 .amux = EM28XX_AMUX_LINE_IN,
1916 .gpio = evga_indtube_analog,
1917 } },
1918 },
Antti Palosaari285eb1a2009-09-15 14:42:13 -03001919 /* eb1a:2868 Empia EM2870 + Philips CU1216L NIM (Philips TDA10023 +
1920 Infineon TUA6034) */
1921 [EM2870_BOARD_REDDO_DVB_C_USB_BOX] = {
1922 .name = "Reddo DVB-C USB TV Box",
1923 .tuner_type = TUNER_ABSENT,
Antti Palosaari28f4ddd12009-10-04 12:59:35 -03001924 .tuner_gpio = reddo_dvb_c_usb_box,
Antti Palosaari285eb1a2009-09-15 14:42:13 -03001925 .has_dvb = 1,
Antti Palosaari285eb1a2009-09-15 14:42:13 -03001926 },
Jarod Wilson7e48b302010-03-07 17:55:43 -03001927 /* 1b80:a340 - Empia EM2870, NXP TDA18271HD and LG DT3304, sold
1928 * initially as the KWorld PlusTV 340U, then as the UB435-Q.
1929 * Early variants have a TDA18271HD/C1, later ones a TDA18271HD/C2 */
1930 [EM2870_BOARD_KWORLD_A340] = {
1931 .name = "KWorld PlusTV 340U or UB435-Q (ATSC)",
1932 .tuner_type = TUNER_ABSENT, /* Digital-only TDA18271HD */
1933 .has_dvb = 1,
1934 .dvb_gpio = kworld_a340_digital,
1935 .tuner_gpio = default_tuner_gpio,
1936 },
Antti Palosaari460312e2011-05-25 17:03:50 -03001937 /* 2013:024f PCTV nanoStick T2 290e.
Antti Palosaarid6a5f922011-04-07 16:34:44 -03001938 * Empia EM28174, Sony CXD2820R and NXP TDA18271HD/C2 */
1939 [EM28174_BOARD_PCTV_290E] = {
Antti Palosaari460312e2011-05-25 17:03:50 -03001940 .name = "PCTV nanoStick T2 290e",
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -03001941 .def_i2c_bus = 1,
1942 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_FREQ_100_KHZ,
Antti Palosaarid6a5f922011-04-07 16:34:44 -03001943 .tuner_type = TUNER_ABSENT,
1944 .tuner_gpio = pctv_290e,
1945 .has_dvb = 1,
Antti Palosaariff7b9292011-05-25 17:00:35 -03001946 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
Antti Palosaarid6a5f922011-04-07 16:34:44 -03001947 },
Antti Palosaari36588712011-08-01 01:15:30 -03001948 /* 2013:024f PCTV DVB-S2 Stick 460e
1949 * Empia EM28174, NXP TDA10071, Conexant CX24118A and Allegro A8293 */
1950 [EM28174_BOARD_PCTV_460E] = {
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -03001951 .def_i2c_bus = 1,
1952 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_FREQ_400_KHZ,
Antti Palosaari36588712011-08-01 01:15:30 -03001953 .name = "PCTV DVB-S2 Stick (460e)",
1954 .tuner_type = TUNER_ABSENT,
1955 .tuner_gpio = pctv_460e,
1956 .has_dvb = 1,
1957 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
1958 },
Gareth Williams4d28d3d2011-12-24 05:47:29 -03001959 /* eb1a:5006 Honestech VIDBOX NW03
1960 * Empia EM2860, Philips SAA7113, Empia EMP202, No Tuner */
1961 [EM2860_BOARD_HT_VIDBOX_NW03] = {
1962 .name = "Honestech Vidbox NW03",
1963 .tuner_type = TUNER_ABSENT,
1964 .decoder = EM28XX_SAA711X,
1965 .input = { {
1966 .type = EM28XX_VMUX_COMPOSITE1,
1967 .vmux = SAA7115_COMPOSITE0,
1968 .amux = EM28XX_AMUX_LINE_IN,
1969 }, {
1970 .type = EM28XX_VMUX_SVIDEO,
1971 .vmux = SAA7115_SVIDEO3, /* S-VIDEO needs confirming */
1972 .amux = EM28XX_AMUX_LINE_IN,
1973 } },
1974 },
Antti Palosaari35530852012-03-18 18:09:01 -03001975 /* 1b80:e425 MaxMedia UB425-TC
1976 * Empia EM2874B + Micronas DRX 3913KA2 + NXP TDA18271HDC2 */
1977 [EM2874_BOARD_MAXMEDIA_UB425_TC] = {
1978 .name = "MaxMedia UB425-TC",
1979 .tuner_type = TUNER_ABSENT,
1980 .tuner_gpio = maxmedia_ub425_tc,
1981 .has_dvb = 1,
Antti Palosaari831378d2013-04-12 13:59:03 -03001982 .ir_codes = RC_MAP_REDDO,
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -03001983 .def_i2c_bus = 1,
1984 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
Antti Palosaari35530852012-03-18 18:09:01 -03001985 EM28XX_I2C_FREQ_400_KHZ,
1986 },
Ivan Kalvachevfa5527c2012-03-19 20:09:55 -03001987 /* 2304:0242 PCTV QuatroStick (510e)
1988 * Empia EM2884 + Micronas DRX 3926K + NXP TDA18271HDC2 */
1989 [EM2884_BOARD_PCTV_510E] = {
1990 .name = "PCTV QuatroStick (510e)",
1991 .tuner_type = TUNER_ABSENT,
1992 .tuner_gpio = pctv_510e,
1993 .has_dvb = 1,
1994 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -03001995 .def_i2c_bus = 1,
1996 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
Ivan Kalvachevfa5527c2012-03-19 20:09:55 -03001997 EM28XX_I2C_FREQ_400_KHZ,
1998 },
Antti Palosaaric247d7b2012-03-19 11:48:19 -03001999 /* 2013:0251 PCTV QuatroStick nano (520e)
2000 * Empia EM2884 + Micronas DRX 3926K + NXP TDA18271HDC2 */
2001 [EM2884_BOARD_PCTV_520E] = {
2002 .name = "PCTV QuatroStick nano (520e)",
2003 .tuner_type = TUNER_ABSENT,
2004 .tuner_gpio = pctv_520e,
2005 .has_dvb = 1,
2006 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -03002007 .def_i2c_bus = 1,
2008 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
Antti Palosaaric247d7b2012-03-19 11:48:19 -03002009 EM28XX_I2C_FREQ_400_KHZ,
2010 },
Martin Blumenstingl89040132012-10-04 14:22:54 -03002011 [EM2884_BOARD_TERRATEC_HTC_USB_XS] = {
2012 .name = "Terratec Cinergy HTC USB XS",
2013 .has_dvb = 1,
2014 .ir_codes = RC_MAP_NEC_TERRATEC_CINERGY_XS,
2015 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -03002016 .def_i2c_bus = 1,
2017 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
Martin Blumenstingl89040132012-10-04 14:22:54 -03002018 EM28XX_I2C_FREQ_400_KHZ,
2019 },
Jakob Haufe7c1dfdb2013-04-13 11:03:37 -03002020 /* 1b80:e1cc Delock 61959
2021 * Empia EM2874B + Micronas DRX 3913KA2 + NXP TDA18271HDC2
2022 * mostly the same as MaxMedia UB-425-TC but different remote */
2023 [EM2874_BOARD_DELOCK_61959] = {
2024 .name = "Delock 61959",
2025 .tuner_type = TUNER_ABSENT,
2026 .tuner_gpio = maxmedia_ub425_tc,
2027 .has_dvb = 1,
2028 .ir_codes = RC_MAP_DELOCK_61959,
2029 .def_i2c_bus = 1,
2030 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
2031 EM28XX_I2C_FREQ_400_KHZ,
2032 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002033};
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08002034const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002035
2036/* table of devices that work with this driver */
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03002037struct usb_device_id em28xx_id_table[] = {
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002038 { USB_DEVICE(0xeb1a, 0x2750),
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002039 .driver_info = EM2750_BOARD_UNKNOWN },
2040 { USB_DEVICE(0xeb1a, 0x2751),
2041 .driver_info = EM2750_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002042 { USB_DEVICE(0xeb1a, 0x2800),
2043 .driver_info = EM2800_BOARD_UNKNOWN },
Mauro Carvalho Chehab9b4e8452009-08-07 12:08:02 -03002044 { USB_DEVICE(0xeb1a, 0x2710),
2045 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002046 { USB_DEVICE(0xeb1a, 0x2820),
2047 .driver_info = EM2820_BOARD_UNKNOWN },
2048 { USB_DEVICE(0xeb1a, 0x2821),
Devin Heitmuellerc665f4d2008-12-16 23:35:23 -03002049 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002050 { USB_DEVICE(0xeb1a, 0x2860),
2051 .driver_info = EM2820_BOARD_UNKNOWN },
2052 { USB_DEVICE(0xeb1a, 0x2861),
2053 .driver_info = EM2820_BOARD_UNKNOWN },
Devin Heitmuellerf91cb652009-09-30 22:44:19 -03002054 { USB_DEVICE(0xeb1a, 0x2862),
2055 .driver_info = EM2820_BOARD_UNKNOWN },
Devin Heitmueller443fed92010-03-19 23:53:12 -03002056 { USB_DEVICE(0xeb1a, 0x2863),
2057 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002058 { USB_DEVICE(0xeb1a, 0x2870),
2059 .driver_info = EM2820_BOARD_UNKNOWN },
2060 { USB_DEVICE(0xeb1a, 0x2881),
2061 .driver_info = EM2820_BOARD_UNKNOWN },
2062 { USB_DEVICE(0xeb1a, 0x2883),
2063 .driver_info = EM2820_BOARD_UNKNOWN },
Antti Palosaari285eb1a2009-09-15 14:42:13 -03002064 { USB_DEVICE(0xeb1a, 0x2868),
2065 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03002066 { USB_DEVICE(0xeb1a, 0x2875),
2067 .driver_info = EM2820_BOARD_UNKNOWN },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002068 { USB_DEVICE(0xeb1a, 0xe300),
2069 .driver_info = EM2861_BOARD_KWORLD_PVRTV_300U },
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03002070 { USB_DEVICE(0xeb1a, 0xe303),
2071 .driver_info = EM2860_BOARD_KAIOMY_TVNPC_U2 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002072 { USB_DEVICE(0xeb1a, 0xe305),
2073 .driver_info = EM2880_BOARD_KWORLD_DVB_305U },
2074 { USB_DEVICE(0xeb1a, 0xe310),
2075 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD },
Franklin Mengd7de5d82009-06-06 17:05:02 -03002076 { USB_DEVICE(0xeb1a, 0xa313),
2077 .driver_info = EM2882_BOARD_KWORLD_ATSC_315U },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002078 { USB_DEVICE(0xeb1a, 0xa316),
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03002079 .driver_info = EM2883_BOARD_KWORLD_HYBRID_330U },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002080 { USB_DEVICE(0xeb1a, 0xe320),
2081 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD_II },
2082 { USB_DEVICE(0xeb1a, 0xe323),
2083 .driver_info = EM2882_BOARD_KWORLD_VS_DVBT },
2084 { USB_DEVICE(0xeb1a, 0xe350),
2085 .driver_info = EM2870_BOARD_KWORLD_350U },
2086 { USB_DEVICE(0xeb1a, 0xe355),
2087 .driver_info = EM2870_BOARD_KWORLD_355U },
2088 { USB_DEVICE(0xeb1a, 0x2801),
2089 .driver_info = EM2800_BOARD_GRABBEEX_USB2800 },
2090 { USB_DEVICE(0xeb1a, 0xe357),
2091 .driver_info = EM2870_BOARD_KWORLD_355U },
Aivar Päkk1985f6f2011-12-11 18:15:00 -03002092 { USB_DEVICE(0xeb1a, 0xe359),
2093 .driver_info = EM2870_BOARD_KWORLD_355U },
Douglas Schilling Landgrafac40d9e2009-02-25 16:55:48 -03002094 { USB_DEVICE(0x1b80, 0xe302),
2095 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, /* Kaiser Baas Video to DVD maker */
Douglas Schilling Landgrafea476892009-09-06 18:41:59 -03002096 { USB_DEVICE(0x1b80, 0xe304),
2097 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, /* Kworld DVD Maker 2 */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002098 { USB_DEVICE(0x0ccd, 0x0036),
2099 .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002100 { USB_DEVICE(0x0ccd, 0x004c),
2101 .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS_FR },
2102 { USB_DEVICE(0x0ccd, 0x004f),
2103 .driver_info = EM2860_BOARD_TERRATEC_HYBRID_XS },
2104 { USB_DEVICE(0x0ccd, 0x005e),
2105 .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS },
2106 { USB_DEVICE(0x0ccd, 0x0042),
Philippe Bourdin91245442010-10-31 09:57:58 -03002107 .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002108 { USB_DEVICE(0x0ccd, 0x0043),
Mauro Carvalho Chehab4e145342011-11-16 14:38:28 -02002109 .driver_info = EM2870_BOARD_TERRATEC_XS },
Holger Nelson6c3b9062011-12-23 23:15:32 -03002110 { USB_DEVICE(0x0ccd, 0x008e), /* Cinergy HTC USB XS Rev. 1 */
Martin Blumenstingl89040132012-10-04 14:22:54 -03002111 .driver_info = EM2884_BOARD_TERRATEC_HTC_USB_XS },
Holger Nelson6c3b9062011-12-23 23:15:32 -03002112 { USB_DEVICE(0x0ccd, 0x00ac), /* Cinergy HTC USB XS Rev. 2 */
Martin Blumenstingl89040132012-10-04 14:22:54 -03002113 .driver_info = EM2884_BOARD_TERRATEC_HTC_USB_XS },
Mauro Carvalho Chehab4e145342011-11-16 14:38:28 -02002114 { USB_DEVICE(0x0ccd, 0x10a2), /* H5 Rev. 1 */
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -03002115 .driver_info = EM2884_BOARD_TERRATEC_H5 },
Mauro Carvalho Chehab4e145342011-11-16 14:38:28 -02002116 { USB_DEVICE(0x0ccd, 0x10ad), /* H5 Rev. 2 */
Mauro Carvalho Chehab33ba28e2011-07-14 21:48:00 -03002117 .driver_info = EM2884_BOARD_TERRATEC_H5 },
Roland Scheidegger676fa7d2013-02-08 21:08:55 -03002118 { USB_DEVICE(0x0ccd, 0x10b6), /* H5 Rev. 3 */
2119 .driver_info = EM2884_BOARD_TERRATEC_H5 },
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -03002120 { USB_DEVICE(0x0ccd, 0x0084),
2121 .driver_info = EM2860_BOARD_TERRATEC_AV350 },
Mauro Carvalho Chehab4557af92009-05-23 09:58:52 -03002122 { USB_DEVICE(0x0ccd, 0x0096),
2123 .driver_info = EM2860_BOARD_TERRATEC_GRABBY },
Tekaefabaaf2011-10-14 05:40:29 -03002124 { USB_DEVICE(0x0ccd, 0x10AF),
2125 .driver_info = EM2860_BOARD_TERRATEC_GRABBY },
Andreas Oberrittera1ed02e2011-11-16 11:06:50 -03002126 { USB_DEVICE(0x0ccd, 0x00b2),
2127 .driver_info = EM2884_BOARD_CINERGY_HTC_STICK },
Adrian Taylor8298f2f2010-10-20 07:55:33 -03002128 { USB_DEVICE(0x0fd9, 0x0033),
2129 .driver_info = EM2860_BOARD_ELGATO_VIDEO_CAPTURE},
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002130 { USB_DEVICE(0x185b, 0x2870),
2131 .driver_info = EM2870_BOARD_COMPRO_VIDEOMATE },
Vitaly Woold3603342008-07-27 14:10:11 -03002132 { USB_DEVICE(0x185b, 0x2041),
Mauro Carvalho Chehabee281b82008-07-27 16:58:04 -03002133 .driver_info = EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002134 { USB_DEVICE(0x2040, 0x4200),
2135 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
Mauro Carvalho Chehab15b9bec2008-01-13 12:02:20 -03002136 { USB_DEVICE(0x2040, 0x4201),
2137 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002138 { USB_DEVICE(0x2040, 0x6500),
2139 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 },
Luc Saillard427d20c2008-01-30 17:23:00 -03002140 { USB_DEVICE(0x2040, 0x6502),
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002141 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2 },
Michael Krufky74ee0512008-05-01 18:02:30 -03002142 { USB_DEVICE(0x2040, 0x6513), /* HCW HVR-980 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002143 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Michael Krufky74ee0512008-05-01 18:02:30 -03002144 { USB_DEVICE(0x2040, 0x6517), /* HP HVR-950 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002145 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Michael Krufky74ee0512008-05-01 18:02:30 -03002146 { USB_DEVICE(0x2040, 0x651b), /* RP HVR-950 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002147 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03002148 { USB_DEVICE(0x2040, 0x651f),
2149 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850 },
Devin Heitmuellere14b3652008-07-26 11:04:33 -03002150 { USB_DEVICE(0x0438, 0xb002),
2151 .driver_info = EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002152 { USB_DEVICE(0x2001, 0xf112),
2153 .driver_info = EM2820_BOARD_DLINK_USB_TV },
2154 { USB_DEVICE(0x2304, 0x0207),
2155 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
2156 { USB_DEVICE(0x2304, 0x0208),
2157 .driver_info = EM2820_BOARD_PINNACLE_USB_2 },
2158 { USB_DEVICE(0x2304, 0x021a),
2159 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
2160 { USB_DEVICE(0x2304, 0x0226),
Devin Heitmueller09bc1942011-03-13 02:07:54 -03002161 .driver_info = EM2882_BOARD_PINNACLE_HYBRID_PRO_330E },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002162 { USB_DEVICE(0x2304, 0x0227),
2163 .driver_info = EM2880_BOARD_PINNACLE_PCTV_HD_PRO },
2164 { USB_DEVICE(0x0413, 0x6023),
2165 .driver_info = EM2800_BOARD_LEADTEK_WINFAST_USBII },
Don Kramer74e07f32012-01-02 16:15:44 -03002166 { USB_DEVICE(0x093b, 0xa003),
2167 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002168 { USB_DEVICE(0x093b, 0xa005),
2169 .driver_info = EM2861_BOARD_PLEXTOR_PX_TV100U },
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03002170 { USB_DEVICE(0x04bb, 0x0515),
2171 .driver_info = EM2820_BOARD_IODATA_GVMVP_SZ },
Zhenyu Wang7c8b5672009-07-05 10:51:21 -03002172 { USB_DEVICE(0xeb1a, 0x50a6),
2173 .driver_info = EM2860_BOARD_GADMEI_UTV330 },
Jarod Wilson7e48b302010-03-07 17:55:43 -03002174 { USB_DEVICE(0x1b80, 0xa340),
2175 .driver_info = EM2870_BOARD_KWORLD_A340 },
Antti Palosaarid6a5f922011-04-07 16:34:44 -03002176 { USB_DEVICE(0x2013, 0x024f),
2177 .driver_info = EM28174_BOARD_PCTV_290E },
Antti Palosaari36588712011-08-01 01:15:30 -03002178 { USB_DEVICE(0x2013, 0x024c),
2179 .driver_info = EM28174_BOARD_PCTV_460E },
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -03002180 { USB_DEVICE(0x2040, 0x1605),
2181 .driver_info = EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C },
Mauro Carvalho Chehab4159d012013-02-28 10:35:56 -03002182 { USB_DEVICE(0x1b80, 0xe755),
2183 .driver_info = EM2884_BOARD_C3TECH_DIGITAL_DUO },
Gareth Williams4d28d3d2011-12-24 05:47:29 -03002184 { USB_DEVICE(0xeb1a, 0x5006),
2185 .driver_info = EM2860_BOARD_HT_VIDBOX_NW03 },
Mario Ceresa2f786042012-01-06 16:00:12 -03002186 { USB_DEVICE(0x1b80, 0xe309), /* Sveon STV40 */
2187 .driver_info = EM2860_BOARD_EASYCAP },
Antti Palosaari35530852012-03-18 18:09:01 -03002188 { USB_DEVICE(0x1b80, 0xe425),
2189 .driver_info = EM2874_BOARD_MAXMEDIA_UB425_TC },
Ivan Kalvachevfa5527c2012-03-19 20:09:55 -03002190 { USB_DEVICE(0x2304, 0x0242),
2191 .driver_info = EM2884_BOARD_PCTV_510E },
Antti Palosaaric247d7b2012-03-19 11:48:19 -03002192 { USB_DEVICE(0x2013, 0x0251),
2193 .driver_info = EM2884_BOARD_PCTV_520E },
Jakob Haufe7c1dfdb2013-04-13 11:03:37 -03002194 { USB_DEVICE(0x1b80, 0xe1cc),
2195 .driver_info = EM2874_BOARD_DELOCK_61959 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002196 { },
2197};
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002198MODULE_DEVICE_TABLE(usb, em28xx_id_table);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002199
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002200/*
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002201 * EEPROM hash table for devices with generic USB IDs
2202 */
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03002203static struct em28xx_hash_table em28xx_eeprom_hash[] = {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03002204 /* P/N: SA 60002070465 Tuner: TVF7533-MF */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002205 {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF},
Douglas Schilling Landgraf1e1addd2008-12-27 21:38:14 -03002206 {0x72cc5a8b, EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2, TUNER_YMEC_TVF_5533MF},
Darron Broadda3808e2008-09-30 02:46:41 -03002207 {0x966a0441, EM2880_BOARD_KWORLD_DVB_310U, TUNER_XC2028},
Douglas Schilling Landgrafa35c87c2009-08-06 12:52:11 -03002208 {0x166a0441, EM2880_BOARD_EMPIRE_DUAL_TV, TUNER_XC2028},
Devin Heitmueller19859222009-06-19 00:33:54 -03002209 {0xcee44a99, EM2882_BOARD_EVGA_INDTUBE, TUNER_XC2028},
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03002210 {0xb8846b20, EM2881_BOARD_PINNACLE_HYBRID_PRO, TUNER_XC2028},
Antti Palosaari285eb1a2009-09-15 14:42:13 -03002211 {0x63f653bd, EM2870_BOARD_REDDO_DVB_C_USB_BOX, TUNER_ABSENT},
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03002212 {0x4e913442, EM2882_BOARD_DIKOM_DK300, TUNER_XC2028},
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002213};
2214
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03002215/* I2C devicelist hash table for devices with generic USB IDs */
Sascha Sommerfad7b952007-11-04 08:06:48 -03002216static struct em28xx_hash_table em28xx_i2c_hash[] = {
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002217 {0xb06a32c3, EM2800_BOARD_TERRATEC_CINERGY_200, TUNER_LG_PAL_NEW_TAPC},
2218 {0xf51200e3, EM2800_BOARD_VGEAR_POCKETTV, TUNER_LG_PAL_NEW_TAPC},
Devin Heitmueller3ed58ba2009-05-27 23:27:26 -03002219 {0x1ba50080, EM2860_BOARD_SAA711X_REFERENCE_DESIGN, TUNER_ABSENT},
Devin Heitmueller443fed92010-03-19 23:53:12 -03002220 {0x77800080, EM2860_BOARD_TVP5150_REFERENCE_DESIGN, TUNER_ABSENT},
Douglas Schilling Landgraff7fe3e62009-01-19 09:31:55 -03002221 {0xc51200e3, EM2820_BOARD_GADMEI_TVR200, TUNER_LG_PAL_NEW_TAPC},
Mauro Carvalho Chehab6d888a62009-08-30 13:05:56 -03002222 {0x4ba50080, EM2861_BOARD_GADMEI_UTV330PLUS, TUNER_TNF_5335MF},
Mauro Carvalho Chehabebaefdb2011-06-01 10:16:25 -03002223 {0x6b800080, EM2874_BOARD_LEADERSHIP_ISDBT, TUNER_ABSENT},
Sascha Sommerfad7b952007-11-04 08:06:48 -03002224};
Frank Schaefer87b52432013-03-03 15:37:40 -03002225/* NOTE: introduce a separate hash table for devices with 16 bit eeproms */
Sascha Sommerfad7b952007-11-04 08:06:48 -03002226
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002227/* I2C possible address to saa7115, tvp5150, msp3400, tvaudio */
2228static unsigned short saa711x_addrs[] = {
2229 0x4a >> 1, 0x48 >> 1, /* SAA7111, SAA7111A and SAA7113 */
2230 0x42 >> 1, 0x40 >> 1, /* SAA7114, SAA7115 and SAA7118 */
2231 I2C_CLIENT_END };
2232
2233static unsigned short tvp5150_addrs[] = {
2234 0xb8 >> 1,
2235 0xba >> 1,
2236 I2C_CLIENT_END
2237};
2238
2239static unsigned short msp3400_addrs[] = {
2240 0x80 >> 1,
2241 0x88 >> 1,
2242 I2C_CLIENT_END
2243};
2244
Michael Krufkyd7cba042008-09-12 13:31:45 -03002245int em28xx_tuner_callback(void *ptr, int component, int command, int arg)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002246{
Hans Verkuilbc3d2922013-03-22 09:54:00 -03002247 struct em28xx_i2c_bus *i2c_bus = ptr;
2248 struct em28xx *dev = i2c_bus->dev;
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002249 int rc = 0;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002250
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -03002251 if (dev->tuner_type != TUNER_XC2028 && dev->tuner_type != TUNER_XC5000)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002252 return 0;
2253
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -03002254 if (command != XC2028_TUNER_RESET && command != XC5000_TUNER_RESET)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002255 return 0;
2256
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03002257 rc = em28xx_gpio_set(dev, dev->board.tuner_gpio);
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002258
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002259 return rc;
2260}
2261EXPORT_SYMBOL_GPL(em28xx_tuner_callback);
2262
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03002263static inline void em28xx_set_model(struct em28xx *dev)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002264{
Ezequiel Garciae0f6e4d2012-09-26 06:25:12 -03002265 dev->board = em28xx_boards[dev->model];
Devin Heitmuellered14e1c2008-12-29 22:27:30 -03002266
2267 /* Those are the default values for the majority of boards
2268 Use those values if not specified otherwise at boards entry
2269 */
2270 if (!dev->board.xclk)
2271 dev->board.xclk = EM28XX_XCLK_IR_RC5_MODE |
2272 EM28XX_XCLK_FREQUENCY_12MHZ;
2273
2274 if (!dev->board.i2c_speed)
2275 dev->board.i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
2276 EM28XX_I2C_FREQ_100_KHZ;
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -03002277
Mauro Carvalho Chehabaab31252013-03-05 06:55:28 -03002278 /* Should be initialized early, for I2C to work */
2279 dev->def_i2c_bus = dev->board.def_i2c_bus;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002280}
2281
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002282/* Since em28xx_pre_card_setup() requires a proper dev->model,
2283 * this won't work for boards with generic PCI IDs
2284 */
Ezequiel Garcia60332f02012-04-28 09:57:01 -03002285static void em28xx_pre_card_setup(struct em28xx *dev)
Markus Rechbergera94e95b2006-01-23 17:11:10 -02002286{
Devin Heitmuellered14e1c2008-12-29 22:27:30 -03002287 /* Set the initial XCLK and I2C clock values based on the board
2288 definition */
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002289 em28xx_write_reg(dev, EM28XX_R0F_XCLK, dev->board.xclk & 0x7f);
Sascha Sommerca80cf62012-01-08 16:32:09 -03002290 if (!dev->board.is_em2800)
2291 em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed);
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03002292 msleep(50);
2293
Markus Rechbergera94e95b2006-01-23 17:11:10 -02002294 /* request some modules */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002295 switch (dev->model) {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002296 case EM2861_BOARD_PLEXTOR_PX_TV100U:
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -03002297 /* Sets the msp34xx I2S speed */
2298 dev->i2s_speed = 2048000;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002299 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002300 case EM2861_BOARD_KWORLD_PVRTV_300U:
2301 case EM2880_BOARD_KWORLD_DVB_305U:
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002302 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x6d);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002303 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002304 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x7d);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002305 msleep(10);
2306 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002307 case EM2870_BOARD_COMPRO_VIDEOMATE:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002308 /* TODO: someone can do some cleanup here...
2309 not everything's needed */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002310 em28xx_write_reg(dev, EM2880_R04_GPO, 0x00);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002311 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002312 em28xx_write_reg(dev, EM2880_R04_GPO, 0x01);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002313 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002314 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002315 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002316 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002317 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002318 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xdc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002319 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002320 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002321 mdelay(70);
2322 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002323 case EM2870_BOARD_TERRATEC_XS_MT2060:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002324 /* this device needs some gpio writes to get the DVB-T
2325 demod work */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002326 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002327 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002328 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xde);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002329 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002330 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002331 mdelay(70);
2332 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002333 case EM2870_BOARD_PINNACLE_PCTV_DVB:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002334 /* this device needs some gpio writes to get the
2335 DVB-T demod work */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002336 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002337 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002338 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xde);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002339 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002340 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002341 mdelay(70);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002342 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002343 case EM2820_BOARD_GADMEI_UTV310:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002344 case EM2820_BOARD_MSI_VOX_USB_2:
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03002345 /* enables audio for that devices */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002346 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002347 break;
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03002348
Franklin Mengd7de5d82009-06-06 17:05:02 -03002349 case EM2882_BOARD_KWORLD_ATSC_315U:
2350 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff);
2351 msleep(10);
2352 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
2353 msleep(10);
2354 em28xx_write_reg(dev, EM2880_R04_GPO, 0x00);
2355 msleep(10);
2356 em28xx_write_reg(dev, EM2880_R04_GPO, 0x08);
2357 msleep(10);
2358 break;
2359
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03002360 case EM2860_BOARD_KAIOMY_TVNPC_U2:
2361 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x07", 1);
2362 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
2363 em28xx_write_regs(dev, 0x0d, "\x42", 1);
2364 em28xx_write_regs(dev, 0x08, "\xfd", 1);
2365 msleep(10);
2366 em28xx_write_regs(dev, 0x08, "\xff", 1);
2367 msleep(10);
2368 em28xx_write_regs(dev, 0x08, "\x7f", 1);
2369 msleep(10);
2370 em28xx_write_regs(dev, 0x08, "\x6b", 1);
2371
2372 break;
Mauro Carvalho Chehab56ee3802009-02-11 14:18:36 -03002373 case EM2860_BOARD_EASYCAP:
2374 em28xx_write_regs(dev, 0x08, "\xf8", 1);
2375 break;
2376
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03002377 case EM2820_BOARD_IODATA_GVMVP_SZ:
2378 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff);
2379 msleep(70);
2380 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf7);
2381 msleep(10);
2382 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
2383 msleep(70);
2384 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
2385 msleep(70);
2386 break;
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002387 }
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03002388
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03002389 em28xx_gpio_set(dev, dev->board.tuner_gpio);
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03002390 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
2391
2392 /* Unlock device */
Mauro Carvalho Chehab2fe3e2e2008-11-27 09:10:40 -03002393 em28xx_set_mode(dev, EM28XX_SUSPEND);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002394}
2395
Mauro Carvalho Chehabe54318e2008-04-18 18:34:31 -03002396static void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl)
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002397{
2398 memset(ctl, 0, sizeof(*ctl));
2399
2400 ctl->fname = XC2028_DEFAULT_FIRMWARE;
2401 ctl->max_len = 64;
2402 ctl->mts = em28xx_boards[dev->model].mts_firmware;
2403
2404 switch (dev->model) {
Douglas Schilling Landgrafe5db5d42009-04-09 18:24:34 -03002405 case EM2880_BOARD_EMPIRE_DUAL_TV:
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03002406 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
Uroš Vamplec994d02009-09-30 22:53:37 -03002407 case EM2882_BOARD_TERRATEC_HYBRID_XS:
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03002408 ctl->demod = XC3028_FE_ZARLINK456;
2409 break;
reinhard schwab655b8402008-07-26 10:47:00 -03002410 case EM2880_BOARD_TERRATEC_HYBRID_XS:
Michel Garniercec4e6c2010-10-16 14:42:01 -03002411 case EM2880_BOARD_TERRATEC_HYBRID_XS_FR:
Devin Heitmuellere16e5a32009-07-15 00:37:22 -03002412 case EM2881_BOARD_PINNACLE_HYBRID_PRO:
reinhard schwab655b8402008-07-26 10:47:00 -03002413 ctl->demod = XC3028_FE_ZARLINK456;
2414 break;
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002415 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
Devin Heitmuellerad9b4bb2011-03-13 02:09:59 -03002416 case EM2882_BOARD_PINNACLE_HYBRID_PRO_330E:
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002417 ctl->demod = XC3028_FE_DEFAULT;
2418 break;
Devin Heitmueller5ea7fe42008-09-16 02:02:12 -03002419 case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600:
2420 ctl->demod = XC3028_FE_DEFAULT;
2421 ctl->fname = XC3028L_DEFAULT_FIRMWARE;
2422 break;
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03002423 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850:
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002424 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03002425 case EM2880_BOARD_PINNACLE_PCTV_HD_PRO:
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03002426 /* FIXME: Better to specify the needed IF */
Devin Heitmuellerbdfbf952008-04-17 21:38:27 -03002427 ctl->demod = XC3028_FE_DEFAULT;
2428 break;
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03002429 case EM2883_BOARD_KWORLD_HYBRID_330U:
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03002430 case EM2882_BOARD_DIKOM_DK300:
Antonio Larrosa811fab62010-03-04 22:19:48 -03002431 case EM2882_BOARD_KWORLD_VS_DVBT:
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03002432 ctl->demod = XC3028_FE_CHINA;
2433 ctl->fname = XC2028_DEFAULT_FIRMWARE;
2434 break;
Devin Heitmueller19859222009-06-19 00:33:54 -03002435 case EM2882_BOARD_EVGA_INDTUBE:
2436 ctl->demod = XC3028_FE_CHINA;
2437 ctl->fname = XC3028L_DEFAULT_FIRMWARE;
2438 break;
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002439 default:
2440 ctl->demod = XC3028_FE_OREN538;
2441 }
2442}
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002443
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002444static void em28xx_tuner_setup(struct em28xx *dev)
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002445{
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002446 struct tuner_setup tun_setup;
2447 struct v4l2_frequency f;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002448
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03002449 if (dev->tuner_type == TUNER_ABSENT)
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002450 return;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002451
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002452 memset(&tun_setup, 0, sizeof(tun_setup));
2453
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002454 tun_setup.mode_mask = T_ANALOG_TV | T_RADIO;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002455 tun_setup.tuner_callback = em28xx_tuner_callback;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002456
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002457 if (dev->board.radio.type) {
2458 tun_setup.type = dev->board.radio.type;
2459 tun_setup.addr = dev->board.radio_addr;
2460
2461 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_type_addr, &tun_setup);
2462 }
2463
2464 if ((dev->tuner_type != TUNER_ABSENT) && (dev->tuner_type)) {
2465 tun_setup.type = dev->tuner_type;
2466 tun_setup.addr = dev->tuner_addr;
2467
2468 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_type_addr, &tun_setup);
2469 }
2470
2471 if (dev->tda9887_conf) {
2472 struct v4l2_priv_tun_config tda9887_cfg;
2473
2474 tda9887_cfg.tuner = TUNER_TDA9887;
2475 tda9887_cfg.priv = &dev->tda9887_conf;
2476
2477 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_config, &tda9887_cfg);
2478 }
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002479
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002480 if (dev->tuner_type == TUNER_XC2028) {
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002481 struct v4l2_priv_tun_config xc2028_cfg;
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002482 struct xc2028_ctrl ctl;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002483
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002484 memset(&xc2028_cfg, 0, sizeof(xc2028_cfg));
2485 memset(&ctl, 0, sizeof(ctl));
2486
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002487 em28xx_setup_xc3028(dev, &ctl);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002488
2489 xc2028_cfg.tuner = TUNER_XC2028;
2490 xc2028_cfg.priv = &ctl;
2491
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002492 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_config, &xc2028_cfg);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002493 }
2494
2495 /* configure tuner */
2496 f.tuner = 0;
2497 f.type = V4L2_TUNER_ANALOG_TV;
2498 f.frequency = 9076; /* just a magic number */
2499 dev->ctl_freq = f.frequency;
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002500 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002501}
2502
2503static int em28xx_hint_board(struct em28xx *dev)
2504{
2505 int i;
2506
Frank Schaefer2d466e12013-03-27 17:06:28 -03002507 if (dev->board.is_webcam) {
2508 if (dev->em28xx_sensor == EM28XX_MT9V011) {
2509 dev->model = EM2820_BOARD_SILVERCREST_WEBCAM;
2510 } else if (dev->em28xx_sensor == EM28XX_MT9M001 ||
2511 dev->em28xx_sensor == EM28XX_MT9M111) {
2512 dev->model = EM2750_BOARD_UNKNOWN;
2513 }
2514 /* FIXME: IMPROVE ! */
2515
2516 return 0;
2517 }
2518
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03002519 /* HINT method: EEPROM
2520 *
2521 * This method works only for boards with eeprom.
2522 * Uses a hash of all eeprom bytes. The hash should be
2523 * unique for a vendor/tuner pair.
2524 * There are a high chance that tuners for different
2525 * video standards produce different hashes.
2526 */
2527 for (i = 0; i < ARRAY_SIZE(em28xx_eeprom_hash); i++) {
2528 if (dev->hash == em28xx_eeprom_hash[i].hash) {
2529 dev->model = em28xx_eeprom_hash[i].model;
2530 dev->tuner_type = em28xx_eeprom_hash[i].tuner;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002531
2532 em28xx_errdev("Your board has no unique USB ID.\n");
2533 em28xx_errdev("A hint were successfully done, "
2534 "based on eeprom hash.\n");
2535 em28xx_errdev("This method is not 100%% failproof.\n");
2536 em28xx_errdev("If the board were missdetected, "
2537 "please email this log to:\n");
2538 em28xx_errdev("\tV4L Mailing List "
Alexey Klimov51caf912009-01-25 12:53:09 -03002539 " <linux-media@vger.kernel.org>\n");
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002540 em28xx_errdev("Board detected as %s\n",
2541 em28xx_boards[dev->model].name);
2542
2543 return 0;
2544 }
2545 }
Sascha Sommerfad7b952007-11-04 08:06:48 -03002546
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03002547 /* HINT method: I2C attached devices
2548 *
2549 * This method works for all boards.
2550 * Uses a hash of i2c scanned devices.
2551 * Devices with the same i2c attached chips will
2552 * be considered equal.
2553 * This method is less precise than the eeprom one.
2554 */
2555
Sascha Sommerfad7b952007-11-04 08:06:48 -03002556 /* user did not request i2c scanning => do it now */
2557 if (!dev->i2c_hash)
Mauro Carvalho Chehabaab31252013-03-05 06:55:28 -03002558 em28xx_do_i2c_scan(dev, dev->def_i2c_bus);
Sascha Sommerfad7b952007-11-04 08:06:48 -03002559
2560 for (i = 0; i < ARRAY_SIZE(em28xx_i2c_hash); i++) {
2561 if (dev->i2c_hash == em28xx_i2c_hash[i].hash) {
2562 dev->model = em28xx_i2c_hash[i].model;
2563 dev->tuner_type = em28xx_i2c_hash[i].tuner;
2564 em28xx_errdev("Your board has no unique USB ID.\n");
2565 em28xx_errdev("A hint were successfully done, "
2566 "based on i2c devicelist hash.\n");
2567 em28xx_errdev("This method is not 100%% failproof.\n");
2568 em28xx_errdev("If the board were missdetected, "
2569 "please email this log to:\n");
2570 em28xx_errdev("\tV4L Mailing List "
Alexey Klimov51caf912009-01-25 12:53:09 -03002571 " <linux-media@vger.kernel.org>\n");
Sascha Sommerfad7b952007-11-04 08:06:48 -03002572 em28xx_errdev("Board detected as %s\n",
2573 em28xx_boards[dev->model].name);
2574
2575 return 0;
2576 }
2577 }
2578
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002579 em28xx_errdev("Your board has no unique USB ID and thus need a "
2580 "hint to be detected.\n");
2581 em28xx_errdev("You may try to use card=<n> insmod option to "
2582 "workaround that.\n");
2583 em28xx_errdev("Please send an email with this log to:\n");
Alexey Klimov51caf912009-01-25 12:53:09 -03002584 em28xx_errdev("\tV4L Mailing List <linux-media@vger.kernel.org>\n");
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002585 em28xx_errdev("Board eeprom hash is 0x%08lx\n", dev->hash);
Sascha Sommerfad7b952007-11-04 08:06:48 -03002586 em28xx_errdev("Board i2c devicelist hash is 0x%08lx\n", dev->i2c_hash);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002587
2588 em28xx_errdev("Here is a list of valid choices for the card=<n>"
2589 " insmod option:\n");
2590 for (i = 0; i < em28xx_bcount; i++) {
2591 em28xx_errdev(" card=%d -> %s\n",
2592 i, em28xx_boards[i].name);
2593 }
2594 return -1;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002595}
2596
Ezequiel Garcia60332f02012-04-28 09:57:01 -03002597static void em28xx_card_setup(struct em28xx *dev)
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002598{
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002599 /*
2600 * If the device can be a webcam, seek for a sensor.
2601 * If sensor is not found, then it isn't a webcam.
2602 */
2603 if (dev->board.is_webcam) {
Frank Schaeferb3944c82013-03-27 17:06:30 -03002604 if (em28xx_detect_sensor(dev) < 0)
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002605 dev->board.is_webcam = 0;
2606 else
2607 dev->progressive = 1;
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03002608 }
2609
Frank Schaefer2d466e12013-03-27 17:06:28 -03002610 switch (dev->model) {
2611 case EM2750_BOARD_UNKNOWN:
2612 case EM2820_BOARD_UNKNOWN:
2613 case EM2800_BOARD_UNKNOWN:
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03002614 /*
2615 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD.
2616 *
2617 * This occurs because they share identical USB vendor and
2618 * product IDs.
2619 *
2620 * What we do here is look up the EEPROM hash of the K-WORLD
2621 * and if it is found then we decide that we do not have
2622 * a DIGIVOX and reset the device to the K-WORLD instead.
2623 *
2624 * This solution is only valid if they do not share eeprom
2625 * hash identities which has not been determined as yet.
2626 */
2627 if (em28xx_hint_board(dev) < 0)
2628 em28xx_errdev("Board not discovered\n");
2629 else {
2630 em28xx_set_model(dev);
2631 em28xx_pre_card_setup(dev);
2632 }
2633 break;
Frank Schaefer2d466e12013-03-27 17:06:28 -03002634 default:
2635 em28xx_set_model(dev);
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03002636 }
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002637
2638 em28xx_info("Identified as %s (card=%d)\n",
2639 dev->board.name, dev->model);
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002640
2641 dev->tuner_type = em28xx_boards[dev->model].tuner_type;
Mauro Carvalho Chehab31e05302008-11-20 18:47:37 -03002642 if (em28xx_boards[dev->model].tuner_addr)
2643 dev->tuner_addr = em28xx_boards[dev->model].tuner_addr;
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002644
Franklin Mengae3340c2009-06-06 16:34:01 -03002645 if (em28xx_boards[dev->model].tda9887_conf)
2646 dev->tda9887_conf = em28xx_boards[dev->model].tda9887_conf;
2647
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002648 /* request some modules */
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002649 switch (dev->model) {
2650 case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2:
Mauro Carvalho Chehab98ae1272007-11-05 09:30:39 -03002651 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002652 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03002653 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850:
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002654 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
Frank Schaefera6166012013-03-03 15:37:44 -03002655 case EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C:
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002656 {
2657 struct tveeprom tv;
Frank Schaefera2179682013-03-03 15:37:42 -03002658
2659 if (dev->eedata == NULL)
2660 break;
Mauro Carvalho Chehabac07bb72009-09-08 14:04:41 -03002661#if defined(CONFIG_MODULES) && defined(MODULE)
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002662 request_module("tveeprom");
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002663#endif
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002664 /* Call first TVeeprom */
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002665
Mauro Carvalho Chehabc7a45e52013-03-05 06:55:26 -03002666 dev->i2c_client[dev->def_i2c_bus].addr = 0xa0 >> 1;
2667 tveeprom_hauppauge_analog(&dev->i2c_client[dev->def_i2c_bus], &tv, dev->eedata);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002668
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002669 dev->tuner_type = tv.tuner_type;
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03002670
Hans Verkuil33001012013-05-29 06:59:45 -03002671 if (tv.audio_processor == TVEEPROM_AUDPROC_MSP) {
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002672 dev->i2s_speed = 2048000;
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002673 dev->board.has_msp34xx = 1;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002674 }
2675 break;
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002676 }
Franklin Mengd7de5d82009-06-06 17:05:02 -03002677 case EM2882_BOARD_KWORLD_ATSC_315U:
2678 em28xx_write_reg(dev, 0x0d, 0x42);
2679 msleep(10);
2680 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
2681 msleep(10);
2682 break;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002683 case EM2820_BOARD_KWORLD_PVRTV2800RF:
2684 /* GPIO enables sound on KWORLD PVR TV 2800RF */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002685 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf9);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002686 break;
2687 case EM2820_BOARD_UNKNOWN:
2688 case EM2800_BOARD_UNKNOWN:
Darron Broadda3808e2008-09-30 02:46:41 -03002689 /*
2690 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD.
2691 *
2692 * This occurs because they share identical USB vendor and
2693 * product IDs.
2694 *
2695 * What we do here is look up the EEPROM hash of the K-WORLD
2696 * and if it is found then we decide that we do not have
2697 * a DIGIVOX and reset the device to the K-WORLD instead.
2698 *
2699 * This solution is only valid if they do not share eeprom
2700 * hash identities which has not been determined as yet.
2701 */
2702 case EM2880_BOARD_MSI_DIGIVOX_AD:
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002703 if (!em28xx_hint_board(dev))
2704 em28xx_set_model(dev);
Devin Heitmuellercdf7bfa2009-06-19 00:20:28 -03002705
2706 /* In cases where we had to use a board hint, the call to
2707 em28xx_set_mode() in em28xx_pre_card_setup() was a no-op,
2708 so make the call now so the analog GPIOs are set properly
2709 before probing the i2c bus. */
Devin Heitmueller5343e442009-07-15 00:35:47 -03002710 em28xx_gpio_set(dev, dev->board.tuner_gpio);
Devin Heitmuellercdf7bfa2009-06-19 00:20:28 -03002711 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002712 break;
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03002713
Frank Schaefera2179682013-03-03 15:37:42 -03002714 /*
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03002715 * The Dikom DK300 is detected as an Kworld VS-DVB-T 323UR.
2716 *
2717 * This occurs because they share identical USB vendor and
2718 * product IDs.
2719 *
2720 * What we do here is look up the EEPROM hash of the Dikom
2721 * and if it is found then we decide that we do not have
2722 * a Kworld and reset the device to the Dikom instead.
2723 *
2724 * This solution is only valid if they do not share eeprom
2725 * hash identities which has not been determined as yet.
2726 */
2727 case EM2882_BOARD_KWORLD_VS_DVBT:
2728 if (!em28xx_hint_board(dev))
2729 em28xx_set_model(dev);
2730
2731 /* In cases where we had to use a board hint, the call to
2732 em28xx_set_mode() in em28xx_pre_card_setup() was a no-op,
2733 so make the call now so the analog GPIOs are set properly
2734 before probing the i2c bus. */
2735 em28xx_gpio_set(dev, dev->board.tuner_gpio);
2736 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
2737 break;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002738 }
2739
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002740 if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002741 em28xx_errdev("\n\n");
2742 em28xx_errdev("The support for this board weren't "
2743 "valid yet.\n");
2744 em28xx_errdev("Please send a report of having this working\n");
2745 em28xx_errdev("not to V4L mailing list (and/or to other "
2746 "addresses)\n\n");
2747 }
2748
Frank Schaefera2179682013-03-03 15:37:42 -03002749 /* Free eeprom data memory */
2750 kfree(dev->eedata);
2751 dev->eedata = NULL;
2752
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002753 /* Allow override tuner type by a module parameter */
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002754 if (tuner >= 0)
2755 dev->tuner_type = tuner;
2756
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002757 /* request some modules */
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002758 if (dev->board.has_msp34xx)
Mauro Carvalho Chehabc7a45e52013-03-05 06:55:26 -03002759 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap[dev->def_i2c_bus],
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002760 "msp3400", 0, msp3400_addrs);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002761
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03002762 if (dev->board.decoder == EM28XX_SAA711X)
Mauro Carvalho Chehabc7a45e52013-03-05 06:55:26 -03002763 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap[dev->def_i2c_bus],
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002764 "saa7115_auto", 0, saa711x_addrs);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002765
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002766 if (dev->board.decoder == EM28XX_TVP5150)
Mauro Carvalho Chehabc7a45e52013-03-05 06:55:26 -03002767 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap[dev->def_i2c_bus],
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002768 "tvp5150", 0, tvp5150_addrs);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002769
Mauro Carvalho Chehabdf7fa092009-02-25 09:06:13 -03002770 if (dev->board.adecoder == EM28XX_TVAUDIO)
Mauro Carvalho Chehabc7a45e52013-03-05 06:55:26 -03002771 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap[dev->def_i2c_bus],
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002772 "tvaudio", dev->board.tvaudio_addr, NULL);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002773
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002774 if (dev->board.tuner_type != TUNER_ABSENT) {
2775 int has_demod = (dev->tda9887_conf & TDA9887_PRESENT);
Mauro Carvalho Chehaba924a492008-11-12 08:41:29 -03002776
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002777 if (dev->board.radio.type)
Mauro Carvalho Chehabc7a45e52013-03-05 06:55:26 -03002778 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap[dev->def_i2c_bus],
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002779 "tuner", dev->board.radio_addr, NULL);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002780
2781 if (has_demod)
Hans Verkuil53dacb12009-08-10 02:49:08 -03002782 v4l2_i2c_new_subdev(&dev->v4l2_dev,
Mauro Carvalho Chehabc7a45e52013-03-05 06:55:26 -03002783 &dev->i2c_adap[dev->def_i2c_bus], "tuner",
Hans Verkuil53dacb12009-08-10 02:49:08 -03002784 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002785 if (dev->tuner_addr == 0) {
2786 enum v4l2_i2c_tuner_type type =
2787 has_demod ? ADDRS_TV_WITH_DEMOD : ADDRS_TV;
2788 struct v4l2_subdev *sd;
2789
Hans Verkuil53dacb12009-08-10 02:49:08 -03002790 sd = v4l2_i2c_new_subdev(&dev->v4l2_dev,
Mauro Carvalho Chehabc7a45e52013-03-05 06:55:26 -03002791 &dev->i2c_adap[dev->def_i2c_bus], "tuner",
Hans Verkuil53dacb12009-08-10 02:49:08 -03002792 0, v4l2_i2c_tuner_addrs(type));
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002793
2794 if (sd)
2795 dev->tuner_addr = v4l2_i2c_subdev_addr(sd);
2796 } else {
Mauro Carvalho Chehabc7a45e52013-03-05 06:55:26 -03002797 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap[dev->def_i2c_bus],
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002798 "tuner", dev->tuner_addr, NULL);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002799 }
2800 }
2801
2802 em28xx_tuner_setup(dev);
Frank Schaefer484fbbe2013-03-27 17:06:29 -03002803
2804 em28xx_init_camera(dev);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002805}
Mauro Carvalho Chehabc8644052008-11-25 13:10:14 -03002806
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002807
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002808static void request_module_async(struct work_struct *work)
2809{
2810 struct em28xx *dev = container_of(work,
2811 struct em28xx, request_module_wk);
2812
Mauro Carvalho Chehab6ae5e062012-10-02 15:35:27 -03002813 /*
2814 * The em28xx extensions can be modules or builtin. If the
2815 * modules are already loaded or are built in, those extensions
2816 * can be initialised right now. Otherwise, the module init
2817 * code will do it.
2818 */
2819 em28xx_init_extension(dev);
2820
2821#if defined(CONFIG_MODULES) && defined(MODULE)
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002822 if (dev->has_audio_class)
2823 request_module("snd-usb-audio");
2824 else if (dev->has_alsa_audio)
2825 request_module("em28xx-alsa");
2826
2827 if (dev->board.has_dvb)
2828 request_module("em28xx-dvb");
Frank Schaefer2b64cbd2013-04-11 15:56:01 -03002829 if (dev->board.has_snapshot_button ||
2830 ((dev->board.ir_codes || dev->board.has_ir_i2c) && !disable_ir))
Ezequiel Garcíaf4d4e762012-03-26 09:13:35 -03002831 request_module("em28xx-rc");
Mauro Carvalho Chehab6ae5e062012-10-02 15:35:27 -03002832#endif /* CONFIG_MODULES */
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002833}
2834
2835static void request_modules(struct em28xx *dev)
2836{
2837 INIT_WORK(&dev->request_module_wk, request_module_async);
2838 schedule_work(&dev->request_module_wk);
2839}
Tejun Heo707bcf32010-12-24 16:14:20 +01002840
2841static void flush_request_modules(struct em28xx *dev)
2842{
Linus Torvalds0b8e74c2012-10-07 17:49:05 +09002843 flush_work(&dev->request_module_wk);
Tejun Heo707bcf32010-12-24 16:14:20 +01002844}
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002845
2846/*
Chris Rankind7222e72011-09-24 11:02:32 -03002847 * em28xx_release_resources()
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002848 * unregisters the v4l2,i2c and usb devices
Chris Rankind7222e72011-09-24 11:02:32 -03002849 * called when the device gets disconnected or at module unload
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002850*/
2851void em28xx_release_resources(struct em28xx *dev)
2852{
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002853 /*FIXME: I2C IR should be disconnected */
2854
2855 em28xx_release_analog_resources(dev);
2856
Mauro Carvalho Chehabaab31252013-03-05 06:55:28 -03002857 if (dev->def_i2c_bus)
2858 em28xx_i2c_unregister(dev, 1);
2859 em28xx_i2c_unregister(dev, 0);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002860
Hans Verkuil081b9452012-09-07 05:43:59 -03002861 v4l2_ctrl_handler_free(&dev->ctrl_handler);
2862
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002863 v4l2_device_unregister(&dev->v4l2_dev);
2864
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002865 usb_put_dev(dev->udev);
2866
2867 /* Mark device as unused */
Chris Rankin38b61eb2011-08-20 08:21:03 -03002868 clear_bit(dev->devno, &em28xx_devused);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002869};
2870
2871/*
2872 * em28xx_init_dev()
2873 * allocates and inits the device structs, registers i2c bus and v4l device
2874 */
Thomas Petazzoni622c2fc2012-01-07 10:18:45 -03002875static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,
Mauro Carvalho Chehab36fa6742009-04-05 08:02:15 -03002876 struct usb_interface *interface,
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002877 int minor)
2878{
Hans Verkuil081b9452012-09-07 05:43:59 -03002879 struct v4l2_ctrl_handler *hdl = &dev->ctrl_handler;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002880 int retval;
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02002881 static const char *default_chip_name = "em28xx";
2882 const char *chip_name = default_chip_name;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002883
2884 dev->udev = udev;
Devin Heitmuellerd3829fa2013-01-04 16:16:24 -03002885 mutex_init(&dev->vb_queue_lock);
2886 mutex_init(&dev->vb_vbi_queue_lock);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002887 mutex_init(&dev->ctrl_urb_lock);
2888 spin_lock_init(&dev->slock);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002889
2890 dev->em28xx_write_regs = em28xx_write_regs;
2891 dev->em28xx_read_reg = em28xx_read_reg;
2892 dev->em28xx_read_reg_req_len = em28xx_read_reg_req_len;
2893 dev->em28xx_write_regs_req = em28xx_write_regs_req;
2894 dev->em28xx_read_reg_req = em28xx_read_reg_req;
2895 dev->board.is_em2800 = em28xx_boards[dev->model].is_em2800;
2896
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002897 em28xx_set_model(dev);
2898
2899 /* Set the default GPO/GPIO for legacy devices */
2900 dev->reg_gpo_num = EM2880_R04_GPO;
2901 dev->reg_gpio_num = EM28XX_R08_GPIO;
2902
2903 dev->wait_after_write = 5;
2904
2905 /* Based on the Chip ID, set the device configuration */
2906 retval = em28xx_read_reg(dev, EM28XX_R0A_CHIPID);
2907 if (retval > 0) {
2908 dev->chip_id = retval;
2909
2910 switch (dev->chip_id) {
Mauro Carvalho Chehabf57b17c32009-11-12 11:21:05 -03002911 case CHIP_ID_EM2800:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02002912 chip_name = "em2800";
Mauro Carvalho Chehabf57b17c32009-11-12 11:21:05 -03002913 break;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002914 case CHIP_ID_EM2710:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02002915 chip_name = "em2710";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002916 break;
2917 case CHIP_ID_EM2750:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02002918 chip_name = "em2750";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002919 break;
Frank Schaefer736a3202013-03-26 13:38:37 -03002920 case CHIP_ID_EM2765:
2921 chip_name = "em2765";
2922 dev->wait_after_write = 0;
2923 dev->is_em25xx = 1;
2924 dev->eeprom_addrwidth_16bit = 1;
2925 break;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002926 case CHIP_ID_EM2820:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02002927 chip_name = "em2710/2820";
Frank Schaefer1552fb32013-04-19 17:09:46 -03002928 if (le16_to_cpu(dev->udev->descriptor.idVendor)
2929 == 0xeb1a) {
Frank Schaefer61ff5d62013-04-11 15:56:47 -03002930 __le16 idProd = dev->udev->descriptor.idProduct;
2931 if (le16_to_cpu(idProd) == 0x2710)
2932 chip_name = "em2710";
2933 else if (le16_to_cpu(idProd) == 0x2820)
2934 chip_name = "em2820";
2935 }
2936 /* NOTE: the em2820 is used in webcams, too ! */
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002937 break;
2938 case CHIP_ID_EM2840:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02002939 chip_name = "em2840";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002940 break;
2941 case CHIP_ID_EM2860:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02002942 chip_name = "em2860";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002943 break;
2944 case CHIP_ID_EM2870:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02002945 chip_name = "em2870";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002946 dev->wait_after_write = 0;
2947 break;
2948 case CHIP_ID_EM2874:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02002949 chip_name = "em2874";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002950 dev->reg_gpio_num = EM2874_R80_GPIO;
2951 dev->wait_after_write = 0;
Frank Schaefer87b52432013-03-03 15:37:40 -03002952 dev->eeprom_addrwidth_16bit = 1;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002953 break;
Antti Palosaaribc022692011-04-07 16:04:48 -03002954 case CHIP_ID_EM28174:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02002955 chip_name = "em28174";
Antti Palosaaribc022692011-04-07 16:04:48 -03002956 dev->reg_gpio_num = EM2874_R80_GPIO;
2957 dev->wait_after_write = 0;
Frank Schaefer87b52432013-03-03 15:37:40 -03002958 dev->eeprom_addrwidth_16bit = 1;
Antti Palosaaribc022692011-04-07 16:04:48 -03002959 break;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002960 case CHIP_ID_EM2883:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02002961 chip_name = "em2882/3";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002962 dev->wait_after_write = 0;
2963 break;
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -03002964 case CHIP_ID_EM2884:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02002965 chip_name = "em2884";
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -03002966 dev->reg_gpio_num = EM2874_R80_GPIO;
2967 dev->wait_after_write = 0;
Frank Schaefer87b52432013-03-03 15:37:40 -03002968 dev->eeprom_addrwidth_16bit = 1;
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -03002969 break;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002970 default:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02002971 printk(KERN_INFO DRIVER_NAME
2972 ": unknown em28xx chip ID (%d)\n", dev->chip_id);
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002973 }
2974 }
2975
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02002976 if (chip_name != default_chip_name)
2977 printk(KERN_INFO DRIVER_NAME
2978 ": chip ID is %s\n", chip_name);
2979
2980 /*
2981 * For em2820/em2710, the name may change latter, after checking
2982 * if the device has a sensor (so, it is em2710) or not.
2983 */
2984 snprintf(dev->name, sizeof(dev->name), "%s #%d", chip_name, dev->devno);
2985
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03002986 if (dev->is_audio_only) {
Chris Rankin6c03e382011-08-20 08:28:17 -03002987 retval = em28xx_audio_setup(dev);
2988 if (retval)
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03002989 return -ENODEV;
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03002990 em28xx_init_extension(dev);
2991
2992 return 0;
2993 }
2994
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002995 /* Prepopulate cached GPO register content */
2996 retval = em28xx_read_reg(dev, dev->reg_gpo_num);
2997 if (retval >= 0)
2998 dev->reg_gpo = retval;
2999
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003000 em28xx_pre_card_setup(dev);
3001
3002 if (!dev->board.is_em2800) {
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03003003 /* Resets I2C speed */
Sascha Sommer0903bb52012-01-08 16:19:30 -03003004 retval = em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003005 if (retval < 0) {
Chris Rankin6c03e382011-08-20 08:28:17 -03003006 em28xx_errdev("%s: em28xx_write_reg failed!"
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003007 " retval [%d]\n",
3008 __func__, retval);
3009 return retval;
3010 }
3011 }
3012
Mauro Carvalho Chehab36fa6742009-04-05 08:02:15 -03003013 retval = v4l2_device_register(&interface->dev, &dev->v4l2_dev);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003014 if (retval < 0) {
3015 em28xx_errdev("Call to v4l2_device_register() failed!\n");
3016 return retval;
3017 }
3018
Frank Schaefer8f8b113a2013-02-15 14:38:32 -03003019 v4l2_ctrl_handler_init(hdl, 8);
Hans Verkuil081b9452012-09-07 05:43:59 -03003020 dev->v4l2_dev.ctrl_handler = hdl;
3021
Mauro Carvalho Chehabaab31252013-03-05 06:55:28 -03003022 rt_mutex_init(&dev->i2c_bus_lock);
3023
3024 /* register i2c bus 0 */
Frank Schaefera3ea4bf2013-03-26 13:38:36 -03003025 if (dev->board.is_em2800)
3026 retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM2800);
3027 else
3028 retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM28XX);
Chris Rankin6c03e382011-08-20 08:28:17 -03003029 if (retval < 0) {
Mauro Carvalho Chehabaab31252013-03-05 06:55:28 -03003030 em28xx_errdev("%s: em28xx_i2c_register bus 0 - error [%d]!\n",
Chris Rankin6c03e382011-08-20 08:28:17 -03003031 __func__, retval);
3032 goto unregister_dev;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003033 }
3034
Frank Schaefera3ea4bf2013-03-26 13:38:36 -03003035 /* register i2c bus 1 */
Mauro Carvalho Chehabaab31252013-03-05 06:55:28 -03003036 if (dev->def_i2c_bus) {
Frank Schaefer736a3202013-03-26 13:38:37 -03003037 if (dev->is_em25xx)
3038 retval = em28xx_i2c_register(dev, 1,
3039 EM28XX_I2C_ALGO_EM25XX_BUS_B);
3040 else
3041 retval = em28xx_i2c_register(dev, 1,
3042 EM28XX_I2C_ALGO_EM28XX);
Mauro Carvalho Chehabaab31252013-03-05 06:55:28 -03003043 if (retval < 0) {
3044 em28xx_errdev("%s: em28xx_i2c_register bus 1 - error [%d]!\n",
3045 __func__, retval);
3046 goto unregister_dev;
3047 }
3048 }
3049
Mauro Carvalho Chehabb04fb662009-07-13 01:28:21 -03003050 /*
Mauro Carvalho Chehab579d3152009-07-14 12:33:25 -03003051 * Default format, used for tvp5150 or saa711x output formats
3052 */
3053 dev->vinmode = 0x10;
Devin Heitmueller206313d2009-08-31 23:23:03 -03003054 dev->vinctl = EM28XX_VINCTRL_INTERLACED |
3055 EM28XX_VINCTRL_CCIR656_ENABLE;
Mauro Carvalho Chehab579d3152009-07-14 12:33:25 -03003056
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003057 /* Do board specific init and eeprom reading */
3058 em28xx_card_setup(dev);
3059
3060 /* Configure audio */
Chris Rankin6c03e382011-08-20 08:28:17 -03003061 retval = em28xx_audio_setup(dev);
3062 if (retval < 0) {
3063 em28xx_errdev("%s: Error while setting audio - error [%d]!\n",
3064 __func__, retval);
3065 goto fail;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003066 }
Hans Verkuil081b9452012-09-07 05:43:59 -03003067 if (dev->audio_mode.ac97 != EM28XX_NO_AC97) {
3068 v4l2_ctrl_new_std(hdl, &em28xx_ctrl_ops,
3069 V4L2_CID_AUDIO_MUTE, 0, 1, 1, 1);
3070 v4l2_ctrl_new_std(hdl, &em28xx_ctrl_ops,
3071 V4L2_CID_AUDIO_VOLUME, 0, 0x1f, 1, 0x1f);
3072 } else {
3073 /* install the em28xx notify callback */
3074 v4l2_ctrl_notify(v4l2_ctrl_find(hdl, V4L2_CID_AUDIO_MUTE),
3075 em28xx_ctrl_notify, dev);
3076 v4l2_ctrl_notify(v4l2_ctrl_find(hdl, V4L2_CID_AUDIO_VOLUME),
3077 em28xx_ctrl_notify, dev);
3078 }
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003079
3080 /* wake i2c devices */
3081 em28xx_wake_i2c(dev);
3082
3083 /* init video dma queues */
3084 INIT_LIST_HEAD(&dev->vidq.active);
Devin Heitmueller28abf0832009-09-01 01:54:54 -03003085 INIT_LIST_HEAD(&dev->vbiq.active);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003086
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003087 if (dev->board.has_msp34xx) {
3088 /* Send a reset to other chips via gpio */
Chris Rankin6c03e382011-08-20 08:28:17 -03003089 retval = em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf7);
3090 if (retval < 0) {
3091 em28xx_errdev("%s: em28xx_write_reg - "
3092 "msp34xx(1) failed! error [%d]\n",
3093 __func__, retval);
3094 goto fail;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003095 }
3096 msleep(3);
3097
Chris Rankin6c03e382011-08-20 08:28:17 -03003098 retval = em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff);
3099 if (retval < 0) {
3100 em28xx_errdev("%s: em28xx_write_reg - "
3101 "msp34xx(2) failed! error [%d]\n",
3102 __func__, retval);
3103 goto fail;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003104 }
3105 msleep(3);
3106 }
3107
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003108 retval = em28xx_register_analog_devices(dev);
3109 if (retval < 0) {
Chris Rankin6c03e382011-08-20 08:28:17 -03003110 goto fail;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003111 }
3112
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003113 /* Save some power by putting tuner to sleep */
Laurent Pinchart622b8282009-10-05 10:48:17 -03003114 v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_power, 0);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003115
3116 return 0;
3117
Chris Rankin6c03e382011-08-20 08:28:17 -03003118fail:
Mauro Carvalho Chehabaab31252013-03-05 06:55:28 -03003119 if (dev->def_i2c_bus)
3120 em28xx_i2c_unregister(dev, 1);
3121 em28xx_i2c_unregister(dev, 0);
Hans Verkuil081b9452012-09-07 05:43:59 -03003122 v4l2_ctrl_handler_free(&dev->ctrl_handler);
Chris Rankin6c03e382011-08-20 08:28:17 -03003123
3124unregister_dev:
3125 v4l2_device_unregister(&dev->v4l2_dev);
3126
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003127 return retval;
3128}
3129
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003130/* high bandwidth multiplier, as encoded in highspeed endpoint descriptors */
3131#define hb_mult(wMaxPacketSize) (1 + (((wMaxPacketSize) >> 11) & 0x03))
3132
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003133/*
3134 * em28xx_usb_probe()
3135 * checks for supported devices
3136 */
3137static int em28xx_usb_probe(struct usb_interface *interface,
3138 const struct usb_device_id *id)
3139{
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003140 struct usb_device *udev;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003141 struct em28xx *dev = NULL;
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003142 int retval;
Holger Nelson8ab33622011-12-28 18:55:41 -03003143 bool has_audio = false, has_video = false, has_dvb = false;
Mauro Carvalho Chehab8b2aea72012-12-23 13:25:38 -02003144 int i, nr, try_bulk;
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003145 const int ifnum = interface->altsetting[0].desc.bInterfaceNumber;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003146 char *speed;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003147
3148 udev = usb_get_dev(interface_to_usbdev(interface));
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003149
3150 /* Check to see next free device and mark as used */
Chris Rankin38b61eb2011-08-20 08:21:03 -03003151 do {
3152 nr = find_first_zero_bit(&em28xx_devused, EM28XX_MAXBOARDS);
3153 if (nr >= EM28XX_MAXBOARDS) {
3154 /* No free device slots */
3155 printk(DRIVER_NAME ": Supports only %i em28xx boards.\n",
3156 EM28XX_MAXBOARDS);
3157 retval = -ENOMEM;
3158 goto err_no_slot;
3159 }
3160 } while (test_and_set_bit(nr, &em28xx_devused));
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003161
3162 /* Don't register audio interfaces */
3163 if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
3164 em28xx_err(DRIVER_NAME " audio device (%04x:%04x): "
3165 "interface %i, class %i\n",
3166 le16_to_cpu(udev->descriptor.idVendor),
3167 le16_to_cpu(udev->descriptor.idProduct),
3168 ifnum,
3169 interface->altsetting[0].desc.bInterfaceClass);
3170
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003171 retval = -ENODEV;
3172 goto err;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003173 }
3174
Holger Nelson8ab33622011-12-28 18:55:41 -03003175 /* allocate memory for our device state and initialize it */
3176 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
3177 if (dev == NULL) {
3178 em28xx_err(DRIVER_NAME ": out of memory!\n");
3179 retval = -ENOMEM;
3180 goto err;
3181 }
3182
3183 /* compute alternate max packet sizes */
Frank Schaefer0cf544a2012-11-08 14:11:49 -03003184 dev->alt_max_pkt_size_isoc =
3185 kmalloc(sizeof(dev->alt_max_pkt_size_isoc[0]) *
Holger Nelson8ab33622011-12-28 18:55:41 -03003186 interface->num_altsetting, GFP_KERNEL);
Frank Schaefer0cf544a2012-11-08 14:11:49 -03003187 if (dev->alt_max_pkt_size_isoc == NULL) {
Holger Nelson8ab33622011-12-28 18:55:41 -03003188 em28xx_errdev("out of memory!\n");
3189 kfree(dev);
3190 retval = -ENOMEM;
3191 goto err;
3192 }
3193
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003194 /* Get endpoints */
3195 for (i = 0; i < interface->num_altsetting; i++) {
3196 int ep;
3197
3198 for (ep = 0; ep < interface->altsetting[i].desc.bNumEndpoints; ep++) {
Holger Nelson8ab33622011-12-28 18:55:41 -03003199 const struct usb_endpoint_descriptor *e;
3200 int sizedescr, size;
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003201
Holger Nelson8ab33622011-12-28 18:55:41 -03003202 e = &interface->altsetting[i].endpoint[ep].desc;
3203
3204 sizedescr = le16_to_cpu(e->wMaxPacketSize);
3205 size = sizedescr & 0x7ff;
3206
3207 if (udev->speed == USB_SPEED_HIGH)
3208 size = size * hb_mult(sizedescr);
3209
Frank Schaeferc647a912012-11-08 14:11:52 -03003210 if (usb_endpoint_dir_in(e)) {
Holger Nelson8ab33622011-12-28 18:55:41 -03003211 switch (e->bEndpointAddress) {
Frank Schaeferc647a912012-11-08 14:11:52 -03003212 case 0x82:
Holger Nelson8ab33622011-12-28 18:55:41 -03003213 has_video = true;
Frank Schaeferc647a912012-11-08 14:11:52 -03003214 if (usb_endpoint_xfer_isoc(e)) {
3215 dev->analog_ep_isoc =
3216 e->bEndpointAddress;
3217 dev->alt_max_pkt_size_isoc[i] = size;
3218 } else if (usb_endpoint_xfer_bulk(e)) {
3219 dev->analog_ep_bulk =
3220 e->bEndpointAddress;
3221 }
Holger Nelson8ab33622011-12-28 18:55:41 -03003222 break;
Frank Schaeferc647a912012-11-08 14:11:52 -03003223 case 0x83:
3224 if (usb_endpoint_xfer_isoc(e)) {
3225 has_audio = true;
3226 } else {
3227 printk(KERN_INFO DRIVER_NAME
3228 ": error: skipping audio endpoint 0x83, because it uses bulk transfers !\n");
3229 }
3230 break;
3231 case 0x84:
3232 if (has_video &&
3233 (usb_endpoint_xfer_bulk(e))) {
3234 dev->analog_ep_bulk =
3235 e->bEndpointAddress;
3236 } else {
Frank Schaeferc647a912012-11-08 14:11:52 -03003237 if (usb_endpoint_xfer_isoc(e)) {
Frank Schaeferc647a912012-11-08 14:11:52 -03003238 if (size > dev->dvb_max_pkt_size_isoc) {
Frank Schaefer72cc9ba2013-03-27 16:07:41 -03003239 has_dvb = true; /* see NOTE (~) */
Frank Schaeferb3404a82013-04-08 13:06:59 -03003240 dev->dvb_ep_isoc = e->bEndpointAddress;
Frank Schaeferc647a912012-11-08 14:11:52 -03003241 dev->dvb_max_pkt_size_isoc = size;
3242 dev->dvb_alt_isoc = i;
3243 }
3244 } else {
Frank Schaefer72cc9ba2013-03-27 16:07:41 -03003245 has_dvb = true;
Frank Schaeferc647a912012-11-08 14:11:52 -03003246 dev->dvb_ep_bulk = e->bEndpointAddress;
3247 }
Holger Nelson8ab33622011-12-28 18:55:41 -03003248 }
3249 break;
3250 }
3251 }
Frank Schaeferc647a912012-11-08 14:11:52 -03003252 /* NOTE:
3253 * Old logic with support for isoc transfers only was:
3254 * 0x82 isoc => analog
3255 * 0x83 isoc => audio
3256 * 0x84 isoc => digital
3257 *
3258 * New logic with support for bulk transfers
3259 * 0x82 isoc => analog
3260 * 0x82 bulk => analog
3261 * 0x83 isoc* => audio
3262 * 0x84 isoc => digital
3263 * 0x84 bulk => analog or digital**
3264 * (*: audio should always be isoc)
3265 * (**: analog, if ep 0x82 is isoc, otherwise digital)
3266 *
3267 * The new logic preserves backwards compatibility and
3268 * reflects the endpoint configurations we have seen
3269 * so far. But there might be devices for which this
3270 * logic is not sufficient...
3271 */
Frank Schaefer72cc9ba2013-03-27 16:07:41 -03003272 /*
3273 * NOTE (~): some manufacturers (e.g. Terratec) disable
3274 * endpoints by setting wMaxPacketSize to 0 bytes for
3275 * all alt settings. So far, we've seen this for
3276 * DVB isoc endpoints only.
3277 */
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003278 }
3279 }
3280
Holger Nelson8ab33622011-12-28 18:55:41 -03003281 if (!(has_audio || has_video || has_dvb)) {
3282 retval = -ENODEV;
3283 goto err_free;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003284 }
3285
3286 switch (udev->speed) {
3287 case USB_SPEED_LOW:
3288 speed = "1.5";
3289 break;
3290 case USB_SPEED_UNKNOWN:
3291 case USB_SPEED_FULL:
3292 speed = "12";
3293 break;
3294 case USB_SPEED_HIGH:
3295 speed = "480";
3296 break;
3297 default:
3298 speed = "unknown";
3299 }
3300
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003301 printk(KERN_INFO DRIVER_NAME
Ezequiel García401a5822012-03-13 10:27:09 -03003302 ": New device %s %s @ %s Mbps "
3303 "(%04x:%04x, interface %d, class %d)\n",
3304 udev->manufacturer ? udev->manufacturer : "",
3305 udev->product ? udev->product : "",
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003306 speed,
3307 le16_to_cpu(udev->descriptor.idVendor),
3308 le16_to_cpu(udev->descriptor.idProduct),
3309 ifnum,
3310 interface->altsetting->desc.bInterfaceNumber);
3311
Devin Heitmueller64a00b42009-05-27 23:23:37 -03003312 /*
3313 * Make sure we have 480 Mbps of bandwidth, otherwise things like
3314 * video stream wouldn't likely work, since 12 Mbps is generally
3315 * not enough even for most Digital TV streams.
3316 */
Devin Heitmuellere2a1b792009-05-27 23:44:10 -03003317 if (udev->speed != USB_SPEED_HIGH && disable_usb_speed_check == 0) {
Devin Heitmueller64a00b42009-05-27 23:23:37 -03003318 printk(DRIVER_NAME ": Device initialization failed.\n");
3319 printk(DRIVER_NAME ": Device must be connected to a high-speed"
3320 " USB 2.0 port.\n");
Devin Heitmueller64a00b42009-05-27 23:23:37 -03003321 retval = -ENODEV;
Holger Nelson8ab33622011-12-28 18:55:41 -03003322 goto err_free;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003323 }
3324
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003325 dev->devno = nr;
3326 dev->model = id->driver_info;
3327 dev->alt = -1;
Holger Nelson8ab33622011-12-28 18:55:41 -03003328 dev->is_audio_only = has_audio && !(has_video || has_dvb);
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003329 dev->has_alsa_audio = has_audio;
3330 dev->audio_ifnum = ifnum;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003331
3332 /* Checks if audio is provided by some interface */
3333 for (i = 0; i < udev->config->desc.bNumInterfaces; i++) {
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003334 struct usb_interface *uif = udev->config->interface[i];
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003335 if (uif->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
3336 dev->has_audio_class = 1;
3337 break;
3338 }
3339 }
3340
Mauro Carvalho Chehabaa514962012-12-23 13:15:47 -02003341 if (has_audio)
3342 printk(KERN_INFO DRIVER_NAME
3343 ": Audio interface %i found %s\n",
3344 ifnum,
3345 dev->has_audio_class ? "(USB Audio Class)" : "(Vendor Class)");
3346 if (has_video)
3347 printk(KERN_INFO DRIVER_NAME
3348 ": Video interface %i found:%s%s\n",
3349 ifnum,
3350 dev->analog_ep_bulk ? " bulk" : "",
3351 dev->analog_ep_isoc ? " isoc" : "");
3352 if (has_dvb)
3353 printk(KERN_INFO DRIVER_NAME
3354 ": DVB interface %i found:%s%s\n",
3355 ifnum,
3356 dev->dvb_ep_bulk ? " bulk" : "",
3357 dev->dvb_ep_isoc ? " isoc" : "");
3358
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003359 dev->num_alt = interface->num_altsetting;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003360
Mauro Carvalho Chehabd3e4ea02012-10-27 16:29:20 -03003361 if ((unsigned)card[nr] < em28xx_bcount)
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003362 dev->model = card[nr];
3363
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003364 /* save our data pointer in this interface device */
3365 usb_set_intfdata(interface, dev);
3366
Devin Heitmuellerd3829fa2013-01-04 16:16:24 -03003367 /* initialize videobuf2 stuff */
3368 em28xx_vb2_setup(dev);
3369
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003370 /* allocate device struct */
3371 mutex_init(&dev->lock);
3372 mutex_lock(&dev->lock);
Thomas Petazzoni622c2fc2012-01-07 10:18:45 -03003373 retval = em28xx_init_dev(dev, udev, interface, nr);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003374 if (retval) {
Holger Nelson8ab33622011-12-28 18:55:41 -03003375 goto unlock_and_free;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003376 }
3377
Frank Schaefer7e5d74e2012-12-26 15:12:37 -03003378 if (usb_xfer_mode < 0) {
Mauro Carvalho Chehab8b2aea72012-12-23 13:25:38 -02003379 if (dev->board.is_webcam)
3380 try_bulk = 1;
3381 else
3382 try_bulk = 0;
3383 } else {
Frank Schaefer7e5d74e2012-12-26 15:12:37 -03003384 try_bulk = usb_xfer_mode > 0;
Mauro Carvalho Chehab8b2aea72012-12-23 13:25:38 -02003385 }
3386
3387 /* Select USB transfer types to use */
3388 if (has_video) {
3389 if (!dev->analog_ep_isoc || (try_bulk && dev->analog_ep_bulk))
3390 dev->analog_xfer_bulk = 1;
3391 em28xx_info("analog set to %s mode.\n",
3392 dev->analog_xfer_bulk ? "bulk" : "isoc");
3393 }
Gianluca Gennari86d38d12012-02-13 13:59:22 -03003394 if (has_dvb) {
Mauro Carvalho Chehab8b2aea72012-12-23 13:25:38 -02003395 if (!dev->dvb_ep_isoc || (try_bulk && dev->dvb_ep_bulk))
3396 dev->dvb_xfer_bulk = 1;
3397
3398 em28xx_info("dvb set to %s mode.\n",
3399 dev->dvb_xfer_bulk ? "bulk" : "isoc");
3400
Frank Schaeferc647a912012-11-08 14:11:52 -03003401 /* pre-allocate DVB usb transfer buffers */
3402 if (dev->dvb_xfer_bulk) {
3403 retval = em28xx_alloc_urbs(dev, EM28XX_DIGITAL_MODE,
3404 dev->dvb_xfer_bulk,
3405 EM28XX_DVB_NUM_BUFS,
3406 512,
3407 EM28XX_DVB_BULK_PACKET_MULTIPLIER);
3408 } else {
3409 retval = em28xx_alloc_urbs(dev, EM28XX_DIGITAL_MODE,
3410 dev->dvb_xfer_bulk,
3411 EM28XX_DVB_NUM_BUFS,
3412 dev->dvb_max_pkt_size_isoc,
3413 EM28XX_DVB_NUM_ISOC_PACKETS);
3414 }
Gianluca Gennari86d38d12012-02-13 13:59:22 -03003415 if (retval) {
Frank Schaeferc647a912012-11-08 14:11:52 -03003416 printk(DRIVER_NAME
3417 ": Failed to pre-allocate USB transfer buffers for DVB.\n");
Gianluca Gennari86d38d12012-02-13 13:59:22 -03003418 goto unlock_and_free;
3419 }
3420 }
3421
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003422 request_modules(dev);
3423
3424 /* Should be the last thing to do, to avoid newer udev's to
3425 open the device before fully initializing it
3426 */
3427 mutex_unlock(&dev->lock);
3428
3429 return 0;
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003430
Holger Nelson8ab33622011-12-28 18:55:41 -03003431unlock_and_free:
3432 mutex_unlock(&dev->lock);
3433
3434err_free:
Frank Schaefer0cf544a2012-11-08 14:11:49 -03003435 kfree(dev->alt_max_pkt_size_isoc);
Holger Nelson8ab33622011-12-28 18:55:41 -03003436 kfree(dev);
3437
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003438err:
Chris Rankin38b61eb2011-08-20 08:21:03 -03003439 clear_bit(nr, &em28xx_devused);
3440
3441err_no_slot:
3442 usb_put_dev(udev);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003443 return retval;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003444}
3445
3446/*
3447 * em28xx_usb_disconnect()
Chris Rankind7222e72011-09-24 11:02:32 -03003448 * called when the device gets disconnected
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003449 * video device will be unregistered on v4l2_close in case it is still open
3450 */
3451static void em28xx_usb_disconnect(struct usb_interface *interface)
3452{
3453 struct em28xx *dev;
3454
3455 dev = usb_get_intfdata(interface);
3456 usb_set_intfdata(interface, NULL);
3457
3458 if (!dev)
3459 return;
3460
Frank Schaefer05fe2172012-12-27 19:02:44 -03003461 dev->disconnected = 1;
3462
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003463 if (dev->is_audio_only) {
3464 mutex_lock(&dev->lock);
3465 em28xx_close_extension(dev);
3466 mutex_unlock(&dev->lock);
3467 return;
3468 }
3469
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003470 em28xx_info("disconnecting %s\n", dev->vdev->name);
3471
Tejun Heo707bcf32010-12-24 16:14:20 +01003472 flush_request_modules(dev);
3473
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003474 mutex_lock(&dev->lock);
3475
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003476 v4l2_device_disconnect(&dev->v4l2_dev);
3477
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003478 if (dev->users) {
Frank Schaefer05fe2172012-12-27 19:02:44 -03003479 em28xx_warn("device %s is open! Deregistration and memory deallocation are deferred on close.\n",
3480 video_device_node_name(dev->vdev));
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003481
Frank Schaefer05fe2172012-12-27 19:02:44 -03003482 em28xx_uninit_usb_xfer(dev, EM28XX_ANALOG_MODE);
3483 em28xx_uninit_usb_xfer(dev, EM28XX_DIGITAL_MODE);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003484 }
3485
Frank Schaefer05fe2172012-12-27 19:02:44 -03003486 em28xx_close_extension(dev);
3487 /* NOTE: must be called BEFORE the resources are released */
3488
3489 if (!dev->users)
3490 em28xx_release_resources(dev);
Gianluca Gennari86d38d12012-02-13 13:59:22 -03003491
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003492 mutex_unlock(&dev->lock);
3493
3494 if (!dev->users) {
Frank Schaefer0cf544a2012-11-08 14:11:49 -03003495 kfree(dev->alt_max_pkt_size_isoc);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003496 kfree(dev);
3497 }
3498}
3499
3500static struct usb_driver em28xx_usb_driver = {
3501 .name = "em28xx",
3502 .probe = em28xx_usb_probe,
3503 .disconnect = em28xx_usb_disconnect,
3504 .id_table = em28xx_id_table,
3505};
3506
Greg Kroah-Hartmanecb3b2b2011-11-18 09:46:12 -08003507module_usb_driver(em28xx_usb_driver);