blob: 279307cc3adbae00e498c34f14a36e241ac66cce [file] [log] [blame]
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001/*
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002 em28xx-cards.c - driver for Empia EM2800/EM2820/2840 USB
3 video capture devices
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08004
Mauro Carvalho Chehabf7abcd32005-11-08 21:38:25 -08005 Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it>
6 Markus Rechberger <mrechberger@gmail.com>
Mauro Carvalho Chehab2e7c6dc2006-04-03 07:53:40 -03007 Mauro Carvalho Chehab <mchehab@infradead.org>
Mauro Carvalho Chehabf7abcd32005-11-08 21:38:25 -08008 Sascha Sommer <saschasommer@freenet.de>
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08009
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 */
24
25#include <linux/init.h>
26#include <linux/module.h>
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -080027#include <linux/delay.h>
28#include <linux/i2c.h>
29#include <linux/usb.h>
30#include <media/tuner.h>
Hans Verkuil2474ed42006-03-19 12:35:57 -030031#include <media/msp3400.h>
Hans Verkuilc7c0b342006-04-02 13:35:00 -030032#include <media/saa7115.h>
33#include <media/tvp5150.h>
Mauro Carvalho Chehab1f6173e2005-11-08 21:37:16 -080034#include <media/tveeprom.h>
Mauro Carvalho Chehab9bb13a62006-01-09 15:25:37 -020035#include <media/v4l2-common.h>
Hans Verkuil38f9d302008-07-23 05:09:15 -030036#include <media/v4l2-chip-ident.h>
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -080037
Mauro Carvalho Chehabf7abcd32005-11-08 21:38:25 -080038#include "em28xx.h"
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -080039
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -030040static int tuner = -1;
41module_param(tuner, int, 0444);
42MODULE_PARM_DESC(tuner, "tuner type");
43
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -030044static unsigned int disable_ir;
45module_param(disable_ir, int, 0444);
46MODULE_PARM_DESC(disable_ir, "disable infrared remote support");
47
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -030048struct em28xx_hash_table {
49 unsigned long hash;
50 unsigned int model;
51 unsigned int tuner;
52};
53
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -080054struct em28xx_board em28xx_boards[] = {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -030055 [EM2750_BOARD_UNKNOWN] = {
56 .name = "Unknown EM2750/EM2751 webcam grabber",
57 .vchannels = 1,
58 .input = { {
59 .type = EM28XX_VMUX_COMPOSITE1,
60 .vmux = 0,
61 .amux = 0,
62 } },
63 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -080064 [EM2800_BOARD_UNKNOWN] = {
65 .name = "Unknown EM2800 video grabber",
66 .is_em2800 = 1,
67 .vchannels = 2,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -080068 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -080069 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -030070 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -080071 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -030072 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -080073 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -030074 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -080075 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -030076 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -080077 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -030078 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -080079 },
80 [EM2820_BOARD_UNKNOWN] = {
Mauro Carvalho Chehab3dbd85b2007-11-03 08:07:07 -030081 .name = "Unknown EM2750/28xx video grabber",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -080082 .is_em2800 = 0,
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -030083 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -080084 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -030085 [EM2750_BOARD_DLCW_130] = {
86 /* Beijing Huaqi Information Digital Technology Co., Ltd */
87 .name = "Huaqi DLCW-130",
88 .valid = EM28XX_BOARD_NOT_VALIDATED,
89 .vchannels = 1,
90 .input = { {
91 .type = EM28XX_VMUX_COMPOSITE1,
92 .vmux = 0,
93 .amux = 0,
94 } },
95 },
Markus Rechberger4d17d082006-02-07 06:25:39 -020096 [EM2820_BOARD_KWORLD_PVRTV2800RF] = {
Markus Rechberger33ccaa32006-02-07 06:25:41 -020097 .name = "Kworld PVR TV 2800 RF",
Markus Rechberger4d17d082006-02-07 06:25:39 -020098 .is_em2800 = 0,
99 .vchannels = 2,
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -0300100 .tuner_type = TUNER_TEMIC_PAL,
Markus Rechberger4d17d082006-02-07 06:25:39 -0200101 .tda9887_conf = TDA9887_PRESENT,
Markus Rechberger4d17d082006-02-07 06:25:39 -0200102 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300103 .input = { {
Markus Rechberger4d17d082006-02-07 06:25:39 -0200104 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300105 .vmux = SAA7115_COMPOSITE0,
Markus Rechberger4d17d082006-02-07 06:25:39 -0200106 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300107 }, {
Markus Rechberger4d17d082006-02-07 06:25:39 -0200108 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300109 .vmux = SAA7115_SVIDEO3,
Markus Rechberger4d17d082006-02-07 06:25:39 -0200110 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300111 } },
Markus Rechberger4d17d082006-02-07 06:25:39 -0200112 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800113 [EM2820_BOARD_TERRATEC_CINERGY_250] = {
114 .name = "Terratec Cinergy 250 USB",
115 .vchannels = 3,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800116 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
117 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800118 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300119 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800120 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300121 .vmux = SAA7115_COMPOSITE2,
Markus Rechberger9475fb12006-02-27 00:07:34 -0300122 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300123 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800124 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300125 .vmux = SAA7115_COMPOSITE0,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800126 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300127 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800128 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300129 .vmux = SAA7115_SVIDEO3,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800130 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300131 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800132 },
133 [EM2820_BOARD_PINNACLE_USB_2] = {
134 .name = "Pinnacle PCTV USB 2",
135 .vchannels = 3,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800136 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
137 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800138 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300139 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800140 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300141 .vmux = SAA7115_COMPOSITE2,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800142 .amux = 0,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300143 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800144 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300145 .vmux = SAA7115_COMPOSITE0,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800146 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300147 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800148 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300149 .vmux = SAA7115_SVIDEO3,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800150 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300151 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800152 },
153 [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2] = {
154 .name = "Hauppauge WinTV USB 2",
155 .vchannels = 3,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800156 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300157 .tda9887_conf = TDA9887_PRESENT |
158 TDA9887_PORT1_ACTIVE|
159 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800160 .decoder = EM28XX_TVP5150,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800161 .has_msp34xx = 1,
162 /*FIXME: S-Video not tested */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300163 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800164 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300165 .vmux = TVP5150_COMPOSITE0,
Hans Verkuil2474ed42006-03-19 12:35:57 -0300166 .amux = MSP_INPUT_DEFAULT,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300167 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800168 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300169 .vmux = TVP5150_SVIDEO,
Hans Verkuil07151722006-04-01 18:03:23 -0300170 .amux = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1,
171 MSP_DSP_IN_SCART, MSP_DSP_IN_SCART),
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300172 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800173 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300174 [EM2820_BOARD_DLINK_USB_TV] = {
175 .name = "D-Link DUB-T210 TV Tuner",
176 .valid = EM28XX_BOARD_NOT_VALIDATED,
177 .vchannels = 3,
178 .is_em2800 = 0,
179 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
180 .tda9887_conf = TDA9887_PRESENT,
181 .decoder = EM28XX_SAA7113,
182 .input = { {
183 .type = EM28XX_VMUX_TELEVISION,
184 .vmux = SAA7115_COMPOSITE2,
185 .amux = 1,
186 }, {
187 .type = EM28XX_VMUX_COMPOSITE1,
188 .vmux = SAA7115_COMPOSITE0,
189 .amux = 1,
190 }, {
191 .type = EM28XX_VMUX_SVIDEO,
192 .vmux = SAA7115_SVIDEO3,
193 .amux = 1,
194 } },
195 },
196 [EM2820_BOARD_HERCULES_SMART_TV_USB2] = {
197 .name = "Hercules Smart TV USB 2.0",
198 .valid = EM28XX_BOARD_NOT_VALIDATED,
199 .vchannels = 3,
200 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
201 .tda9887_conf = TDA9887_PRESENT,
202 .decoder = EM28XX_SAA7113,
203 .input = { {
204 .type = EM28XX_VMUX_TELEVISION,
205 .vmux = SAA7115_COMPOSITE2,
206 .amux = 1,
207 }, {
208 .type = EM28XX_VMUX_COMPOSITE1,
209 .vmux = SAA7115_COMPOSITE0,
210 .amux = 1,
211 }, {
212 .type = EM28XX_VMUX_SVIDEO,
213 .vmux = SAA7115_SVIDEO3,
214 .amux = 1,
215 } },
216 },
217 [EM2820_BOARD_PINNACLE_USB_2_FM1216ME] = {
218 .name = "Pinnacle PCTV USB 2 (Philips FM1216ME)",
219 .valid = EM28XX_BOARD_NOT_VALIDATED,
220 .vchannels = 3,
221 .is_em2800 = 0,
222 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
223 .tda9887_conf = TDA9887_PRESENT,
224 .decoder = EM28XX_SAA7113,
225 .input = { {
226 .type = EM28XX_VMUX_TELEVISION,
227 .vmux = SAA7115_COMPOSITE2,
228 .amux = 0,
229 }, {
230 .type = EM28XX_VMUX_COMPOSITE1,
231 .vmux = SAA7115_COMPOSITE0,
232 .amux = 1,
233 }, {
234 .type = EM28XX_VMUX_SVIDEO,
235 .vmux = SAA7115_SVIDEO3,
236 .amux = 1,
237 } },
238 },
239 [EM2820_BOARD_GADMEI_UTV310] = {
240 .name = "Gadmei UTV310",
241 .valid = EM28XX_BOARD_NOT_VALIDATED,
242 .vchannels = 3,
243 .tuner_type = TUNER_TNF_5335MF,
244 .tda9887_conf = TDA9887_PRESENT,
245 .decoder = EM28XX_SAA7113,
246 .input = { {
247 .type = EM28XX_VMUX_TELEVISION,
248 .vmux = SAA7115_COMPOSITE1,
249 .amux = 1,
250 }, {
251 .type = EM28XX_VMUX_COMPOSITE1,
252 .vmux = SAA7115_COMPOSITE0,
253 .amux = 1,
254 }, {
255 .type = EM28XX_VMUX_SVIDEO,
256 .vmux = SAA7115_SVIDEO3,
257 .amux = 1,
258 } },
259 },
260 [EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE] = {
261 .name = "Leadtek Winfast USB II Deluxe",
262 .valid = EM28XX_BOARD_NOT_VALIDATED,
263 .vchannels = 3,
264 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
265 .tda9887_conf = TDA9887_PRESENT,
266 .decoder = EM28XX_SAA7114,
267 .input = { {
268 .type = EM28XX_VMUX_TELEVISION,
269 .vmux = 2,
270 .amux = 0,
271 }, {
272 .type = EM28XX_VMUX_COMPOSITE1,
273 .vmux = 0,
274 .amux = 1,
275 }, {
276 .type = EM28XX_VMUX_SVIDEO,
277 .vmux = 9,
278 .amux = 1,
279 } },
280 },
281 [EM2820_BOARD_PINNACLE_DVC_100] = {
282 .name = "Pinnacle Dazzle DVC 100",
283 .valid = EM28XX_BOARD_NOT_VALIDATED,
284 .vchannels = 3,
285 .decoder = EM28XX_SAA7113,
286 .input = { {
287 .type = EM28XX_VMUX_COMPOSITE1,
288 .vmux = SAA7115_COMPOSITE0,
289 .amux = 1,
290 }, {
291 .type = EM28XX_VMUX_SVIDEO,
292 .vmux = SAA7115_SVIDEO3,
293 .amux = 1,
294 } },
295 },
296 [EM2820_BOARD_VIDEOLOGY_20K14XUSB] = {
297 .name = "Videology 20K14XUSB USB2.0",
298 .valid = EM28XX_BOARD_NOT_VALIDATED,
299 .vchannels = 1,
300 .input = { {
301 .type = EM28XX_VMUX_COMPOSITE1,
302 .vmux = 0,
303 .amux = 0,
304 } },
305 },
306 [EM2821_BOARD_PROLINK_PLAYTV_USB2] = {
307 .name = "SIIG AVTuner-PVR/Prolink PlayTV USB 2.0",
308 .valid = EM28XX_BOARD_NOT_VALIDATED,
309 .vchannels = 3,
310 .is_em2800 = 0,
311 .tuner_type = TUNER_LG_PAL_NEW_TAPC, /* unknown? */
312 .tda9887_conf = TDA9887_PRESENT, /* unknown? */
313 .decoder = EM28XX_SAA7113,
314 .input = { {
315 .type = EM28XX_VMUX_TELEVISION,
316 .vmux = SAA7115_COMPOSITE2,
317 .amux = 1,
318 }, {
319 .type = EM28XX_VMUX_COMPOSITE1,
320 .vmux = SAA7115_COMPOSITE0,
321 .amux = 1,
322 }, {
323 .type = EM28XX_VMUX_SVIDEO,
324 .vmux = SAA7115_SVIDEO3,
325 .amux = 1,
326 } },
327 },
328 [EM2821_BOARD_SUPERCOMP_USB_2] = {
329 .name = "Supercomp USB 2.0 TV",
330 .valid = EM28XX_BOARD_NOT_VALIDATED,
331 .vchannels = 3,
332 .is_em2800 = 0,
333 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
334 .tda9887_conf = TDA9887_PRESENT |
335 TDA9887_PORT1_ACTIVE |
336 TDA9887_PORT2_ACTIVE,
337 .decoder = EM28XX_SAA7113,
338 .input = { {
339 .type = EM28XX_VMUX_TELEVISION,
340 .vmux = SAA7115_COMPOSITE2,
341 .amux = 1,
342 }, {
343 .type = EM28XX_VMUX_COMPOSITE1,
344 .vmux = SAA7115_COMPOSITE0,
345 .amux = 0,
346 }, {
347 .type = EM28XX_VMUX_SVIDEO,
348 .vmux = SAA7115_SVIDEO3,
349 .amux = 1,
350 } },
351 },
352 [EM2821_BOARD_USBGEAR_VD204] = {
353 .name = "Usbgear VD204v9",
354 .valid = EM28XX_BOARD_NOT_VALIDATED,
355 .vchannels = 2,
356 .decoder = EM28XX_SAA7113,
357 .input = { {
358 .type = EM28XX_VMUX_COMPOSITE1,
359 .vmux = SAA7115_COMPOSITE0,
360 .amux = 1,
361 }, {
362 .type = EM28XX_VMUX_SVIDEO,
363 .vmux = SAA7115_SVIDEO3,
364 .amux = 1,
365 } },
366 },
367 [EM2860_BOARD_NETGMBH_CAM] = {
368 /* Beijing Huaqi Information Digital Technology Co., Ltd */
369 .name = "NetGMBH Cam",
370 .valid = EM28XX_BOARD_NOT_VALIDATED,
371 .vchannels = 1,
372 .input = { {
373 .type = EM28XX_VMUX_COMPOSITE1,
374 .vmux = 0,
375 .amux = 0,
376 } },
377 },
378 [EM2860_BOARD_TYPHOON_DVD_MAKER] = {
379 .name = "Typhoon DVD Maker",
380 .valid = EM28XX_BOARD_NOT_VALIDATED,
381 .vchannels = 2,
382 .decoder = EM28XX_SAA7113,
383 .input = { {
384 .type = EM28XX_VMUX_COMPOSITE1,
385 .vmux = SAA7115_COMPOSITE0,
386 .amux = 1,
387 }, {
388 .type = EM28XX_VMUX_SVIDEO,
389 .vmux = SAA7115_SVIDEO3,
390 .amux = 1,
391 } },
392 },
393 [EM2860_BOARD_GADMEI_UTV330] = {
394 .name = "Gadmei UTV330",
395 .valid = EM28XX_BOARD_NOT_VALIDATED,
396 .vchannels = 3,
397 .tuner_type = TUNER_TNF_5335MF,
398 .tda9887_conf = TDA9887_PRESENT,
399 .decoder = EM28XX_SAA7113,
400 .input = { {
401 .type = EM28XX_VMUX_TELEVISION,
402 .vmux = SAA7115_COMPOSITE2,
403 .amux = 0,
404 }, {
405 .type = EM28XX_VMUX_COMPOSITE1,
406 .vmux = SAA7115_COMPOSITE0,
407 .amux = 1,
408 }, {
409 .type = EM28XX_VMUX_SVIDEO,
410 .vmux = SAA7115_SVIDEO3,
411 .amux = 1,
412 } },
413 },
414 [EM2860_BOARD_TERRATEC_HYBRID_XS] = {
415 .name = "Terratec Cinergy A Hybrid XS",
416 .valid = EM28XX_BOARD_NOT_VALIDATED,
417 .vchannels = 3,
418 .tuner_type = TUNER_XC2028,
419 .decoder = EM28XX_TVP5150,
420 .input = { {
421 .type = EM28XX_VMUX_TELEVISION,
422 .vmux = TVP5150_COMPOSITE0,
423 .amux = 0,
424 }, {
425 .type = EM28XX_VMUX_COMPOSITE1,
426 .vmux = TVP5150_COMPOSITE1,
427 .amux = 1,
428 }, {
429 .type = EM28XX_VMUX_SVIDEO,
430 .vmux = TVP5150_SVIDEO,
431 .amux = 1,
432 } },
433 },
434 [EM2861_BOARD_KWORLD_PVRTV_300U] = {
435 .name = "KWorld PVRTV 300U",
436 .valid = EM28XX_BOARD_NOT_VALIDATED,
437 .vchannels = 3,
438 .tuner_type = TUNER_XC2028,
439 .decoder = EM28XX_TVP5150,
440 .input = { {
441 .type = EM28XX_VMUX_TELEVISION,
442 .vmux = TVP5150_COMPOSITE0,
443 .amux = 0,
444 }, {
445 .type = EM28XX_VMUX_COMPOSITE1,
446 .vmux = TVP5150_COMPOSITE1,
447 .amux = 1,
448 }, {
449 .type = EM28XX_VMUX_SVIDEO,
450 .vmux = TVP5150_SVIDEO,
451 .amux = 1,
452 } },
453 },
454 [EM2861_BOARD_YAKUMO_MOVIE_MIXER] = {
455 .name = "Yakumo MovieMixer",
456 .valid = EM28XX_BOARD_NOT_VALIDATED,
457 .vchannels = 1,
458 .decoder = EM28XX_TVP5150,
459 .input = { {
460 .type = EM28XX_VMUX_TELEVISION,
461 .vmux = TVP5150_COMPOSITE0,
462 .amux = 0,
463 }, {
464 .type = EM28XX_VMUX_COMPOSITE1,
465 .vmux = TVP5150_COMPOSITE1,
466 .amux = 1,
467 }, {
468 .type = EM28XX_VMUX_SVIDEO,
469 .vmux = TVP5150_SVIDEO,
470 .amux = 1,
471 } },
472 },
473 [EM2861_BOARD_PLEXTOR_PX_TV100U] = {
474 .name = "Plextor ConvertX PX-TV100U",
475 .valid = EM28XX_BOARD_NOT_VALIDATED,
476 .vchannels = 3,
477 .tuner_type = TUNER_TNF_5335MF,
478 .tda9887_conf = TDA9887_PRESENT,
479 .decoder = EM28XX_TVP5150,
480 .input = { {
481 .type = EM28XX_VMUX_TELEVISION,
482 .vmux = TVP5150_COMPOSITE0,
483 .amux = 1,
484 }, {
485 .type = EM28XX_VMUX_COMPOSITE1,
486 .vmux = TVP5150_COMPOSITE1,
487 .amux = 1,
488 }, {
489 .type = EM28XX_VMUX_SVIDEO,
490 .vmux = TVP5150_SVIDEO,
491 .amux = 1,
492 } },
493 },
494 [EM2870_BOARD_TERRATEC_XS] = {
495 .name = "Terratec Cinergy T XS",
496 .valid = EM28XX_BOARD_NOT_VALIDATED,
497 .tuner_type = TUNER_XC2028,
498 },
499 [EM2870_BOARD_TERRATEC_XS_MT2060] = {
500 .name = "Terratec Cinergy T XS (MT2060)",
501 .valid = EM28XX_BOARD_NOT_VALIDATED,
502 .tuner_type = TUNER_ABSENT, /* MT2060 */
503 },
504 [EM2870_BOARD_KWORLD_350U] = {
505 .name = "Kworld 350 U DVB-T",
506 .valid = EM28XX_BOARD_NOT_VALIDATED,
507 .tuner_type = TUNER_XC2028,
508 },
509 [EM2870_BOARD_KWORLD_355U] = {
510 .name = "Kworld 355 U DVB-T",
511 .valid = EM28XX_BOARD_NOT_VALIDATED,
512 },
513 [EM2870_BOARD_PINNACLE_PCTV_DVB] = {
514 .name = "Pinnacle PCTV DVB-T",
515 .valid = EM28XX_BOARD_NOT_VALIDATED,
516 .tuner_type = TUNER_ABSENT, /* MT2060 */
517 },
518 [EM2870_BOARD_COMPRO_VIDEOMATE] = {
519 .name = "Compro, VideoMate U3",
520 .valid = EM28XX_BOARD_NOT_VALIDATED,
521 .tuner_type = TUNER_ABSENT, /* MT2060 */
522 },
523 [EM2880_BOARD_TERRATEC_HYBRID_XS_FR] = {
524 .name = "Terratec Hybrid XS Secam",
525 .valid = EM28XX_BOARD_NOT_VALIDATED,
526 .vchannels = 3,
527 .has_msp34xx = 1,
528 .tuner_type = TUNER_XC2028,
529 .decoder = EM28XX_TVP5150,
530 .input = { {
531 .type = EM28XX_VMUX_TELEVISION,
532 .vmux = TVP5150_COMPOSITE0,
533 .amux = 0,
534 }, {
535 .type = EM28XX_VMUX_COMPOSITE1,
536 .vmux = TVP5150_COMPOSITE1,
537 .amux = 1,
538 }, {
539 .type = EM28XX_VMUX_SVIDEO,
540 .vmux = TVP5150_SVIDEO,
541 .amux = 1,
542 } },
543 },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300544 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900] = {
Aidan Thornton122d1582007-11-20 15:25:08 -0300545 .name = "Hauppauge WinTV HVR 900",
546 .vchannels = 3,
547 .tda9887_conf = TDA9887_PRESENT,
548 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab5add9a62007-11-22 12:08:53 -0300549 .mts_firmware = 1,
Devin Heitmuellerb38cc642008-06-09 14:59:05 -0300550 .has_dvb = 1,
Aidan Thornton122d1582007-11-20 15:25:08 -0300551 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300552 .input = { {
Aidan Thornton122d1582007-11-20 15:25:08 -0300553 .type = EM28XX_VMUX_TELEVISION,
554 .vmux = TVP5150_COMPOSITE0,
555 .amux = 0,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300556 }, {
Aidan Thornton122d1582007-11-20 15:25:08 -0300557 .type = EM28XX_VMUX_COMPOSITE1,
558 .vmux = TVP5150_COMPOSITE1,
559 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300560 }, {
Aidan Thornton122d1582007-11-20 15:25:08 -0300561 .type = EM28XX_VMUX_SVIDEO,
562 .vmux = TVP5150_SVIDEO,
563 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300564 } },
Aidan Thornton122d1582007-11-20 15:25:08 -0300565 },
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300566 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2] = {
567 .name = "Hauppauge WinTV HVR 900 (R2)",
568 .vchannels = 3,
569 .tda9887_conf = TDA9887_PRESENT,
570 .tuner_type = TUNER_XC2028,
571 .mts_firmware = 1,
572 .decoder = EM28XX_TVP5150,
573 .input = { {
574 .type = EM28XX_VMUX_TELEVISION,
575 .vmux = TVP5150_COMPOSITE0,
576 .amux = 0,
577 }, {
578 .type = EM28XX_VMUX_COMPOSITE1,
579 .vmux = TVP5150_COMPOSITE1,
580 .amux = 1,
581 }, {
582 .type = EM28XX_VMUX_SVIDEO,
583 .vmux = TVP5150_SVIDEO,
584 .amux = 1,
585 } },
586 },
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -0300587 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950] = {
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -0300588 .name = "Hauppauge WinTV HVR 950",
589 .vchannels = 3,
590 .tda9887_conf = TDA9887_PRESENT,
591 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -0300592 .mts_firmware = 1,
593 .has_12mhz_i2s = 1,
Mauro Carvalho Chehab227ad4a2008-04-17 21:37:40 -0300594 .has_dvb = 1,
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -0300595 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300596 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300597 .type = EM28XX_VMUX_TELEVISION,
598 .vmux = TVP5150_COMPOSITE0,
599 .amux = 0,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300600 }, {
Mauro Carvalho Chehab7d070e22007-11-01 21:52:58 -0300601 .type = EM28XX_VMUX_COMPOSITE1,
602 .vmux = TVP5150_COMPOSITE1,
603 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300604 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300605 .type = EM28XX_VMUX_SVIDEO,
606 .vmux = TVP5150_SVIDEO,
607 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300608 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300609 },
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300610 [EM2880_BOARD_PINNACLE_PCTV_HD_PRO] = {
611 .name = "Pinnacle PCTV HD Pro Stick",
612 .vchannels = 3,
613 .tda9887_conf = TDA9887_PRESENT,
614 .tuner_type = TUNER_XC2028,
615 .mts_firmware = 1,
616 .has_12mhz_i2s = 1,
617 .has_dvb = 1,
618 .decoder = EM28XX_TVP5150,
619 .input = { {
620 .type = EM28XX_VMUX_TELEVISION,
621 .vmux = TVP5150_COMPOSITE0,
622 .amux = 0,
623 }, {
624 .type = EM28XX_VMUX_COMPOSITE1,
625 .vmux = TVP5150_COMPOSITE1,
626 .amux = 1,
627 }, {
628 .type = EM28XX_VMUX_SVIDEO,
629 .vmux = TVP5150_SVIDEO,
630 .amux = 1,
631 } },
632 },
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300633 [EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600] = {
634 .name = "AMD ATI TV Wonder HD 600",
635 .vchannels = 3,
636 .tda9887_conf = TDA9887_PRESENT,
637 .tuner_type = TUNER_XC2028,
638 .mts_firmware = 1,
639 .has_12mhz_i2s = 1,
640 .has_dvb = 1,
641 .decoder = EM28XX_TVP5150,
642 .input = { {
643 .type = EM28XX_VMUX_TELEVISION,
644 .vmux = TVP5150_COMPOSITE0,
645 .amux = 0,
646 }, {
647 .type = EM28XX_VMUX_COMPOSITE1,
648 .vmux = TVP5150_COMPOSITE1,
649 .amux = 1,
650 }, {
651 .type = EM28XX_VMUX_SVIDEO,
652 .vmux = TVP5150_SVIDEO,
653 .amux = 1,
654 } },
655 },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300656 [EM2880_BOARD_TERRATEC_HYBRID_XS] = {
657 .name = "Terratec Hybrid XS",
658 .vchannels = 3,
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300659 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300660 .tuner_type = TUNER_XC2028,
661 .decoder = EM28XX_TVP5150,
reinhard schwab655b8402008-07-26 10:47:00 -0300662 .has_dvb = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300663 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300664 .type = EM28XX_VMUX_TELEVISION,
665 .vmux = TVP5150_COMPOSITE0,
666 .amux = 0,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300667 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300668 .type = EM28XX_VMUX_COMPOSITE1,
669 .vmux = TVP5150_COMPOSITE1,
670 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300671 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300672 .type = EM28XX_VMUX_SVIDEO,
673 .vmux = TVP5150_SVIDEO,
674 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300675 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300676 },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300677 /* maybe there's a reason behind it why Terratec sells the Hybrid XS
678 as Prodigy XS with a different PID, let's keep it separated for now
679 maybe we'll need it lateron */
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300680 [EM2880_BOARD_TERRATEC_PRODIGY_XS] = {
681 .name = "Terratec Prodigy XS",
682 .vchannels = 3,
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300683 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300684 .tuner_type = TUNER_XC2028,
685 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300686 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300687 .type = EM28XX_VMUX_TELEVISION,
688 .vmux = TVP5150_COMPOSITE0,
689 .amux = 0,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300690 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300691 .type = EM28XX_VMUX_COMPOSITE1,
692 .vmux = TVP5150_COMPOSITE1,
693 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300694 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300695 .type = EM28XX_VMUX_SVIDEO,
696 .vmux = TVP5150_SVIDEO,
697 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300698 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300699 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800700 [EM2820_BOARD_MSI_VOX_USB_2] = {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300701 .name = "MSI VOX USB 2.0",
702 .vchannels = 3,
703 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
704 .tda9887_conf = TDA9887_PRESENT |
705 TDA9887_PORT1_ACTIVE |
706 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300707 .max_range_640_480 = 1,
708
709 .decoder = EM28XX_SAA7114,
710 .input = { {
711 .type = EM28XX_VMUX_TELEVISION,
712 .vmux = SAA7115_COMPOSITE4,
713 .amux = 0,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300714 }, {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300715 .type = EM28XX_VMUX_COMPOSITE1,
716 .vmux = SAA7115_COMPOSITE0,
717 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300718 }, {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300719 .type = EM28XX_VMUX_SVIDEO,
720 .vmux = SAA7115_SVIDEO3,
721 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300722 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800723 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800724 [EM2800_BOARD_TERRATEC_CINERGY_200] = {
725 .name = "Terratec Cinergy 200 USB",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800726 .is_em2800 = 1,
727 .vchannels = 3,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800728 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
729 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800730 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300731 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800732 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300733 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800734 .amux = 0,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300735 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800736 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300737 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800738 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300739 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800740 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300741 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800742 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300743 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800744 },
Aron Szabo59d07f12008-07-27 13:47:52 -0300745 [EM2800_BOARD_GRABBEEX_USB2800] = {
746 .name = "eMPIA Technology, Inc. GrabBeeX+ Video Encoder",
747 .is_em2800 = 1,
748 .vchannels = 2,
749 .decoder = EM28XX_SAA7113,
750 .input = { {
751 .type = EM28XX_VMUX_COMPOSITE1,
752 .vmux = SAA7115_COMPOSITE0,
753 .amux = 1,
754 }, {
755 .type = EM28XX_VMUX_SVIDEO,
756 .vmux = SAA7115_SVIDEO3,
757 .amux = 1,
758 } },
759 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800760 [EM2800_BOARD_LEADTEK_WINFAST_USBII] = {
761 .name = "Leadtek Winfast USB II",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800762 .is_em2800 = 1,
763 .vchannels = 3,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800764 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
765 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800766 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300767 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800768 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300769 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800770 .amux = 0,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300771 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800772 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300773 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800774 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300775 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800776 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300777 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800778 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300779 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800780 },
781 [EM2800_BOARD_KWORLD_USB2800] = {
782 .name = "Kworld USB2800",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800783 .is_em2800 = 1,
784 .vchannels = 3,
Michael Krufkyab8b8702008-04-22 14:46:05 -0300785 .tuner_type = TUNER_PHILIPS_FCV1236D,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800786 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800787 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300788 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800789 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300790 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800791 .amux = 0,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300792 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800793 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300794 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800795 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300796 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800797 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300798 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800799 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300800 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800801 },
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -0800802 [EM2820_BOARD_PINNACLE_DVC_90] = {
Aurelien Jarnoaec2aef2007-12-17 13:49:17 -0300803 .name = "Pinnacle Dazzle DVC 90/DVC 100",
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -0800804 .vchannels = 3,
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -0300805 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800806 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300807 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800808 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300809 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -0800810 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300811 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800812 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300813 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -0800814 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300815 } },
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -0800816 },
Sascha Sommer43625592007-11-03 15:05:07 -0300817 [EM2800_BOARD_VGEAR_POCKETTV] = {
818 .name = "V-Gear PocketTV",
819 .is_em2800 = 1,
820 .vchannels = 3,
Sascha Sommer43625592007-11-03 15:05:07 -0300821 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
822 .tda9887_conf = TDA9887_PRESENT,
Sascha Sommer43625592007-11-03 15:05:07 -0300823 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300824 .input = { {
Sascha Sommer43625592007-11-03 15:05:07 -0300825 .type = EM28XX_VMUX_TELEVISION,
826 .vmux = SAA7115_COMPOSITE2,
827 .amux = 0,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300828 }, {
Sascha Sommer43625592007-11-03 15:05:07 -0300829 .type = EM28XX_VMUX_COMPOSITE1,
830 .vmux = SAA7115_COMPOSITE0,
831 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300832 }, {
Sascha Sommer43625592007-11-03 15:05:07 -0300833 .type = EM28XX_VMUX_SVIDEO,
834 .vmux = SAA7115_SVIDEO3,
835 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300836 } },
Sascha Sommer43625592007-11-03 15:05:07 -0300837 },
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300838 [EM2820_BOARD_PROLINK_PLAYTV_USB2] = {
839 .name = "Pixelview Prolink PlayTV USB 2.0",
840 .vchannels = 3,
841 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -0300842 .tuner_type = TUNER_YMEC_TVF_5533MF,
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300843 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300844 .input = { {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300845 .type = EM28XX_VMUX_TELEVISION,
846 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab7463dda2008-02-05 22:29:26 -0300847 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300848 }, {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300849 .type = EM28XX_VMUX_COMPOSITE1,
850 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab7463dda2008-02-05 22:29:26 -0300851 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300852 }, {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300853 .type = EM28XX_VMUX_SVIDEO,
854 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab7463dda2008-02-05 22:29:26 -0300855 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300856 } },
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300857 },
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -0300858 [EM2860_BOARD_POINTNIX_INTRAORAL_CAMERA] = {
859 .name = "PointNix Intra-Oral Camera",
860 .has_snapshot_button = 1,
861 .vchannels = 1,
862 .tda9887_conf = TDA9887_PRESENT,
863 .tuner_type = TUNER_ABSENT,
864 .decoder = EM28XX_SAA7113,
865 .input = { {
866 .type = EM28XX_VMUX_SVIDEO,
867 .vmux = SAA7115_SVIDEO3,
868 .amux = 0,
869 } },
870 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300871 [EM2880_BOARD_MSI_DIGIVOX_AD] = {
872 .name = "MSI DigiVox A/D",
873 .valid = EM28XX_BOARD_NOT_VALIDATED,
874 .vchannels = 3,
875 .tuner_type = TUNER_XC2028,
876 .decoder = EM28XX_TVP5150,
877 .input = { {
878 .type = EM28XX_VMUX_TELEVISION,
879 .vmux = TVP5150_COMPOSITE0,
880 .amux = 0,
881 }, {
882 .type = EM28XX_VMUX_COMPOSITE1,
883 .vmux = TVP5150_COMPOSITE1,
884 .amux = 1,
885 }, {
886 .type = EM28XX_VMUX_SVIDEO,
887 .vmux = TVP5150_SVIDEO,
888 .amux = 1,
889 } },
890 },
891 [EM2880_BOARD_MSI_DIGIVOX_AD_II] = {
892 .name = "MSI DigiVox A/D II",
893 .valid = EM28XX_BOARD_NOT_VALIDATED,
894 .vchannels = 3,
895 .tuner_type = TUNER_XC2028,
896 .decoder = EM28XX_TVP5150,
897 .input = { {
898 .type = EM28XX_VMUX_TELEVISION,
899 .vmux = TVP5150_COMPOSITE0,
900 .amux = 0,
901 }, {
902 .type = EM28XX_VMUX_COMPOSITE1,
903 .vmux = TVP5150_COMPOSITE1,
904 .amux = 1,
905 }, {
906 .type = EM28XX_VMUX_SVIDEO,
907 .vmux = TVP5150_SVIDEO,
908 .amux = 1,
909 } },
910 },
911 [EM2880_BOARD_KWORLD_DVB_305U] = {
912 .name = "KWorld DVB-T 305U",
913 .valid = EM28XX_BOARD_NOT_VALIDATED,
914 .vchannels = 3,
915 .tuner_type = TUNER_XC2028,
916 .decoder = EM28XX_TVP5150,
917 .input = { {
918 .type = EM28XX_VMUX_TELEVISION,
919 .vmux = TVP5150_COMPOSITE0,
920 .amux = 0,
921 }, {
922 .type = EM28XX_VMUX_COMPOSITE1,
923 .vmux = TVP5150_COMPOSITE1,
924 .amux = 1,
925 }, {
926 .type = EM28XX_VMUX_SVIDEO,
927 .vmux = TVP5150_SVIDEO,
928 .amux = 1,
929 } },
930 },
931 [EM2880_BOARD_KWORLD_DVB_310U] = {
932 .name = "KWorld DVB-T 310U",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300933 .vchannels = 3,
934 .tuner_type = TUNER_XC2028,
Darron Broadda3808e2008-09-30 02:46:41 -0300935 .has_dvb = 1,
936 .mts_firmware = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300937 .decoder = EM28XX_TVP5150,
938 .input = { {
939 .type = EM28XX_VMUX_TELEVISION,
940 .vmux = TVP5150_COMPOSITE0,
Darron Broadda3808e2008-09-30 02:46:41 -0300941 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300942 }, {
943 .type = EM28XX_VMUX_COMPOSITE1,
944 .vmux = TVP5150_COMPOSITE1,
Darron Broadda3808e2008-09-30 02:46:41 -0300945 .amux = EM28XX_AMUX_AC97_LINE_IN,
946 }, { /* S-video has not been tested yet */
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300947 .type = EM28XX_VMUX_SVIDEO,
948 .vmux = TVP5150_SVIDEO,
Darron Broadda3808e2008-09-30 02:46:41 -0300949 .amux = EM28XX_AMUX_AC97_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300950 } },
951 },
952 [EM2881_BOARD_DNT_DA2_HYBRID] = {
953 .name = "DNT DA2 Hybrid",
954 .valid = EM28XX_BOARD_NOT_VALIDATED,
955 .vchannels = 3,
956 .tuner_type = TUNER_XC2028,
957 .decoder = EM28XX_TVP5150,
958 .input = { {
959 .type = EM28XX_VMUX_TELEVISION,
960 .vmux = TVP5150_COMPOSITE0,
961 .amux = 0,
962 }, {
963 .type = EM28XX_VMUX_COMPOSITE1,
964 .vmux = TVP5150_COMPOSITE1,
965 .amux = 1,
966 }, {
967 .type = EM28XX_VMUX_SVIDEO,
968 .vmux = TVP5150_SVIDEO,
969 .amux = 1,
970 } },
971 },
972 [EM2881_BOARD_PINNACLE_HYBRID_PRO] = {
973 .name = "Pinnacle Hybrid Pro",
974 .valid = EM28XX_BOARD_NOT_VALIDATED,
975 .vchannels = 3,
976 .tuner_type = TUNER_XC2028,
977 .decoder = EM28XX_TVP5150,
978 .input = { {
979 .type = EM28XX_VMUX_TELEVISION,
980 .vmux = TVP5150_COMPOSITE0,
981 .amux = 0,
982 }, {
983 .type = EM28XX_VMUX_COMPOSITE1,
984 .vmux = TVP5150_COMPOSITE1,
985 .amux = 1,
986 }, {
987 .type = EM28XX_VMUX_SVIDEO,
988 .vmux = TVP5150_SVIDEO,
989 .amux = 1,
990 } },
991 },
992 [EM2882_BOARD_PINNACLE_HYBRID_PRO] = {
993 .name = "Pinnacle Hybrid Pro (2)",
994 .valid = EM28XX_BOARD_NOT_VALIDATED,
995 .vchannels = 3,
996 .tuner_type = TUNER_XC2028,
Eugeniy Meshcheryakova674a3b2008-08-01 08:23:41 -0300997 .mts_firmware = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300998 .decoder = EM28XX_TVP5150,
999 .input = { {
1000 .type = EM28XX_VMUX_TELEVISION,
1001 .vmux = TVP5150_COMPOSITE0,
1002 .amux = 0,
1003 }, {
1004 .type = EM28XX_VMUX_COMPOSITE1,
1005 .vmux = TVP5150_COMPOSITE1,
1006 .amux = 1,
1007 }, {
1008 .type = EM28XX_VMUX_SVIDEO,
1009 .vmux = TVP5150_SVIDEO,
1010 .amux = 1,
1011 } },
1012 },
1013 [EM2882_BOARD_KWORLD_VS_DVBT] = {
1014 .name = "Kworld VS-DVB-T 323UR",
1015 .valid = EM28XX_BOARD_NOT_VALIDATED,
1016 .vchannels = 3,
1017 .tuner_type = TUNER_XC2028,
1018 .decoder = EM28XX_TVP5150,
1019 .input = { {
1020 .type = EM28XX_VMUX_TELEVISION,
1021 .vmux = TVP5150_COMPOSITE0,
1022 .amux = 0,
1023 }, {
1024 .type = EM28XX_VMUX_COMPOSITE1,
1025 .vmux = TVP5150_COMPOSITE1,
1026 .amux = 1,
1027 }, {
1028 .type = EM28XX_VMUX_SVIDEO,
1029 .vmux = TVP5150_SVIDEO,
1030 .amux = 1,
1031 } },
1032 },
1033 [EM2882_BOARD_TERRATEC_HYBRID_XS] = {
1034 .name = "Terratec Hybrid XS (em2882)",
1035 .valid = EM28XX_BOARD_NOT_VALIDATED,
1036 .vchannels = 3,
1037 .tuner_type = TUNER_XC2028,
1038 .decoder = EM28XX_TVP5150,
1039 .input = { {
1040 .type = EM28XX_VMUX_TELEVISION,
1041 .vmux = TVP5150_COMPOSITE0,
1042 .amux = 0,
1043 }, {
1044 .type = EM28XX_VMUX_COMPOSITE1,
1045 .vmux = TVP5150_COMPOSITE1,
1046 .amux = 1,
1047 }, {
1048 .type = EM28XX_VMUX_SVIDEO,
1049 .vmux = TVP5150_SVIDEO,
1050 .amux = 1,
1051 } },
1052 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001053 [EM2883_BOARD_KWORLD_HYBRID_A316] = {
1054 .name = "Kworld PlusTV HD Hybrid 330",
1055 .valid = EM28XX_BOARD_NOT_VALIDATED,
1056 .vchannels = 3,
1057 .is_em2800 = 0,
1058 .tuner_type = TUNER_XC2028,
1059 .decoder = EM28XX_TVP5150,
1060 .input = { {
1061 .type = EM28XX_VMUX_TELEVISION,
1062 .vmux = TVP5150_COMPOSITE0,
1063 .amux = 0,
1064 }, {
1065 .type = EM28XX_VMUX_COMPOSITE1,
1066 .vmux = TVP5150_COMPOSITE1,
1067 .amux = 1,
1068 }, {
1069 .type = EM28XX_VMUX_SVIDEO,
1070 .vmux = TVP5150_SVIDEO,
1071 .amux = 1,
1072 } },
1073 },
Mauro Carvalho Chehabee281b82008-07-27 16:58:04 -03001074 [EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU] = {
Vitaly Woold3603342008-07-27 14:10:11 -03001075 .name = "Compro VideoMate ForYou/Stereo",
1076 .vchannels = 2,
1077 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1078 .tda9887_conf = TDA9887_PRESENT,
1079 .decoder = EM28XX_TVP5150,
1080 .input = { {
1081 .type = EM28XX_VMUX_TELEVISION,
1082 .vmux = TVP5150_COMPOSITE0,
1083 .amux = EM28XX_AMUX_LINE_IN,
1084 }, {
1085 .type = EM28XX_VMUX_SVIDEO,
1086 .vmux = TVP5150_SVIDEO,
1087 .amux = EM28XX_AMUX_LINE_IN,
1088 } },
1089 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001090};
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001091const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001092
1093/* table of devices that work with this driver */
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001094struct usb_device_id em28xx_id_table [] = {
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001095 { USB_DEVICE(0xeb1a, 0x2750),
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001096 .driver_info = EM2750_BOARD_UNKNOWN },
1097 { USB_DEVICE(0xeb1a, 0x2751),
1098 .driver_info = EM2750_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001099 { USB_DEVICE(0xeb1a, 0x2800),
1100 .driver_info = EM2800_BOARD_UNKNOWN },
1101 { USB_DEVICE(0xeb1a, 0x2820),
1102 .driver_info = EM2820_BOARD_UNKNOWN },
1103 { USB_DEVICE(0xeb1a, 0x2821),
1104 .driver_info = EM2820_BOARD_UNKNOWN },
1105 { USB_DEVICE(0xeb1a, 0x2860),
1106 .driver_info = EM2820_BOARD_UNKNOWN },
1107 { USB_DEVICE(0xeb1a, 0x2861),
1108 .driver_info = EM2820_BOARD_UNKNOWN },
1109 { USB_DEVICE(0xeb1a, 0x2870),
1110 .driver_info = EM2820_BOARD_UNKNOWN },
1111 { USB_DEVICE(0xeb1a, 0x2881),
1112 .driver_info = EM2820_BOARD_UNKNOWN },
1113 { USB_DEVICE(0xeb1a, 0x2883),
1114 .driver_info = EM2820_BOARD_UNKNOWN },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001115 { USB_DEVICE(0xeb1a, 0xe300),
1116 .driver_info = EM2861_BOARD_KWORLD_PVRTV_300U },
1117 { USB_DEVICE(0xeb1a, 0xe305),
1118 .driver_info = EM2880_BOARD_KWORLD_DVB_305U },
1119 { USB_DEVICE(0xeb1a, 0xe310),
1120 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD },
1121 { USB_DEVICE(0xeb1a, 0xa316),
1122 .driver_info = EM2883_BOARD_KWORLD_HYBRID_A316 },
1123 { USB_DEVICE(0xeb1a, 0xe320),
1124 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD_II },
1125 { USB_DEVICE(0xeb1a, 0xe323),
1126 .driver_info = EM2882_BOARD_KWORLD_VS_DVBT },
1127 { USB_DEVICE(0xeb1a, 0xe350),
1128 .driver_info = EM2870_BOARD_KWORLD_350U },
1129 { USB_DEVICE(0xeb1a, 0xe355),
1130 .driver_info = EM2870_BOARD_KWORLD_355U },
1131 { USB_DEVICE(0xeb1a, 0x2801),
1132 .driver_info = EM2800_BOARD_GRABBEEX_USB2800 },
1133 { USB_DEVICE(0xeb1a, 0xe357),
1134 .driver_info = EM2870_BOARD_KWORLD_355U },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001135 { USB_DEVICE(0x0ccd, 0x0036),
1136 .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001137 { USB_DEVICE(0x0ccd, 0x004c),
1138 .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS_FR },
1139 { USB_DEVICE(0x0ccd, 0x004f),
1140 .driver_info = EM2860_BOARD_TERRATEC_HYBRID_XS },
1141 { USB_DEVICE(0x0ccd, 0x005e),
1142 .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS },
1143 { USB_DEVICE(0x0ccd, 0x0042),
1144 .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS },
1145 { USB_DEVICE(0x0ccd, 0x0043),
1146 .driver_info = EM2870_BOARD_TERRATEC_XS },
1147 { USB_DEVICE(0x0ccd, 0x0047),
1148 .driver_info = EM2880_BOARD_TERRATEC_PRODIGY_XS },
1149 { USB_DEVICE(0x185b, 0x2870),
1150 .driver_info = EM2870_BOARD_COMPRO_VIDEOMATE },
Vitaly Woold3603342008-07-27 14:10:11 -03001151 { USB_DEVICE(0x185b, 0x2041),
Mauro Carvalho Chehabee281b82008-07-27 16:58:04 -03001152 .driver_info = EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001153 { USB_DEVICE(0x2040, 0x4200),
1154 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
Mauro Carvalho Chehab15b9bec2008-01-13 12:02:20 -03001155 { USB_DEVICE(0x2040, 0x4201),
1156 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001157 { USB_DEVICE(0x2040, 0x6500),
1158 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 },
Luc Saillard427d20c2008-01-30 17:23:00 -03001159 { USB_DEVICE(0x2040, 0x6502),
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001160 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2 },
Michael Krufky74ee0512008-05-01 18:02:30 -03001161 { USB_DEVICE(0x2040, 0x6513), /* HCW HVR-980 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001162 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Michael Krufky74ee0512008-05-01 18:02:30 -03001163 { USB_DEVICE(0x2040, 0x6517), /* HP HVR-950 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001164 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Michael Krufky74ee0512008-05-01 18:02:30 -03001165 { USB_DEVICE(0x2040, 0x651b), /* RP HVR-950 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001166 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Michael Krufky74ee0512008-05-01 18:02:30 -03001167 { USB_DEVICE(0x2040, 0x651f), /* HCW HVR-850 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001168 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001169 { USB_DEVICE(0x0438, 0xb002),
1170 .driver_info = EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001171 { USB_DEVICE(0x2001, 0xf112),
1172 .driver_info = EM2820_BOARD_DLINK_USB_TV },
1173 { USB_DEVICE(0x2304, 0x0207),
1174 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
1175 { USB_DEVICE(0x2304, 0x0208),
1176 .driver_info = EM2820_BOARD_PINNACLE_USB_2 },
1177 { USB_DEVICE(0x2304, 0x021a),
1178 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
1179 { USB_DEVICE(0x2304, 0x0226),
1180 .driver_info = EM2882_BOARD_PINNACLE_HYBRID_PRO },
1181 { USB_DEVICE(0x2304, 0x0227),
1182 .driver_info = EM2880_BOARD_PINNACLE_PCTV_HD_PRO },
1183 { USB_DEVICE(0x0413, 0x6023),
1184 .driver_info = EM2800_BOARD_LEADTEK_WINFAST_USBII },
1185 { USB_DEVICE(0x093b, 0xa005),
1186 .driver_info = EM2861_BOARD_PLEXTOR_PX_TV100U },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001187 { },
1188};
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001189MODULE_DEVICE_TABLE(usb, em28xx_id_table);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001190
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001191/*
1192 * Reset sequences for analog/digital modes
1193 */
1194
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001195/* Reset for the most [analog] boards */
1196static struct em28xx_reg_seq default_analog[] = {
1197 {EM28XX_R08_GPIO, 0x6d, ~EM_GPIO_4, 10},
1198 { -1, -1, -1, -1},
1199};
1200
1201/* Reset for the most [digital] boards */
1202static struct em28xx_reg_seq default_digital[] = {
1203 {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
1204 { -1, -1, -1, -1},
1205};
1206
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001207/* Board Hauppauge WinTV HVR 900 analog */
Mauro Carvalho Chehabe54318e2008-04-18 18:34:31 -03001208static struct em28xx_reg_seq hauppauge_wintv_hvr_900_analog[] = {
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001209 {EM28XX_R08_GPIO, 0x2d, ~EM_GPIO_4, 10},
1210 {0x05, 0xff, 0x10, 10},
1211 { -1, -1, -1, -1},
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001212};
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001213
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001214/* Board Hauppauge WinTV HVR 900 digital */
Mauro Carvalho Chehabe54318e2008-04-18 18:34:31 -03001215static struct em28xx_reg_seq hauppauge_wintv_hvr_900_digital[] = {
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001216 {EM28XX_R08_GPIO, 0x2e, ~EM_GPIO_4, 10},
1217 {EM2880_R04_GPO, 0x04, 0x0f, 10},
1218 {EM2880_R04_GPO, 0x0c, 0x0f, 10},
1219 { -1, -1, -1, -1},
1220};
1221
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001222/* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
1223static struct em28xx_reg_seq em2880_msi_digivox_ad_analog[] = {
1224 {EM28XX_R08_GPIO, 0x69, ~EM_GPIO_4, 10},
1225 { -1, -1, -1, -1},
1226};
1227
1228/* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
1229static struct em28xx_reg_seq em2880_msi_digivox_ad_digital[] = {
1230 {EM28XX_R08_GPIO, 0x6a, ~EM_GPIO_4, 10},
1231 { -1, -1, -1, -1},
1232};
1233
1234/* Board - EM2870 Kworld 355u
1235 Analog - No input analog */
1236static struct em28xx_reg_seq em2870_kworld_355u_digital[] = {
1237 {EM2880_R04_GPO, 0x01, 0xff, 10},
1238 { -1, -1, -1, -1},
1239};
1240
1241/* Callback for the most boards */
1242static struct em28xx_reg_seq default_callback[] = {
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001243 {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10},
1244 {EM28XX_R08_GPIO, 0, EM_GPIO_4, 10},
1245 {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10},
1246 { -1, -1, -1, -1},
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001247};
1248
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001249/* Callback for EM2882 TERRATEC HYBRID XS */
1250static struct em28xx_reg_seq em2882_terratec_hybrid_xs_digital[] = {
1251 {EM28XX_R08_GPIO, 0x2e, 0xff, 6},
1252 {EM28XX_R08_GPIO, 0x3e, ~EM_GPIO_4, 6},
1253 {EM2880_R04_GPO, 0x04, 0xff, 10},
1254 {EM2880_R04_GPO, 0x0c, 0xff, 10},
1255 { -1, -1, -1, -1},
1256};
1257
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001258/*
1259 * EEPROM hash table for devices with generic USB IDs
1260 */
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03001261static struct em28xx_hash_table em28xx_eeprom_hash [] = {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001262 /* P/N: SA 60002070465 Tuner: TVF7533-MF */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001263 {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF},
Darron Broadda3808e2008-09-30 02:46:41 -03001264 {0x966a0441, EM2880_BOARD_KWORLD_DVB_310U, TUNER_XC2028},
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001265};
1266
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03001267/* I2C devicelist hash table for devices with generic USB IDs */
Sascha Sommerfad7b952007-11-04 08:06:48 -03001268static struct em28xx_hash_table em28xx_i2c_hash[] = {
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001269 {0xb06a32c3, EM2800_BOARD_TERRATEC_CINERGY_200, TUNER_LG_PAL_NEW_TAPC},
1270 {0xf51200e3, EM2800_BOARD_VGEAR_POCKETTV, TUNER_LG_PAL_NEW_TAPC},
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001271 {0x1ba50080, EM2860_BOARD_POINTNIX_INTRAORAL_CAMERA, TUNER_ABSENT},
Sascha Sommerfad7b952007-11-04 08:06:48 -03001272};
1273
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001274int em28xx_tuner_callback(void *ptr, int command, int arg)
1275{
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001276 int rc = 0;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001277 struct em28xx *dev = ptr;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001278
1279 if (dev->tuner_type != TUNER_XC2028)
1280 return 0;
1281
1282 if (command != XC2028_TUNER_RESET)
1283 return 0;
1284
1285 if (dev->mode == EM28XX_ANALOG_MODE)
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001286 rc = em28xx_gpio_set(dev, dev->tun_analog_gpio);
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001287 else
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001288 rc = em28xx_gpio_set(dev, dev->tun_digital_gpio);
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001289
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001290 return rc;
1291}
1292EXPORT_SYMBOL_GPL(em28xx_tuner_callback);
1293
1294static void em28xx_set_model(struct em28xx *dev)
1295{
1296 dev->is_em2800 = em28xx_boards[dev->model].is_em2800;
1297 dev->has_msp34xx = em28xx_boards[dev->model].has_msp34xx;
1298 dev->tda9887_conf = em28xx_boards[dev->model].tda9887_conf;
1299 dev->decoder = em28xx_boards[dev->model].decoder;
1300 dev->video_inputs = em28xx_boards[dev->model].vchannels;
1301 dev->has_12mhz_i2s = em28xx_boards[dev->model].has_12mhz_i2s;
1302 dev->max_range_640_480 = em28xx_boards[dev->model].max_range_640_480;
1303 dev->has_dvb = em28xx_boards[dev->model].has_dvb;
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001304 dev->has_snapshot_button = em28xx_boards[dev->model].has_snapshot_button;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001305 dev->valid = em28xx_boards[dev->model].valid;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001306}
1307
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001308/* Since em28xx_pre_card_setup() requires a proper dev->model,
1309 * this won't work for boards with generic PCI IDs
1310 */
Markus Rechbergera94e95b2006-01-23 17:11:10 -02001311void em28xx_pre_card_setup(struct em28xx *dev)
1312{
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001313 int rc;
1314
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001315 rc = em28xx_read_reg(dev, EM2880_R04_GPO);
1316 if (rc >= 0)
1317 dev->reg_gpo = rc;
1318
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001319 dev->wait_after_write = 5;
Mauro Carvalho Chehab41facaa2008-04-17 21:44:58 -03001320 rc = em28xx_read_reg(dev, EM28XX_R0A_CHIPID);
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001321 if (rc > 0) {
1322 switch (rc) {
Devin Heitmuellera8a1f8c2008-06-10 12:35:42 -03001323 case CHIP_ID_EM2860:
1324 em28xx_info("chip ID is em2860\n");
1325 break;
Mauro Carvalho Chehab2ba890e2008-04-17 21:42:58 -03001326 case CHIP_ID_EM2883:
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001327 em28xx_info("chip ID is em2882/em2883\n");
1328 dev->wait_after_write = 0;
1329 break;
1330 default:
1331 em28xx_info("em28xx chip ID = %d\n", rc);
1332 }
1333 }
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001334 em28xx_set_model(dev);
1335
Markus Rechbergera94e95b2006-01-23 17:11:10 -02001336 /* request some modules */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001337 switch (dev->model) {
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001338 case EM2880_BOARD_TERRATEC_PRODIGY_XS:
1339 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001340 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001341 case EM2860_BOARD_TERRATEC_HYBRID_XS:
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001342 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001343 case EM2880_BOARD_PINNACLE_PCTV_HD_PRO:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001344 case EM2882_BOARD_PINNACLE_HYBRID_PRO:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001345 case EM2883_BOARD_KWORLD_HYBRID_A316:
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001346 case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600:
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001347 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1);
Mauro Carvalho Chehab41facaa2008-04-17 21:44:58 -03001348 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001349 msleep(50);
Markus Rechbergera94e95b2006-01-23 17:11:10 -02001350
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001351 /* Sets GPO/GPIO sequences for this device */
1352 dev->analog_gpio = hauppauge_wintv_hvr_900_analog;
1353 dev->digital_gpio = hauppauge_wintv_hvr_900_digital;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001354 dev->tun_analog_gpio = default_callback;
1355 dev->tun_digital_gpio = default_callback;
1356 break;
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001357
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001358 case EM2882_BOARD_TERRATEC_HYBRID_XS:
1359 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1);
1360 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
1361 msleep(50);
1362
1363 /* should be added ir_codes here */
1364
1365 /* Sets GPO/GPIO sequences for this device */
1366 dev->analog_gpio = hauppauge_wintv_hvr_900_analog;
1367 dev->digital_gpio = hauppauge_wintv_hvr_900_digital;
1368 dev->tun_analog_gpio = default_callback;
1369 dev->tun_digital_gpio = em2882_terratec_hybrid_xs_digital;
1370 break;
1371
1372 case EM2880_BOARD_TERRATEC_HYBRID_XS_FR:
1373 case EM2880_BOARD_TERRATEC_HYBRID_XS:
1374 case EM2870_BOARD_TERRATEC_XS:
1375 case EM2881_BOARD_PINNACLE_HYBRID_PRO:
1376 case EM2880_BOARD_KWORLD_DVB_310U:
1377 case EM2870_BOARD_KWORLD_350U:
1378 case EM2881_BOARD_DNT_DA2_HYBRID:
1379 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1);
1380 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
1381 msleep(50);
1382
1383 /* NOTE: EM2881_DNT_DA2_HYBRID spend 140 msleep for digital
1384 and analog commands. If this commands doesn't work,
1385 add this timer. */
1386
1387 /* Sets GPO/GPIO sequences for this device */
1388 dev->analog_gpio = default_analog;
1389 dev->digital_gpio = default_digital;
1390 dev->tun_analog_gpio = default_callback;
1391 dev->tun_digital_gpio = default_callback;
1392 break;
1393
1394 case EM2880_BOARD_MSI_DIGIVOX_AD:
1395 case EM2880_BOARD_MSI_DIGIVOX_AD_II:
1396 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1);
1397 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
1398 msleep(50);
1399
1400 /* Sets GPO/GPIO sequences for this device */
1401 dev->analog_gpio = em2880_msi_digivox_ad_analog;
1402 dev->digital_gpio = em2880_msi_digivox_ad_digital;
1403 dev->tun_analog_gpio = default_callback;
1404 dev->tun_digital_gpio = default_callback;
1405 break;
1406
1407 case EM2750_BOARD_UNKNOWN:
1408 case EM2750_BOARD_DLCW_130:
1409 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x0a", 1);
1410 break;
1411
1412 case EM2861_BOARD_PLEXTOR_PX_TV100U:
1413 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1);
1414 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
1415 /* FIXME guess */
1416 /* Turn on analog audio output */
1417 em28xx_write_regs_req(dev, 0x00, 0x08, "\xfd", 1);
1418 break;
1419
1420 case EM2861_BOARD_KWORLD_PVRTV_300U:
1421 case EM2880_BOARD_KWORLD_DVB_305U:
1422 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1);
1423 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x4c", 1);
1424 msleep(10);
1425 em28xx_write_regs(dev, 0x08, "\x6d", 1);
1426 msleep(10);
1427 em28xx_write_regs(dev, 0x08, "\x7d", 1);
1428 msleep(10);
1429 break;
1430
1431 case EM2870_BOARD_KWORLD_355U:
1432 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1);
1433 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
1434 msleep(50);
1435
1436 /* Sets GPO/GPIO sequences for this device */
1437 dev->digital_gpio = em2870_kworld_355u_digital;
1438 break;
1439
1440 case EM2870_BOARD_COMPRO_VIDEOMATE:
1441 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1);
1442 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
1443 /* TODO: someone can do some cleanup here...
1444 not everything's needed */
1445 em28xx_write_regs(dev, 0x04, "\x00", 1);
1446 msleep(10);
1447 em28xx_write_regs(dev, 0x04, "\x01", 1);
1448 msleep(10);
1449 em28xx_write_regs(dev, 0x08, "\xfd", 1);
1450 mdelay(70);
1451 em28xx_write_regs(dev, 0x08, "\xfc", 1);
1452 mdelay(70);
1453 em28xx_write_regs(dev, 0x08, "\xdc", 1);
1454 mdelay(70);
1455 em28xx_write_regs(dev, 0x08, "\xfc", 1);
1456 mdelay(70);
1457 break;
1458
1459 case EM2870_BOARD_TERRATEC_XS_MT2060:
1460 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1);
1461 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
1462 /* this device needs some gpio writes to get the DVB-T
1463 demod work */
1464 em28xx_write_regs(dev, 0x08, "\xfe", 1);
1465 mdelay(70);
1466 em28xx_write_regs(dev, 0x08, "\xde", 1);
1467 mdelay(70);
1468 dev->em28xx_write_regs(dev, 0x08, "\xfe", 1);
1469 mdelay(70);
1470 break;
1471
1472 case EM2870_BOARD_PINNACLE_PCTV_DVB:
1473 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
1474 /* this device needs some gpio writes to get the
1475 DVB-T demod work */
1476 em28xx_write_regs(dev, 0x08, "\xfe", 1);
1477 mdelay(70);
1478 em28xx_write_regs(dev, 0x08, "\xde", 1);
1479 mdelay(70);
1480 em28xx_write_regs(dev, 0x08, "\xfe", 1);
1481 mdelay(70);
1482 /* switch em2880 rc protocol */
1483 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x22", 1);
1484 /* should be added ir_codes here */
1485 break;
1486
1487 case EM2820_BOARD_GADMEI_UTV310:
1488 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1);
1489 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
1490 /* Turn on analog audio output */
1491 em28xx_write_regs_req(dev, 0x00, 0x08, "\xfd", 1);
1492 break;
1493
1494 case EM2860_BOARD_GADMEI_UTV330:
1495 /* Turn on IR */
1496 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x07", 1);
1497 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
1498 /* should be added ir_codes here */
1499 break;
1500
1501 case EM2820_BOARD_MSI_VOX_USB_2:
1502 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1);
1503 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
1504 /* enables audio for that device */
1505 em28xx_write_regs_req(dev, 0x00, 0x08, "\xfd", 1);
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001506 break;
1507 }
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001508
1509 em28xx_gpio_set(dev, dev->tun_analog_gpio);
1510 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
1511
1512 /* Unlock device */
1513 em28xx_set_mode(dev, EM28XX_MODE_UNDEFINED);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001514}
1515
Mauro Carvalho Chehabe54318e2008-04-18 18:34:31 -03001516static void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl)
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03001517{
1518 memset(ctl, 0, sizeof(*ctl));
1519
1520 ctl->fname = XC2028_DEFAULT_FIRMWARE;
1521 ctl->max_len = 64;
1522 ctl->mts = em28xx_boards[dev->model].mts_firmware;
1523
1524 switch (dev->model) {
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03001525 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
1526 ctl->demod = XC3028_FE_ZARLINK456;
1527 break;
reinhard schwab655b8402008-07-26 10:47:00 -03001528 case EM2880_BOARD_TERRATEC_HYBRID_XS:
1529 ctl->demod = XC3028_FE_ZARLINK456;
1530 break;
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001531 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
1532 /* djh - Not sure which demod we need here */
1533 ctl->demod = XC3028_FE_DEFAULT;
1534 break;
Devin Heitmueller5ea7fe42008-09-16 02:02:12 -03001535 case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600:
1536 ctl->demod = XC3028_FE_DEFAULT;
1537 ctl->fname = XC3028L_DEFAULT_FIRMWARE;
1538 break;
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001539 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001540 case EM2880_BOARD_PINNACLE_PCTV_HD_PRO:
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03001541 /* FIXME: Better to specify the needed IF */
Devin Heitmuellerbdfbf952008-04-17 21:38:27 -03001542 ctl->demod = XC3028_FE_DEFAULT;
1543 break;
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03001544 default:
1545 ctl->demod = XC3028_FE_OREN538;
1546 }
1547}
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03001548
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001549static void em28xx_config_tuner(struct em28xx *dev)
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001550{
1551 struct v4l2_priv_tun_config xc2028_cfg;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001552 struct tuner_setup tun_setup;
1553 struct v4l2_frequency f;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001554
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03001555 if (dev->tuner_type == TUNER_ABSENT)
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001556 return;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001557
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001558 tun_setup.mode_mask = T_ANALOG_TV | T_RADIO;
1559 tun_setup.type = dev->tuner_type;
1560 tun_setup.addr = dev->tuner_addr;
1561 tun_setup.tuner_callback = em28xx_tuner_callback;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001562
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001563 em28xx_i2c_call_clients(dev, TUNER_SET_TYPE_ADDR, &tun_setup);
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001564
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001565 if (dev->tuner_type == TUNER_XC2028) {
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03001566 struct xc2028_ctrl ctl;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001567
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03001568 em28xx_setup_xc3028(dev, &ctl);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001569
1570 xc2028_cfg.tuner = TUNER_XC2028;
1571 xc2028_cfg.priv = &ctl;
1572
1573 em28xx_i2c_call_clients(dev, TUNER_SET_CONFIG, &xc2028_cfg);
1574 }
1575
1576 /* configure tuner */
1577 f.tuner = 0;
1578 f.type = V4L2_TUNER_ANALOG_TV;
1579 f.frequency = 9076; /* just a magic number */
1580 dev->ctl_freq = f.frequency;
1581 em28xx_i2c_call_clients(dev, VIDIOC_S_FREQUENCY, &f);
1582}
1583
1584static int em28xx_hint_board(struct em28xx *dev)
1585{
1586 int i;
1587
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03001588 /* HINT method: EEPROM
1589 *
1590 * This method works only for boards with eeprom.
1591 * Uses a hash of all eeprom bytes. The hash should be
1592 * unique for a vendor/tuner pair.
1593 * There are a high chance that tuners for different
1594 * video standards produce different hashes.
1595 */
1596 for (i = 0; i < ARRAY_SIZE(em28xx_eeprom_hash); i++) {
1597 if (dev->hash == em28xx_eeprom_hash[i].hash) {
1598 dev->model = em28xx_eeprom_hash[i].model;
1599 dev->tuner_type = em28xx_eeprom_hash[i].tuner;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001600
1601 em28xx_errdev("Your board has no unique USB ID.\n");
1602 em28xx_errdev("A hint were successfully done, "
1603 "based on eeprom hash.\n");
1604 em28xx_errdev("This method is not 100%% failproof.\n");
1605 em28xx_errdev("If the board were missdetected, "
1606 "please email this log to:\n");
1607 em28xx_errdev("\tV4L Mailing List "
1608 " <video4linux-list@redhat.com>\n");
1609 em28xx_errdev("Board detected as %s\n",
1610 em28xx_boards[dev->model].name);
1611
1612 return 0;
1613 }
1614 }
Sascha Sommerfad7b952007-11-04 08:06:48 -03001615
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03001616 /* HINT method: I2C attached devices
1617 *
1618 * This method works for all boards.
1619 * Uses a hash of i2c scanned devices.
1620 * Devices with the same i2c attached chips will
1621 * be considered equal.
1622 * This method is less precise than the eeprom one.
1623 */
1624
Sascha Sommerfad7b952007-11-04 08:06:48 -03001625 /* user did not request i2c scanning => do it now */
1626 if (!dev->i2c_hash)
1627 em28xx_do_i2c_scan(dev);
1628
1629 for (i = 0; i < ARRAY_SIZE(em28xx_i2c_hash); i++) {
1630 if (dev->i2c_hash == em28xx_i2c_hash[i].hash) {
1631 dev->model = em28xx_i2c_hash[i].model;
1632 dev->tuner_type = em28xx_i2c_hash[i].tuner;
1633 em28xx_errdev("Your board has no unique USB ID.\n");
1634 em28xx_errdev("A hint were successfully done, "
1635 "based on i2c devicelist hash.\n");
1636 em28xx_errdev("This method is not 100%% failproof.\n");
1637 em28xx_errdev("If the board were missdetected, "
1638 "please email this log to:\n");
1639 em28xx_errdev("\tV4L Mailing List "
1640 " <video4linux-list@redhat.com>\n");
1641 em28xx_errdev("Board detected as %s\n",
1642 em28xx_boards[dev->model].name);
1643
1644 return 0;
1645 }
1646 }
1647
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001648 em28xx_errdev("Your board has no unique USB ID and thus need a "
1649 "hint to be detected.\n");
1650 em28xx_errdev("You may try to use card=<n> insmod option to "
1651 "workaround that.\n");
1652 em28xx_errdev("Please send an email with this log to:\n");
1653 em28xx_errdev("\tV4L Mailing List <video4linux-list@redhat.com>\n");
1654 em28xx_errdev("Board eeprom hash is 0x%08lx\n", dev->hash);
Sascha Sommerfad7b952007-11-04 08:06:48 -03001655 em28xx_errdev("Board i2c devicelist hash is 0x%08lx\n", dev->i2c_hash);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001656
1657 em28xx_errdev("Here is a list of valid choices for the card=<n>"
1658 " insmod option:\n");
1659 for (i = 0; i < em28xx_bcount; i++) {
1660 em28xx_errdev(" card=%d -> %s\n",
1661 i, em28xx_boards[i].name);
1662 }
1663 return -1;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001664}
1665
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001666/* ----------------------------------------------------------------------- */
1667void em28xx_set_ir(struct em28xx *dev, struct IR_i2c *ir)
1668{
1669 if (disable_ir) {
1670 ir->get_key = NULL;
1671 return ;
1672 }
1673
1674 /* detect & configure */
1675 switch (dev->model) {
1676 case (EM2800_BOARD_UNKNOWN):
1677 break;
1678 case (EM2820_BOARD_UNKNOWN):
1679 break;
1680 case (EM2800_BOARD_TERRATEC_CINERGY_200):
1681 case (EM2820_BOARD_TERRATEC_CINERGY_250):
1682 ir->ir_codes = ir_codes_em_terratec;
1683 ir->get_key = em28xx_get_key_terratec;
1684 snprintf(ir->c.name, sizeof(ir->c.name),
1685 "i2c IR (EM28XX Terratec)");
1686 break;
1687 case (EM2820_BOARD_PINNACLE_USB_2):
1688 ir->ir_codes = ir_codes_pinnacle_grey;
1689 ir->get_key = em28xx_get_key_pinnacle_usb_grey;
1690 snprintf(ir->c.name, sizeof(ir->c.name),
1691 "i2c IR (EM28XX Pinnacle PCTV)");
1692 break;
1693 case (EM2820_BOARD_HAUPPAUGE_WINTV_USB_2):
1694 ir->ir_codes = ir_codes_hauppauge_new;
1695 ir->get_key = em28xx_get_key_em_haup;
1696 snprintf(ir->c.name, sizeof(ir->c.name),
1697 "i2c IR (EM2840 Hauppauge)");
1698 break;
1699 case (EM2820_BOARD_MSI_VOX_USB_2):
1700 break;
1701 case (EM2800_BOARD_LEADTEK_WINFAST_USBII):
1702 break;
1703 case (EM2800_BOARD_KWORLD_USB2800):
1704 break;
Aron Szabo59d07f12008-07-27 13:47:52 -03001705 case (EM2800_BOARD_GRABBEEX_USB2800):
1706 break;
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001707 }
1708}
1709
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001710void em28xx_card_setup(struct em28xx *dev)
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001711{
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03001712 em28xx_set_model(dev);
1713
1714 dev->tuner_type = em28xx_boards[dev->model].tuner_type;
1715
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001716 /* request some modules */
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001717 switch (dev->model) {
1718 case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2:
Mauro Carvalho Chehab98ae1272007-11-05 09:30:39 -03001719 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001720 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001721 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001722 {
1723 struct tveeprom tv;
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001724#ifdef CONFIG_MODULES
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001725 request_module("tveeprom");
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001726#endif
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001727 /* Call first TVeeprom */
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001728
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001729 dev->i2c_client.addr = 0xa0 >> 1;
1730 tveeprom_hauppauge_analog(&dev->i2c_client, &tv, dev->eedata);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001731
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001732 dev->tuner_type = tv.tuner_type;
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03001733
Hans Verkuil38f9d302008-07-23 05:09:15 -03001734 if (tv.audio_processor == V4L2_IDENT_MSPX4XX) {
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001735 dev->i2s_speed = 2048000;
1736 dev->has_msp34xx = 1;
1737 }
Mauro Carvalho Chehab98ae1272007-11-05 09:30:39 -03001738#ifdef CONFIG_MODULES
1739 if (tv.has_ir)
1740 request_module("ir-kbd-i2c");
1741#endif
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001742 break;
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001743 }
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001744 case EM2820_BOARD_KWORLD_PVRTV2800RF:
1745 /* GPIO enables sound on KWORLD PVR TV 2800RF */
1746 em28xx_write_regs_req(dev, 0x00, 0x08, "\xf9", 1);
1747 break;
1748 case EM2820_BOARD_UNKNOWN:
1749 case EM2800_BOARD_UNKNOWN:
Darron Broadda3808e2008-09-30 02:46:41 -03001750 /*
1751 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD.
1752 *
1753 * This occurs because they share identical USB vendor and
1754 * product IDs.
1755 *
1756 * What we do here is look up the EEPROM hash of the K-WORLD
1757 * and if it is found then we decide that we do not have
1758 * a DIGIVOX and reset the device to the K-WORLD instead.
1759 *
1760 * This solution is only valid if they do not share eeprom
1761 * hash identities which has not been determined as yet.
1762 */
1763 case EM2880_BOARD_MSI_DIGIVOX_AD:
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03001764 if (!em28xx_hint_board(dev))
1765 em28xx_set_model(dev);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001766 break;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001767 }
1768
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001769 if (dev->has_snapshot_button)
1770 em28xx_register_snapshot_button(dev);
1771
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001772 if (dev->valid == EM28XX_BOARD_NOT_VALIDATED) {
1773 em28xx_errdev("\n\n");
1774 em28xx_errdev("The support for this board weren't "
1775 "valid yet.\n");
1776 em28xx_errdev("Please send a report of having this working\n");
1777 em28xx_errdev("not to V4L mailing list (and/or to other "
1778 "addresses)\n\n");
1779 }
1780
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03001781 /* Allow override tuner type by a module parameter */
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001782 if (tuner >= 0)
1783 dev->tuner_type = tuner;
1784
1785#ifdef CONFIG_MODULES
1786 /* request some modules */
1787 if (dev->has_msp34xx)
1788 request_module("msp3400");
1789 if (dev->decoder == EM28XX_SAA7113 || dev->decoder == EM28XX_SAA7114)
1790 request_module("saa7115");
1791 if (dev->decoder == EM28XX_TVP5150)
1792 request_module("tvp5150");
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03001793 if (dev->tuner_type != TUNER_ABSENT)
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001794 request_module("tuner");
1795#endif
1796
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001797 em28xx_config_tuner(dev);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001798}