blob: 16ab4d7780b3494ad44de43d839c01e6672f7b08 [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
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -0300961 .def_i2c_bus = 1,
962 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -0300963 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,
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -0300977 .def_i2c_bus = 1,
978 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -0300979 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,
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -0300986 .def_i2c_bus = 1,
987 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800988 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 Chehab3aa2b3b2013-03-05 06:55:27 -03001407 .def_i2c_bus = 1,
1408 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03001409 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",
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -03001920 .def_i2c_bus = 1,
1921 .i2c_speed = 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] = {
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -03001930 .def_i2c_bus = 1,
1931 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_FREQ_400_KHZ,
Antti Palosaari36588712011-08-01 01:15:30 -03001932 .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,
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -03001961 .def_i2c_bus = 1,
1962 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
Antti Palosaari35530852012-03-18 18:09:01 -03001963 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,
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -03001973 .def_i2c_bus = 1,
1974 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
Ivan Kalvachevfa5527c2012-03-19 20:09:55 -03001975 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,
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -03001985 .def_i2c_bus = 1,
1986 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
Antti Palosaaric247d7b2012-03-19 11:48:19 -03001987 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,
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -03001994 .def_i2c_bus = 1,
1995 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
Martin Blumenstingl89040132012-10-04 14:22:54 -03001996 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 },
Roland Scheidegger676fa7d2013-02-08 21:08:55 -03002083 { USB_DEVICE(0x0ccd, 0x10b6), /* H5 Rev. 3 */
2084 .driver_info = EM2884_BOARD_TERRATEC_H5 },
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -03002085 { USB_DEVICE(0x0ccd, 0x0084),
2086 .driver_info = EM2860_BOARD_TERRATEC_AV350 },
Mauro Carvalho Chehab4557af92009-05-23 09:58:52 -03002087 { USB_DEVICE(0x0ccd, 0x0096),
2088 .driver_info = EM2860_BOARD_TERRATEC_GRABBY },
Tekaefabaaf2011-10-14 05:40:29 -03002089 { USB_DEVICE(0x0ccd, 0x10AF),
2090 .driver_info = EM2860_BOARD_TERRATEC_GRABBY },
Andreas Oberrittera1ed02e2011-11-16 11:06:50 -03002091 { USB_DEVICE(0x0ccd, 0x00b2),
2092 .driver_info = EM2884_BOARD_CINERGY_HTC_STICK },
Adrian Taylor8298f2f2010-10-20 07:55:33 -03002093 { USB_DEVICE(0x0fd9, 0x0033),
2094 .driver_info = EM2860_BOARD_ELGATO_VIDEO_CAPTURE},
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002095 { USB_DEVICE(0x185b, 0x2870),
2096 .driver_info = EM2870_BOARD_COMPRO_VIDEOMATE },
Vitaly Woold3603342008-07-27 14:10:11 -03002097 { USB_DEVICE(0x185b, 0x2041),
Mauro Carvalho Chehabee281b82008-07-27 16:58:04 -03002098 .driver_info = EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002099 { USB_DEVICE(0x2040, 0x4200),
2100 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
Mauro Carvalho Chehab15b9bec2008-01-13 12:02:20 -03002101 { USB_DEVICE(0x2040, 0x4201),
2102 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002103 { USB_DEVICE(0x2040, 0x6500),
2104 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 },
Luc Saillard427d20c2008-01-30 17:23:00 -03002105 { USB_DEVICE(0x2040, 0x6502),
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002106 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2 },
Michael Krufky74ee0512008-05-01 18:02:30 -03002107 { USB_DEVICE(0x2040, 0x6513), /* HCW HVR-980 */
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, 0x6517), /* HP HVR-950 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002110 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Michael Krufky74ee0512008-05-01 18:02:30 -03002111 { USB_DEVICE(0x2040, 0x651b), /* RP HVR-950 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002112 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03002113 { USB_DEVICE(0x2040, 0x651f),
2114 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850 },
Devin Heitmuellere14b3652008-07-26 11:04:33 -03002115 { USB_DEVICE(0x0438, 0xb002),
2116 .driver_info = EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002117 { USB_DEVICE(0x2001, 0xf112),
2118 .driver_info = EM2820_BOARD_DLINK_USB_TV },
2119 { USB_DEVICE(0x2304, 0x0207),
2120 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
2121 { USB_DEVICE(0x2304, 0x0208),
2122 .driver_info = EM2820_BOARD_PINNACLE_USB_2 },
2123 { USB_DEVICE(0x2304, 0x021a),
2124 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
2125 { USB_DEVICE(0x2304, 0x0226),
Devin Heitmueller09bc1942011-03-13 02:07:54 -03002126 .driver_info = EM2882_BOARD_PINNACLE_HYBRID_PRO_330E },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002127 { USB_DEVICE(0x2304, 0x0227),
2128 .driver_info = EM2880_BOARD_PINNACLE_PCTV_HD_PRO },
2129 { USB_DEVICE(0x0413, 0x6023),
2130 .driver_info = EM2800_BOARD_LEADTEK_WINFAST_USBII },
Don Kramer74e07f32012-01-02 16:15:44 -03002131 { USB_DEVICE(0x093b, 0xa003),
2132 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002133 { USB_DEVICE(0x093b, 0xa005),
2134 .driver_info = EM2861_BOARD_PLEXTOR_PX_TV100U },
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03002135 { USB_DEVICE(0x04bb, 0x0515),
2136 .driver_info = EM2820_BOARD_IODATA_GVMVP_SZ },
Zhenyu Wang7c8b5672009-07-05 10:51:21 -03002137 { USB_DEVICE(0xeb1a, 0x50a6),
2138 .driver_info = EM2860_BOARD_GADMEI_UTV330 },
Jarod Wilson7e48b302010-03-07 17:55:43 -03002139 { USB_DEVICE(0x1b80, 0xa340),
2140 .driver_info = EM2870_BOARD_KWORLD_A340 },
Antti Palosaarid6a5f922011-04-07 16:34:44 -03002141 { USB_DEVICE(0x2013, 0x024f),
2142 .driver_info = EM28174_BOARD_PCTV_290E },
Antti Palosaari36588712011-08-01 01:15:30 -03002143 { USB_DEVICE(0x2013, 0x024c),
2144 .driver_info = EM28174_BOARD_PCTV_460E },
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -03002145 { USB_DEVICE(0x2040, 0x1605),
2146 .driver_info = EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C },
Gareth Williams4d28d3d2011-12-24 05:47:29 -03002147 { USB_DEVICE(0xeb1a, 0x5006),
2148 .driver_info = EM2860_BOARD_HT_VIDBOX_NW03 },
Mario Ceresa2f786042012-01-06 16:00:12 -03002149 { USB_DEVICE(0x1b80, 0xe309), /* Sveon STV40 */
2150 .driver_info = EM2860_BOARD_EASYCAP },
Antti Palosaari35530852012-03-18 18:09:01 -03002151 { USB_DEVICE(0x1b80, 0xe425),
2152 .driver_info = EM2874_BOARD_MAXMEDIA_UB425_TC },
Ivan Kalvachevfa5527c2012-03-19 20:09:55 -03002153 { USB_DEVICE(0x2304, 0x0242),
2154 .driver_info = EM2884_BOARD_PCTV_510E },
Antti Palosaaric247d7b2012-03-19 11:48:19 -03002155 { USB_DEVICE(0x2013, 0x0251),
2156 .driver_info = EM2884_BOARD_PCTV_520E },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002157 { },
2158};
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002159MODULE_DEVICE_TABLE(usb, em28xx_id_table);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002160
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002161/*
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002162 * EEPROM hash table for devices with generic USB IDs
2163 */
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03002164static struct em28xx_hash_table em28xx_eeprom_hash[] = {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03002165 /* P/N: SA 60002070465 Tuner: TVF7533-MF */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002166 {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF},
Douglas Schilling Landgraf1e1addd2008-12-27 21:38:14 -03002167 {0x72cc5a8b, EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2, TUNER_YMEC_TVF_5533MF},
Darron Broadda3808e2008-09-30 02:46:41 -03002168 {0x966a0441, EM2880_BOARD_KWORLD_DVB_310U, TUNER_XC2028},
Douglas Schilling Landgrafa35c87c2009-08-06 12:52:11 -03002169 {0x166a0441, EM2880_BOARD_EMPIRE_DUAL_TV, TUNER_XC2028},
Devin Heitmueller19859222009-06-19 00:33:54 -03002170 {0xcee44a99, EM2882_BOARD_EVGA_INDTUBE, TUNER_XC2028},
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03002171 {0xb8846b20, EM2881_BOARD_PINNACLE_HYBRID_PRO, TUNER_XC2028},
Antti Palosaari285eb1a2009-09-15 14:42:13 -03002172 {0x63f653bd, EM2870_BOARD_REDDO_DVB_C_USB_BOX, TUNER_ABSENT},
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03002173 {0x4e913442, EM2882_BOARD_DIKOM_DK300, TUNER_XC2028},
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002174};
2175
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03002176/* I2C devicelist hash table for devices with generic USB IDs */
Sascha Sommerfad7b952007-11-04 08:06:48 -03002177static struct em28xx_hash_table em28xx_i2c_hash[] = {
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002178 {0xb06a32c3, EM2800_BOARD_TERRATEC_CINERGY_200, TUNER_LG_PAL_NEW_TAPC},
2179 {0xf51200e3, EM2800_BOARD_VGEAR_POCKETTV, TUNER_LG_PAL_NEW_TAPC},
Devin Heitmueller3ed58ba2009-05-27 23:27:26 -03002180 {0x1ba50080, EM2860_BOARD_SAA711X_REFERENCE_DESIGN, TUNER_ABSENT},
Devin Heitmueller443fed92010-03-19 23:53:12 -03002181 {0x77800080, EM2860_BOARD_TVP5150_REFERENCE_DESIGN, TUNER_ABSENT},
Douglas Schilling Landgraff7fe3e62009-01-19 09:31:55 -03002182 {0xc51200e3, EM2820_BOARD_GADMEI_TVR200, TUNER_LG_PAL_NEW_TAPC},
Mauro Carvalho Chehab6d888a62009-08-30 13:05:56 -03002183 {0x4ba50080, EM2861_BOARD_GADMEI_UTV330PLUS, TUNER_TNF_5335MF},
Mauro Carvalho Chehabebaefdb2011-06-01 10:16:25 -03002184 {0x6b800080, EM2874_BOARD_LEADERSHIP_ISDBT, TUNER_ABSENT},
Sascha Sommerfad7b952007-11-04 08:06:48 -03002185};
Frank Schaefer87b52432013-03-03 15:37:40 -03002186/* NOTE: introduce a separate hash table for devices with 16 bit eeproms */
Sascha Sommerfad7b952007-11-04 08:06:48 -03002187
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002188/* I2C possible address to saa7115, tvp5150, msp3400, tvaudio */
2189static unsigned short saa711x_addrs[] = {
2190 0x4a >> 1, 0x48 >> 1, /* SAA7111, SAA7111A and SAA7113 */
2191 0x42 >> 1, 0x40 >> 1, /* SAA7114, SAA7115 and SAA7118 */
2192 I2C_CLIENT_END };
2193
2194static unsigned short tvp5150_addrs[] = {
2195 0xb8 >> 1,
2196 0xba >> 1,
2197 I2C_CLIENT_END
2198};
2199
2200static unsigned short msp3400_addrs[] = {
2201 0x80 >> 1,
2202 0x88 >> 1,
2203 I2C_CLIENT_END
2204};
2205
Michael Krufkyd7cba042008-09-12 13:31:45 -03002206int em28xx_tuner_callback(void *ptr, int component, int command, int arg)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002207{
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002208 int rc = 0;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002209 struct em28xx *dev = ptr;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002210
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -03002211 if (dev->tuner_type != TUNER_XC2028 && dev->tuner_type != TUNER_XC5000)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002212 return 0;
2213
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -03002214 if (command != XC2028_TUNER_RESET && command != XC5000_TUNER_RESET)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002215 return 0;
2216
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03002217 rc = em28xx_gpio_set(dev, dev->board.tuner_gpio);
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002218
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002219 return rc;
2220}
2221EXPORT_SYMBOL_GPL(em28xx_tuner_callback);
2222
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03002223static inline void em28xx_set_model(struct em28xx *dev)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002224{
Ezequiel Garciae0f6e4d2012-09-26 06:25:12 -03002225 dev->board = em28xx_boards[dev->model];
Devin Heitmuellered14e1c2008-12-29 22:27:30 -03002226
2227 /* Those are the default values for the majority of boards
2228 Use those values if not specified otherwise at boards entry
2229 */
2230 if (!dev->board.xclk)
2231 dev->board.xclk = EM28XX_XCLK_IR_RC5_MODE |
2232 EM28XX_XCLK_FREQUENCY_12MHZ;
2233
2234 if (!dev->board.i2c_speed)
2235 dev->board.i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
2236 EM28XX_I2C_FREQ_100_KHZ;
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -03002237
2238 if (dev->board.def_i2c_bus == 1)
2239 dev->board.i2c_speed |= EM2874_I2C_SECONDARY_BUS_SELECT;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002240}
2241
Mauro Carvalho Chehabf2e26ae2009-08-12 20:21:44 -03002242
2243/* FIXME: Should be replaced by a proper mt9m111 driver */
2244static int em28xx_initialize_mt9m111(struct em28xx *dev)
2245{
2246 int i;
2247 unsigned char regs[][3] = {
2248 { 0x0d, 0x00, 0x01, }, /* reset and use defaults */
2249 { 0x0d, 0x00, 0x00, },
2250 { 0x0a, 0x00, 0x21, },
2251 { 0x21, 0x04, 0x00, }, /* full readout speed, no row/col skipping */
2252 };
2253
2254 for (i = 0; i < ARRAY_SIZE(regs); i++)
Mauro Carvalho Chehabc7a45e52013-03-05 06:55:26 -03002255 i2c_master_send(&dev->i2c_client[dev->def_i2c_bus], &regs[i][0], 3);
Mauro Carvalho Chehabf2e26ae2009-08-12 20:21:44 -03002256
2257 return 0;
2258}
2259
2260
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -03002261/* FIXME: Should be replaced by a proper mt9m001 driver */
2262static int em28xx_initialize_mt9m001(struct em28xx *dev)
2263{
2264 int i;
2265 unsigned char regs[][3] = {
2266 { 0x0d, 0x00, 0x01, },
2267 { 0x0d, 0x00, 0x00, },
2268 { 0x04, 0x05, 0x00, }, /* hres = 1280 */
2269 { 0x03, 0x04, 0x00, }, /* vres = 1024 */
2270 { 0x20, 0x11, 0x00, },
2271 { 0x06, 0x00, 0x10, },
2272 { 0x2b, 0x00, 0x24, },
2273 { 0x2e, 0x00, 0x24, },
2274 { 0x35, 0x00, 0x24, },
2275 { 0x2d, 0x00, 0x20, },
2276 { 0x2c, 0x00, 0x20, },
2277 { 0x09, 0x0a, 0xd4, },
2278 { 0x35, 0x00, 0x57, },
2279 };
2280
2281 for (i = 0; i < ARRAY_SIZE(regs); i++)
Mauro Carvalho Chehabc7a45e52013-03-05 06:55:26 -03002282 i2c_master_send(&dev->i2c_client[dev->def_i2c_bus], &regs[i][0], 3);
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -03002283
2284 return 0;
2285}
2286
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002287/* HINT method: webcam I2C chips
2288 *
Mauro Carvalho Chehabf2e26ae2009-08-12 20:21:44 -03002289 * This method works for webcams with Micron sensors
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002290 */
2291static int em28xx_hint_sensor(struct em28xx *dev)
2292{
2293 int rc;
2294 char *sensor_name;
2295 unsigned char cmd;
2296 __be16 version_be;
2297 u16 version;
2298
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002299 /* Micron sensor detection */
Mauro Carvalho Chehabc7a45e52013-03-05 06:55:26 -03002300 dev->i2c_client[dev->def_i2c_bus].addr = 0xba >> 1;
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002301 cmd = 0;
Mauro Carvalho Chehabc7a45e52013-03-05 06:55:26 -03002302 i2c_master_send(&dev->i2c_client[dev->def_i2c_bus], &cmd, 1);
2303 rc = i2c_master_recv(&dev->i2c_client[dev->def_i2c_bus], (char *)&version_be, 2);
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002304 if (rc != 2)
2305 return -EINVAL;
2306
2307 version = be16_to_cpu(version_be);
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002308 switch (version) {
Mauro Carvalho Chehab296544e2009-07-27 08:24:29 -03002309 case 0x8232: /* mt9v011 640x480 1.3 Mpix sensor */
2310 case 0x8243: /* mt9v011 rev B 640x480 1.3 Mpix sensor */
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002311 dev->model = EM2820_BOARD_SILVERCREST_WEBCAM;
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002312 em28xx_set_model(dev);
2313
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002314 sensor_name = "mt9v011";
Mauro Carvalho Chehab527f09a2009-07-12 11:04:15 -03002315 dev->em28xx_sensor = EM28XX_MT9V011;
Mauro Carvalho Chehab55699962009-07-13 20:15:02 -03002316 dev->sensor_xres = 640;
2317 dev->sensor_yres = 480;
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002318 /*
2319 * FIXME: mt9v011 uses I2S speed as xtal clk - at least with
2320 * the Silvercrest cam I have here for testing - for higher
2321 * resolutions, a high clock cause horizontal artifacts, so we
2322 * need to use a lower xclk frequency.
2323 * Yet, it would be possible to adjust xclk depending on the
2324 * desired resolution, since this affects directly the
2325 * frame rate.
2326 */
2327 dev->board.xclk = EM28XX_XCLK_FREQUENCY_4_3MHZ;
2328 dev->sensor_xtal = 4300000;
Mauro Carvalho Chehab579d3152009-07-14 12:33:25 -03002329
2330 /* probably means GRGB 16 bit bayer */
2331 dev->vinmode = 0x0d;
2332 dev->vinctl = 0x00;
2333
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002334 break;
Mauro Carvalho Chehabf2e26ae2009-08-12 20:21:44 -03002335
2336 case 0x143a: /* MT9M111 as found in the ECS G200 */
2337 dev->model = EM2750_BOARD_UNKNOWN;
2338 em28xx_set_model(dev);
2339
2340 sensor_name = "mt9m111";
2341 dev->board.xclk = EM28XX_XCLK_FREQUENCY_48MHZ;
2342 dev->em28xx_sensor = EM28XX_MT9M111;
2343 em28xx_initialize_mt9m111(dev);
2344 dev->sensor_xres = 640;
2345 dev->sensor_yres = 512;
2346
2347 dev->vinmode = 0x0a;
2348 dev->vinctl = 0x00;
2349
2350 break;
2351
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -03002352 case 0x8431:
2353 dev->model = EM2750_BOARD_UNKNOWN;
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002354 em28xx_set_model(dev);
2355
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -03002356 sensor_name = "mt9m001";
2357 dev->em28xx_sensor = EM28XX_MT9M001;
2358 em28xx_initialize_mt9m001(dev);
2359 dev->sensor_xres = 1280;
2360 dev->sensor_yres = 1024;
2361
2362 /* probably means BGGR 16 bit bayer */
2363 dev->vinmode = 0x0c;
2364 dev->vinctl = 0x00;
2365
2366 break;
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002367 default:
Mauro Carvalho Chehabf2e26ae2009-08-12 20:21:44 -03002368 printk("Unknown Micron Sensor 0x%04x\n", version);
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002369 return -EINVAL;
2370 }
2371
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002372 /* Setup webcam defaults */
2373 em28xx_pre_card_setup(dev);
2374
Mauro Carvalho Chehab8b220792009-07-12 10:56:21 -03002375 em28xx_errdev("Sensor is %s, using model %s entry.\n",
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002376 sensor_name, em28xx_boards[dev->model].name);
2377
2378 return 0;
2379}
2380
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002381/* Since em28xx_pre_card_setup() requires a proper dev->model,
2382 * this won't work for boards with generic PCI IDs
2383 */
Ezequiel Garcia60332f02012-04-28 09:57:01 -03002384static void em28xx_pre_card_setup(struct em28xx *dev)
Markus Rechbergera94e95b2006-01-23 17:11:10 -02002385{
Devin Heitmuellered14e1c2008-12-29 22:27:30 -03002386 /* Set the initial XCLK and I2C clock values based on the board
2387 definition */
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002388 em28xx_write_reg(dev, EM28XX_R0F_XCLK, dev->board.xclk & 0x7f);
Sascha Sommerca80cf62012-01-08 16:32:09 -03002389 if (!dev->board.is_em2800)
2390 em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed);
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03002391 msleep(50);
2392
Markus Rechbergera94e95b2006-01-23 17:11:10 -02002393 /* request some modules */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002394 switch (dev->model) {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002395 case EM2861_BOARD_PLEXTOR_PX_TV100U:
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -03002396 /* Sets the msp34xx I2S speed */
2397 dev->i2s_speed = 2048000;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002398 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002399 case EM2861_BOARD_KWORLD_PVRTV_300U:
2400 case EM2880_BOARD_KWORLD_DVB_305U:
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002401 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x6d);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002402 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002403 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x7d);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002404 msleep(10);
2405 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002406 case EM2870_BOARD_COMPRO_VIDEOMATE:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002407 /* TODO: someone can do some cleanup here...
2408 not everything's needed */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002409 em28xx_write_reg(dev, EM2880_R04_GPO, 0x00);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002410 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002411 em28xx_write_reg(dev, EM2880_R04_GPO, 0x01);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002412 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002413 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002414 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002415 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002416 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002417 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xdc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002418 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002419 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002420 mdelay(70);
2421 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002422 case EM2870_BOARD_TERRATEC_XS_MT2060:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002423 /* this device needs some gpio writes to get the DVB-T
2424 demod work */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002425 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002426 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002427 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xde);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002428 mdelay(70);
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);
2431 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002432 case EM2870_BOARD_PINNACLE_PCTV_DVB:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002433 /* this device needs some gpio writes to get the
2434 DVB-T demod work */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002435 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002436 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002437 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xde);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002438 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002439 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002440 mdelay(70);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002441 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002442 case EM2820_BOARD_GADMEI_UTV310:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002443 case EM2820_BOARD_MSI_VOX_USB_2:
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03002444 /* enables audio for that devices */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002445 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002446 break;
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03002447
Franklin Mengd7de5d82009-06-06 17:05:02 -03002448 case EM2882_BOARD_KWORLD_ATSC_315U:
2449 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff);
2450 msleep(10);
2451 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
2452 msleep(10);
2453 em28xx_write_reg(dev, EM2880_R04_GPO, 0x00);
2454 msleep(10);
2455 em28xx_write_reg(dev, EM2880_R04_GPO, 0x08);
2456 msleep(10);
2457 break;
2458
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03002459 case EM2860_BOARD_KAIOMY_TVNPC_U2:
2460 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x07", 1);
2461 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
2462 em28xx_write_regs(dev, 0x0d, "\x42", 1);
2463 em28xx_write_regs(dev, 0x08, "\xfd", 1);
2464 msleep(10);
2465 em28xx_write_regs(dev, 0x08, "\xff", 1);
2466 msleep(10);
2467 em28xx_write_regs(dev, 0x08, "\x7f", 1);
2468 msleep(10);
2469 em28xx_write_regs(dev, 0x08, "\x6b", 1);
2470
2471 break;
Mauro Carvalho Chehab56ee3802009-02-11 14:18:36 -03002472 case EM2860_BOARD_EASYCAP:
2473 em28xx_write_regs(dev, 0x08, "\xf8", 1);
2474 break;
2475
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03002476 case EM2820_BOARD_IODATA_GVMVP_SZ:
2477 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff);
2478 msleep(70);
2479 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf7);
2480 msleep(10);
2481 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
2482 msleep(70);
2483 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
2484 msleep(70);
2485 break;
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002486 }
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03002487
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03002488 em28xx_gpio_set(dev, dev->board.tuner_gpio);
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03002489 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
2490
2491 /* Unlock device */
Mauro Carvalho Chehab2fe3e2e2008-11-27 09:10:40 -03002492 em28xx_set_mode(dev, EM28XX_SUSPEND);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002493}
2494
Mauro Carvalho Chehabe54318e2008-04-18 18:34:31 -03002495static void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl)
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002496{
2497 memset(ctl, 0, sizeof(*ctl));
2498
2499 ctl->fname = XC2028_DEFAULT_FIRMWARE;
2500 ctl->max_len = 64;
2501 ctl->mts = em28xx_boards[dev->model].mts_firmware;
2502
2503 switch (dev->model) {
Douglas Schilling Landgrafe5db5d42009-04-09 18:24:34 -03002504 case EM2880_BOARD_EMPIRE_DUAL_TV:
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03002505 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
Uroš Vamplec994d02009-09-30 22:53:37 -03002506 case EM2882_BOARD_TERRATEC_HYBRID_XS:
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03002507 ctl->demod = XC3028_FE_ZARLINK456;
2508 break;
reinhard schwab655b8402008-07-26 10:47:00 -03002509 case EM2880_BOARD_TERRATEC_HYBRID_XS:
Michel Garniercec4e6c2010-10-16 14:42:01 -03002510 case EM2880_BOARD_TERRATEC_HYBRID_XS_FR:
Devin Heitmuellere16e5a32009-07-15 00:37:22 -03002511 case EM2881_BOARD_PINNACLE_HYBRID_PRO:
reinhard schwab655b8402008-07-26 10:47:00 -03002512 ctl->demod = XC3028_FE_ZARLINK456;
2513 break;
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002514 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
Devin Heitmuellerad9b4bb2011-03-13 02:09:59 -03002515 case EM2882_BOARD_PINNACLE_HYBRID_PRO_330E:
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002516 ctl->demod = XC3028_FE_DEFAULT;
2517 break;
Devin Heitmueller5ea7fe42008-09-16 02:02:12 -03002518 case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600:
2519 ctl->demod = XC3028_FE_DEFAULT;
2520 ctl->fname = XC3028L_DEFAULT_FIRMWARE;
2521 break;
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03002522 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850:
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002523 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03002524 case EM2880_BOARD_PINNACLE_PCTV_HD_PRO:
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03002525 /* FIXME: Better to specify the needed IF */
Devin Heitmuellerbdfbf952008-04-17 21:38:27 -03002526 ctl->demod = XC3028_FE_DEFAULT;
2527 break;
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03002528 case EM2883_BOARD_KWORLD_HYBRID_330U:
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03002529 case EM2882_BOARD_DIKOM_DK300:
Antonio Larrosa811fab62010-03-04 22:19:48 -03002530 case EM2882_BOARD_KWORLD_VS_DVBT:
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03002531 ctl->demod = XC3028_FE_CHINA;
2532 ctl->fname = XC2028_DEFAULT_FIRMWARE;
2533 break;
Devin Heitmueller19859222009-06-19 00:33:54 -03002534 case EM2882_BOARD_EVGA_INDTUBE:
2535 ctl->demod = XC3028_FE_CHINA;
2536 ctl->fname = XC3028L_DEFAULT_FIRMWARE;
2537 break;
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002538 default:
2539 ctl->demod = XC3028_FE_OREN538;
2540 }
2541}
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002542
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002543static void em28xx_tuner_setup(struct em28xx *dev)
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002544{
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002545 struct tuner_setup tun_setup;
2546 struct v4l2_frequency f;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002547
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03002548 if (dev->tuner_type == TUNER_ABSENT)
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002549 return;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002550
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002551 memset(&tun_setup, 0, sizeof(tun_setup));
2552
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002553 tun_setup.mode_mask = T_ANALOG_TV | T_RADIO;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002554 tun_setup.tuner_callback = em28xx_tuner_callback;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002555
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002556 if (dev->board.radio.type) {
2557 tun_setup.type = dev->board.radio.type;
2558 tun_setup.addr = dev->board.radio_addr;
2559
2560 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_type_addr, &tun_setup);
2561 }
2562
2563 if ((dev->tuner_type != TUNER_ABSENT) && (dev->tuner_type)) {
2564 tun_setup.type = dev->tuner_type;
2565 tun_setup.addr = dev->tuner_addr;
2566
2567 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_type_addr, &tun_setup);
2568 }
2569
2570 if (dev->tda9887_conf) {
2571 struct v4l2_priv_tun_config tda9887_cfg;
2572
2573 tda9887_cfg.tuner = TUNER_TDA9887;
2574 tda9887_cfg.priv = &dev->tda9887_conf;
2575
2576 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_config, &tda9887_cfg);
2577 }
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002578
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002579 if (dev->tuner_type == TUNER_XC2028) {
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002580 struct v4l2_priv_tun_config xc2028_cfg;
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002581 struct xc2028_ctrl ctl;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002582
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002583 memset(&xc2028_cfg, 0, sizeof(xc2028_cfg));
2584 memset(&ctl, 0, sizeof(ctl));
2585
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002586 em28xx_setup_xc3028(dev, &ctl);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002587
2588 xc2028_cfg.tuner = TUNER_XC2028;
2589 xc2028_cfg.priv = &ctl;
2590
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002591 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_config, &xc2028_cfg);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002592 }
2593
2594 /* configure tuner */
2595 f.tuner = 0;
2596 f.type = V4L2_TUNER_ANALOG_TV;
2597 f.frequency = 9076; /* just a magic number */
2598 dev->ctl_freq = f.frequency;
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002599 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002600}
2601
2602static int em28xx_hint_board(struct em28xx *dev)
2603{
2604 int i;
2605
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03002606 /* HINT method: EEPROM
2607 *
2608 * This method works only for boards with eeprom.
2609 * Uses a hash of all eeprom bytes. The hash should be
2610 * unique for a vendor/tuner pair.
2611 * There are a high chance that tuners for different
2612 * video standards produce different hashes.
2613 */
2614 for (i = 0; i < ARRAY_SIZE(em28xx_eeprom_hash); i++) {
2615 if (dev->hash == em28xx_eeprom_hash[i].hash) {
2616 dev->model = em28xx_eeprom_hash[i].model;
2617 dev->tuner_type = em28xx_eeprom_hash[i].tuner;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002618
2619 em28xx_errdev("Your board has no unique USB ID.\n");
2620 em28xx_errdev("A hint were successfully done, "
2621 "based on eeprom hash.\n");
2622 em28xx_errdev("This method is not 100%% failproof.\n");
2623 em28xx_errdev("If the board were missdetected, "
2624 "please email this log to:\n");
2625 em28xx_errdev("\tV4L Mailing List "
Alexey Klimov51caf912009-01-25 12:53:09 -03002626 " <linux-media@vger.kernel.org>\n");
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002627 em28xx_errdev("Board detected as %s\n",
2628 em28xx_boards[dev->model].name);
2629
2630 return 0;
2631 }
2632 }
Sascha Sommerfad7b952007-11-04 08:06:48 -03002633
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03002634 /* HINT method: I2C attached devices
2635 *
2636 * This method works for all boards.
2637 * Uses a hash of i2c scanned devices.
2638 * Devices with the same i2c attached chips will
2639 * be considered equal.
2640 * This method is less precise than the eeprom one.
2641 */
2642
Sascha Sommerfad7b952007-11-04 08:06:48 -03002643 /* user did not request i2c scanning => do it now */
2644 if (!dev->i2c_hash)
2645 em28xx_do_i2c_scan(dev);
2646
2647 for (i = 0; i < ARRAY_SIZE(em28xx_i2c_hash); i++) {
2648 if (dev->i2c_hash == em28xx_i2c_hash[i].hash) {
2649 dev->model = em28xx_i2c_hash[i].model;
2650 dev->tuner_type = em28xx_i2c_hash[i].tuner;
2651 em28xx_errdev("Your board has no unique USB ID.\n");
2652 em28xx_errdev("A hint were successfully done, "
2653 "based on i2c devicelist hash.\n");
2654 em28xx_errdev("This method is not 100%% failproof.\n");
2655 em28xx_errdev("If the board were missdetected, "
2656 "please email this log to:\n");
2657 em28xx_errdev("\tV4L Mailing List "
Alexey Klimov51caf912009-01-25 12:53:09 -03002658 " <linux-media@vger.kernel.org>\n");
Sascha Sommerfad7b952007-11-04 08:06:48 -03002659 em28xx_errdev("Board detected as %s\n",
2660 em28xx_boards[dev->model].name);
2661
2662 return 0;
2663 }
2664 }
2665
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002666 em28xx_errdev("Your board has no unique USB ID and thus need a "
2667 "hint to be detected.\n");
2668 em28xx_errdev("You may try to use card=<n> insmod option to "
2669 "workaround that.\n");
2670 em28xx_errdev("Please send an email with this log to:\n");
Alexey Klimov51caf912009-01-25 12:53:09 -03002671 em28xx_errdev("\tV4L Mailing List <linux-media@vger.kernel.org>\n");
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002672 em28xx_errdev("Board eeprom hash is 0x%08lx\n", dev->hash);
Sascha Sommerfad7b952007-11-04 08:06:48 -03002673 em28xx_errdev("Board i2c devicelist hash is 0x%08lx\n", dev->i2c_hash);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002674
2675 em28xx_errdev("Here is a list of valid choices for the card=<n>"
2676 " insmod option:\n");
2677 for (i = 0; i < em28xx_bcount; i++) {
2678 em28xx_errdev(" card=%d -> %s\n",
2679 i, em28xx_boards[i].name);
2680 }
2681 return -1;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002682}
2683
Ezequiel Garcia60332f02012-04-28 09:57:01 -03002684static void em28xx_card_setup(struct em28xx *dev)
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002685{
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002686 /*
2687 * If the device can be a webcam, seek for a sensor.
2688 * If sensor is not found, then it isn't a webcam.
2689 */
2690 if (dev->board.is_webcam) {
2691 if (em28xx_hint_sensor(dev) < 0)
2692 dev->board.is_webcam = 0;
2693 else
2694 dev->progressive = 1;
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03002695 }
2696
2697 if (!dev->board.is_webcam) {
2698 switch (dev->model) {
2699 case EM2820_BOARD_UNKNOWN:
2700 case EM2800_BOARD_UNKNOWN:
2701 /*
2702 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD.
2703 *
2704 * This occurs because they share identical USB vendor and
2705 * product IDs.
2706 *
2707 * What we do here is look up the EEPROM hash of the K-WORLD
2708 * and if it is found then we decide that we do not have
2709 * a DIGIVOX and reset the device to the K-WORLD instead.
2710 *
2711 * This solution is only valid if they do not share eeprom
2712 * hash identities which has not been determined as yet.
2713 */
2714 if (em28xx_hint_board(dev) < 0)
2715 em28xx_errdev("Board not discovered\n");
2716 else {
2717 em28xx_set_model(dev);
2718 em28xx_pre_card_setup(dev);
2719 }
2720 break;
2721 default:
2722 em28xx_set_model(dev);
2723 }
2724 }
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002725
2726 em28xx_info("Identified as %s (card=%d)\n",
2727 dev->board.name, dev->model);
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002728
2729 dev->tuner_type = em28xx_boards[dev->model].tuner_type;
Mauro Carvalho Chehab31e05302008-11-20 18:47:37 -03002730 if (em28xx_boards[dev->model].tuner_addr)
2731 dev->tuner_addr = em28xx_boards[dev->model].tuner_addr;
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002732
Franklin Mengae3340c2009-06-06 16:34:01 -03002733 if (em28xx_boards[dev->model].tda9887_conf)
2734 dev->tda9887_conf = em28xx_boards[dev->model].tda9887_conf;
2735
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002736 /* request some modules */
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002737 switch (dev->model) {
2738 case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2:
Mauro Carvalho Chehab98ae1272007-11-05 09:30:39 -03002739 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002740 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03002741 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850:
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002742 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
Frank Schaefera6166012013-03-03 15:37:44 -03002743 case EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C:
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002744 {
2745 struct tveeprom tv;
Frank Schaefera2179682013-03-03 15:37:42 -03002746
2747 if (dev->eedata == NULL)
2748 break;
Mauro Carvalho Chehabac07bb72009-09-08 14:04:41 -03002749#if defined(CONFIG_MODULES) && defined(MODULE)
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002750 request_module("tveeprom");
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002751#endif
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002752 /* Call first TVeeprom */
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002753
Mauro Carvalho Chehabc7a45e52013-03-05 06:55:26 -03002754 dev->i2c_client[dev->def_i2c_bus].addr = 0xa0 >> 1;
2755 tveeprom_hauppauge_analog(&dev->i2c_client[dev->def_i2c_bus], &tv, dev->eedata);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002756
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002757 dev->tuner_type = tv.tuner_type;
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03002758
Hans Verkuil38f9d302008-07-23 05:09:15 -03002759 if (tv.audio_processor == V4L2_IDENT_MSPX4XX) {
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002760 dev->i2s_speed = 2048000;
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002761 dev->board.has_msp34xx = 1;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002762 }
2763 break;
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002764 }
Franklin Mengd7de5d82009-06-06 17:05:02 -03002765 case EM2882_BOARD_KWORLD_ATSC_315U:
2766 em28xx_write_reg(dev, 0x0d, 0x42);
2767 msleep(10);
2768 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
2769 msleep(10);
2770 break;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002771 case EM2820_BOARD_KWORLD_PVRTV2800RF:
2772 /* GPIO enables sound on KWORLD PVR TV 2800RF */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002773 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf9);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002774 break;
2775 case EM2820_BOARD_UNKNOWN:
2776 case EM2800_BOARD_UNKNOWN:
Darron Broadda3808e2008-09-30 02:46:41 -03002777 /*
2778 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD.
2779 *
2780 * This occurs because they share identical USB vendor and
2781 * product IDs.
2782 *
2783 * What we do here is look up the EEPROM hash of the K-WORLD
2784 * and if it is found then we decide that we do not have
2785 * a DIGIVOX and reset the device to the K-WORLD instead.
2786 *
2787 * This solution is only valid if they do not share eeprom
2788 * hash identities which has not been determined as yet.
2789 */
2790 case EM2880_BOARD_MSI_DIGIVOX_AD:
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002791 if (!em28xx_hint_board(dev))
2792 em28xx_set_model(dev);
Devin Heitmuellercdf7bfa2009-06-19 00:20:28 -03002793
2794 /* In cases where we had to use a board hint, the call to
2795 em28xx_set_mode() in em28xx_pre_card_setup() was a no-op,
2796 so make the call now so the analog GPIOs are set properly
2797 before probing the i2c bus. */
Devin Heitmueller5343e442009-07-15 00:35:47 -03002798 em28xx_gpio_set(dev, dev->board.tuner_gpio);
Devin Heitmuellercdf7bfa2009-06-19 00:20:28 -03002799 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002800 break;
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03002801
Frank Schaefera2179682013-03-03 15:37:42 -03002802 /*
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03002803 * The Dikom DK300 is detected as an Kworld VS-DVB-T 323UR.
2804 *
2805 * This occurs because they share identical USB vendor and
2806 * product IDs.
2807 *
2808 * What we do here is look up the EEPROM hash of the Dikom
2809 * and if it is found then we decide that we do not have
2810 * a Kworld and reset the device to the Dikom instead.
2811 *
2812 * This solution is only valid if they do not share eeprom
2813 * hash identities which has not been determined as yet.
2814 */
2815 case EM2882_BOARD_KWORLD_VS_DVBT:
2816 if (!em28xx_hint_board(dev))
2817 em28xx_set_model(dev);
2818
2819 /* In cases where we had to use a board hint, the call to
2820 em28xx_set_mode() in em28xx_pre_card_setup() was a no-op,
2821 so make the call now so the analog GPIOs are set properly
2822 before probing the i2c bus. */
2823 em28xx_gpio_set(dev, dev->board.tuner_gpio);
2824 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
2825 break;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002826 }
2827
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002828 if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002829 em28xx_errdev("\n\n");
2830 em28xx_errdev("The support for this board weren't "
2831 "valid yet.\n");
2832 em28xx_errdev("Please send a report of having this working\n");
2833 em28xx_errdev("not to V4L mailing list (and/or to other "
2834 "addresses)\n\n");
2835 }
2836
Frank Schaefera2179682013-03-03 15:37:42 -03002837 /* Free eeprom data memory */
2838 kfree(dev->eedata);
2839 dev->eedata = NULL;
2840
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002841 /* Allow override tuner type by a module parameter */
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002842 if (tuner >= 0)
2843 dev->tuner_type = tuner;
2844
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002845 /* request some modules */
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002846 if (dev->board.has_msp34xx)
Mauro Carvalho Chehabc7a45e52013-03-05 06:55:26 -03002847 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap[dev->def_i2c_bus],
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002848 "msp3400", 0, msp3400_addrs);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002849
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03002850 if (dev->board.decoder == EM28XX_SAA711X)
Mauro Carvalho Chehabc7a45e52013-03-05 06:55:26 -03002851 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap[dev->def_i2c_bus],
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002852 "saa7115_auto", 0, saa711x_addrs);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002853
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002854 if (dev->board.decoder == EM28XX_TVP5150)
Mauro Carvalho Chehabc7a45e52013-03-05 06:55:26 -03002855 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap[dev->def_i2c_bus],
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002856 "tvp5150", 0, tvp5150_addrs);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002857
Mauro Carvalho Chehabd36bb4e2009-07-14 03:18:39 -03002858 if (dev->em28xx_sensor == EM28XX_MT9V011) {
Hans Verkuil3c7c9372011-01-08 07:08:02 -03002859 struct mt9v011_platform_data pdata;
2860 struct i2c_board_info mt9v011_info = {
2861 .type = "mt9v011",
2862 .addr = 0xba >> 1,
2863 .platform_data = &pdata,
2864 };
Mauro Carvalho Chehabd36bb4e2009-07-14 03:18:39 -03002865
Hans Verkuil3c7c9372011-01-08 07:08:02 -03002866 pdata.xtal = dev->sensor_xtal;
Mauro Carvalho Chehabc7a45e52013-03-05 06:55:26 -03002867 v4l2_i2c_new_subdev_board(&dev->v4l2_dev, &dev->i2c_adap[dev->def_i2c_bus],
Hans Verkuil3c7c9372011-01-08 07:08:02 -03002868 &mt9v011_info, NULL);
Mauro Carvalho Chehabd36bb4e2009-07-14 03:18:39 -03002869 }
Mauro Carvalho Chehab02e78042009-06-29 11:35:05 -03002870
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -03002871
Mauro Carvalho Chehabdf7fa092009-02-25 09:06:13 -03002872 if (dev->board.adecoder == EM28XX_TVAUDIO)
Mauro Carvalho Chehabc7a45e52013-03-05 06:55:26 -03002873 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap[dev->def_i2c_bus],
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002874 "tvaudio", dev->board.tvaudio_addr, NULL);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002875
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002876 if (dev->board.tuner_type != TUNER_ABSENT) {
2877 int has_demod = (dev->tda9887_conf & TDA9887_PRESENT);
Mauro Carvalho Chehaba924a492008-11-12 08:41:29 -03002878
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002879 if (dev->board.radio.type)
Mauro Carvalho Chehabc7a45e52013-03-05 06:55:26 -03002880 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap[dev->def_i2c_bus],
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002881 "tuner", dev->board.radio_addr, NULL);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002882
2883 if (has_demod)
Hans Verkuil53dacb12009-08-10 02:49:08 -03002884 v4l2_i2c_new_subdev(&dev->v4l2_dev,
Mauro Carvalho Chehabc7a45e52013-03-05 06:55:26 -03002885 &dev->i2c_adap[dev->def_i2c_bus], "tuner",
Hans Verkuil53dacb12009-08-10 02:49:08 -03002886 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002887 if (dev->tuner_addr == 0) {
2888 enum v4l2_i2c_tuner_type type =
2889 has_demod ? ADDRS_TV_WITH_DEMOD : ADDRS_TV;
2890 struct v4l2_subdev *sd;
2891
Hans Verkuil53dacb12009-08-10 02:49:08 -03002892 sd = v4l2_i2c_new_subdev(&dev->v4l2_dev,
Mauro Carvalho Chehabc7a45e52013-03-05 06:55:26 -03002893 &dev->i2c_adap[dev->def_i2c_bus], "tuner",
Hans Verkuil53dacb12009-08-10 02:49:08 -03002894 0, v4l2_i2c_tuner_addrs(type));
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002895
2896 if (sd)
2897 dev->tuner_addr = v4l2_i2c_subdev_addr(sd);
2898 } else {
Mauro Carvalho Chehabc7a45e52013-03-05 06:55:26 -03002899 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap[dev->def_i2c_bus],
Laurent Pinchart9a1f8b32010-09-24 10:16:44 -03002900 "tuner", dev->tuner_addr, NULL);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002901 }
2902 }
2903
2904 em28xx_tuner_setup(dev);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002905}
Mauro Carvalho Chehabc8644052008-11-25 13:10:14 -03002906
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002907
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002908static void request_module_async(struct work_struct *work)
2909{
2910 struct em28xx *dev = container_of(work,
2911 struct em28xx, request_module_wk);
2912
Mauro Carvalho Chehab6ae5e062012-10-02 15:35:27 -03002913 /*
2914 * The em28xx extensions can be modules or builtin. If the
2915 * modules are already loaded or are built in, those extensions
2916 * can be initialised right now. Otherwise, the module init
2917 * code will do it.
2918 */
2919 em28xx_init_extension(dev);
2920
2921#if defined(CONFIG_MODULES) && defined(MODULE)
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002922 if (dev->has_audio_class)
2923 request_module("snd-usb-audio");
2924 else if (dev->has_alsa_audio)
2925 request_module("em28xx-alsa");
2926
2927 if (dev->board.has_dvb)
2928 request_module("em28xx-dvb");
Mauro Carvalho Chehab728f9772013-01-04 17:32:58 -03002929 if ((dev->board.ir_codes || dev->board.has_ir_i2c) && !disable_ir)
Ezequiel Garcíaf4d4e762012-03-26 09:13:35 -03002930 request_module("em28xx-rc");
Mauro Carvalho Chehab6ae5e062012-10-02 15:35:27 -03002931#endif /* CONFIG_MODULES */
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002932}
2933
2934static void request_modules(struct em28xx *dev)
2935{
2936 INIT_WORK(&dev->request_module_wk, request_module_async);
2937 schedule_work(&dev->request_module_wk);
2938}
Tejun Heo707bcf32010-12-24 16:14:20 +01002939
2940static void flush_request_modules(struct em28xx *dev)
2941{
Linus Torvalds0b8e74c2012-10-07 17:49:05 +09002942 flush_work(&dev->request_module_wk);
Tejun Heo707bcf32010-12-24 16:14:20 +01002943}
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002944
2945/*
Chris Rankind7222e72011-09-24 11:02:32 -03002946 * em28xx_release_resources()
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002947 * unregisters the v4l2,i2c and usb devices
Chris Rankind7222e72011-09-24 11:02:32 -03002948 * called when the device gets disconnected or at module unload
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002949*/
2950void em28xx_release_resources(struct em28xx *dev)
2951{
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002952 /*FIXME: I2C IR should be disconnected */
2953
2954 em28xx_release_analog_resources(dev);
2955
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002956 em28xx_i2c_unregister(dev);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002957
Hans Verkuil081b9452012-09-07 05:43:59 -03002958 v4l2_ctrl_handler_free(&dev->ctrl_handler);
2959
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002960 v4l2_device_unregister(&dev->v4l2_dev);
2961
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002962 usb_put_dev(dev->udev);
2963
2964 /* Mark device as unused */
Chris Rankin38b61eb2011-08-20 08:21:03 -03002965 clear_bit(dev->devno, &em28xx_devused);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002966};
2967
2968/*
2969 * em28xx_init_dev()
2970 * allocates and inits the device structs, registers i2c bus and v4l device
2971 */
Thomas Petazzoni622c2fc2012-01-07 10:18:45 -03002972static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,
Mauro Carvalho Chehab36fa6742009-04-05 08:02:15 -03002973 struct usb_interface *interface,
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002974 int minor)
2975{
Hans Verkuil081b9452012-09-07 05:43:59 -03002976 struct v4l2_ctrl_handler *hdl = &dev->ctrl_handler;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002977 int retval;
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02002978 static const char *default_chip_name = "em28xx";
2979 const char *chip_name = default_chip_name;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002980
2981 dev->udev = udev;
Devin Heitmuellerd3829fa2013-01-04 16:16:24 -03002982 mutex_init(&dev->vb_queue_lock);
2983 mutex_init(&dev->vb_vbi_queue_lock);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002984 mutex_init(&dev->ctrl_urb_lock);
2985 spin_lock_init(&dev->slock);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002986
2987 dev->em28xx_write_regs = em28xx_write_regs;
2988 dev->em28xx_read_reg = em28xx_read_reg;
2989 dev->em28xx_read_reg_req_len = em28xx_read_reg_req_len;
2990 dev->em28xx_write_regs_req = em28xx_write_regs_req;
2991 dev->em28xx_read_reg_req = em28xx_read_reg_req;
2992 dev->board.is_em2800 = em28xx_boards[dev->model].is_em2800;
2993
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03002994 em28xx_set_model(dev);
2995
2996 /* Set the default GPO/GPIO for legacy devices */
2997 dev->reg_gpo_num = EM2880_R04_GPO;
2998 dev->reg_gpio_num = EM28XX_R08_GPIO;
2999
3000 dev->wait_after_write = 5;
3001
3002 /* Based on the Chip ID, set the device configuration */
3003 retval = em28xx_read_reg(dev, EM28XX_R0A_CHIPID);
3004 if (retval > 0) {
3005 dev->chip_id = retval;
3006
3007 switch (dev->chip_id) {
Mauro Carvalho Chehabf57b17c32009-11-12 11:21:05 -03003008 case CHIP_ID_EM2800:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003009 chip_name = "em2800";
Mauro Carvalho Chehabf57b17c32009-11-12 11:21:05 -03003010 break;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003011 case CHIP_ID_EM2710:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003012 chip_name = "em2710";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003013 break;
3014 case CHIP_ID_EM2750:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003015 chip_name = "em2750";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003016 break;
3017 case CHIP_ID_EM2820:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003018 chip_name = "em2710/2820";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003019 break;
3020 case CHIP_ID_EM2840:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003021 chip_name = "em2840";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003022 break;
3023 case CHIP_ID_EM2860:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003024 chip_name = "em2860";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003025 break;
3026 case CHIP_ID_EM2870:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003027 chip_name = "em2870";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003028 dev->wait_after_write = 0;
3029 break;
3030 case CHIP_ID_EM2874:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003031 chip_name = "em2874";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003032 dev->reg_gpio_num = EM2874_R80_GPIO;
3033 dev->wait_after_write = 0;
Frank Schaefer87b52432013-03-03 15:37:40 -03003034 dev->eeprom_addrwidth_16bit = 1;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003035 break;
Antti Palosaaribc022692011-04-07 16:04:48 -03003036 case CHIP_ID_EM28174:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003037 chip_name = "em28174";
Antti Palosaaribc022692011-04-07 16:04:48 -03003038 dev->reg_gpio_num = EM2874_R80_GPIO;
3039 dev->wait_after_write = 0;
Frank Schaefer87b52432013-03-03 15:37:40 -03003040 dev->eeprom_addrwidth_16bit = 1;
Antti Palosaaribc022692011-04-07 16:04:48 -03003041 break;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003042 case CHIP_ID_EM2883:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003043 chip_name = "em2882/3";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003044 dev->wait_after_write = 0;
3045 break;
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -03003046 case CHIP_ID_EM2884:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003047 chip_name = "em2884";
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -03003048 dev->reg_gpio_num = EM2874_R80_GPIO;
3049 dev->wait_after_write = 0;
Frank Schaefer87b52432013-03-03 15:37:40 -03003050 dev->eeprom_addrwidth_16bit = 1;
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -03003051 break;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003052 default:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003053 printk(KERN_INFO DRIVER_NAME
3054 ": unknown em28xx chip ID (%d)\n", dev->chip_id);
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003055 }
3056 }
3057
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003058 if (chip_name != default_chip_name)
3059 printk(KERN_INFO DRIVER_NAME
3060 ": chip ID is %s\n", chip_name);
3061
3062 /*
3063 * For em2820/em2710, the name may change latter, after checking
3064 * if the device has a sensor (so, it is em2710) or not.
3065 */
3066 snprintf(dev->name, sizeof(dev->name), "%s #%d", chip_name, dev->devno);
3067
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003068 if (dev->is_audio_only) {
Chris Rankin6c03e382011-08-20 08:28:17 -03003069 retval = em28xx_audio_setup(dev);
3070 if (retval)
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003071 return -ENODEV;
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003072 em28xx_init_extension(dev);
3073
3074 return 0;
3075 }
3076
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003077 /* Prepopulate cached GPO register content */
3078 retval = em28xx_read_reg(dev, dev->reg_gpo_num);
3079 if (retval >= 0)
3080 dev->reg_gpo = retval;
3081
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003082 em28xx_pre_card_setup(dev);
3083
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003084 if (dev->chip_id == CHIP_ID_EM2820) {
3085 if (dev->board.is_webcam)
3086 chip_name = "em2710";
3087 else
3088 chip_name = "em2820";
3089 snprintf(dev->name, sizeof(dev->name), "%s #%d", chip_name, dev->devno);
3090 }
3091
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003092 if (!dev->board.is_em2800) {
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03003093 /* Resets I2C speed */
Sascha Sommer0903bb52012-01-08 16:19:30 -03003094 retval = em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003095 if (retval < 0) {
Chris Rankin6c03e382011-08-20 08:28:17 -03003096 em28xx_errdev("%s: em28xx_write_reg failed!"
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003097 " retval [%d]\n",
3098 __func__, retval);
3099 return retval;
3100 }
3101 }
3102
Mauro Carvalho Chehab36fa6742009-04-05 08:02:15 -03003103 retval = v4l2_device_register(&interface->dev, &dev->v4l2_dev);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003104 if (retval < 0) {
3105 em28xx_errdev("Call to v4l2_device_register() failed!\n");
3106 return retval;
3107 }
3108
Frank Schaefer8f8b113a2013-02-15 14:38:32 -03003109 v4l2_ctrl_handler_init(hdl, 8);
Hans Verkuil081b9452012-09-07 05:43:59 -03003110 dev->v4l2_dev.ctrl_handler = hdl;
3111
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003112 /* register i2c bus */
Chris Rankin6c03e382011-08-20 08:28:17 -03003113 retval = em28xx_i2c_register(dev);
3114 if (retval < 0) {
3115 em28xx_errdev("%s: em28xx_i2c_register - error [%d]!\n",
3116 __func__, retval);
3117 goto unregister_dev;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003118 }
3119
Mauro Carvalho Chehabb04fb662009-07-13 01:28:21 -03003120 /*
Mauro Carvalho Chehab579d3152009-07-14 12:33:25 -03003121 * Default format, used for tvp5150 or saa711x output formats
3122 */
3123 dev->vinmode = 0x10;
Devin Heitmueller206313d2009-08-31 23:23:03 -03003124 dev->vinctl = EM28XX_VINCTRL_INTERLACED |
3125 EM28XX_VINCTRL_CCIR656_ENABLE;
Mauro Carvalho Chehab579d3152009-07-14 12:33:25 -03003126
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003127 /* Do board specific init and eeprom reading */
3128 em28xx_card_setup(dev);
3129
3130 /* Configure audio */
Chris Rankin6c03e382011-08-20 08:28:17 -03003131 retval = em28xx_audio_setup(dev);
3132 if (retval < 0) {
3133 em28xx_errdev("%s: Error while setting audio - error [%d]!\n",
3134 __func__, retval);
3135 goto fail;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003136 }
Hans Verkuil081b9452012-09-07 05:43:59 -03003137 if (dev->audio_mode.ac97 != EM28XX_NO_AC97) {
3138 v4l2_ctrl_new_std(hdl, &em28xx_ctrl_ops,
3139 V4L2_CID_AUDIO_MUTE, 0, 1, 1, 1);
3140 v4l2_ctrl_new_std(hdl, &em28xx_ctrl_ops,
3141 V4L2_CID_AUDIO_VOLUME, 0, 0x1f, 1, 0x1f);
3142 } else {
3143 /* install the em28xx notify callback */
3144 v4l2_ctrl_notify(v4l2_ctrl_find(hdl, V4L2_CID_AUDIO_MUTE),
3145 em28xx_ctrl_notify, dev);
3146 v4l2_ctrl_notify(v4l2_ctrl_find(hdl, V4L2_CID_AUDIO_VOLUME),
3147 em28xx_ctrl_notify, dev);
3148 }
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003149
3150 /* wake i2c devices */
3151 em28xx_wake_i2c(dev);
3152
3153 /* init video dma queues */
3154 INIT_LIST_HEAD(&dev->vidq.active);
Devin Heitmueller28abf0832009-09-01 01:54:54 -03003155 INIT_LIST_HEAD(&dev->vbiq.active);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003156
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003157 if (dev->board.has_msp34xx) {
3158 /* Send a reset to other chips via gpio */
Chris Rankin6c03e382011-08-20 08:28:17 -03003159 retval = em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf7);
3160 if (retval < 0) {
3161 em28xx_errdev("%s: em28xx_write_reg - "
3162 "msp34xx(1) failed! error [%d]\n",
3163 __func__, retval);
3164 goto fail;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003165 }
3166 msleep(3);
3167
Chris Rankin6c03e382011-08-20 08:28:17 -03003168 retval = em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff);
3169 if (retval < 0) {
3170 em28xx_errdev("%s: em28xx_write_reg - "
3171 "msp34xx(2) failed! error [%d]\n",
3172 __func__, retval);
3173 goto fail;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003174 }
3175 msleep(3);
3176 }
3177
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003178 retval = em28xx_register_analog_devices(dev);
3179 if (retval < 0) {
Chris Rankin6c03e382011-08-20 08:28:17 -03003180 goto fail;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003181 }
3182
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003183 /* Save some power by putting tuner to sleep */
Laurent Pinchart622b8282009-10-05 10:48:17 -03003184 v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_power, 0);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003185
3186 return 0;
3187
Chris Rankin6c03e382011-08-20 08:28:17 -03003188fail:
3189 em28xx_i2c_unregister(dev);
Hans Verkuil081b9452012-09-07 05:43:59 -03003190 v4l2_ctrl_handler_free(&dev->ctrl_handler);
Chris Rankin6c03e382011-08-20 08:28:17 -03003191
3192unregister_dev:
3193 v4l2_device_unregister(&dev->v4l2_dev);
3194
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003195 return retval;
3196}
3197
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003198/* high bandwidth multiplier, as encoded in highspeed endpoint descriptors */
3199#define hb_mult(wMaxPacketSize) (1 + (((wMaxPacketSize) >> 11) & 0x03))
3200
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003201/*
3202 * em28xx_usb_probe()
3203 * checks for supported devices
3204 */
3205static int em28xx_usb_probe(struct usb_interface *interface,
3206 const struct usb_device_id *id)
3207{
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003208 struct usb_device *udev;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003209 struct em28xx *dev = NULL;
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003210 int retval;
Holger Nelson8ab33622011-12-28 18:55:41 -03003211 bool has_audio = false, has_video = false, has_dvb = false;
Mauro Carvalho Chehab8b2aea72012-12-23 13:25:38 -02003212 int i, nr, try_bulk;
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003213 const int ifnum = interface->altsetting[0].desc.bInterfaceNumber;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003214 char *speed;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003215
3216 udev = usb_get_dev(interface_to_usbdev(interface));
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003217
3218 /* Check to see next free device and mark as used */
Chris Rankin38b61eb2011-08-20 08:21:03 -03003219 do {
3220 nr = find_first_zero_bit(&em28xx_devused, EM28XX_MAXBOARDS);
3221 if (nr >= EM28XX_MAXBOARDS) {
3222 /* No free device slots */
3223 printk(DRIVER_NAME ": Supports only %i em28xx boards.\n",
3224 EM28XX_MAXBOARDS);
3225 retval = -ENOMEM;
3226 goto err_no_slot;
3227 }
3228 } while (test_and_set_bit(nr, &em28xx_devused));
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003229
3230 /* Don't register audio interfaces */
3231 if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
3232 em28xx_err(DRIVER_NAME " audio device (%04x:%04x): "
3233 "interface %i, class %i\n",
3234 le16_to_cpu(udev->descriptor.idVendor),
3235 le16_to_cpu(udev->descriptor.idProduct),
3236 ifnum,
3237 interface->altsetting[0].desc.bInterfaceClass);
3238
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003239 retval = -ENODEV;
3240 goto err;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003241 }
3242
Holger Nelson8ab33622011-12-28 18:55:41 -03003243 /* allocate memory for our device state and initialize it */
3244 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
3245 if (dev == NULL) {
3246 em28xx_err(DRIVER_NAME ": out of memory!\n");
3247 retval = -ENOMEM;
3248 goto err;
3249 }
3250
3251 /* compute alternate max packet sizes */
Frank Schaefer0cf544a2012-11-08 14:11:49 -03003252 dev->alt_max_pkt_size_isoc =
3253 kmalloc(sizeof(dev->alt_max_pkt_size_isoc[0]) *
Holger Nelson8ab33622011-12-28 18:55:41 -03003254 interface->num_altsetting, GFP_KERNEL);
Frank Schaefer0cf544a2012-11-08 14:11:49 -03003255 if (dev->alt_max_pkt_size_isoc == NULL) {
Holger Nelson8ab33622011-12-28 18:55:41 -03003256 em28xx_errdev("out of memory!\n");
3257 kfree(dev);
3258 retval = -ENOMEM;
3259 goto err;
3260 }
3261
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003262 /* Get endpoints */
3263 for (i = 0; i < interface->num_altsetting; i++) {
3264 int ep;
3265
3266 for (ep = 0; ep < interface->altsetting[i].desc.bNumEndpoints; ep++) {
Holger Nelson8ab33622011-12-28 18:55:41 -03003267 const struct usb_endpoint_descriptor *e;
3268 int sizedescr, size;
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003269
Holger Nelson8ab33622011-12-28 18:55:41 -03003270 e = &interface->altsetting[i].endpoint[ep].desc;
3271
3272 sizedescr = le16_to_cpu(e->wMaxPacketSize);
3273 size = sizedescr & 0x7ff;
3274
3275 if (udev->speed == USB_SPEED_HIGH)
3276 size = size * hb_mult(sizedescr);
3277
Frank Schaeferc647a912012-11-08 14:11:52 -03003278 if (usb_endpoint_dir_in(e)) {
Holger Nelson8ab33622011-12-28 18:55:41 -03003279 switch (e->bEndpointAddress) {
Frank Schaeferc647a912012-11-08 14:11:52 -03003280 case 0x82:
Holger Nelson8ab33622011-12-28 18:55:41 -03003281 has_video = true;
Frank Schaeferc647a912012-11-08 14:11:52 -03003282 if (usb_endpoint_xfer_isoc(e)) {
3283 dev->analog_ep_isoc =
3284 e->bEndpointAddress;
3285 dev->alt_max_pkt_size_isoc[i] = size;
3286 } else if (usb_endpoint_xfer_bulk(e)) {
3287 dev->analog_ep_bulk =
3288 e->bEndpointAddress;
3289 }
Holger Nelson8ab33622011-12-28 18:55:41 -03003290 break;
Frank Schaeferc647a912012-11-08 14:11:52 -03003291 case 0x83:
3292 if (usb_endpoint_xfer_isoc(e)) {
3293 has_audio = true;
3294 } else {
3295 printk(KERN_INFO DRIVER_NAME
3296 ": error: skipping audio endpoint 0x83, because it uses bulk transfers !\n");
3297 }
3298 break;
3299 case 0x84:
3300 if (has_video &&
3301 (usb_endpoint_xfer_bulk(e))) {
3302 dev->analog_ep_bulk =
3303 e->bEndpointAddress;
3304 } else {
3305 has_dvb = true;
3306 if (usb_endpoint_xfer_isoc(e)) {
3307 dev->dvb_ep_isoc = e->bEndpointAddress;
3308 if (size > dev->dvb_max_pkt_size_isoc) {
3309 dev->dvb_max_pkt_size_isoc = size;
3310 dev->dvb_alt_isoc = i;
3311 }
3312 } else {
3313 dev->dvb_ep_bulk = e->bEndpointAddress;
3314 }
Holger Nelson8ab33622011-12-28 18:55:41 -03003315 }
3316 break;
3317 }
3318 }
Frank Schaeferc647a912012-11-08 14:11:52 -03003319 /* NOTE:
3320 * Old logic with support for isoc transfers only was:
3321 * 0x82 isoc => analog
3322 * 0x83 isoc => audio
3323 * 0x84 isoc => digital
3324 *
3325 * New logic with support for bulk transfers
3326 * 0x82 isoc => analog
3327 * 0x82 bulk => analog
3328 * 0x83 isoc* => audio
3329 * 0x84 isoc => digital
3330 * 0x84 bulk => analog or digital**
3331 * (*: audio should always be isoc)
3332 * (**: analog, if ep 0x82 is isoc, otherwise digital)
3333 *
3334 * The new logic preserves backwards compatibility and
3335 * reflects the endpoint configurations we have seen
3336 * so far. But there might be devices for which this
3337 * logic is not sufficient...
3338 */
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003339 }
3340 }
3341
Holger Nelson8ab33622011-12-28 18:55:41 -03003342 if (!(has_audio || has_video || has_dvb)) {
3343 retval = -ENODEV;
3344 goto err_free;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003345 }
3346
3347 switch (udev->speed) {
3348 case USB_SPEED_LOW:
3349 speed = "1.5";
3350 break;
3351 case USB_SPEED_UNKNOWN:
3352 case USB_SPEED_FULL:
3353 speed = "12";
3354 break;
3355 case USB_SPEED_HIGH:
3356 speed = "480";
3357 break;
3358 default:
3359 speed = "unknown";
3360 }
3361
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003362 printk(KERN_INFO DRIVER_NAME
Ezequiel García401a5822012-03-13 10:27:09 -03003363 ": New device %s %s @ %s Mbps "
3364 "(%04x:%04x, interface %d, class %d)\n",
3365 udev->manufacturer ? udev->manufacturer : "",
3366 udev->product ? udev->product : "",
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003367 speed,
3368 le16_to_cpu(udev->descriptor.idVendor),
3369 le16_to_cpu(udev->descriptor.idProduct),
3370 ifnum,
3371 interface->altsetting->desc.bInterfaceNumber);
3372
Devin Heitmueller64a00b42009-05-27 23:23:37 -03003373 /*
3374 * Make sure we have 480 Mbps of bandwidth, otherwise things like
3375 * video stream wouldn't likely work, since 12 Mbps is generally
3376 * not enough even for most Digital TV streams.
3377 */
Devin Heitmuellere2a1b792009-05-27 23:44:10 -03003378 if (udev->speed != USB_SPEED_HIGH && disable_usb_speed_check == 0) {
Devin Heitmueller64a00b42009-05-27 23:23:37 -03003379 printk(DRIVER_NAME ": Device initialization failed.\n");
3380 printk(DRIVER_NAME ": Device must be connected to a high-speed"
3381 " USB 2.0 port.\n");
Devin Heitmueller64a00b42009-05-27 23:23:37 -03003382 retval = -ENODEV;
Holger Nelson8ab33622011-12-28 18:55:41 -03003383 goto err_free;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003384 }
3385
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003386 dev->devno = nr;
3387 dev->model = id->driver_info;
3388 dev->alt = -1;
Holger Nelson8ab33622011-12-28 18:55:41 -03003389 dev->is_audio_only = has_audio && !(has_video || has_dvb);
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003390 dev->has_alsa_audio = has_audio;
3391 dev->audio_ifnum = ifnum;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003392
3393 /* Checks if audio is provided by some interface */
3394 for (i = 0; i < udev->config->desc.bNumInterfaces; i++) {
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003395 struct usb_interface *uif = udev->config->interface[i];
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003396 if (uif->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
3397 dev->has_audio_class = 1;
3398 break;
3399 }
3400 }
3401
Mauro Carvalho Chehabaa514962012-12-23 13:15:47 -02003402 if (has_audio)
3403 printk(KERN_INFO DRIVER_NAME
3404 ": Audio interface %i found %s\n",
3405 ifnum,
3406 dev->has_audio_class ? "(USB Audio Class)" : "(Vendor Class)");
3407 if (has_video)
3408 printk(KERN_INFO DRIVER_NAME
3409 ": Video interface %i found:%s%s\n",
3410 ifnum,
3411 dev->analog_ep_bulk ? " bulk" : "",
3412 dev->analog_ep_isoc ? " isoc" : "");
3413 if (has_dvb)
3414 printk(KERN_INFO DRIVER_NAME
3415 ": DVB interface %i found:%s%s\n",
3416 ifnum,
3417 dev->dvb_ep_bulk ? " bulk" : "",
3418 dev->dvb_ep_isoc ? " isoc" : "");
3419
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003420 dev->num_alt = interface->num_altsetting;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003421
Mauro Carvalho Chehabd3e4ea02012-10-27 16:29:20 -03003422 if ((unsigned)card[nr] < em28xx_bcount)
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003423 dev->model = card[nr];
3424
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003425 /* save our data pointer in this interface device */
3426 usb_set_intfdata(interface, dev);
3427
Devin Heitmuellerd3829fa2013-01-04 16:16:24 -03003428 /* initialize videobuf2 stuff */
3429 em28xx_vb2_setup(dev);
3430
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003431 /* allocate device struct */
3432 mutex_init(&dev->lock);
3433 mutex_lock(&dev->lock);
Thomas Petazzoni622c2fc2012-01-07 10:18:45 -03003434 retval = em28xx_init_dev(dev, udev, interface, nr);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003435 if (retval) {
Holger Nelson8ab33622011-12-28 18:55:41 -03003436 goto unlock_and_free;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003437 }
3438
Frank Schaefer7e5d74e2012-12-26 15:12:37 -03003439 if (usb_xfer_mode < 0) {
Mauro Carvalho Chehab8b2aea72012-12-23 13:25:38 -02003440 if (dev->board.is_webcam)
3441 try_bulk = 1;
3442 else
3443 try_bulk = 0;
3444 } else {
Frank Schaefer7e5d74e2012-12-26 15:12:37 -03003445 try_bulk = usb_xfer_mode > 0;
Mauro Carvalho Chehab8b2aea72012-12-23 13:25:38 -02003446 }
3447
3448 /* Select USB transfer types to use */
3449 if (has_video) {
3450 if (!dev->analog_ep_isoc || (try_bulk && dev->analog_ep_bulk))
3451 dev->analog_xfer_bulk = 1;
3452 em28xx_info("analog set to %s mode.\n",
3453 dev->analog_xfer_bulk ? "bulk" : "isoc");
3454 }
Gianluca Gennari86d38d12012-02-13 13:59:22 -03003455 if (has_dvb) {
Mauro Carvalho Chehab8b2aea72012-12-23 13:25:38 -02003456 if (!dev->dvb_ep_isoc || (try_bulk && dev->dvb_ep_bulk))
3457 dev->dvb_xfer_bulk = 1;
3458
3459 em28xx_info("dvb set to %s mode.\n",
3460 dev->dvb_xfer_bulk ? "bulk" : "isoc");
3461
Frank Schaeferc647a912012-11-08 14:11:52 -03003462 /* pre-allocate DVB usb transfer buffers */
3463 if (dev->dvb_xfer_bulk) {
3464 retval = em28xx_alloc_urbs(dev, EM28XX_DIGITAL_MODE,
3465 dev->dvb_xfer_bulk,
3466 EM28XX_DVB_NUM_BUFS,
3467 512,
3468 EM28XX_DVB_BULK_PACKET_MULTIPLIER);
3469 } else {
3470 retval = em28xx_alloc_urbs(dev, EM28XX_DIGITAL_MODE,
3471 dev->dvb_xfer_bulk,
3472 EM28XX_DVB_NUM_BUFS,
3473 dev->dvb_max_pkt_size_isoc,
3474 EM28XX_DVB_NUM_ISOC_PACKETS);
3475 }
Gianluca Gennari86d38d12012-02-13 13:59:22 -03003476 if (retval) {
Frank Schaeferc647a912012-11-08 14:11:52 -03003477 printk(DRIVER_NAME
3478 ": Failed to pre-allocate USB transfer buffers for DVB.\n");
Gianluca Gennari86d38d12012-02-13 13:59:22 -03003479 goto unlock_and_free;
3480 }
3481 }
3482
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003483 request_modules(dev);
3484
3485 /* Should be the last thing to do, to avoid newer udev's to
3486 open the device before fully initializing it
3487 */
3488 mutex_unlock(&dev->lock);
3489
3490 return 0;
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003491
Holger Nelson8ab33622011-12-28 18:55:41 -03003492unlock_and_free:
3493 mutex_unlock(&dev->lock);
3494
3495err_free:
Frank Schaefer0cf544a2012-11-08 14:11:49 -03003496 kfree(dev->alt_max_pkt_size_isoc);
Holger Nelson8ab33622011-12-28 18:55:41 -03003497 kfree(dev);
3498
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003499err:
Chris Rankin38b61eb2011-08-20 08:21:03 -03003500 clear_bit(nr, &em28xx_devused);
3501
3502err_no_slot:
3503 usb_put_dev(udev);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003504 return retval;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003505}
3506
3507/*
3508 * em28xx_usb_disconnect()
Chris Rankind7222e72011-09-24 11:02:32 -03003509 * called when the device gets disconnected
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003510 * video device will be unregistered on v4l2_close in case it is still open
3511 */
3512static void em28xx_usb_disconnect(struct usb_interface *interface)
3513{
3514 struct em28xx *dev;
3515
3516 dev = usb_get_intfdata(interface);
3517 usb_set_intfdata(interface, NULL);
3518
3519 if (!dev)
3520 return;
3521
Frank Schaefer05fe2172012-12-27 19:02:44 -03003522 dev->disconnected = 1;
3523
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003524 if (dev->is_audio_only) {
3525 mutex_lock(&dev->lock);
3526 em28xx_close_extension(dev);
3527 mutex_unlock(&dev->lock);
3528 return;
3529 }
3530
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003531 em28xx_info("disconnecting %s\n", dev->vdev->name);
3532
Tejun Heo707bcf32010-12-24 16:14:20 +01003533 flush_request_modules(dev);
3534
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003535 mutex_lock(&dev->lock);
3536
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003537 v4l2_device_disconnect(&dev->v4l2_dev);
3538
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003539 if (dev->users) {
Frank Schaefer05fe2172012-12-27 19:02:44 -03003540 em28xx_warn("device %s is open! Deregistration and memory deallocation are deferred on close.\n",
3541 video_device_node_name(dev->vdev));
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003542
Frank Schaefer05fe2172012-12-27 19:02:44 -03003543 em28xx_uninit_usb_xfer(dev, EM28XX_ANALOG_MODE);
3544 em28xx_uninit_usb_xfer(dev, EM28XX_DIGITAL_MODE);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003545 }
3546
Frank Schaefer05fe2172012-12-27 19:02:44 -03003547 em28xx_close_extension(dev);
3548 /* NOTE: must be called BEFORE the resources are released */
3549
3550 if (!dev->users)
3551 em28xx_release_resources(dev);
Gianluca Gennari86d38d12012-02-13 13:59:22 -03003552
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003553 mutex_unlock(&dev->lock);
3554
3555 if (!dev->users) {
Frank Schaefer0cf544a2012-11-08 14:11:49 -03003556 kfree(dev->alt_max_pkt_size_isoc);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003557 kfree(dev);
3558 }
3559}
3560
3561static struct usb_driver em28xx_usb_driver = {
3562 .name = "em28xx",
3563 .probe = em28xx_usb_probe,
3564 .disconnect = em28xx_usb_disconnect,
3565 .id_table = em28xx_id_table,
3566};
3567
Greg Kroah-Hartmanecb3b2b2011-11-18 09:46:12 -08003568module_usb_driver(em28xx_usb_driver);