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>
37 struct em28xx_board em28xx_boards[] = {
38 [EM2800_BOARD_UNKNOWN] = {
39 .name = "Unknown EM2800 video grabber",
42 .norm = VIDEO_MODE_PAL,
43 .tda9887_conf = TDA9887_PRESENT,
45 .decoder = EM28XX_SAA7113,
47 .type = EM28XX_VMUX_COMPOSITE1,
51 .type = EM28XX_VMUX_SVIDEO,
56 [EM2820_BOARD_UNKNOWN] = {
57 .name = "Unknown EM2820/2840 video grabber",
60 .norm = VIDEO_MODE_PAL,
61 .tda9887_conf = TDA9887_PRESENT,
63 .decoder = EM28XX_SAA7113,
65 .type = EM28XX_VMUX_COMPOSITE1,
69 .type = EM28XX_VMUX_SVIDEO,
74 [EM2820_BOARD_TERRATEC_CINERGY_250] = {
75 .name = "Terratec Cinergy 250 USB",
77 .norm = VIDEO_MODE_PAL,
78 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
79 .tda9887_conf = TDA9887_PRESENT,
81 .decoder = EM28XX_SAA7113,
83 .type = EM28XX_VMUX_TELEVISION,
87 .type = EM28XX_VMUX_COMPOSITE1,
91 .type = EM28XX_VMUX_SVIDEO,
96 [EM2820_BOARD_PINNACLE_USB_2] = {
97 .name = "Pinnacle PCTV USB 2",
99 .norm = VIDEO_MODE_PAL,
100 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
101 .tda9887_conf = TDA9887_PRESENT,
103 .decoder = EM28XX_SAA7113,
105 .type = EM28XX_VMUX_TELEVISION,
109 .type = EM28XX_VMUX_COMPOSITE1,
113 .type = EM28XX_VMUX_SVIDEO,
118 [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2] = {
119 .name = "Hauppauge WinTV USB 2",
121 .norm = VIDEO_MODE_NTSC,
122 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
123 .tda9887_conf = TDA9887_PRESENT|TDA9887_PORT1_ACTIVE|TDA9887_PORT2_ACTIVE,
125 .decoder = EM28XX_TVP5150,
127 /*FIXME: S-Video not tested */
129 .type = EM28XX_VMUX_TELEVISION,
133 .type = EM28XX_VMUX_SVIDEO,
138 [EM2820_BOARD_MSI_VOX_USB_2] = {
139 .name = "MSI VOX USB 2.0",
141 .norm = VIDEO_MODE_PAL,
142 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
143 .tda9887_conf = TDA9887_PRESENT|TDA9887_PORT1_ACTIVE|TDA9887_PORT2_ACTIVE,
145 .decoder = EM28XX_SAA7114,
147 .type = EM28XX_VMUX_TELEVISION,
151 .type = EM28XX_VMUX_COMPOSITE1,
155 .type = EM28XX_VMUX_SVIDEO,
160 [EM2800_BOARD_TERRATEC_CINERGY_200] = {
161 .name = "Terratec Cinergy 200 USB",
164 .norm = VIDEO_MODE_PAL,
165 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
166 .tda9887_conf = TDA9887_PRESENT,
168 .decoder = EM28XX_SAA7113,
170 .type = EM28XX_VMUX_TELEVISION,
174 .type = EM28XX_VMUX_COMPOSITE1,
178 .type = EM28XX_VMUX_SVIDEO,
183 [EM2800_BOARD_LEADTEK_WINFAST_USBII] = {
184 .name = "Leadtek Winfast USB II",
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_KWORLD_USB2800] = {
207 .name = "Kworld USB2800",
210 .norm = VIDEO_MODE_PAL,
211 .tuner_type = TUNER_PHILIPS_ATSC,
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 [EM2820_BOARD_PINNACLE_DVC_90] = {
230 .name = "Pinnacle Dazzle DVC 90",
232 .norm = VIDEO_MODE_PAL,
234 .decoder = EM28XX_SAA7113,
236 .type = EM28XX_VMUX_COMPOSITE1,
240 .type = EM28XX_VMUX_SVIDEO,
246 const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards);
248 /* table of devices that work with this driver */
249 struct usb_device_id em28xx_id_table [] = {
250 { USB_DEVICE(0xeb1a, 0x2800), .driver_info = EM2800_BOARD_UNKNOWN },
251 { USB_DEVICE(0xeb1a, 0x2820), .driver_info = EM2820_BOARD_MSI_VOX_USB_2 },
252 { USB_DEVICE(0x0ccd, 0x0036), .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 },
253 { USB_DEVICE(0x2304, 0x0208), .driver_info = EM2820_BOARD_PINNACLE_USB_2 },
254 { USB_DEVICE(0x2040, 0x4200), .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
255 { USB_DEVICE(0x2304, 0x0207), .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
259 void em28xx_card_setup(struct em28xx *dev)
261 /* request some modules */
262 if (dev->model == EM2820_BOARD_HAUPPAUGE_WINTV_USB_2) {
264 struct v4l2_audioout ao;
265 #ifdef CONFIG_MODULES
266 request_module("tveeprom");
267 request_module("ir-kbd-i2c");
268 request_module("msp3400");
270 /* Call first TVeeprom */
272 dev->i2c_client.addr = 0xa0 >> 1;
273 tveeprom_hauppauge_analog(&dev->i2c_client, &tv, dev->eedata);
275 dev->tuner_type= tv.tuner_type;
276 if (tv.audio_processor == AUDIO_CHIP_MSP34XX) {
278 memset (&ao,0,sizeof(ao));
281 ao.mode=V4L2_AUDMODE_32BITS;
282 em28xx_i2c_call_clients(dev, VIDIOC_S_AUDOUT, &ao);
288 EXPORT_SYMBOL(em28xx_boards);
289 EXPORT_SYMBOL(em28xx_bcount);
290 EXPORT_SYMBOL(em28xx_id_table);
292 MODULE_DEVICE_TABLE (usb, em28xx_id_table);