2 em2820-cards.c - driver for Empia 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 "audiochip.h"
38 enum em2820_board_entry {
39 EM2820_BOARD_TERRATEC_CINERGY_250,
40 EM2820_BOARD_PINNACLE_USB_2,
41 EM2820_BOARD_HAUPPAUGE_WINTV_USB_2,
42 EM2820_BOARD_MSI_VOX_USB_2
45 struct em2820_board em2820_boards[] = {
46 [EM2820_BOARD_TERRATEC_CINERGY_250] = {
47 .name = "Terratec Cinergy 250 USB",
49 .norm = VIDEO_MODE_PAL,
50 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
51 .tda9887_conf = TDA9887_PRESENT,
53 .decoder = EM2820_SAA7113,
55 .type = EM2820_VMUX_TELEVISION,
59 .type = EM2820_VMUX_COMPOSITE1,
63 .type = EM2820_VMUX_SVIDEO,
68 [EM2820_BOARD_PINNACLE_USB_2] = {
69 .name = "Pinnacle PCTV USB 2",
71 .norm = VIDEO_MODE_PAL,
72 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
73 .tda9887_conf = TDA9887_PRESENT,
75 .decoder = EM2820_SAA7113,
77 .type = EM2820_VMUX_TELEVISION,
81 .type = EM2820_VMUX_COMPOSITE1,
85 .type = EM2820_VMUX_SVIDEO,
90 [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2] = {
91 .name = "Hauppauge WinTV USB 2",
93 .norm = VIDEO_MODE_NTSC,
94 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
95 .tda9887_conf = TDA9887_PRESENT|TDA9887_PORT1_ACTIVE|TDA9887_PORT2_ACTIVE,
97 .decoder = EM2820_TVP5150,
99 /*FIXME: S-Video not tested */
101 .type = EM2820_VMUX_TELEVISION,
105 .type = EM2820_VMUX_SVIDEO,
110 [EM2820_BOARD_MSI_VOX_USB_2] = {
111 .name = "MSI VOX USB 2.0",
113 .norm = VIDEO_MODE_PAL,
114 .tuner_type = TUNER_PHILIPS_PAL,
115 .tda9887_conf = TDA9887_PRESENT|TDA9887_PORT1_ACTIVE|TDA9887_PORT2_ACTIVE,
117 .decoder = EM2820_SAA7114,
119 .type = EM2820_VMUX_TELEVISION,
123 .type = EM2820_VMUX_COMPOSITE1,
127 .type = EM2820_VMUX_SVIDEO,
132 { } /* Terminating entry */
135 /* table of devices that work with this driver */
136 struct usb_device_id em2820_id_table [] = {
137 /* Terratec Cinerhy 200 USB: em2800 nor supported, at the moment */
138 /* { USB_DEVICE(0xeb1a, 0x2800), .driver_info = EM2800_BOARD_TERRATEC_CINERGY_200 }, */
139 { USB_DEVICE(0x0ccd, 0x0036), .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 },
140 { USB_DEVICE(0x2304, 0x0208), .driver_info = EM2820_BOARD_PINNACLE_USB_2 },
141 { USB_DEVICE(0x2040, 0x4200), .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
142 { USB_DEVICE(0xeb1a, 0x2820), .driver_info = EM2820_BOARD_MSI_VOX_USB_2 },
146 void em2820_card_setup(struct em2820 *dev)
148 /* request some modules */
149 if (dev->model == EM2820_BOARD_HAUPPAUGE_WINTV_USB_2) {
151 #ifdef CONFIG_MODULES
152 request_module("tveeprom");
154 /* Call first TVeeprom */
156 tveeprom_hauppauge_analog(&dev->i2c_client, &tv, dev->eedata);
158 dev->tuner_type= tv.tuner_type;
159 if (tv.audio_processor == AUDIO_CHIP_MSP34XX) {
161 } else dev->has_msp34xx=0;
165 EXPORT_SYMBOL(em2820_boards);
166 EXPORT_SYMBOL(em2820_id_table);
168 MODULE_DEVICE_TABLE (usb, em2820_id_table);