2 em2820-cards.c - driver for Empia EM2800/EM2820/2840 USB video capture devices
4 Copyright (C) 2005 Markus Rechberger <mrechberger@gmail.com>
5 Ludovico Cavedon <cavedon@sssup.it>
6 Mauro Carvalho Chehab <mchehab@brturbo.com.br>
8 Based on the em2800 driver from Sascha Sommer <saschasommer@freenet.de>
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.
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.
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.
25 #include <linux/init.h>
26 #include <linux/module.h>
27 #include <linux/pci.h>
28 #include <linux/delay.h>
29 #include <linux/i2c.h>
30 #include <linux/usb.h>
31 #include <media/tuner.h>
32 #include <media/audiochip.h>
33 #include <media/tveeprom.h>
38 struct em2820_board em2820_boards[] = {
39 [EM2800_BOARD_UNKNOWN] = {
40 .name = "Unknown EM2800 video grabber",
43 .norm = VIDEO_MODE_PAL,
44 .tda9887_conf = TDA9887_PRESENT,
46 .decoder = EM2820_SAA7113,
48 .type = EM2820_VMUX_COMPOSITE1,
52 .type = EM2820_VMUX_SVIDEO,
57 [EM2820_BOARD_UNKNOWN] = {
58 .name = "Unknown EM2820/2840 video grabber",
61 .norm = VIDEO_MODE_PAL,
62 .tda9887_conf = TDA9887_PRESENT,
64 .decoder = EM2820_SAA7113,
66 .type = EM2820_VMUX_COMPOSITE1,
70 .type = EM2820_VMUX_SVIDEO,
75 [EM2820_BOARD_TERRATEC_CINERGY_250] = {
76 .name = "Terratec Cinergy 250 USB",
78 .norm = VIDEO_MODE_PAL,
79 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
80 .tda9887_conf = TDA9887_PRESENT,
82 .decoder = EM2820_SAA7113,
84 .type = EM2820_VMUX_TELEVISION,
88 .type = EM2820_VMUX_COMPOSITE1,
92 .type = EM2820_VMUX_SVIDEO,
97 [EM2820_BOARD_PINNACLE_USB_2] = {
98 .name = "Pinnacle PCTV USB 2",
100 .norm = VIDEO_MODE_PAL,
101 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
102 .tda9887_conf = TDA9887_PRESENT,
104 .decoder = EM2820_SAA7113,
106 .type = EM2820_VMUX_TELEVISION,
110 .type = EM2820_VMUX_COMPOSITE1,
114 .type = EM2820_VMUX_SVIDEO,
119 [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2] = {
120 .name = "Hauppauge WinTV USB 2",
122 .norm = VIDEO_MODE_NTSC,
123 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
124 .tda9887_conf = TDA9887_PRESENT|TDA9887_PORT1_ACTIVE|TDA9887_PORT2_ACTIVE,
126 .decoder = EM2820_TVP5150,
128 /*FIXME: S-Video not tested */
130 .type = EM2820_VMUX_TELEVISION,
134 .type = EM2820_VMUX_SVIDEO,
139 [EM2820_BOARD_MSI_VOX_USB_2] = {
140 .name = "MSI VOX USB 2.0",
142 .norm = VIDEO_MODE_PAL,
143 .tuner_type = TUNER_PHILIPS_PAL,
144 .tda9887_conf = TDA9887_PRESENT|TDA9887_PORT1_ACTIVE|TDA9887_PORT2_ACTIVE,
146 .decoder = EM2820_SAA7114,
148 .type = EM2820_VMUX_TELEVISION,
152 .type = EM2820_VMUX_COMPOSITE1,
156 .type = EM2820_VMUX_SVIDEO,
161 [EM2800_BOARD_TERRATEC_CINERGY_200] = {
162 .name = "Terratec Cinergy 200 USB",
165 .norm = VIDEO_MODE_PAL,
166 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
167 .tda9887_conf = TDA9887_PRESENT,
169 .decoder = EM2820_SAA7113,
171 .type = EM2820_VMUX_TELEVISION,
175 .type = EM2820_VMUX_COMPOSITE1,
179 .type = EM2820_VMUX_SVIDEO,
184 [EM2800_BOARD_LEADTEK_WINFAST_USBII] = {
185 .name = "Leadtek Winfast USB II",
188 .norm = VIDEO_MODE_PAL,
189 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
190 .tda9887_conf = TDA9887_PRESENT,
192 .decoder = EM2820_SAA7113,
194 .type = EM2820_VMUX_TELEVISION,
198 .type = EM2820_VMUX_COMPOSITE1,
202 .type = EM2820_VMUX_SVIDEO,
207 [EM2800_BOARD_KWORLD_USB2800] = {
208 .name = "Kworld USB2800",
211 .norm = VIDEO_MODE_PAL,
212 .tuner_type = TUNER_PHILIPS_ATSC,
213 .tda9887_conf = TDA9887_PRESENT,
215 .decoder = EM2820_SAA7113,
217 .type = EM2820_VMUX_TELEVISION,
221 .type = EM2820_VMUX_COMPOSITE1,
225 .type = EM2820_VMUX_SVIDEO,
231 const unsigned int em2820_bcount = ARRAY_SIZE(em2820_boards);
233 /* table of devices that work with this driver */
234 struct usb_device_id em2820_id_table [] = {
235 { USB_DEVICE(0xeb1a, 0x2800), .driver_info = EM2800_BOARD_UNKNOWN },
236 { USB_DEVICE(0xeb1a, 0x2820), .driver_info = EM2820_BOARD_UNKNOWN },
237 { USB_DEVICE(0x0ccd, 0x0036), .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 },
238 { USB_DEVICE(0x2304, 0x0208), .driver_info = EM2820_BOARD_PINNACLE_USB_2 },
239 { USB_DEVICE(0x2040, 0x4200), .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
243 void em2820_card_setup(struct em2820 *dev)
245 /* request some modules */
246 if (dev->model == EM2820_BOARD_HAUPPAUGE_WINTV_USB_2) {
248 #ifdef CONFIG_MODULES
249 request_module("tveeprom");
250 request_module("ir-kbd-i2c");
252 /* Call first TVeeprom */
254 dev->i2c_client.addr = 0xa0 >> 1;
255 tveeprom_hauppauge_analog(&dev->i2c_client, &tv, dev->eedata);
257 dev->tuner_type= tv.tuner_type;
258 if (tv.audio_processor == AUDIO_CHIP_MSP34XX) {
260 } else dev->has_msp34xx=0;
264 EXPORT_SYMBOL(em2820_boards);
265 EXPORT_SYMBOL(em2820_bcount);
266 EXPORT_SYMBOL(em2820_id_table);
268 MODULE_DEVICE_TABLE (usb, em2820_id_table);