aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx/em28xx-cards.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-cards.c')
-rw-r--r--drivers/media/video/em28xx/em28xx-cards.c105
1 files changed, 87 insertions, 18 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index fe0ee4518479..368a766eb802 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -42,12 +42,36 @@ static int tuner = -1;
42module_param(tuner, int, 0444); 42module_param(tuner, int, 0444);
43MODULE_PARM_DESC(tuner, "tuner type"); 43MODULE_PARM_DESC(tuner, "tuner type");
44 44
45static unsigned int disable_ir;
46module_param(disable_ir, int, 0444);
47MODULE_PARM_DESC(disable_ir, "disable infrared remote support");
48
45struct em28xx_hash_table { 49struct em28xx_hash_table {
46 unsigned long hash; 50 unsigned long hash;
47 unsigned int model; 51 unsigned int model;
48 unsigned int tuner; 52 unsigned int tuner;
49}; 53};
50 54
55/* Boards supported by driver */
56
57#define EM2800_BOARD_UNKNOWN 0
58#define EM2820_BOARD_UNKNOWN 1
59#define EM2820_BOARD_TERRATEC_CINERGY_250 2
60#define EM2820_BOARD_PINNACLE_USB_2 3
61#define EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 4
62#define EM2820_BOARD_MSI_VOX_USB_2 5
63#define EM2800_BOARD_TERRATEC_CINERGY_200 6
64#define EM2800_BOARD_LEADTEK_WINFAST_USBII 7
65#define EM2800_BOARD_KWORLD_USB2800 8
66#define EM2820_BOARD_PINNACLE_DVC_90 9
67#define EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 10
68#define EM2880_BOARD_TERRATEC_HYBRID_XS 11
69#define EM2820_BOARD_KWORLD_PVRTV2800RF 12
70#define EM2880_BOARD_TERRATEC_PRODIGY_XS 13
71#define EM2820_BOARD_PROLINK_PLAYTV_USB2 14
72#define EM2800_BOARD_VGEAR_POCKETTV 15
73#define EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950 16
74
51struct em28xx_board em28xx_boards[] = { 75struct em28xx_board em28xx_boards[] = {
52 [EM2800_BOARD_UNKNOWN] = { 76 [EM2800_BOARD_UNKNOWN] = {
53 .name = "Unknown EM2800 video grabber", 77 .name = "Unknown EM2800 video grabber",
@@ -245,26 +269,28 @@ struct em28xx_board em28xx_boards[] = {
245 } }, 269 } },
246 }, 270 },
247 [EM2820_BOARD_MSI_VOX_USB_2] = { 271 [EM2820_BOARD_MSI_VOX_USB_2] = {
248 .name = "MSI VOX USB 2.0", 272 .name = "MSI VOX USB 2.0",
249 .vchannels = 3, 273 .vchannels = 3,
250 .tuner_type = TUNER_LG_PAL_NEW_TAPC, 274 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
251 .tda9887_conf = TDA9887_PRESENT | 275 .tda9887_conf = TDA9887_PRESENT |
252 TDA9887_PORT1_ACTIVE | 276 TDA9887_PORT1_ACTIVE |
253 TDA9887_PORT2_ACTIVE, 277 TDA9887_PORT2_ACTIVE,
254 .has_tuner = 1, 278 .has_tuner = 1,
255 .decoder = EM28XX_SAA7114, 279 .max_range_640_480 = 1,
256 .input = { { 280
257 .type = EM28XX_VMUX_TELEVISION, 281 .decoder = EM28XX_SAA7114,
258 .vmux = SAA7115_COMPOSITE4, 282 .input = { {
259 .amux = 0, 283 .type = EM28XX_VMUX_TELEVISION,
284 .vmux = SAA7115_COMPOSITE4,
285 .amux = 0,
260 }, { 286 }, {
261 .type = EM28XX_VMUX_COMPOSITE1, 287 .type = EM28XX_VMUX_COMPOSITE1,
262 .vmux = SAA7115_COMPOSITE0, 288 .vmux = SAA7115_COMPOSITE0,
263 .amux = 1, 289 .amux = 1,
264 }, { 290 }, {
265 .type = EM28XX_VMUX_SVIDEO, 291 .type = EM28XX_VMUX_SVIDEO,
266 .vmux = SAA7115_SVIDEO3, 292 .vmux = SAA7115_SVIDEO3,
267 .amux = 1, 293 .amux = 1,
268 } }, 294 } },
269 }, 295 },
270 [EM2800_BOARD_TERRATEC_CINERGY_200] = { 296 [EM2800_BOARD_TERRATEC_CINERGY_200] = {
@@ -649,11 +675,54 @@ static void em28xx_set_model(struct em28xx *dev)
649 dev->video_inputs = em28xx_boards[dev->model].vchannels; 675 dev->video_inputs = em28xx_boards[dev->model].vchannels;
650 dev->analog_gpio = em28xx_boards[dev->model].analog_gpio; 676 dev->analog_gpio = em28xx_boards[dev->model].analog_gpio;
651 dev->has_12mhz_i2s = em28xx_boards[dev->model].has_12mhz_i2s; 677 dev->has_12mhz_i2s = em28xx_boards[dev->model].has_12mhz_i2s;
678 dev->max_range_640_480 = em28xx_boards[dev->model].max_range_640_480;
652 679
653 if (!em28xx_boards[dev->model].has_tuner) 680 if (!em28xx_boards[dev->model].has_tuner)
654 dev->tuner_type = UNSET; 681 dev->tuner_type = UNSET;
655} 682}
656 683
684/* ----------------------------------------------------------------------- */
685void em28xx_set_ir(struct em28xx *dev, struct IR_i2c *ir)
686{
687 if (disable_ir) {
688 ir->get_key = NULL;
689 return ;
690 }
691
692 /* detect & configure */
693 switch (dev->model) {
694 case (EM2800_BOARD_UNKNOWN):
695 break;
696 case (EM2820_BOARD_UNKNOWN):
697 break;
698 case (EM2800_BOARD_TERRATEC_CINERGY_200):
699 case (EM2820_BOARD_TERRATEC_CINERGY_250):
700 ir->ir_codes = ir_codes_em_terratec;
701 ir->get_key = em28xx_get_key_terratec;
702 snprintf(ir->c.name, sizeof(ir->c.name),
703 "i2c IR (EM28XX Terratec)");
704 break;
705 case (EM2820_BOARD_PINNACLE_USB_2):
706 ir->ir_codes = ir_codes_pinnacle_grey;
707 ir->get_key = em28xx_get_key_pinnacle_usb_grey;
708 snprintf(ir->c.name, sizeof(ir->c.name),
709 "i2c IR (EM28XX Pinnacle PCTV)");
710 break;
711 case (EM2820_BOARD_HAUPPAUGE_WINTV_USB_2):
712 ir->ir_codes = ir_codes_hauppauge_new;
713 ir->get_key = em28xx_get_key_em_haup;
714 snprintf(ir->c.name, sizeof(ir->c.name),
715 "i2c IR (EM2840 Hauppauge)");
716 break;
717 case (EM2820_BOARD_MSI_VOX_USB_2):
718 break;
719 case (EM2800_BOARD_LEADTEK_WINFAST_USBII):
720 break;
721 case (EM2800_BOARD_KWORLD_USB2800):
722 break;
723 }
724}
725
657void em28xx_card_setup(struct em28xx *dev) 726void em28xx_card_setup(struct em28xx *dev)
658{ 727{
659 em28xx_set_model(dev); 728 em28xx_set_model(dev);