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_KWORLD_PVRTV2800RF] = {
76 .name = "Kworld PVR TV 2800 RF",
79 .norm = VIDEO_MODE_PAL,
80 .tda9887_conf = TDA9887_PRESENT,
82 .decoder = EM28XX_SAA7113,
84 .type = EM28XX_VMUX_COMPOSITE1,
88 .type = EM28XX_VMUX_SVIDEO,
93 [EM2820_BOARD_TERRATEC_CINERGY_250] = {
94 .name = "Terratec Cinergy 250 USB",
96 .norm = VIDEO_MODE_PAL,
97 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
98 .tda9887_conf = TDA9887_PRESENT,
100 .decoder = EM28XX_SAA7113,
102 .type = EM28XX_VMUX_TELEVISION,
106 .type = EM28XX_VMUX_COMPOSITE1,
110 .type = EM28XX_VMUX_SVIDEO,
115 [EM2820_BOARD_PINNACLE_USB_2] = {
116 .name = "Pinnacle PCTV USB 2",
118 .norm = VIDEO_MODE_PAL,
119 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
120 .tda9887_conf = TDA9887_PRESENT,
122 .decoder = EM28XX_SAA7113,
124 .type = EM28XX_VMUX_TELEVISION,
128 .type = EM28XX_VMUX_COMPOSITE1,
132 .type = EM28XX_VMUX_SVIDEO,
137 [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2] = {
138 .name = "Hauppauge WinTV USB 2",
140 .norm = VIDEO_MODE_NTSC,
141 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
142 .tda9887_conf = TDA9887_PRESENT|TDA9887_PORT1_ACTIVE|TDA9887_PORT2_ACTIVE,
144 .decoder = EM28XX_TVP5150,
146 /*FIXME: S-Video not tested */
148 .type = EM28XX_VMUX_TELEVISION,
152 .type = EM28XX_VMUX_SVIDEO,
157 [EM2820_BOARD_MSI_VOX_USB_2] = {
158 .name = "MSI VOX USB 2.0",
160 .norm = VIDEO_MODE_PAL,
161 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
162 .tda9887_conf = TDA9887_PRESENT|TDA9887_PORT1_ACTIVE|TDA9887_PORT2_ACTIVE,
164 .decoder = EM28XX_SAA7114,
166 .type = EM28XX_VMUX_TELEVISION,
170 .type = EM28XX_VMUX_COMPOSITE1,
174 .type = EM28XX_VMUX_SVIDEO,
179 [EM2800_BOARD_TERRATEC_CINERGY_200] = {
180 .name = "Terratec Cinergy 200 USB",
183 .norm = VIDEO_MODE_PAL,
184 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
185 .tda9887_conf = TDA9887_PRESENT,
187 .decoder = EM28XX_SAA7113,
189 .type = EM28XX_VMUX_TELEVISION,
193 .type = EM28XX_VMUX_COMPOSITE1,
197 .type = EM28XX_VMUX_SVIDEO,
202 [EM2800_BOARD_LEADTEK_WINFAST_USBII] = {
203 .name = "Leadtek Winfast USB II",
206 .norm = VIDEO_MODE_PAL,
207 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
208 .tda9887_conf = TDA9887_PRESENT,
210 .decoder = EM28XX_SAA7113,
212 .type = EM28XX_VMUX_TELEVISION,
216 .type = EM28XX_VMUX_COMPOSITE1,
220 .type = EM28XX_VMUX_SVIDEO,
225 [EM2800_BOARD_KWORLD_USB2800] = {
226 .name = "Kworld USB2800",
229 .norm = VIDEO_MODE_PAL,
230 .tuner_type = TUNER_PHILIPS_ATSC,
231 .tda9887_conf = TDA9887_PRESENT,
233 .decoder = EM28XX_SAA7113,
235 .type = EM28XX_VMUX_TELEVISION,
239 .type = EM28XX_VMUX_COMPOSITE1,
243 .type = EM28XX_VMUX_SVIDEO,
248 [EM2820_BOARD_PINNACLE_DVC_90] = {
249 .name = "Pinnacle Dazzle DVC 90",
251 .norm = VIDEO_MODE_PAL,
253 .decoder = EM28XX_SAA7113,
255 .type = EM28XX_VMUX_COMPOSITE1,
259 .type = EM28XX_VMUX_SVIDEO,
265 const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards);
267 /* table of devices that work with this driver */
268 struct usb_device_id em28xx_id_table [] = {
269 { USB_DEVICE(0xeb1a, 0x2800), .driver_info = EM2800_BOARD_UNKNOWN },
270 { USB_DEVICE(0xeb1a, 0x2820), .driver_info = EM2820_BOARD_MSI_VOX_USB_2 },
271 { USB_DEVICE(0x0ccd, 0x0036), .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 },
272 { USB_DEVICE(0x2304, 0x0208), .driver_info = EM2820_BOARD_PINNACLE_USB_2 },
273 { USB_DEVICE(0x2040, 0x4200), .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
274 { USB_DEVICE(0x2304, 0x0207), .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
278 void em28xx_pre_card_setup(struct em28xx *dev)
280 /* request some modules */
282 case EM2880_BOARD_TERRATEC_PRODIGY_XS:
283 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
284 case EM2880_BOARD_TERRATEC_HYBRID_XS:
286 em28xx_write_regs_req(dev, 0x00, 0x08, "\x7d", 1); // reset through GPIO?
292 void em28xx_card_setup(struct em28xx *dev)
294 /* request some modules */
296 case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2:
299 #ifdef CONFIG_MODULES
300 request_module("tveeprom");
301 request_module("ir-kbd-i2c");
302 request_module("msp3400");
304 /* Call first TVeeprom */
306 dev->i2c_client.addr = 0xa0 >> 1;
307 tveeprom_hauppauge_analog(&dev->i2c_client, &tv, dev->eedata);
309 dev->tuner_type= tv.tuner_type;
310 if (tv.audio_processor == AUDIO_CHIP_MSP34XX) {
311 dev->i2s_speed=2048000;
317 case EM2820_BOARD_KWORLD_PVRTV2800RF:
319 em28xx_write_regs_req(dev,0x00,0x08, "\xf9", 1); // GPIO enables sound on KWORLD PVR TV 2800RF
326 EXPORT_SYMBOL(em28xx_boards);
327 EXPORT_SYMBOL(em28xx_bcount);
328 EXPORT_SYMBOL(em28xx_id_table);
330 MODULE_DEVICE_TABLE (usb, em28xx_id_table);