blob: 0a5aa6223adff7699abec10ef1d6f2e13cf1cd5d [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>
Hans Verkuil3c7c9372011-01-08 07:08:02 -030037#include <media/mt9v011.h>
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -030038#include <media/i2c-addr.h>
Mauro Carvalho Chehab1f6173e2005-11-08 21:37:16 -080039#include <media/tveeprom.h>
Mauro Carvalho Chehab9bb13a62006-01-09 15:25:37 -020040#include <media/v4l2-common.h>
Hans Verkuil38f9d302008-07-23 05:09:15 -030041#include <media/v4l2-chip-ident.h>
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -080042
Mauro Carvalho Chehabf7abcd32005-11-08 21:38:25 -080043#include "em28xx.h"
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -080044
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -030045#define DRIVER_NAME "em28xx"
46
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -030047static int tuner = -1;
48module_param(tuner, int, 0444);
49MODULE_PARM_DESC(tuner, "tuner type");
50
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -030051static unsigned int disable_ir;
52module_param(disable_ir, int, 0444);
53MODULE_PARM_DESC(disable_ir, "disable infrared remote support");
54
Devin Heitmuellere2a1b792009-05-27 23:44:10 -030055static unsigned int disable_usb_speed_check;
56module_param(disable_usb_speed_check, int, 0444);
57MODULE_PARM_DESC(disable_usb_speed_check,
58 "override min bandwidth requirement of 480M bps");
59
Devin Heitmuellerd3829fa2013-01-04 16:16:24 -030060static unsigned int card[] = {[0 ... (EM28XX_MAXBOARDS - 1)] = -1U };
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -030061module_param_array(card, int, NULL, 0444);
62MODULE_PARM_DESC(card, "card type");
63
Frank Schaefer7e5d74e2012-12-26 15:12:37 -030064static int usb_xfer_mode = -1;
65module_param(usb_xfer_mode, int, 0444);
66MODULE_PARM_DESC(usb_xfer_mode,
67 "USB transfer mode for frame data (-1 = auto, 0 = prefer isoc, 1 = prefer bulk)");
Frank Schaefer454fe922012-11-08 14:11:53 -030068
69
Chris Rankin38b61eb2011-08-20 08:21:03 -030070/* Bitmask marking allocated devices from 0 to EM28XX_MAXBOARDS - 1 */
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -030071static unsigned long em28xx_devused;
72
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -030073struct em28xx_hash_table {
74 unsigned long hash;
75 unsigned int model;
76 unsigned int tuner;
77};
78
Ezequiel Garcia60332f02012-04-28 09:57:01 -030079static void em28xx_pre_card_setup(struct em28xx *dev);
80
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -030081/*
82 * Reset sequences for analog/digital modes
83 */
84
85/* Reset for the most [analog] boards */
86static struct em28xx_reg_seq default_analog[] = {
87 {EM28XX_R08_GPIO, 0x6d, ~EM_GPIO_4, 10},
88 { -1, -1, -1, -1},
89};
90
91/* Reset for the most [digital] boards */
92static struct em28xx_reg_seq default_digital[] = {
93 {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
94 { -1, -1, -1, -1},
95};
96
97/* Board Hauppauge WinTV HVR 900 analog */
98static struct em28xx_reg_seq hauppauge_wintv_hvr_900_analog[] = {
99 {EM28XX_R08_GPIO, 0x2d, ~EM_GPIO_4, 10},
100 {0x05, 0xff, 0x10, 10},
101 { -1, -1, -1, -1},
102};
103
104/* Board Hauppauge WinTV HVR 900 digital */
105static struct em28xx_reg_seq hauppauge_wintv_hvr_900_digital[] = {
106 {EM28XX_R08_GPIO, 0x2e, ~EM_GPIO_4, 10},
107 {EM2880_R04_GPO, 0x04, 0x0f, 10},
108 {EM2880_R04_GPO, 0x0c, 0x0f, 10},
109 { -1, -1, -1, -1},
110};
111
Devin Heitmueller7030f522011-03-13 02:04:53 -0300112/* Board Hauppauge WinTV HVR 900 (R2) digital */
113static struct em28xx_reg_seq hauppauge_wintv_hvr_900R2_digital[] = {
114 {EM28XX_R08_GPIO, 0x2e, ~EM_GPIO_4, 10},
115 {EM2880_R04_GPO, 0x0c, 0x0f, 10},
116 { -1, -1, -1, -1},
117};
118
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300119/* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
120static struct em28xx_reg_seq em2880_msi_digivox_ad_analog[] = {
121 {EM28XX_R08_GPIO, 0x69, ~EM_GPIO_4, 10},
122 { -1, -1, -1, -1},
123};
124
125/* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300126
127/* Board - EM2870 Kworld 355u
128 Analog - No input analog */
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300129
Franklin Mengd7de5d82009-06-06 17:05:02 -0300130/* Board - EM2882 Kworld 315U digital */
131static struct em28xx_reg_seq em2882_kworld_315u_digital[] = {
132 {EM28XX_R08_GPIO, 0xff, 0xff, 10},
133 {EM28XX_R08_GPIO, 0xfe, 0xff, 10},
134 {EM2880_R04_GPO, 0x04, 0xff, 10},
135 {EM2880_R04_GPO, 0x0c, 0xff, 10},
136 {EM28XX_R08_GPIO, 0x7e, 0xff, 10},
137 { -1, -1, -1, -1},
138};
139
140static struct em28xx_reg_seq em2882_kworld_315u_tuner_gpio[] = {
141 {EM2880_R04_GPO, 0x08, 0xff, 10},
142 {EM2880_R04_GPO, 0x0c, 0xff, 10},
143 {EM2880_R04_GPO, 0x08, 0xff, 10},
144 {EM2880_R04_GPO, 0x0c, 0xff, 10},
145 { -1, -1, -1, -1},
146};
147
Robert Krakora6e7b9ea2009-01-18 21:59:34 -0300148static struct em28xx_reg_seq kworld_330u_analog[] = {
149 {EM28XX_R08_GPIO, 0x6d, ~EM_GPIO_4, 10},
150 {EM2880_R04_GPO, 0x00, 0xff, 10},
151 { -1, -1, -1, -1},
152};
153
154static struct em28xx_reg_seq kworld_330u_digital[] = {
155 {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
156 {EM2880_R04_GPO, 0x08, 0xff, 10},
157 { -1, -1, -1, -1},
158};
159
Devin Heitmueller19859222009-06-19 00:33:54 -0300160/* Evga inDtube
161 GPIO0 - Enable digital power (s5h1409) - low to enable
162 GPIO1 - Enable analog power (tvp5150/emp202) - low to enable
163 GPIO4 - xc3028 reset
164 GOP3 - s5h1409 reset
165 */
166static struct em28xx_reg_seq evga_indtube_analog[] = {
167 {EM28XX_R08_GPIO, 0x79, 0xff, 60},
168 { -1, -1, -1, -1},
169};
170
171static struct em28xx_reg_seq evga_indtube_digital[] = {
172 {EM28XX_R08_GPIO, 0x7a, 0xff, 1},
173 {EM2880_R04_GPO, 0x04, 0xff, 10},
174 {EM2880_R04_GPO, 0x0c, 0xff, 1},
175 { -1, -1, -1, -1},
176};
177
Jarod Wilson7e48b302010-03-07 17:55:43 -0300178/*
179 * KWorld PlusTV 340U and UB435-Q (ATSC) GPIOs map:
180 * EM_GPIO_0 - currently unknown
181 * EM_GPIO_1 - LED disable/enable (1 = off, 0 = on)
182 * EM_GPIO_2 - currently unknown
183 * EM_GPIO_3 - currently unknown
184 * EM_GPIO_4 - TDA18271HD/C1 tuner (1 = active, 0 = in reset)
185 * EM_GPIO_5 - LGDT3304 ATSC/QAM demod (1 = active, 0 = in reset)
186 * EM_GPIO_6 - currently unknown
187 * EM_GPIO_7 - currently unknown
188 */
189static struct em28xx_reg_seq kworld_a340_digital[] = {
190 {EM28XX_R08_GPIO, 0x6d, ~EM_GPIO_4, 10},
191 { -1, -1, -1, -1},
192};
193
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -0300194/* Pinnacle Hybrid Pro eb1a:2881 */
195static struct em28xx_reg_seq pinnacle_hybrid_pro_analog[] = {
Devin Heitmueller44010442009-07-08 22:18:15 -0300196 {EM28XX_R08_GPIO, 0xfd, ~EM_GPIO_4, 10},
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -0300197 { -1, -1, -1, -1},
198};
199
200static struct em28xx_reg_seq pinnacle_hybrid_pro_digital[] = {
201 {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
202 {EM2880_R04_GPO, 0x04, 0xff, 100},/* zl10353 reset */
203 {EM2880_R04_GPO, 0x0c, 0xff, 1},
204 { -1, -1, -1, -1},
205};
206
Michel Garniercec4e6c2010-10-16 14:42:01 -0300207static struct em28xx_reg_seq terratec_cinergy_USB_XS_FR_analog[] = {
208 {EM28XX_R08_GPIO, 0x6d, ~EM_GPIO_4, 10},
209 {EM2880_R04_GPO, 0x00, 0xff, 10},
210 { -1, -1, -1, -1},
211};
212
213static struct em28xx_reg_seq terratec_cinergy_USB_XS_FR_digital[] = {
214 {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
215 {EM2880_R04_GPO, 0x08, 0xff, 10},
216 { -1, -1, -1, -1},
217};
218
Antti Palosaari285eb1a2009-09-15 14:42:13 -0300219/* eb1a:2868 Reddo DVB-C USB TV Box
220 GPIO4 - CU1216L NIM
221 Other GPIOs seems to be don't care. */
222static struct em28xx_reg_seq reddo_dvb_c_usb_box[] = {
223 {EM28XX_R08_GPIO, 0xfe, 0xff, 10},
224 {EM28XX_R08_GPIO, 0xde, 0xff, 10},
225 {EM28XX_R08_GPIO, 0xfe, 0xff, 10},
226 {EM28XX_R08_GPIO, 0xff, 0xff, 10},
227 {EM28XX_R08_GPIO, 0x7f, 0xff, 10},
228 {EM28XX_R08_GPIO, 0x6f, 0xff, 10},
229 {EM28XX_R08_GPIO, 0xff, 0xff, 10},
230 {-1, -1, -1, -1},
231};
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -0300232
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300233/* Callback for the most boards */
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300234static struct em28xx_reg_seq default_tuner_gpio[] = {
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300235 {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10},
236 {EM28XX_R08_GPIO, 0, EM_GPIO_4, 10},
237 {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10},
238 { -1, -1, -1, -1},
239};
240
Vitaly Wool2bd1d9eb2009-03-04 08:27:52 -0300241/* Mute/unmute */
242static struct em28xx_reg_seq compro_unmute_tv_gpio[] = {
243 {EM28XX_R08_GPIO, 5, 7, 10},
244 { -1, -1, -1, -1},
245};
246
247static struct em28xx_reg_seq compro_unmute_svid_gpio[] = {
248 {EM28XX_R08_GPIO, 4, 7, 10},
249 { -1, -1, -1, -1},
250};
251
252static struct em28xx_reg_seq compro_mute_gpio[] = {
253 {EM28XX_R08_GPIO, 6, 7, 10},
254 { -1, -1, -1, -1},
255};
256
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -0300257/* Terratec AV350 */
258static struct em28xx_reg_seq terratec_av350_mute_gpio[] = {
259 {EM28XX_R08_GPIO, 0xff, 0x7f, 10},
260 { -1, -1, -1, -1},
261};
262
263static struct em28xx_reg_seq terratec_av350_unmute_gpio[] = {
264 {EM28XX_R08_GPIO, 0xff, 0xff, 10},
265 { -1, -1, -1, -1},
266};
Mauro Carvalho Chehab02e78042009-06-29 11:35:05 -0300267
268static struct em28xx_reg_seq silvercrest_reg_seq[] = {
269 {EM28XX_R08_GPIO, 0xff, 0xff, 10},
270 {EM28XX_R08_GPIO, 0x01, 0xf7, 10},
271 { -1, -1, -1, -1},
272};
273
Mauro Carvalho Chehab694a1012009-11-26 21:26:13 -0300274static struct em28xx_reg_seq vc211a_enable[] = {
275 {EM28XX_R08_GPIO, 0xff, 0x07, 10},
276 {EM28XX_R08_GPIO, 0xff, 0x0f, 10},
277 {EM28XX_R08_GPIO, 0xff, 0x0b, 10},
278 { -1, -1, -1, -1},
279};
280
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -0300281static struct em28xx_reg_seq dikom_dk300_digital[] = {
282 {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
283 {EM2880_R04_GPO, 0x08, 0xff, 10},
284 { -1, -1, -1, -1},
285};
286
Mauro Carvalho Chehab694a1012009-11-26 21:26:13 -0300287
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -0300288/* Reset for the most [digital] boards */
289static struct em28xx_reg_seq leadership_digital[] = {
290 {EM2874_R80_GPIO, 0x70, 0xff, 10},
291 { -1, -1, -1, -1},
292};
293
294static struct em28xx_reg_seq leadership_reset[] = {
295 {EM2874_R80_GPIO, 0xf0, 0xff, 10},
296 {EM2874_R80_GPIO, 0xb0, 0xff, 10},
297 {EM2874_R80_GPIO, 0xf0, 0xff, 10},
298 { -1, -1, -1, -1},
299};
300
Antti Palosaari460312e2011-05-25 17:03:50 -0300301/* 2013:024f PCTV nanoStick T2 290e
Antti Palosaarid6a5f922011-04-07 16:34:44 -0300302 * GPIO_6 - demod reset
303 * GPIO_7 - LED
304 */
305static struct em28xx_reg_seq pctv_290e[] = {
306 {EM2874_R80_GPIO, 0x00, 0xff, 80},
307 {EM2874_R80_GPIO, 0x40, 0xff, 80}, /* GPIO_6 = 1 */
308 {EM2874_R80_GPIO, 0xc0, 0xff, 80}, /* GPIO_7 = 1 */
309 {-1, -1, -1, -1},
310};
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -0300311
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -0300312#if 0
313static struct em28xx_reg_seq terratec_h5_gpio[] = {
314 {EM28XX_R08_GPIO, 0xff, 0xff, 10},
315 {EM2874_R80_GPIO, 0xf6, 0xff, 100},
316 {EM2874_R80_GPIO, 0xf2, 0xff, 50},
317 {EM2874_R80_GPIO, 0xf6, 0xff, 50},
318 { -1, -1, -1, -1},
319};
320
321static struct em28xx_reg_seq terratec_h5_digital[] = {
322 {EM2874_R80_GPIO, 0xf6, 0xff, 10},
323 {EM2874_R80_GPIO, 0xe6, 0xff, 100},
324 {EM2874_R80_GPIO, 0xa6, 0xff, 10},
325 { -1, -1, -1, -1},
326};
327#endif
328
Antti Palosaari36588712011-08-01 01:15:30 -0300329/* 2013:024f PCTV DVB-S2 Stick 460e
330 * GPIO_0 - POWER_ON
331 * GPIO_1 - BOOST
332 * GPIO_2 - VUV_LNB (red LED)
333 * GPIO_3 - EXT_12V
334 * GPIO_4 - INT_DEM (DEMOD GPIO_0)
335 * GPIO_5 - INT_LNB
336 * GPIO_6 - RESET_DEM
337 * GPIO_7 - LED (green LED)
338 */
339static struct em28xx_reg_seq pctv_460e[] = {
340 {EM2874_R80_GPIO, 0x01, 0xff, 50},
341 {0x0d, 0xff, 0xff, 50},
342 {EM2874_R80_GPIO, 0x41, 0xff, 50}, /* GPIO_6=1 */
343 {0x0d, 0x42, 0xff, 50},
344 {EM2874_R80_GPIO, 0x61, 0xff, 50}, /* GPIO_5=1 */
345 { -1, -1, -1, -1},
346};
347
Mauro Carvalho Chehab85032322011-11-24 15:01:45 -0200348#if 0
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -0300349static struct em28xx_reg_seq hauppauge_930c_gpio[] = {
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -0300350 {EM2874_R80_GPIO, 0x6f, 0xff, 10},
Mauro Carvalho Chehabde724052011-11-20 11:23:24 -0200351 {EM2874_R80_GPIO, 0x4f, 0xff, 10}, /* xc5000 reset */
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -0300352 {EM2874_R80_GPIO, 0x6f, 0xff, 10},
353 {EM2874_R80_GPIO, 0x4f, 0xff, 10},
354 { -1, -1, -1, -1},
355};
356
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -0300357static struct em28xx_reg_seq hauppauge_930c_digital[] = {
358 {EM2874_R80_GPIO, 0xf6, 0xff, 10},
359 {EM2874_R80_GPIO, 0xe6, 0xff, 100},
360 {EM2874_R80_GPIO, 0xa6, 0xff, 10},
361 { -1, -1, -1, -1},
362};
363#endif
364
Antti Palosaari35530852012-03-18 18:09:01 -0300365/* 1b80:e425 MaxMedia UB425-TC
366 * GPIO_6 - demod reset, 0=active
367 * GPIO_7 - LED, 0=active
368 */
369static struct em28xx_reg_seq maxmedia_ub425_tc[] = {
370 {EM2874_R80_GPIO, 0x83, 0xff, 100},
371 {EM2874_R80_GPIO, 0xc3, 0xff, 100}, /* GPIO_6 = 1 */
372 {EM2874_R80_GPIO, 0x43, 0xff, 000}, /* GPIO_7 = 0 */
373 {-1, -1, -1, -1},
374};
375
Ivan Kalvachevfa5527c2012-03-19 20:09:55 -0300376/* 2304:0242 PCTV QuatroStick (510e)
377 * GPIO_2: decoder reset, 0=active
378 * GPIO_4: decoder suspend, 0=active
379 * GPIO_6: demod reset, 0=active
380 * GPIO_7: LED, 1=active
381 */
382static struct em28xx_reg_seq pctv_510e[] = {
383 {EM2874_R80_GPIO, 0x10, 0xff, 100},
384 {EM2874_R80_GPIO, 0x14, 0xff, 100}, /* GPIO_2 = 1 */
385 {EM2874_R80_GPIO, 0x54, 0xff, 050}, /* GPIO_6 = 1 */
386 { -1, -1, -1, -1},
387};
388
Antti Palosaaric247d7b2012-03-19 11:48:19 -0300389/* 2013:0251 PCTV QuatroStick nano (520e)
390 * GPIO_2: decoder reset, 0=active
391 * GPIO_4: decoder suspend, 0=active
392 * GPIO_6: demod reset, 0=active
393 * GPIO_7: LED, 1=active
394 */
395static struct em28xx_reg_seq pctv_520e[] = {
396 {EM2874_R80_GPIO, 0x10, 0xff, 100},
397 {EM2874_R80_GPIO, 0x14, 0xff, 100}, /* GPIO_2 = 1 */
398 {EM2874_R80_GPIO, 0x54, 0xff, 050}, /* GPIO_6 = 1 */
399 {EM2874_R80_GPIO, 0xd4, 0xff, 000}, /* GPIO_7 = 1 */
400 { -1, -1, -1, -1},
401};
402
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300403/*
404 * Board definitions
405 */
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800406struct em28xx_board em28xx_boards[] = {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300407 [EM2750_BOARD_UNKNOWN] = {
Mauro Carvalho Chehab8b220792009-07-12 10:56:21 -0300408 .name = "EM2710/EM2750/EM2751 webcam grabber",
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -0300409 .xclk = EM28XX_XCLK_FREQUENCY_20MHZ,
Mauro Carvalho Chehab8a2e6992009-07-12 10:26:36 -0300410 .tuner_type = TUNER_ABSENT,
411 .is_webcam = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300412 .input = { {
413 .type = EM28XX_VMUX_COMPOSITE1,
414 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300415 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -0300416 .gpio = silvercrest_reg_seq,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300417 } },
418 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800419 [EM2800_BOARD_UNKNOWN] = {
420 .name = "Unknown EM2800 video grabber",
421 .is_em2800 = 1,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800422 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300423 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300424 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300425 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800426 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300427 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300428 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300429 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800430 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300431 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300432 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300433 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800434 },
435 [EM2820_BOARD_UNKNOWN] = {
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300436 .name = "Unknown EM2750/28xx video grabber",
437 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabb04fb662009-07-13 01:28:21 -0300438 .is_webcam = 1, /* To enable sensor probe */
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800439 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300440 [EM2750_BOARD_DLCW_130] = {
441 /* Beijing Huaqi Information Digital Technology Co., Ltd */
442 .name = "Huaqi DLCW-130",
443 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300444 .xclk = EM28XX_XCLK_FREQUENCY_48MHZ,
Mauro Carvalho Chehab8a2e6992009-07-12 10:26:36 -0300445 .tuner_type = TUNER_ABSENT,
446 .is_webcam = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300447 .input = { {
448 .type = EM28XX_VMUX_COMPOSITE1,
449 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300450 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300451 } },
452 },
Markus Rechberger4d17d082006-02-07 06:25:39 -0200453 [EM2820_BOARD_KWORLD_PVRTV2800RF] = {
Markus Rechberger33ccaa32006-02-07 06:25:41 -0200454 .name = "Kworld PVR TV 2800 RF",
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -0300455 .tuner_type = TUNER_TEMIC_PAL,
Markus Rechberger4d17d082006-02-07 06:25:39 -0200456 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300457 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300458 .input = { {
Markus Rechberger4d17d082006-02-07 06:25:39 -0200459 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300460 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300461 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300462 }, {
Markus Rechberger4d17d082006-02-07 06:25:39 -0200463 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300464 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300465 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300466 } },
Markus Rechberger4d17d082006-02-07 06:25:39 -0200467 },
Douglas Schilling Landgraff7fe3e62009-01-19 09:31:55 -0300468 [EM2820_BOARD_GADMEI_TVR200] = {
469 .name = "Gadmei TVR200",
470 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
471 .tda9887_conf = TDA9887_PRESENT,
472 .decoder = EM28XX_SAA711X,
473 .input = { {
474 .type = EM28XX_VMUX_TELEVISION,
475 .vmux = SAA7115_COMPOSITE2,
476 .amux = EM28XX_AMUX_LINE_IN,
477 }, {
478 .type = EM28XX_VMUX_COMPOSITE1,
479 .vmux = SAA7115_COMPOSITE0,
480 .amux = EM28XX_AMUX_LINE_IN,
481 }, {
482 .type = EM28XX_VMUX_SVIDEO,
483 .vmux = SAA7115_SVIDEO3,
484 .amux = EM28XX_AMUX_LINE_IN,
485 } },
486 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800487 [EM2820_BOARD_TERRATEC_CINERGY_250] = {
488 .name = "Terratec Cinergy 250 USB",
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800489 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
Mauro Carvalho Chehabac07bb72009-09-08 14:04:41 -0300490 .has_ir_i2c = 1,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800491 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300492 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300493 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800494 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300495 .vmux = SAA7115_COMPOSITE2,
Frank Schaefer5e8d02b2013-01-05 08:44:09 -0300496 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300497 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800498 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300499 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300500 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300501 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800502 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300503 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300504 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300505 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800506 },
507 [EM2820_BOARD_PINNACLE_USB_2] = {
508 .name = "Pinnacle PCTV USB 2",
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800509 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
Mauro Carvalho Chehabac07bb72009-09-08 14:04:41 -0300510 .has_ir_i2c = 1,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800511 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300512 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300513 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800514 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300515 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300516 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300517 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800518 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300519 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300520 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300521 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800522 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300523 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300524 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300525 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800526 },
527 [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2] = {
528 .name = "Hauppauge WinTV USB 2",
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800529 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300530 .tda9887_conf = TDA9887_PRESENT |
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -0300531 TDA9887_PORT1_ACTIVE |
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300532 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800533 .decoder = EM28XX_TVP5150,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800534 .has_msp34xx = 1,
Mauro Carvalho Chehabac07bb72009-09-08 14:04:41 -0300535 .has_ir_i2c = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300536 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800537 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300538 .vmux = TVP5150_COMPOSITE0,
Hans Verkuil2474ed42006-03-19 12:35:57 -0300539 .amux = MSP_INPUT_DEFAULT,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300540 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800541 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300542 .vmux = TVP5150_SVIDEO,
Hans Verkuil07151722006-04-01 18:03:23 -0300543 .amux = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1,
544 MSP_DSP_IN_SCART, MSP_DSP_IN_SCART),
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300545 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800546 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300547 [EM2820_BOARD_DLINK_USB_TV] = {
548 .name = "D-Link DUB-T210 TV Tuner",
549 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300550 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
551 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300552 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300553 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300554 .type = EM28XX_VMUX_TELEVISION,
555 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300556 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300557 }, {
558 .type = EM28XX_VMUX_COMPOSITE1,
559 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300560 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300561 }, {
562 .type = EM28XX_VMUX_SVIDEO,
563 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300564 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300565 } },
566 },
567 [EM2820_BOARD_HERCULES_SMART_TV_USB2] = {
568 .name = "Hercules Smart TV USB 2.0",
569 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300570 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
571 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300572 .decoder = EM28XX_SAA711X,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300573 .input = { {
574 .type = EM28XX_VMUX_TELEVISION,
575 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300576 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300577 }, {
578 .type = EM28XX_VMUX_COMPOSITE1,
579 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300580 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300581 }, {
582 .type = EM28XX_VMUX_SVIDEO,
583 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300584 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300585 } },
586 },
587 [EM2820_BOARD_PINNACLE_USB_2_FM1216ME] = {
588 .name = "Pinnacle PCTV USB 2 (Philips FM1216ME)",
589 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300590 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
591 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300592 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300593 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300594 .type = EM28XX_VMUX_TELEVISION,
595 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300596 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300597 }, {
598 .type = EM28XX_VMUX_COMPOSITE1,
599 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300600 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300601 }, {
602 .type = EM28XX_VMUX_SVIDEO,
603 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300604 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300605 } },
606 },
607 [EM2820_BOARD_GADMEI_UTV310] = {
608 .name = "Gadmei UTV310",
609 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300610 .tuner_type = TUNER_TNF_5335MF,
611 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300612 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300613 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300614 .type = EM28XX_VMUX_TELEVISION,
615 .vmux = SAA7115_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300616 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300617 }, {
618 .type = EM28XX_VMUX_COMPOSITE1,
619 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300620 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300621 }, {
622 .type = EM28XX_VMUX_SVIDEO,
623 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300624 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300625 } },
626 },
627 [EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE] = {
628 .name = "Leadtek Winfast USB II Deluxe",
629 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300630 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
Magnus Almca39d842009-11-13 05:48:24 -0300631 .has_ir_i2c = 1,
632 .tvaudio_addr = 0x58,
633 .tda9887_conf = TDA9887_PRESENT |
634 TDA9887_PORT2_ACTIVE |
635 TDA9887_QSS,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300636 .decoder = EM28XX_SAA711X,
Magnus Almca39d842009-11-13 05:48:24 -0300637 .adecoder = EM28XX_TVAUDIO,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300638 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300639 .type = EM28XX_VMUX_TELEVISION,
Magnus Almca39d842009-11-13 05:48:24 -0300640 .vmux = SAA7115_COMPOSITE4,
641 .amux = EM28XX_AMUX_AUX,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300642 }, {
643 .type = EM28XX_VMUX_COMPOSITE1,
Magnus Almca39d842009-11-13 05:48:24 -0300644 .vmux = SAA7115_COMPOSITE5,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300645 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300646 }, {
647 .type = EM28XX_VMUX_SVIDEO,
Magnus Almca39d842009-11-13 05:48:24 -0300648 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300649 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300650 } },
Magnus Almca39d842009-11-13 05:48:24 -0300651 .radio = {
652 .type = EM28XX_RADIO,
653 .amux = EM28XX_AMUX_AUX,
654 }
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300655 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300656 [EM2820_BOARD_VIDEOLOGY_20K14XUSB] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300657 .name = "Videology 20K14XUSB USB2.0",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300658 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehab8a2e6992009-07-12 10:26:36 -0300659 .tuner_type = TUNER_ABSENT,
660 .is_webcam = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300661 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300662 .type = EM28XX_VMUX_COMPOSITE1,
663 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300664 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300665 } },
666 },
Mauro Carvalho Chehab02e78042009-06-29 11:35:05 -0300667 [EM2820_BOARD_SILVERCREST_WEBCAM] = {
668 .name = "Silvercrest Webcam 1.3mpix",
669 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabc43221d2009-07-12 10:23:23 -0300670 .is_webcam = 1,
Mauro Carvalho Chehab02e78042009-06-29 11:35:05 -0300671 .input = { {
672 .type = EM28XX_VMUX_COMPOSITE1,
673 .vmux = 0,
674 .amux = EM28XX_AMUX_VIDEO,
675 .gpio = silvercrest_reg_seq,
676 } },
677 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300678 [EM2821_BOARD_SUPERCOMP_USB_2] = {
679 .name = "Supercomp USB 2.0 TV",
680 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300681 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
682 .tda9887_conf = TDA9887_PRESENT |
683 TDA9887_PORT1_ACTIVE |
684 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300685 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300686 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300687 .type = EM28XX_VMUX_TELEVISION,
688 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300689 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300690 }, {
691 .type = EM28XX_VMUX_COMPOSITE1,
692 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300693 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300694 }, {
695 .type = EM28XX_VMUX_SVIDEO,
696 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300697 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300698 } },
699 },
700 [EM2821_BOARD_USBGEAR_VD204] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300701 .name = "Usbgear VD204v9",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300702 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300703 .tuner_type = TUNER_ABSENT, /* Capture only device */
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300704 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300705 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300706 .type = EM28XX_VMUX_COMPOSITE1,
707 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300708 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300709 }, {
710 .type = EM28XX_VMUX_SVIDEO,
711 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300712 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300713 } },
714 },
715 [EM2860_BOARD_NETGMBH_CAM] = {
716 /* Beijing Huaqi Information Digital Technology Co., Ltd */
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300717 .name = "NetGMBH Cam",
718 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehab8a2e6992009-07-12 10:26:36 -0300719 .tuner_type = TUNER_ABSENT,
720 .is_webcam = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300721 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300722 .type = EM28XX_VMUX_COMPOSITE1,
723 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300724 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300725 } },
726 },
727 [EM2860_BOARD_TYPHOON_DVD_MAKER] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300728 .name = "Typhoon DVD Maker",
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300729 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300730 .tuner_type = TUNER_ABSENT, /* Capture only device */
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300731 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300732 .type = EM28XX_VMUX_COMPOSITE1,
733 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300734 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300735 }, {
736 .type = EM28XX_VMUX_SVIDEO,
737 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300738 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300739 } },
740 },
741 [EM2860_BOARD_GADMEI_UTV330] = {
742 .name = "Gadmei UTV330",
743 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300744 .tuner_type = TUNER_TNF_5335MF,
745 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300746 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300747 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300748 .type = EM28XX_VMUX_TELEVISION,
749 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300750 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300751 }, {
752 .type = EM28XX_VMUX_COMPOSITE1,
753 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300754 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300755 }, {
756 .type = EM28XX_VMUX_SVIDEO,
757 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300758 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300759 } },
760 },
Mauro Carvalho Chehab6d888a62009-08-30 13:05:56 -0300761 [EM2861_BOARD_GADMEI_UTV330PLUS] = {
762 .name = "Gadmei UTV330+",
763 .tuner_type = TUNER_TNF_5335MF,
764 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -0300765 .ir_codes = RC_MAP_GADMEI_RM008Z,
Mauro Carvalho Chehab6d888a62009-08-30 13:05:56 -0300766 .decoder = EM28XX_SAA711X,
767 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
768 .input = { {
769 .type = EM28XX_VMUX_TELEVISION,
770 .vmux = SAA7115_COMPOSITE2,
771 .amux = EM28XX_AMUX_VIDEO,
772 }, {
773 .type = EM28XX_VMUX_COMPOSITE1,
774 .vmux = SAA7115_COMPOSITE0,
775 .amux = EM28XX_AMUX_LINE_IN,
776 }, {
777 .type = EM28XX_VMUX_SVIDEO,
778 .vmux = SAA7115_SVIDEO3,
779 .amux = EM28XX_AMUX_LINE_IN,
780 } },
781 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300782 [EM2860_BOARD_TERRATEC_HYBRID_XS] = {
783 .name = "Terratec Cinergy A Hybrid XS",
784 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300785 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300786 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300787 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300788
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300789 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300790 .type = EM28XX_VMUX_TELEVISION,
791 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300792 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300793 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300794 }, {
795 .type = EM28XX_VMUX_COMPOSITE1,
796 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300797 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300798 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300799 }, {
800 .type = EM28XX_VMUX_SVIDEO,
801 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300802 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300803 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300804 } },
805 },
806 [EM2861_BOARD_KWORLD_PVRTV_300U] = {
807 .name = "KWorld PVRTV 300U",
808 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300809 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300810 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300811 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300812 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300813 .type = EM28XX_VMUX_TELEVISION,
814 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300815 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300816 }, {
817 .type = EM28XX_VMUX_COMPOSITE1,
818 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300819 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300820 }, {
821 .type = EM28XX_VMUX_SVIDEO,
822 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300823 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300824 } },
825 },
826 [EM2861_BOARD_YAKUMO_MOVIE_MIXER] = {
827 .name = "Yakumo MovieMixer",
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -0300828 .tuner_type = TUNER_ABSENT, /* Capture only device */
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300829 .decoder = EM28XX_TVP5150,
830 .input = { {
831 .type = EM28XX_VMUX_TELEVISION,
832 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300833 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300834 }, {
835 .type = EM28XX_VMUX_COMPOSITE1,
836 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300837 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300838 }, {
839 .type = EM28XX_VMUX_SVIDEO,
840 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300841 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300842 } },
843 },
Devin Heitmueller443fed92010-03-19 23:53:12 -0300844 [EM2860_BOARD_TVP5150_REFERENCE_DESIGN] = {
845 .name = "EM2860/TVP5150 Reference Design",
846 .tuner_type = TUNER_ABSENT, /* Capture only device */
847 .decoder = EM28XX_TVP5150,
848 .input = { {
849 .type = EM28XX_VMUX_COMPOSITE1,
850 .vmux = TVP5150_COMPOSITE1,
851 .amux = EM28XX_AMUX_LINE_IN,
852 }, {
853 .type = EM28XX_VMUX_SVIDEO,
854 .vmux = TVP5150_SVIDEO,
855 .amux = EM28XX_AMUX_LINE_IN,
856 } },
857 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300858 [EM2861_BOARD_PLEXTOR_PX_TV100U] = {
859 .name = "Plextor ConvertX PX-TV100U",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300860 .tuner_type = TUNER_TNF_5335MF,
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -0300861 .xclk = EM28XX_XCLK_I2S_MSB_TIMING |
862 EM28XX_XCLK_FREQUENCY_12MHZ,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300863 .tda9887_conf = TDA9887_PRESENT,
864 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -0300865 .has_msp34xx = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300866 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300867 .type = EM28XX_VMUX_TELEVISION,
868 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300869 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -0300870 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300871 }, {
872 .type = EM28XX_VMUX_COMPOSITE1,
873 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300874 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -0300875 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300876 }, {
877 .type = EM28XX_VMUX_SVIDEO,
878 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300879 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -0300880 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300881 } },
882 },
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300883
884 /* Those boards with em2870 are DVB Only*/
885
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300886 [EM2870_BOARD_TERRATEC_XS] = {
887 .name = "Terratec Cinergy T XS",
888 .valid = EM28XX_BOARD_NOT_VALIDATED,
889 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300890 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300891 },
892 [EM2870_BOARD_TERRATEC_XS_MT2060] = {
893 .name = "Terratec Cinergy T XS (MT2060)",
894 .valid = EM28XX_BOARD_NOT_VALIDATED,
895 .tuner_type = TUNER_ABSENT, /* MT2060 */
896 },
897 [EM2870_BOARD_KWORLD_350U] = {
898 .name = "Kworld 350 U DVB-T",
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_KWORLD_355U] = {
904 .name = "Kworld 355 U DVB-T",
905 .valid = EM28XX_BOARD_NOT_VALIDATED,
Aivar Päkk1985f6f2011-12-11 18:15:00 -0300906 .tuner_type = TUNER_ABSENT,
907 .tuner_gpio = default_tuner_gpio,
908 .has_dvb = 1,
909 .dvb_gpio = default_digital,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300910 },
911 [EM2870_BOARD_PINNACLE_PCTV_DVB] = {
912 .name = "Pinnacle PCTV DVB-T",
913 .valid = EM28XX_BOARD_NOT_VALIDATED,
914 .tuner_type = TUNER_ABSENT, /* MT2060 */
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300915 /* djh - I have serious doubts this is right... */
916 .xclk = EM28XX_XCLK_IR_RC5_MODE |
917 EM28XX_XCLK_FREQUENCY_10MHZ,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300918 },
919 [EM2870_BOARD_COMPRO_VIDEOMATE] = {
920 .name = "Compro, VideoMate U3",
921 .valid = EM28XX_BOARD_NOT_VALIDATED,
922 .tuner_type = TUNER_ABSENT, /* MT2060 */
923 },
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300924
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300925 [EM2880_BOARD_TERRATEC_HYBRID_XS_FR] = {
926 .name = "Terratec Hybrid XS Secam",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300927 .has_msp34xx = 1,
928 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300929 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300930 .decoder = EM28XX_TVP5150,
Catimimi65638012010-02-18 18:06:32 -0300931 .has_dvb = 1,
Michel Garniercec4e6c2010-10-16 14:42:01 -0300932 .dvb_gpio = terratec_cinergy_USB_XS_FR_digital,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300933 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300934 .type = EM28XX_VMUX_TELEVISION,
935 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300936 .amux = EM28XX_AMUX_VIDEO,
Michel Garniercec4e6c2010-10-16 14:42:01 -0300937 .gpio = terratec_cinergy_USB_XS_FR_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300938 }, {
939 .type = EM28XX_VMUX_COMPOSITE1,
940 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300941 .amux = EM28XX_AMUX_LINE_IN,
Michel Garniercec4e6c2010-10-16 14:42:01 -0300942 .gpio = terratec_cinergy_USB_XS_FR_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300943 }, {
944 .type = EM28XX_VMUX_SVIDEO,
945 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300946 .amux = EM28XX_AMUX_LINE_IN,
Michel Garniercec4e6c2010-10-16 14:42:01 -0300947 .gpio = terratec_cinergy_USB_XS_FR_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300948 } },
949 },
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -0300950 [EM2884_BOARD_TERRATEC_H5] = {
951 .name = "Terratec Cinergy H5",
952 .has_dvb = 1,
953#if 0
954 .tuner_type = TUNER_PHILIPS_TDA8290,
955 .tuner_addr = 0x41,
956 .dvb_gpio = terratec_h5_digital, /* FIXME: probably wrong */
957 .tuner_gpio = terratec_h5_gpio,
Mauro Carvalho Chehabde724052011-11-20 11:23:24 -0200958#else
959 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -0300960#endif
961 .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT |
962 EM28XX_I2C_CLK_WAIT_ENABLE |
963 EM28XX_I2C_FREQ_400_KHZ,
964 },
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -0300965 [EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C] = {
966 .name = "Hauppauge WinTV HVR 930C",
967 .has_dvb = 1,
Mauro Carvalho Chehabde724052011-11-20 11:23:24 -0200968#if 0 /* FIXME: Add analog support */
969 .tuner_type = TUNER_XC5000,
970 .tuner_addr = 0x41,
971 .dvb_gpio = hauppauge_930c_digital,
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -0300972 .tuner_gpio = hauppauge_930c_gpio,
Mauro Carvalho Chehabde724052011-11-20 11:23:24 -0200973#else
974 .tuner_type = TUNER_ABSENT,
975#endif
Mauro Carvalho Chehabdfbbf5da2011-11-20 12:16:25 -0200976 .ir_codes = RC_MAP_HAUPPAUGE,
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -0300977 .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT |
978 EM28XX_I2C_CLK_WAIT_ENABLE |
979 EM28XX_I2C_FREQ_400_KHZ,
980 },
Andreas Oberrittera1ed02e2011-11-16 11:06:50 -0300981 [EM2884_BOARD_CINERGY_HTC_STICK] = {
982 .name = "Terratec Cinergy HTC Stick",
983 .has_dvb = 1,
Martin Blumenstinglc8dce002012-06-12 18:19:28 -0300984 .ir_codes = RC_MAP_NEC_TERRATEC_CINERGY_XS,
985 .tuner_type = TUNER_ABSENT,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800986 .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT |
987 EM28XX_I2C_CLK_WAIT_ENABLE |
988 EM28XX_I2C_FREQ_400_KHZ,
989 },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300990 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900] = {
Aidan Thornton122d1582007-11-20 15:25:08 -0300991 .name = "Hauppauge WinTV HVR 900",
Aidan Thornton122d1582007-11-20 15:25:08 -0300992 .tda9887_conf = TDA9887_PRESENT,
993 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300994 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab5add9a62007-11-22 12:08:53 -0300995 .mts_firmware = 1,
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300996 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300997 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehabaf86ce72011-01-24 12:18:48 -0300998 .ir_codes = RC_MAP_HAUPPAUGE,
Aidan Thornton122d1582007-11-20 15:25:08 -0300999 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001000 .input = { {
Aidan Thornton122d1582007-11-20 15:25:08 -03001001 .type = EM28XX_VMUX_TELEVISION,
1002 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001003 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001004 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001005 }, {
Aidan Thornton122d1582007-11-20 15:25:08 -03001006 .type = EM28XX_VMUX_COMPOSITE1,
1007 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001008 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001009 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001010 }, {
Aidan Thornton122d1582007-11-20 15:25:08 -03001011 .type = EM28XX_VMUX_SVIDEO,
1012 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001013 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001014 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001015 } },
Aidan Thornton122d1582007-11-20 15:25:08 -03001016 },
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001017 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2] = {
1018 .name = "Hauppauge WinTV HVR 900 (R2)",
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001019 .tda9887_conf = TDA9887_PRESENT,
1020 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001021 .tuner_gpio = default_tuner_gpio,
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001022 .mts_firmware = 1,
Devin Heitmueller75e2b862011-03-13 02:01:02 -03001023 .has_dvb = 1,
Devin Heitmueller7030f522011-03-13 02:04:53 -03001024 .dvb_gpio = hauppauge_wintv_hvr_900R2_digital,
Mauro Carvalho Chehabaf86ce72011-01-24 12:18:48 -03001025 .ir_codes = RC_MAP_HAUPPAUGE,
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001026 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001027 .input = { {
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001028 .type = EM28XX_VMUX_TELEVISION,
1029 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001030 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001031 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001032 }, {
1033 .type = EM28XX_VMUX_COMPOSITE1,
1034 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehaba5942b52008-11-27 07:44:00 -03001035 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001036 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001037 }, {
1038 .type = EM28XX_VMUX_SVIDEO,
1039 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001040 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001041 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001042 } },
1043 },
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03001044 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850] = {
1045 .name = "Hauppauge WinTV HVR 850",
1046 .tuner_type = TUNER_XC2028,
1047 .tuner_gpio = default_tuner_gpio,
1048 .mts_firmware = 1,
1049 .has_dvb = 1,
1050 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehabaf86ce72011-01-24 12:18:48 -03001051 .ir_codes = RC_MAP_HAUPPAUGE,
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03001052 .decoder = EM28XX_TVP5150,
1053 .input = { {
1054 .type = EM28XX_VMUX_TELEVISION,
1055 .vmux = TVP5150_COMPOSITE0,
1056 .amux = EM28XX_AMUX_VIDEO,
1057 .gpio = hauppauge_wintv_hvr_900_analog,
1058 }, {
1059 .type = EM28XX_VMUX_COMPOSITE1,
1060 .vmux = TVP5150_COMPOSITE1,
1061 .amux = EM28XX_AMUX_LINE_IN,
1062 .gpio = hauppauge_wintv_hvr_900_analog,
1063 }, {
1064 .type = EM28XX_VMUX_SVIDEO,
1065 .vmux = TVP5150_SVIDEO,
1066 .amux = EM28XX_AMUX_LINE_IN,
1067 .gpio = hauppauge_wintv_hvr_900_analog,
1068 } },
1069 },
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001070 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950] = {
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -03001071 .name = "Hauppauge WinTV HVR 950",
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -03001072 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001073 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -03001074 .mts_firmware = 1,
Mauro Carvalho Chehab227ad4a2008-04-17 21:37:40 -03001075 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001076 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehab15195d32011-01-24 12:18:47 -03001077 .ir_codes = RC_MAP_HAUPPAUGE,
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -03001078 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001079 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001080 .type = EM28XX_VMUX_TELEVISION,
1081 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001082 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001083 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001084 }, {
Mauro Carvalho Chehab7d070e22007-11-01 21:52:58 -03001085 .type = EM28XX_VMUX_COMPOSITE1,
1086 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001087 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001088 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001089 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001090 .type = EM28XX_VMUX_SVIDEO,
1091 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001092 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001093 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001094 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001095 },
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001096 [EM2880_BOARD_PINNACLE_PCTV_HD_PRO] = {
1097 .name = "Pinnacle PCTV HD Pro Stick",
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001098 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001099 .tuner_gpio = default_tuner_gpio,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001100 .mts_firmware = 1,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001101 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001102 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001103 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001104 .decoder = EM28XX_TVP5150,
1105 .input = { {
1106 .type = EM28XX_VMUX_TELEVISION,
1107 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001108 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001109 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001110 }, {
1111 .type = EM28XX_VMUX_COMPOSITE1,
1112 .vmux = TVP5150_COMPOSITE1,
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,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001115 }, {
1116 .type = EM28XX_VMUX_SVIDEO,
1117 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001118 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001119 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001120 } },
1121 },
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001122 [EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600] = {
1123 .name = "AMD ATI TV Wonder HD 600",
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001124 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001125 .tuner_gpio = default_tuner_gpio,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001126 .mts_firmware = 1,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001127 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001128 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001129 .ir_codes = RC_MAP_ATI_TV_WONDER_HD_600,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001130 .decoder = EM28XX_TVP5150,
1131 .input = { {
1132 .type = EM28XX_VMUX_TELEVISION,
1133 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001134 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001135 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001136 }, {
1137 .type = EM28XX_VMUX_COMPOSITE1,
1138 .vmux = TVP5150_COMPOSITE1,
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 Heitmuellere14b3652008-07-26 11:04:33 -03001141 }, {
1142 .type = EM28XX_VMUX_SVIDEO,
1143 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001144 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001145 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001146 } },
1147 },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001148 [EM2880_BOARD_TERRATEC_HYBRID_XS] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001149 .name = "Terratec Hybrid XS",
1150 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001151 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001152 .decoder = EM28XX_TVP5150,
reinhard schwab655b8402008-07-26 10:47:00 -03001153 .has_dvb = 1,
Devin Heitmuellerf7976082009-06-22 22:32:32 -03001154 .dvb_gpio = default_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001155 .ir_codes = RC_MAP_TERRATEC_CINERGY_XS,
Devin Heitmueller8cd9aae2009-08-03 23:56:51 -03001156 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001157 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001158 .type = EM28XX_VMUX_TELEVISION,
1159 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001160 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001161 .gpio = default_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001162 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001163 .type = EM28XX_VMUX_COMPOSITE1,
1164 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001165 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001166 .gpio = default_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001167 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001168 .type = EM28XX_VMUX_SVIDEO,
1169 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001170 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001171 .gpio = default_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001172 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001173 },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001174 /* maybe there's a reason behind it why Terratec sells the Hybrid XS
1175 as Prodigy XS with a different PID, let's keep it separated for now
1176 maybe we'll need it lateron */
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001177 [EM2880_BOARD_TERRATEC_PRODIGY_XS] = {
1178 .name = "Terratec Prodigy XS",
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001179 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001180 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001181 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001182 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001183 .type = EM28XX_VMUX_TELEVISION,
1184 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001185 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001186 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001187 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001188 .type = EM28XX_VMUX_COMPOSITE1,
1189 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001190 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001191 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001192 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001193 .type = EM28XX_VMUX_SVIDEO,
1194 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001195 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001196 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001197 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001198 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001199 [EM2820_BOARD_MSI_VOX_USB_2] = {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001200 .name = "MSI VOX USB 2.0",
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001201 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1202 .tda9887_conf = TDA9887_PRESENT |
1203 TDA9887_PORT1_ACTIVE |
1204 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001205 .max_range_640_480 = 1,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001206 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001207 .input = { {
1208 .type = EM28XX_VMUX_TELEVISION,
1209 .vmux = SAA7115_COMPOSITE4,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001210 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001211 }, {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001212 .type = EM28XX_VMUX_COMPOSITE1,
1213 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001214 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001215 }, {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001216 .type = EM28XX_VMUX_SVIDEO,
1217 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001218 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001219 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001220 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001221 [EM2800_BOARD_TERRATEC_CINERGY_200] = {
1222 .name = "Terratec Cinergy 200 USB",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001223 .is_em2800 = 1,
Mauro Carvalho Chehabac07bb72009-09-08 14:04:41 -03001224 .has_ir_i2c = 1,
Sascha Sommer53b667e2012-01-08 16:41:22 -03001225 .tuner_type = TUNER_LG_TALN,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001226 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001227 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001228 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001229 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001230 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001231 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001232 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001233 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001234 .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 Chehab3acf2802005-11-08 21:38:27 -08001237 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001238 .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 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001241 },
Aron Szabo59d07f12008-07-27 13:47:52 -03001242 [EM2800_BOARD_GRABBEEX_USB2800] = {
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03001243 .name = "eMPIA Technology, Inc. GrabBeeX+ Video Encoder",
1244 .is_em2800 = 1,
1245 .decoder = EM28XX_SAA711X,
1246 .tuner_type = TUNER_ABSENT, /* capture only board */
1247 .input = { {
Aron Szabo59d07f12008-07-27 13:47:52 -03001248 .type = EM28XX_VMUX_COMPOSITE1,
1249 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001250 .amux = EM28XX_AMUX_LINE_IN,
Aron Szabo59d07f12008-07-27 13:47:52 -03001251 }, {
1252 .type = EM28XX_VMUX_SVIDEO,
1253 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001254 .amux = EM28XX_AMUX_LINE_IN,
Aron Szabo59d07f12008-07-27 13:47:52 -03001255 } },
1256 },
Mauro Carvalho Chehab694a1012009-11-26 21:26:13 -03001257 [EM2800_BOARD_VC211A] = {
1258 .name = "Actionmaster/LinXcel/Digitus VC211A",
1259 .is_em2800 = 1,
1260 .tuner_type = TUNER_ABSENT, /* Capture-only board */
1261 .decoder = EM28XX_SAA711X,
1262 .input = { {
1263 .type = EM28XX_VMUX_COMPOSITE1,
1264 .vmux = SAA7115_COMPOSITE0,
1265 .amux = EM28XX_AMUX_LINE_IN,
1266 .gpio = vc211a_enable,
1267 }, {
1268 .type = EM28XX_VMUX_SVIDEO,
1269 .vmux = SAA7115_SVIDEO3,
1270 .amux = EM28XX_AMUX_LINE_IN,
1271 .gpio = vc211a_enable,
1272 } },
1273 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001274 [EM2800_BOARD_LEADTEK_WINFAST_USBII] = {
1275 .name = "Leadtek Winfast USB II",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001276 .is_em2800 = 1,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001277 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1278 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001279 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001280 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001281 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001282 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001283 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001284 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001285 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001286 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001287 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001288 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001289 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001290 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001291 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001292 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001293 },
1294 [EM2800_BOARD_KWORLD_USB2800] = {
1295 .name = "Kworld USB2800",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001296 .is_em2800 = 1,
Michael Krufkyab8b8702008-04-22 14:46:05 -03001297 .tuner_type = TUNER_PHILIPS_FCV1236D,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001298 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001299 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001300 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001301 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001302 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001303 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001304 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001305 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001306 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001307 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001308 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001309 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001310 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001311 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001312 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001313 },
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -08001314 [EM2820_BOARD_PINNACLE_DVC_90] = {
Douglas Schilling Landgrafea476892009-09-06 18:41:59 -03001315 .name = "Pinnacle Dazzle DVC 90/100/101/107 / Kaiser Baas Video to DVD maker "
Don Kramer74e07f32012-01-02 16:15:44 -03001316 "/ Kworld DVD Maker 2 / Plextor ConvertX PX-AV100U",
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -03001317 .tuner_type = TUNER_ABSENT, /* capture only board */
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001318 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001319 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001320 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001321 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001322 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001323 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001324 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001325 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001326 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001327 } },
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -08001328 },
Sascha Sommer43625592007-11-03 15:05:07 -03001329 [EM2800_BOARD_VGEAR_POCKETTV] = {
1330 .name = "V-Gear PocketTV",
1331 .is_em2800 = 1,
Sascha Sommer43625592007-11-03 15:05:07 -03001332 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1333 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001334 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001335 .input = { {
Sascha Sommer43625592007-11-03 15:05:07 -03001336 .type = EM28XX_VMUX_TELEVISION,
1337 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001338 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001339 }, {
Sascha Sommer43625592007-11-03 15:05:07 -03001340 .type = EM28XX_VMUX_COMPOSITE1,
1341 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001342 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001343 }, {
Sascha Sommer43625592007-11-03 15:05:07 -03001344 .type = EM28XX_VMUX_SVIDEO,
1345 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001346 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001347 } },
Sascha Sommer43625592007-11-03 15:05:07 -03001348 },
Douglas Schilling Landgraf1e1addd2008-12-27 21:38:14 -03001349 [EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2] = {
1350 .name = "Pixelview PlayTV Box 4 USB 2.0",
1351 .tda9887_conf = TDA9887_PRESENT,
1352 .tuner_type = TUNER_YMEC_TVF_5533MF,
1353 .decoder = EM28XX_SAA711X,
1354 .input = { {
1355 .type = EM28XX_VMUX_TELEVISION,
1356 .vmux = SAA7115_COMPOSITE2,
1357 .amux = EM28XX_AMUX_VIDEO,
1358 .aout = EM28XX_AOUT_MONO | /* I2S */
1359 EM28XX_AOUT_MASTER, /* Line out pin */
1360 }, {
1361 .type = EM28XX_VMUX_COMPOSITE1,
1362 .vmux = SAA7115_COMPOSITE0,
1363 .amux = EM28XX_AMUX_LINE_IN,
1364 }, {
1365 .type = EM28XX_VMUX_SVIDEO,
1366 .vmux = SAA7115_SVIDEO3,
1367 .amux = EM28XX_AMUX_LINE_IN,
1368 } },
1369 },
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001370 [EM2820_BOARD_PROLINK_PLAYTV_USB2] = {
Douglas Schilling Landgraf1f372a92009-02-25 16:54:31 -03001371 .name = "SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0",
Douglas Schilling Landgraf5609cfd2008-12-27 21:39:35 -03001372 .has_snapshot_button = 1,
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001373 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03001374 .tuner_type = TUNER_YMEC_TVF_5533MF,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001375 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001376 .input = { {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001377 .type = EM28XX_VMUX_TELEVISION,
1378 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab30e4ac72008-11-20 13:43:05 -03001379 .amux = EM28XX_AMUX_VIDEO,
1380 .aout = EM28XX_AOUT_MONO | /* I2S */
1381 EM28XX_AOUT_MASTER, /* Line out pin */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001382 }, {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001383 .type = EM28XX_VMUX_COMPOSITE1,
1384 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab7463dda2008-02-05 22:29:26 -03001385 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001386 }, {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001387 .type = EM28XX_VMUX_SVIDEO,
1388 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab7463dda2008-02-05 22:29:26 -03001389 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001390 } },
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001391 },
Devin Heitmueller3ed58ba2009-05-27 23:27:26 -03001392 [EM2860_BOARD_SAA711X_REFERENCE_DESIGN] = {
1393 .name = "EM2860/SAA711X Reference Design",
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001394 .has_snapshot_button = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001395 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001396 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001397 .input = { {
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001398 .type = EM28XX_VMUX_SVIDEO,
1399 .vmux = SAA7115_SVIDEO3,
Devin Heitmueller3ed58ba2009-05-27 23:27:26 -03001400 }, {
1401 .type = EM28XX_VMUX_COMPOSITE1,
1402 .vmux = SAA7115_COMPOSITE0,
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001403 } },
1404 },
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03001405
Mauro Carvalho Chehabebaefdb2011-06-01 10:16:25 -03001406 [EM2874_BOARD_LEADERSHIP_ISDBT] = {
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03001407 .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT |
1408 EM28XX_I2C_CLK_WAIT_ENABLE |
1409 EM28XX_I2C_FREQ_100_KHZ,
1410 .xclk = EM28XX_XCLK_FREQUENCY_10MHZ,
1411 .name = "EM2874 Leadership ISDBT",
1412 .tuner_type = TUNER_ABSENT,
1413 .tuner_gpio = leadership_reset,
1414 .dvb_gpio = leadership_digital,
1415 .has_dvb = 1,
1416 },
1417
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001418 [EM2880_BOARD_MSI_DIGIVOX_AD] = {
1419 .name = "MSI DigiVox A/D",
1420 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001421 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001422 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001423 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001424 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001425 .type = EM28XX_VMUX_TELEVISION,
1426 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001427 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001428 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001429 }, {
1430 .type = EM28XX_VMUX_COMPOSITE1,
1431 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001432 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001433 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001434 }, {
1435 .type = EM28XX_VMUX_SVIDEO,
1436 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001437 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001438 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001439 } },
1440 },
1441 [EM2880_BOARD_MSI_DIGIVOX_AD_II] = {
1442 .name = "MSI DigiVox A/D II",
1443 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001444 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001445 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001446 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001447 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001448 .type = EM28XX_VMUX_TELEVISION,
1449 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001450 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001451 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001452 }, {
1453 .type = EM28XX_VMUX_COMPOSITE1,
1454 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001455 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001456 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001457 }, {
1458 .type = EM28XX_VMUX_SVIDEO,
1459 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001460 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001461 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001462 } },
1463 },
1464 [EM2880_BOARD_KWORLD_DVB_305U] = {
1465 .name = "KWorld DVB-T 305U",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001466 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001467 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001468 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001469 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001470 .type = EM28XX_VMUX_TELEVISION,
1471 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001472 .amux = EM28XX_AMUX_VIDEO,
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,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001477 }, {
1478 .type = EM28XX_VMUX_SVIDEO,
1479 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001480 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001481 } },
1482 },
1483 [EM2880_BOARD_KWORLD_DVB_310U] = {
1484 .name = "KWorld DVB-T 310U",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001485 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001486 .tuner_gpio = default_tuner_gpio,
Darron Broadda3808e2008-09-30 02:46:41 -03001487 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001488 .dvb_gpio = default_digital,
Darron Broadda3808e2008-09-30 02:46:41 -03001489 .mts_firmware = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001490 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001491 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001492 .type = EM28XX_VMUX_TELEVISION,
1493 .vmux = TVP5150_COMPOSITE0,
Darron Broadda3808e2008-09-30 02:46:41 -03001494 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001495 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001496 }, {
1497 .type = EM28XX_VMUX_COMPOSITE1,
1498 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehaba42aa192008-11-19 11:08:53 -03001499 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001500 .gpio = default_analog,
Darron Broadda3808e2008-09-30 02:46:41 -03001501 }, { /* S-video has not been tested yet */
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001502 .type = EM28XX_VMUX_SVIDEO,
1503 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehaba42aa192008-11-19 11:08:53 -03001504 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001505 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001506 } },
1507 },
Franklin Mengd7de5d82009-06-06 17:05:02 -03001508 [EM2882_BOARD_KWORLD_ATSC_315U] = {
1509 .name = "KWorld ATSC 315U HDTV TV Box",
1510 .valid = EM28XX_BOARD_NOT_VALIDATED,
1511 .tuner_type = TUNER_THOMSON_DTT761X,
1512 .tuner_gpio = em2882_kworld_315u_tuner_gpio,
1513 .tda9887_conf = TDA9887_PRESENT,
1514 .decoder = EM28XX_SAA711X,
1515 .has_dvb = 1,
1516 .dvb_gpio = em2882_kworld_315u_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001517 .ir_codes = RC_MAP_KWORLD_315U,
Franklin Mengd7de5d82009-06-06 17:05:02 -03001518 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
1519 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE,
1520 /* Analog mode - still not ready */
1521 /*.input = { {
1522 .type = EM28XX_VMUX_TELEVISION,
1523 .vmux = SAA7115_COMPOSITE2,
1524 .amux = EM28XX_AMUX_VIDEO,
1525 .gpio = em2882_kworld_315u_analog,
1526 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1527 }, {
1528 .type = EM28XX_VMUX_COMPOSITE1,
1529 .vmux = SAA7115_COMPOSITE0,
1530 .amux = EM28XX_AMUX_LINE_IN,
1531 .gpio = em2882_kworld_315u_analog1,
1532 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1533 }, {
1534 .type = EM28XX_VMUX_SVIDEO,
1535 .vmux = SAA7115_SVIDEO3,
1536 .amux = EM28XX_AMUX_LINE_IN,
1537 .gpio = em2882_kworld_315u_analog1,
1538 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1539 } }, */
1540 },
Douglas Schilling Landgrafe5db5d42009-04-09 18:24:34 -03001541 [EM2880_BOARD_EMPIRE_DUAL_TV] = {
1542 .name = "Empire dual TV",
1543 .tuner_type = TUNER_XC2028,
1544 .tuner_gpio = default_tuner_gpio,
1545 .has_dvb = 1,
1546 .dvb_gpio = default_digital,
1547 .mts_firmware = 1,
1548 .decoder = EM28XX_TVP5150,
1549 .input = { {
1550 .type = EM28XX_VMUX_TELEVISION,
1551 .vmux = TVP5150_COMPOSITE0,
1552 .amux = EM28XX_AMUX_VIDEO,
1553 .gpio = default_analog,
1554 }, {
1555 .type = EM28XX_VMUX_COMPOSITE1,
1556 .vmux = TVP5150_COMPOSITE1,
1557 .amux = EM28XX_AMUX_LINE_IN,
1558 .gpio = default_analog,
1559 }, {
1560 .type = EM28XX_VMUX_SVIDEO,
1561 .vmux = TVP5150_SVIDEO,
1562 .amux = EM28XX_AMUX_LINE_IN,
1563 .gpio = default_analog,
1564 } },
1565 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001566 [EM2881_BOARD_DNT_DA2_HYBRID] = {
1567 .name = "DNT DA2 Hybrid",
1568 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001569 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001570 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001571 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001572 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001573 .type = EM28XX_VMUX_TELEVISION,
1574 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001575 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001576 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001577 }, {
1578 .type = EM28XX_VMUX_COMPOSITE1,
1579 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001580 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001581 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001582 }, {
1583 .type = EM28XX_VMUX_SVIDEO,
1584 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001585 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001586 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001587 } },
1588 },
1589 [EM2881_BOARD_PINNACLE_HYBRID_PRO] = {
1590 .name = "Pinnacle Hybrid Pro",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001591 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001592 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001593 .decoder = EM28XX_TVP5150,
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03001594 .has_dvb = 1,
1595 .dvb_gpio = pinnacle_hybrid_pro_digital,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001596 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001597 .type = EM28XX_VMUX_TELEVISION,
1598 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001599 .amux = EM28XX_AMUX_VIDEO,
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03001600 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001601 }, {
1602 .type = EM28XX_VMUX_COMPOSITE1,
1603 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001604 .amux = EM28XX_AMUX_LINE_IN,
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03001605 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001606 }, {
1607 .type = EM28XX_VMUX_SVIDEO,
1608 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001609 .amux = EM28XX_AMUX_LINE_IN,
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03001610 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001611 } },
1612 },
Devin Heitmueller09bc1942011-03-13 02:07:54 -03001613 [EM2882_BOARD_PINNACLE_HYBRID_PRO_330E] = {
1614 .name = "Pinnacle Hybrid Pro (330e)",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001615 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001616 .tuner_gpio = default_tuner_gpio,
Eugeniy Meshcheryakova674a3b2008-08-01 08:23:41 -03001617 .mts_firmware = 1,
Devin Heitmuellerad9b4bb2011-03-13 02:09:59 -03001618 .has_dvb = 1,
1619 .dvb_gpio = hauppauge_wintv_hvr_900R2_digital,
Devin Heitmueller9b316d62011-03-13 02:18:34 -03001620 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001621 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001622 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001623 .type = EM28XX_VMUX_TELEVISION,
1624 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001625 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001626 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001627 }, {
1628 .type = EM28XX_VMUX_COMPOSITE1,
1629 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001630 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001631 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001632 }, {
1633 .type = EM28XX_VMUX_SVIDEO,
1634 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001635 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001636 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001637 } },
1638 },
1639 [EM2882_BOARD_KWORLD_VS_DVBT] = {
1640 .name = "Kworld VS-DVB-T 323UR",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001641 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001642 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001643 .decoder = EM28XX_TVP5150,
Antonio Larrosa811fab62010-03-04 22:19:48 -03001644 .mts_firmware = 1,
1645 .has_dvb = 1,
1646 .dvb_gpio = kworld_330u_digital,
1647 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001648 .ir_codes = RC_MAP_KWORLD_315U,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001649 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001650 .type = EM28XX_VMUX_TELEVISION,
1651 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001652 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001653 }, {
1654 .type = EM28XX_VMUX_COMPOSITE1,
1655 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001656 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001657 }, {
1658 .type = EM28XX_VMUX_SVIDEO,
1659 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001660 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001661 } },
1662 },
1663 [EM2882_BOARD_TERRATEC_HYBRID_XS] = {
Philippe Bourdin91245442010-10-31 09:57:58 -03001664 .name = "Terratec Cinnergy Hybrid T USB XS (em2882)",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001665 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001666 .tuner_gpio = default_tuner_gpio,
Uroš Vamplec994d02009-09-30 22:53:37 -03001667 .mts_firmware = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001668 .decoder = EM28XX_TVP5150,
Uroš Vamplec994d02009-09-30 22:53:37 -03001669 .has_dvb = 1,
1670 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001671 .ir_codes = RC_MAP_TERRATEC_CINERGY_XS,
Uroš Vamplec994d02009-09-30 22:53:37 -03001672 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001673 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001674 .type = EM28XX_VMUX_TELEVISION,
1675 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001676 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001677 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001678 }, {
1679 .type = EM28XX_VMUX_COMPOSITE1,
1680 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001681 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001682 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001683 }, {
1684 .type = EM28XX_VMUX_SVIDEO,
1685 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001686 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001687 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001688 } },
1689 },
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03001690 [EM2882_BOARD_DIKOM_DK300] = {
1691 .name = "Dikom DK300",
1692 .tuner_type = TUNER_XC2028,
1693 .tuner_gpio = default_tuner_gpio,
1694 .decoder = EM28XX_TVP5150,
1695 .mts_firmware = 1,
1696 .has_dvb = 1,
1697 .dvb_gpio = dikom_dk300_digital,
1698 .input = { {
1699 .type = EM28XX_VMUX_TELEVISION,
1700 .vmux = TVP5150_COMPOSITE0,
1701 .amux = EM28XX_AMUX_VIDEO,
1702 .gpio = default_analog,
1703 } },
1704 },
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001705 [EM2883_BOARD_KWORLD_HYBRID_330U] = {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001706 .name = "Kworld PlusTV HD Hybrid 330",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001707 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001708 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001709 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabbe2c6db2008-12-09 15:43:10 -03001710 .mts_firmware = 1,
1711 .has_dvb = 1,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001712 .dvb_gpio = kworld_330u_digital,
1713 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03001714 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
1715 EM28XX_I2C_EEPROM_ON_BOARD |
1716 EM28XX_I2C_EEPROM_KEY_VALID,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001717 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001718 .type = EM28XX_VMUX_TELEVISION,
1719 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001720 .amux = EM28XX_AMUX_VIDEO,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001721 .gpio = kworld_330u_analog,
1722 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001723 }, {
1724 .type = EM28XX_VMUX_COMPOSITE1,
1725 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001726 .amux = EM28XX_AMUX_LINE_IN,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001727 .gpio = kworld_330u_analog,
1728 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001729 }, {
1730 .type = EM28XX_VMUX_SVIDEO,
1731 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001732 .amux = EM28XX_AMUX_LINE_IN,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001733 .gpio = kworld_330u_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001734 } },
1735 },
Mauro Carvalho Chehabee281b82008-07-27 16:58:04 -03001736 [EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU] = {
Vitaly Woold3603342008-07-27 14:10:11 -03001737 .name = "Compro VideoMate ForYou/Stereo",
Vitaly Woold3603342008-07-27 14:10:11 -03001738 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03001739 .tvaudio_addr = 0xb0,
Vitaly Woold3603342008-07-27 14:10:11 -03001740 .tda9887_conf = TDA9887_PRESENT,
1741 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabdf7fa092009-02-25 09:06:13 -03001742 .adecoder = EM28XX_TVAUDIO,
Vitaly Wool2bd1d9eb2009-03-04 08:27:52 -03001743 .mute_gpio = compro_mute_gpio,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001744 .input = { {
Vitaly Woold3603342008-07-27 14:10:11 -03001745 .type = EM28XX_VMUX_TELEVISION,
1746 .vmux = TVP5150_COMPOSITE0,
Vitaly Wool2bd1d9eb2009-03-04 08:27:52 -03001747 .amux = EM28XX_AMUX_VIDEO,
1748 .gpio = compro_unmute_tv_gpio,
Vitaly Woold3603342008-07-27 14:10:11 -03001749 }, {
1750 .type = EM28XX_VMUX_SVIDEO,
1751 .vmux = TVP5150_SVIDEO,
1752 .amux = EM28XX_AMUX_LINE_IN,
Vitaly Wool2bd1d9eb2009-03-04 08:27:52 -03001753 .gpio = compro_unmute_svid_gpio,
Vitaly Woold3603342008-07-27 14:10:11 -03001754 } },
1755 },
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03001756 [EM2860_BOARD_KAIOMY_TVNPC_U2] = {
1757 .name = "Kaiomy TVnPC U2",
1758 .vchannels = 3,
1759 .tuner_type = TUNER_XC2028,
1760 .tuner_addr = 0x61,
1761 .mts_firmware = 1,
1762 .decoder = EM28XX_TVP5150,
1763 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001764 .ir_codes = RC_MAP_KAIOMY,
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03001765 .input = { {
1766 .type = EM28XX_VMUX_TELEVISION,
1767 .vmux = TVP5150_COMPOSITE0,
1768 .amux = EM28XX_AMUX_VIDEO,
1769
1770 }, {
1771 .type = EM28XX_VMUX_COMPOSITE1,
1772 .vmux = TVP5150_COMPOSITE1,
1773 .amux = EM28XX_AMUX_LINE_IN,
1774 }, {
1775 .type = EM28XX_VMUX_SVIDEO,
1776 .vmux = TVP5150_SVIDEO,
1777 .amux = EM28XX_AMUX_LINE_IN,
1778 } },
1779 .radio = {
1780 .type = EM28XX_RADIO,
1781 .amux = EM28XX_AMUX_LINE_IN,
1782 }
Mauro Carvalho Chehab56ee3802009-02-11 14:18:36 -03001783 },
1784 [EM2860_BOARD_EASYCAP] = {
1785 .name = "Easy Cap Capture DC-60",
1786 .vchannels = 2,
1787 .tuner_type = TUNER_ABSENT,
1788 .decoder = EM28XX_SAA711X,
1789 .input = { {
1790 .type = EM28XX_VMUX_COMPOSITE1,
1791 .vmux = SAA7115_COMPOSITE0,
1792 .amux = EM28XX_AMUX_LINE_IN,
1793 }, {
1794 .type = EM28XX_VMUX_SVIDEO,
1795 .vmux = SAA7115_SVIDEO3,
1796 .amux = EM28XX_AMUX_LINE_IN,
1797 } },
1798 },
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03001799 [EM2820_BOARD_IODATA_GVMVP_SZ] = {
1800 .name = "IO-DATA GV-MVP/SZ",
1801 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
1802 .tuner_gpio = default_tuner_gpio,
1803 .tda9887_conf = TDA9887_PRESENT,
1804 .decoder = EM28XX_TVP5150,
1805 .input = { {
1806 .type = EM28XX_VMUX_TELEVISION,
1807 .vmux = TVP5150_COMPOSITE0,
1808 .amux = EM28XX_AMUX_VIDEO,
1809 }, { /* Composite has not been tested yet */
1810 .type = EM28XX_VMUX_COMPOSITE1,
1811 .vmux = TVP5150_COMPOSITE1,
1812 .amux = EM28XX_AMUX_VIDEO,
1813 }, { /* S-video has not been tested yet */
1814 .type = EM28XX_VMUX_SVIDEO,
1815 .vmux = TVP5150_SVIDEO,
1816 .amux = EM28XX_AMUX_VIDEO,
1817 } },
1818 },
Mauro Carvalho Chehab4557af92009-05-23 09:58:52 -03001819 [EM2860_BOARD_TERRATEC_GRABBY] = {
1820 .name = "Terratec Grabby",
1821 .vchannels = 2,
1822 .tuner_type = TUNER_ABSENT,
1823 .decoder = EM28XX_SAA711X,
1824 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
1825 .input = { {
1826 .type = EM28XX_VMUX_COMPOSITE1,
1827 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehaba3fa9042010-10-25 17:51:15 -03001828 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab4557af92009-05-23 09:58:52 -03001829 }, {
1830 .type = EM28XX_VMUX_SVIDEO,
1831 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehaba3fa9042010-10-25 17:51:15 -03001832 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab4557af92009-05-23 09:58:52 -03001833 } },
1834 },
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -03001835 [EM2860_BOARD_TERRATEC_AV350] = {
1836 .name = "Terratec AV350",
1837 .vchannels = 2,
1838 .tuner_type = TUNER_ABSENT,
1839 .decoder = EM28XX_TVP5150,
1840 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
1841 .mute_gpio = terratec_av350_mute_gpio,
1842 .input = { {
1843 .type = EM28XX_VMUX_COMPOSITE1,
1844 .vmux = TVP5150_COMPOSITE1,
1845 .amux = EM28XX_AUDIO_SRC_LINE,
Jean Delvare1df8e982009-05-13 16:48:07 -03001846 .gpio = terratec_av350_unmute_gpio,
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -03001847
1848 }, {
1849 .type = EM28XX_VMUX_SVIDEO,
1850 .vmux = TVP5150_SVIDEO,
1851 .amux = EM28XX_AUDIO_SRC_LINE,
Jean Delvare1df8e982009-05-13 16:48:07 -03001852 .gpio = terratec_av350_unmute_gpio,
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -03001853 } },
1854 },
Adrian Taylor8298f2f2010-10-20 07:55:33 -03001855
1856 [EM2860_BOARD_ELGATO_VIDEO_CAPTURE] = {
1857 .name = "Elgato Video Capture",
1858 .decoder = EM28XX_SAA711X,
1859 .tuner_type = TUNER_ABSENT, /* Capture only device */
1860 .input = { {
1861 .type = EM28XX_VMUX_COMPOSITE1,
1862 .vmux = SAA7115_COMPOSITE0,
1863 .amux = EM28XX_AMUX_LINE_IN,
1864 }, {
1865 .type = EM28XX_VMUX_SVIDEO,
1866 .vmux = SAA7115_SVIDEO3,
1867 .amux = EM28XX_AMUX_LINE_IN,
1868 } },
1869 },
1870
Devin Heitmueller19859222009-06-19 00:33:54 -03001871 [EM2882_BOARD_EVGA_INDTUBE] = {
1872 .name = "Evga inDtube",
1873 .tuner_type = TUNER_XC2028,
1874 .tuner_gpio = default_tuner_gpio,
1875 .decoder = EM28XX_TVP5150,
Devin Heitmuellera4c47302009-06-20 21:34:42 -03001876 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */
Devin Heitmueller19859222009-06-19 00:33:54 -03001877 .mts_firmware = 1,
1878 .has_dvb = 1,
1879 .dvb_gpio = evga_indtube_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001880 .ir_codes = RC_MAP_EVGA_INDTUBE,
Devin Heitmueller19859222009-06-19 00:33:54 -03001881 .input = { {
1882 .type = EM28XX_VMUX_TELEVISION,
1883 .vmux = TVP5150_COMPOSITE0,
1884 .amux = EM28XX_AMUX_VIDEO,
1885 .gpio = evga_indtube_analog,
1886 }, {
1887 .type = EM28XX_VMUX_COMPOSITE1,
1888 .vmux = TVP5150_COMPOSITE1,
1889 .amux = EM28XX_AMUX_LINE_IN,
1890 .gpio = evga_indtube_analog,
1891 }, {
1892 .type = EM28XX_VMUX_SVIDEO,
1893 .vmux = TVP5150_SVIDEO,
1894 .amux = EM28XX_AMUX_LINE_IN,
1895 .gpio = evga_indtube_analog,
1896 } },
1897 },
Antti Palosaari285eb1a2009-09-15 14:42:13 -03001898 /* eb1a:2868 Empia EM2870 + Philips CU1216L NIM (Philips TDA10023 +
1899 Infineon TUA6034) */
1900 [EM2870_BOARD_REDDO_DVB_C_USB_BOX] = {
1901 .name = "Reddo DVB-C USB TV Box",
1902 .tuner_type = TUNER_ABSENT,
Antti Palosaari28f4ddd12009-10-04 12:59:35 -03001903 .tuner_gpio = reddo_dvb_c_usb_box,
Antti Palosaari285eb1a2009-09-15 14:42:13 -03001904 .has_dvb = 1,
Antti Palosaari285eb1a2009-09-15 14:42:13 -03001905 },
Jarod Wilson7e48b302010-03-07 17:55:43 -03001906 /* 1b80:a340 - Empia EM2870, NXP TDA18271HD and LG DT3304, sold
1907 * initially as the KWorld PlusTV 340U, then as the UB435-Q.
1908 * Early variants have a TDA18271HD/C1, later ones a TDA18271HD/C2 */
1909 [EM2870_BOARD_KWORLD_A340] = {
1910 .name = "KWorld PlusTV 340U or UB435-Q (ATSC)",
1911 .tuner_type = TUNER_ABSENT, /* Digital-only TDA18271HD */
1912 .has_dvb = 1,
1913 .dvb_gpio = kworld_a340_digital,
1914 .tuner_gpio = default_tuner_gpio,
1915 },
Antti Palosaari460312e2011-05-25 17:03:50 -03001916 /* 2013:024f PCTV nanoStick T2 290e.
Antti Palosaarid6a5f922011-04-07 16:34:44 -03001917 * Empia EM28174, Sony CXD2820R and NXP TDA18271HD/C2 */
1918 [EM28174_BOARD_PCTV_290E] = {
Antti Palosaari460312e2011-05-25 17:03:50 -03001919 .name = "PCTV nanoStick T2 290e",
Antti Palosaarid6a5f922011-04-07 16:34:44 -03001920 .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT |
1921 EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_FREQ_100_KHZ,
Antti Palosaarid6a5f922011-04-07 16:34:44 -03001922 .tuner_type = TUNER_ABSENT,
1923 .tuner_gpio = pctv_290e,
1924 .has_dvb = 1,
Antti Palosaariff7b9292011-05-25 17:00:35 -03001925 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
Antti Palosaarid6a5f922011-04-07 16:34:44 -03001926 },
Antti Palosaari36588712011-08-01 01:15:30 -03001927 /* 2013:024f PCTV DVB-S2 Stick 460e
1928 * Empia EM28174, NXP TDA10071, Conexant CX24118A and Allegro A8293 */
1929 [EM28174_BOARD_PCTV_460E] = {
1930 .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT |
1931 EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_FREQ_400_KHZ,
1932 .name = "PCTV DVB-S2 Stick (460e)",
1933 .tuner_type = TUNER_ABSENT,
1934 .tuner_gpio = pctv_460e,
1935 .has_dvb = 1,
1936 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
1937 },
Gareth Williams4d28d3d2011-12-24 05:47:29 -03001938 /* eb1a:5006 Honestech VIDBOX NW03
1939 * Empia EM2860, Philips SAA7113, Empia EMP202, No Tuner */
1940 [EM2860_BOARD_HT_VIDBOX_NW03] = {
1941 .name = "Honestech Vidbox NW03",
1942 .tuner_type = TUNER_ABSENT,
1943 .decoder = EM28XX_SAA711X,
1944 .input = { {
1945 .type = EM28XX_VMUX_COMPOSITE1,
1946 .vmux = SAA7115_COMPOSITE0,
1947 .amux = EM28XX_AMUX_LINE_IN,
1948 }, {
1949 .type = EM28XX_VMUX_SVIDEO,
1950 .vmux = SAA7115_SVIDEO3, /* S-VIDEO needs confirming */
1951 .amux = EM28XX_AMUX_LINE_IN,
1952 } },
1953 },
Antti Palosaari35530852012-03-18 18:09:01 -03001954 /* 1b80:e425 MaxMedia UB425-TC
1955 * Empia EM2874B + Micronas DRX 3913KA2 + NXP TDA18271HDC2 */
1956 [EM2874_BOARD_MAXMEDIA_UB425_TC] = {
1957 .name = "MaxMedia UB425-TC",
1958 .tuner_type = TUNER_ABSENT,
1959 .tuner_gpio = maxmedia_ub425_tc,
1960 .has_dvb = 1,
1961 .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT |
1962 EM28XX_I2C_CLK_WAIT_ENABLE |
1963 EM28XX_I2C_FREQ_400_KHZ,
1964 },
Ivan Kalvachevfa5527c2012-03-19 20:09:55 -03001965 /* 2304:0242 PCTV QuatroStick (510e)
1966 * Empia EM2884 + Micronas DRX 3926K + NXP TDA18271HDC2 */
1967 [EM2884_BOARD_PCTV_510E] = {
1968 .name = "PCTV QuatroStick (510e)",
1969 .tuner_type = TUNER_ABSENT,
1970 .tuner_gpio = pctv_510e,
1971 .has_dvb = 1,
1972 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
1973 .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT |
1974 EM28XX_I2C_CLK_WAIT_ENABLE |
1975 EM28XX_I2C_FREQ_400_KHZ,
1976 },
Antti Palosaaric247d7b2012-03-19 11:48:19 -03001977 /* 2013:0251 PCTV QuatroStick nano (520e)
1978 * Empia EM2884 + Micronas DRX 3926K + NXP TDA18271HDC2 */
1979 [EM2884_BOARD_PCTV_520E] = {
1980 .name = "PCTV QuatroStick nano (520e)",
1981 .tuner_type = TUNER_ABSENT,
1982 .tuner_gpio = pctv_520e,
1983 .has_dvb = 1,
1984 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
1985 .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT |
1986 EM28XX_I2C_CLK_WAIT_ENABLE |
1987 EM28XX_I2C_FREQ_400_KHZ,
1988 },
Martin Blumenstingl89040132012-10-04 14:22:54 -03001989 [EM2884_BOARD_TERRATEC_HTC_USB_XS] = {
1990 .name = "Terratec Cinergy HTC USB XS",
1991 .has_dvb = 1,
1992 .ir_codes = RC_MAP_NEC_TERRATEC_CINERGY_XS,
1993 .tuner_type = TUNER_ABSENT,
1994 .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT |
1995 EM28XX_I2C_CLK_WAIT_ENABLE |
1996 EM28XX_I2C_FREQ_400_KHZ,
1997 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001998};
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001999const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002000
2001/* table of devices that work with this driver */
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03002002struct usb_device_id em28xx_id_table[] = {
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002003 { USB_DEVICE(0xeb1a, 0x2750),
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002004 .driver_info = EM2750_BOARD_UNKNOWN },
2005 { USB_DEVICE(0xeb1a, 0x2751),
2006 .driver_info = EM2750_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002007 { USB_DEVICE(0xeb1a, 0x2800),
2008 .driver_info = EM2800_BOARD_UNKNOWN },
Mauro Carvalho Chehab9b4e8452009-08-07 12:08:02 -03002009 { USB_DEVICE(0xeb1a, 0x2710),
2010 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002011 { USB_DEVICE(0xeb1a, 0x2820),
2012 .driver_info = EM2820_BOARD_UNKNOWN },
2013 { USB_DEVICE(0xeb1a, 0x2821),
Devin Heitmuellerc665f4d2008-12-16 23:35:23 -03002014 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002015 { USB_DEVICE(0xeb1a, 0x2860),
2016 .driver_info = EM2820_BOARD_UNKNOWN },
2017 { USB_DEVICE(0xeb1a, 0x2861),
2018 .driver_info = EM2820_BOARD_UNKNOWN },
Devin Heitmuellerf91cb652009-09-30 22:44:19 -03002019 { USB_DEVICE(0xeb1a, 0x2862),
2020 .driver_info = EM2820_BOARD_UNKNOWN },
Devin Heitmueller443fed92010-03-19 23:53:12 -03002021 { USB_DEVICE(0xeb1a, 0x2863),
2022 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002023 { USB_DEVICE(0xeb1a, 0x2870),
2024 .driver_info = EM2820_BOARD_UNKNOWN },
2025 { USB_DEVICE(0xeb1a, 0x2881),
2026 .driver_info = EM2820_BOARD_UNKNOWN },
2027 { USB_DEVICE(0xeb1a, 0x2883),
2028 .driver_info = EM2820_BOARD_UNKNOWN },
Antti Palosaari285eb1a2009-09-15 14:42:13 -03002029 { USB_DEVICE(0xeb1a, 0x2868),
2030 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03002031 { USB_DEVICE(0xeb1a, 0x2875),
2032 .driver_info = EM2820_BOARD_UNKNOWN },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002033 { USB_DEVICE(0xeb1a, 0xe300),
2034 .driver_info = EM2861_BOARD_KWORLD_PVRTV_300U },
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03002035 { USB_DEVICE(0xeb1a, 0xe303),
2036 .driver_info = EM2860_BOARD_KAIOMY_TVNPC_U2 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002037 { USB_DEVICE(0xeb1a, 0xe305),
2038 .driver_info = EM2880_BOARD_KWORLD_DVB_305U },
2039 { USB_DEVICE(0xeb1a, 0xe310),
2040 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD },
Franklin Mengd7de5d82009-06-06 17:05:02 -03002041 { USB_DEVICE(0xeb1a, 0xa313),
2042 .driver_info = EM2882_BOARD_KWORLD_ATSC_315U },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002043 { USB_DEVICE(0xeb1a, 0xa316),
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03002044 .driver_info = EM2883_BOARD_KWORLD_HYBRID_330U },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002045 { USB_DEVICE(0xeb1a, 0xe320),
2046 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD_II },
2047 { USB_DEVICE(0xeb1a, 0xe323),
2048 .driver_info = EM2882_BOARD_KWORLD_VS_DVBT },
2049 { USB_DEVICE(0xeb1a, 0xe350),
2050 .driver_info = EM2870_BOARD_KWORLD_350U },
2051 { USB_DEVICE(0xeb1a, 0xe355),
2052 .driver_info = EM2870_BOARD_KWORLD_355U },
2053 { USB_DEVICE(0xeb1a, 0x2801),
2054 .driver_info = EM2800_BOARD_GRABBEEX_USB2800 },
2055 { USB_DEVICE(0xeb1a, 0xe357),
2056 .driver_info = EM2870_BOARD_KWORLD_355U },
Aivar Päkk1985f6f2011-12-11 18:15:00 -03002057 { USB_DEVICE(0xeb1a, 0xe359),
2058 .driver_info = EM2870_BOARD_KWORLD_355U },
Douglas Schilling Landgrafac40d9e2009-02-25 16:55:48 -03002059 { USB_DEVICE(0x1b80, 0xe302),
2060 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, /* Kaiser Baas Video to DVD maker */
Douglas Schilling Landgrafea476892009-09-06 18:41:59 -03002061 { USB_DEVICE(0x1b80, 0xe304),
2062 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, /* Kworld DVD Maker 2 */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002063 { USB_DEVICE(0x0ccd, 0x0036),
2064 .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002065 { USB_DEVICE(0x0ccd, 0x004c),
2066 .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS_FR },
2067 { USB_DEVICE(0x0ccd, 0x004f),
2068 .driver_info = EM2860_BOARD_TERRATEC_HYBRID_XS },
2069 { USB_DEVICE(0x0ccd, 0x005e),
2070 .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS },
2071 { USB_DEVICE(0x0ccd, 0x0042),
Philippe Bourdin91245442010-10-31 09:57:58 -03002072 .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002073 { USB_DEVICE(0x0ccd, 0x0043),
Mauro Carvalho Chehab4e145342011-11-16 14:38:28 -02002074 .driver_info = EM2870_BOARD_TERRATEC_XS },
Holger Nelson6c3b9062011-12-23 23:15:32 -03002075 { USB_DEVICE(0x0ccd, 0x008e), /* Cinergy HTC USB XS Rev. 1 */
Martin Blumenstingl89040132012-10-04 14:22:54 -03002076 .driver_info = EM2884_BOARD_TERRATEC_HTC_USB_XS },
Holger Nelson6c3b9062011-12-23 23:15:32 -03002077 { USB_DEVICE(0x0ccd, 0x00ac), /* Cinergy HTC USB XS Rev. 2 */
Martin Blumenstingl89040132012-10-04 14:22:54 -03002078 .driver_info = EM2884_BOARD_TERRATEC_HTC_USB_XS },
Mauro Carvalho Chehab4e145342011-11-16 14:38:28 -02002079 { USB_DEVICE(0x0ccd, 0x10a2), /* H5 Rev. 1 */
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -03002080 .driver_info = EM2884_BOARD_TERRATEC_H5 },
Mauro Carvalho Chehab4e145342011-11-16 14:38:28 -02002081 { USB_DEVICE(0x0ccd, 0x10ad), /* H5 Rev. 2 */
Mauro Carvalho Chehab33ba28e2011-07-14 21:48:00 -03002082 .driver_info = EM2884_BOARD_TERRATEC_H5 },
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -03002083 { USB_DEVICE(0x0ccd, 0x0084),
2084 .driver_info = EM2860_BOARD_TERRATEC_AV350 },
Mauro Carvalho Chehab4557af92009-05-23 09:58:52 -03002085 { USB_DEVICE(0x0ccd, 0x0096),
2086 .driver_info = EM2860_BOARD_TERRATEC_GRABBY },
Tekaefabaaf2011-10-14 05:40:29 -03002087 { USB_DEVICE(0x0ccd, 0x10AF),
2088 .driver_info = EM2860_BOARD_TERRATEC_GRABBY },
Andreas Oberrittera1ed02e2011-11-16 11:06:50 -03002089 { USB_DEVICE(0x0ccd, 0x00b2),
2090 .driver_info = EM2884_BOARD_CINERGY_HTC_STICK },
Adrian Taylor8298f2f2010-10-20 07:55:33 -03002091 { USB_DEVICE(0x0fd9, 0x0033),
2092 .driver_info = EM2860_BOARD_ELGATO_VIDEO_CAPTURE},
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002093 { USB_DEVICE(0x185b, 0x2870),
2094 .driver_info = EM2870_BOARD_COMPRO_VIDEOMATE },
Vitaly Woold3603342008-07-27 14:10:11 -03002095 { USB_DEVICE(0x185b, 0x2041),
Mauro Carvalho Chehabee281b82008-07-27 16:58:04 -03002096 .driver_info = EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002097 { USB_DEVICE(0x2040, 0x4200),
2098 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
Mauro Carvalho Chehab15b9bec2008-01-13 12:02:20 -03002099 { USB_DEVICE(0x2040, 0x4201),
2100 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002101 { USB_DEVICE(0x2040, 0x6500),
2102 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 },
Luc Saillard427d20c2008-01-30 17:23:00 -03002103 { USB_DEVICE(0x2040, 0x6502),
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002104 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2 },
Michael Krufky74ee0512008-05-01 18:02:30 -03002105 { USB_DEVICE(0x2040, 0x6513), /* HCW HVR-980 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002106 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Michael Krufky74ee0512008-05-01 18:02:30 -03002107 { USB_DEVICE(0x2040, 0x6517), /* HP HVR-950 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002108 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Michael Krufky74ee0512008-05-01 18:02:30 -03002109 { USB_DEVICE(0x2040, 0x651b), /* RP HVR-950 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002110 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03002111 { USB_DEVICE(0x2040, 0x651f),
2112 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850 },
Devin Heitmuellere14b3652008-07-26 11:04:33 -03002113 { USB_DEVICE(0x0438, 0xb002),
2114 .driver_info = EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002115 { USB_DEVICE(0x2001, 0xf112),
2116 .driver_info = EM2820_BOARD_DLINK_USB_TV },
2117 { USB_DEVICE(0x2304, 0x0207),
2118 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
2119 { USB_DEVICE(0x2304, 0x0208),
2120 .driver_info = EM2820_BOARD_PINNACLE_USB_2 },
2121 { USB_DEVICE(0x2304, 0x021a),
2122 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
2123 { USB_DEVICE(0x2304, 0x0226),
Devin Heitmueller09bc1942011-03-13 02:07:54 -03002124 .driver_info = EM2882_BOARD_PINNACLE_HYBRID_PRO_330E },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002125 { USB_DEVICE(0x2304, 0x0227),
2126 .driver_info = EM2880_BOARD_PINNACLE_PCTV_HD_PRO },
2127 { USB_DEVICE(0x0413, 0x6023),
2128 .driver_info = EM2800_BOARD_LEADTEK_WINFAST_USBII },
Don Kramer74e07f32012-01-02 16:15:44 -03002129 { USB_DEVICE(0x093b, 0xa003),
2130 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002131 { USB_DEVICE(0x093b, 0xa005),
2132 .driver_info = EM2861_BOARD_PLEXTOR_PX_TV100U },
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03002133 { USB_DEVICE(0x04bb, 0x0515),
2134 .driver_info = EM2820_BOARD_IODATA_GVMVP_SZ },
Zhenyu Wang7c8b5672009-07-05 10:51:21 -03002135 { USB_DEVICE(0xeb1a, 0x50a6),
2136 .driver_info = EM2860_BOARD_GADMEI_UTV330 },
Jarod Wilson7e48b302010-03-07 17:55:43 -03002137 { USB_DEVICE(0x1b80, 0xa340),
2138 .driver_info = EM2870_BOARD_KWORLD_A340 },
Antti Palosaarid6a5f922011-04-07 16:34:44 -03002139 { USB_DEVICE(0x2013, 0x024f),
2140 .driver_info = EM28174_BOARD_PCTV_290E },
Antti Palosaari36588712011-08-01 01:15:30 -03002141 { USB_DEVICE(0x2013, 0x024c),
2142 .driver_info = EM28174_BOARD_PCTV_460E },
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -03002143 { USB_DEVICE(0x2040, 0x1605),
2144 .driver_info = EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C },
Gareth Williams4d28d3d2011-12-24 05:47:29 -03002145 { USB_DEVICE(0xeb1a, 0x5006),
2146 .driver_info = EM2860_BOARD_HT_VIDBOX_NW03 },
Mario Ceresa2f786042012-01-06 16:00:12 -03002147 { USB_DEVICE(0x1b80, 0xe309), /* Sveon STV40 */
2148 .driver_info = EM2860_BOARD_EASYCAP },
Antti Palosaari35530852012-03-18 18:09:01 -03002149 { USB_DEVICE(0x1b80, 0xe425),
2150 .driver_info = EM2874_BOARD_MAXMEDIA_UB425_TC },
Ivan Kalvachevfa5527c2012-03-19 20:09:55 -03002151 { USB_DEVICE(0x2304, 0x0242),
2152 .driver_info = EM2884_BOARD_PCTV_510E },
Antti Palosaaric247d7b2012-03-19 11:48:19 -03002153 { USB_DEVICE(0x2013, 0x0251),
2154 .driver_info = EM2884_BOARD_PCTV_520E },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002155 { },
2156};
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002157MODULE_DEVICE_TABLE(usb, em28xx_id_table);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002158
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002159/*
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002160 * EEPROM hash table for devices with generic USB IDs
2161 */
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03002162static struct em28xx_hash_table em28xx_eeprom_hash[] = {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03002163 /* P/N: SA 60002070465 Tuner: TVF7533-MF */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002164 {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF},
Douglas Schilling Landgraf1e1addd2008-12-27 21:38:14 -03002165 {0x72cc5a8b, EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2, TUNER_YMEC_TVF_5533MF},
Darron Broadda3808e2008-09-30 02:46:41 -03002166 {0x966a0441, EM2880_BOARD_KWORLD_DVB_310U, TUNER_XC2028},
Douglas Schilling Landgrafa35c87c2009-08-06 12:52:11 -03002167 {0x166a0441, EM2880_BOARD_EMPIRE_DUAL_TV, TUNER_XC2028},
Devin Heitmueller19859222009-06-19 00:33:54 -03002168 {0xcee44a99, EM2882_BOARD_EVGA_INDTUBE, TUNER_XC2028},
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03002169 {0xb8846b20, EM2881_BOARD_PINNACLE_HYBRID_PRO, TUNER_XC2028},
Antti Palosaari285eb1a2009-09-15 14:42:13 -03002170 {0x63f653bd, EM2870_BOARD_REDDO_DVB_C_USB_BOX, TUNER_ABSENT},
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03002171 {0x4e913442, EM2882_BOARD_DIKOM_DK300, TUNER_XC2028},
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002172};
2173
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03002174/* I2C devicelist hash table for devices with generic USB IDs */
Sascha Sommerfad7b952007-11-04 08:06:48 -03002175static struct em28xx_hash_table em28xx_i2c_hash[] = {
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002176 {0xb06a32c3, EM2800_BOARD_TERRATEC_CINERGY_200, TUNER_LG_PAL_NEW_TAPC},
2177 {0xf51200e3, EM2800_BOARD_VGEAR_POCKETTV, TUNER_LG_PAL_NEW_TAPC},
Devin Heitmueller3ed58ba2009-05-27 23:27:26 -03002178 {0x1ba50080, EM2860_BOARD_SAA711X_REFERENCE_DESIGN, TUNER_ABSENT},
Devin Heitmueller443fed92010-03-19 23:53:12 -03002179 {0x77800080, EM2860_BOARD_TVP5150_REFERENCE_DESIGN, TUNER_ABSENT},
Douglas Schilling Landgraff7fe3e62009-01-19 09:31:55 -03002180 {0xc51200e3, EM2820_BOARD_GADMEI_TVR200, TUNER_LG_PAL_NEW_TAPC},
Mauro Carvalho Chehab6d888a62009-08-30 13:05:56 -03002181 {0x4ba50080, EM2861_BOARD_GADMEI_UTV330PLUS, TUNER_TNF_5335MF},
Mauro Carvalho Chehabebaefdb2011-06-01 10:16:25 -03002182 {0x6b800080, EM2874_BOARD_LEADERSHIP_ISDBT, TUNER_ABSENT},
Sascha Sommerfad7b952007-11-04 08:06:48 -03002183};
2184
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002185/* I2C possible address to saa7115, tvp5150, msp3400, tvaudio */
2186static unsigned short saa711x_addrs[] = {
2187 0x4a >> 1, 0x48 >> 1, /* SAA7111, SAA7111A and SAA7113 */
2188 0x42 >> 1, 0x40 >> 1, /* SAA7114, SAA7115 and SAA7118 */
2189 I2C_CLIENT_END };
2190
2191static unsigned short tvp5150_addrs[] = {
2192 0xb8 >> 1,
2193 0xba >> 1,
2194 I2C_CLIENT_END
2195};
2196
2197static unsigned short msp3400_addrs[] = {
2198 0x80 >> 1,
2199 0x88 >> 1,
2200 I2C_CLIENT_END
2201};
2202
Michael Krufkyd7cba042008-09-12 13:31:45 -03002203int em28xx_tuner_callback(void *ptr, int component, int command, int arg)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002204{
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002205 int rc = 0;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002206 struct em28xx *dev = ptr;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002207
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -03002208 if (dev->tuner_type != TUNER_XC2028 && dev->tuner_type != TUNER_XC5000)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002209 return 0;
2210
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -03002211 if (command != XC2028_TUNER_RESET && command != XC5000_TUNER_RESET)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002212 return 0;
2213
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03002214 rc = em28xx_gpio_set(dev, dev->board.tuner_gpio);
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002215
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002216 return rc;
2217}
2218EXPORT_SYMBOL_GPL(em28xx_tuner_callback);
2219
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03002220static inline void em28xx_set_model(struct em28xx *dev)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002221{
Ezequiel Garciae0f6e4d2012-09-26 06:25:12 -03002222 dev->board = em28xx_boards[dev->model];
Devin Heitmuellered14e1c2008-12-29 22:27:30 -03002223
2224 /* Those are the default values for the majority of boards
2225 Use those values if not specified otherwise at boards entry
2226 */
2227 if (!dev->board.xclk)
2228 dev->board.xclk = EM28XX_XCLK_IR_RC5_MODE |
2229 EM28XX_XCLK_FREQUENCY_12MHZ;
2230
2231 if (!dev->board.i2c_speed)
2232 dev->board.i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
2233 EM28XX_I2C_FREQ_100_KHZ;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002234}
2235
Mauro Carvalho Chehabf2e26ae2009-08-12 20:21:44 -03002236
2237/* FIXME: Should be replaced by a proper mt9m111 driver */
2238static int em28xx_initialize_mt9m111(struct em28xx *dev)
2239{
2240 int i;
2241 unsigned char regs[][3] = {
2242 { 0x0d, 0x00, 0x01, }, /* reset and use defaults */
2243 { 0x0d, 0x00, 0x00, },
2244 { 0x0a, 0x00, 0x21, },
2245 { 0x21, 0x04, 0x00, }, /* full readout speed, no row/col skipping */
2246 };
2247
2248 for (i = 0; i < ARRAY_SIZE(regs); i++)
2249 i2c_master_send(&dev->i2c_client, &regs[i][0], 3);
2250
2251 return 0;
2252}
2253
2254
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -03002255/* FIXME: Should be replaced by a proper mt9m001 driver */
2256static int em28xx_initialize_mt9m001(struct em28xx *dev)
2257{
2258 int i;
2259 unsigned char regs[][3] = {
2260 { 0x0d, 0x00, 0x01, },
2261 { 0x0d, 0x00, 0x00, },
2262 { 0x04, 0x05, 0x00, }, /* hres = 1280 */
2263 { 0x03, 0x04, 0x00, }, /* vres = 1024 */
2264 { 0x20, 0x11, 0x00, },
2265 { 0x06, 0x00, 0x10, },
2266 { 0x2b, 0x00, 0x24, },
2267 { 0x2e, 0x00, 0x24, },
2268 { 0x35, 0x00, 0x24, },
2269 { 0x2d, 0x00, 0x20, },
2270 { 0x2c, 0x00, 0x20, },
2271 { 0x09, 0x0a, 0xd4, },
2272 { 0x35, 0x00, 0x57, },
2273 };
2274
2275 for (i = 0; i < ARRAY_SIZE(regs); i++)
2276 i2c_master_send(&dev->i2c_client, &regs[i][0], 3);
2277
2278 return 0;
2279}
2280
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002281/* HINT method: webcam I2C chips
2282 *
Mauro Carvalho Chehabf2e26ae2009-08-12 20:21:44 -03002283 * This method works for webcams with Micron sensors
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002284 */
2285static int em28xx_hint_sensor(struct em28xx *dev)
2286{
2287 int rc;
2288 char *sensor_name;
2289 unsigned char cmd;
2290 __be16 version_be;
2291 u16 version;
2292
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002293 /* Micron sensor detection */
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002294 dev->i2c_client.addr = 0xba >> 1;
2295 cmd = 0;
2296 i2c_master_send(&dev->i2c_client, &cmd, 1);
2297 rc = i2c_master_recv(&dev->i2c_client, (char *)&version_be, 2);
2298 if (rc != 2)
2299 return -EINVAL;
2300
2301 version = be16_to_cpu(version_be);
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002302 switch (version) {
Mauro Carvalho Chehab296544e2009-07-27 08:24:29 -03002303 case 0x8232: /* mt9v011 640x480 1.3 Mpix sensor */
2304 case 0x8243: /* mt9v011 rev B 640x480 1.3 Mpix sensor */
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002305 dev->model = EM2820_BOARD_SILVERCREST_WEBCAM;
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002306 em28xx_set_model(dev);
2307
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002308 sensor_name = "mt9v011";
Mauro Carvalho Chehab527f09a2009-07-12 11:04:15 -03002309 dev->em28xx_sensor = EM28XX_MT9V011;
Mauro Carvalho Chehab55699962009-07-13 20:15:02 -03002310 dev->sensor_xres = 640;
2311 dev->sensor_yres = 480;
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002312 /*
2313 * FIXME: mt9v011 uses I2S speed as xtal clk - at least with
2314 * the Silvercrest cam I have here for testing - for higher
2315 * resolutions, a high clock cause horizontal artifacts, so we
2316 * need to use a lower xclk frequency.
2317 * Yet, it would be possible to adjust xclk depending on the
2318 * desired resolution, since this affects directly the
2319 * frame rate.
2320 */
2321 dev->board.xclk = EM28XX_XCLK_FREQUENCY_4_3MHZ;
2322 dev->sensor_xtal = 4300000;
Mauro Carvalho Chehab579d3152009-07-14 12:33:25 -03002323
2324 /* probably means GRGB 16 bit bayer */
2325 dev->vinmode = 0x0d;
2326 dev->vinctl = 0x00;
2327
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002328 break;
Mauro Carvalho Chehabf2e26ae2009-08-12 20:21:44 -03002329
2330 case 0x143a: /* MT9M111 as found in the ECS G200 */
2331 dev->model = EM2750_BOARD_UNKNOWN;
2332 em28xx_set_model(dev);
2333
2334 sensor_name = "mt9m111";
2335 dev->board.xclk = EM28XX_XCLK_FREQUENCY_48MHZ;
2336 dev->em28xx_sensor = EM28XX_MT9M111;
2337 em28xx_initialize_mt9m111(dev);
2338 dev->sensor_xres = 640;
2339 dev->sensor_yres = 512;
2340
2341 dev->vinmode = 0x0a;
2342 dev->vinctl = 0x00;
2343
2344 break;
2345
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -03002346 case 0x8431:
2347 dev->model = EM2750_BOARD_UNKNOWN;
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002348 em28xx_set_model(dev);
2349
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -03002350 sensor_name = "mt9m001";
2351 dev->em28xx_sensor = EM28XX_MT9M001;
2352 em28xx_initialize_mt9m001(dev);
2353 dev->sensor_xres = 1280;
2354 dev->sensor_yres = 1024;
2355
2356 /* probably means BGGR 16 bit bayer */
2357 dev->vinmode = 0x0c;
2358 dev->vinctl = 0x00;
2359
2360 break;
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002361 default:
Mauro Carvalho Chehabf2e26ae2009-08-12 20:21:44 -03002362 printk("Unknown Micron Sensor 0x%04x\n", version);
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002363 return -EINVAL;
2364 }
2365
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002366 /* Setup webcam defaults */
2367 em28xx_pre_card_setup(dev);
2368
Mauro Carvalho Chehab8b220792009-07-12 10:56:21 -03002369 em28xx_errdev("Sensor is %s, using model %s entry.\n",
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002370 sensor_name, em28xx_boards[dev->model].name);
2371
2372 return 0;
2373}
2374
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002375/* Since em28xx_pre_card_setup() requires a proper dev->model,
2376 * this won't work for boards with generic PCI IDs
2377 */
Ezequiel Garcia60332f02012-04-28 09:57:01 -03002378static void em28xx_pre_card_setup(struct em28xx *dev)
Markus Rechbergera94e95b2006-01-23 17:11:10 -02002379{
Devin Heitmuellered14e1c2008-12-29 22:27:30 -03002380 /* Set the initial XCLK and I2C clock values based on the board
2381 definition */
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002382 em28xx_write_reg(dev, EM28XX_R0F_XCLK, dev->board.xclk & 0x7f);
Sascha Sommerca80cf62012-01-08 16:32:09 -03002383 if (!dev->board.is_em2800)
2384 em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed);
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03002385 msleep(50);
2386
Markus Rechbergera94e95b2006-01-23 17:11:10 -02002387 /* request some modules */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002388 switch (dev->model) {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002389 case EM2861_BOARD_PLEXTOR_PX_TV100U:
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -03002390 /* Sets the msp34xx I2S speed */
2391 dev->i2s_speed = 2048000;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002392 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002393 case EM2861_BOARD_KWORLD_PVRTV_300U:
2394 case EM2880_BOARD_KWORLD_DVB_305U:
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002395 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x6d);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002396 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002397 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x7d);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002398 msleep(10);
2399 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002400 case EM2870_BOARD_COMPRO_VIDEOMATE:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002401 /* TODO: someone can do some cleanup here...
2402 not everything's needed */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002403 em28xx_write_reg(dev, EM2880_R04_GPO, 0x00);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002404 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002405 em28xx_write_reg(dev, EM2880_R04_GPO, 0x01);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002406 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002407 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002408 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002409 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002410 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002411 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xdc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002412 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002413 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002414 mdelay(70);
2415 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002416 case EM2870_BOARD_TERRATEC_XS_MT2060:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002417 /* this device needs some gpio writes to get the DVB-T
2418 demod work */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002419 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002420 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002421 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xde);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002422 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002423 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002424 mdelay(70);
2425 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002426 case EM2870_BOARD_PINNACLE_PCTV_DVB:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002427 /* this device needs some gpio writes to get the
2428 DVB-T demod work */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002429 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002430 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002431 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xde);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002432 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002433 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002434 mdelay(70);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002435 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002436 case EM2820_BOARD_GADMEI_UTV310:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002437 case EM2820_BOARD_MSI_VOX_USB_2:
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03002438 /* enables audio for that devices */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002439 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002440 break;
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03002441
Franklin Mengd7de5d82009-06-06 17:05:02 -03002442 case EM2882_BOARD_KWORLD_ATSC_315U:
2443 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff);
2444 msleep(10);
2445 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
2446 msleep(10);
2447 em28xx_write_reg(dev, EM2880_R04_GPO, 0x00);
2448 msleep(10);
2449 em28xx_write_reg(dev, EM2880_R04_GPO, 0x08);
2450 msleep(10);
2451 break;
2452
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03002453 case EM2860_BOARD_KAIOMY_TVNPC_U2:
2454 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x07", 1);
2455 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
2456 em28xx_write_regs(dev, 0x0d, "\x42", 1);
2457 em28xx_write_regs(dev, 0x08, "\xfd", 1);
2458 msleep(10);
2459 em28xx_write_regs(dev, 0x08, "\xff", 1);
2460 msleep(10);
2461 em28xx_write_regs(dev, 0x08, "\x7f", 1);
2462 msleep(10);
2463 em28xx_write_regs(dev, 0x08, "\x6b", 1);
2464
2465 break;
Mauro Carvalho Chehab56ee3802009-02-11 14:18:36 -03002466 case EM2860_BOARD_EASYCAP:
2467 em28xx_write_regs(dev, 0x08, "\xf8", 1);
2468 break;
2469
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03002470 case EM2820_BOARD_IODATA_GVMVP_SZ:
2471 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff);
2472 msleep(70);
2473 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf7);
2474 msleep(10);
2475 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
2476 msleep(70);
2477 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
2478 msleep(70);
2479 break;
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002480 }
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03002481
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03002482 em28xx_gpio_set(dev, dev->board.tuner_gpio);
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03002483 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
2484
2485 /* Unlock device */
Mauro Carvalho Chehab2fe3e2e2008-11-27 09:10:40 -03002486 em28xx_set_mode(dev, EM28XX_SUSPEND);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002487}
2488
Mauro Carvalho Chehabe54318e2008-04-18 18:34:31 -03002489static void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl)
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002490{
2491 memset(ctl, 0, sizeof(*ctl));
2492
2493 ctl->fname = XC2028_DEFAULT_FIRMWARE;
2494 ctl->max_len = 64;
2495 ctl->mts = em28xx_boards[dev->model].mts_firmware;
2496
2497 switch (dev->model) {
Douglas Schilling Landgrafe5db5d42009-04-09 18:24:34 -03002498 case EM2880_BOARD_EMPIRE_DUAL_TV:
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03002499 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
Uroš Vamplec994d02009-09-30 22:53:37 -03002500 case EM2882_BOARD_TERRATEC_HYBRID_XS:
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03002501 ctl->demod = XC3028_FE_ZARLINK456;
2502 break;
reinhard schwab655b8402008-07-26 10:47:00 -03002503 case EM2880_BOARD_TERRATEC_HYBRID_XS:
Michel Garniercec4e6c2010-10-16 14:42:01 -03002504 case EM2880_BOARD_TERRATEC_HYBRID_XS_FR:
Devin Heitmuellere16e5a32009-07-15 00:37:22 -03002505 case EM2881_BOARD_PINNACLE_HYBRID_PRO:
reinhard schwab655b8402008-07-26 10:47:00 -03002506 ctl->demod = XC3028_FE_ZARLINK456;
2507 break;
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002508 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
Devin Heitmuellerad9b4bb2011-03-13 02:09:59 -03002509 case EM2882_BOARD_PINNACLE_HYBRID_PRO_330E:
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002510 ctl->demod = XC3028_FE_DEFAULT;
2511 break;
Devin Heitmueller5ea7fe42008-09-16 02:02:12 -03002512 case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600:
2513 ctl->demod = XC3028_FE_DEFAULT;
2514 ctl->fname = XC3028L_DEFAULT_FIRMWARE;
2515 break;
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03002516 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850:
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002517 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03002518 case EM2880_BOARD_PINNACLE_PCTV_HD_PRO:
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03002519 /* FIXME: Better to specify the needed IF */
Devin Heitmuellerbdfbf952008-04-17 21:38:27 -03002520 ctl->demod = XC3028_FE_DEFAULT;
2521 break;
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03002522 case EM2883_BOARD_KWORLD_HYBRID_330U:
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03002523 case EM2882_BOARD_DIKOM_DK300:
Antonio Larrosa811fab62010-03-04 22:19:48 -03002524 case EM2882_BOARD_KWORLD_VS_DVBT:
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03002525 ctl->demod = XC3028_FE_CHINA;
2526 ctl->fname = XC2028_DEFAULT_FIRMWARE;
2527 break;
Devin Heitmueller19859222009-06-19 00:33:54 -03002528 case EM2882_BOARD_EVGA_INDTUBE:
2529 ctl->demod = XC3028_FE_CHINA;
2530 ctl->fname = XC3028L_DEFAULT_FIRMWARE;
2531 break;
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002532 default:
2533 ctl->demod = XC3028_FE_OREN538;
2534 }
2535}
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002536
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002537static void em28xx_tuner_setup(struct em28xx *dev)
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002538{
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002539 struct tuner_setup tun_setup;
2540 struct v4l2_frequency f;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002541
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03002542 if (dev->tuner_type == TUNER_ABSENT)
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002543 return;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002544
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002545 memset(&tun_setup, 0, sizeof(tun_setup));
2546
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002547 tun_setup.mode_mask = T_ANALOG_TV | T_RADIO;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002548 tun_setup.tuner_callback = em28xx_tuner_callback;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002549
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002550 if (dev->board.radio.type) {
2551 tun_setup.type = dev->board.radio.type;
2552 tun_setup.addr = dev->board.radio_addr;
2553
2554 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_type_addr, &tun_setup);
2555 }
2556
2557 if ((dev->tuner_type != TUNER_ABSENT) && (dev->tuner_type)) {
2558 tun_setup.type = dev->tuner_type;
2559 tun_setup.addr = dev->tuner_addr;
2560
2561 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_type_addr, &tun_setup);
2562 }
2563
2564 if (dev->tda9887_conf) {
2565 struct v4l2_priv_tun_config tda9887_cfg;
2566
2567 tda9887_cfg.tuner = TUNER_TDA9887;
2568 tda9887_cfg.priv = &dev->tda9887_conf;
2569
2570 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_config, &tda9887_cfg);
2571 }
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002572
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002573 if (dev->tuner_type == TUNER_XC2028) {
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002574 struct v4l2_priv_tun_config xc2028_cfg;
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002575 struct xc2028_ctrl ctl;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002576
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002577 memset(&xc2028_cfg, 0, sizeof(xc2028_cfg));
2578 memset(&ctl, 0, sizeof(ctl));
2579
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002580 em28xx_setup_xc3028(dev, &ctl);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002581
2582 xc2028_cfg.tuner = TUNER_XC2028;
2583 xc2028_cfg.priv = &ctl;
2584
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002585 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_config, &xc2028_cfg);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002586 }
2587
2588 /* configure tuner */
2589 f.tuner = 0;
2590 f.type = V4L2_TUNER_ANALOG_TV;
2591 f.frequency = 9076; /* just a magic number */
2592 dev->ctl_freq = f.frequency;
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002593 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002594}
2595
2596static int em28xx_hint_board(struct em28xx *dev)
2597{
2598 int i;
2599
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03002600 /* HINT method: EEPROM
2601 *
2602 * This method works only for boards with eeprom.
2603 * Uses a hash of all eeprom bytes. The hash should be
2604 * unique for a vendor/tuner pair.
2605 * There are a high chance that tuners for different
2606 * video standards produce different hashes.
2607 */
2608 for (i = 0; i < ARRAY_SIZE(em28xx_eeprom_hash); i++) {
2609 if (dev->hash == em28xx_eeprom_hash[i].hash) {
2610 dev->model = em28xx_eeprom_hash[i].model;
2611 dev->tuner_type = em28xx_eeprom_hash[i].tuner;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002612
2613 em28xx_errdev("Your board has no unique USB ID.\n");
2614 em28xx_errdev("A hint were successfully done, "
2615 "based on eeprom hash.\n");
2616 em28xx_errdev("This method is not 100%% failproof.\n");
2617 em28xx_errdev("If the board were missdetected, "
2618 "please email this log to:\n");
2619 em28xx_errdev("\tV4L Mailing List "
Alexey Klimov51caf912009-01-25 12:53:09 -03002620 " <linux-media@vger.kernel.org>\n");
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002621 em28xx_errdev("Board detected as %s\n",
2622 em28xx_boards[dev->model].name);
2623
2624 return 0;
2625 }
2626 }
Sascha Sommerfad7b952007-11-04 08:06:48 -03002627
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03002628 /* HINT method: I2C attached devices
2629 *
2630 * This method works for all boards.
2631 * Uses a hash of i2c scanned devices.
2632 * Devices with the same i2c attached chips will
2633 * be considered equal.
2634 * This method is less precise than the eeprom one.
2635 */
2636
Sascha Sommerfad7b952007-11-04 08:06:48 -03002637 /* user did not request i2c scanning => do it now */
2638 if (!dev->i2c_hash)
2639 em28xx_do_i2c_scan(dev);
2640
2641 for (i = 0; i < ARRAY_SIZE(em28xx_i2c_hash); i++) {
2642 if (dev->i2c_hash == em28xx_i2c_hash[i].hash) {
2643 dev->model = em28xx_i2c_hash[i].model;
2644 dev->tuner_type = em28xx_i2c_hash[i].tuner;
2645 em28xx_errdev("Your board has no unique USB ID.\n");
2646 em28xx_errdev("A hint were successfully done, "
2647 "based on i2c devicelist hash.\n");
2648 em28xx_errdev("This method is not 100%% failproof.\n");
2649 em28xx_errdev("If the board were missdetected, "
2650 "please email this log to:\n");
2651 em28xx_errdev("\tV4L Mailing List "
Alexey Klimov51caf912009-01-25 12:53:09 -03002652 " <linux-media@vger.kernel.org>\n");
Sascha Sommerfad7b952007-11-04 08:06:48 -03002653 em28xx_errdev("Board detected as %s\n",
2654 em28xx_boards[dev->model].name);
2655
2656 return 0;
2657 }
2658 }
2659
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002660 em28xx_errdev("Your board has no unique USB ID and thus need a "
2661 "hint to be detected.\n");
2662 em28xx_errdev("You may try to use card=<n> insmod option to "
2663 "workaround that.\n");
2664 em28xx_errdev("Please send an email with this log to:\n");
Alexey Klimov51caf912009-01-25 12:53:09 -03002665 em28xx_errdev("\tV4L Mailing List <linux-media@vger.kernel.org>\n");
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002666 em28xx_errdev("Board eeprom hash is 0x%08lx\n", dev->hash);
Sascha Sommerfad7b952007-11-04 08:06:48 -03002667 em28xx_errdev("Board i2c devicelist hash is 0x%08lx\n", dev->i2c_hash);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002668
2669 em28xx_errdev("Here is a list of valid choices for the card=<n>"
2670 " insmod option:\n");
2671 for (i = 0; i < em28xx_bcount; i++) {
2672 em28xx_errdev(" card=%d -> %s\n",
2673 i, em28xx_boards[i].name);
2674 }
2675 return -1;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002676}
2677
Ezequiel Garcia60332f02012-04-28 09:57:01 -03002678static void em28xx_card_setup(struct em28xx *dev)
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002679{
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002680 /*
2681 * If the device can be a webcam, seek for a sensor.
2682 * If sensor is not found, then it isn't a webcam.
2683 */
2684 if (dev->board.is_webcam) {
2685 if (em28xx_hint_sensor(dev) < 0)
2686 dev->board.is_webcam = 0;
2687 else
2688 dev->progressive = 1;
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03002689 }
2690
2691 if (!dev->board.is_webcam) {
2692 switch (dev->model) {
2693 case EM2820_BOARD_UNKNOWN:
2694 case EM2800_BOARD_UNKNOWN:
2695 /*
2696 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD.
2697 *
2698 * This occurs because they share identical USB vendor and
2699 * product IDs.
2700 *
2701 * What we do here is look up the EEPROM hash of the K-WORLD
2702 * and if it is found then we decide that we do not have
2703 * a DIGIVOX and reset the device to the K-WORLD instead.
2704 *
2705 * This solution is only valid if they do not share eeprom
2706 * hash identities which has not been determined as yet.
2707 */
2708 if (em28xx_hint_board(dev) < 0)
2709 em28xx_errdev("Board not discovered\n");
2710 else {
2711 em28xx_set_model(dev);
2712 em28xx_pre_card_setup(dev);
2713 }
2714 break;
2715 default:
2716 em28xx_set_model(dev);
2717 }
2718 }
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002719
2720 em28xx_info("Identified as %s (card=%d)\n",
2721 dev->board.name, dev->model);
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002722
2723 dev->tuner_type = em28xx_boards[dev->model].tuner_type;
Mauro Carvalho Chehab31e05302008-11-20 18:47:37 -03002724 if (em28xx_boards[dev->model].tuner_addr)
2725 dev->tuner_addr = em28xx_boards[dev->model].tuner_addr;
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002726
Franklin Mengae3340c2009-06-06 16:34:01 -03002727 if (em28xx_boards[dev->model].tda9887_conf)
2728 dev->tda9887_conf = em28xx_boards[dev->model].tda9887_conf;
2729
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002730 /* request some modules */
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002731 switch (dev->model) {
2732 case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2:
Mauro Carvalho Chehab98ae1272007-11-05 09:30:39 -03002733 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002734 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03002735 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850:
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002736 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002737 {
2738 struct tveeprom tv;
Mauro Carvalho Chehabac07bb72009-09-08 14:04:41 -03002739#if defined(CONFIG_MODULES) && defined(MODULE)
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002740 request_module("tveeprom");
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002741#endif
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002742 /* Call first TVeeprom */
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002743
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002744 dev->i2c_client.addr = 0xa0 >> 1;
2745 tveeprom_hauppauge_analog(&dev->i2c_client, &tv, dev->eedata);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002746
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002747 dev->tuner_type = tv.tuner_type;
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03002748
Hans Verkuil38f9d302008-07-23 05:09:15 -03002749 if (tv.audio_processor == V4L2_IDENT_MSPX4XX) {
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002750 dev->i2s_speed = 2048000;
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002751 dev->board.has_msp34xx = 1;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002752 }
2753 break;
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002754 }
Franklin Mengd7de5d82009-06-06 17:05:02 -03002755 case EM2882_BOARD_KWORLD_ATSC_315U:
2756 em28xx_write_reg(dev, 0x0d, 0x42);
2757 msleep(10);
2758 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
2759 msleep(10);
2760 break;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002761 case EM2820_BOARD_KWORLD_PVRTV2800RF:
2762 /* GPIO enables sound on KWORLD PVR TV 2800RF */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002763 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf9);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002764 break;
2765 case EM2820_BOARD_UNKNOWN:
2766 case EM2800_BOARD_UNKNOWN:
Darron Broadda3808e2008-09-30 02:46:41 -03002767 /*
2768 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD.
2769 *
2770 * This occurs because they share identical USB vendor and
2771 * product IDs.
2772 *
2773 * What we do here is look up the EEPROM hash of the K-WORLD
2774 * and if it is found then we decide that we do not have
2775 * a DIGIVOX and reset the device to the K-WORLD instead.
2776 *
2777 * This solution is only valid if they do not share eeprom
2778 * hash identities which has not been determined as yet.
2779 */
2780 case EM2880_BOARD_MSI_DIGIVOX_AD:
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002781 if (!em28xx_hint_board(dev))
2782 em28xx_set_model(dev);
Devin Heitmuellercdf7bfa2009-06-19 00:20:28 -03002783
2784 /* In cases where we had to use a board hint, the call to
2785 em28xx_set_mode() in em28xx_pre_card_setup() was a no-op,
2786 so make the call now so the analog GPIOs are set properly
2787 before probing the i2c bus. */
Devin Heitmueller5343e442009-07-15 00:35:47 -03002788 em28xx_gpio_set(dev, dev->board.tuner_gpio);
Devin Heitmuellercdf7bfa2009-06-19 00:20:28 -03002789 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002790 break;
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03002791
2792/*
2793 * The Dikom DK300 is detected as an Kworld VS-DVB-T 323UR.
2794 *
2795 * This occurs because they share identical USB vendor and
2796 * product IDs.
2797 *
2798 * What we do here is look up the EEPROM hash of the Dikom
2799 * and if it is found then we decide that we do not have
2800 * a Kworld and reset the device to the Dikom instead.
2801 *
2802 * This solution is only valid if they do not share eeprom
2803 * hash identities which has not been determined as yet.
2804 */
2805 case EM2882_BOARD_KWORLD_VS_DVBT:
2806 if (!em28xx_hint_board(dev))
2807 em28xx_set_model(dev);
2808
2809 /* In cases where we had to use a board hint, the call to
2810 em28xx_set_mode() in em28xx_pre_card_setup() was a no-op,
2811 so make the call now so the analog GPIOs are set properly
2812 before probing the i2c bus. */
2813 em28xx_gpio_set(dev, dev->board.tuner_gpio);
2814 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
2815 break;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002816 }
2817
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002818 if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002819 em28xx_errdev("\n\n");
2820 em28xx_errdev("The support for this board weren't "
2821 "valid yet.\n");
2822 em28xx_errdev("Please send a report of having this working\n");
2823 em28xx_errdev("not to V4L mailing list (and/or to other "
2824 "addresses)\n\n");
2825 }
2826
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002827 /* Allow override tuner type by a module parameter */
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002828 if (tuner >= 0)
2829 dev->tuner_type = tuner;
2830
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002831 /* request some modules */
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002832 if (dev->board.has_msp34xx)
Hans Verkuil53dacb12009-08-10 02:49:08 -03002833 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002834 "msp3400", 0, msp3400_addrs);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002835
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03002836 if (dev->board.decoder == EM28XX_SAA711X)
Hans Verkuil53dacb12009-08-10 02:49:08 -03002837 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002838 "saa7115_auto", 0, saa711x_addrs);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002839
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002840 if (dev->board.decoder == EM28XX_TVP5150)
Hans Verkuil53dacb12009-08-10 02:49:08 -03002841 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002842 "tvp5150", 0, tvp5150_addrs);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002843
Mauro Carvalho Chehabd36bb4e2009-07-14 03:18:39 -03002844 if (dev->em28xx_sensor == EM28XX_MT9V011) {
Hans Verkuil3c7c9372011-01-08 07:08:02 -03002845 struct mt9v011_platform_data pdata;
2846 struct i2c_board_info mt9v011_info = {
2847 .type = "mt9v011",
2848 .addr = 0xba >> 1,
2849 .platform_data = &pdata,
2850 };
Mauro Carvalho Chehabd36bb4e2009-07-14 03:18:39 -03002851
Hans Verkuil3c7c9372011-01-08 07:08:02 -03002852 pdata.xtal = dev->sensor_xtal;
Mauro Carvalho Chehab00d2e7a2011-06-17 20:28:51 -03002853 v4l2_i2c_new_subdev_board(&dev->v4l2_dev, &dev->i2c_adap,
Hans Verkuil3c7c9372011-01-08 07:08:02 -03002854 &mt9v011_info, NULL);
Mauro Carvalho Chehabd36bb4e2009-07-14 03:18:39 -03002855 }
Mauro Carvalho Chehab02e78042009-06-29 11:35:05 -03002856
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -03002857
Mauro Carvalho Chehabdf7fa092009-02-25 09:06:13 -03002858 if (dev->board.adecoder == EM28XX_TVAUDIO)
Hans Verkuile6574f22009-04-01 03:57:53 -03002859 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002860 "tvaudio", dev->board.tvaudio_addr, NULL);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002861
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002862 if (dev->board.tuner_type != TUNER_ABSENT) {
2863 int has_demod = (dev->tda9887_conf & TDA9887_PRESENT);
Mauro Carvalho Chehaba924a492008-11-12 08:41:29 -03002864
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002865 if (dev->board.radio.type)
Hans Verkuile6574f22009-04-01 03:57:53 -03002866 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002867 "tuner", dev->board.radio_addr, NULL);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002868
2869 if (has_demod)
Hans Verkuil53dacb12009-08-10 02:49:08 -03002870 v4l2_i2c_new_subdev(&dev->v4l2_dev,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002871 &dev->i2c_adap, "tuner",
Hans Verkuil53dacb12009-08-10 02:49:08 -03002872 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002873 if (dev->tuner_addr == 0) {
2874 enum v4l2_i2c_tuner_type type =
2875 has_demod ? ADDRS_TV_WITH_DEMOD : ADDRS_TV;
2876 struct v4l2_subdev *sd;
2877
Hans Verkuil53dacb12009-08-10 02:49:08 -03002878 sd = v4l2_i2c_new_subdev(&dev->v4l2_dev,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002879 &dev->i2c_adap, "tuner",
Hans Verkuil53dacb12009-08-10 02:49:08 -03002880 0, v4l2_i2c_tuner_addrs(type));
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002881
2882 if (sd)
2883 dev->tuner_addr = v4l2_i2c_subdev_addr(sd);
2884 } else {
Hans Verkuile6574f22009-04-01 03:57:53 -03002885 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002886 "tuner", dev->tuner_addr, NULL);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002887 }
2888 }
2889
2890 em28xx_tuner_setup(dev);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002891}
Mauro Carvalho Chehabc8644052008-11-25 13:10:14 -03002892
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002893
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002894static void request_module_async(struct work_struct *work)
2895{
2896 struct em28xx *dev = container_of(work,
2897 struct em28xx, request_module_wk);
2898
Mauro Carvalho Chehab6ae5e062012-10-02 15:35:27 -03002899 /*
2900 * The em28xx extensions can be modules or builtin. If the
2901 * modules are already loaded or are built in, those extensions
2902 * can be initialised right now. Otherwise, the module init
2903 * code will do it.
2904 */
2905 em28xx_init_extension(dev);
2906
2907#if defined(CONFIG_MODULES) && defined(MODULE)
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002908 if (dev->has_audio_class)
2909 request_module("snd-usb-audio");
2910 else if (dev->has_alsa_audio)
2911 request_module("em28xx-alsa");
2912
2913 if (dev->board.has_dvb)
2914 request_module("em28xx-dvb");
Mauro Carvalho Chehab728f9772013-01-04 17:32:58 -03002915 if ((dev->board.ir_codes || dev->board.has_ir_i2c) && !disable_ir)
Ezequiel Garcíaf4d4e762012-03-26 09:13:35 -03002916 request_module("em28xx-rc");
Mauro Carvalho Chehab6ae5e062012-10-02 15:35:27 -03002917#endif /* CONFIG_MODULES */
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002918}
2919
2920static void request_modules(struct em28xx *dev)
2921{
2922 INIT_WORK(&dev->request_module_wk, request_module_async);
2923 schedule_work(&dev->request_module_wk);
2924}
Tejun Heo707bcf32010-12-24 16:14:20 +01002925
2926static void flush_request_modules(struct em28xx *dev)
2927{
Linus Torvalds0b8e74c2012-10-07 17:49:05 +09002928 flush_work(&dev->request_module_wk);
Tejun Heo707bcf32010-12-24 16:14:20 +01002929}
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002930
2931/*
Chris Rankind7222e72011-09-24 11:02:32 -03002932 * em28xx_release_resources()
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002933 * unregisters the v4l2,i2c and usb devices
Chris Rankind7222e72011-09-24 11:02:32 -03002934 * called when the device gets disconnected or at module unload
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002935*/
2936void em28xx_release_resources(struct em28xx *dev)
2937{
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002938 /*FIXME: I2C IR should be disconnected */
2939
2940 em28xx_release_analog_resources(dev);
2941
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002942 em28xx_i2c_unregister(dev);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002943
Hans Verkuil081b9452012-09-07 05:43:59 -03002944 v4l2_ctrl_handler_free(&dev->ctrl_handler);
2945
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002946 v4l2_device_unregister(&dev->v4l2_dev);
2947
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002948 usb_put_dev(dev->udev);
2949
2950 /* Mark device as unused */
Chris Rankin38b61eb2011-08-20 08:21:03 -03002951 clear_bit(dev->devno, &em28xx_devused);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002952};
2953
2954/*
2955 * em28xx_init_dev()
2956 * allocates and inits the device structs, registers i2c bus and v4l device
2957 */
Thomas Petazzoni622c2fc2012-01-07 10:18:45 -03002958static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,
Mauro Carvalho Chehab36fa6742009-04-05 08:02:15 -03002959 struct usb_interface *interface,
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002960 int minor)
2961{
Hans Verkuil081b9452012-09-07 05:43:59 -03002962 struct v4l2_ctrl_handler *hdl = &dev->ctrl_handler;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002963 int retval;
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02002964 static const char *default_chip_name = "em28xx";
2965 const char *chip_name = default_chip_name;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002966
2967 dev->udev = udev;
Devin Heitmuellerd3829fa2013-01-04 16:16:24 -03002968 mutex_init(&dev->vb_queue_lock);
2969 mutex_init(&dev->vb_vbi_queue_lock);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002970 mutex_init(&dev->ctrl_urb_lock);
2971 spin_lock_init(&dev->slock);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002972
2973 dev->em28xx_write_regs = em28xx_write_regs;
2974 dev->em28xx_read_reg = em28xx_read_reg;
2975 dev->em28xx_read_reg_req_len = em28xx_read_reg_req_len;
2976 dev->em28xx_write_regs_req = em28xx_write_regs_req;
2977 dev->em28xx_read_reg_req = em28xx_read_reg_req;
2978 dev->board.is_em2800 = em28xx_boards[dev->model].is_em2800;
2979
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002980 em28xx_set_model(dev);
2981
2982 /* Set the default GPO/GPIO for legacy devices */
2983 dev->reg_gpo_num = EM2880_R04_GPO;
2984 dev->reg_gpio_num = EM28XX_R08_GPIO;
2985
2986 dev->wait_after_write = 5;
2987
2988 /* Based on the Chip ID, set the device configuration */
2989 retval = em28xx_read_reg(dev, EM28XX_R0A_CHIPID);
2990 if (retval > 0) {
2991 dev->chip_id = retval;
2992
2993 switch (dev->chip_id) {
Mauro Carvalho Chehabf57b17c32009-11-12 11:21:05 -03002994 case CHIP_ID_EM2800:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02002995 chip_name = "em2800";
Mauro Carvalho Chehabf57b17c32009-11-12 11:21:05 -03002996 break;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002997 case CHIP_ID_EM2710:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02002998 chip_name = "em2710";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002999 break;
3000 case CHIP_ID_EM2750:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003001 chip_name = "em2750";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003002 break;
3003 case CHIP_ID_EM2820:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003004 chip_name = "em2710/2820";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003005 break;
3006 case CHIP_ID_EM2840:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003007 chip_name = "em2840";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003008 break;
3009 case CHIP_ID_EM2860:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003010 chip_name = "em2860";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003011 break;
3012 case CHIP_ID_EM2870:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003013 chip_name = "em2870";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003014 dev->wait_after_write = 0;
3015 break;
3016 case CHIP_ID_EM2874:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003017 chip_name = "em2874";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003018 dev->reg_gpio_num = EM2874_R80_GPIO;
3019 dev->wait_after_write = 0;
3020 break;
Antti Palosaaribc022692011-04-07 16:04:48 -03003021 case CHIP_ID_EM28174:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003022 chip_name = "em28174";
Antti Palosaaribc022692011-04-07 16:04:48 -03003023 dev->reg_gpio_num = EM2874_R80_GPIO;
3024 dev->wait_after_write = 0;
3025 break;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003026 case CHIP_ID_EM2883:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003027 chip_name = "em2882/3";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003028 dev->wait_after_write = 0;
3029 break;
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -03003030 case CHIP_ID_EM2884:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003031 chip_name = "em2884";
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -03003032 dev->reg_gpio_num = EM2874_R80_GPIO;
3033 dev->wait_after_write = 0;
3034 break;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003035 default:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003036 printk(KERN_INFO DRIVER_NAME
3037 ": unknown em28xx chip ID (%d)\n", dev->chip_id);
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003038 }
3039 }
3040
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003041 if (chip_name != default_chip_name)
3042 printk(KERN_INFO DRIVER_NAME
3043 ": chip ID is %s\n", chip_name);
3044
3045 /*
3046 * For em2820/em2710, the name may change latter, after checking
3047 * if the device has a sensor (so, it is em2710) or not.
3048 */
3049 snprintf(dev->name, sizeof(dev->name), "%s #%d", chip_name, dev->devno);
3050
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003051 if (dev->is_audio_only) {
Chris Rankin6c03e382011-08-20 08:28:17 -03003052 retval = em28xx_audio_setup(dev);
3053 if (retval)
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003054 return -ENODEV;
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003055 em28xx_init_extension(dev);
3056
3057 return 0;
3058 }
3059
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003060 /* Prepopulate cached GPO register content */
3061 retval = em28xx_read_reg(dev, dev->reg_gpo_num);
3062 if (retval >= 0)
3063 dev->reg_gpo = retval;
3064
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003065 em28xx_pre_card_setup(dev);
3066
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003067 if (dev->chip_id == CHIP_ID_EM2820) {
3068 if (dev->board.is_webcam)
3069 chip_name = "em2710";
3070 else
3071 chip_name = "em2820";
3072 snprintf(dev->name, sizeof(dev->name), "%s #%d", chip_name, dev->devno);
3073 }
3074
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003075 if (!dev->board.is_em2800) {
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03003076 /* Resets I2C speed */
Sascha Sommer0903bb52012-01-08 16:19:30 -03003077 retval = em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003078 if (retval < 0) {
Chris Rankin6c03e382011-08-20 08:28:17 -03003079 em28xx_errdev("%s: em28xx_write_reg failed!"
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003080 " retval [%d]\n",
3081 __func__, retval);
3082 return retval;
3083 }
3084 }
3085
Mauro Carvalho Chehab36fa6742009-04-05 08:02:15 -03003086 retval = v4l2_device_register(&interface->dev, &dev->v4l2_dev);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003087 if (retval < 0) {
3088 em28xx_errdev("Call to v4l2_device_register() failed!\n");
3089 return retval;
3090 }
3091
Hans Verkuil081b9452012-09-07 05:43:59 -03003092 v4l2_ctrl_handler_init(hdl, 4);
3093 dev->v4l2_dev.ctrl_handler = hdl;
3094
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003095 /* register i2c bus */
Chris Rankin6c03e382011-08-20 08:28:17 -03003096 retval = em28xx_i2c_register(dev);
3097 if (retval < 0) {
3098 em28xx_errdev("%s: em28xx_i2c_register - error [%d]!\n",
3099 __func__, retval);
3100 goto unregister_dev;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003101 }
3102
Mauro Carvalho Chehabb04fb662009-07-13 01:28:21 -03003103 /*
Mauro Carvalho Chehab579d3152009-07-14 12:33:25 -03003104 * Default format, used for tvp5150 or saa711x output formats
3105 */
3106 dev->vinmode = 0x10;
Devin Heitmueller206313d2009-08-31 23:23:03 -03003107 dev->vinctl = EM28XX_VINCTRL_INTERLACED |
3108 EM28XX_VINCTRL_CCIR656_ENABLE;
Mauro Carvalho Chehab579d3152009-07-14 12:33:25 -03003109
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003110 /* Do board specific init and eeprom reading */
3111 em28xx_card_setup(dev);
3112
3113 /* Configure audio */
Chris Rankin6c03e382011-08-20 08:28:17 -03003114 retval = em28xx_audio_setup(dev);
3115 if (retval < 0) {
3116 em28xx_errdev("%s: Error while setting audio - error [%d]!\n",
3117 __func__, retval);
3118 goto fail;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003119 }
Hans Verkuil081b9452012-09-07 05:43:59 -03003120 if (dev->audio_mode.ac97 != EM28XX_NO_AC97) {
3121 v4l2_ctrl_new_std(hdl, &em28xx_ctrl_ops,
3122 V4L2_CID_AUDIO_MUTE, 0, 1, 1, 1);
3123 v4l2_ctrl_new_std(hdl, &em28xx_ctrl_ops,
3124 V4L2_CID_AUDIO_VOLUME, 0, 0x1f, 1, 0x1f);
3125 } else {
3126 /* install the em28xx notify callback */
3127 v4l2_ctrl_notify(v4l2_ctrl_find(hdl, V4L2_CID_AUDIO_MUTE),
3128 em28xx_ctrl_notify, dev);
3129 v4l2_ctrl_notify(v4l2_ctrl_find(hdl, V4L2_CID_AUDIO_VOLUME),
3130 em28xx_ctrl_notify, dev);
3131 }
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003132
3133 /* wake i2c devices */
3134 em28xx_wake_i2c(dev);
3135
3136 /* init video dma queues */
3137 INIT_LIST_HEAD(&dev->vidq.active);
Devin Heitmueller28abf0832009-09-01 01:54:54 -03003138 INIT_LIST_HEAD(&dev->vbiq.active);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003139
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003140 if (dev->board.has_msp34xx) {
3141 /* Send a reset to other chips via gpio */
Chris Rankin6c03e382011-08-20 08:28:17 -03003142 retval = em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf7);
3143 if (retval < 0) {
3144 em28xx_errdev("%s: em28xx_write_reg - "
3145 "msp34xx(1) failed! error [%d]\n",
3146 __func__, retval);
3147 goto fail;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003148 }
3149 msleep(3);
3150
Chris Rankin6c03e382011-08-20 08:28:17 -03003151 retval = em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff);
3152 if (retval < 0) {
3153 em28xx_errdev("%s: em28xx_write_reg - "
3154 "msp34xx(2) failed! error [%d]\n",
3155 __func__, retval);
3156 goto fail;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003157 }
3158 msleep(3);
3159 }
3160
Hans Verkuil081b9452012-09-07 05:43:59 -03003161 v4l2_ctrl_handler_setup(&dev->ctrl_handler);
3162 retval = dev->ctrl_handler.error;
3163 if (retval)
3164 goto fail;
3165
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003166 retval = em28xx_register_analog_devices(dev);
3167 if (retval < 0) {
Chris Rankin6c03e382011-08-20 08:28:17 -03003168 goto fail;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003169 }
3170
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003171 /* Save some power by putting tuner to sleep */
Laurent Pinchart622b8282009-10-05 10:48:17 -03003172 v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_power, 0);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003173
3174 return 0;
3175
Chris Rankin6c03e382011-08-20 08:28:17 -03003176fail:
3177 em28xx_i2c_unregister(dev);
Hans Verkuil081b9452012-09-07 05:43:59 -03003178 v4l2_ctrl_handler_free(&dev->ctrl_handler);
Chris Rankin6c03e382011-08-20 08:28:17 -03003179
3180unregister_dev:
3181 v4l2_device_unregister(&dev->v4l2_dev);
3182
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003183 return retval;
3184}
3185
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003186/* high bandwidth multiplier, as encoded in highspeed endpoint descriptors */
3187#define hb_mult(wMaxPacketSize) (1 + (((wMaxPacketSize) >> 11) & 0x03))
3188
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003189/*
3190 * em28xx_usb_probe()
3191 * checks for supported devices
3192 */
3193static int em28xx_usb_probe(struct usb_interface *interface,
3194 const struct usb_device_id *id)
3195{
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003196 struct usb_device *udev;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003197 struct em28xx *dev = NULL;
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003198 int retval;
Holger Nelson8ab33622011-12-28 18:55:41 -03003199 bool has_audio = false, has_video = false, has_dvb = false;
Mauro Carvalho Chehab8b2aea72012-12-23 13:25:38 -02003200 int i, nr, try_bulk;
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003201 const int ifnum = interface->altsetting[0].desc.bInterfaceNumber;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003202 char *speed;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003203
3204 udev = usb_get_dev(interface_to_usbdev(interface));
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003205
3206 /* Check to see next free device and mark as used */
Chris Rankin38b61eb2011-08-20 08:21:03 -03003207 do {
3208 nr = find_first_zero_bit(&em28xx_devused, EM28XX_MAXBOARDS);
3209 if (nr >= EM28XX_MAXBOARDS) {
3210 /* No free device slots */
3211 printk(DRIVER_NAME ": Supports only %i em28xx boards.\n",
3212 EM28XX_MAXBOARDS);
3213 retval = -ENOMEM;
3214 goto err_no_slot;
3215 }
3216 } while (test_and_set_bit(nr, &em28xx_devused));
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003217
3218 /* Don't register audio interfaces */
3219 if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
3220 em28xx_err(DRIVER_NAME " audio device (%04x:%04x): "
3221 "interface %i, class %i\n",
3222 le16_to_cpu(udev->descriptor.idVendor),
3223 le16_to_cpu(udev->descriptor.idProduct),
3224 ifnum,
3225 interface->altsetting[0].desc.bInterfaceClass);
3226
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003227 retval = -ENODEV;
3228 goto err;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003229 }
3230
Holger Nelson8ab33622011-12-28 18:55:41 -03003231 /* allocate memory for our device state and initialize it */
3232 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
3233 if (dev == NULL) {
3234 em28xx_err(DRIVER_NAME ": out of memory!\n");
3235 retval = -ENOMEM;
3236 goto err;
3237 }
3238
3239 /* compute alternate max packet sizes */
Frank Schaefer0cf544a2012-11-08 14:11:49 -03003240 dev->alt_max_pkt_size_isoc =
3241 kmalloc(sizeof(dev->alt_max_pkt_size_isoc[0]) *
Holger Nelson8ab33622011-12-28 18:55:41 -03003242 interface->num_altsetting, GFP_KERNEL);
Frank Schaefer0cf544a2012-11-08 14:11:49 -03003243 if (dev->alt_max_pkt_size_isoc == NULL) {
Holger Nelson8ab33622011-12-28 18:55:41 -03003244 em28xx_errdev("out of memory!\n");
3245 kfree(dev);
3246 retval = -ENOMEM;
3247 goto err;
3248 }
3249
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003250 /* Get endpoints */
3251 for (i = 0; i < interface->num_altsetting; i++) {
3252 int ep;
3253
3254 for (ep = 0; ep < interface->altsetting[i].desc.bNumEndpoints; ep++) {
Holger Nelson8ab33622011-12-28 18:55:41 -03003255 const struct usb_endpoint_descriptor *e;
3256 int sizedescr, size;
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003257
Holger Nelson8ab33622011-12-28 18:55:41 -03003258 e = &interface->altsetting[i].endpoint[ep].desc;
3259
3260 sizedescr = le16_to_cpu(e->wMaxPacketSize);
3261 size = sizedescr & 0x7ff;
3262
3263 if (udev->speed == USB_SPEED_HIGH)
3264 size = size * hb_mult(sizedescr);
3265
Frank Schaeferc647a912012-11-08 14:11:52 -03003266 if (usb_endpoint_dir_in(e)) {
Holger Nelson8ab33622011-12-28 18:55:41 -03003267 switch (e->bEndpointAddress) {
Frank Schaeferc647a912012-11-08 14:11:52 -03003268 case 0x82:
Holger Nelson8ab33622011-12-28 18:55:41 -03003269 has_video = true;
Frank Schaeferc647a912012-11-08 14:11:52 -03003270 if (usb_endpoint_xfer_isoc(e)) {
3271 dev->analog_ep_isoc =
3272 e->bEndpointAddress;
3273 dev->alt_max_pkt_size_isoc[i] = size;
3274 } else if (usb_endpoint_xfer_bulk(e)) {
3275 dev->analog_ep_bulk =
3276 e->bEndpointAddress;
3277 }
Holger Nelson8ab33622011-12-28 18:55:41 -03003278 break;
Frank Schaeferc647a912012-11-08 14:11:52 -03003279 case 0x83:
3280 if (usb_endpoint_xfer_isoc(e)) {
3281 has_audio = true;
3282 } else {
3283 printk(KERN_INFO DRIVER_NAME
3284 ": error: skipping audio endpoint 0x83, because it uses bulk transfers !\n");
3285 }
3286 break;
3287 case 0x84:
3288 if (has_video &&
3289 (usb_endpoint_xfer_bulk(e))) {
3290 dev->analog_ep_bulk =
3291 e->bEndpointAddress;
3292 } else {
3293 has_dvb = true;
3294 if (usb_endpoint_xfer_isoc(e)) {
3295 dev->dvb_ep_isoc = e->bEndpointAddress;
3296 if (size > dev->dvb_max_pkt_size_isoc) {
3297 dev->dvb_max_pkt_size_isoc = size;
3298 dev->dvb_alt_isoc = i;
3299 }
3300 } else {
3301 dev->dvb_ep_bulk = e->bEndpointAddress;
3302 }
Holger Nelson8ab33622011-12-28 18:55:41 -03003303 }
3304 break;
3305 }
3306 }
Frank Schaeferc647a912012-11-08 14:11:52 -03003307 /* NOTE:
3308 * Old logic with support for isoc transfers only was:
3309 * 0x82 isoc => analog
3310 * 0x83 isoc => audio
3311 * 0x84 isoc => digital
3312 *
3313 * New logic with support for bulk transfers
3314 * 0x82 isoc => analog
3315 * 0x82 bulk => analog
3316 * 0x83 isoc* => audio
3317 * 0x84 isoc => digital
3318 * 0x84 bulk => analog or digital**
3319 * (*: audio should always be isoc)
3320 * (**: analog, if ep 0x82 is isoc, otherwise digital)
3321 *
3322 * The new logic preserves backwards compatibility and
3323 * reflects the endpoint configurations we have seen
3324 * so far. But there might be devices for which this
3325 * logic is not sufficient...
3326 */
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003327 }
3328 }
3329
Holger Nelson8ab33622011-12-28 18:55:41 -03003330 if (!(has_audio || has_video || has_dvb)) {
3331 retval = -ENODEV;
3332 goto err_free;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003333 }
3334
3335 switch (udev->speed) {
3336 case USB_SPEED_LOW:
3337 speed = "1.5";
3338 break;
3339 case USB_SPEED_UNKNOWN:
3340 case USB_SPEED_FULL:
3341 speed = "12";
3342 break;
3343 case USB_SPEED_HIGH:
3344 speed = "480";
3345 break;
3346 default:
3347 speed = "unknown";
3348 }
3349
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003350 printk(KERN_INFO DRIVER_NAME
Ezequiel García401a5822012-03-13 10:27:09 -03003351 ": New device %s %s @ %s Mbps "
3352 "(%04x:%04x, interface %d, class %d)\n",
3353 udev->manufacturer ? udev->manufacturer : "",
3354 udev->product ? udev->product : "",
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003355 speed,
3356 le16_to_cpu(udev->descriptor.idVendor),
3357 le16_to_cpu(udev->descriptor.idProduct),
3358 ifnum,
3359 interface->altsetting->desc.bInterfaceNumber);
3360
Devin Heitmueller64a00b42009-05-27 23:23:37 -03003361 /*
3362 * Make sure we have 480 Mbps of bandwidth, otherwise things like
3363 * video stream wouldn't likely work, since 12 Mbps is generally
3364 * not enough even for most Digital TV streams.
3365 */
Devin Heitmuellere2a1b792009-05-27 23:44:10 -03003366 if (udev->speed != USB_SPEED_HIGH && disable_usb_speed_check == 0) {
Devin Heitmueller64a00b42009-05-27 23:23:37 -03003367 printk(DRIVER_NAME ": Device initialization failed.\n");
3368 printk(DRIVER_NAME ": Device must be connected to a high-speed"
3369 " USB 2.0 port.\n");
Devin Heitmueller64a00b42009-05-27 23:23:37 -03003370 retval = -ENODEV;
Holger Nelson8ab33622011-12-28 18:55:41 -03003371 goto err_free;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003372 }
3373
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003374 dev->devno = nr;
3375 dev->model = id->driver_info;
3376 dev->alt = -1;
Holger Nelson8ab33622011-12-28 18:55:41 -03003377 dev->is_audio_only = has_audio && !(has_video || has_dvb);
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003378 dev->has_alsa_audio = has_audio;
3379 dev->audio_ifnum = ifnum;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003380
3381 /* Checks if audio is provided by some interface */
3382 for (i = 0; i < udev->config->desc.bNumInterfaces; i++) {
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003383 struct usb_interface *uif = udev->config->interface[i];
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003384 if (uif->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
3385 dev->has_audio_class = 1;
3386 break;
3387 }
3388 }
3389
Mauro Carvalho Chehabaa514962012-12-23 13:15:47 -02003390 if (has_audio)
3391 printk(KERN_INFO DRIVER_NAME
3392 ": Audio interface %i found %s\n",
3393 ifnum,
3394 dev->has_audio_class ? "(USB Audio Class)" : "(Vendor Class)");
3395 if (has_video)
3396 printk(KERN_INFO DRIVER_NAME
3397 ": Video interface %i found:%s%s\n",
3398 ifnum,
3399 dev->analog_ep_bulk ? " bulk" : "",
3400 dev->analog_ep_isoc ? " isoc" : "");
3401 if (has_dvb)
3402 printk(KERN_INFO DRIVER_NAME
3403 ": DVB interface %i found:%s%s\n",
3404 ifnum,
3405 dev->dvb_ep_bulk ? " bulk" : "",
3406 dev->dvb_ep_isoc ? " isoc" : "");
3407
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003408 dev->num_alt = interface->num_altsetting;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003409
Mauro Carvalho Chehabd3e4ea02012-10-27 16:29:20 -03003410 if ((unsigned)card[nr] < em28xx_bcount)
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003411 dev->model = card[nr];
3412
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003413 /* save our data pointer in this interface device */
3414 usb_set_intfdata(interface, dev);
3415
Devin Heitmuellerd3829fa2013-01-04 16:16:24 -03003416 /* initialize videobuf2 stuff */
3417 em28xx_vb2_setup(dev);
3418
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003419 /* allocate device struct */
3420 mutex_init(&dev->lock);
3421 mutex_lock(&dev->lock);
Thomas Petazzoni622c2fc2012-01-07 10:18:45 -03003422 retval = em28xx_init_dev(dev, udev, interface, nr);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003423 if (retval) {
Holger Nelson8ab33622011-12-28 18:55:41 -03003424 goto unlock_and_free;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003425 }
3426
Frank Schaefer7e5d74e2012-12-26 15:12:37 -03003427 if (usb_xfer_mode < 0) {
Mauro Carvalho Chehab8b2aea72012-12-23 13:25:38 -02003428 if (dev->board.is_webcam)
3429 try_bulk = 1;
3430 else
3431 try_bulk = 0;
3432 } else {
Frank Schaefer7e5d74e2012-12-26 15:12:37 -03003433 try_bulk = usb_xfer_mode > 0;
Mauro Carvalho Chehab8b2aea72012-12-23 13:25:38 -02003434 }
3435
3436 /* Select USB transfer types to use */
3437 if (has_video) {
3438 if (!dev->analog_ep_isoc || (try_bulk && dev->analog_ep_bulk))
3439 dev->analog_xfer_bulk = 1;
3440 em28xx_info("analog set to %s mode.\n",
3441 dev->analog_xfer_bulk ? "bulk" : "isoc");
3442 }
Gianluca Gennari86d38d12012-02-13 13:59:22 -03003443 if (has_dvb) {
Mauro Carvalho Chehab8b2aea72012-12-23 13:25:38 -02003444 if (!dev->dvb_ep_isoc || (try_bulk && dev->dvb_ep_bulk))
3445 dev->dvb_xfer_bulk = 1;
3446
3447 em28xx_info("dvb set to %s mode.\n",
3448 dev->dvb_xfer_bulk ? "bulk" : "isoc");
3449
Frank Schaeferc647a912012-11-08 14:11:52 -03003450 /* pre-allocate DVB usb transfer buffers */
3451 if (dev->dvb_xfer_bulk) {
3452 retval = em28xx_alloc_urbs(dev, EM28XX_DIGITAL_MODE,
3453 dev->dvb_xfer_bulk,
3454 EM28XX_DVB_NUM_BUFS,
3455 512,
3456 EM28XX_DVB_BULK_PACKET_MULTIPLIER);
3457 } else {
3458 retval = em28xx_alloc_urbs(dev, EM28XX_DIGITAL_MODE,
3459 dev->dvb_xfer_bulk,
3460 EM28XX_DVB_NUM_BUFS,
3461 dev->dvb_max_pkt_size_isoc,
3462 EM28XX_DVB_NUM_ISOC_PACKETS);
3463 }
Gianluca Gennari86d38d12012-02-13 13:59:22 -03003464 if (retval) {
Frank Schaeferc647a912012-11-08 14:11:52 -03003465 printk(DRIVER_NAME
3466 ": Failed to pre-allocate USB transfer buffers for DVB.\n");
Gianluca Gennari86d38d12012-02-13 13:59:22 -03003467 goto unlock_and_free;
3468 }
3469 }
3470
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003471 request_modules(dev);
3472
3473 /* Should be the last thing to do, to avoid newer udev's to
3474 open the device before fully initializing it
3475 */
3476 mutex_unlock(&dev->lock);
3477
3478 return 0;
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003479
Holger Nelson8ab33622011-12-28 18:55:41 -03003480unlock_and_free:
3481 mutex_unlock(&dev->lock);
3482
3483err_free:
Frank Schaefer0cf544a2012-11-08 14:11:49 -03003484 kfree(dev->alt_max_pkt_size_isoc);
Holger Nelson8ab33622011-12-28 18:55:41 -03003485 kfree(dev);
3486
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003487err:
Chris Rankin38b61eb2011-08-20 08:21:03 -03003488 clear_bit(nr, &em28xx_devused);
3489
3490err_no_slot:
3491 usb_put_dev(udev);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003492 return retval;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003493}
3494
3495/*
3496 * em28xx_usb_disconnect()
Chris Rankind7222e72011-09-24 11:02:32 -03003497 * called when the device gets disconnected
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003498 * video device will be unregistered on v4l2_close in case it is still open
3499 */
3500static void em28xx_usb_disconnect(struct usb_interface *interface)
3501{
3502 struct em28xx *dev;
3503
3504 dev = usb_get_intfdata(interface);
3505 usb_set_intfdata(interface, NULL);
3506
3507 if (!dev)
3508 return;
3509
Frank Schaefer05fe2172012-12-27 19:02:44 -03003510 dev->disconnected = 1;
3511
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003512 if (dev->is_audio_only) {
3513 mutex_lock(&dev->lock);
3514 em28xx_close_extension(dev);
3515 mutex_unlock(&dev->lock);
3516 return;
3517 }
3518
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003519 em28xx_info("disconnecting %s\n", dev->vdev->name);
3520
Tejun Heo707bcf32010-12-24 16:14:20 +01003521 flush_request_modules(dev);
3522
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003523 mutex_lock(&dev->lock);
3524
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003525 v4l2_device_disconnect(&dev->v4l2_dev);
3526
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003527 if (dev->users) {
Frank Schaefer05fe2172012-12-27 19:02:44 -03003528 em28xx_warn("device %s is open! Deregistration and memory deallocation are deferred on close.\n",
3529 video_device_node_name(dev->vdev));
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003530
Frank Schaefer05fe2172012-12-27 19:02:44 -03003531 em28xx_uninit_usb_xfer(dev, EM28XX_ANALOG_MODE);
3532 em28xx_uninit_usb_xfer(dev, EM28XX_DIGITAL_MODE);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003533 }
3534
Frank Schaefer05fe2172012-12-27 19:02:44 -03003535 em28xx_close_extension(dev);
3536 /* NOTE: must be called BEFORE the resources are released */
3537
3538 if (!dev->users)
3539 em28xx_release_resources(dev);
Gianluca Gennari86d38d12012-02-13 13:59:22 -03003540
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003541 mutex_unlock(&dev->lock);
3542
3543 if (!dev->users) {
Frank Schaefer0cf544a2012-11-08 14:11:49 -03003544 kfree(dev->alt_max_pkt_size_isoc);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003545 kfree(dev);
3546 }
3547}
3548
3549static struct usb_driver em28xx_usb_driver = {
3550 .name = "em28xx",
3551 .probe = em28xx_usb_probe,
3552 .disconnect = em28xx_usb_disconnect,
3553 .id_table = em28xx_id_table,
3554};
3555
Greg Kroah-Hartmanecb3b2b2011-11-18 09:46:12 -08003556module_usb_driver(em28xx_usb_driver);