patch-2.4.8 linux/drivers/media/video/bttv-cards.c

Next file: linux/drivers/media/video/bttv-driver.c
Previous file: linux/drivers/media/video/bt856.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.7/linux/drivers/media/video/bttv-cards.c linux/drivers/media/video/bttv-cards.c
@@ -46,13 +46,16 @@
 #endif
 
 static void winview_audio(struct bttv *btv, struct video_audio *v, int set);
+static void lt9415_audio(struct bttv *btv, struct video_audio *v, int set);
 static void avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v,
 				    int set);
 static void terratv_audio(struct bttv *btv, struct video_audio *v, int set);
 static void gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set);
+static void winfast2000_audio(struct bttv *btv, struct video_audio *v, int set);
 
 /* config variables */
 static int triton1=0;
+static int vsfx=0;
 int no_overlay=-1;
 static unsigned int card[4]  = { -1, -1, -1, -1 };
 static unsigned int pll[4]   = { -1, -1, -1, -1 };
@@ -111,38 +114,55 @@
 	int cardnr;
 	char *name;
 } cards[] __devinitdata = {
-	{ 0x00011002, BTTV_HAUPPAUGE878,  "ATI TV Wonder" },
-	{ 0x00011461, BTTV_AVPHONE98,     "AVerMedia TVPhone98" },
-	{ 0x00021461, BTTV_AVERMEDIA98,   "Avermedia TVCapture 98" },
-	{ 0x00031002, BTTV_HAUPPAUGE878,  "ATI TV Wonder/VE" },
-	{ 0x00031461, BTTV_AVPHONE98,     "AVerMedia TVPhone98" },
-	{ 0x00041461, BTTV_AVERMEDIA98,   "AVerMedia TVCapture 98" },
-	{ 0x010114c7, 16 /* FIXME */,     "Modular Technology PCTV" },
-	{ 0x10b42636, BTTV_HAUPPAUGE878,  "STB ???" },
-	{ 0x1118153b, BTTV_TERRATVALUE,   "Terratec TV Value" },
-	{ 0x1123153b, BTTV_TERRATVRADIO,  "Terratec TV/Radio+" },
-	{ 0x1200bd11, BTTV_PINNACLE,      "Pinnacle PCTV" },
 	{ 0x13eb0070, BTTV_HAUPPAUGE878,  "Hauppauge WinTV" },
-	{ 0x18501851, BTTV_CHRONOS_VS2,   "Chronos Video Shuttle II" },
-	{ 0x18521852, BTTV_TYPHOON_TVIEW, "Typhoon TView TV/FM Tuner" },
-	{ 0x217d6606, BTTV_WINFAST2000,   "Leadtek WinFast TV 2000" },
+	{ 0x39000070, BTTV_HAUPPAUGE878,  "Hauppauge WinTV-D" },
+	{ 0x45000070, BTTV_HAUPPAUGE878,  "Hauppauge WinTV/PVR" },
+	{ 0xff000070, BTTV_HAUPPAUGE878,  "Osprey-100" },
+	{ 0xff010070, BTTV_HAUPPAUGE878,  "Osprey-200" },
+
+	{ 0x00011002, BTTV_ATI_TVWONDER,  "ATI TV Wonder" },
+	{ 0x00031002, BTTV_ATI_TVWONDERVE,"ATI TV Wonder/VE" },
+
+	{ 0x6606107d, BTTV_WINFAST2000,   "Leadtek WinFast TV 2000" },
 	{ 0x263610b4, BTTV_STB2,          "STB TV PCI FM, P/N 6000704" },
+ 	{ 0x402010fc, BTTV_GVBCTV3PCI,    "I-O Data Co. GV-BCV3/PCI" },
+	{ 0x405010fc, BTTV_GVBCTV3PCI,    "I-O Data Co. GV-BCV4/PCI" },
+	{ 0x001211bd, BTTV_PINNACLE,      "Pinnacle PCTV" },
 	{ 0x3000121a, 0/* no entry yet */,"VoodooTV 200" },
+
 	{ 0x3000144f, BTTV_MAGICTVIEW063, "TView 99 (CPH063)" },
-	{ 0x300014ff, BTTV_MAGICTVIEW061, "TView 99 (CPH061)" },
 	{ 0x3002144f, BTTV_MAGICTVIEW061, "Askey Magic TView" },
+
+	{ 0x00011461, BTTV_AVPHONE98,     "AVerMedia TVPhone98" },
+	{ 0x00021461, BTTV_AVERMEDIA98,   "AVermedia TVCapture 98" },
+	{ 0x00031461, BTTV_AVPHONE98,     "AVerMedia TVPhone98" },
+	{ 0x00041461, BTTV_AVERMEDIA98,   "AVerMedia TVCapture 98" },
+
+	{ 0x300014ff, BTTV_MAGICTVIEW061, "TView 99 (CPH061)" },
 	{ 0x300214ff, BTTV_PHOEBE_TVMAS,  "Phoebe TV Master" },
-	{ 0x39000070, BTTV_HAUPPAUGE878,  "Hauppauge WinTV-D" },
+
+	{ 0x1117153b, BTTV_TERRATVALUE,   "Terratec TValue" },
+	{ 0x1118153b, BTTV_TERRATVALUE,   "Terratec TValue" },
+	{ 0x1119153b, BTTV_TERRATVALUE,   "Terratec TValue" },
+	{ 0x111a153b, BTTV_TERRATVALUE,   "Terratec TValue" },
+	{ 0x1123153b, BTTV_TERRATVRADIO,  "Terratec TV Radio+" },
+	{ 0x1127153b, BTTV_TERRATV,       "Terratec TV+"    },
+	{ 0x1134153b, BTTV_TERRATVALUE,   "Terratec TValue" },
+	{ 0x1135153b, BTTV_TERRATVALUER,  "Terratec TValue Radio" },
+
 	{ 0x400a15b0, BTTV_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
 	{ 0x400d15b0, BTTV_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
 	{ 0x401015b0, BTTV_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
- 	{ 0x402010fc, BTTV_GVBCTV3PCI,    "I-O Data Co. GV-BCV3/PCI" },
-	{ 0xff000070, BTTV_HAUPPAUGE878,  "Osprey-100" },
-	{ 0xff010070, BTTV_HAUPPAUGE878,  "Osprey-200" },
-#if 0 /* probably wrong */
-	{ 0x14610002, BTTV_AVERMEDIA98,   "Avermedia TVCapture 98" },
-	{ 0x6606217d, BTTV_WINFAST2000,   "Leadtek WinFast TV 2000" },
-#endif
+
+    	{ 0x010115cb, BTTV_GMV1,          "AG GMV1" },
+	{ 0x010114c7, 16 /* FIXME */,     "Modular Technology PCTV" },
+	{ 0x18501851, BTTV_CHRONOS_VS2,   "Chronos Video Shuttle II" },
+	{ 0x18511851, 0 /* FIXME */,      "CyberMail AV" },
+	{ 0x18521852, BTTV_TYPHOON_TVIEW, "Typhoon TView TV/FM Tuner" },
+	{ 0x10b42636, BTTV_HAUPPAUGE878,  "STB ???" },
+	{ 0x217d6606, BTTV_WINFAST2000,   "Leadtek WinFast TV 2000" },
+	{ 0x1200bd11, BTTV_PINNACLE,      "Pinnacle PCTV" },
+
 	{ 0, -1, NULL }
 };
 
@@ -223,13 +243,10 @@
 	audio_inputs:	1,
 	tuner:		0,
 	svhs:		3,
-	/* old 
-	gpiomask:	15,
-	audiomux:	{12, 4,11,11, 0},
-	*/
 	muxsel:		{ 2, 3, 1, 1},
 	gpiomask:	0x0f,
-	audiomux:	{ 0x04, 0x04, 0x08, 0x04, 0},
+	audiomux:	{ 0x0c, 0x04, 0x08, 0x04, 0},
+	/*                0x04 for some cards ?? */
 	needs_tvaudio:	1,
 	tuner_type:	-1,
 	audio_hook:	avermedia_tvphone_audio,
@@ -286,9 +303,9 @@
 	audio_inputs:	1,
 	tuner:		0,
 	svhs:		2,
-	gpiomask:	0x3000f,
+	gpiomask:	0x3014f,
 	muxsel:		{ 2, 3, 1, 1},
-	audiomux:	{ 1,0x10001, 0, 0,10},
+	audiomux:	{ 0x20001,0x10001, 0, 0,10},
 	needs_tvaudio:	1,
 	tuner_type:	-1,
 },{
@@ -490,7 +507,7 @@
 	muxsel:		{ 2, 3, 1, 1},
 	audiomux:	{ 0x20000, 0x30000, 0x10000, 0x00000, 0x40000},
 	needs_tvaudio:	1,
-	tuner_type:	-1,
+	tuner_type:	TUNER_PHILIPS_PAL,
 	audio_hook:	terratv_audio,
 },{
 	/* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */
@@ -556,12 +573,13 @@
 	audio_inputs:	1,
 	tuner:		0,
 	svhs:		2,
-	gpiomask:	0xfff000,
+	gpiomask:	0xc33000,
 	muxsel:		{ 2, 3, 1, 1,0},
-	audiomux:	{ 0x621000,0x6ddf07,0x621100,0x620000,0xE210000,0x620000},
-	needs_tvaudio:	1,
+	audiomux:	{ 0x422000,0x001000,0x621100,0x620000,0x800000,0x620000},
+	needs_tvaudio:	0,
 	pll:		PLL_28,
 	tuner_type:	-1,
+	audio_hook:	winfast2000_audio,
 },{
 	name:		"Chronos Video Shuttle II",
 	video_inputs:	3,
@@ -808,7 +826,7 @@
 		options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
 		audiomux=0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
 		options tuner type=5 */
-	name:		"Livetec 9415 TV",
+	name:		"Lifetec LT 9415 TV",
 	video_inputs:	4,
 	audio_inputs:	1,
 	tuner:		0,
@@ -816,10 +834,15 @@
 	gpiomask:	0x18e0,
 	muxsel:		{ 2, 3, 1, 1},
 	audiomux:	{ 0x0000,0x0800,0x1000,0x1000,0x18e0 },
+		       /* 0x0000: Tuner normal stereo
+			  0x0080: Tuner A2 SAP (second audio program = Zweikanalton)
+			  0x0880: Tuner A2 stereo */
 	pll:		PLL_28,
 	tuner_type:	TUNER_PHILIPS_PAL,
+	audio_hook:	lt9415_audio,
 },{
-	/* Miguel Angel Alvarez <maacruz@navegalia.com> */
+	/* Miguel Angel Alvarez <maacruz@navegalia.com>
+	   old Easy TV BT848 version (model CPH031) */
 	name:           "BESTBUY Easy TV",
 	video_inputs:	4,
 	audio_inputs:   1,
@@ -830,22 +853,22 @@
 	audiomux:       { 2, 0, 0, 0, 10},
 	needs_tvaudio:  0,
 	pll:		PLL_28,
-	tuner_type:	TUNER_TEMIC_PAL_I,
+	tuner_type:	TUNER_TEMIC_PAL,
 },{
 
 /* ---- card 0x38 ---------------------------------- */
-	/* Gordon Heydon <gjheydon@bigfoot.com */
+	/* Gordon Heydon <gjheydon@bigfoot.com ('98) */
 	name:           "FlyVideo '98/FM",
 	video_inputs:   3,
 	audio_inputs:   3,
 	tuner:          0,
 	svhs:           2,
 	gpiomask:       0x1800,
-	muxsel:         { 2, 3, 1, 1},
+	muxsel:         { 2, 3, 0, 1},
 	audiomux:       { 0, 0x800, 0, 0, 0x1800, 0 },
 	needs_tvaudio:  1,
 	pll:            PLL_28,
-	tuner_type:     -1,
+	tuner_type:     5,
 },{
 	/* This is the ultimate cheapo capture card 
 	 * just a BT848A on a small PCB!
@@ -875,6 +898,112 @@
         needs_tvaudio:  1,
         pll:            PLL_NONE,
         tuner_type:     TUNER_TEMIC_4036FY5_NTSC,
+},{
+	/* Matti Mottus <mottus@physic.ut.ee> */
+	name:		"TV Capturer",
+	video_inputs:	4,
+	audio_inputs:	1,
+	tuner:		0,
+	svhs:		2,
+        gpiomask:       0x03000F,
+	muxsel:		{ 2, 3, 1, 0},
+        audiomux:       { 2,0,0,0,1 },
+	pll:            PLL_28,
+	tuner_type:	0,
+},{
+
+/* ---- card 0x3c ---------------------------------- */
+	/* Philip Blundell <philb@gnu.org> */
+	name:           "MM100PCTV",
+	video_inputs:   2,
+	audio_inputs:   2,
+	gpiomask:       11,
+	muxsel:         { 2, 3, 1, 1},
+	audiomux:       { 2, 0, 0, 1, 8},
+	pll:            PLL_NONE,
+	tuner_type:     TUNER_TEMIC_PAL,
+
+},{
+	/* Adrian Cox <adrian@humboldt.co.uk */
+	name:	        "AG Electronics GMV1",
+	video_inputs:   2,
+	audio_inputs:   0,
+	tuner:	        -1,
+	svhs:	        1,
+	gpiomask:       0xF,
+	muxsel:	        { 2, 2},
+	audiomux:       { },
+	no_msp34xx:     1,
+	needs_tvaudio:  0,
+	pll:	        PLL_28,
+	tuner_type:     -1,
+},{
+	/* Miguel Angel Alvarez <maacruz@navegalia.com>
+	   new Easy TV BT878 version (model CPH061) 
+	   special thanks to Informatica Mieres for providing the card */
+	name:           "BESTBUY Easy TV (bt878)",
+	video_inputs:	3,
+	audio_inputs:   2,
+	tuner:          0,
+	svhs:           2,
+	gpiomask:       0xFF,
+	muxsel:         { 2, 3, 1, 0},
+	audiomux:       { 1, 0, 4, 4, 9},
+	needs_tvaudio:  0,
+	pll:		PLL_28,
+	tuner_type:	TUNER_PHILIPS_PAL,
+},{
+	/* Lukas Gebauer <geby@volny.cz> */
+	name:		"ATI TV-Wonder",
+	video_inputs:	3,
+	audio_inputs:	1,
+	tuner:		0,
+	svhs:		2,
+	gpiomask:	0xf03f,
+	muxsel:		{ 2, 3, 0, 1},
+	audiomux:	{ 0xbffe, 0, 0xbfff, 0, 0xbffe},
+	pll:		PLL_28,
+	tuner_type:	TUNER_TEMIC_4006FN5_MULTI_PAL,
+},{
+
+/* ---- card 0x40 ---------------------------------- */
+	/* Lukas Gebauer <geby@volny.cz> */
+	name:		"ATI TV-Wonder VE",
+	video_inputs:	2,
+	audio_inputs:	1,
+	tuner:		0,
+	svhs:		-1,
+	gpiomask:	1,
+	muxsel:		{ 2, 3, 0, 1},
+	audiomux:	{ 0, 0, 1, 0, 0},
+	no_msp34xx:	1,
+	pll:		PLL_28,
+	tuner_type:	TUNER_TEMIC_4006FN5_MULTI_PAL,
+},{
+	/* DeeJay <deejay@westel900.net (2000S) */
+	name:           "FlyVideo 2000S",
+	video_inputs:   3,
+	audio_inputs:   3,
+	tuner:          0,
+	svhs:           2,
+	gpiomask:	0x18e0,
+	muxsel:		{ 2, 3, 0, 1},
+	audiomux:	{ 0,0x18e0,0x1000,0x1000,0x1080, 0x1080 },
+	needs_tvaudio:  1,
+	pll:            PLL_28,
+	tuner_type:     5,
+},{
+	name:		"Terratec TValueRadio",
+	video_inputs:	3,
+	audio_inputs:	1,
+	tuner:		0,
+	svhs:		2,
+	gpiomask:	0xffff00,
+	muxsel:		{ 2, 3, 1, 1},
+	audiomux:	{ 0x500, 0x500, 0x300, 0x900, 0x900},
+	needs_tvaudio:	1,
+	pll:		PLL_28,
+	tuner_type:	TUNER_PHILIPS_PAL,
 }};
 
 const int bttv_num_tvcards = (sizeof(bttv_tvcards)/sizeof(struct tvcard));
@@ -1031,6 +1160,14 @@
 		btv->mbox_mask    = 0x38;
 	}
 
+	if (btv->type == BTTV_LIFETEC_9415) {
+		if (btread(BT848_GPIO_DATA) & 0x4000)
+			printk("bttv%d: lifetec: tv mono/fm stereo card\n", btv->nr);
+		else
+			printk("bttv%d: lifetec: stereo(TDA9821) card\n",btv->nr);
+		btv->has_radio=1;
+	}
+
 	/* pll configuration */
         if (!(btv->id==848 && btv->revision==0x11)) {
 		/* defaults from card list */
@@ -1149,19 +1286,19 @@
         { TUNER_TEMIC_4066FY5_PAL_I, "Temic 4066FY5" },
         { TUNER_ABSENT,        "Philips TD1536" },
         { TUNER_ABSENT,        "Philips TD1536D" },
-        { TUNER_ABSENT,        "Philips FMR1236" },
+	{ TUNER_PHILIPS_NTSC,  "Philips FMR1236" }, /* mono radio */
         { TUNER_ABSENT,        "Philips FI1256MP" },
         { TUNER_ABSENT,        "Samsung TCPQ9091P" },
         { TUNER_TEMIC_4006FN5_MULTI_PAL, "Temic 4006FN5" },
         { TUNER_TEMIC_4009FR5_PAL, "Temic 4009FR5" },
         { TUNER_TEMIC_4046FM5,     "Temic 4046FM5" },
-	{ TUNER_ABSENT,        "Temic 4009FN5" },
+	{ TUNER_TEMIC_4009FN5_MULTI_PAL_FM, "Temic 4009FN5" },
 	{ TUNER_ABSENT,        "Philips TD1536D_FH_44"},
-	{ TUNER_ABSENT,	       "LG TP18NSR01F"},
-	{ TUNER_ABSENT,        "LG TP18PSB01D"},
-	{ TUNER_ABSENT,        "LG TP18PSB11D"},	
-	{ TUNER_ABSENT,        "LG TAPC_l001D"},
-	{ TUNER_ABSENT,        "LG TAPC_l701D"}
+	{ TUNER_LG_NTSC_FM,    "LG TP18NSR01F"},
+	{ TUNER_LG_PAL_FM,     "LG TP18PSB01D"},
+	{ TUNER_LG_PAL,        "LG TP18PSB11D"},	
+	{ TUNER_LG_PAL_I_FM,   "LG TAPC-I001D"},
+	{ TUNER_LG_PAL_I,      "LG TAPC-I701D"}
 };
 
 static void __devinit hauppauge_eeprom(struct bttv *btv)
@@ -1394,7 +1531,8 @@
 	int bits_out, loops, vol, data;
 
 	if (!set) {
-		v->mode |= VIDEO_AUDIO_VOLUME;
+		/* Fixed by Leandro Lucarella <luca@linuxmendoza.org.ar (07/31/01) */
+		v->flags |= VIDEO_AUDIO_VOLUME;
 		return;
 	}
 	
@@ -1490,6 +1628,37 @@
 	}
 }
 
+/* Lifetec 9415 handling */
+static void
+lt9415_audio(struct bttv *btv, struct video_audio *v, int set)
+{
+        int val = 0;
+
+        if (btread(BT848_GPIO_DATA) & 0x4000) {
+		v->mode = VIDEO_SOUND_MONO;
+		return;
+	}
+
+        if (set) {
+                if (v->mode & VIDEO_SOUND_LANG2)  /* A2 SAP */
+                        val = 0x0080;
+		if (v->mode & VIDEO_SOUND_STEREO) /* A2 stereo */
+                        val = 0x0880;
+                if ((v->mode & VIDEO_SOUND_LANG1) ||
+		    (v->mode & VIDEO_SOUND_MONO))
+			val = 0;
+                btaor(val, ~0x0880, BT848_GPIO_DATA);
+                if (bttv_gpio)
+                        bttv_gpio_tracking(btv,"lt9415");
+        } else {
+		/* autodetect doesn't work with this card :-( */
+                v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
+			VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
+                return;
+        }
+}
+
+
 static void
 terratv_audio(struct bttv *btv, struct video_audio *v, int set)
 {
@@ -1510,6 +1679,31 @@
 	}
 }
 
+static void
+winfast2000_audio(struct bttv *btv, struct video_audio *v, int set)
+{
+	unsigned long val = 0;
+
+	if (set) {
+		/*btor (0xc32000, BT848_GPIO_OUT_EN);*/
+		if (v->mode & VIDEO_SOUND_MONO)		/* Mono */
+			val = 0x420000;
+		if (v->mode & VIDEO_SOUND_LANG1)	/* Mono */
+			val = 0x420000;
+		if (v->mode & VIDEO_SOUND_LANG2)	/* SAP */
+			val = 0x410000;
+		if (v->mode & VIDEO_SOUND_STEREO)	/* Stereo */
+			val = 0x020000;
+		if (val) {
+			btaor(val, ~0x430000, BT848_GPIO_DATA);
+			if (bttv_gpio)
+				bttv_gpio_tracking(btv,"winfast2000");
+		}
+	} else {
+		v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
+			  VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
+	}
+}
 
 /* ----------------------------------------------------------------------- */
 /* motherboard chipset specific stuff                                      */
@@ -1525,10 +1719,14 @@
 
 	if (pci_pci_problems & (PCIPCI_TRITON|PCIPCI_NATOMA|PCIPCI_VIAETBF))
 		triton1 = 1;
+	while ((dev = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C576, dev)))
+		vsfx = 1;
 
 	/* print warnings about quirks found */
 	if (triton1)
 		printk(KERN_INFO "bttv: Host bridge needs ETBF enabled.\n");
+	if (vsfx)
+		printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n");
 
 	if (pcipci_fail) {
 		printk(KERN_WARNING "bttv: BT848 and your chipset may not work together.\n");
@@ -1553,25 +1751,28 @@
 {
  	unsigned char command;
 
-	if (!triton1)
+	if (!triton1 && !vsfx)
 		return 0;
 
-	if (bttv_verbose)
-		printk("bttv%d: enabling 430FX/VP3 compatibilty\n",btv->nr);
+	if (bttv_verbose) {
+		if (triton1)
+			printk("bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->nr);
+		if (vsfx && btv->id >= 878)
+			printk("bttv%d: enabling VSFX\n",btv->nr);
+	}
 
 	if (btv->id < 878) {
-		/* bt848 (mis)uses a bit in the irq mask */
-		btv->triton1 = BT848_INT_ETBF;
+		/* bt848 (mis)uses a bit in the irq mask for etbf */
+		if (triton1)
+			btv->triton1 = BT848_INT_ETBF;
 	} else {
 		/* bt878 has a bit in the pci config space for it */
                 pci_read_config_byte(btv->dev, BT878_DEVCTRL, &command);
-                command |= BT878_EN_TBFX;
+		if (triton1)
+			command |= BT878_EN_TBFX;
+		if (vsfx)
+			command |= BT878_EN_VSFX;
                 pci_write_config_byte(btv->dev, BT878_DEVCTRL, command);
-                pci_read_config_byte(btv->dev, BT878_DEVCTRL, &command);
-                if (!(command&BT878_EN_TBFX)) {
-                        printk("bttv: 430FX compatibility could not be enabled\n");
-			return -1;
-                }
         }
 	return 0;
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)