📄 bttv-cards.c
字号:
/* bttv-cards.c this file has configuration informations - card-specific stuff like the big tvcards array for the most part Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de) & Marcus Metzler (mocm@thp.uni-koeln.de) (c) 1999-2001 Gerd Knorr <kraxel@goldbach.in-berlin.de> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */#define __NO_VERSION__ 1#include <linux/version.h>#include <linux/delay.h>#include <linux/module.h>#include <linux/kmod.h>#include <linux/init.h>#include <linux/pci.h>#include <asm/io.h>#include "bttvp.h"#include "tuner.h"#include "bt832.h"/* fwd decl */static void boot_msp34xx(struct bttv *btv, int pin);static void boot_bt832(struct bttv *btv);static void hauppauge_eeprom(struct bttv *btv);static void avermedia_eeprom(struct bttv *btv);static void osprey_eeprom(struct bttv *btv);static void modtec_eeprom(struct bttv *btv);static void init_PXC200(struct bttv *btv);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);static void pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set);static void fv2000s_audio(struct bttv *btv, struct video_audio *v, int set);static void windvr_audio(struct bttv *btv, struct video_audio *v, int set);static void adtvk503_audio(struct bttv *btv, struct video_audio *v, int set);static void rv605_muxsel(struct bttv *btv, unsigned int input);static void eagle_muxsel(struct bttv *btv, unsigned int input);static int terratec_active_radio_upgrade(struct bttv *btv);static int tea5757_read(struct bttv *btv);static int tea5757_write(struct bttv *btv, int value);static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256]);/* config variables */static unsigned int triton1=0;static unsigned int vsfx=0;static unsigned int latency = UNSET;unsigned int no_overlay=-1;static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET};static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET};static unsigned int tuner[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET};#ifdef MODULEstatic unsigned int autoload = 1;#elsestatic unsigned int autoload = 0;#endifstatic unsigned int gpiomask = UNSET;static unsigned int audioall = UNSET;static unsigned int audiomux[5] = { [ 0 ... 4 ] = UNSET };/* insmod options */MODULE_PARM(triton1,"i");MODULE_PARM_DESC(triton1,"set ETBF pci config bit " "[enable bug compatibility for triton1 + others]");MODULE_PARM(vsfx,"i");MODULE_PARM_DESC(vsfx,"set VSFX pci config bit " "[yet another chipset flaw workaround]");MODULE_PARM(no_overlay,"i");MODULE_PARM(latency,"i");MODULE_PARM_DESC(latency,"pci latency timer");MODULE_PARM(card,"1-" __stringify(BTTV_MAX) "i");MODULE_PARM_DESC(card,"specify TV/grabber card model, see CARDLIST file for a list");MODULE_PARM(pll,"1-" __stringify(BTTV_MAX) "i");MODULE_PARM_DESC(pll,"specify installed crystal (0=none, 28=28 MHz, 35=35 MHz)");MODULE_PARM(tuner,"1-" __stringify(BTTV_MAX) "i");MODULE_PARM_DESC(tuner,"specify installed tuner type");MODULE_PARM(autoload,"i");MODULE_PARM_DESC(autoload,"automatically load i2c modules like tuner.o, default is 1 (yes)");MODULE_PARM(gpiomask,"i");MODULE_PARM(audioall,"i");MODULE_PARM(audiomux,"1-5i");/* kernel args */#ifndef MODULEstatic int __init p_card(char *str) { return bttv_parse(str,BTTV_MAX,card); }static int __init p_pll(char *str) { return bttv_parse(str,BTTV_MAX,pll); }static int __init p_tuner(char *str) { return bttv_parse(str,BTTV_MAX,tuner); }__setup("bttv.card=", p_card);__setup("bttv.pll=", p_pll);__setup("bttv.tuner=", p_tuner);int __init bttv_parse(char *str, int max, int *vals){ int i,number,res = 2; for (i = 0; res == 2 && i < max; i++) { res = get_option(&str,&number); if (res) vals[i] = number; } return 1;}#endif/* ----------------------------------------------------------------------- *//* list of card IDs for bt878+ cards */static struct CARD { unsigned id; int cardnr; char *name;} cards[] __devinitdata = { { 0x13eb0070, BTTV_HAUPPAUGE878, "Hauppauge WinTV" }, { 0x39000070, BTTV_HAUPPAUGE878, "Hauppauge WinTV-D" }, { 0x45000070, BTTV_HAUPPAUGEPVR, "Hauppauge WinTV/PVR" }, { 0xff000070, BTTV_OSPREY1x0, "Osprey-100" }, { 0xff010070, BTTV_OSPREY2x0_SVID,"Osprey-200" }, { 0xff020070, BTTV_OSPREY500, "Osprey-500" }, { 0xff030070, BTTV_OSPREY2000, "Osprey-2000" }, { 0xff040070, BTTV_OSPREY540, "Osprey-540" }, { 0x00011002, BTTV_ATI_TVWONDER, "ATI TV Wonder" }, { 0x00031002, BTTV_ATI_TVWONDERVE,"ATI TV Wonder/VE" }, { 0x6606107d, BTTV_WINFAST2000, "Leadtek WinFast TV 2000" }, { 0x6607107d, BTTV_WINFAST2000, "Leadtek WinFast VC 100" }, { 0x263610b4, BTTV_STB2, "STB TV PCI FM, Gateway P/N 6000704" }, { 0x402010fc, BTTV_GVBCTV3PCI, "I-O Data Co. GV-BCTV3/PCI" }, { 0x405010fc, BTTV_GVBCTV4PCI, "I-O Data Co. GV-BCTV4/PCI" }, { 0x407010fc, BTTV_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" }, { 0x1200bd11, BTTV_PINNACLE, "Pinnacle PCTV" }, { 0x001211bd, BTTV_PINNACLE, "Pinnacle PCTV" }, { 0x001c11bd, BTTV_PINNACLESAT, "Pinnacle PCTV Sat" }, { 0x3000121a, BTTV_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" }, { 0x3060121a, BTTV_STB2, "3Dfx VoodooTV 100/ STB OEM" }, { 0x3000144f, BTTV_MAGICTVIEW063, "(Askey Magic/others) TView99 CPH06x" }, { 0x3002144f, BTTV_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH05x" }, { 0x3005144f, BTTV_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH061/06L (T1/LC)" }, { 0x00011461, BTTV_AVPHONE98, "AVerMedia TVPhone98" }, { 0x00021461, BTTV_AVERMEDIA98, "AVermedia TVCapture 98" }, { 0x00031461, BTTV_AVPHONE98, "AVerMedia TVPhone98" }, { 0x00041461, BTTV_AVERMEDIA98, "AVerMedia TVCapture 98" }, { 0x03001461, BTTV_AVERMEDIA98, "VDOMATE TV TUNER CARD" }, { 0x300014ff, BTTV_MAGICTVIEW061, "TView 99 (CPH061)" }, { 0x300214ff, BTTV_PHOEBE_TVMAS, "Phoebe TV Master (CPH060)" }, { 0x1117153b, BTTV_TERRATVALUE, "Terratec TValue (Philips PAL B/G)" }, { 0x1118153b, BTTV_TERRATVALUE, "Terratec TValue (Temic PAL B/G)" }, { 0x1119153b, BTTV_TERRATVALUE, "Terratec TValue (Philips PAL I)" }, { 0x111a153b, BTTV_TERRATVALUE, "Terratec TValue (Temic PAL I)" }, { 0x1123153b, BTTV_TERRATVRADIO, "Terratec TV Radio+" }, { 0x1127153b, BTTV_TERRATV, "Terratec TV+ (V1.05)" }, // clashes with FlyVideo //{ 0x18521852, BTTV_TERRATV, "Terratec TV+ (V1.10)" }, { 0x1134153b, BTTV_TERRATVALUE, "Terratec TValue (LR102)" }, { 0x1135153b, BTTV_TERRATVALUER, "Terratec TValue Radio" }, // LR102 { 0x5018153b, BTTV_TERRATVALUE, "Terratec TValue" }, // ?? { 0x400015b0, BTTV_ZOLTRIX_GENIE, "Zoltrix Genie TV" }, { 0x400a15b0, BTTV_ZOLTRIX_GENIE, "Zoltrix Genie TV" }, { 0x400d15b0, BTTV_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" }, { 0x401015b0, BTTV_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" }, { 0x401615b0, BTTV_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" }, { 0x010115cb, BTTV_GMV1, "AG GMV1" }, { 0x010114c7, BTTV_MODTEC_205, "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV" }, { 0x18501851, BTTV_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" }, { 0x18511851, BTTV_FLYVIDEO98EZ, "FlyVideo 98EZ (LR51)/ CyberMail AV" }, { 0x18521852, BTTV_TYPHOON_TVIEW, "FlyVideo 98FM (LR50)/ Typhoon TView TV/FM Tuner" }, { 0x10b42636, BTTV_HAUPPAUGE878, "STB ???" }, { 0x217d6606, BTTV_WINFAST2000, "Leadtek WinFast TV 2000" }, { 0x03116000, BTTV_SENSORAY311, "Sensoray 311" }, { 0x00790e11, BTTV_WINDVR, "Canopus WinDVR PCI" }, { 0xa0fca1a0, BTTV_ZOLTRIX, "Face to Face Tvmax" }, { 0x1460aa00, BTTV_PV150, "Provideo PV150A-1" }, { 0x1461aa01, BTTV_PV150, "Provideo PV150A-2" }, { 0x1462aa02, BTTV_PV150, "Provideo PV150A-3" }, { 0x1463aa03, BTTV_PV150, "Provideo PV150A-4" }, { 0x1464aa04, BTTV_PV150, "Provideo PV150B-1" }, { 0x1465aa05, BTTV_PV150, "Provideo PV150B-2" }, { 0x1466aa06, BTTV_PV150, "Provideo PV150B-3" }, { 0x1467aa07, BTTV_PV150, "Provideo PV150B-4" }, // likely broken, vendor id doesn't match the other magic views ... //{ 0xa0fca04f, BTTV_MAGICTVIEW063, "Guillemot Maxi TV Video 3" }, { 0, -1, NULL }};/* ----------------------------------------------------------------------- *//* array with description for bt848 / bt878 tv/grabber cards */struct tvcard bttv_tvcards[] = {{/* ---- card 0x00 ---------------------------------- */ .name = " *** UNKNOWN/GENERIC *** ", .video_inputs = 4, .audio_inputs = 1, .tuner = 0, .svhs = 2, .muxsel = { 2, 3, 1, 0}, .tuner_type = -1,},{ .name = "MIRO PCTV", .video_inputs = 4, .audio_inputs = 1, .tuner = 0, .svhs = 2, .gpiomask = 15, .muxsel = { 2, 3, 1, 1}, .audiomux = { 2, 0, 0, 0, 10}, .needs_tvaudio = 1, .tuner_type = -1,},{ .name = "Hauppauge (bt848)", .video_inputs = 4, .audio_inputs = 1, .tuner = 0, .svhs = 2, .gpiomask = 7, .muxsel = { 2, 3, 1, 1}, .audiomux = { 0, 1, 2, 3, 4}, .needs_tvaudio = 1, .tuner_type = -1,},{ .name = "STB, Gateway P/N 6000699 (bt848)", .video_inputs = 3, .audio_inputs = 1, .tuner = 0, .svhs = 2, .gpiomask = 7, .muxsel = { 2, 3, 1, 1}, .audiomux = { 4, 0, 2, 3, 1}, .no_msp34xx = 1, .needs_tvaudio = 1, .tuner_type = TUNER_PHILIPS_NTSC, .pll = PLL_28, .has_radio = 1,},{/* ---- card 0x04 ---------------------------------- */ .name = "Intel Create and Share PCI/ Smart Video Recorder III", .video_inputs = 4, .audio_inputs = 0, .tuner = -1, .svhs = 2, .gpiomask = 0, .muxsel = { 2, 3, 1, 1}, .audiomux = { 0 }, .needs_tvaudio = 0, .tuner_type = 4,},{ .name = "Diamond DTV2000", .video_inputs = 4, .audio_inputs = 1, .tuner = 0, .svhs = 2, .gpiomask = 3, .muxsel = { 2, 3, 1, 0}, .audiomux = { 0, 1, 0, 1, 3}, .needs_tvaudio = 1, .tuner_type = -1,},{ .name = "AVerMedia TVPhone", .video_inputs = 3, .audio_inputs = 1, .tuner = 0, .svhs = 3, .muxsel = { 2, 3, 1, 1}, .gpiomask = 0x0f, .audiomux = { 0x0c, 0x04, 0x08, 0x04, 0}, /* 0x04 for some cards ?? */ .needs_tvaudio = 1, .tuner_type = -1, .audio_hook = avermedia_tvphone_audio,},{ .name = "MATRIX-Vision MV-Delta", .video_inputs = 5, .audio_inputs = 1, .tuner = -1, .svhs = 3, .gpiomask = 0, .muxsel = { 2, 3, 1, 0, 0}, .audiomux = {0 }, .needs_tvaudio = 1, .tuner_type = -1,},{/* ---- card 0x08 ---------------------------------- */ .name = "Lifeview FlyVideo II (Bt848) LR26", .video_inputs = 4, .audio_inputs = 1, .tuner = 0, .svhs = 2, .gpiomask = 0xc00, .muxsel = { 2, 3, 1, 1}, .audiomux = { 0, 0xc00, 0x800, 0x400, 0xc00, 0}, .needs_tvaudio = 1, .pll = PLL_28, .tuner_type = -1,},{ .name = "IMS/IXmicro TurboTV", .video_inputs = 3, .audio_inputs = 1, .tuner = 0, .svhs = 2, .gpiomask = 3, .muxsel = { 2, 3, 1, 1}, .audiomux = { 1, 1, 2, 3, 0}, .needs_tvaudio = 0, .pll = PLL_28, .tuner_type = TUNER_TEMIC_PAL,},{ .name = "Hauppauge (bt878)", .video_inputs = 4, .audio_inputs = 1, .tuner = 0, .svhs = 2, .gpiomask = 0x0f, /* old: 7 */ .muxsel = { 2, 0, 1, 1}, .audiomux = { 0, 1, 2, 3, 4}, .needs_tvaudio = 1, .pll = PLL_28, .tuner_type = -1,},{ .name = "MIRO PCTV pro", .video_inputs = 3, .audio_inputs = 1, .tuner = 0, .svhs = 2, .gpiomask = 0x3014f, .muxsel = { 2, 3, 1, 1}, .audiomux = { 0x20001,0x10001, 0, 0,10}, .needs_tvaudio = 1, .tuner_type = -1,},{/* ---- card 0x0c ---------------------------------- */ .name = "ADS Technologies Channel Surfer TV (bt848)", .video_inputs = 3, .audio_inputs = 1, .tuner = 0, .svhs = 2, .gpiomask = 15, .muxsel = { 2, 3, 1, 1}, .audiomux = { 13, 14, 11, 7, 0, 0}, .needs_tvaudio = 1, .tuner_type = -1,},{ .name = "AVerMedia TVCapture 98", .video_inputs = 3, .audio_inputs = 4, .tuner = 0, .svhs = 2, .gpiomask = 15, .muxsel = { 2, 3, 1, 1}, .audiomux = { 13, 14, 11, 7, 0, 0}, .needs_tvaudio = 1, .msp34xx_alt = 1, .pll = PLL_28, .tuner_type = TUNER_PHILIPS_PAL,},{ .name = "Aimslab Video Highway Xtreme (VHX)", .video_inputs = 3, .audio_inputs = 1, .tuner = 0, .svhs = 2, .gpiomask = 7, .muxsel = { 2, 3, 1, 1}, .audiomux = { 0, 2, 1, 3, 4}, /* old: { 0, 1, 2, 3, 4} */ .needs_tvaudio = 1, .pll = PLL_28, .tuner_type = -1,},{ .name = "Zoltrix TV-Max", .video_inputs = 3, .audio_inputs = 1, .tuner = 0, .svhs = 2, .gpiomask = 15, .muxsel = { 2, 3, 1, 1}, .audiomux = {0 , 0, 1 , 0, 10}, .needs_tvaudio = 1, .tuner_type = -1,},{/* ---- card 0x10 ---------------------------------- */ .name = "Prolink Pixelview PlayTV (bt878)", .video_inputs = 3, .audio_inputs = 1, .tuner = 0, .svhs = 2, .gpiomask = 0x01fe00, .muxsel = { 2, 3, 1, 1}, .audiomux = { 0x01c000, 0, 0x018000, 0x014000, 0x002000, 0 }, .needs_tvaudio = 1, .pll = PLL_28, .tuner_type = -1,},{ .name = "Leadtek WinView 601", .video_inputs = 3, .audio_inputs = 1, .tuner = 0, .svhs = 2, .gpiomask = 0x8300f8, .muxsel = { 2, 3, 1, 1,0}, .audiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007}, .needs_tvaudio = 1, .tuner_type = -1, .audio_hook = winview_audio, .has_radio = 1,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -