2 em28xx-cards.c - driver for Empia EM2800/EM2820/2840 USB video capture devices
4 Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it>
5 Markus Rechberger <mrechberger@gmail.com>
6 Mauro Carvalho Chehab <mchehab@brturbo.com.br>
7 Sascha Sommer <saschasommer@freenet.de>
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #include <linux/init.h>
25 #include <linux/module.h>
26 #include <linux/pci.h>
27 #include <linux/delay.h>
28 #include <linux/i2c.h>
29 #include <linux/usb.h>
30 #include <media/tuner.h>
31 #include <media/audiochip.h>
32 #include <media/tveeprom.h>
33 #include <media/v4l2-common.h>
38 struct em28xx_board em28xx_boards[] = {
39 [EM2800_BOARD_UNKNOWN] = {
40 .name = "Unknown EM2800 video grabber",
43 .norm = VIDEO_MODE_PAL,
44 .tda9887_conf = TDA9887_PRESENT,
46 .decoder = EM28XX_SAA7113,
48 .type = EM28XX_VMUX_COMPOSITE1,
52 .type = EM28XX_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 = EM28XX_SAA7113,
66 .type = EM28XX_VMUX_COMPOSITE1,
70 .type = EM28XX_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 = EM28XX_SAA7113,
84 .type = EM28XX_VMUX_TELEVISION,
88 .type = EM28XX_VMUX_COMPOSITE1,
92 .type = EM28XX_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 = EM28XX_SAA7113,
106 .type = EM28XX_VMUX_TELEVISION,
110 .type = EM28XX_VMUX_COMPOSITE1,
114 .type = EM28XX_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 = EM28XX_TVP5150,
128 /*FIXME: S-Video not tested */
130 .type = EM28XX_VMUX_TELEVISION,
134 .type = EM28XX_VMUX_SVIDEO,
139 [EM2880_BOARD_WINTV_HVR_900] = {
140 .name = "WinTV HVR 900",
142 .norm = VIDEO_MODE_PAL,
144 .tda9887_conf = TDA9887_PRESENT,
146 .decoder = EM28XX_TVP5150,
148 .type = EM28XX_VMUX_COMPOSITE1,
152 .type = EM28XX_VMUX_TELEVISION,
156 .type = EM28XX_VMUX_SVIDEO,
161 [EM2820_BOARD_MSI_VOX_USB_2] = {
162 .name = "MSI VOX USB 2.0",
164 .norm = VIDEO_MODE_PAL,
165 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
166 .tda9887_conf = TDA9887_PRESENT|TDA9887_PORT1_ACTIVE|TDA9887_PORT2_ACTIVE,
168 .decoder = EM28XX_SAA7114,
170 .type = EM28XX_VMUX_TELEVISION,
174 .type = EM28XX_VMUX_COMPOSITE1,
178 .type = EM28XX_VMUX_SVIDEO,
183 [EM2800_BOARD_TERRATEC_CINERGY_200] = {
184 .name = "Terratec Cinergy 200 USB",
187 .norm = VIDEO_MODE_PAL,
188 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
189 .tda9887_conf = TDA9887_PRESENT,
191 .decoder = EM28XX_SAA7113,
193 .type = EM28XX_VMUX_TELEVISION,
197 .type = EM28XX_VMUX_COMPOSITE1,
201 .type = EM28XX_VMUX_SVIDEO,
206 [EM2800_BOARD_LEADTEK_WINFAST_USBII] = {
207 .name = "Leadtek Winfast USB II",
210 .norm = VIDEO_MODE_PAL,
211 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
212 .tda9887_conf = TDA9887_PRESENT,
214 .decoder = EM28XX_SAA7113,
216 .type = EM28XX_VMUX_TELEVISION,
220 .type = EM28XX_VMUX_COMPOSITE1,
224 .type = EM28XX_VMUX_SVIDEO,
229 [EM2800_BOARD_KWORLD_USB2800] = {
230 .name = "Kworld USB2800",
233 .norm = VIDEO_MODE_PAL,
234 .tuner_type = TUNER_PHILIPS_ATSC,
235 .tda9887_conf = TDA9887_PRESENT,
237 .decoder = EM28XX_SAA7113,
239 .type = EM28XX_VMUX_TELEVISION,
243 .type = EM28XX_VMUX_COMPOSITE1,
247 .type = EM28XX_VMUX_SVIDEO,
252 [EM2820_BOARD_PINNACLE_DVC_90] = {
253 .name = "Pinnacle Dazzle DVC 90",
255 .norm = VIDEO_MODE_PAL,
257 .decoder = EM28XX_SAA7113,
259 .type = EM28XX_VMUX_COMPOSITE1,
263 .type = EM28XX_VMUX_SVIDEO,
269 const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards);
271 /* table of devices that work with this driver */
272 struct usb_device_id em28xx_id_table [] = {
273 { USB_DEVICE(0xeb1a, 0x2800), .driver_info = EM2800_BOARD_UNKNOWN },
274 { USB_DEVICE(0xeb1a, 0x2820), .driver_info = EM2820_BOARD_MSI_VOX_USB_2 },
275 { USB_DEVICE(0x0ccd, 0x0036), .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 },
276 { USB_DEVICE(0x2304, 0x0208), .driver_info = EM2820_BOARD_PINNACLE_USB_2 },
277 { USB_DEVICE(0x2040, 0x4200), .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
278 { USB_DEVICE(0x2304, 0x0207), .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
279 { USB_DEVICE(0x2040, 0x6500), .driver_info = EM2880_BOARD_WINTV_HVR_900 },
283 void em28xx_pre_card_setup(struct em28xx *dev)
285 /* request some modules */
287 case EM2880_BOARD_WINTV_HVR_900:
289 em28xx_write_regs_req(dev, 0x00, 0x08, "\x7d", 1); // reset through GPIO?
295 void em28xx_card_setup(struct em28xx *dev)
297 /* request some modules */
299 case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2:
302 #ifdef CONFIG_MODULES
303 request_module("tveeprom");
304 request_module("ir-kbd-i2c");
305 request_module("msp3400");
307 /* Call first TVeeprom */
309 dev->i2c_client.addr = 0xa0 >> 1;
310 tveeprom_hauppauge_analog(&dev->i2c_client, &tv, dev->eedata);
312 dev->tuner_type= tv.tuner_type;
313 if (tv.audio_processor == AUDIO_CHIP_MSP34XX) {
314 dev->i2s_speed=2048000;
323 EXPORT_SYMBOL(em28xx_boards);
324 EXPORT_SYMBOL(em28xx_bcount);
325 EXPORT_SYMBOL(em28xx_id_table);
327 MODULE_DEVICE_TABLE (usb, em28xx_id_table);