blob: e3e965defd5acf899487d5b31b89d1784584074d [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 },
96 [EM2800_BOARD_KWORLD_USB2800] = {
97 .name = "Kworld USB2800",
98 .valid = EM28XX_BOARD_NOT_VALIDATED,
99 .is_em2800 = 1,
100 .vchannels = 3,
101 .tuner_type = TUNER_PHILIPS_FCV1236D,
102 .tda9887_conf = TDA9887_PRESENT,
103 .decoder = EM28XX_SAA7113,
104 .input = { {
105 .type = EM28XX_VMUX_TELEVISION,
106 .vmux = SAA7115_COMPOSITE2,
107 .amux = 0,
108 }, {
109 .type = EM28XX_VMUX_COMPOSITE1,
110 .vmux = SAA7115_COMPOSITE0,
111 .amux = 1,
112 }, {
113 .type = EM28XX_VMUX_SVIDEO,
114 .vmux = SAA7115_SVIDEO3,
115 .amux = 1,
116 } },
117 },
Markus Rechberger4d17d082006-02-07 06:25:39 -0200118 [EM2820_BOARD_KWORLD_PVRTV2800RF] = {
Markus Rechberger33ccaa32006-02-07 06:25:41 -0200119 .name = "Kworld PVR TV 2800 RF",
Markus Rechberger4d17d082006-02-07 06:25:39 -0200120 .is_em2800 = 0,
121 .vchannels = 2,
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -0300122 .tuner_type = TUNER_TEMIC_PAL,
Markus Rechberger4d17d082006-02-07 06:25:39 -0200123 .tda9887_conf = TDA9887_PRESENT,
Markus Rechberger4d17d082006-02-07 06:25:39 -0200124 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300125 .input = { {
Markus Rechberger4d17d082006-02-07 06:25:39 -0200126 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300127 .vmux = SAA7115_COMPOSITE0,
Markus Rechberger4d17d082006-02-07 06:25:39 -0200128 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300129 }, {
Markus Rechberger4d17d082006-02-07 06:25:39 -0200130 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300131 .vmux = SAA7115_SVIDEO3,
Markus Rechberger4d17d082006-02-07 06:25:39 -0200132 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300133 } },
Markus Rechberger4d17d082006-02-07 06:25:39 -0200134 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800135 [EM2820_BOARD_TERRATEC_CINERGY_250] = {
136 .name = "Terratec Cinergy 250 USB",
137 .vchannels = 3,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800138 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
139 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800140 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300141 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800142 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300143 .vmux = SAA7115_COMPOSITE2,
Markus Rechberger9475fb12006-02-27 00:07:34 -0300144 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300145 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800146 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300147 .vmux = SAA7115_COMPOSITE0,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800148 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300149 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800150 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300151 .vmux = SAA7115_SVIDEO3,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800152 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300153 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800154 },
155 [EM2820_BOARD_PINNACLE_USB_2] = {
156 .name = "Pinnacle PCTV USB 2",
157 .vchannels = 3,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800158 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
159 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800160 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300161 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800162 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300163 .vmux = SAA7115_COMPOSITE2,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800164 .amux = 0,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300165 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800166 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300167 .vmux = SAA7115_COMPOSITE0,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800168 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300169 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800170 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300171 .vmux = SAA7115_SVIDEO3,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800172 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300173 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800174 },
175 [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2] = {
176 .name = "Hauppauge WinTV USB 2",
177 .vchannels = 3,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800178 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300179 .tda9887_conf = TDA9887_PRESENT |
180 TDA9887_PORT1_ACTIVE|
181 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800182 .decoder = EM28XX_TVP5150,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800183 .has_msp34xx = 1,
184 /*FIXME: S-Video not tested */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300185 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800186 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300187 .vmux = TVP5150_COMPOSITE0,
Hans Verkuil2474ed42006-03-19 12:35:57 -0300188 .amux = MSP_INPUT_DEFAULT,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300189 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800190 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300191 .vmux = TVP5150_SVIDEO,
Hans Verkuil07151722006-04-01 18:03:23 -0300192 .amux = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1,
193 MSP_DSP_IN_SCART, MSP_DSP_IN_SCART),
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300194 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800195 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300196 [EM2820_BOARD_DLINK_USB_TV] = {
197 .name = "D-Link DUB-T210 TV Tuner",
198 .valid = EM28XX_BOARD_NOT_VALIDATED,
199 .vchannels = 3,
200 .is_em2800 = 0,
201 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
202 .tda9887_conf = TDA9887_PRESENT,
203 .decoder = EM28XX_SAA7113,
204 .input = { {
205 .type = EM28XX_VMUX_TELEVISION,
206 .vmux = SAA7115_COMPOSITE2,
207 .amux = 1,
208 }, {
209 .type = EM28XX_VMUX_COMPOSITE1,
210 .vmux = SAA7115_COMPOSITE0,
211 .amux = 1,
212 }, {
213 .type = EM28XX_VMUX_SVIDEO,
214 .vmux = SAA7115_SVIDEO3,
215 .amux = 1,
216 } },
217 },
218 [EM2820_BOARD_HERCULES_SMART_TV_USB2] = {
219 .name = "Hercules Smart TV USB 2.0",
220 .valid = EM28XX_BOARD_NOT_VALIDATED,
221 .vchannels = 3,
222 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
223 .tda9887_conf = TDA9887_PRESENT,
224 .decoder = EM28XX_SAA7113,
225 .input = { {
226 .type = EM28XX_VMUX_TELEVISION,
227 .vmux = SAA7115_COMPOSITE2,
228 .amux = 1,
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_PINNACLE_USB_2_FM1216ME] = {
240 .name = "Pinnacle PCTV USB 2 (Philips FM1216ME)",
241 .valid = EM28XX_BOARD_NOT_VALIDATED,
242 .vchannels = 3,
243 .is_em2800 = 0,
244 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
245 .tda9887_conf = TDA9887_PRESENT,
246 .decoder = EM28XX_SAA7113,
247 .input = { {
248 .type = EM28XX_VMUX_TELEVISION,
249 .vmux = SAA7115_COMPOSITE2,
250 .amux = 0,
251 }, {
252 .type = EM28XX_VMUX_COMPOSITE1,
253 .vmux = SAA7115_COMPOSITE0,
254 .amux = 1,
255 }, {
256 .type = EM28XX_VMUX_SVIDEO,
257 .vmux = SAA7115_SVIDEO3,
258 .amux = 1,
259 } },
260 },
261 [EM2820_BOARD_GADMEI_UTV310] = {
262 .name = "Gadmei UTV310",
263 .valid = EM28XX_BOARD_NOT_VALIDATED,
264 .vchannels = 3,
265 .tuner_type = TUNER_TNF_5335MF,
266 .tda9887_conf = TDA9887_PRESENT,
267 .decoder = EM28XX_SAA7113,
268 .input = { {
269 .type = EM28XX_VMUX_TELEVISION,
270 .vmux = SAA7115_COMPOSITE1,
271 .amux = 1,
272 }, {
273 .type = EM28XX_VMUX_COMPOSITE1,
274 .vmux = SAA7115_COMPOSITE0,
275 .amux = 1,
276 }, {
277 .type = EM28XX_VMUX_SVIDEO,
278 .vmux = SAA7115_SVIDEO3,
279 .amux = 1,
280 } },
281 },
282 [EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE] = {
283 .name = "Leadtek Winfast USB II Deluxe",
284 .valid = EM28XX_BOARD_NOT_VALIDATED,
285 .vchannels = 3,
286 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
287 .tda9887_conf = TDA9887_PRESENT,
288 .decoder = EM28XX_SAA7114,
289 .input = { {
290 .type = EM28XX_VMUX_TELEVISION,
291 .vmux = 2,
292 .amux = 0,
293 }, {
294 .type = EM28XX_VMUX_COMPOSITE1,
295 .vmux = 0,
296 .amux = 1,
297 }, {
298 .type = EM28XX_VMUX_SVIDEO,
299 .vmux = 9,
300 .amux = 1,
301 } },
302 },
303 [EM2820_BOARD_PINNACLE_DVC_100] = {
304 .name = "Pinnacle Dazzle DVC 100",
305 .valid = EM28XX_BOARD_NOT_VALIDATED,
306 .vchannels = 3,
307 .decoder = EM28XX_SAA7113,
308 .input = { {
309 .type = EM28XX_VMUX_COMPOSITE1,
310 .vmux = SAA7115_COMPOSITE0,
311 .amux = 1,
312 }, {
313 .type = EM28XX_VMUX_SVIDEO,
314 .vmux = SAA7115_SVIDEO3,
315 .amux = 1,
316 } },
317 },
318 [EM2820_BOARD_VIDEOLOGY_20K14XUSB] = {
319 .name = "Videology 20K14XUSB USB2.0",
320 .valid = EM28XX_BOARD_NOT_VALIDATED,
321 .vchannels = 1,
322 .input = { {
323 .type = EM28XX_VMUX_COMPOSITE1,
324 .vmux = 0,
325 .amux = 0,
326 } },
327 },
328 [EM2821_BOARD_PROLINK_PLAYTV_USB2] = {
329 .name = "SIIG AVTuner-PVR/Prolink PlayTV USB 2.0",
330 .valid = EM28XX_BOARD_NOT_VALIDATED,
331 .vchannels = 3,
332 .is_em2800 = 0,
333 .tuner_type = TUNER_LG_PAL_NEW_TAPC, /* unknown? */
334 .tda9887_conf = TDA9887_PRESENT, /* unknown? */
335 .decoder = EM28XX_SAA7113,
336 .input = { {
337 .type = EM28XX_VMUX_TELEVISION,
338 .vmux = SAA7115_COMPOSITE2,
339 .amux = 1,
340 }, {
341 .type = EM28XX_VMUX_COMPOSITE1,
342 .vmux = SAA7115_COMPOSITE0,
343 .amux = 1,
344 }, {
345 .type = EM28XX_VMUX_SVIDEO,
346 .vmux = SAA7115_SVIDEO3,
347 .amux = 1,
348 } },
349 },
350 [EM2821_BOARD_SUPERCOMP_USB_2] = {
351 .name = "Supercomp USB 2.0 TV",
352 .valid = EM28XX_BOARD_NOT_VALIDATED,
353 .vchannels = 3,
354 .is_em2800 = 0,
355 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
356 .tda9887_conf = TDA9887_PRESENT |
357 TDA9887_PORT1_ACTIVE |
358 TDA9887_PORT2_ACTIVE,
359 .decoder = EM28XX_SAA7113,
360 .input = { {
361 .type = EM28XX_VMUX_TELEVISION,
362 .vmux = SAA7115_COMPOSITE2,
363 .amux = 1,
364 }, {
365 .type = EM28XX_VMUX_COMPOSITE1,
366 .vmux = SAA7115_COMPOSITE0,
367 .amux = 0,
368 }, {
369 .type = EM28XX_VMUX_SVIDEO,
370 .vmux = SAA7115_SVIDEO3,
371 .amux = 1,
372 } },
373 },
374 [EM2821_BOARD_USBGEAR_VD204] = {
375 .name = "Usbgear VD204v9",
376 .valid = EM28XX_BOARD_NOT_VALIDATED,
377 .vchannels = 2,
378 .decoder = EM28XX_SAA7113,
379 .input = { {
380 .type = EM28XX_VMUX_COMPOSITE1,
381 .vmux = SAA7115_COMPOSITE0,
382 .amux = 1,
383 }, {
384 .type = EM28XX_VMUX_SVIDEO,
385 .vmux = SAA7115_SVIDEO3,
386 .amux = 1,
387 } },
388 },
389 [EM2860_BOARD_NETGMBH_CAM] = {
390 /* Beijing Huaqi Information Digital Technology Co., Ltd */
391 .name = "NetGMBH Cam",
392 .valid = EM28XX_BOARD_NOT_VALIDATED,
393 .vchannels = 1,
394 .input = { {
395 .type = EM28XX_VMUX_COMPOSITE1,
396 .vmux = 0,
397 .amux = 0,
398 } },
399 },
400 [EM2860_BOARD_TYPHOON_DVD_MAKER] = {
401 .name = "Typhoon DVD Maker",
402 .valid = EM28XX_BOARD_NOT_VALIDATED,
403 .vchannels = 2,
404 .decoder = EM28XX_SAA7113,
405 .input = { {
406 .type = EM28XX_VMUX_COMPOSITE1,
407 .vmux = SAA7115_COMPOSITE0,
408 .amux = 1,
409 }, {
410 .type = EM28XX_VMUX_SVIDEO,
411 .vmux = SAA7115_SVIDEO3,
412 .amux = 1,
413 } },
414 },
415 [EM2860_BOARD_GADMEI_UTV330] = {
416 .name = "Gadmei UTV330",
417 .valid = EM28XX_BOARD_NOT_VALIDATED,
418 .vchannels = 3,
419 .tuner_type = TUNER_TNF_5335MF,
420 .tda9887_conf = TDA9887_PRESENT,
421 .decoder = EM28XX_SAA7113,
422 .input = { {
423 .type = EM28XX_VMUX_TELEVISION,
424 .vmux = SAA7115_COMPOSITE2,
425 .amux = 0,
426 }, {
427 .type = EM28XX_VMUX_COMPOSITE1,
428 .vmux = SAA7115_COMPOSITE0,
429 .amux = 1,
430 }, {
431 .type = EM28XX_VMUX_SVIDEO,
432 .vmux = SAA7115_SVIDEO3,
433 .amux = 1,
434 } },
435 },
436 [EM2860_BOARD_TERRATEC_HYBRID_XS] = {
437 .name = "Terratec Cinergy A Hybrid XS",
438 .valid = EM28XX_BOARD_NOT_VALIDATED,
439 .vchannels = 3,
440 .tuner_type = TUNER_XC2028,
441 .decoder = EM28XX_TVP5150,
442 .input = { {
443 .type = EM28XX_VMUX_TELEVISION,
444 .vmux = TVP5150_COMPOSITE0,
445 .amux = 0,
446 }, {
447 .type = EM28XX_VMUX_COMPOSITE1,
448 .vmux = TVP5150_COMPOSITE1,
449 .amux = 1,
450 }, {
451 .type = EM28XX_VMUX_SVIDEO,
452 .vmux = TVP5150_SVIDEO,
453 .amux = 1,
454 } },
455 },
456 [EM2861_BOARD_KWORLD_PVRTV_300U] = {
457 .name = "KWorld PVRTV 300U",
458 .valid = EM28XX_BOARD_NOT_VALIDATED,
459 .vchannels = 3,
460 .tuner_type = TUNER_XC2028,
461 .decoder = EM28XX_TVP5150,
462 .input = { {
463 .type = EM28XX_VMUX_TELEVISION,
464 .vmux = TVP5150_COMPOSITE0,
465 .amux = 0,
466 }, {
467 .type = EM28XX_VMUX_COMPOSITE1,
468 .vmux = TVP5150_COMPOSITE1,
469 .amux = 1,
470 }, {
471 .type = EM28XX_VMUX_SVIDEO,
472 .vmux = TVP5150_SVIDEO,
473 .amux = 1,
474 } },
475 },
476 [EM2861_BOARD_YAKUMO_MOVIE_MIXER] = {
477 .name = "Yakumo MovieMixer",
478 .valid = EM28XX_BOARD_NOT_VALIDATED,
479 .vchannels = 1,
480 .decoder = EM28XX_TVP5150,
481 .input = { {
482 .type = EM28XX_VMUX_TELEVISION,
483 .vmux = TVP5150_COMPOSITE0,
484 .amux = 0,
485 }, {
486 .type = EM28XX_VMUX_COMPOSITE1,
487 .vmux = TVP5150_COMPOSITE1,
488 .amux = 1,
489 }, {
490 .type = EM28XX_VMUX_SVIDEO,
491 .vmux = TVP5150_SVIDEO,
492 .amux = 1,
493 } },
494 },
495 [EM2861_BOARD_PLEXTOR_PX_TV100U] = {
496 .name = "Plextor ConvertX PX-TV100U",
497 .valid = EM28XX_BOARD_NOT_VALIDATED,
498 .vchannels = 3,
499 .tuner_type = TUNER_TNF_5335MF,
500 .tda9887_conf = TDA9887_PRESENT,
501 .decoder = EM28XX_TVP5150,
502 .input = { {
503 .type = EM28XX_VMUX_TELEVISION,
504 .vmux = TVP5150_COMPOSITE0,
505 .amux = 1,
506 }, {
507 .type = EM28XX_VMUX_COMPOSITE1,
508 .vmux = TVP5150_COMPOSITE1,
509 .amux = 1,
510 }, {
511 .type = EM28XX_VMUX_SVIDEO,
512 .vmux = TVP5150_SVIDEO,
513 .amux = 1,
514 } },
515 },
516 [EM2870_BOARD_TERRATEC_XS] = {
517 .name = "Terratec Cinergy T XS",
518 .valid = EM28XX_BOARD_NOT_VALIDATED,
519 .tuner_type = TUNER_XC2028,
520 },
521 [EM2870_BOARD_TERRATEC_XS_MT2060] = {
522 .name = "Terratec Cinergy T XS (MT2060)",
523 .valid = EM28XX_BOARD_NOT_VALIDATED,
524 .tuner_type = TUNER_ABSENT, /* MT2060 */
525 },
526 [EM2870_BOARD_KWORLD_350U] = {
527 .name = "Kworld 350 U DVB-T",
528 .valid = EM28XX_BOARD_NOT_VALIDATED,
529 .tuner_type = TUNER_XC2028,
530 },
531 [EM2870_BOARD_KWORLD_355U] = {
532 .name = "Kworld 355 U DVB-T",
533 .valid = EM28XX_BOARD_NOT_VALIDATED,
534 },
535 [EM2870_BOARD_PINNACLE_PCTV_DVB] = {
536 .name = "Pinnacle PCTV DVB-T",
537 .valid = EM28XX_BOARD_NOT_VALIDATED,
538 .tuner_type = TUNER_ABSENT, /* MT2060 */
539 },
540 [EM2870_BOARD_COMPRO_VIDEOMATE] = {
541 .name = "Compro, VideoMate U3",
542 .valid = EM28XX_BOARD_NOT_VALIDATED,
543 .tuner_type = TUNER_ABSENT, /* MT2060 */
544 },
545 [EM2880_BOARD_TERRATEC_HYBRID_XS_FR] = {
546 .name = "Terratec Hybrid XS Secam",
547 .valid = EM28XX_BOARD_NOT_VALIDATED,
548 .vchannels = 3,
549 .has_msp34xx = 1,
550 .tuner_type = TUNER_XC2028,
551 .decoder = EM28XX_TVP5150,
552 .input = { {
553 .type = EM28XX_VMUX_TELEVISION,
554 .vmux = TVP5150_COMPOSITE0,
555 .amux = 0,
556 }, {
557 .type = EM28XX_VMUX_COMPOSITE1,
558 .vmux = TVP5150_COMPOSITE1,
559 .amux = 1,
560 }, {
561 .type = EM28XX_VMUX_SVIDEO,
562 .vmux = TVP5150_SVIDEO,
563 .amux = 1,
564 } },
565 },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300566 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900] = {
Aidan Thornton122d1582007-11-20 15:25:08 -0300567 .name = "Hauppauge WinTV HVR 900",
568 .vchannels = 3,
569 .tda9887_conf = TDA9887_PRESENT,
570 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab5add9a62007-11-22 12:08:53 -0300571 .mts_firmware = 1,
Devin Heitmuellerb38cc642008-06-09 14:59:05 -0300572 .has_dvb = 1,
Aidan Thornton122d1582007-11-20 15:25:08 -0300573 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300574 .input = { {
Aidan Thornton122d1582007-11-20 15:25:08 -0300575 .type = EM28XX_VMUX_TELEVISION,
576 .vmux = TVP5150_COMPOSITE0,
577 .amux = 0,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300578 }, {
Aidan Thornton122d1582007-11-20 15:25:08 -0300579 .type = EM28XX_VMUX_COMPOSITE1,
580 .vmux = TVP5150_COMPOSITE1,
581 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300582 }, {
Aidan Thornton122d1582007-11-20 15:25:08 -0300583 .type = EM28XX_VMUX_SVIDEO,
584 .vmux = TVP5150_SVIDEO,
585 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300586 } },
Aidan Thornton122d1582007-11-20 15:25:08 -0300587 },
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300588 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2] = {
589 .name = "Hauppauge WinTV HVR 900 (R2)",
590 .vchannels = 3,
591 .tda9887_conf = TDA9887_PRESENT,
592 .tuner_type = TUNER_XC2028,
593 .mts_firmware = 1,
594 .decoder = EM28XX_TVP5150,
595 .input = { {
596 .type = EM28XX_VMUX_TELEVISION,
597 .vmux = TVP5150_COMPOSITE0,
598 .amux = 0,
599 }, {
600 .type = EM28XX_VMUX_COMPOSITE1,
601 .vmux = TVP5150_COMPOSITE1,
602 .amux = 1,
603 }, {
604 .type = EM28XX_VMUX_SVIDEO,
605 .vmux = TVP5150_SVIDEO,
606 .amux = 1,
607 } },
608 },
Aidan Thornton122d1582007-11-20 15:25:08 -0300609 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950] = {
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -0300610 .name = "Hauppauge WinTV HVR 950",
611 .vchannels = 3,
612 .tda9887_conf = TDA9887_PRESENT,
613 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -0300614 .mts_firmware = 1,
615 .has_12mhz_i2s = 1,
Mauro Carvalho Chehab227ad4a2008-04-17 21:37:40 -0300616 .has_dvb = 1,
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -0300617 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300618 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300619 .type = EM28XX_VMUX_TELEVISION,
620 .vmux = TVP5150_COMPOSITE0,
621 .amux = 0,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300622 }, {
Mauro Carvalho Chehab7d070e22007-11-01 21:52:58 -0300623 .type = EM28XX_VMUX_COMPOSITE1,
624 .vmux = TVP5150_COMPOSITE1,
625 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300626 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300627 .type = EM28XX_VMUX_SVIDEO,
628 .vmux = TVP5150_SVIDEO,
629 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300630 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300631 },
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300632 [EM2880_BOARD_PINNACLE_PCTV_HD_PRO] = {
633 .name = "Pinnacle PCTV HD Pro Stick",
634 .vchannels = 3,
635 .tda9887_conf = TDA9887_PRESENT,
636 .tuner_type = TUNER_XC2028,
637 .mts_firmware = 1,
638 .has_12mhz_i2s = 1,
639 .has_dvb = 1,
640 .decoder = EM28XX_TVP5150,
641 .input = { {
642 .type = EM28XX_VMUX_TELEVISION,
643 .vmux = TVP5150_COMPOSITE0,
644 .amux = 0,
645 }, {
646 .type = EM28XX_VMUX_COMPOSITE1,
647 .vmux = TVP5150_COMPOSITE1,
648 .amux = 1,
649 }, {
650 .type = EM28XX_VMUX_SVIDEO,
651 .vmux = TVP5150_SVIDEO,
652 .amux = 1,
653 } },
654 },
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300655 [EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600] = {
656 .name = "AMD ATI TV Wonder HD 600",
657 .vchannels = 3,
658 .tda9887_conf = TDA9887_PRESENT,
659 .tuner_type = TUNER_XC2028,
660 .mts_firmware = 1,
661 .has_12mhz_i2s = 1,
662 .has_dvb = 1,
663 .decoder = EM28XX_TVP5150,
664 .input = { {
665 .type = EM28XX_VMUX_TELEVISION,
666 .vmux = TVP5150_COMPOSITE0,
667 .amux = 0,
668 }, {
669 .type = EM28XX_VMUX_COMPOSITE1,
670 .vmux = TVP5150_COMPOSITE1,
671 .amux = 1,
672 }, {
673 .type = EM28XX_VMUX_SVIDEO,
674 .vmux = TVP5150_SVIDEO,
675 .amux = 1,
676 } },
677 },
678 [EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600] = {
679 .name = "AMD ATI TV Wonder HD 600",
680 .vchannels = 3,
681 .tda9887_conf = TDA9887_PRESENT,
682 .tuner_type = TUNER_XC2028,
683 .mts_firmware = 1,
684 .has_12mhz_i2s = 1,
685 .has_dvb = 1,
686 .decoder = EM28XX_TVP5150,
687 .input = { {
688 .type = EM28XX_VMUX_TELEVISION,
689 .vmux = TVP5150_COMPOSITE0,
690 .amux = 0,
691 }, {
692 .type = EM28XX_VMUX_COMPOSITE1,
693 .vmux = TVP5150_COMPOSITE1,
694 .amux = 1,
695 }, {
696 .type = EM28XX_VMUX_SVIDEO,
697 .vmux = TVP5150_SVIDEO,
698 .amux = 1,
699 } },
700 },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300701 [EM2880_BOARD_TERRATEC_HYBRID_XS] = {
702 .name = "Terratec Hybrid XS",
703 .vchannels = 3,
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300704 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300705 .tuner_type = TUNER_XC2028,
706 .decoder = EM28XX_TVP5150,
reinhard schwab655b8402008-07-26 10:47:00 -0300707 .has_dvb = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300708 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300709 .type = EM28XX_VMUX_TELEVISION,
710 .vmux = TVP5150_COMPOSITE0,
711 .amux = 0,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300712 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300713 .type = EM28XX_VMUX_COMPOSITE1,
714 .vmux = TVP5150_COMPOSITE1,
715 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300716 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300717 .type = EM28XX_VMUX_SVIDEO,
718 .vmux = TVP5150_SVIDEO,
719 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300720 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300721 },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300722 /* maybe there's a reason behind it why Terratec sells the Hybrid XS
723 as Prodigy XS with a different PID, let's keep it separated for now
724 maybe we'll need it lateron */
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300725 [EM2880_BOARD_TERRATEC_PRODIGY_XS] = {
726 .name = "Terratec Prodigy XS",
727 .vchannels = 3,
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300728 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300729 .tuner_type = TUNER_XC2028,
730 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300731 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300732 .type = EM28XX_VMUX_TELEVISION,
733 .vmux = TVP5150_COMPOSITE0,
734 .amux = 0,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300735 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300736 .type = EM28XX_VMUX_COMPOSITE1,
737 .vmux = TVP5150_COMPOSITE1,
738 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300739 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300740 .type = EM28XX_VMUX_SVIDEO,
741 .vmux = TVP5150_SVIDEO,
742 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300743 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300744 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800745 [EM2820_BOARD_MSI_VOX_USB_2] = {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300746 .name = "MSI VOX USB 2.0",
747 .vchannels = 3,
748 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
749 .tda9887_conf = TDA9887_PRESENT |
750 TDA9887_PORT1_ACTIVE |
751 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300752 .max_range_640_480 = 1,
753
754 .decoder = EM28XX_SAA7114,
755 .input = { {
756 .type = EM28XX_VMUX_TELEVISION,
757 .vmux = SAA7115_COMPOSITE4,
758 .amux = 0,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300759 }, {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300760 .type = EM28XX_VMUX_COMPOSITE1,
761 .vmux = SAA7115_COMPOSITE0,
762 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300763 }, {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300764 .type = EM28XX_VMUX_SVIDEO,
765 .vmux = SAA7115_SVIDEO3,
766 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300767 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800768 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800769 [EM2800_BOARD_TERRATEC_CINERGY_200] = {
770 .name = "Terratec Cinergy 200 USB",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800771 .is_em2800 = 1,
772 .vchannels = 3,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800773 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
774 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800775 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300776 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800777 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300778 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800779 .amux = 0,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300780 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800781 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300782 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800783 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300784 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800785 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300786 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800787 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300788 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800789 },
Aron Szabo59d07f12008-07-27 13:47:52 -0300790 [EM2800_BOARD_GRABBEEX_USB2800] = {
791 .name = "eMPIA Technology, Inc. GrabBeeX+ Video Encoder",
792 .is_em2800 = 1,
793 .vchannels = 2,
794 .decoder = EM28XX_SAA7113,
795 .input = { {
796 .type = EM28XX_VMUX_COMPOSITE1,
797 .vmux = SAA7115_COMPOSITE0,
798 .amux = 1,
799 }, {
800 .type = EM28XX_VMUX_SVIDEO,
801 .vmux = SAA7115_SVIDEO3,
802 .amux = 1,
803 } },
804 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800805 [EM2800_BOARD_LEADTEK_WINFAST_USBII] = {
806 .name = "Leadtek Winfast USB II",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800807 .is_em2800 = 1,
808 .vchannels = 3,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800809 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
810 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800811 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300812 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800813 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300814 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800815 .amux = 0,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300816 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800817 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300818 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800819 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300820 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800821 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300822 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800823 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300824 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800825 },
826 [EM2800_BOARD_KWORLD_USB2800] = {
827 .name = "Kworld USB2800",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800828 .is_em2800 = 1,
829 .vchannels = 3,
Michael Krufkyab8b8702008-04-22 14:46:05 -0300830 .tuner_type = TUNER_PHILIPS_FCV1236D,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800831 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800832 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300833 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800834 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300835 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800836 .amux = 0,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300837 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800838 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300839 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800840 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300841 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800842 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300843 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800844 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300845 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800846 },
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -0800847 [EM2820_BOARD_PINNACLE_DVC_90] = {
Aurelien Jarnoaec2aef2007-12-17 13:49:17 -0300848 .name = "Pinnacle Dazzle DVC 90/DVC 100",
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -0800849 .vchannels = 3,
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -0300850 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800851 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300852 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800853 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300854 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -0800855 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300856 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800857 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300858 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -0800859 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300860 } },
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -0800861 },
Sascha Sommer43625592007-11-03 15:05:07 -0300862 [EM2800_BOARD_VGEAR_POCKETTV] = {
863 .name = "V-Gear PocketTV",
864 .is_em2800 = 1,
865 .vchannels = 3,
Sascha Sommer43625592007-11-03 15:05:07 -0300866 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
867 .tda9887_conf = TDA9887_PRESENT,
Sascha Sommer43625592007-11-03 15:05:07 -0300868 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300869 .input = { {
Sascha Sommer43625592007-11-03 15:05:07 -0300870 .type = EM28XX_VMUX_TELEVISION,
871 .vmux = SAA7115_COMPOSITE2,
872 .amux = 0,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300873 }, {
Sascha Sommer43625592007-11-03 15:05:07 -0300874 .type = EM28XX_VMUX_COMPOSITE1,
875 .vmux = SAA7115_COMPOSITE0,
876 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300877 }, {
Sascha Sommer43625592007-11-03 15:05:07 -0300878 .type = EM28XX_VMUX_SVIDEO,
879 .vmux = SAA7115_SVIDEO3,
880 .amux = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300881 } },
Sascha Sommer43625592007-11-03 15:05:07 -0300882 },
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300883 [EM2820_BOARD_PROLINK_PLAYTV_USB2] = {
884 .name = "Pixelview Prolink PlayTV USB 2.0",
885 .vchannels = 3,
886 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -0300887 .tuner_type = TUNER_YMEC_TVF_5533MF,
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300888 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300889 .input = { {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300890 .type = EM28XX_VMUX_TELEVISION,
891 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab7463dda2008-02-05 22:29:26 -0300892 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300893 }, {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300894 .type = EM28XX_VMUX_COMPOSITE1,
895 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab7463dda2008-02-05 22:29:26 -0300896 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300897 }, {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300898 .type = EM28XX_VMUX_SVIDEO,
899 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab7463dda2008-02-05 22:29:26 -0300900 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300901 } },
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300902 },
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -0300903 [EM2860_BOARD_POINTNIX_INTRAORAL_CAMERA] = {
904 .name = "PointNix Intra-Oral Camera",
905 .has_snapshot_button = 1,
906 .vchannels = 1,
907 .tda9887_conf = TDA9887_PRESENT,
908 .tuner_type = TUNER_ABSENT,
909 .decoder = EM28XX_SAA7113,
910 .input = { {
911 .type = EM28XX_VMUX_SVIDEO,
912 .vmux = SAA7115_SVIDEO3,
913 .amux = 0,
914 } },
915 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300916 [EM2880_BOARD_MSI_DIGIVOX_AD] = {
917 .name = "MSI DigiVox A/D",
918 .valid = EM28XX_BOARD_NOT_VALIDATED,
919 .vchannels = 3,
920 .tuner_type = TUNER_XC2028,
921 .decoder = EM28XX_TVP5150,
922 .input = { {
923 .type = EM28XX_VMUX_TELEVISION,
924 .vmux = TVP5150_COMPOSITE0,
925 .amux = 0,
926 }, {
927 .type = EM28XX_VMUX_COMPOSITE1,
928 .vmux = TVP5150_COMPOSITE1,
929 .amux = 1,
930 }, {
931 .type = EM28XX_VMUX_SVIDEO,
932 .vmux = TVP5150_SVIDEO,
933 .amux = 1,
934 } },
935 },
936 [EM2880_BOARD_MSI_DIGIVOX_AD_II] = {
937 .name = "MSI DigiVox A/D II",
938 .valid = EM28XX_BOARD_NOT_VALIDATED,
939 .vchannels = 3,
940 .tuner_type = TUNER_XC2028,
941 .decoder = EM28XX_TVP5150,
942 .input = { {
943 .type = EM28XX_VMUX_TELEVISION,
944 .vmux = TVP5150_COMPOSITE0,
945 .amux = 0,
946 }, {
947 .type = EM28XX_VMUX_COMPOSITE1,
948 .vmux = TVP5150_COMPOSITE1,
949 .amux = 1,
950 }, {
951 .type = EM28XX_VMUX_SVIDEO,
952 .vmux = TVP5150_SVIDEO,
953 .amux = 1,
954 } },
955 },
956 [EM2880_BOARD_KWORLD_DVB_305U] = {
957 .name = "KWorld DVB-T 305U",
958 .valid = EM28XX_BOARD_NOT_VALIDATED,
959 .vchannels = 3,
960 .tuner_type = TUNER_XC2028,
961 .decoder = EM28XX_TVP5150,
962 .input = { {
963 .type = EM28XX_VMUX_TELEVISION,
964 .vmux = TVP5150_COMPOSITE0,
965 .amux = 0,
966 }, {
967 .type = EM28XX_VMUX_COMPOSITE1,
968 .vmux = TVP5150_COMPOSITE1,
969 .amux = 1,
970 }, {
971 .type = EM28XX_VMUX_SVIDEO,
972 .vmux = TVP5150_SVIDEO,
973 .amux = 1,
974 } },
975 },
976 [EM2880_BOARD_KWORLD_DVB_310U] = {
977 .name = "KWorld DVB-T 310U",
978 .valid = EM28XX_BOARD_NOT_VALIDATED,
979 .vchannels = 3,
980 .tuner_type = TUNER_XC2028,
981 .decoder = EM28XX_TVP5150,
982 .input = { {
983 .type = EM28XX_VMUX_TELEVISION,
984 .vmux = TVP5150_COMPOSITE0,
985 .amux = 0,
986 }, {
987 .type = EM28XX_VMUX_COMPOSITE1,
988 .vmux = TVP5150_COMPOSITE1,
989 .amux = 1,
990 }, {
991 .type = EM28XX_VMUX_SVIDEO,
992 .vmux = TVP5150_SVIDEO,
993 .amux = 1,
994 } },
995 },
996 [EM2881_BOARD_DNT_DA2_HYBRID] = {
997 .name = "DNT DA2 Hybrid",
998 .valid = EM28XX_BOARD_NOT_VALIDATED,
999 .vchannels = 3,
1000 .tuner_type = TUNER_XC2028,
1001 .decoder = EM28XX_TVP5150,
1002 .input = { {
1003 .type = EM28XX_VMUX_TELEVISION,
1004 .vmux = TVP5150_COMPOSITE0,
1005 .amux = 0,
1006 }, {
1007 .type = EM28XX_VMUX_COMPOSITE1,
1008 .vmux = TVP5150_COMPOSITE1,
1009 .amux = 1,
1010 }, {
1011 .type = EM28XX_VMUX_SVIDEO,
1012 .vmux = TVP5150_SVIDEO,
1013 .amux = 1,
1014 } },
1015 },
1016 [EM2881_BOARD_PINNACLE_HYBRID_PRO] = {
1017 .name = "Pinnacle Hybrid Pro",
1018 .valid = EM28XX_BOARD_NOT_VALIDATED,
1019 .vchannels = 3,
1020 .tuner_type = TUNER_XC2028,
1021 .decoder = EM28XX_TVP5150,
1022 .input = { {
1023 .type = EM28XX_VMUX_TELEVISION,
1024 .vmux = TVP5150_COMPOSITE0,
1025 .amux = 0,
1026 }, {
1027 .type = EM28XX_VMUX_COMPOSITE1,
1028 .vmux = TVP5150_COMPOSITE1,
1029 .amux = 1,
1030 }, {
1031 .type = EM28XX_VMUX_SVIDEO,
1032 .vmux = TVP5150_SVIDEO,
1033 .amux = 1,
1034 } },
1035 },
1036 [EM2882_BOARD_PINNACLE_HYBRID_PRO] = {
1037 .name = "Pinnacle Hybrid Pro (2)",
1038 .valid = EM28XX_BOARD_NOT_VALIDATED,
1039 .vchannels = 3,
1040 .tuner_type = TUNER_XC2028,
1041 .decoder = EM28XX_TVP5150,
1042 .input = { {
1043 .type = EM28XX_VMUX_TELEVISION,
1044 .vmux = TVP5150_COMPOSITE0,
1045 .amux = 0,
1046 }, {
1047 .type = EM28XX_VMUX_COMPOSITE1,
1048 .vmux = TVP5150_COMPOSITE1,
1049 .amux = 1,
1050 }, {
1051 .type = EM28XX_VMUX_SVIDEO,
1052 .vmux = TVP5150_SVIDEO,
1053 .amux = 1,
1054 } },
1055 },
1056 [EM2882_BOARD_KWORLD_VS_DVBT] = {
1057 .name = "Kworld VS-DVB-T 323UR",
1058 .valid = EM28XX_BOARD_NOT_VALIDATED,
1059 .vchannels = 3,
1060 .tuner_type = TUNER_XC2028,
1061 .decoder = EM28XX_TVP5150,
1062 .input = { {
1063 .type = EM28XX_VMUX_TELEVISION,
1064 .vmux = TVP5150_COMPOSITE0,
1065 .amux = 0,
1066 }, {
1067 .type = EM28XX_VMUX_COMPOSITE1,
1068 .vmux = TVP5150_COMPOSITE1,
1069 .amux = 1,
1070 }, {
1071 .type = EM28XX_VMUX_SVIDEO,
1072 .vmux = TVP5150_SVIDEO,
1073 .amux = 1,
1074 } },
1075 },
1076 [EM2882_BOARD_TERRATEC_HYBRID_XS] = {
1077 .name = "Terratec Hybrid XS (em2882)",
1078 .valid = EM28XX_BOARD_NOT_VALIDATED,
1079 .vchannels = 3,
1080 .tuner_type = TUNER_XC2028,
1081 .decoder = EM28XX_TVP5150,
1082 .input = { {
1083 .type = EM28XX_VMUX_TELEVISION,
1084 .vmux = TVP5150_COMPOSITE0,
1085 .amux = 0,
1086 }, {
1087 .type = EM28XX_VMUX_COMPOSITE1,
1088 .vmux = TVP5150_COMPOSITE1,
1089 .amux = 1,
1090 }, {
1091 .type = EM28XX_VMUX_SVIDEO,
1092 .vmux = TVP5150_SVIDEO,
1093 .amux = 1,
1094 } },
1095 },
1096 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950] = {
1097 .name = "Hauppauge WinTV HVR 950",
1098 .valid = EM28XX_BOARD_NOT_VALIDATED,
1099 .vchannels = 3,
1100 .tuner_type = TUNER_XC2028,
1101 .decoder = EM28XX_TVP5150,
1102 .input = { {
1103 .type = EM28XX_VMUX_TELEVISION,
1104 .vmux = TVP5150_COMPOSITE0,
1105 .amux = 0,
1106 }, {
1107 .type = EM28XX_VMUX_COMPOSITE1,
1108 .vmux = TVP5150_COMPOSITE1,
1109 .amux = 1,
1110 }, {
1111 .type = EM28XX_VMUX_SVIDEO,
1112 .vmux = TVP5150_SVIDEO,
1113 .amux = 1,
1114 } },
1115 },
1116 [EM2883_BOARD_KWORLD_HYBRID_A316] = {
1117 .name = "Kworld PlusTV HD Hybrid 330",
1118 .valid = EM28XX_BOARD_NOT_VALIDATED,
1119 .vchannels = 3,
1120 .is_em2800 = 0,
1121 .tuner_type = TUNER_XC2028,
1122 .decoder = EM28XX_TVP5150,
1123 .input = { {
1124 .type = EM28XX_VMUX_TELEVISION,
1125 .vmux = TVP5150_COMPOSITE0,
1126 .amux = 0,
1127 }, {
1128 .type = EM28XX_VMUX_COMPOSITE1,
1129 .vmux = TVP5150_COMPOSITE1,
1130 .amux = 1,
1131 }, {
1132 .type = EM28XX_VMUX_SVIDEO,
1133 .vmux = TVP5150_SVIDEO,
1134 .amux = 1,
1135 } },
1136 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001137};
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001138const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001139
1140/* table of devices that work with this driver */
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001141struct usb_device_id em28xx_id_table [] = {
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001142 { USB_DEVICE(0xeb1a, 0x2750),
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001143 .driver_info = EM2750_BOARD_UNKNOWN },
1144 { USB_DEVICE(0xeb1a, 0x2751),
1145 .driver_info = EM2750_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001146 { USB_DEVICE(0xeb1a, 0x2800),
1147 .driver_info = EM2800_BOARD_UNKNOWN },
1148 { USB_DEVICE(0xeb1a, 0x2820),
1149 .driver_info = EM2820_BOARD_UNKNOWN },
1150 { USB_DEVICE(0xeb1a, 0x2821),
1151 .driver_info = EM2820_BOARD_UNKNOWN },
1152 { USB_DEVICE(0xeb1a, 0x2860),
1153 .driver_info = EM2820_BOARD_UNKNOWN },
1154 { USB_DEVICE(0xeb1a, 0x2861),
1155 .driver_info = EM2820_BOARD_UNKNOWN },
1156 { USB_DEVICE(0xeb1a, 0x2870),
1157 .driver_info = EM2820_BOARD_UNKNOWN },
1158 { USB_DEVICE(0xeb1a, 0x2881),
1159 .driver_info = EM2820_BOARD_UNKNOWN },
1160 { USB_DEVICE(0xeb1a, 0x2883),
1161 .driver_info = EM2820_BOARD_UNKNOWN },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001162 { USB_DEVICE(0xeb1a, 0xe300),
1163 .driver_info = EM2861_BOARD_KWORLD_PVRTV_300U },
1164 { USB_DEVICE(0xeb1a, 0xe305),
1165 .driver_info = EM2880_BOARD_KWORLD_DVB_305U },
1166 { USB_DEVICE(0xeb1a, 0xe310),
1167 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD },
1168 { USB_DEVICE(0xeb1a, 0xa316),
1169 .driver_info = EM2883_BOARD_KWORLD_HYBRID_A316 },
1170 { USB_DEVICE(0xeb1a, 0xe320),
1171 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD_II },
1172 { USB_DEVICE(0xeb1a, 0xe323),
1173 .driver_info = EM2882_BOARD_KWORLD_VS_DVBT },
1174 { USB_DEVICE(0xeb1a, 0xe350),
1175 .driver_info = EM2870_BOARD_KWORLD_350U },
1176 { USB_DEVICE(0xeb1a, 0xe355),
1177 .driver_info = EM2870_BOARD_KWORLD_355U },
1178 { USB_DEVICE(0xeb1a, 0x2801),
1179 .driver_info = EM2800_BOARD_GRABBEEX_USB2800 },
1180 { USB_DEVICE(0xeb1a, 0xe357),
1181 .driver_info = EM2870_BOARD_KWORLD_355U },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001182 { USB_DEVICE(0x0ccd, 0x0036),
1183 .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001184 { USB_DEVICE(0x0ccd, 0x004c),
1185 .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS_FR },
1186 { USB_DEVICE(0x0ccd, 0x004f),
1187 .driver_info = EM2860_BOARD_TERRATEC_HYBRID_XS },
1188 { USB_DEVICE(0x0ccd, 0x005e),
1189 .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS },
1190 { USB_DEVICE(0x0ccd, 0x0042),
1191 .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS },
1192 { USB_DEVICE(0x0ccd, 0x0043),
1193 .driver_info = EM2870_BOARD_TERRATEC_XS },
1194 { USB_DEVICE(0x0ccd, 0x0047),
1195 .driver_info = EM2880_BOARD_TERRATEC_PRODIGY_XS },
1196 { USB_DEVICE(0x185b, 0x2870),
1197 .driver_info = EM2870_BOARD_COMPRO_VIDEOMATE },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001198 { USB_DEVICE(0x2040, 0x4200),
1199 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
Mauro Carvalho Chehab15b9bec2008-01-13 12:02:20 -03001200 { USB_DEVICE(0x2040, 0x4201),
1201 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001202 { USB_DEVICE(0x2040, 0x6500),
1203 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 },
Luc Saillard427d20c2008-01-30 17:23:00 -03001204 { USB_DEVICE(0x2040, 0x6502),
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001205 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2 },
Michael Krufky74ee0512008-05-01 18:02:30 -03001206 { USB_DEVICE(0x2040, 0x6513), /* HCW HVR-980 */
1207 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950 },
1208 { USB_DEVICE(0x2040, 0x6517), /* HP HVR-950 */
1209 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950 },
1210 { USB_DEVICE(0x2040, 0x651b), /* RP HVR-950 */
1211 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950 },
1212 { USB_DEVICE(0x2040, 0x651f), /* HCW HVR-850 */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001213 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001214 { USB_DEVICE(0x0438, 0xb002),
1215 .driver_info = EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001216 { USB_DEVICE(0x2001, 0xf112),
1217 .driver_info = EM2820_BOARD_DLINK_USB_TV },
1218 { USB_DEVICE(0x2304, 0x0207),
1219 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
1220 { USB_DEVICE(0x2304, 0x0208),
1221 .driver_info = EM2820_BOARD_PINNACLE_USB_2 },
1222 { USB_DEVICE(0x2304, 0x021a),
1223 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
1224 { USB_DEVICE(0x2304, 0x0226),
1225 .driver_info = EM2882_BOARD_PINNACLE_HYBRID_PRO },
1226 { USB_DEVICE(0x2304, 0x0227),
1227 .driver_info = EM2880_BOARD_PINNACLE_PCTV_HD_PRO },
1228 { USB_DEVICE(0x0413, 0x6023),
1229 .driver_info = EM2800_BOARD_LEADTEK_WINFAST_USBII },
1230 { USB_DEVICE(0x093b, 0xa005),
1231 .driver_info = EM2861_BOARD_PLEXTOR_PX_TV100U },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001232 { },
1233};
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001234MODULE_DEVICE_TABLE(usb, em28xx_id_table);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001235
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001236/*
1237 * Reset sequences for analog/digital modes
1238 */
1239
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001240/* Reset for the most [analog] boards */
1241static struct em28xx_reg_seq default_analog[] = {
1242 {EM28XX_R08_GPIO, 0x6d, ~EM_GPIO_4, 10},
1243 { -1, -1, -1, -1},
1244};
1245
1246/* Reset for the most [digital] boards */
1247static struct em28xx_reg_seq default_digital[] = {
1248 {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
1249 { -1, -1, -1, -1},
1250};
1251
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001252/* Board Hauppauge WinTV HVR 900 analog */
Mauro Carvalho Chehabe54318e2008-04-18 18:34:31 -03001253static struct em28xx_reg_seq hauppauge_wintv_hvr_900_analog[] = {
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001254 {EM28XX_R08_GPIO, 0x2d, ~EM_GPIO_4, 10},
1255 {0x05, 0xff, 0x10, 10},
1256 { -1, -1, -1, -1},
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001257};
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001258
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001259/* Board Hauppauge WinTV HVR 900 digital */
Mauro Carvalho Chehabe54318e2008-04-18 18:34:31 -03001260static struct em28xx_reg_seq hauppauge_wintv_hvr_900_digital[] = {
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001261 {EM28XX_R08_GPIO, 0x2e, ~EM_GPIO_4, 10},
1262 {EM2880_R04_GPO, 0x04, 0x0f, 10},
1263 {EM2880_R04_GPO, 0x0c, 0x0f, 10},
1264 { -1, -1, -1, -1},
1265};
1266
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001267/* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
1268static struct em28xx_reg_seq em2880_msi_digivox_ad_analog[] = {
1269 {EM28XX_R08_GPIO, 0x69, ~EM_GPIO_4, 10},
1270 { -1, -1, -1, -1},
1271};
1272
1273/* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
1274static struct em28xx_reg_seq em2880_msi_digivox_ad_digital[] = {
1275 {EM28XX_R08_GPIO, 0x6a, ~EM_GPIO_4, 10},
1276 { -1, -1, -1, -1},
1277};
1278
1279/* Board - EM2870 Kworld 355u
1280 Analog - No input analog */
1281static struct em28xx_reg_seq em2870_kworld_355u_digital[] = {
1282 {EM2880_R04_GPO, 0x01, 0xff, 10},
1283 { -1, -1, -1, -1},
1284};
1285
1286/* Callback for the most boards */
1287static struct em28xx_reg_seq default_callback[] = {
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001288 {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10},
1289 {EM28XX_R08_GPIO, 0, EM_GPIO_4, 10},
1290 {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10},
1291 { -1, -1, -1, -1},
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001292};
1293
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001294/* Callback for EM2882 TERRATEC HYBRID XS */
1295static struct em28xx_reg_seq em2882_terratec_hybrid_xs_digital[] = {
1296 {EM28XX_R08_GPIO, 0x2e, 0xff, 6},
1297 {EM28XX_R08_GPIO, 0x3e, ~EM_GPIO_4, 6},
1298 {EM2880_R04_GPO, 0x04, 0xff, 10},
1299 {EM2880_R04_GPO, 0x0c, 0xff, 10},
1300 { -1, -1, -1, -1},
1301};
1302
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001303/*
1304 * EEPROM hash table for devices with generic USB IDs
1305 */
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03001306static struct em28xx_hash_table em28xx_eeprom_hash [] = {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001307 /* P/N: SA 60002070465 Tuner: TVF7533-MF */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001308 {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF},
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001309};
1310
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03001311/* I2C devicelist hash table for devices with generic USB IDs */
Sascha Sommerfad7b952007-11-04 08:06:48 -03001312static struct em28xx_hash_table em28xx_i2c_hash[] = {
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001313 {0xb06a32c3, EM2800_BOARD_TERRATEC_CINERGY_200, TUNER_LG_PAL_NEW_TAPC},
1314 {0xf51200e3, EM2800_BOARD_VGEAR_POCKETTV, TUNER_LG_PAL_NEW_TAPC},
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001315 {0x1ba50080, EM2860_BOARD_POINTNIX_INTRAORAL_CAMERA, TUNER_ABSENT},
Sascha Sommerfad7b952007-11-04 08:06:48 -03001316};
1317
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001318int em28xx_tuner_callback(void *ptr, int command, int arg)
1319{
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001320 int rc = 0;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001321 struct em28xx *dev = ptr;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001322
1323 if (dev->tuner_type != TUNER_XC2028)
1324 return 0;
1325
1326 if (command != XC2028_TUNER_RESET)
1327 return 0;
1328
1329 if (dev->mode == EM28XX_ANALOG_MODE)
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001330 rc = em28xx_gpio_set(dev, dev->tun_analog_gpio);
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001331 else
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001332 rc = em28xx_gpio_set(dev, dev->tun_digital_gpio);
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001333
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001334 return rc;
1335}
1336EXPORT_SYMBOL_GPL(em28xx_tuner_callback);
1337
1338static void em28xx_set_model(struct em28xx *dev)
1339{
1340 dev->is_em2800 = em28xx_boards[dev->model].is_em2800;
1341 dev->has_msp34xx = em28xx_boards[dev->model].has_msp34xx;
1342 dev->tda9887_conf = em28xx_boards[dev->model].tda9887_conf;
1343 dev->decoder = em28xx_boards[dev->model].decoder;
1344 dev->video_inputs = em28xx_boards[dev->model].vchannels;
1345 dev->has_12mhz_i2s = em28xx_boards[dev->model].has_12mhz_i2s;
1346 dev->max_range_640_480 = em28xx_boards[dev->model].max_range_640_480;
1347 dev->has_dvb = em28xx_boards[dev->model].has_dvb;
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001348 dev->has_snapshot_button = em28xx_boards[dev->model].has_snapshot_button;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001349 dev->valid = em28xx_boards[dev->model].valid;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001350}
1351
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001352/* Since em28xx_pre_card_setup() requires a proper dev->model,
1353 * this won't work for boards with generic PCI IDs
1354 */
Markus Rechbergera94e95b2006-01-23 17:11:10 -02001355void em28xx_pre_card_setup(struct em28xx *dev)
1356{
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001357 int rc;
1358
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001359 rc = em28xx_read_reg(dev, EM2880_R04_GPO);
1360 if (rc >= 0)
1361 dev->reg_gpo = rc;
1362
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001363 dev->wait_after_write = 5;
Mauro Carvalho Chehab41facaa2008-04-17 21:44:58 -03001364 rc = em28xx_read_reg(dev, EM28XX_R0A_CHIPID);
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001365 if (rc > 0) {
1366 switch (rc) {
Devin Heitmuellera8a1f8c2008-06-10 12:35:42 -03001367 case CHIP_ID_EM2860:
1368 em28xx_info("chip ID is em2860\n");
1369 break;
Mauro Carvalho Chehab2ba890e2008-04-17 21:42:58 -03001370 case CHIP_ID_EM2883:
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001371 em28xx_info("chip ID is em2882/em2883\n");
1372 dev->wait_after_write = 0;
1373 break;
1374 default:
1375 em28xx_info("em28xx chip ID = %d\n", rc);
1376 }
1377 }
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001378 em28xx_set_model(dev);
1379
Markus Rechbergera94e95b2006-01-23 17:11:10 -02001380 /* request some modules */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001381 switch (dev->model) {
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001382 case EM2880_BOARD_TERRATEC_PRODIGY_XS:
1383 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001384 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001385 case EM2860_BOARD_TERRATEC_HYBRID_XS:
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001386 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950:
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001387 case EM2880_BOARD_PINNACLE_PCTV_HD_PRO:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001388 case EM2882_BOARD_PINNACLE_HYBRID_PRO:
1389 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
1390 case EM2883_BOARD_KWORLD_HYBRID_A316:
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001391 case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600:
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001392 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1);
Mauro Carvalho Chehab41facaa2008-04-17 21:44:58 -03001393 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001394 msleep(50);
Markus Rechbergera94e95b2006-01-23 17:11:10 -02001395
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001396 /* Sets GPO/GPIO sequences for this device */
1397 dev->analog_gpio = hauppauge_wintv_hvr_900_analog;
1398 dev->digital_gpio = hauppauge_wintv_hvr_900_digital;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001399 dev->tun_analog_gpio = default_callback;
1400 dev->tun_digital_gpio = default_callback;
1401 break;
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001402
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001403 case EM2882_BOARD_TERRATEC_HYBRID_XS:
1404 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1);
1405 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
1406 msleep(50);
1407
1408 /* should be added ir_codes here */
1409
1410 /* Sets GPO/GPIO sequences for this device */
1411 dev->analog_gpio = hauppauge_wintv_hvr_900_analog;
1412 dev->digital_gpio = hauppauge_wintv_hvr_900_digital;
1413 dev->tun_analog_gpio = default_callback;
1414 dev->tun_digital_gpio = em2882_terratec_hybrid_xs_digital;
1415 break;
1416
1417 case EM2880_BOARD_TERRATEC_HYBRID_XS_FR:
1418 case EM2880_BOARD_TERRATEC_HYBRID_XS:
1419 case EM2870_BOARD_TERRATEC_XS:
1420 case EM2881_BOARD_PINNACLE_HYBRID_PRO:
1421 case EM2880_BOARD_KWORLD_DVB_310U:
1422 case EM2870_BOARD_KWORLD_350U:
1423 case EM2881_BOARD_DNT_DA2_HYBRID:
1424 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1);
1425 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
1426 msleep(50);
1427
1428 /* NOTE: EM2881_DNT_DA2_HYBRID spend 140 msleep for digital
1429 and analog commands. If this commands doesn't work,
1430 add this timer. */
1431
1432 /* Sets GPO/GPIO sequences for this device */
1433 dev->analog_gpio = default_analog;
1434 dev->digital_gpio = default_digital;
1435 dev->tun_analog_gpio = default_callback;
1436 dev->tun_digital_gpio = default_callback;
1437 break;
1438
1439 case EM2880_BOARD_MSI_DIGIVOX_AD:
1440 case EM2880_BOARD_MSI_DIGIVOX_AD_II:
1441 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1);
1442 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
1443 msleep(50);
1444
1445 /* Sets GPO/GPIO sequences for this device */
1446 dev->analog_gpio = em2880_msi_digivox_ad_analog;
1447 dev->digital_gpio = em2880_msi_digivox_ad_digital;
1448 dev->tun_analog_gpio = default_callback;
1449 dev->tun_digital_gpio = default_callback;
1450 break;
1451
1452 case EM2750_BOARD_UNKNOWN:
1453 case EM2750_BOARD_DLCW_130:
1454 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x0a", 1);
1455 break;
1456
1457 case EM2861_BOARD_PLEXTOR_PX_TV100U:
1458 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1);
1459 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
1460 /* FIXME guess */
1461 /* Turn on analog audio output */
1462 em28xx_write_regs_req(dev, 0x00, 0x08, "\xfd", 1);
1463 break;
1464
1465 case EM2861_BOARD_KWORLD_PVRTV_300U:
1466 case EM2880_BOARD_KWORLD_DVB_305U:
1467 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1);
1468 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x4c", 1);
1469 msleep(10);
1470 em28xx_write_regs(dev, 0x08, "\x6d", 1);
1471 msleep(10);
1472 em28xx_write_regs(dev, 0x08, "\x7d", 1);
1473 msleep(10);
1474 break;
1475
1476 case EM2870_BOARD_KWORLD_355U:
1477 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1);
1478 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
1479 msleep(50);
1480
1481 /* Sets GPO/GPIO sequences for this device */
1482 dev->digital_gpio = em2870_kworld_355u_digital;
1483 break;
1484
1485 case EM2870_BOARD_COMPRO_VIDEOMATE:
1486 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1);
1487 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
1488 /* TODO: someone can do some cleanup here...
1489 not everything's needed */
1490 em28xx_write_regs(dev, 0x04, "\x00", 1);
1491 msleep(10);
1492 em28xx_write_regs(dev, 0x04, "\x01", 1);
1493 msleep(10);
1494 em28xx_write_regs(dev, 0x08, "\xfd", 1);
1495 mdelay(70);
1496 em28xx_write_regs(dev, 0x08, "\xfc", 1);
1497 mdelay(70);
1498 em28xx_write_regs(dev, 0x08, "\xdc", 1);
1499 mdelay(70);
1500 em28xx_write_regs(dev, 0x08, "\xfc", 1);
1501 mdelay(70);
1502 break;
1503
1504 case EM2870_BOARD_TERRATEC_XS_MT2060:
1505 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1);
1506 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
1507 /* this device needs some gpio writes to get the DVB-T
1508 demod work */
1509 em28xx_write_regs(dev, 0x08, "\xfe", 1);
1510 mdelay(70);
1511 em28xx_write_regs(dev, 0x08, "\xde", 1);
1512 mdelay(70);
1513 dev->em28xx_write_regs(dev, 0x08, "\xfe", 1);
1514 mdelay(70);
1515 break;
1516
1517 case EM2870_BOARD_PINNACLE_PCTV_DVB:
1518 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
1519 /* this device needs some gpio writes to get the
1520 DVB-T demod work */
1521 em28xx_write_regs(dev, 0x08, "\xfe", 1);
1522 mdelay(70);
1523 em28xx_write_regs(dev, 0x08, "\xde", 1);
1524 mdelay(70);
1525 em28xx_write_regs(dev, 0x08, "\xfe", 1);
1526 mdelay(70);
1527 /* switch em2880 rc protocol */
1528 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x22", 1);
1529 /* should be added ir_codes here */
1530 break;
1531
1532 case EM2820_BOARD_GADMEI_UTV310:
1533 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1);
1534 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
1535 /* Turn on analog audio output */
1536 em28xx_write_regs_req(dev, 0x00, 0x08, "\xfd", 1);
1537 break;
1538
1539 case EM2860_BOARD_GADMEI_UTV330:
1540 /* Turn on IR */
1541 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x07", 1);
1542 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
1543 /* should be added ir_codes here */
1544 break;
1545
1546 case EM2820_BOARD_MSI_VOX_USB_2:
1547 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x27", 1);
1548 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
1549 /* enables audio for that device */
1550 em28xx_write_regs_req(dev, 0x00, 0x08, "\xfd", 1);
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001551 break;
1552 }
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001553
1554 em28xx_gpio_set(dev, dev->tun_analog_gpio);
1555 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
1556
1557 /* Unlock device */
1558 em28xx_set_mode(dev, EM28XX_MODE_UNDEFINED);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001559}
1560
Mauro Carvalho Chehabe54318e2008-04-18 18:34:31 -03001561static void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl)
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03001562{
1563 memset(ctl, 0, sizeof(*ctl));
1564
1565 ctl->fname = XC2028_DEFAULT_FIRMWARE;
1566 ctl->max_len = 64;
1567 ctl->mts = em28xx_boards[dev->model].mts_firmware;
1568
1569 switch (dev->model) {
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03001570 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
1571 ctl->demod = XC3028_FE_ZARLINK456;
1572 break;
reinhard schwab655b8402008-07-26 10:47:00 -03001573 case EM2880_BOARD_TERRATEC_HYBRID_XS:
1574 ctl->demod = XC3028_FE_ZARLINK456;
1575 break;
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001576 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
1577 /* djh - Not sure which demod we need here */
1578 ctl->demod = XC3028_FE_DEFAULT;
1579 break;
Devin Heitmuellerbdfbf952008-04-17 21:38:27 -03001580 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950:
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001581 case EM2880_BOARD_PINNACLE_PCTV_HD_PRO:
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001582 case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600:
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03001583 /* FIXME: Better to specify the needed IF */
Devin Heitmuellerbdfbf952008-04-17 21:38:27 -03001584 ctl->demod = XC3028_FE_DEFAULT;
1585 break;
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03001586 default:
1587 ctl->demod = XC3028_FE_OREN538;
1588 }
1589}
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03001590
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001591static void em28xx_config_tuner(struct em28xx *dev)
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001592{
1593 struct v4l2_priv_tun_config xc2028_cfg;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001594 struct tuner_setup tun_setup;
1595 struct v4l2_frequency f;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001596
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03001597 if (dev->tuner_type == TUNER_ABSENT)
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001598 return;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001599
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001600 tun_setup.mode_mask = T_ANALOG_TV | T_RADIO;
1601 tun_setup.type = dev->tuner_type;
1602 tun_setup.addr = dev->tuner_addr;
1603 tun_setup.tuner_callback = em28xx_tuner_callback;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001604
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001605 em28xx_i2c_call_clients(dev, TUNER_SET_TYPE_ADDR, &tun_setup);
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001606
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001607 if (dev->tuner_type == TUNER_XC2028) {
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03001608 struct xc2028_ctrl ctl;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001609
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03001610 em28xx_setup_xc3028(dev, &ctl);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001611
1612 xc2028_cfg.tuner = TUNER_XC2028;
1613 xc2028_cfg.priv = &ctl;
1614
1615 em28xx_i2c_call_clients(dev, TUNER_SET_CONFIG, &xc2028_cfg);
1616 }
1617
1618 /* configure tuner */
1619 f.tuner = 0;
1620 f.type = V4L2_TUNER_ANALOG_TV;
1621 f.frequency = 9076; /* just a magic number */
1622 dev->ctl_freq = f.frequency;
1623 em28xx_i2c_call_clients(dev, VIDIOC_S_FREQUENCY, &f);
1624}
1625
1626static int em28xx_hint_board(struct em28xx *dev)
1627{
1628 int i;
1629
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03001630 /* HINT method: EEPROM
1631 *
1632 * This method works only for boards with eeprom.
1633 * Uses a hash of all eeprom bytes. The hash should be
1634 * unique for a vendor/tuner pair.
1635 * There are a high chance that tuners for different
1636 * video standards produce different hashes.
1637 */
1638 for (i = 0; i < ARRAY_SIZE(em28xx_eeprom_hash); i++) {
1639 if (dev->hash == em28xx_eeprom_hash[i].hash) {
1640 dev->model = em28xx_eeprom_hash[i].model;
1641 dev->tuner_type = em28xx_eeprom_hash[i].tuner;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001642
1643 em28xx_errdev("Your board has no unique USB ID.\n");
1644 em28xx_errdev("A hint were successfully done, "
1645 "based on eeprom hash.\n");
1646 em28xx_errdev("This method is not 100%% failproof.\n");
1647 em28xx_errdev("If the board were missdetected, "
1648 "please email this log to:\n");
1649 em28xx_errdev("\tV4L Mailing List "
1650 " <video4linux-list@redhat.com>\n");
1651 em28xx_errdev("Board detected as %s\n",
1652 em28xx_boards[dev->model].name);
1653
1654 return 0;
1655 }
1656 }
Sascha Sommerfad7b952007-11-04 08:06:48 -03001657
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03001658 /* HINT method: I2C attached devices
1659 *
1660 * This method works for all boards.
1661 * Uses a hash of i2c scanned devices.
1662 * Devices with the same i2c attached chips will
1663 * be considered equal.
1664 * This method is less precise than the eeprom one.
1665 */
1666
Sascha Sommerfad7b952007-11-04 08:06:48 -03001667 /* user did not request i2c scanning => do it now */
1668 if (!dev->i2c_hash)
1669 em28xx_do_i2c_scan(dev);
1670
1671 for (i = 0; i < ARRAY_SIZE(em28xx_i2c_hash); i++) {
1672 if (dev->i2c_hash == em28xx_i2c_hash[i].hash) {
1673 dev->model = em28xx_i2c_hash[i].model;
1674 dev->tuner_type = em28xx_i2c_hash[i].tuner;
1675 em28xx_errdev("Your board has no unique USB ID.\n");
1676 em28xx_errdev("A hint were successfully done, "
1677 "based on i2c devicelist hash.\n");
1678 em28xx_errdev("This method is not 100%% failproof.\n");
1679 em28xx_errdev("If the board were missdetected, "
1680 "please email this log to:\n");
1681 em28xx_errdev("\tV4L Mailing List "
1682 " <video4linux-list@redhat.com>\n");
1683 em28xx_errdev("Board detected as %s\n",
1684 em28xx_boards[dev->model].name);
1685
1686 return 0;
1687 }
1688 }
1689
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001690 em28xx_errdev("Your board has no unique USB ID and thus need a "
1691 "hint to be detected.\n");
1692 em28xx_errdev("You may try to use card=<n> insmod option to "
1693 "workaround that.\n");
1694 em28xx_errdev("Please send an email with this log to:\n");
1695 em28xx_errdev("\tV4L Mailing List <video4linux-list@redhat.com>\n");
1696 em28xx_errdev("Board eeprom hash is 0x%08lx\n", dev->hash);
Sascha Sommerfad7b952007-11-04 08:06:48 -03001697 em28xx_errdev("Board i2c devicelist hash is 0x%08lx\n", dev->i2c_hash);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001698
1699 em28xx_errdev("Here is a list of valid choices for the card=<n>"
1700 " insmod option:\n");
1701 for (i = 0; i < em28xx_bcount; i++) {
1702 em28xx_errdev(" card=%d -> %s\n",
1703 i, em28xx_boards[i].name);
1704 }
1705 return -1;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001706}
1707
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001708/* ----------------------------------------------------------------------- */
1709void em28xx_set_ir(struct em28xx *dev, struct IR_i2c *ir)
1710{
1711 if (disable_ir) {
1712 ir->get_key = NULL;
1713 return ;
1714 }
1715
1716 /* detect & configure */
1717 switch (dev->model) {
1718 case (EM2800_BOARD_UNKNOWN):
1719 break;
1720 case (EM2820_BOARD_UNKNOWN):
1721 break;
1722 case (EM2800_BOARD_TERRATEC_CINERGY_200):
1723 case (EM2820_BOARD_TERRATEC_CINERGY_250):
1724 ir->ir_codes = ir_codes_em_terratec;
1725 ir->get_key = em28xx_get_key_terratec;
1726 snprintf(ir->c.name, sizeof(ir->c.name),
1727 "i2c IR (EM28XX Terratec)");
1728 break;
1729 case (EM2820_BOARD_PINNACLE_USB_2):
1730 ir->ir_codes = ir_codes_pinnacle_grey;
1731 ir->get_key = em28xx_get_key_pinnacle_usb_grey;
1732 snprintf(ir->c.name, sizeof(ir->c.name),
1733 "i2c IR (EM28XX Pinnacle PCTV)");
1734 break;
1735 case (EM2820_BOARD_HAUPPAUGE_WINTV_USB_2):
1736 ir->ir_codes = ir_codes_hauppauge_new;
1737 ir->get_key = em28xx_get_key_em_haup;
1738 snprintf(ir->c.name, sizeof(ir->c.name),
1739 "i2c IR (EM2840 Hauppauge)");
1740 break;
1741 case (EM2820_BOARD_MSI_VOX_USB_2):
1742 break;
1743 case (EM2800_BOARD_LEADTEK_WINFAST_USBII):
1744 break;
1745 case (EM2800_BOARD_KWORLD_USB2800):
1746 break;
Aron Szabo59d07f12008-07-27 13:47:52 -03001747 case (EM2800_BOARD_GRABBEEX_USB2800):
1748 break;
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001749 }
1750}
1751
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001752void em28xx_card_setup(struct em28xx *dev)
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001753{
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03001754 em28xx_set_model(dev);
1755
1756 dev->tuner_type = em28xx_boards[dev->model].tuner_type;
1757
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001758 /* request some modules */
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001759 switch (dev->model) {
1760 case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2:
Mauro Carvalho Chehab98ae1272007-11-05 09:30:39 -03001761 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001762 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
Aidan Thornton122d1582007-11-20 15:25:08 -03001763 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950:
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001764 {
1765 struct tveeprom tv;
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001766#ifdef CONFIG_MODULES
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001767 request_module("tveeprom");
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001768#endif
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001769 /* Call first TVeeprom */
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001770
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001771 dev->i2c_client.addr = 0xa0 >> 1;
1772 tveeprom_hauppauge_analog(&dev->i2c_client, &tv, dev->eedata);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001773
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001774 dev->tuner_type = tv.tuner_type;
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03001775
Hans Verkuil38f9d302008-07-23 05:09:15 -03001776 if (tv.audio_processor == V4L2_IDENT_MSPX4XX) {
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001777 dev->i2s_speed = 2048000;
1778 dev->has_msp34xx = 1;
1779 }
Mauro Carvalho Chehab98ae1272007-11-05 09:30:39 -03001780#ifdef CONFIG_MODULES
1781 if (tv.has_ir)
1782 request_module("ir-kbd-i2c");
1783#endif
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001784 break;
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001785 }
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001786 case EM2820_BOARD_KWORLD_PVRTV2800RF:
1787 /* GPIO enables sound on KWORLD PVR TV 2800RF */
1788 em28xx_write_regs_req(dev, 0x00, 0x08, "\xf9", 1);
1789 break;
1790 case EM2820_BOARD_UNKNOWN:
1791 case EM2800_BOARD_UNKNOWN:
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03001792 if (!em28xx_hint_board(dev))
1793 em28xx_set_model(dev);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001794 break;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001795 }
1796
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001797 if (dev->has_snapshot_button)
1798 em28xx_register_snapshot_button(dev);
1799
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001800 if (dev->valid == EM28XX_BOARD_NOT_VALIDATED) {
1801 em28xx_errdev("\n\n");
1802 em28xx_errdev("The support for this board weren't "
1803 "valid yet.\n");
1804 em28xx_errdev("Please send a report of having this working\n");
1805 em28xx_errdev("not to V4L mailing list (and/or to other "
1806 "addresses)\n\n");
1807 }
1808
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03001809 /* Allow override tuner type by a module parameter */
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001810 if (tuner >= 0)
1811 dev->tuner_type = tuner;
1812
1813#ifdef CONFIG_MODULES
1814 /* request some modules */
1815 if (dev->has_msp34xx)
1816 request_module("msp3400");
1817 if (dev->decoder == EM28XX_SAA7113 || dev->decoder == EM28XX_SAA7114)
1818 request_module("saa7115");
1819 if (dev->decoder == EM28XX_TVP5150)
1820 request_module("tvp5150");
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03001821 if (dev->tuner_type != TUNER_ABSENT)
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001822 request_module("tuner");
1823#endif
1824
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001825 em28xx_config_tuner(dev);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001826}