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/msp3400.h>
32 #include <media/tveeprom.h>
33 #include <media/audiochip.h>
34 #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,
150 .amux = MSP_INPUT_DEFAULT,
152 .type = EM28XX_VMUX_SVIDEO,
154 .amux = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1,
155 MSP_DSP_IN_SCART, MSP_DSP_IN_SCART),
158 [EM2820_BOARD_MSI_VOX_USB_2] = {
159 .name = "MSI VOX USB 2.0",
161 .norm = VIDEO_MODE_PAL,
162 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
163 .tda9887_conf = TDA9887_PRESENT|TDA9887_PORT1_ACTIVE|TDA9887_PORT2_ACTIVE,
165 .decoder = EM28XX_SAA7114,
167 .type = EM28XX_VMUX_TELEVISION,
171 .type = EM28XX_VMUX_COMPOSITE1,
175 .type = EM28XX_VMUX_SVIDEO,
180 [EM2800_BOARD_TERRATEC_CINERGY_200] = {
181 .name = "Terratec Cinergy 200 USB",
184 .norm = VIDEO_MODE_PAL,
185 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
186 .tda9887_conf = TDA9887_PRESENT,
188 .decoder = EM28XX_SAA7113,
190 .type = EM28XX_VMUX_TELEVISION,
194 .type = EM28XX_VMUX_COMPOSITE1,
198 .type = EM28XX_VMUX_SVIDEO,
203 [EM2800_BOARD_LEADTEK_WINFAST_USBII] = {
204 .name = "Leadtek Winfast USB II",
207 .norm = VIDEO_MODE_PAL,
208 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
209 .tda9887_conf = TDA9887_PRESENT,
211 .decoder = EM28XX_SAA7113,
213 .type = EM28XX_VMUX_TELEVISION,
217 .type = EM28XX_VMUX_COMPOSITE1,
221 .type = EM28XX_VMUX_SVIDEO,
226 [EM2800_BOARD_KWORLD_USB2800] = {
227 .name = "Kworld USB2800",
230 .norm = VIDEO_MODE_PAL,
231 .tuner_type = TUNER_PHILIPS_ATSC,
232 .tda9887_conf = TDA9887_PRESENT,
234 .decoder = EM28XX_SAA7113,
236 .type = EM28XX_VMUX_TELEVISION,
240 .type = EM28XX_VMUX_COMPOSITE1,
244 .type = EM28XX_VMUX_SVIDEO,
249 [EM2820_BOARD_PINNACLE_DVC_90] = {
250 .name = "Pinnacle Dazzle DVC 90",
252 .norm = VIDEO_MODE_PAL,
254 .decoder = EM28XX_SAA7113,
256 .type = EM28XX_VMUX_COMPOSITE1,
260 .type = EM28XX_VMUX_SVIDEO,
266 const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards);
268 /* table of devices that work with this driver */
269 struct usb_device_id em28xx_id_table [] = {
270 { USB_DEVICE(0xeb1a, 0x2800), .driver_info = EM2800_BOARD_UNKNOWN },
271 { USB_DEVICE(0xeb1a, 0x2820), .driver_info = EM2820_BOARD_MSI_VOX_USB_2 },
272 { USB_DEVICE(0x0ccd, 0x0036), .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 },
273 { USB_DEVICE(0x2304, 0x0208), .driver_info = EM2820_BOARD_PINNACLE_USB_2 },
274 { USB_DEVICE(0x2040, 0x4200), .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
275 { USB_DEVICE(0x2304, 0x0207), .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
279 void em28xx_pre_card_setup(struct em28xx *dev)
281 /* request some modules */
283 case EM2880_BOARD_TERRATEC_PRODIGY_XS:
284 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
285 case EM2880_BOARD_TERRATEC_HYBRID_XS:
287 em28xx_write_regs_req(dev, 0x00, 0x08, "\x7d", 1); // reset through GPIO?
293 void em28xx_card_setup(struct em28xx *dev)
295 /* request some modules */
297 case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2:
300 #ifdef CONFIG_MODULES
301 request_module("tveeprom");
302 request_module("ir-kbd-i2c");
303 request_module("msp3400");
305 /* Call first TVeeprom */
307 dev->i2c_client.addr = 0xa0 >> 1;
308 tveeprom_hauppauge_analog(&dev->i2c_client, &tv, dev->eedata);
310 dev->tuner_type= tv.tuner_type;
311 if (tv.audio_processor == AUDIO_CHIP_MSP34XX) {
312 dev->i2s_speed=2048000;
318 case EM2820_BOARD_KWORLD_PVRTV2800RF:
320 em28xx_write_regs_req(dev,0x00,0x08, "\xf9", 1); // GPIO enables sound on KWORLD PVR TV 2800RF
327 EXPORT_SYMBOL(em28xx_boards);
328 EXPORT_SYMBOL(em28xx_bcount);
329 EXPORT_SYMBOL(em28xx_id_table);
331 MODULE_DEVICE_TABLE (usb, em28xx_id_table);