Path: blob/master/drivers/media/video/bt8xx/bttv-cards.c
10785 views
/*12bttv-cards.c34this file has configuration informations - card-specific stuff5like the big tvcards array for the most part67Copyright (C) 1996,97,98 Ralph Metzler ([email protected])8& Marcus Metzler ([email protected])9(c) 1999-2001 Gerd Knorr <[email protected]>1011This program is free software; you can redistribute it and/or modify12it under the terms of the GNU General Public License as published by13the Free Software Foundation; either version 2 of the License, or14(at your option) any later version.1516This program is distributed in the hope that it will be useful,17but WITHOUT ANY WARRANTY; without even the implied warranty of18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the19GNU General Public License for more details.2021You should have received a copy of the GNU General Public License22along with this program; if not, write to the Free Software23Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.2425*/2627#include <linux/delay.h>28#include <linux/module.h>29#include <linux/kmod.h>30#include <linux/init.h>31#include <linux/pci.h>32#include <linux/vmalloc.h>33#include <linux/firmware.h>34#include <net/checksum.h>3536#include <asm/unaligned.h>37#include <asm/io.h>3839#include "bttvp.h"40#include <media/v4l2-common.h>41#include <media/tvaudio.h>42#include "bttv-audio-hook.h"4344/* fwd decl */45static void boot_msp34xx(struct bttv *btv, int pin);46static void hauppauge_eeprom(struct bttv *btv);47static void avermedia_eeprom(struct bttv *btv);48static void osprey_eeprom(struct bttv *btv, const u8 ee[256]);49static void modtec_eeprom(struct bttv *btv);50static void init_PXC200(struct bttv *btv);51static void init_RTV24(struct bttv *btv);5253static void rv605_muxsel(struct bttv *btv, unsigned int input);54static void eagle_muxsel(struct bttv *btv, unsigned int input);55static void xguard_muxsel(struct bttv *btv, unsigned int input);56static void ivc120_muxsel(struct bttv *btv, unsigned int input);57static void gvc1100_muxsel(struct bttv *btv, unsigned int input);5859static void PXC200_muxsel(struct bttv *btv, unsigned int input);6061static void picolo_tetra_muxsel(struct bttv *btv, unsigned int input);62static void picolo_tetra_init(struct bttv *btv);6364static void tibetCS16_muxsel(struct bttv *btv, unsigned int input);65static void tibetCS16_init(struct bttv *btv);6667static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input);68static void kodicom4400r_init(struct bttv *btv);6970static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input);71static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);7273static void geovision_muxsel(struct bttv *btv, unsigned int input);7475static void phytec_muxsel(struct bttv *btv, unsigned int input);7677static void gv800s_muxsel(struct bttv *btv, unsigned int input);78static void gv800s_init(struct bttv *btv);7980static int terratec_active_radio_upgrade(struct bttv *btv);81static int tea5757_read(struct bttv *btv);82static int tea5757_write(struct bttv *btv, int value);83static void identify_by_eeprom(struct bttv *btv,84unsigned char eeprom_data[256]);85static int __devinit pvr_boot(struct bttv *btv);8687/* config variables */88static unsigned int triton1;89static unsigned int vsfx;90static unsigned int latency = UNSET;91int no_overlay=-1;9293static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };94static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };95static unsigned int tuner[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };96static unsigned int svhs[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };97static unsigned int remote[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };98static unsigned int audiodev[BTTV_MAX];99static unsigned int saa6588[BTTV_MAX];100static struct bttv *master[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = NULL };101static unsigned int autoload = UNSET;102static unsigned int gpiomask = UNSET;103static unsigned int audioall = UNSET;104static unsigned int audiomux[5] = { [ 0 ... 4 ] = UNSET };105106/* insmod options */107module_param(triton1, int, 0444);108module_param(vsfx, int, 0444);109module_param(no_overlay, int, 0444);110module_param(latency, int, 0444);111module_param(gpiomask, int, 0444);112module_param(audioall, int, 0444);113module_param(autoload, int, 0444);114115module_param_array(card, int, NULL, 0444);116module_param_array(pll, int, NULL, 0444);117module_param_array(tuner, int, NULL, 0444);118module_param_array(svhs, int, NULL, 0444);119module_param_array(remote, int, NULL, 0444);120module_param_array(audiodev, int, NULL, 0444);121module_param_array(audiomux, int, NULL, 0444);122123MODULE_PARM_DESC(triton1,"set ETBF pci config bit "124"[enable bug compatibility for triton1 + others]");125MODULE_PARM_DESC(vsfx,"set VSFX pci config bit "126"[yet another chipset flaw workaround]");127MODULE_PARM_DESC(latency,"pci latency timer");128MODULE_PARM_DESC(card,"specify TV/grabber card model, see CARDLIST file for a list");129MODULE_PARM_DESC(pll,"specify installed crystal (0=none, 28=28 MHz, 35=35 MHz)");130MODULE_PARM_DESC(tuner,"specify installed tuner type");131MODULE_PARM_DESC(autoload, "obsolete option, please do not use anymore");132MODULE_PARM_DESC(audiodev, "specify audio device:\n"133"\t\t-1 = no audio\n"134"\t\t 0 = autodetect (default)\n"135"\t\t 1 = msp3400\n"136"\t\t 2 = tda7432\n"137"\t\t 3 = tvaudio");138MODULE_PARM_DESC(saa6588, "if 1, then load the saa6588 RDS module, default (0) is to use the card definition.");139MODULE_PARM_DESC(no_overlay,"allow override overlay default (0 disables, 1 enables)"140" [some VIA/SIS chipsets are known to have problem with overlay]");141142/* ----------------------------------------------------------------------- */143/* list of card IDs for bt878+ cards */144145static struct CARD {146unsigned id;147int cardnr;148char *name;149} cards[] __devinitdata = {150{ 0x13eb0070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV" },151{ 0x39000070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV-D" },152{ 0x45000070, BTTV_BOARD_HAUPPAUGEPVR, "Hauppauge WinTV/PVR" },153{ 0xff000070, BTTV_BOARD_OSPREY1x0, "Osprey-100" },154{ 0xff010070, BTTV_BOARD_OSPREY2x0_SVID,"Osprey-200" },155{ 0xff020070, BTTV_BOARD_OSPREY500, "Osprey-500" },156{ 0xff030070, BTTV_BOARD_OSPREY2000, "Osprey-2000" },157{ 0xff040070, BTTV_BOARD_OSPREY540, "Osprey-540" },158{ 0xff070070, BTTV_BOARD_OSPREY440, "Osprey-440" },159160{ 0x00011002, BTTV_BOARD_ATI_TVWONDER, "ATI TV Wonder" },161{ 0x00031002, BTTV_BOARD_ATI_TVWONDERVE,"ATI TV Wonder/VE" },162163{ 0x6606107d, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },164{ 0x6607107d, BTTV_BOARD_WINFASTVC100, "Leadtek WinFast VC 100" },165{ 0x6609107d, BTTV_BOARD_WINFAST2000, "Leadtek TV 2000 XP" },166{ 0x263610b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },167{ 0x264510b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },168{ 0x402010fc, BTTV_BOARD_GVBCTV3PCI, "I-O Data Co. GV-BCTV3/PCI" },169{ 0x405010fc, BTTV_BOARD_GVBCTV4PCI, "I-O Data Co. GV-BCTV4/PCI" },170{ 0x407010fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },171{ 0xd01810fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },172173{ 0x001211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },174/* some cards ship with byteswapped IDs ... */175{ 0x1200bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },176{ 0xff00bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },177/* this seems to happen as well ... */178{ 0xff1211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },179180{ 0x3000121a, BTTV_BOARD_VOODOOTV_200, "3Dfx VoodooTV 200" },181{ 0x263710b4, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM" },182{ 0x3060121a, BTTV_BOARD_STB2, "3Dfx VoodooTV 100/ STB OEM" },183184{ 0x3000144f, BTTV_BOARD_MAGICTVIEW063, "(Askey Magic/others) TView99 CPH06x" },185{ 0xa005144f, BTTV_BOARD_MAGICTVIEW063, "CPH06X TView99-Card" },186{ 0x3002144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH05x" },187{ 0x3005144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH061/06L (T1/LC)" },188{ 0x5000144f, BTTV_BOARD_MAGICTVIEW061, "Askey CPH050" },189{ 0x300014ff, BTTV_BOARD_MAGICTVIEW061, "TView 99 (CPH061)" },190{ 0x300214ff, BTTV_BOARD_PHOEBE_TVMAS, "Phoebe TV Master (CPH060)" },191192{ 0x00011461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },193{ 0x00021461, BTTV_BOARD_AVERMEDIA98, "AVermedia TVCapture 98" },194{ 0x00031461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },195{ 0x00041461, BTTV_BOARD_AVERMEDIA98, "AVerMedia TVCapture 98" },196{ 0x03001461, BTTV_BOARD_AVERMEDIA98, "VDOMATE TV TUNER CARD" },197198{ 0x1117153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL B/G)" },199{ 0x1118153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL B/G)" },200{ 0x1119153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL I)" },201{ 0x111a153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL I)" },202203{ 0x1123153b, BTTV_BOARD_TERRATVRADIO, "Terratec TV Radio+" },204{ 0x1127153b, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.05)" },205/* clashes with FlyVideo206*{ 0x18521852, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.10)" }, */207{ 0x1134153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (LR102)" },208{ 0x1135153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* LR102 */209{ 0x5018153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue" }, /* ?? */210{ 0xff3b153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* ?? */211212{ 0x400015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },213{ 0x400a15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },214{ 0x400d15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },215{ 0x401015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },216{ 0x401615b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },217218{ 0x1430aa00, BTTV_BOARD_PV143, "Provideo PV143A" },219{ 0x1431aa00, BTTV_BOARD_PV143, "Provideo PV143B" },220{ 0x1432aa00, BTTV_BOARD_PV143, "Provideo PV143C" },221{ 0x1433aa00, BTTV_BOARD_PV143, "Provideo PV143D" },222{ 0x1433aa03, BTTV_BOARD_PV143, "Security Eyes" },223224{ 0x1460aa00, BTTV_BOARD_PV150, "Provideo PV150A-1" },225{ 0x1461aa01, BTTV_BOARD_PV150, "Provideo PV150A-2" },226{ 0x1462aa02, BTTV_BOARD_PV150, "Provideo PV150A-3" },227{ 0x1463aa03, BTTV_BOARD_PV150, "Provideo PV150A-4" },228229{ 0x1464aa04, BTTV_BOARD_PV150, "Provideo PV150B-1" },230{ 0x1465aa05, BTTV_BOARD_PV150, "Provideo PV150B-2" },231{ 0x1466aa06, BTTV_BOARD_PV150, "Provideo PV150B-3" },232{ 0x1467aa07, BTTV_BOARD_PV150, "Provideo PV150B-4" },233234{ 0xa132ff00, BTTV_BOARD_IVC100, "IVC-100" },235{ 0xa1550000, BTTV_BOARD_IVC200, "IVC-200" },236{ 0xa1550001, BTTV_BOARD_IVC200, "IVC-200" },237{ 0xa1550002, BTTV_BOARD_IVC200, "IVC-200" },238{ 0xa1550003, BTTV_BOARD_IVC200, "IVC-200" },239{ 0xa1550100, BTTV_BOARD_IVC200, "IVC-200G" },240{ 0xa1550101, BTTV_BOARD_IVC200, "IVC-200G" },241{ 0xa1550102, BTTV_BOARD_IVC200, "IVC-200G" },242{ 0xa1550103, BTTV_BOARD_IVC200, "IVC-200G" },243{ 0xa1550800, BTTV_BOARD_IVC200, "IVC-200" },244{ 0xa1550801, BTTV_BOARD_IVC200, "IVC-200" },245{ 0xa1550802, BTTV_BOARD_IVC200, "IVC-200" },246{ 0xa1550803, BTTV_BOARD_IVC200, "IVC-200" },247{ 0xa182ff00, BTTV_BOARD_IVC120, "IVC-120G" },248{ 0xa182ff01, BTTV_BOARD_IVC120, "IVC-120G" },249{ 0xa182ff02, BTTV_BOARD_IVC120, "IVC-120G" },250{ 0xa182ff03, BTTV_BOARD_IVC120, "IVC-120G" },251{ 0xa182ff04, BTTV_BOARD_IVC120, "IVC-120G" },252{ 0xa182ff05, BTTV_BOARD_IVC120, "IVC-120G" },253{ 0xa182ff06, BTTV_BOARD_IVC120, "IVC-120G" },254{ 0xa182ff07, BTTV_BOARD_IVC120, "IVC-120G" },255{ 0xa182ff08, BTTV_BOARD_IVC120, "IVC-120G" },256{ 0xa182ff09, BTTV_BOARD_IVC120, "IVC-120G" },257{ 0xa182ff0a, BTTV_BOARD_IVC120, "IVC-120G" },258{ 0xa182ff0b, BTTV_BOARD_IVC120, "IVC-120G" },259{ 0xa182ff0c, BTTV_BOARD_IVC120, "IVC-120G" },260{ 0xa182ff0d, BTTV_BOARD_IVC120, "IVC-120G" },261{ 0xa182ff0e, BTTV_BOARD_IVC120, "IVC-120G" },262{ 0xa182ff0f, BTTV_BOARD_IVC120, "IVC-120G" },263{ 0xf0500000, BTTV_BOARD_IVCE8784, "IVCE-8784" },264{ 0xf0500001, BTTV_BOARD_IVCE8784, "IVCE-8784" },265{ 0xf0500002, BTTV_BOARD_IVCE8784, "IVCE-8784" },266{ 0xf0500003, BTTV_BOARD_IVCE8784, "IVCE-8784" },267268{ 0x41424344, BTTV_BOARD_GRANDTEC, "GrandTec Multi Capture" },269{ 0x01020304, BTTV_BOARD_XGUARD, "Grandtec Grand X-Guard" },270271{ 0x18501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },272{ 0xa0501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },273{ 0x18511851, BTTV_BOARD_FLYVIDEO98EZ, "FlyVideo 98EZ (LR51)/ CyberMail AV" },274{ 0x18521852, BTTV_BOARD_TYPHOON_TVIEW, "FlyVideo 98FM (LR50)/ Typhoon TView TV/FM Tuner" },275{ 0x41a0a051, BTTV_BOARD_FLYVIDEO_98FM, "Lifeview FlyVideo 98 LR50 Rev Q" },276{ 0x18501f7f, BTTV_BOARD_FLYVIDEO_98, "Lifeview Flyvideo 98" },277278{ 0x010115cb, BTTV_BOARD_GMV1, "AG GMV1" },279{ 0x010114c7, BTTV_BOARD_MODTEC_205, "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV" },280281{ 0x10b42636, BTTV_BOARD_HAUPPAUGE878, "STB ???" },282{ 0x217d6606, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },283{ 0xfff6f6ff, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },284{ 0x03116000, BTTV_BOARD_SENSORAY311, "Sensoray 311" },285{ 0x00790e11, BTTV_BOARD_WINDVR, "Canopus WinDVR PCI" },286{ 0xa0fca1a0, BTTV_BOARD_ZOLTRIX, "Face to Face Tvmax" },287{ 0x82b2aa6a, BTTV_BOARD_SIMUS_GVC1100, "SIMUS GVC1100" },288{ 0x146caa0c, BTTV_BOARD_PV951, "ituner spectra8" },289{ 0x200a1295, BTTV_BOARD_PXC200, "ImageNation PXC200A" },290291{ 0x40111554, BTTV_BOARD_PV_BT878P_9B, "Prolink Pixelview PV-BT" },292{ 0x17de0a01, BTTV_BOARD_KWORLD, "Mecer TV/FM/Video Tuner" },293294{ 0x01051805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #1" },295{ 0x01061805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #2" },296{ 0x01071805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #3" },297{ 0x01081805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #4" },298299{ 0x15409511, BTTV_BOARD_ACORP_Y878F, "Acorp Y878F" },300301{ 0x53534149, BTTV_BOARD_SSAI_SECURITY, "SSAI Security Video Interface" },302{ 0x5353414a, BTTV_BOARD_SSAI_ULTRASOUND, "SSAI Ultrasound Video Interface" },303304/* likely broken, vendor id doesn't match the other magic views ...305* { 0xa0fca04f, BTTV_BOARD_MAGICTVIEW063, "Guillemot Maxi TV Video 3" }, */306307/* Duplicate PCI ID, reconfigure for this board during the eeprom read.308* { 0x13eb0070, BTTV_BOARD_HAUPPAUGE_IMPACTVCB, "Hauppauge ImpactVCB" }, */309310{ 0x109e036e, BTTV_BOARD_CONCEPTRONIC_CTVFMI2, "Conceptronic CTVFMi v2"},311312/* DVB cards (using pci function .1 for mpeg data xfer) */313{ 0x001c11bd, BTTV_BOARD_PINNACLESAT, "Pinnacle PCTV Sat" },314{ 0x01010071, BTTV_BOARD_NEBULA_DIGITV, "Nebula Electronics DigiTV" },315{ 0x20007063, BTTV_BOARD_PC_HDTV, "pcHDTV HD-2000 TV"},316{ 0x002611bd, BTTV_BOARD_TWINHAN_DST, "Pinnacle PCTV SAT CI" },317{ 0x00011822, BTTV_BOARD_TWINHAN_DST, "Twinhan VisionPlus DVB" },318{ 0xfc00270f, BTTV_BOARD_TWINHAN_DST, "ChainTech digitop DST-1000 DVB-S" },319{ 0x07711461, BTTV_BOARD_AVDVBT_771, "AVermedia AverTV DVB-T 771" },320{ 0x07611461, BTTV_BOARD_AVDVBT_761, "AverMedia AverTV DVB-T 761" },321{ 0xdb1018ac, BTTV_BOARD_DVICO_DVBT_LITE, "DViCO FusionHDTV DVB-T Lite" },322{ 0xdb1118ac, BTTV_BOARD_DVICO_DVBT_LITE, "Ultraview DVB-T Lite" },323{ 0xd50018ac, BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE, "DViCO FusionHDTV 5 Lite" },324{ 0x00261822, BTTV_BOARD_TWINHAN_DST, "DNTV Live! Mini "},325{ 0xd200dbc0, BTTV_BOARD_DVICO_FUSIONHDTV_2, "DViCO FusionHDTV 2" },326{ 0x763c008a, BTTV_BOARD_GEOVISION_GV600, "GeoVision GV-600" },327{ 0x18011000, BTTV_BOARD_ENLTV_FM_2, "Encore ENL TV-FM-2" },328{ 0x763d800a, BTTV_BOARD_GEOVISION_GV800S, "GeoVision GV-800(S) (master)" },329{ 0x763d800b, BTTV_BOARD_GEOVISION_GV800S_SL, "GeoVision GV-800(S) (slave)" },330{ 0x763d800c, BTTV_BOARD_GEOVISION_GV800S_SL, "GeoVision GV-800(S) (slave)" },331{ 0x763d800d, BTTV_BOARD_GEOVISION_GV800S_SL, "GeoVision GV-800(S) (slave)" },332333{ 0x15401830, BTTV_BOARD_PV183, "Provideo PV183-1" },334{ 0x15401831, BTTV_BOARD_PV183, "Provideo PV183-2" },335{ 0x15401832, BTTV_BOARD_PV183, "Provideo PV183-3" },336{ 0x15401833, BTTV_BOARD_PV183, "Provideo PV183-4" },337{ 0x15401834, BTTV_BOARD_PV183, "Provideo PV183-5" },338{ 0x15401835, BTTV_BOARD_PV183, "Provideo PV183-6" },339{ 0x15401836, BTTV_BOARD_PV183, "Provideo PV183-7" },340{ 0x15401837, BTTV_BOARD_PV183, "Provideo PV183-8" },341342{ 0, -1, NULL }343};344345/* ----------------------------------------------------------------------- */346/* array with description for bt848 / bt878 tv/grabber cards */347348struct tvcard bttv_tvcards[] = {349/* ---- card 0x00 ---------------------------------- */350[BTTV_BOARD_UNKNOWN] = {351.name = " *** UNKNOWN/GENERIC *** ",352.video_inputs = 4,353.svhs = 2,354.muxsel = MUXSEL(2, 3, 1, 0),355.tuner_type = UNSET,356.tuner_addr = ADDR_UNSET,357},358[BTTV_BOARD_MIRO] = {359.name = "MIRO PCTV",360.video_inputs = 4,361/* .audio_inputs= 1, */362.svhs = 2,363.gpiomask = 15,364.muxsel = MUXSEL(2, 3, 1, 1),365.gpiomux = { 2, 0, 0, 0 },366.gpiomute = 10,367.needs_tvaudio = 1,368.tuner_type = UNSET,369.tuner_addr = ADDR_UNSET,370},371[BTTV_BOARD_HAUPPAUGE] = {372.name = "Hauppauge (bt848)",373.video_inputs = 4,374/* .audio_inputs= 1, */375.svhs = 2,376.gpiomask = 7,377.muxsel = MUXSEL(2, 3, 1, 1),378.gpiomux = { 0, 1, 2, 3 },379.gpiomute = 4,380.needs_tvaudio = 1,381.tuner_type = UNSET,382.tuner_addr = ADDR_UNSET,383},384[BTTV_BOARD_STB] = {385.name = "STB, Gateway P/N 6000699 (bt848)",386.video_inputs = 3,387/* .audio_inputs= 1, */388.svhs = 2,389.gpiomask = 7,390.muxsel = MUXSEL(2, 3, 1, 1),391.gpiomux = { 4, 0, 2, 3 },392.gpiomute = 1,393.no_msp34xx = 1,394.needs_tvaudio = 1,395.tuner_type = TUNER_PHILIPS_NTSC,396.tuner_addr = ADDR_UNSET,397.pll = PLL_28,398.has_radio = 1,399},400401/* ---- card 0x04 ---------------------------------- */402[BTTV_BOARD_INTEL] = {403.name = "Intel Create and Share PCI/ Smart Video Recorder III",404.video_inputs = 4,405/* .audio_inputs= 0, */406.svhs = 2,407.gpiomask = 0,408.muxsel = MUXSEL(2, 3, 1, 1),409.gpiomux = { 0 },410.needs_tvaudio = 0,411.tuner_type = TUNER_ABSENT,412.tuner_addr = ADDR_UNSET,413},414[BTTV_BOARD_DIAMOND] = {415.name = "Diamond DTV2000",416.video_inputs = 4,417/* .audio_inputs= 1, */418.svhs = 2,419.gpiomask = 3,420.muxsel = MUXSEL(2, 3, 1, 0),421.gpiomux = { 0, 1, 0, 1 },422.gpiomute = 3,423.needs_tvaudio = 1,424.tuner_type = UNSET,425.tuner_addr = ADDR_UNSET,426},427[BTTV_BOARD_AVERMEDIA] = {428.name = "AVerMedia TVPhone",429.video_inputs = 3,430/* .audio_inputs= 1, */431.svhs = 3,432.muxsel = MUXSEL(2, 3, 1, 1),433.gpiomask = 0x0f,434.gpiomux = { 0x0c, 0x04, 0x08, 0x04 },435/* 0x04 for some cards ?? */436.needs_tvaudio = 1,437.tuner_type = UNSET,438.tuner_addr = ADDR_UNSET,439.audio_mode_gpio= avermedia_tvphone_audio,440.has_remote = 1,441},442[BTTV_BOARD_MATRIX_VISION] = {443.name = "MATRIX-Vision MV-Delta",444.video_inputs = 5,445/* .audio_inputs= 1, */446.svhs = 3,447.gpiomask = 0,448.muxsel = MUXSEL(2, 3, 1, 0, 0),449.gpiomux = { 0 },450.needs_tvaudio = 1,451.tuner_type = TUNER_ABSENT,452.tuner_addr = ADDR_UNSET,453},454455/* ---- card 0x08 ---------------------------------- */456[BTTV_BOARD_FLYVIDEO] = {457.name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",458.video_inputs = 4,459/* .audio_inputs= 1, */460.svhs = 2,461.gpiomask = 0xc00,462.muxsel = MUXSEL(2, 3, 1, 1),463.gpiomux = { 0, 0xc00, 0x800, 0x400 },464.gpiomute = 0xc00,465.needs_tvaudio = 1,466.pll = PLL_28,467.tuner_type = UNSET,468.tuner_addr = ADDR_UNSET,469},470[BTTV_BOARD_TURBOTV] = {471.name = "IMS/IXmicro TurboTV",472.video_inputs = 3,473/* .audio_inputs= 1, */474.svhs = 2,475.gpiomask = 3,476.muxsel = MUXSEL(2, 3, 1, 1),477.gpiomux = { 1, 1, 2, 3 },478.needs_tvaudio = 0,479.pll = PLL_28,480.tuner_type = TUNER_TEMIC_PAL,481.tuner_addr = ADDR_UNSET,482},483[BTTV_BOARD_HAUPPAUGE878] = {484.name = "Hauppauge (bt878)",485.video_inputs = 4,486/* .audio_inputs= 1, */487.svhs = 2,488.gpiomask = 0x0f, /* old: 7 */489.muxsel = MUXSEL(2, 0, 1, 1),490.gpiomux = { 0, 1, 2, 3 },491.gpiomute = 4,492.needs_tvaudio = 1,493.pll = PLL_28,494.tuner_type = UNSET,495.tuner_addr = ADDR_UNSET,496},497[BTTV_BOARD_MIROPRO] = {498.name = "MIRO PCTV pro",499.video_inputs = 3,500/* .audio_inputs= 1, */501.svhs = 2,502.gpiomask = 0x3014f,503.muxsel = MUXSEL(2, 3, 1, 1),504.gpiomux = { 0x20001,0x10001, 0, 0 },505.gpiomute = 10,506.needs_tvaudio = 1,507.tuner_type = UNSET,508.tuner_addr = ADDR_UNSET,509},510511/* ---- card 0x0c ---------------------------------- */512[BTTV_BOARD_ADSTECH_TV] = {513.name = "ADS Technologies Channel Surfer TV (bt848)",514.video_inputs = 3,515/* .audio_inputs= 1, */516.svhs = 2,517.gpiomask = 15,518.muxsel = MUXSEL(2, 3, 1, 1),519.gpiomux = { 13, 14, 11, 7 },520.needs_tvaudio = 1,521.tuner_type = UNSET,522.tuner_addr = ADDR_UNSET,523},524[BTTV_BOARD_AVERMEDIA98] = {525.name = "AVerMedia TVCapture 98",526.video_inputs = 3,527/* .audio_inputs= 4, */528.svhs = 2,529.gpiomask = 15,530.muxsel = MUXSEL(2, 3, 1, 1),531.gpiomux = { 13, 14, 11, 7 },532.needs_tvaudio = 1,533.msp34xx_alt = 1,534.pll = PLL_28,535.tuner_type = TUNER_PHILIPS_PAL,536.tuner_addr = ADDR_UNSET,537.audio_mode_gpio= avermedia_tv_stereo_audio,538.no_gpioirq = 1,539},540[BTTV_BOARD_VHX] = {541.name = "Aimslab Video Highway Xtreme (VHX)",542.video_inputs = 3,543/* .audio_inputs= 1, */544.svhs = 2,545.gpiomask = 7,546.muxsel = MUXSEL(2, 3, 1, 1),547.gpiomux = { 0, 2, 1, 3 }, /* old: {0, 1, 2, 3, 4} */548.gpiomute = 4,549.needs_tvaudio = 1,550.pll = PLL_28,551.tuner_type = UNSET,552.tuner_addr = ADDR_UNSET,553},554[BTTV_BOARD_ZOLTRIX] = {555.name = "Zoltrix TV-Max",556.video_inputs = 3,557/* .audio_inputs= 1, */558.svhs = 2,559.gpiomask = 15,560.muxsel = MUXSEL(2, 3, 1, 1),561.gpiomux = { 0, 0, 1, 0 },562.gpiomute = 10,563.needs_tvaudio = 1,564.tuner_type = UNSET,565.tuner_addr = ADDR_UNSET,566},567568/* ---- card 0x10 ---------------------------------- */569[BTTV_BOARD_PIXVIEWPLAYTV] = {570.name = "Prolink Pixelview PlayTV (bt878)",571.video_inputs = 3,572/* .audio_inputs= 1, */573.svhs = 2,574.gpiomask = 0x01fe00,575.muxsel = MUXSEL(2, 3, 1, 1),576/* 2003-10-20 by "Anton A. Arapov" <[email protected]> */577.gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },578.gpiomute = 0x002000,579.needs_tvaudio = 1,580.pll = PLL_28,581.tuner_type = UNSET,582.tuner_addr = ADDR_UNSET,583},584[BTTV_BOARD_WINVIEW_601] = {585.name = "Leadtek WinView 601",586.video_inputs = 3,587/* .audio_inputs= 1, */588.svhs = 2,589.gpiomask = 0x8300f8,590.muxsel = MUXSEL(2, 3, 1, 1, 0),591.gpiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007 },592.gpiomute = 0xcfa007,593.needs_tvaudio = 1,594.tuner_type = UNSET,595.tuner_addr = ADDR_UNSET,596.volume_gpio = winview_volume,597.has_radio = 1,598},599[BTTV_BOARD_AVEC_INTERCAP] = {600.name = "AVEC Intercapture",601.video_inputs = 3,602/* .audio_inputs= 2, */603.svhs = 2,604.gpiomask = 0,605.muxsel = MUXSEL(2, 3, 1, 1),606.gpiomux = { 1, 0, 0, 0 },607.needs_tvaudio = 1,608.tuner_type = UNSET,609.tuner_addr = ADDR_UNSET,610},611[BTTV_BOARD_LIFE_FLYKIT] = {612.name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",613.video_inputs = 4,614/* .audio_inputs= 1, */615.svhs = NO_SVHS,616.gpiomask = 0x8dff00,617.muxsel = MUXSEL(2, 3, 1, 1),618.gpiomux = { 0 },619.no_msp34xx = 1,620.tuner_type = TUNER_ABSENT,621.tuner_addr = ADDR_UNSET,622},623624/* ---- card 0x14 ---------------------------------- */625[BTTV_BOARD_CEI_RAFFLES] = {626.name = "CEI Raffles Card",627.video_inputs = 3,628/* .audio_inputs= 3, */629.svhs = 2,630.muxsel = MUXSEL(2, 3, 1, 1),631.tuner_type = UNSET,632.tuner_addr = ADDR_UNSET,633},634[BTTV_BOARD_CONFERENCETV] = {635.name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",636.video_inputs = 4,637/* .audio_inputs= 2, tuner, line in */638.svhs = 2,639.gpiomask = 0x1800,640.muxsel = MUXSEL(2, 3, 1, 1),641.gpiomux = { 0, 0x800, 0x1000, 0x1000 },642.gpiomute = 0x1800,643.pll = PLL_28,644.tuner_type = TUNER_PHILIPS_PAL_I,645.tuner_addr = ADDR_UNSET,646},647[BTTV_BOARD_PHOEBE_TVMAS] = {648.name = "Askey CPH050/ Phoebe Tv Master + FM",649.video_inputs = 3,650/* .audio_inputs= 1, */651.svhs = 2,652.gpiomask = 0xc00,653.muxsel = MUXSEL(2, 3, 1, 1),654.gpiomux = { 0, 1, 0x800, 0x400 },655.gpiomute = 0xc00,656.needs_tvaudio = 1,657.pll = PLL_28,658.tuner_type = UNSET,659.tuner_addr = ADDR_UNSET,660},661[BTTV_BOARD_MODTEC_205] = {662.name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",663.video_inputs = 3,664/* .audio_inputs= 1, */665.svhs = NO_SVHS,666.has_dig_in = 1,667.gpiomask = 7,668.muxsel = MUXSEL(2, 3, 0), /* input 2 is digital */669/* .digital_mode= DIGITAL_MODE_CAMERA, */670.gpiomux = { 0, 0, 0, 0 },671.no_msp34xx = 1,672.pll = PLL_28,673.tuner_type = TUNER_ALPS_TSBB5_PAL_I,674.tuner_addr = ADDR_UNSET,675},676677/* ---- card 0x18 ---------------------------------- */678[BTTV_BOARD_MAGICTVIEW061] = {679.name = "Askey CPH05X/06X (bt878) [many vendors]",680.video_inputs = 3,681/* .audio_inputs= 1, */682.svhs = 2,683.gpiomask = 0xe00,684.muxsel = MUXSEL(2, 3, 1, 1),685.gpiomux = {0x400, 0x400, 0x400, 0x400 },686.gpiomute = 0xc00,687.needs_tvaudio = 1,688.pll = PLL_28,689.tuner_type = UNSET,690.tuner_addr = ADDR_UNSET,691.has_remote = 1,692},693[BTTV_BOARD_VOBIS_BOOSTAR] = {694.name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",695.video_inputs = 3,696/* .audio_inputs= 1, */697.svhs = 2,698.gpiomask = 0x1f0fff,699.muxsel = MUXSEL(2, 3, 1, 1),700.gpiomux = { 0x20000, 0x30000, 0x10000, 0 },701.gpiomute = 0x40000,702.needs_tvaudio = 0,703.tuner_type = TUNER_PHILIPS_PAL,704.tuner_addr = ADDR_UNSET,705.audio_mode_gpio= terratv_audio,706},707[BTTV_BOARD_HAUPPAUG_WCAM] = {708.name = "Hauppauge WinCam newer (bt878)",709.video_inputs = 4,710/* .audio_inputs= 1, */711.svhs = 3,712.gpiomask = 7,713.muxsel = MUXSEL(2, 0, 1, 1),714.gpiomux = { 0, 1, 2, 3 },715.gpiomute = 4,716.needs_tvaudio = 1,717.tuner_type = UNSET,718.tuner_addr = ADDR_UNSET,719},720[BTTV_BOARD_MAXI] = {721.name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",722.video_inputs = 4,723/* .audio_inputs= 2, */724.svhs = 2,725.gpiomask = 0x1800,726.muxsel = MUXSEL(2, 3, 1, 1),727.gpiomux = { 0, 0x800, 0x1000, 0x1000 },728.gpiomute = 0x1800,729.pll = PLL_28,730.tuner_type = TUNER_PHILIPS_SECAM,731.tuner_addr = ADDR_UNSET,732},733734/* ---- card 0x1c ---------------------------------- */735[BTTV_BOARD_TERRATV] = {736.name = "Terratec TerraTV+ Version 1.1 (bt878)",737.video_inputs = 3,738/* .audio_inputs= 1, */739.svhs = 2,740.gpiomask = 0x1f0fff,741.muxsel = MUXSEL(2, 3, 1, 1),742.gpiomux = { 0x20000, 0x30000, 0x10000, 0x00000 },743.gpiomute = 0x40000,744.needs_tvaudio = 0,745.tuner_type = TUNER_PHILIPS_PAL,746.tuner_addr = ADDR_UNSET,747.audio_mode_gpio= terratv_audio,748/* GPIO wiring:749External 20 pin connector (for Active Radio Upgrade board)750gpio00: i2c-sda751gpio01: i2c-scl752gpio02: om5610-data753gpio03: om5610-clk754gpio04: om5610-wre755gpio05: om5610-stereo756gpio06: rds6588-davn757gpio07: Pin 7 n.c.758gpio08: nIOW759gpio09+10: nIOR, nSEL ?? (bt878)760gpio09: nIOR (bt848)761gpio10: nSEL (bt848)762Sound Routing:763gpio16: u2-A0 (1st 4052bt)764gpio17: u2-A1765gpio18: u2-nEN766gpio19: u4-A0 (2nd 4052)767gpio20: u4-A1768u4-nEN - GND769Btspy:77000000 : Cdrom (internal audio input)77110000 : ext. Video audio input77220000 : TV Mono773a0000 : TV Mono/27741a0000 : TV Stereo77530000 : Radio77640000 : Mute777*/778779},780[BTTV_BOARD_PXC200] = {781/* Jannik Fritsch <[email protected]> */782.name = "Imagenation PXC200",783.video_inputs = 5,784/* .audio_inputs= 1, */785.svhs = 1, /* was: 4 */786.gpiomask = 0,787.muxsel = MUXSEL(2, 3, 1, 0, 0),788.gpiomux = { 0 },789.needs_tvaudio = 1,790.tuner_type = TUNER_ABSENT,791.tuner_addr = ADDR_UNSET,792.muxsel_hook = PXC200_muxsel,793794},795[BTTV_BOARD_FLYVIDEO_98] = {796.name = "Lifeview FlyVideo 98 LR50",797.video_inputs = 4,798/* .audio_inputs= 1, */799.svhs = 2,800.gpiomask = 0x1800, /* 0x8dfe00 */801.muxsel = MUXSEL(2, 3, 1, 1),802.gpiomux = { 0, 0x0800, 0x1000, 0x1000 },803.gpiomute = 0x1800,804.pll = PLL_28,805.tuner_type = UNSET,806.tuner_addr = ADDR_UNSET,807},808[BTTV_BOARD_IPROTV] = {809.name = "Formac iProTV, Formac ProTV I (bt848)",810.video_inputs = 4,811/* .audio_inputs= 1, */812.svhs = 3,813.gpiomask = 1,814.muxsel = MUXSEL(2, 3, 1, 1),815.gpiomux = { 1, 0, 0, 0 },816.pll = PLL_28,817.tuner_type = TUNER_PHILIPS_PAL,818.tuner_addr = ADDR_UNSET,819},820821/* ---- card 0x20 ---------------------------------- */822[BTTV_BOARD_INTEL_C_S_PCI] = {823.name = "Intel Create and Share PCI/ Smart Video Recorder III",824.video_inputs = 4,825/* .audio_inputs= 0, */826.svhs = 2,827.gpiomask = 0,828.muxsel = MUXSEL(2, 3, 1, 1),829.gpiomux = { 0 },830.needs_tvaudio = 0,831.tuner_type = TUNER_ABSENT,832.tuner_addr = ADDR_UNSET,833},834[BTTV_BOARD_TERRATVALUE] = {835.name = "Terratec TerraTValue Version Bt878",836.video_inputs = 3,837/* .audio_inputs= 1, */838.svhs = 2,839.gpiomask = 0xffff00,840.muxsel = MUXSEL(2, 3, 1, 1),841.gpiomux = { 0x500, 0, 0x300, 0x900 },842.gpiomute = 0x900,843.needs_tvaudio = 1,844.pll = PLL_28,845.tuner_type = TUNER_PHILIPS_PAL,846.tuner_addr = ADDR_UNSET,847},848[BTTV_BOARD_WINFAST2000] = {849.name = "Leadtek WinFast 2000/ WinFast 2000 XP",850.video_inputs = 4,851/* .audio_inputs= 1, */852.svhs = 2,853/* TV, CVid, SVid, CVid over SVid connector */854.muxsel = MUXSEL(2, 3, 1, 1, 0),855/* Alexander Varakin <[email protected]> [stereo version] */856.gpiomask = 0xb33000,857.gpiomux = { 0x122000,0x1000,0x0000,0x620000 },858.gpiomute = 0x800000,859/* Audio Routing for "WinFast 2000 XP" (no tv stereo !)860gpio23 -- hef4052:nEnable (0x800000)861gpio12 -- hef4052:A1862gpio13 -- hef4052:A08630x0000: external audio8640x1000: FM8650x2000: TV8660x3000: n.c.867Note: There exists another variant "Winfast 2000" with tv stereo !?868Note: eeprom only contains FF and pci subsystem id 107d:6606869*/870.needs_tvaudio = 0,871.pll = PLL_28,872.has_radio = 1,873.tuner_type = TUNER_PHILIPS_PAL, /* default for now, gpio reads BFFF06 for Pal bg+dk */874.tuner_addr = ADDR_UNSET,875.audio_mode_gpio= winfast2000_audio,876.has_remote = 1,877},878[BTTV_BOARD_CHRONOS_VS2] = {879.name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",880.video_inputs = 4,881/* .audio_inputs= 3, */882.svhs = 2,883.gpiomask = 0x1800,884.muxsel = MUXSEL(2, 3, 1, 1),885.gpiomux = { 0, 0x800, 0x1000, 0x1000 },886.gpiomute = 0x1800,887.pll = PLL_28,888.tuner_type = UNSET,889.tuner_addr = ADDR_UNSET,890},891892/* ---- card 0x24 ---------------------------------- */893[BTTV_BOARD_TYPHOON_TVIEW] = {894.name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",895.video_inputs = 4,896/* .audio_inputs= 3, */897.svhs = 2,898.gpiomask = 0x1800,899.muxsel = MUXSEL(2, 3, 1, 1),900.gpiomux = { 0, 0x800, 0x1000, 0x1000 },901.gpiomute = 0x1800,902.pll = PLL_28,903.tuner_type = UNSET,904.tuner_addr = ADDR_UNSET,905.has_radio = 1,906},907[BTTV_BOARD_PXELVWPLTVPRO] = {908.name = "Prolink PixelView PlayTV pro",909.video_inputs = 3,910/* .audio_inputs= 1, */911.svhs = 2,912.gpiomask = 0xff,913.muxsel = MUXSEL(2, 3, 1, 1),914.gpiomux = { 0x21, 0x20, 0x24, 0x2c },915.gpiomute = 0x29,916.no_msp34xx = 1,917.pll = PLL_28,918.tuner_type = UNSET,919.tuner_addr = ADDR_UNSET,920},921[BTTV_BOARD_MAGICTVIEW063] = {922.name = "Askey CPH06X TView99",923.video_inputs = 4,924/* .audio_inputs= 1, */925.svhs = 2,926.gpiomask = 0x551e00,927.muxsel = MUXSEL(2, 3, 1, 0),928.gpiomux = { 0x551400, 0x551200, 0, 0 },929.gpiomute = 0x551c00,930.needs_tvaudio = 1,931.pll = PLL_28,932.tuner_type = TUNER_PHILIPS_PAL_I,933.tuner_addr = ADDR_UNSET,934.has_remote = 1,935},936[BTTV_BOARD_PINNACLE] = {937.name = "Pinnacle PCTV Studio/Rave",938.video_inputs = 3,939/* .audio_inputs= 1, */940.svhs = 2,941.gpiomask = 0x03000F,942.muxsel = MUXSEL(2, 3, 1, 1),943.gpiomux = { 2, 0xd0001, 0, 0 },944.gpiomute = 1,945.needs_tvaudio = 0,946.pll = PLL_28,947.tuner_type = UNSET,948.tuner_addr = ADDR_UNSET,949},950951/* ---- card 0x28 ---------------------------------- */952[BTTV_BOARD_STB2] = {953.name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",954.video_inputs = 3,955/* .audio_inputs= 1, */956.svhs = 2,957.gpiomask = 7,958.muxsel = MUXSEL(2, 3, 1, 1),959.gpiomux = { 4, 0, 2, 3 },960.gpiomute = 1,961.no_msp34xx = 1,962.needs_tvaudio = 1,963.tuner_type = TUNER_PHILIPS_NTSC,964.tuner_addr = ADDR_UNSET,965.pll = PLL_28,966.has_radio = 1,967},968[BTTV_BOARD_AVPHONE98] = {969.name = "AVerMedia TVPhone 98",970.video_inputs = 3,971/* .audio_inputs= 4, */972.svhs = 2,973.gpiomask = 15,974.muxsel = MUXSEL(2, 3, 1, 1),975.gpiomux = { 13, 4, 11, 7 },976.needs_tvaudio = 1,977.pll = PLL_28,978.tuner_type = UNSET,979.tuner_addr = ADDR_UNSET,980.has_radio = 1,981.audio_mode_gpio= avermedia_tvphone_audio,982},983[BTTV_BOARD_PV951] = {984.name = "ProVideo PV951", /* pic16c54 */985.video_inputs = 3,986/* .audio_inputs= 1, */987.svhs = 2,988.gpiomask = 0,989.muxsel = MUXSEL(2, 3, 1, 1),990.gpiomux = { 0, 0, 0, 0},991.needs_tvaudio = 1,992.no_msp34xx = 1,993.pll = PLL_28,994.tuner_type = TUNER_PHILIPS_PAL_I,995.tuner_addr = ADDR_UNSET,996},997[BTTV_BOARD_ONAIR_TV] = {998.name = "Little OnAir TV",999.video_inputs = 3,1000/* .audio_inputs= 1, */1001.svhs = 2,1002.gpiomask = 0xe00b,1003.muxsel = MUXSEL(2, 3, 1, 1),1004.gpiomux = { 0xff9ff6, 0xff9ff6, 0xff1ff7, 0 },1005.gpiomute = 0xff3ffc,1006.no_msp34xx = 1,1007.tuner_type = UNSET,1008.tuner_addr = ADDR_UNSET,1009},10101011/* ---- card 0x2c ---------------------------------- */1012[BTTV_BOARD_SIGMA_TVII_FM] = {1013.name = "Sigma TVII-FM",1014.video_inputs = 2,1015/* .audio_inputs= 1, */1016.svhs = NO_SVHS,1017.gpiomask = 3,1018.muxsel = MUXSEL(2, 3, 1, 1),1019.gpiomux = { 1, 1, 0, 2 },1020.gpiomute = 3,1021.no_msp34xx = 1,1022.pll = PLL_NONE,1023.tuner_type = UNSET,1024.tuner_addr = ADDR_UNSET,1025},1026[BTTV_BOARD_MATRIX_VISION2] = {1027.name = "MATRIX-Vision MV-Delta 2",1028.video_inputs = 5,1029/* .audio_inputs= 1, */1030.svhs = 3,1031.gpiomask = 0,1032.muxsel = MUXSEL(2, 3, 1, 0, 0),1033.gpiomux = { 0 },1034.no_msp34xx = 1,1035.pll = PLL_28,1036.tuner_type = TUNER_ABSENT,1037.tuner_addr = ADDR_UNSET,1038},1039[BTTV_BOARD_ZOLTRIX_GENIE] = {1040.name = "Zoltrix Genie TV/FM",1041.video_inputs = 3,1042/* .audio_inputs= 1, */1043.svhs = 2,1044.gpiomask = 0xbcf03f,1045.muxsel = MUXSEL(2, 3, 1, 1),1046.gpiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0 },1047.gpiomute = 0xbcb03f,1048.no_msp34xx = 1,1049.pll = PLL_28,1050.tuner_type = TUNER_TEMIC_4039FR5_NTSC,1051.tuner_addr = ADDR_UNSET,1052},1053[BTTV_BOARD_TERRATVRADIO] = {1054.name = "Terratec TV/Radio+",1055.video_inputs = 3,1056/* .audio_inputs= 1, */1057.svhs = 2,1058.gpiomask = 0x70000,1059.muxsel = MUXSEL(2, 3, 1, 1),1060.gpiomux = { 0x20000, 0x30000, 0x10000, 0 },1061.gpiomute = 0x40000,1062.needs_tvaudio = 1,1063.no_msp34xx = 1,1064.pll = PLL_35,1065.tuner_type = TUNER_PHILIPS_PAL_I,1066.tuner_addr = ADDR_UNSET,1067.has_radio = 1,1068},10691070/* ---- card 0x30 ---------------------------------- */1071[BTTV_BOARD_DYNALINK] = {1072.name = "Askey CPH03x/ Dynalink Magic TView",1073.video_inputs = 3,1074/* .audio_inputs= 1, */1075.svhs = 2,1076.gpiomask = 15,1077.muxsel = MUXSEL(2, 3, 1, 1),1078.gpiomux = {2,0,0,0 },1079.gpiomute = 1,1080.needs_tvaudio = 1,1081.pll = PLL_28,1082.tuner_type = UNSET,1083.tuner_addr = ADDR_UNSET,1084},1085[BTTV_BOARD_GVBCTV3PCI] = {1086.name = "IODATA GV-BCTV3/PCI",1087.video_inputs = 3,1088/* .audio_inputs= 1, */1089.svhs = 2,1090.gpiomask = 0x010f00,1091.muxsel = MUXSEL(2, 3, 0, 0),1092.gpiomux = {0x10000, 0, 0x10000, 0 },1093.no_msp34xx = 1,1094.pll = PLL_28,1095.tuner_type = TUNER_ALPS_TSHC6_NTSC,1096.tuner_addr = ADDR_UNSET,1097.audio_mode_gpio= gvbctv3pci_audio,1098},1099[BTTV_BOARD_PXELVWPLTVPAK] = {1100.name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",1101.video_inputs = 5,1102/* .audio_inputs= 1, */1103.svhs = 3,1104.has_dig_in = 1,1105.gpiomask = 0xAA0000,1106.muxsel = MUXSEL(2, 3, 1, 1, 0), /* in 4 is digital */1107/* .digital_mode= DIGITAL_MODE_CAMERA, */1108.gpiomux = { 0x20000, 0, 0x80000, 0x80000 },1109.gpiomute = 0xa8000,1110.no_msp34xx = 1,1111.pll = PLL_28,1112.tuner_type = TUNER_PHILIPS_PAL_I,1113.tuner_addr = ADDR_UNSET,1114.has_remote = 1,1115/* GPIO wiring: (different from Rev.4C !)1116GPIO17: U4.A0 (first hef4052bt)1117GPIO19: U4.A11118GPIO20: U5.A1 (second hef4052bt)1119GPIO21: U4.nEN1120GPIO22: BT832 Reset Line1121GPIO23: A5,A0, U5,nEN1122Note: At i2c=0x8a is a Bt832 chip, which changes to 0x88 after being reset via GPIO221123*/1124},1125[BTTV_BOARD_EAGLE] = {1126.name = "Eagle Wireless Capricorn2 (bt878A)",1127.video_inputs = 4,1128/* .audio_inputs= 1, */1129.svhs = 2,1130.gpiomask = 7,1131.muxsel = MUXSEL(2, 0, 1, 1),1132.gpiomux = { 0, 1, 2, 3 },1133.gpiomute = 4,1134.pll = PLL_28,1135.tuner_type = UNSET /* TUNER_ALPS_TMDH2_NTSC */,1136.tuner_addr = ADDR_UNSET,1137},11381139/* ---- card 0x34 ---------------------------------- */1140[BTTV_BOARD_PINNACLEPRO] = {1141/* David Härdeman <[email protected]> */1142.name = "Pinnacle PCTV Studio Pro",1143.video_inputs = 4,1144/* .audio_inputs= 1, */1145.svhs = 3,1146.gpiomask = 0x03000F,1147.muxsel = MUXSEL(2, 3, 1, 1),1148.gpiomux = { 1, 0xd0001, 0, 0 },1149.gpiomute = 10,1150/* sound path (5 sources):1151MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)11520= ext. Audio IN11531= from MUX211542= Mono TV sound from Tuner11553= not connected1156MUX2 (mask 0x30000):11570,2,3= from MSP34xx11581= FM stereo Radio from Tuner */1159.needs_tvaudio = 0,1160.pll = PLL_28,1161.tuner_type = UNSET,1162.tuner_addr = ADDR_UNSET,1163},1164[BTTV_BOARD_TVIEW_RDS_FM] = {1165/* Claas Langbehn <[email protected]>,1166Sven Grothklags <[email protected]> */1167.name = "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",1168.video_inputs = 4,1169/* .audio_inputs= 3, */1170.svhs = 2,1171.gpiomask = 0x1c,1172.muxsel = MUXSEL(2, 3, 1, 1),1173.gpiomux = { 0, 0, 0x10, 8 },1174.gpiomute = 4,1175.needs_tvaudio = 1,1176.pll = PLL_28,1177.tuner_type = TUNER_PHILIPS_PAL,1178.tuner_addr = ADDR_UNSET,1179.has_radio = 1,1180},1181[BTTV_BOARD_LIFETEC_9415] = {1182/* Tim Röstermundt <[email protected]>1183in de.comp.os.unix.linux.hardware:1184options bttv card=0 pll=1 radio=1 gpiomask=0x18e01185gpiomux =0x44c71f,0x44d71f,0,0x44d71f,0x44dfff1186options tuner type=5 */1187.name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",1188.video_inputs = 4,1189/* .audio_inputs= 1, */1190.svhs = 2,1191.gpiomask = 0x18e0,1192.muxsel = MUXSEL(2, 3, 1, 1),1193.gpiomux = { 0x0000,0x0800,0x1000,0x1000 },1194.gpiomute = 0x18e0,1195/* For cards with tda9820/tda9821:11960x0000: Tuner normal stereo11970x0080: Tuner A2 SAP (second audio program = Zweikanalton)11980x0880: Tuner A2 stereo */1199.pll = PLL_28,1200.tuner_type = UNSET,1201.tuner_addr = ADDR_UNSET,1202},1203[BTTV_BOARD_BESTBUY_EASYTV] = {1204/* Miguel Angel Alvarez <[email protected]>1205old Easy TV BT848 version (model CPH031) */1206.name = "Askey CPH031/ BESTBUY Easy TV",1207.video_inputs = 4,1208/* .audio_inputs= 1, */1209.svhs = 2,1210.gpiomask = 0xF,1211.muxsel = MUXSEL(2, 3, 1, 0),1212.gpiomux = { 2, 0, 0, 0 },1213.gpiomute = 10,1214.needs_tvaudio = 0,1215.pll = PLL_28,1216.tuner_type = TUNER_TEMIC_PAL,1217.tuner_addr = ADDR_UNSET,1218},12191220/* ---- card 0x38 ---------------------------------- */1221[BTTV_BOARD_FLYVIDEO_98FM] = {1222/* Gordon Heydon <[email protected] ('98) */1223.name = "Lifeview FlyVideo 98FM LR50",1224.video_inputs = 4,1225/* .audio_inputs= 3, */1226.svhs = 2,1227.gpiomask = 0x1800,1228.muxsel = MUXSEL(2, 3, 1, 1),1229.gpiomux = { 0, 0x800, 0x1000, 0x1000 },1230.gpiomute = 0x1800,1231.pll = PLL_28,1232.tuner_type = TUNER_PHILIPS_PAL,1233.tuner_addr = ADDR_UNSET,1234},1235/* This is the ultimate cheapo capture card1236* just a BT848A on a small PCB!1237* Steve Hosgood <[email protected]> */1238[BTTV_BOARD_GRANDTEC] = {1239.name = "GrandTec 'Grand Video Capture' (Bt848)",1240.video_inputs = 2,1241/* .audio_inputs= 0, */1242.svhs = 1,1243.gpiomask = 0,1244.muxsel = MUXSEL(3, 1),1245.gpiomux = { 0 },1246.needs_tvaudio = 0,1247.no_msp34xx = 1,1248.pll = PLL_35,1249.tuner_type = TUNER_ABSENT,1250.tuner_addr = ADDR_UNSET,1251},1252[BTTV_BOARD_ASKEY_CPH060] = {1253/* Daniel Herrington <[email protected]> */1254.name = "Askey CPH060/ Phoebe TV Master Only (No FM)",1255.video_inputs = 3,1256/* .audio_inputs= 1, */1257.svhs = 2,1258.gpiomask = 0xe00,1259.muxsel = MUXSEL(2, 3, 1, 1),1260.gpiomux = { 0x400, 0x400, 0x400, 0x400 },1261.gpiomute = 0x800,1262.needs_tvaudio = 1,1263.pll = PLL_28,1264.tuner_type = TUNER_TEMIC_4036FY5_NTSC,1265.tuner_addr = ADDR_UNSET,1266},1267[BTTV_BOARD_ASKEY_CPH03X] = {1268/* Matti Mottus <[email protected]> */1269.name = "Askey CPH03x TV Capturer",1270.video_inputs = 4,1271/* .audio_inputs= 1, */1272.svhs = 2,1273.gpiomask = 0x03000F,1274.muxsel = MUXSEL(2, 3, 1, 0),1275.gpiomux = { 2, 0, 0, 0 },1276.gpiomute = 1,1277.pll = PLL_28,1278.tuner_type = TUNER_TEMIC_PAL,1279.tuner_addr = ADDR_UNSET,1280.has_remote = 1,1281},12821283/* ---- card 0x3c ---------------------------------- */1284[BTTV_BOARD_MM100PCTV] = {1285/* Philip Blundell <[email protected]> */1286.name = "Modular Technology MM100PCTV",1287.video_inputs = 2,1288/* .audio_inputs= 2, */1289.svhs = NO_SVHS,1290.gpiomask = 11,1291.muxsel = MUXSEL(2, 3, 1, 1),1292.gpiomux = { 2, 0, 0, 1 },1293.gpiomute = 8,1294.pll = PLL_35,1295.tuner_type = TUNER_TEMIC_PAL,1296.tuner_addr = ADDR_UNSET,1297},1298[BTTV_BOARD_GMV1] = {1299/* Adrian Cox <[email protected] */1300.name = "AG Electronics GMV1",1301.video_inputs = 2,1302/* .audio_inputs= 0, */1303.svhs = 1,1304.gpiomask = 0xF,1305.muxsel = MUXSEL(2, 2),1306.gpiomux = { },1307.no_msp34xx = 1,1308.needs_tvaudio = 0,1309.pll = PLL_28,1310.tuner_type = TUNER_ABSENT,1311.tuner_addr = ADDR_UNSET,1312},1313[BTTV_BOARD_BESTBUY_EASYTV2] = {1314/* Miguel Angel Alvarez <[email protected]>1315new Easy TV BT878 version (model CPH061)1316special thanks to Informatica Mieres for providing the card */1317.name = "Askey CPH061/ BESTBUY Easy TV (bt878)",1318.video_inputs = 3,1319/* .audio_inputs= 2, */1320.svhs = 2,1321.gpiomask = 0xFF,1322.muxsel = MUXSEL(2, 3, 1, 0),1323.gpiomux = { 1, 0, 4, 4 },1324.gpiomute = 9,1325.needs_tvaudio = 0,1326.pll = PLL_28,1327.tuner_type = TUNER_PHILIPS_PAL,1328.tuner_addr = ADDR_UNSET,1329},1330[BTTV_BOARD_ATI_TVWONDER] = {1331/* Lukas Gebauer <[email protected]> */1332.name = "ATI TV-Wonder",1333.video_inputs = 3,1334/* .audio_inputs= 1, */1335.svhs = 2,1336.gpiomask = 0xf03f,1337.muxsel = MUXSEL(2, 3, 1, 0),1338.gpiomux = { 0xbffe, 0, 0xbfff, 0 },1339.gpiomute = 0xbffe,1340.pll = PLL_28,1341.tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,1342.tuner_addr = ADDR_UNSET,1343},13441345/* ---- card 0x40 ---------------------------------- */1346[BTTV_BOARD_ATI_TVWONDERVE] = {1347/* Lukas Gebauer <[email protected]> */1348.name = "ATI TV-Wonder VE",1349.video_inputs = 2,1350/* .audio_inputs= 1, */1351.svhs = NO_SVHS,1352.gpiomask = 1,1353.muxsel = MUXSEL(2, 3, 0, 1),1354.gpiomux = { 0, 0, 1, 0 },1355.no_msp34xx = 1,1356.pll = PLL_28,1357.tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,1358.tuner_addr = ADDR_UNSET,1359},1360[BTTV_BOARD_FLYVIDEO2000] = {1361/* DeeJay <[email protected] (2000S) */1362.name = "Lifeview FlyVideo 2000S LR90",1363.video_inputs = 3,1364/* .audio_inputs= 3, */1365.svhs = 2,1366.gpiomask = 0x18e0,1367.muxsel = MUXSEL(2, 3, 0, 1),1368/* Radio changed from 1e80 to 0x800 to make1369FlyVideo2000S in .hu happy (gm)*/1370/* -dk-???: set mute=0x1800 for tda9874h daughterboard */1371.gpiomux = { 0x0000,0x0800,0x1000,0x1000 },1372.gpiomute = 0x1800,1373.audio_mode_gpio= fv2000s_audio,1374.no_msp34xx = 1,1375.needs_tvaudio = 1,1376.pll = PLL_28,1377.tuner_type = TUNER_PHILIPS_PAL,1378.tuner_addr = ADDR_UNSET,1379},1380[BTTV_BOARD_TERRATVALUER] = {1381.name = "Terratec TValueRadio",1382.video_inputs = 3,1383/* .audio_inputs= 1, */1384.svhs = 2,1385.gpiomask = 0xffff00,1386.muxsel = MUXSEL(2, 3, 1, 1),1387.gpiomux = { 0x500, 0x500, 0x300, 0x900 },1388.gpiomute = 0x900,1389.needs_tvaudio = 1,1390.pll = PLL_28,1391.tuner_type = TUNER_PHILIPS_PAL,1392.tuner_addr = ADDR_UNSET,1393.has_radio = 1,1394},1395[BTTV_BOARD_GVBCTV4PCI] = {1396/* TANAKA Kei <[email protected]> */1397.name = "IODATA GV-BCTV4/PCI",1398.video_inputs = 3,1399/* .audio_inputs= 1, */1400.svhs = 2,1401.gpiomask = 0x010f00,1402.muxsel = MUXSEL(2, 3, 0, 0),1403.gpiomux = {0x10000, 0, 0x10000, 0 },1404.no_msp34xx = 1,1405.pll = PLL_28,1406.tuner_type = TUNER_SHARP_2U5JF5540_NTSC,1407.tuner_addr = ADDR_UNSET,1408.audio_mode_gpio= gvbctv3pci_audio,1409},14101411/* ---- card 0x44 ---------------------------------- */1412[BTTV_BOARD_VOODOOTV_FM] = {1413.name = "3Dfx VoodooTV FM (Euro)",1414/* try "insmod msp3400 simple=0" if you have1415* sound problems with this card. */1416.video_inputs = 4,1417/* .audio_inputs= 1, */1418.svhs = NO_SVHS,1419.gpiomask = 0x4f8a00,1420/* 0x100000: 1=MSP enabled (0=disable again)1421* 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */1422.gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },1423.gpiomute = 0x947fff,1424/* tvtuner, radio, external,internal, mute, stereo1425* tuner, Composit, SVid, Composit-on-Svid-adapter */1426.muxsel = MUXSEL(2, 3, 0, 1),1427.tuner_type = TUNER_MT2032,1428.tuner_addr = ADDR_UNSET,1429.pll = PLL_28,1430.has_radio = 1,1431},1432[BTTV_BOARD_VOODOOTV_200] = {1433.name = "VoodooTV 200 (USA)",1434/* try "insmod msp3400 simple=0" if you have1435* sound problems with this card. */1436.video_inputs = 4,1437/* .audio_inputs= 1, */1438.svhs = NO_SVHS,1439.gpiomask = 0x4f8a00,1440/* 0x100000: 1=MSP enabled (0=disable again)1441* 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */1442.gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },1443.gpiomute = 0x947fff,1444/* tvtuner, radio, external,internal, mute, stereo1445* tuner, Composit, SVid, Composit-on-Svid-adapter */1446.muxsel = MUXSEL(2, 3, 0, 1),1447.tuner_type = TUNER_MT2032,1448.tuner_addr = ADDR_UNSET,1449.pll = PLL_28,1450.has_radio = 1,1451},1452[BTTV_BOARD_AIMMS] = {1453/* Philip Blundell <[email protected]> */1454.name = "Active Imaging AIMMS",1455.video_inputs = 1,1456/* .audio_inputs= 0, */1457.tuner_type = TUNER_ABSENT,1458.tuner_addr = ADDR_UNSET,1459.pll = PLL_28,1460.muxsel = MUXSEL(2),1461.gpiomask = 01462},1463[BTTV_BOARD_PV_BT878P_PLUS] = {1464/* Tomasz Pyra <[email protected]> */1465.name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",1466.video_inputs = 3,1467/* .audio_inputs= 4, */1468.svhs = 2,1469.gpiomask = 15,1470.muxsel = MUXSEL(2, 3, 1, 1),1471.gpiomux = { 0, 0, 11, 7 }, /* TV and Radio with same GPIO ! */1472.gpiomute = 13,1473.needs_tvaudio = 1,1474.pll = PLL_28,1475.tuner_type = TUNER_LG_PAL_I_FM,1476.tuner_addr = ADDR_UNSET,1477.has_remote = 1,1478/* GPIO wiring:1479GPIO0: U4.A0 (hef4052bt)1480GPIO1: U4.A11481GPIO2: U4.A1 (second hef4052bt)1482GPIO3: U4.nEN, U5.A0, A5.nEN1483GPIO8-15: vrd866b ?1484*/1485},1486[BTTV_BOARD_FLYVIDEO98EZ] = {1487.name = "Lifeview FlyVideo 98EZ (capture only) LR51",1488.video_inputs = 4,1489/* .audio_inputs= 0, */1490.svhs = 2,1491/* AV1, AV2, SVHS, CVid adapter on SVHS */1492.muxsel = MUXSEL(2, 3, 1, 1),1493.pll = PLL_28,1494.no_msp34xx = 1,1495.tuner_type = TUNER_ABSENT,1496.tuner_addr = ADDR_UNSET,1497},14981499/* ---- card 0x48 ---------------------------------- */1500[BTTV_BOARD_PV_BT878P_9B] = {1501/* Dariusz Kowalewski <[email protected]> */1502.name = "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",1503.video_inputs = 4,1504/* .audio_inputs= 1, */1505.svhs = 2,1506.gpiomask = 0x3f,1507.muxsel = MUXSEL(2, 3, 1, 1),1508.gpiomux = { 0x01, 0x00, 0x03, 0x03 },1509.gpiomute = 0x09,1510.needs_tvaudio = 1,1511.no_msp34xx = 1,1512.pll = PLL_28,1513.tuner_type = TUNER_PHILIPS_PAL,1514.tuner_addr = ADDR_UNSET,1515.audio_mode_gpio= pvbt878p9b_audio, /* Note: not all cards have stereo */1516.has_radio = 1, /* Note: not all cards have radio */1517.has_remote = 1,1518/* GPIO wiring:1519GPIO0: A0 hef40521520GPIO1: A1 hef40521521GPIO3: nEN hef40521522GPIO8-15: vrd866b1523GPIO20,22,23: R30,R29,R281524*/1525},1526[BTTV_BOARD_SENSORAY311] = {1527/* Clay Kunz <[email protected]> */1528/* you must jumper JP5 for the card to work */1529.name = "Sensoray 311",1530.video_inputs = 5,1531/* .audio_inputs= 0, */1532.svhs = 4,1533.gpiomask = 0,1534.muxsel = MUXSEL(2, 3, 1, 0, 0),1535.gpiomux = { 0 },1536.needs_tvaudio = 0,1537.tuner_type = TUNER_ABSENT,1538.tuner_addr = ADDR_UNSET,1539},1540[BTTV_BOARD_RV605] = {1541/* Miguel Freitas <[email protected]> */1542.name = "RemoteVision MX (RV605)",1543.video_inputs = 16,1544/* .audio_inputs= 0, */1545.svhs = NO_SVHS,1546.gpiomask = 0x00,1547.gpiomask2 = 0x07ff,1548.muxsel = MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),1549.no_msp34xx = 1,1550.tuner_type = TUNER_ABSENT,1551.tuner_addr = ADDR_UNSET,1552.muxsel_hook = rv605_muxsel,1553},1554[BTTV_BOARD_POWERCLR_MTV878] = {1555.name = "Powercolor MTV878/ MTV878R/ MTV878F",1556.video_inputs = 3,1557/* .audio_inputs= 2, */1558.svhs = 2,1559.gpiomask = 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */1560.muxsel = MUXSEL(2, 1, 1),1561.gpiomux = { 0, 1, 2, 2 },1562.gpiomute = 4,1563.needs_tvaudio = 0,1564.tuner_type = TUNER_PHILIPS_PAL,1565.tuner_addr = ADDR_UNSET,1566.pll = PLL_28,1567.has_radio = 1,1568},15691570/* ---- card 0x4c ---------------------------------- */1571[BTTV_BOARD_WINDVR] = {1572/* Masaki Suzuki <[email protected]> */1573.name = "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",1574.video_inputs = 3,1575/* .audio_inputs= 1, */1576.svhs = 2,1577.gpiomask = 0x140007,1578.muxsel = MUXSEL(2, 3, 1, 1),1579.gpiomux = { 0, 1, 2, 3 },1580.gpiomute = 4,1581.tuner_type = TUNER_PHILIPS_NTSC,1582.tuner_addr = ADDR_UNSET,1583.audio_mode_gpio= windvr_audio,1584},1585[BTTV_BOARD_GRANDTEC_MULTI] = {1586.name = "GrandTec Multi Capture Card (Bt878)",1587.video_inputs = 4,1588/* .audio_inputs= 0, */1589.svhs = NO_SVHS,1590.gpiomask = 0,1591.muxsel = MUXSEL(2, 3, 1, 0),1592.gpiomux = { 0 },1593.needs_tvaudio = 0,1594.no_msp34xx = 1,1595.pll = PLL_28,1596.tuner_type = TUNER_ABSENT,1597.tuner_addr = ADDR_UNSET,1598},1599[BTTV_BOARD_KWORLD] = {1600.name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",1601.video_inputs = 4,1602/* .audio_inputs= 3, */1603.svhs = 2,1604.gpiomask = 7,1605/* Tuner, SVid, SVHS, SVid to SVHS connector */1606.muxsel = MUXSEL(2, 3, 1, 1),1607.gpiomux = { 0, 0, 4, 4 },/* Yes, this tuner uses the same audio output for TV and FM radio!1608* This card lacks external Audio In, so we mute it on Ext. & Int.1609* The PCB can take a sbx1637/sbx1673, wiring unknown.1610* This card lacks PCI subsystem ID, sigh.1611* gpiomux =1: lower volume, 2+3: mute1612* btwincap uses 0x80000/0x800031613*/1614.gpiomute = 4,1615.needs_tvaudio = 0,1616.no_msp34xx = 1,1617.pll = PLL_28,1618.tuner_type = TUNER_PHILIPS_PAL,1619.tuner_addr = ADDR_UNSET,1620/* Samsung TCPA9095PC27A (BG+DK), philips compatible, w/FM, stereo and1621radio signal strength indicators work fine. */1622.has_radio = 1,1623/* GPIO Info:1624GPIO0,1: HEF4052 A0,A11625GPIO2: HEF4052 nENABLE1626GPIO3-7: n.c.1627GPIO8-13: IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]1628GPIO14,15: ??1629GPIO16-21: n.c.1630GPIO22,23: ??1631?? : mtu8b56ep microcontroller for IR (GPIO wiring unknown)*/1632},1633[BTTV_BOARD_DSP_TCVIDEO] = {1634/* Arthur Tetzlaff-Deas, DSP Design Ltd <[email protected]> */1635.name = "DSP Design TCVIDEO",1636.video_inputs = 4,1637.svhs = NO_SVHS,1638.muxsel = MUXSEL(2, 3, 1, 0),1639.pll = PLL_28,1640.tuner_type = UNSET,1641.tuner_addr = ADDR_UNSET,1642},16431644/* ---- card 0x50 ---------------------------------- */1645[BTTV_BOARD_HAUPPAUGEPVR] = {1646.name = "Hauppauge WinTV PVR",1647.video_inputs = 4,1648/* .audio_inputs= 1, */1649.svhs = 2,1650.muxsel = MUXSEL(2, 0, 1, 1),1651.needs_tvaudio = 1,1652.pll = PLL_28,1653.tuner_type = UNSET,1654.tuner_addr = ADDR_UNSET,16551656.gpiomask = 7,1657.gpiomux = {7},1658},1659[BTTV_BOARD_GVBCTV5PCI] = {1660.name = "IODATA GV-BCTV5/PCI",1661.video_inputs = 3,1662/* .audio_inputs= 1, */1663.svhs = 2,1664.gpiomask = 0x0f0f80,1665.muxsel = MUXSEL(2, 3, 1, 0),1666.gpiomux = {0x030000, 0x010000, 0, 0 },1667.gpiomute = 0x020000,1668.no_msp34xx = 1,1669.pll = PLL_28,1670.tuner_type = TUNER_PHILIPS_NTSC_M,1671.tuner_addr = ADDR_UNSET,1672.audio_mode_gpio= gvbctv5pci_audio,1673.has_radio = 1,1674},1675[BTTV_BOARD_OSPREY1x0] = {1676.name = "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */1677.video_inputs = 4, /* id-inputs-clock */1678/* .audio_inputs= 0, */1679.svhs = 3,1680.muxsel = MUXSEL(3, 2, 0, 1),1681.pll = PLL_28,1682.tuner_type = TUNER_ABSENT,1683.tuner_addr = ADDR_UNSET,1684.no_msp34xx = 1,1685.no_tda7432 = 1,1686},1687[BTTV_BOARD_OSPREY1x0_848] = {1688.name = "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */1689.video_inputs = 3,1690/* .audio_inputs= 0, */1691.svhs = 2,1692.muxsel = MUXSEL(2, 3, 1),1693.pll = PLL_28,1694.tuner_type = TUNER_ABSENT,1695.tuner_addr = ADDR_UNSET,1696.no_msp34xx = 1,1697.no_tda7432 = 1,1698},16991700/* ---- card 0x54 ---------------------------------- */1701[BTTV_BOARD_OSPREY101_848] = {1702.name = "Osprey 101 (848)", /* 0x05-40C0-C1 */1703.video_inputs = 2,1704/* .audio_inputs= 0, */1705.svhs = 1,1706.muxsel = MUXSEL(3, 1),1707.pll = PLL_28,1708.tuner_type = TUNER_ABSENT,1709.tuner_addr = ADDR_UNSET,1710.no_msp34xx = 1,1711.no_tda7432 = 1,1712},1713[BTTV_BOARD_OSPREY1x1] = {1714.name = "Osprey 101/151", /* 0x1(4|5)-0004-C4 */1715.video_inputs = 1,1716/* .audio_inputs= 0, */1717.svhs = NO_SVHS,1718.muxsel = MUXSEL(0),1719.pll = PLL_28,1720.tuner_type = TUNER_ABSENT,1721.tuner_addr = ADDR_UNSET,1722.no_msp34xx = 1,1723.no_tda7432 = 1,1724},1725[BTTV_BOARD_OSPREY1x1_SVID] = {1726.name = "Osprey 101/151 w/ svid", /* 0x(16|17|20)-00C4-C1 */1727.video_inputs = 2,1728/* .audio_inputs= 0, */1729.svhs = 1,1730.muxsel = MUXSEL(0, 1),1731.pll = PLL_28,1732.tuner_type = TUNER_ABSENT,1733.tuner_addr = ADDR_UNSET,1734.no_msp34xx = 1,1735.no_tda7432 = 1,1736},1737[BTTV_BOARD_OSPREY2xx] = {1738.name = "Osprey 200/201/250/251", /* 0x1(8|9|E|F)-0004-C4 */1739.video_inputs = 1,1740/* .audio_inputs= 1, */1741.svhs = NO_SVHS,1742.muxsel = MUXSEL(0),1743.pll = PLL_28,1744.tuner_type = TUNER_ABSENT,1745.tuner_addr = ADDR_UNSET,1746.no_msp34xx = 1,1747.no_tda7432 = 1,1748},17491750/* ---- card 0x58 ---------------------------------- */1751[BTTV_BOARD_OSPREY2x0_SVID] = {1752.name = "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */1753.video_inputs = 2,1754/* .audio_inputs= 1, */1755.svhs = 1,1756.muxsel = MUXSEL(0, 1),1757.pll = PLL_28,1758.tuner_type = TUNER_ABSENT,1759.tuner_addr = ADDR_UNSET,1760.no_msp34xx = 1,1761.no_tda7432 = 1,1762},1763[BTTV_BOARD_OSPREY2x0] = {1764.name = "Osprey 210/220/230", /* 0x1(A|B)-04C0-C1 */1765.video_inputs = 2,1766/* .audio_inputs= 1, */1767.svhs = 1,1768.muxsel = MUXSEL(2, 3),1769.pll = PLL_28,1770.tuner_type = TUNER_ABSENT,1771.tuner_addr = ADDR_UNSET,1772.no_msp34xx = 1,1773.no_tda7432 = 1,1774},1775[BTTV_BOARD_OSPREY500] = {1776.name = "Osprey 500", /* 500 */1777.video_inputs = 2,1778/* .audio_inputs= 1, */1779.svhs = 1,1780.muxsel = MUXSEL(2, 3),1781.pll = PLL_28,1782.tuner_type = TUNER_ABSENT,1783.tuner_addr = ADDR_UNSET,1784.no_msp34xx = 1,1785.no_tda7432 = 1,1786},1787[BTTV_BOARD_OSPREY540] = {1788.name = "Osprey 540", /* 540 */1789.video_inputs = 4,1790/* .audio_inputs= 1, */1791.pll = PLL_28,1792.tuner_type = TUNER_ABSENT,1793.tuner_addr = ADDR_UNSET,1794.no_msp34xx = 1,1795.no_tda7432 = 1,1796},17971798/* ---- card 0x5C ---------------------------------- */1799[BTTV_BOARD_OSPREY2000] = {1800.name = "Osprey 2000", /* 2000 */1801.video_inputs = 2,1802/* .audio_inputs= 1, */1803.svhs = 1,1804.muxsel = MUXSEL(2, 3),1805.pll = PLL_28,1806.tuner_type = TUNER_ABSENT,1807.tuner_addr = ADDR_UNSET,1808.no_msp34xx = 1,1809.no_tda7432 = 1, /* must avoid, conflicts with the bt860 */1810},1811[BTTV_BOARD_IDS_EAGLE] = {1812/* M G Berberich <[email protected]> */1813.name = "IDS Eagle",1814.video_inputs = 4,1815/* .audio_inputs= 0, */1816.tuner_type = TUNER_ABSENT,1817.tuner_addr = ADDR_UNSET,1818.svhs = NO_SVHS,1819.gpiomask = 0,1820.muxsel = MUXSEL(2, 2, 2, 2),1821.muxsel_hook = eagle_muxsel,1822.no_msp34xx = 1,1823.pll = PLL_28,1824},1825[BTTV_BOARD_PINNACLESAT] = {1826.name = "Pinnacle PCTV Sat",1827.video_inputs = 2,1828/* .audio_inputs= 0, */1829.svhs = 1,1830.tuner_type = TUNER_ABSENT,1831.tuner_addr = ADDR_UNSET,1832.no_msp34xx = 1,1833.no_tda7432 = 1,1834.muxsel = MUXSEL(3, 1),1835.pll = PLL_28,1836.no_gpioirq = 1,1837.has_dvb = 1,1838},1839[BTTV_BOARD_FORMAC_PROTV] = {1840.name = "Formac ProTV II (bt878)",1841.video_inputs = 4,1842/* .audio_inputs= 1, */1843.svhs = 3,1844.gpiomask = 2,1845/* TV, Comp1, Composite over SVID con, SVID */1846.muxsel = MUXSEL(2, 3, 1, 1),1847.gpiomux = { 2, 2, 0, 0 },1848.pll = PLL_28,1849.has_radio = 1,1850.tuner_type = TUNER_PHILIPS_PAL,1851.tuner_addr = ADDR_UNSET,1852/* sound routing:1853GPIO=0x00,0x01,0x03: mute (?)18540x02: both TV and radio (tuner: FM1216/I)1855The card has onboard audio connectors labeled "cdrom" and "board",1856not soldered here, though unknown wiring.1857Card lacks: external audio in, pci subsystem id.1858*/1859},18601861/* ---- card 0x60 ---------------------------------- */1862[BTTV_BOARD_MACHTV] = {1863.name = "MachTV",1864.video_inputs = 3,1865/* .audio_inputs= 1, */1866.svhs = NO_SVHS,1867.gpiomask = 7,1868.muxsel = MUXSEL(2, 3, 1, 1),1869.gpiomux = { 0, 1, 2, 3},1870.gpiomute = 4,1871.needs_tvaudio = 1,1872.tuner_type = TUNER_PHILIPS_PAL,1873.tuner_addr = ADDR_UNSET,1874.pll = PLL_28,1875},1876[BTTV_BOARD_EURESYS_PICOLO] = {1877.name = "Euresys Picolo",1878.video_inputs = 3,1879/* .audio_inputs= 0, */1880.svhs = 2,1881.gpiomask = 0,1882.no_msp34xx = 1,1883.no_tda7432 = 1,1884.muxsel = MUXSEL(2, 0, 1),1885.pll = PLL_28,1886.tuner_type = TUNER_ABSENT,1887.tuner_addr = ADDR_UNSET,1888},1889[BTTV_BOARD_PV150] = {1890/* Luc Van Hoeylandt <[email protected]> */1891.name = "ProVideo PV150", /* 0x4f */1892.video_inputs = 2,1893/* .audio_inputs= 0, */1894.svhs = NO_SVHS,1895.gpiomask = 0,1896.muxsel = MUXSEL(2, 3),1897.gpiomux = { 0 },1898.needs_tvaudio = 0,1899.no_msp34xx = 1,1900.pll = PLL_28,1901.tuner_type = TUNER_ABSENT,1902.tuner_addr = ADDR_UNSET,1903},1904[BTTV_BOARD_AD_TVK503] = {1905/* Hiroshi Takekawa <[email protected]> */1906/* This card lacks subsystem ID */1907.name = "AD-TVK503", /* 0x63 */1908.video_inputs = 4,1909/* .audio_inputs= 1, */1910.svhs = 2,1911.gpiomask = 0x001e8007,1912.muxsel = MUXSEL(2, 3, 1, 0),1913/* Tuner, Radio, external, internal, off, on */1914.gpiomux = { 0x08, 0x0f, 0x0a, 0x08 },1915.gpiomute = 0x0f,1916.needs_tvaudio = 0,1917.no_msp34xx = 1,1918.pll = PLL_28,1919.tuner_type = TUNER_PHILIPS_NTSC,1920.tuner_addr = ADDR_UNSET,1921.audio_mode_gpio= adtvk503_audio,1922},19231924/* ---- card 0x64 ---------------------------------- */1925[BTTV_BOARD_HERCULES_SM_TV] = {1926.name = "Hercules Smart TV Stereo",1927.video_inputs = 4,1928/* .audio_inputs= 1, */1929.svhs = 2,1930.gpiomask = 0x00,1931.muxsel = MUXSEL(2, 3, 1, 1),1932.needs_tvaudio = 1,1933.no_msp34xx = 1,1934.pll = PLL_28,1935.tuner_type = TUNER_PHILIPS_PAL,1936.tuner_addr = ADDR_UNSET,1937/* Notes:1938- card lacks subsystem ID1939- stereo variant w/ daughter board with tda9874a @0xb01940- Audio Routing:1941always from tda9874 independent of GPIO (?)1942external line in: unknown1943- Other chips: em78p156elp @ 0x96 (probably IR remote control)1944hef4053 (instead 4052) for unknown function1945*/1946},1947[BTTV_BOARD_PACETV] = {1948.name = "Pace TV & Radio Card",1949.video_inputs = 4,1950/* .audio_inputs= 1, */1951.svhs = 2,1952/* Tuner, CVid, SVid, CVid over SVid connector */1953.muxsel = MUXSEL(2, 3, 1, 1),1954.gpiomask = 0,1955.no_tda7432 = 1,1956.tuner_type = TUNER_PHILIPS_PAL_I,1957.tuner_addr = ADDR_UNSET,1958.has_radio = 1,1959.pll = PLL_28,1960/* Bt878, Bt832, FI1246 tuner; no pci subsystem id1961only internal line out: (4pin header) RGGL1962Radio must be decoded by msp3410d (not routed through)*/1963/*1964.digital_mode = DIGITAL_MODE_CAMERA, todo!1965*/1966},1967[BTTV_BOARD_IVC200] = {1968/* Chris Willing <[email protected]> */1969.name = "IVC-200",1970.video_inputs = 1,1971/* .audio_inputs= 0, */1972.tuner_type = TUNER_ABSENT,1973.tuner_addr = ADDR_UNSET,1974.svhs = NO_SVHS,1975.gpiomask = 0xdf,1976.muxsel = MUXSEL(2),1977.pll = PLL_28,1978},1979[BTTV_BOARD_IVCE8784] = {1980.name = "IVCE-8784",1981.video_inputs = 1,1982/* .audio_inputs= 0, */1983.tuner_type = TUNER_ABSENT,1984.tuner_addr = ADDR_UNSET,1985.svhs = NO_SVHS,1986.gpiomask = 0xdf,1987.muxsel = MUXSEL(2),1988.pll = PLL_28,1989},1990[BTTV_BOARD_XGUARD] = {1991.name = "Grand X-Guard / Trust 814PCI",1992.video_inputs = 16,1993/* .audio_inputs= 0, */1994.svhs = NO_SVHS,1995.tuner_type = TUNER_ABSENT,1996.tuner_addr = ADDR_UNSET,1997.gpiomask2 = 0xff,1998.muxsel = MUXSEL(2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0),1999.muxsel_hook = xguard_muxsel,2000.no_msp34xx = 1,2001.no_tda7432 = 1,2002.pll = PLL_28,2003},20042005/* ---- card 0x68 ---------------------------------- */2006[BTTV_BOARD_NEBULA_DIGITV] = {2007.name = "Nebula Electronics DigiTV",2008.video_inputs = 1,2009.svhs = NO_SVHS,2010.muxsel = MUXSEL(2, 3, 1, 0),2011.no_msp34xx = 1,2012.no_tda7432 = 1,2013.pll = PLL_28,2014.tuner_type = TUNER_ABSENT,2015.tuner_addr = ADDR_UNSET,2016.has_dvb = 1,2017.has_remote = 1,2018.gpiomask = 0x1b,2019.no_gpioirq = 1,2020},2021[BTTV_BOARD_PV143] = {2022/* Jorge Boncompte - DTI2 <[email protected]> */2023.name = "ProVideo PV143",2024.video_inputs = 4,2025/* .audio_inputs= 0, */2026.svhs = NO_SVHS,2027.gpiomask = 0,2028.muxsel = MUXSEL(2, 3, 1, 0),2029.gpiomux = { 0 },2030.needs_tvaudio = 0,2031.no_msp34xx = 1,2032.pll = PLL_28,2033.tuner_type = TUNER_ABSENT,2034.tuner_addr = ADDR_UNSET,2035},2036[BTTV_BOARD_VD009X1_VD011_MINIDIN] = {2037/* [email protected] */2038.name = "PHYTEC VD-009-X1 VD-011 MiniDIN (bt878)",2039.video_inputs = 4,2040/* .audio_inputs= 0, */2041.svhs = 3,2042.gpiomask = 0x00,2043.muxsel = MUXSEL(2, 3, 1, 0),2044.gpiomux = { 0, 0, 0, 0 }, /* card has no audio */2045.needs_tvaudio = 0,2046.pll = PLL_28,2047.tuner_type = TUNER_ABSENT,2048.tuner_addr = ADDR_UNSET,2049},2050[BTTV_BOARD_VD009X1_VD011_COMBI] = {2051.name = "PHYTEC VD-009-X1 VD-011 Combi (bt878)",2052.video_inputs = 4,2053/* .audio_inputs= 0, */2054.svhs = 3,2055.gpiomask = 0x00,2056.muxsel = MUXSEL(2, 3, 1, 1),2057.gpiomux = { 0, 0, 0, 0 }, /* card has no audio */2058.needs_tvaudio = 0,2059.pll = PLL_28,2060.tuner_type = TUNER_ABSENT,2061.tuner_addr = ADDR_UNSET,2062},20632064/* ---- card 0x6c ---------------------------------- */2065[BTTV_BOARD_VD009_MINIDIN] = {2066.name = "PHYTEC VD-009 MiniDIN (bt878)",2067.video_inputs = 10,2068/* .audio_inputs= 0, */2069.svhs = 9,2070.gpiomask = 0x00,2071.gpiomask2 = 0x03, /* used for external vodeo mux */2072.muxsel = MUXSEL(2, 2, 2, 2, 3, 3, 3, 3, 1, 0),2073.muxsel_hook = phytec_muxsel,2074.gpiomux = { 0, 0, 0, 0 }, /* card has no audio */2075.needs_tvaudio = 1,2076.pll = PLL_28,2077.tuner_type = TUNER_ABSENT,2078.tuner_addr = ADDR_UNSET,2079},2080[BTTV_BOARD_VD009_COMBI] = {2081.name = "PHYTEC VD-009 Combi (bt878)",2082.video_inputs = 10,2083/* .audio_inputs= 0, */2084.svhs = 9,2085.gpiomask = 0x00,2086.gpiomask2 = 0x03, /* used for external vodeo mux */2087.muxsel = MUXSEL(2, 2, 2, 2, 3, 3, 3, 3, 1, 1),2088.muxsel_hook = phytec_muxsel,2089.gpiomux = { 0, 0, 0, 0 }, /* card has no audio */2090.needs_tvaudio = 1,2091.pll = PLL_28,2092.tuner_type = TUNER_ABSENT,2093.tuner_addr = ADDR_UNSET,2094},2095[BTTV_BOARD_IVC100] = {2096.name = "IVC-100",2097.video_inputs = 4,2098/* .audio_inputs= 0, */2099.tuner_type = TUNER_ABSENT,2100.tuner_addr = ADDR_UNSET,2101.svhs = NO_SVHS,2102.gpiomask = 0xdf,2103.muxsel = MUXSEL(2, 3, 1, 0),2104.pll = PLL_28,2105},2106[BTTV_BOARD_IVC120] = {2107/* IVC-120G - Alan Garfield <[email protected]> */2108.name = "IVC-120G",2109.video_inputs = 16,2110/* .audio_inputs= 0, */2111.tuner_type = TUNER_ABSENT,2112.tuner_addr = ADDR_UNSET,2113.svhs = NO_SVHS, /* card has no svhs */2114.needs_tvaudio = 0,2115.no_msp34xx = 1,2116.no_tda7432 = 1,2117.gpiomask = 0x00,2118.muxsel = MUXSEL(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),2119.muxsel_hook = ivc120_muxsel,2120.pll = PLL_28,2121},21222123/* ---- card 0x70 ---------------------------------- */2124[BTTV_BOARD_PC_HDTV] = {2125.name = "pcHDTV HD-2000 TV",2126.video_inputs = 4,2127/* .audio_inputs= 1, */2128.svhs = 2,2129.muxsel = MUXSEL(2, 3, 1, 0),2130.tuner_type = TUNER_PHILIPS_FCV1236D,2131.tuner_addr = ADDR_UNSET,2132.has_dvb = 1,2133},2134[BTTV_BOARD_TWINHAN_DST] = {2135.name = "Twinhan DST + clones",2136.no_msp34xx = 1,2137.no_tda7432 = 1,2138.tuner_type = TUNER_ABSENT,2139.tuner_addr = ADDR_UNSET,2140.no_video = 1,2141.has_dvb = 1,2142},2143[BTTV_BOARD_WINFASTVC100] = {2144.name = "Winfast VC100",2145.video_inputs = 3,2146/* .audio_inputs= 0, */2147.svhs = 1,2148/* Vid In, SVid In, Vid over SVid in connector */2149.muxsel = MUXSEL(3, 1, 1, 3),2150.no_msp34xx = 1,2151.no_tda7432 = 1,2152.tuner_type = TUNER_ABSENT,2153.tuner_addr = ADDR_UNSET,2154.pll = PLL_28,2155},2156[BTTV_BOARD_TEV560] = {2157.name = "Teppro TEV-560/InterVision IV-560",2158.video_inputs = 3,2159/* .audio_inputs= 1, */2160.svhs = 2,2161.gpiomask = 3,2162.muxsel = MUXSEL(2, 3, 1, 1),2163.gpiomux = { 1, 1, 1, 1 },2164.needs_tvaudio = 1,2165.tuner_type = TUNER_PHILIPS_PAL,2166.tuner_addr = ADDR_UNSET,2167.pll = PLL_35,2168},21692170/* ---- card 0x74 ---------------------------------- */2171[BTTV_BOARD_SIMUS_GVC1100] = {2172.name = "SIMUS GVC1100",2173.video_inputs = 4,2174/* .audio_inputs= 0, */2175.svhs = NO_SVHS,2176.tuner_type = TUNER_ABSENT,2177.tuner_addr = ADDR_UNSET,2178.pll = PLL_28,2179.muxsel = MUXSEL(2, 2, 2, 2),2180.gpiomask = 0x3F,2181.muxsel_hook = gvc1100_muxsel,2182},2183[BTTV_BOARD_NGSTV_PLUS] = {2184/* Carlos Silva [email protected] || card 0x75 */2185.name = "NGS NGSTV+",2186.video_inputs = 3,2187.svhs = 2,2188.gpiomask = 0x008007,2189.muxsel = MUXSEL(2, 3, 0, 0),2190.gpiomux = { 0, 0, 0, 0 },2191.gpiomute = 0x000003,2192.pll = PLL_28,2193.tuner_type = TUNER_PHILIPS_PAL,2194.tuner_addr = ADDR_UNSET,2195.has_remote = 1,2196},2197[BTTV_BOARD_LMLBT4] = {2198/* http://linuxmedialabs.com */2199.name = "LMLBT4",2200.video_inputs = 4, /* IN1,IN2,IN3,IN4 */2201/* .audio_inputs= 0, */2202.svhs = NO_SVHS,2203.muxsel = MUXSEL(2, 3, 1, 0),2204.no_msp34xx = 1,2205.no_tda7432 = 1,2206.needs_tvaudio = 0,2207.tuner_type = TUNER_ABSENT,2208.tuner_addr = ADDR_UNSET,2209},2210[BTTV_BOARD_TEKRAM_M205] = {2211/* Helmroos Harri <[email protected]> */2212.name = "Tekram M205 PRO",2213.video_inputs = 3,2214/* .audio_inputs= 1, */2215.tuner_type = TUNER_PHILIPS_PAL,2216.tuner_addr = ADDR_UNSET,2217.svhs = 2,2218.needs_tvaudio = 0,2219.gpiomask = 0x68,2220.muxsel = MUXSEL(2, 3, 1),2221.gpiomux = { 0x68, 0x68, 0x61, 0x61 },2222.pll = PLL_28,2223},22242225/* ---- card 0x78 ---------------------------------- */2226[BTTV_BOARD_CONTVFMI] = {2227/* Javier Cendan Ares <[email protected]> */2228/* bt878 TV + FM without subsystem ID */2229.name = "Conceptronic CONTVFMi",2230.video_inputs = 3,2231/* .audio_inputs= 1, */2232.svhs = 2,2233.gpiomask = 0x008007,2234.muxsel = MUXSEL(2, 3, 1, 1),2235.gpiomux = { 0, 1, 2, 2 },2236.gpiomute = 3,2237.needs_tvaudio = 0,2238.pll = PLL_28,2239.tuner_type = TUNER_PHILIPS_PAL,2240.tuner_addr = ADDR_UNSET,2241.has_remote = 1,2242.has_radio = 1,2243},2244[BTTV_BOARD_PICOLO_TETRA_CHIP] = {2245/*Eric DEBIEF <[email protected]>*/2246/*EURESYS Picolo Tetra : 4 Conexant Fusion 878A, no audio, video input set with analog multiplexers GPIO controlled*/2247/* adds picolo_tetra_muxsel(), picolo_tetra_init(), the following declaration strucure, and #define BTTV_BOARD_PICOLO_TETRA_CHIP*/2248/*0x79 in bttv.h*/2249.name = "Euresys Picolo Tetra",2250.video_inputs = 4,2251/* .audio_inputs= 0, */2252.svhs = NO_SVHS,2253.gpiomask = 0,2254.gpiomask2 = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/2255.no_msp34xx = 1,2256.no_tda7432 = 1,2257/*878A input is always MUX0, see above.*/2258.muxsel = MUXSEL(2, 2, 2, 2),2259.gpiomux = { 0, 0, 0, 0 }, /* card has no audio */2260.pll = PLL_28,2261.needs_tvaudio = 0,2262.muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/2263.tuner_type = TUNER_ABSENT,2264.tuner_addr = ADDR_UNSET,2265},2266[BTTV_BOARD_SPIRIT_TV] = {2267/* Spirit TV Tuner from http://spiritmodems.com.au */2268/* Stafford Goodsell <[email protected]> */2269.name = "Spirit TV Tuner",2270.video_inputs = 3,2271/* .audio_inputs= 1, */2272.svhs = 2,2273.gpiomask = 0x0000000f,2274.muxsel = MUXSEL(2, 1, 1),2275.gpiomux = { 0x02, 0x00, 0x00, 0x00 },2276.tuner_type = TUNER_TEMIC_PAL,2277.tuner_addr = ADDR_UNSET,2278.no_msp34xx = 1,2279},2280[BTTV_BOARD_AVDVBT_771] = {2281/* Wolfram Joost <[email protected]> */2282.name = "AVerMedia AVerTV DVB-T 771",2283.video_inputs = 2,2284.svhs = 1,2285.tuner_type = TUNER_ABSENT,2286.tuner_addr = ADDR_UNSET,2287.muxsel = MUXSEL(3, 3),2288.no_msp34xx = 1,2289.no_tda7432 = 1,2290.pll = PLL_28,2291.has_dvb = 1,2292.no_gpioirq = 1,2293.has_remote = 1,2294},2295/* ---- card 0x7c ---------------------------------- */2296[BTTV_BOARD_AVDVBT_761] = {2297/* Matt Jesson <[email protected]> */2298/* Based on the Nebula card data - added remote and new card number - BTTV_BOARD_AVDVBT_761, see also ir-kbd-gpio.c */2299.name = "AverMedia AverTV DVB-T 761",2300.video_inputs = 2,2301.svhs = 1,2302.muxsel = MUXSEL(3, 1, 2, 0), /* Comp0, S-Video, ?, ? */2303.no_msp34xx = 1,2304.no_tda7432 = 1,2305.pll = PLL_28,2306.tuner_type = TUNER_ABSENT,2307.tuner_addr = ADDR_UNSET,2308.has_dvb = 1,2309.no_gpioirq = 1,2310.has_remote = 1,2311},2312[BTTV_BOARD_MATRIX_VISIONSQ] = {2313/* [email protected] */2314.name = "MATRIX Vision Sigma-SQ",2315.video_inputs = 16,2316/* .audio_inputs= 0, */2317.svhs = NO_SVHS,2318.gpiomask = 0x0,2319.muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3),2320.muxsel_hook = sigmaSQ_muxsel,2321.gpiomux = { 0 },2322.no_msp34xx = 1,2323.pll = PLL_28,2324.tuner_type = TUNER_ABSENT,2325.tuner_addr = ADDR_UNSET,2326},2327[BTTV_BOARD_MATRIX_VISIONSLC] = {2328/* [email protected] */2329.name = "MATRIX Vision Sigma-SLC",2330.video_inputs = 4,2331/* .audio_inputs= 0, */2332.svhs = NO_SVHS,2333.gpiomask = 0x0,2334.muxsel = MUXSEL(2, 2, 2, 2),2335.muxsel_hook = sigmaSLC_muxsel,2336.gpiomux = { 0 },2337.no_msp34xx = 1,2338.pll = PLL_28,2339.tuner_type = TUNER_ABSENT,2340.tuner_addr = ADDR_UNSET,2341},2342/* BTTV_BOARD_APAC_VIEWCOMP */2343[BTTV_BOARD_APAC_VIEWCOMP] = {2344/* Attila Kondoros <[email protected]> */2345/* bt878 TV + FM 0x00000000 subsystem ID */2346.name = "APAC Viewcomp 878(AMAX)",2347.video_inputs = 2,2348/* .audio_inputs= 1, */2349.svhs = NO_SVHS,2350.gpiomask = 0xFF,2351.muxsel = MUXSEL(2, 3, 1, 1),2352.gpiomux = { 2, 0, 0, 0 },2353.gpiomute = 10,2354.needs_tvaudio = 0,2355.pll = PLL_28,2356.tuner_type = TUNER_PHILIPS_PAL,2357.tuner_addr = ADDR_UNSET,2358.has_remote = 1, /* miniremote works, see ir-kbd-gpio.c */2359.has_radio = 1, /* not every card has radio */2360},23612362/* ---- card 0x80 ---------------------------------- */2363[BTTV_BOARD_DVICO_DVBT_LITE] = {2364/* Chris Pascoe <[email protected]> */2365.name = "DViCO FusionHDTV DVB-T Lite",2366.no_msp34xx = 1,2367.no_tda7432 = 1,2368.pll = PLL_28,2369.no_video = 1,2370.has_dvb = 1,2371.tuner_type = TUNER_ABSENT,2372.tuner_addr = ADDR_UNSET,2373},2374[BTTV_BOARD_VGEAR_MYVCD] = {2375/* Steven <[email protected]> */2376.name = "V-Gear MyVCD",2377.video_inputs = 3,2378/* .audio_inputs= 1, */2379.svhs = 2,2380.gpiomask = 0x3f,2381.muxsel = MUXSEL(2, 3, 1, 0),2382.gpiomux = {0x31, 0x31, 0x31, 0x31 },2383.gpiomute = 0x31,2384.no_msp34xx = 1,2385.pll = PLL_28,2386.tuner_type = TUNER_PHILIPS_NTSC_M,2387.tuner_addr = ADDR_UNSET,2388.has_radio = 0,2389},2390[BTTV_BOARD_SUPER_TV] = {2391/* Rick C <[email protected]> */2392.name = "Super TV Tuner",2393.video_inputs = 4,2394/* .audio_inputs= 1, */2395.svhs = 2,2396.muxsel = MUXSEL(2, 3, 1, 0),2397.tuner_type = TUNER_PHILIPS_NTSC,2398.tuner_addr = ADDR_UNSET,2399.gpiomask = 0x008007,2400.gpiomux = { 0, 0x000001,0,0 },2401.needs_tvaudio = 1,2402.has_radio = 1,2403},2404[BTTV_BOARD_TIBET_CS16] = {2405/* Chris Fanning <[email protected]> */2406.name = "Tibet Systems 'Progress DVR' CS16",2407.video_inputs = 16,2408/* .audio_inputs= 0, */2409.svhs = NO_SVHS,2410.muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2),2411.pll = PLL_28,2412.no_msp34xx = 1,2413.no_tda7432 = 1,2414.tuner_type = TUNER_ABSENT,2415.tuner_addr = ADDR_UNSET,2416.muxsel_hook = tibetCS16_muxsel,2417},2418[BTTV_BOARD_KODICOM_4400R] = {2419/* Bill Brack <[email protected]> */2420/*2421* Note that, because of the card's wiring, the "master"2422* BT878A chip (i.e. the one which controls the analog switch2423* and must use this card type) is the 2nd one detected. The2424* other 3 chips should use card type 0x85, whose description2425* follows this one. There is a EEPROM on the card (which is2426* connected to the I2C of one of those other chips), but is2427* not currently handled. There is also a facility for a2428* "monitor", which is also not currently implemented.2429*/2430.name = "Kodicom 4400R (master)",2431.video_inputs = 16,2432/* .audio_inputs= 0, */2433.tuner_type = TUNER_ABSENT,2434.tuner_addr = ADDR_UNSET,2435.svhs = NO_SVHS,2436/* GPIO bits 0-9 used for analog switch:2437* 00 - 03: camera selector2438* 04 - 06: channel (controller) selector2439* 07: data (1->on, 0->off)2440* 08: strobe2441* 09: reset2442* bit 16 is input from sync separator for the channel2443*/2444.gpiomask = 0x0003ff,2445.no_gpioirq = 1,2446.muxsel = MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),2447.pll = PLL_28,2448.no_msp34xx = 1,2449.no_tda7432 = 1,2450.muxsel_hook = kodicom4400r_muxsel,2451},2452[BTTV_BOARD_KODICOM_4400R_SL] = {2453/* Bill Brack <[email protected]> */2454/* Note that, for reasons unknown, the "master" BT878A chip (i.e. the2455* one which controls the analog switch, and must use the card type)2456* is the 2nd one detected. The other 3 chips should use this card2457* type2458*/2459.name = "Kodicom 4400R (slave)",2460.video_inputs = 16,2461/* .audio_inputs= 0, */2462.tuner_type = TUNER_ABSENT,2463.tuner_addr = ADDR_UNSET,2464.svhs = NO_SVHS,2465.gpiomask = 0x010000,2466.no_gpioirq = 1,2467.muxsel = MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),2468.pll = PLL_28,2469.no_msp34xx = 1,2470.no_tda7432 = 1,2471.muxsel_hook = kodicom4400r_muxsel,2472},2473/* ---- card 0x86---------------------------------- */2474[BTTV_BOARD_ADLINK_RTV24] = {2475/* Michael Henson <[email protected]> */2476/* Adlink RTV24 with special unlock codes */2477.name = "Adlink RTV24",2478.video_inputs = 4,2479/* .audio_inputs= 1, */2480.svhs = 2,2481.muxsel = MUXSEL(2, 3, 1, 0),2482.tuner_type = UNSET,2483.tuner_addr = ADDR_UNSET,2484.pll = PLL_28,2485},2486/* ---- card 0x87---------------------------------- */2487[BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = {2488/* Michael Krufky <[email protected]> */2489.name = "DViCO FusionHDTV 5 Lite",2490.tuner_type = TUNER_LG_TDVS_H06XF, /* TDVS-H064F */2491.tuner_addr = ADDR_UNSET,2492.video_inputs = 3,2493/* .audio_inputs= 1, */2494.svhs = 2,2495.muxsel = MUXSEL(2, 3, 1),2496.gpiomask = 0x00e00007,2497.gpiomux = { 0x00400005, 0, 0x00000001, 0 },2498.gpiomute = 0x00c00007,2499.no_msp34xx = 1,2500.no_tda7432 = 1,2501.has_dvb = 1,2502},2503/* ---- card 0x88---------------------------------- */2504[BTTV_BOARD_ACORP_Y878F] = {2505/* Mauro Carvalho Chehab <[email protected]> */2506.name = "Acorp Y878F",2507.video_inputs = 3,2508/* .audio_inputs= 1, */2509.svhs = 2,2510.gpiomask = 0x01fe00,2511.muxsel = MUXSEL(2, 3, 1, 1),2512.gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },2513.gpiomute = 0x002000,2514.needs_tvaudio = 1,2515.pll = PLL_28,2516.tuner_type = TUNER_YMEC_TVF66T5_B_DFF,2517.tuner_addr = 0xc1 >>1,2518.has_radio = 1,2519},2520/* ---- card 0x89 ---------------------------------- */2521[BTTV_BOARD_CONCEPTRONIC_CTVFMI2] = {2522.name = "Conceptronic CTVFMi v2",2523.video_inputs = 3,2524/* .audio_inputs= 1, */2525.svhs = 2,2526.gpiomask = 0x001c0007,2527.muxsel = MUXSEL(2, 3, 1, 1),2528.gpiomux = { 0, 1, 2, 2 },2529.gpiomute = 3,2530.needs_tvaudio = 0,2531.pll = PLL_28,2532.tuner_type = TUNER_TENA_9533_DI,2533.tuner_addr = ADDR_UNSET,2534.has_remote = 1,2535.has_radio = 1,2536},2537/* ---- card 0x8a ---------------------------------- */2538[BTTV_BOARD_PV_BT878P_2E] = {2539.name = "Prolink Pixelview PV-BT878P+ (Rev.2E)",2540.video_inputs = 5,2541/* .audio_inputs= 1, */2542.svhs = 3,2543.has_dig_in = 1,2544.gpiomask = 0x01fe00,2545.muxsel = MUXSEL(2, 3, 1, 1, 0), /* in 4 is digital */2546/* .digital_mode= DIGITAL_MODE_CAMERA, */2547.gpiomux = { 0x00400, 0x10400, 0x04400, 0x80000 },2548.gpiomute = 0x12400,2549.no_msp34xx = 1,2550.pll = PLL_28,2551.tuner_type = TUNER_LG_PAL_FM,2552.tuner_addr = ADDR_UNSET,2553.has_remote = 1,2554},2555/* ---- card 0x8b ---------------------------------- */2556[BTTV_BOARD_PV_M4900] = {2557/* Sérgio Fortier <[email protected]> */2558.name = "Prolink PixelView PlayTV MPEG2 PV-M4900",2559.video_inputs = 3,2560/* .audio_inputs= 1, */2561.svhs = 2,2562.gpiomask = 0x3f,2563.muxsel = MUXSEL(2, 3, 1, 1),2564.gpiomux = { 0x21, 0x20, 0x24, 0x2c },2565.gpiomute = 0x29,2566.no_msp34xx = 1,2567.pll = PLL_28,2568.tuner_type = TUNER_YMEC_TVF_5533MF,2569.tuner_addr = ADDR_UNSET,2570.has_radio = 1,2571.has_remote = 1,2572},2573/* ---- card 0x8c ---------------------------------- */2574/* Has four Bt878 chips behind a PCI bridge, each chip has:2575one external BNC composite input (mux 2)2576three internal composite inputs (unknown muxes)2577an 18-bit stereo A/D (CS5331A), which has:2578one external stereo unblanced (RCA) audio connection2579one (or 3?) internal stereo balanced (XLR) audio connection2580input is selected via gpio to a 14052B mux2581(mask=0x300, unbal=0x000, bal=0x100, ??=0x200,0x300)2582gain is controlled via an X9221A chip on the I2C bus @0x282583sample rate is controlled via gpio to an MK1413S2584(mask=0x3, 32kHz=0x0, 44.1kHz=0x1, 48kHz=0x2, ??=0x3)2585There is neither a tuner nor an svideo input. */2586[BTTV_BOARD_OSPREY440] = {2587.name = "Osprey 440",2588.video_inputs = 4,2589/* .audio_inputs= 2, */2590.svhs = NO_SVHS,2591.muxsel = MUXSEL(2, 3, 0, 1), /* 3,0,1 are guesses */2592.gpiomask = 0x303,2593.gpiomute = 0x000, /* int + 32kHz */2594.gpiomux = { 0, 0, 0x000, 0x100},2595.pll = PLL_28,2596.tuner_type = TUNER_ABSENT,2597.tuner_addr = ADDR_UNSET,2598.no_msp34xx = 1,2599.no_tda7432 = 1,2600},2601/* ---- card 0x8d ---------------------------------- */2602[BTTV_BOARD_ASOUND_SKYEYE] = {2603.name = "Asound Skyeye PCTV",2604.video_inputs = 3,2605/* .audio_inputs= 1, */2606.svhs = 2,2607.gpiomask = 15,2608.muxsel = MUXSEL(2, 3, 1, 1),2609.gpiomux = { 2, 0, 0, 0 },2610.gpiomute = 1,2611.needs_tvaudio = 1,2612.pll = PLL_28,2613.tuner_type = TUNER_PHILIPS_NTSC,2614.tuner_addr = ADDR_UNSET,2615},2616/* ---- card 0x8e ---------------------------------- */2617[BTTV_BOARD_SABRENT_TVFM] = {2618.name = "Sabrent TV-FM (bttv version)",2619.video_inputs = 3,2620/* .audio_inputs= 1, */2621.svhs = 2,2622.gpiomask = 0x108007,2623.muxsel = MUXSEL(2, 3, 1, 1),2624.gpiomux = { 100000, 100002, 100002, 100000 },2625.no_msp34xx = 1,2626.no_tda7432 = 1,2627.pll = PLL_28,2628.tuner_type = TUNER_TNF_5335MF,2629.tuner_addr = ADDR_UNSET,2630.has_radio = 1,2631},2632/* ---- card 0x8f ---------------------------------- */2633[BTTV_BOARD_HAUPPAUGE_IMPACTVCB] = {2634.name = "Hauppauge ImpactVCB (bt878)",2635.video_inputs = 4,2636/* .audio_inputs= 0, */2637.svhs = NO_SVHS,2638.gpiomask = 0x0f, /* old: 7 */2639.muxsel = MUXSEL(0, 1, 3, 2), /* Composite 0-3 */2640.no_msp34xx = 1,2641.no_tda7432 = 1,2642.tuner_type = TUNER_ABSENT,2643.tuner_addr = ADDR_UNSET,2644},2645[BTTV_BOARD_MACHTV_MAGICTV] = {2646/* Julian Calaby <[email protected]>2647* Slightly different from original MachTV definition (0x60)26482649* FIXME: RegSpy says gpiomask should be "0x001c800f", but it2650* stuffs up remote chip. Bug is a pin on the jaecs is not set2651* properly (methinks) causing no keyup bits being set */26522653.name = "MagicTV", /* rebranded MachTV */2654.video_inputs = 3,2655/* .audio_inputs= 1, */2656.svhs = 2,2657.gpiomask = 7,2658.muxsel = MUXSEL(2, 3, 1, 1),2659.gpiomux = { 0, 1, 2, 3 },2660.gpiomute = 4,2661.tuner_type = TUNER_TEMIC_4009FR5_PAL,2662.tuner_addr = ADDR_UNSET,2663.pll = PLL_28,2664.has_radio = 1,2665.has_remote = 1,2666},2667[BTTV_BOARD_SSAI_SECURITY] = {2668.name = "SSAI Security Video Interface",2669.video_inputs = 4,2670/* .audio_inputs= 0, */2671.svhs = NO_SVHS,2672.muxsel = MUXSEL(0, 1, 2, 3),2673.tuner_type = TUNER_ABSENT,2674.tuner_addr = ADDR_UNSET,2675},2676[BTTV_BOARD_SSAI_ULTRASOUND] = {2677.name = "SSAI Ultrasound Video Interface",2678.video_inputs = 2,2679/* .audio_inputs= 0, */2680.svhs = 1,2681.muxsel = MUXSEL(2, 0, 1, 3),2682.tuner_type = TUNER_ABSENT,2683.tuner_addr = ADDR_UNSET,2684},2685/* ---- card 0x94---------------------------------- */2686[BTTV_BOARD_DVICO_FUSIONHDTV_2] = {2687.name = "DViCO FusionHDTV 2",2688.tuner_type = TUNER_PHILIPS_FCV1236D,2689.tuner_addr = ADDR_UNSET,2690.video_inputs = 3,2691/* .audio_inputs= 1, */2692.svhs = 2,2693.muxsel = MUXSEL(2, 3, 1),2694.gpiomask = 0x00e00007,2695.gpiomux = { 0x00400005, 0, 0x00000001, 0 },2696.gpiomute = 0x00c00007,2697.no_msp34xx = 1,2698.no_tda7432 = 1,2699},2700/* ---- card 0x95---------------------------------- */2701[BTTV_BOARD_TYPHOON_TVTUNERPCI] = {2702.name = "Typhoon TV-Tuner PCI (50684)",2703.video_inputs = 3,2704/* .audio_inputs= 1, */2705.svhs = 2,2706.gpiomask = 0x3014f,2707.muxsel = MUXSEL(2, 3, 1, 1),2708.gpiomux = { 0x20001,0x10001, 0, 0 },2709.gpiomute = 10,2710.needs_tvaudio = 1,2711.pll = PLL_28,2712.tuner_type = TUNER_PHILIPS_PAL_I,2713.tuner_addr = ADDR_UNSET,2714},2715[BTTV_BOARD_GEOVISION_GV600] = {2716/* [email protected] */2717.name = "Geovision GV-600",2718.video_inputs = 16,2719/* .audio_inputs= 0, */2720.svhs = NO_SVHS,2721.gpiomask = 0x0,2722.muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2),2723.muxsel_hook = geovision_muxsel,2724.gpiomux = { 0 },2725.no_msp34xx = 1,2726.pll = PLL_28,2727.tuner_type = TUNER_ABSENT,2728.tuner_addr = ADDR_UNSET,2729},2730[BTTV_BOARD_KOZUMI_KTV_01C] = {2731/* Mauro Lacy <[email protected]>2732* Based on MagicTV and Conceptronic CONTVFMi */27332734.name = "Kozumi KTV-01C",2735.video_inputs = 3,2736/* .audio_inputs= 1, */2737.svhs = 2,2738.gpiomask = 0x008007,2739.muxsel = MUXSEL(2, 3, 1, 1),2740.gpiomux = { 0, 1, 2, 2 }, /* CONTVFMi */2741.gpiomute = 3, /* CONTVFMi */2742.needs_tvaudio = 0,2743.tuner_type = TUNER_PHILIPS_FM1216ME_MK3, /* TCL MK3 */2744.tuner_addr = ADDR_UNSET,2745.pll = PLL_28,2746.has_radio = 1,2747.has_remote = 1,2748},2749[BTTV_BOARD_ENLTV_FM_2] = {2750/* Encore TV Tuner Pro ENL TV-FM-22751Mauro Carvalho Chehab <[email protected] */2752.name = "Encore ENL TV-FM-2",2753.video_inputs = 3,2754/* .audio_inputs= 1, */2755.svhs = 2,2756/* bit 6 -> IR disabled2757bit 18/17 = 00 -> mute275801 -> enable external audio input275910 -> internal audio input (mono?)276011 -> internal audio input2761*/2762.gpiomask = 0x060040,2763.muxsel = MUXSEL(2, 3, 3),2764.gpiomux = { 0x60000, 0x60000, 0x20000, 0x20000 },2765.gpiomute = 0,2766.tuner_type = TUNER_TCL_MF02GIP_5N,2767.tuner_addr = ADDR_UNSET,2768.pll = PLL_28,2769.has_radio = 1,2770.has_remote = 1,2771},2772[BTTV_BOARD_VD012] = {2773/* [email protected] */2774.name = "PHYTEC VD-012 (bt878)",2775.video_inputs = 4,2776/* .audio_inputs= 0, */2777.svhs = NO_SVHS,2778.gpiomask = 0x00,2779.muxsel = MUXSEL(0, 2, 3, 1),2780.gpiomux = { 0, 0, 0, 0 }, /* card has no audio */2781.needs_tvaudio = 0,2782.pll = PLL_28,2783.tuner_type = TUNER_ABSENT,2784.tuner_addr = ADDR_UNSET,2785},2786[BTTV_BOARD_VD012_X1] = {2787/* [email protected] */2788.name = "PHYTEC VD-012-X1 (bt878)",2789.video_inputs = 4,2790/* .audio_inputs= 0, */2791.svhs = 3,2792.gpiomask = 0x00,2793.muxsel = MUXSEL(2, 3, 1),2794.gpiomux = { 0, 0, 0, 0 }, /* card has no audio */2795.needs_tvaudio = 0,2796.pll = PLL_28,2797.tuner_type = TUNER_ABSENT,2798.tuner_addr = ADDR_UNSET,2799},2800[BTTV_BOARD_VD012_X2] = {2801/* [email protected] */2802.name = "PHYTEC VD-012-X2 (bt878)",2803.video_inputs = 4,2804/* .audio_inputs= 0, */2805.svhs = 3,2806.gpiomask = 0x00,2807.muxsel = MUXSEL(3, 2, 1),2808.gpiomux = { 0, 0, 0, 0 }, /* card has no audio */2809.needs_tvaudio = 0,2810.pll = PLL_28,2811.tuner_type = TUNER_ABSENT,2812.tuner_addr = ADDR_UNSET,2813},2814[BTTV_BOARD_GEOVISION_GV800S] = {2815/* Bruno Christo <[email protected]>2816*2817* GeoVision GV-800(S) has 4 Conexant Fusion 878A:2818* 1 audio input per BT878A = 4 audio inputs2819* 4 video inputs per BT878A = 16 video inputs2820* This is the first BT878A chip of the GV-800(S). It's the2821* "master" chip and it controls the video inputs through an2822* analog multiplexer (a CD22M3494) via some GPIO pins. The2823* slaves should use card type 0x9e (following this one).2824* There is a EEPROM on the card which is currently not handled.2825* The audio input is not working yet.2826*/2827.name = "Geovision GV-800(S) (master)",2828.video_inputs = 4,2829/* .audio_inputs= 1, */2830.tuner_type = TUNER_ABSENT,2831.tuner_addr = ADDR_UNSET,2832.svhs = NO_SVHS,2833.gpiomask = 0xf107f,2834.no_gpioirq = 1,2835.muxsel = MUXSEL(2, 2, 2, 2),2836.pll = PLL_28,2837.no_msp34xx = 1,2838.no_tda7432 = 1,2839.muxsel_hook = gv800s_muxsel,2840},2841[BTTV_BOARD_GEOVISION_GV800S_SL] = {2842/* Bruno Christo <[email protected]>2843*2844* GeoVision GV-800(S) has 4 Conexant Fusion 878A:2845* 1 audio input per BT878A = 4 audio inputs2846* 4 video inputs per BT878A = 16 video inputs2847* The 3 other BT878A chips are "slave" chips of the GV-800(S)2848* and should use this card type.2849* The audio input is not working yet.2850*/2851.name = "Geovision GV-800(S) (slave)",2852.video_inputs = 4,2853/* .audio_inputs= 1, */2854.tuner_type = TUNER_ABSENT,2855.tuner_addr = ADDR_UNSET,2856.svhs = NO_SVHS,2857.gpiomask = 0x00,2858.no_gpioirq = 1,2859.muxsel = MUXSEL(2, 2, 2, 2),2860.pll = PLL_28,2861.no_msp34xx = 1,2862.no_tda7432 = 1,2863.muxsel_hook = gv800s_muxsel,2864},2865[BTTV_BOARD_PV183] = {2866.name = "ProVideo PV183", /* 0x9f */2867.video_inputs = 2,2868/* .audio_inputs= 0, */2869.svhs = NO_SVHS,2870.gpiomask = 0,2871.muxsel = MUXSEL(2, 3),2872.gpiomux = { 0 },2873.needs_tvaudio = 0,2874.no_msp34xx = 1,2875.pll = PLL_28,2876.tuner_type = TUNER_ABSENT,2877.tuner_addr = ADDR_UNSET,2878},2879};28802881static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);28822883/* ----------------------------------------------------------------------- */28842885static unsigned char eeprom_data[256];28862887/*2888* identify card2889*/2890void __devinit bttv_idcard(struct bttv *btv)2891{2892unsigned int gpiobits;2893int i,type;2894unsigned short tmp;28952896/* read PCI subsystem ID */2897pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_ID, &tmp);2898btv->cardid = tmp << 16;2899pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_VENDOR_ID, &tmp);2900btv->cardid |= tmp;29012902if (0 != btv->cardid && 0xffffffff != btv->cardid) {2903/* look for the card */2904for (type = -1, i = 0; cards[i].id != 0; i++)2905if (cards[i].id == btv->cardid)2906type = i;29072908if (type != -1) {2909/* found it */2910printk(KERN_INFO "bttv%d: detected: %s [card=%d], "2911"PCI subsystem ID is %04x:%04x\n",2912btv->c.nr,cards[type].name,cards[type].cardnr,2913btv->cardid & 0xffff,2914(btv->cardid >> 16) & 0xffff);2915btv->c.type = cards[type].cardnr;2916} else {2917/* 404 */2918printk(KERN_INFO "bttv%d: subsystem: %04x:%04x (UNKNOWN)\n",2919btv->c.nr, btv->cardid & 0xffff,2920(btv->cardid >> 16) & 0xffff);2921printk(KERN_DEBUG "please mail id, board name and "2922"the correct card= insmod option to [email protected]\n");2923}2924}29252926/* let the user override the autodetected type */2927if (card[btv->c.nr] < bttv_num_tvcards)2928btv->c.type=card[btv->c.nr];29292930/* print which card config we are using */2931printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->c.nr,2932bttv_tvcards[btv->c.type].name, btv->c.type,2933card[btv->c.nr] < bttv_num_tvcards2934? "insmod option" : "autodetected");29352936/* overwrite gpio stuff ?? */2937if (UNSET == audioall && UNSET == audiomux[0])2938return;29392940if (UNSET != audiomux[0]) {2941gpiobits = 0;2942for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {2943bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i];2944gpiobits |= audiomux[i];2945}2946} else {2947gpiobits = audioall;2948for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {2949bttv_tvcards[btv->c.type].gpiomux[i] = audioall;2950}2951}2952bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;2953printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",2954btv->c.nr,bttv_tvcards[btv->c.type].gpiomask);2955for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {2956printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]);2957}2958printk("\n");2959}29602961/*2962* (most) board specific initialisations goes here2963*/29642965/* Some Modular Technology cards have an eeprom, but no subsystem ID */2966static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])2967{2968int type = -1;29692970if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13))2971type = BTTV_BOARD_MODTEC_205;2972else if (0 == strncmp(eeprom_data+20,"Picolo",7))2973type = BTTV_BOARD_EURESYS_PICOLO;2974else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)2975type = BTTV_BOARD_HAUPPAUGE; /* old bt848 */29762977if (-1 != type) {2978btv->c.type = type;2979printk("bttv%d: detected by eeprom: %s [card=%d]\n",2980btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);2981}2982}29832984static void flyvideo_gpio(struct bttv *btv)2985{2986int gpio, has_remote, has_radio, is_capture_only;2987int is_lr90, has_tda9820_tda9821;2988int tuner_type = UNSET, ttype;29892990gpio_inout(0xffffff, 0);2991udelay(8); /* without this we would see the 0x1800 mask */2992gpio = gpio_read();2993/* FIXME: must restore OUR_EN ??? */29942995/* all cards provide GPIO info, some have an additional eeprom2996* LR50: GPIO coding can be found lower right CP1 .. CP92997* CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.2998* GPIO14-12: n.c.2999* LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878)30003001* lowest 3 bytes are remote control codes (no handshake needed)3002* xxxFFF: No remote control chip soldered3003* xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered3004* Note: Some bits are Audio_Mask !3005*/3006ttype = (gpio & 0x0f0000) >> 16;3007switch (ttype) {3008case 0x0:3009tuner_type = 2; /* NTSC, e.g. TPI8NSR11P */3010break;3011case 0x2:3012tuner_type = 39; /* LG NTSC (newer TAPC series) TAPC-H701P */3013break;3014case 0x4:3015tuner_type = 5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */3016break;3017case 0x6:3018tuner_type = 37; /* LG PAL (newer TAPC series) TAPC-G702P */3019break;3020case 0xC:3021tuner_type = 3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */3022break;3023default:3024printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr);3025break;3026}30273028has_remote = gpio & 0x800000;3029has_radio = gpio & 0x400000;3030/* unknown 0x200000;3031* unknown2 0x100000; */3032is_capture_only = !(gpio & 0x008000); /* GPIO15 */3033has_tda9820_tda9821 = !(gpio & 0x004000);3034is_lr90 = !(gpio & 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */3035/*3036* gpio & 0x001000 output bit for audio routing */30373038if (is_capture_only)3039tuner_type = TUNER_ABSENT; /* No tuner present */30403041printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",3042btv->c.nr, has_radio ? "yes" : "no ",3043has_remote ? "yes" : "no ", tuner_type, gpio);3044printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",3045btv->c.nr, is_lr90 ? "yes" : "no ",3046has_tda9820_tda9821 ? "yes" : "no ",3047is_capture_only ? "yes" : "no ");30483049if (tuner_type != UNSET) /* only set if known tuner autodetected, else let insmod option through */3050btv->tuner_type = tuner_type;3051btv->has_radio = has_radio;30523053/* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c803054* LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c003055* Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */3056if (has_tda9820_tda9821)3057btv->audio_mode_gpio = lt9415_audio;3058/* todo: if(has_tda9874) btv->audio_mode_gpio = fv2000s_audio; */3059}30603061static int miro_tunermap[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,306214,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };3063static int miro_fmtuner[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,30641,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };30653066static void miro_pinnacle_gpio(struct bttv *btv)3067{3068int id,msp,gpio;3069char *info;30703071gpio_inout(0xffffff, 0);3072gpio = gpio_read();3073id = ((gpio>>10) & 63) -1;3074msp = bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx");3075if (id < 32) {3076btv->tuner_type = miro_tunermap[id];3077if (0 == (gpio & 0x20)) {3078btv->has_radio = 1;3079if (!miro_fmtuner[id]) {3080btv->has_matchbox = 1;3081btv->mbox_we = (1<<6);3082btv->mbox_most = (1<<7);3083btv->mbox_clk = (1<<8);3084btv->mbox_data = (1<<9);3085btv->mbox_mask = (1<<6)|(1<<7)|(1<<8)|(1<<9);3086}3087} else {3088btv->has_radio = 0;3089}3090if (-1 != msp) {3091if (btv->c.type == BTTV_BOARD_MIRO)3092btv->c.type = BTTV_BOARD_MIROPRO;3093if (btv->c.type == BTTV_BOARD_PINNACLE)3094btv->c.type = BTTV_BOARD_PINNACLEPRO;3095}3096printk(KERN_INFO3097"bttv%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",3098btv->c.nr, id+1, btv->tuner_type,3099!btv->has_radio ? "no" :3100(btv->has_matchbox ? "matchbox" : "fmtuner"),3101(-1 == msp) ? "no" : "yes");3102} else {3103/* new cards with microtune tuner */3104id = 63 - id;3105btv->has_radio = 0;3106switch (id) {3107case 1:3108info = "PAL / mono";3109btv->tda9887_conf = TDA9887_INTERCARRIER;3110break;3111case 2:3112info = "PAL+SECAM / stereo";3113btv->has_radio = 1;3114btv->tda9887_conf = TDA9887_QSS;3115break;3116case 3:3117info = "NTSC / stereo";3118btv->has_radio = 1;3119btv->tda9887_conf = TDA9887_QSS;3120break;3121case 4:3122info = "PAL+SECAM / mono";3123btv->tda9887_conf = TDA9887_QSS;3124break;3125case 5:3126info = "NTSC / mono";3127btv->tda9887_conf = TDA9887_INTERCARRIER;3128break;3129case 6:3130info = "NTSC / stereo";3131btv->tda9887_conf = TDA9887_INTERCARRIER;3132break;3133case 7:3134info = "PAL / stereo";3135btv->tda9887_conf = TDA9887_INTERCARRIER;3136break;3137default:3138info = "oops: unknown card";3139break;3140}3141if (-1 != msp)3142btv->c.type = BTTV_BOARD_PINNACLEPRO;3143printk(KERN_INFO3144"bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",3145btv->c.nr, id, info, btv->has_radio ? "yes" : "no");3146btv->tuner_type = TUNER_MT2032;3147}3148}31493150/* GPIO21 L: Buffer aktiv, H: Buffer inaktiv */3151#define LM1882_SYNC_DRIVE 0x200000L31523153static void init_ids_eagle(struct bttv *btv)3154{3155gpio_inout(0xffffff,0xFFFF37);3156gpio_write(0x200020);31573158/* flash strobe inverter ?! */3159gpio_write(0x200024);31603161/* switch sync drive off */3162gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);31633164/* set BT848 muxel to 2 */3165btaor((2)<<5, ~(2<<5), BT848_IFORM);3166}31673168/* Muxsel helper for the IDS Eagle.3169* the eagles does not use the standard muxsel-bits but3170* has its own multiplexer */3171static void eagle_muxsel(struct bttv *btv, unsigned int input)3172{3173gpio_bits(3, input & 3);31743175/* composite */3176/* set chroma ADC to sleep */3177btor(BT848_ADC_C_SLEEP, BT848_ADC);3178/* set to composite video */3179btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);3180btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);31813182/* switch sync drive off */3183gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);3184}31853186static void gvc1100_muxsel(struct bttv *btv, unsigned int input)3187{3188static const int masks[] = {0x30, 0x01, 0x12, 0x23};3189gpio_write(masks[input%4]);3190}31913192/* LMLBT4x initialization - to allow access to GPIO bits for sensors input and3193alarms output31943195GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |3196assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | |31973198IN - sensor inputs, INx - sensor inputs and TI XORed together3199O1,O2,O3 - alarm outputs (relays)32003201OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 = 0x6C032023203*/32043205static void init_lmlbt4x(struct bttv *btv)3206{3207printk(KERN_DEBUG "LMLBT4x init\n");3208btwrite(0x000000, BT848_GPIO_REG_INP);3209gpio_inout(0xffffff, 0x0006C0);3210gpio_write(0x000000);3211}32123213static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input)3214{3215unsigned int inmux = input % 8;3216gpio_inout( 0xf, 0xf );3217gpio_bits( 0xf, inmux );3218}32193220static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input)3221{3222unsigned int inmux = input % 4;3223gpio_inout( 3<<9, 3<<9 );3224gpio_bits( 3<<9, inmux<<9 );3225}32263227static void geovision_muxsel(struct bttv *btv, unsigned int input)3228{3229unsigned int inmux = input % 16;3230gpio_inout(0xf, 0xf);3231gpio_bits(0xf, inmux);3232}32333234/* ----------------------------------------------------------------------- */32353236static void bttv_reset_audio(struct bttv *btv)3237{3238/*3239* BT878A has a audio-reset register.3240* 1. This register is an audio reset function but it is in3241* function-0 (video capture) address space.3242* 2. It is enough to do this once per power-up of the card.3243* 3. There is a typo in the Conexant doc -- it is not at3244* 0x5B, but at 0x058. (B is an odd-number, obviously a typo!).3245* --//Shrikumar 0306093246*/3247if (btv->id != 878)3248return;32493250if (bttv_debug)3251printk("bttv%d: BT878A ARESET\n",btv->c.nr);3252btwrite((1<<7), 0x058);3253udelay(10);3254btwrite( 0, 0x058);3255}32563257/* initialization part one -- before registering i2c bus */3258void __devinit bttv_init_card1(struct bttv *btv)3259{3260switch (btv->c.type) {3261case BTTV_BOARD_HAUPPAUGE:3262case BTTV_BOARD_HAUPPAUGE878:3263boot_msp34xx(btv,5);3264break;3265case BTTV_BOARD_VOODOOTV_200:3266case BTTV_BOARD_VOODOOTV_FM:3267boot_msp34xx(btv,20);3268break;3269case BTTV_BOARD_AVERMEDIA98:3270boot_msp34xx(btv,11);3271break;3272case BTTV_BOARD_HAUPPAUGEPVR:3273pvr_boot(btv);3274break;3275case BTTV_BOARD_TWINHAN_DST:3276case BTTV_BOARD_AVDVBT_771:3277case BTTV_BOARD_PINNACLESAT:3278btv->use_i2c_hw = 1;3279break;3280case BTTV_BOARD_ADLINK_RTV24:3281init_RTV24( btv );3282break;32833284}3285if (!bttv_tvcards[btv->c.type].has_dvb)3286bttv_reset_audio(btv);3287}32883289/* initialization part two -- after registering i2c bus */3290void __devinit bttv_init_card2(struct bttv *btv)3291{3292btv->tuner_type = UNSET;32933294if (BTTV_BOARD_UNKNOWN == btv->c.type) {3295bttv_readee(btv,eeprom_data,0xa0);3296identify_by_eeprom(btv,eeprom_data);3297}32983299switch (btv->c.type) {3300case BTTV_BOARD_MIRO:3301case BTTV_BOARD_MIROPRO:3302case BTTV_BOARD_PINNACLE:3303case BTTV_BOARD_PINNACLEPRO:3304/* miro/pinnacle */3305miro_pinnacle_gpio(btv);3306break;3307case BTTV_BOARD_FLYVIDEO_98:3308case BTTV_BOARD_MAXI:3309case BTTV_BOARD_LIFE_FLYKIT:3310case BTTV_BOARD_FLYVIDEO:3311case BTTV_BOARD_TYPHOON_TVIEW:3312case BTTV_BOARD_CHRONOS_VS2:3313case BTTV_BOARD_FLYVIDEO_98FM:3314case BTTV_BOARD_FLYVIDEO2000:3315case BTTV_BOARD_FLYVIDEO98EZ:3316case BTTV_BOARD_CONFERENCETV:3317case BTTV_BOARD_LIFETEC_9415:3318flyvideo_gpio(btv);3319break;3320case BTTV_BOARD_HAUPPAUGE:3321case BTTV_BOARD_HAUPPAUGE878:3322case BTTV_BOARD_HAUPPAUGEPVR:3323/* pick up some config infos from the eeprom */3324bttv_readee(btv,eeprom_data,0xa0);3325hauppauge_eeprom(btv);3326break;3327case BTTV_BOARD_AVERMEDIA98:3328case BTTV_BOARD_AVPHONE98:3329bttv_readee(btv,eeprom_data,0xa0);3330avermedia_eeprom(btv);3331break;3332case BTTV_BOARD_PXC200:3333init_PXC200(btv);3334break;3335case BTTV_BOARD_PICOLO_TETRA_CHIP:3336picolo_tetra_init(btv);3337break;3338case BTTV_BOARD_VHX:3339btv->has_radio = 1;3340btv->has_matchbox = 1;3341btv->mbox_we = 0x20;3342btv->mbox_most = 0;3343btv->mbox_clk = 0x08;3344btv->mbox_data = 0x10;3345btv->mbox_mask = 0x38;3346break;3347case BTTV_BOARD_VOBIS_BOOSTAR:3348case BTTV_BOARD_TERRATV:3349terratec_active_radio_upgrade(btv);3350break;3351case BTTV_BOARD_MAGICTVIEW061:3352if (btv->cardid == 0x3002144f) {3353btv->has_radio=1;3354printk("bttv%d: radio detected by subsystem id (CPH05x)\n",btv->c.nr);3355}3356break;3357case BTTV_BOARD_STB2:3358if (btv->cardid == 0x3060121a) {3359/* Fix up entry for 3DFX VoodooTV 100,3360which is an OEM STB card variant. */3361btv->has_radio=0;3362btv->tuner_type=TUNER_TEMIC_NTSC;3363}3364break;3365case BTTV_BOARD_OSPREY1x0:3366case BTTV_BOARD_OSPREY1x0_848:3367case BTTV_BOARD_OSPREY101_848:3368case BTTV_BOARD_OSPREY1x1:3369case BTTV_BOARD_OSPREY1x1_SVID:3370case BTTV_BOARD_OSPREY2xx:3371case BTTV_BOARD_OSPREY2x0_SVID:3372case BTTV_BOARD_OSPREY2x0:3373case BTTV_BOARD_OSPREY440:3374case BTTV_BOARD_OSPREY500:3375case BTTV_BOARD_OSPREY540:3376case BTTV_BOARD_OSPREY2000:3377bttv_readee(btv,eeprom_data,0xa0);3378osprey_eeprom(btv, eeprom_data);3379break;3380case BTTV_BOARD_IDS_EAGLE:3381init_ids_eagle(btv);3382break;3383case BTTV_BOARD_MODTEC_205:3384bttv_readee(btv,eeprom_data,0xa0);3385modtec_eeprom(btv);3386break;3387case BTTV_BOARD_LMLBT4:3388init_lmlbt4x(btv);3389break;3390case BTTV_BOARD_TIBET_CS16:3391tibetCS16_init(btv);3392break;3393case BTTV_BOARD_KODICOM_4400R:3394kodicom4400r_init(btv);3395break;3396case BTTV_BOARD_GEOVISION_GV800S:3397gv800s_init(btv);3398break;3399}34003401/* pll configuration */3402if (!(btv->id==848 && btv->revision==0x11)) {3403/* defaults from card list */3404if (PLL_28 == bttv_tvcards[btv->c.type].pll) {3405btv->pll.pll_ifreq=28636363;3406btv->pll.pll_crystal=BT848_IFORM_XT0;3407}3408if (PLL_35 == bttv_tvcards[btv->c.type].pll) {3409btv->pll.pll_ifreq=35468950;3410btv->pll.pll_crystal=BT848_IFORM_XT1;3411}3412/* insmod options can override */3413switch (pll[btv->c.nr]) {3414case 0: /* none */3415btv->pll.pll_crystal = 0;3416btv->pll.pll_ifreq = 0;3417btv->pll.pll_ofreq = 0;3418break;3419case 1: /* 28 MHz */3420case 28:3421btv->pll.pll_ifreq = 28636363;3422btv->pll.pll_ofreq = 0;3423btv->pll.pll_crystal = BT848_IFORM_XT0;3424break;3425case 2: /* 35 MHz */3426case 35:3427btv->pll.pll_ifreq = 35468950;3428btv->pll.pll_ofreq = 0;3429btv->pll.pll_crystal = BT848_IFORM_XT1;3430break;3431}3432}3433btv->pll.pll_current = -1;34343435/* tuner configuration (from card list / autodetect / insmod option) */3436if (UNSET != bttv_tvcards[btv->c.type].tuner_type)3437if (UNSET == btv->tuner_type)3438btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;3439if (UNSET != tuner[btv->c.nr])3440btv->tuner_type = tuner[btv->c.nr];34413442if (btv->tuner_type == TUNER_ABSENT)3443printk(KERN_INFO "bttv%d: tuner absent\n", btv->c.nr);3444else if(btv->tuner_type == UNSET)3445printk(KERN_WARNING "bttv%d: tuner type unset\n", btv->c.nr);3446else3447printk(KERN_INFO "bttv%d: tuner type=%d\n", btv->c.nr,3448btv->tuner_type);34493450if (autoload != UNSET) {3451printk(KERN_WARNING "bttv%d: the autoload option is obsolete.\n", btv->c.nr);3452printk(KERN_WARNING "bttv%d: use option msp3400, tda7432 or tvaudio to\n", btv->c.nr);3453printk(KERN_WARNING "bttv%d: override which audio module should be used.\n", btv->c.nr);3454}34553456if (UNSET == btv->tuner_type)3457btv->tuner_type = TUNER_ABSENT;34583459btv->dig = bttv_tvcards[btv->c.type].has_dig_in ?3460bttv_tvcards[btv->c.type].video_inputs - 1 : UNSET;3461btv->svhs = bttv_tvcards[btv->c.type].svhs == NO_SVHS ?3462UNSET : bttv_tvcards[btv->c.type].svhs;3463if (svhs[btv->c.nr] != UNSET)3464btv->svhs = svhs[btv->c.nr];3465if (remote[btv->c.nr] != UNSET)3466btv->has_remote = remote[btv->c.nr];34673468if (bttv_tvcards[btv->c.type].has_radio)3469btv->has_radio = 1;3470if (bttv_tvcards[btv->c.type].has_remote)3471btv->has_remote = 1;3472if (!bttv_tvcards[btv->c.type].no_gpioirq)3473btv->gpioirq = 1;3474if (bttv_tvcards[btv->c.type].volume_gpio)3475btv->volume_gpio = bttv_tvcards[btv->c.type].volume_gpio;3476if (bttv_tvcards[btv->c.type].audio_mode_gpio)3477btv->audio_mode_gpio = bttv_tvcards[btv->c.type].audio_mode_gpio;34783479if (btv->tuner_type == TUNER_ABSENT)3480return; /* no tuner or related drivers to load */34813482if (btv->has_saa6588 || saa6588[btv->c.nr]) {3483/* Probe for RDS receiver chip */3484static const unsigned short addrs[] = {34850x20 >> 1,34860x22 >> 1,3487I2C_CLIENT_END3488};3489struct v4l2_subdev *sd;34903491sd = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,3492&btv->c.i2c_adap, "saa6588", 0, addrs);3493btv->has_saa6588 = (sd != NULL);3494}34953496/* try to detect audio/fader chips */34973498/* First check if the user specified the audio chip via a module3499option. */35003501switch (audiodev[btv->c.nr]) {3502case -1:3503return; /* do not load any audio module */35043505case 0: /* autodetect */3506break;35073508case 1: {3509/* The user specified that we should probe for msp3400 */3510static const unsigned short addrs[] = {3511I2C_ADDR_MSP3400 >> 1,3512I2C_ADDR_MSP3400_ALT >> 1,3513I2C_CLIENT_END3514};35153516btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,3517&btv->c.i2c_adap, "msp3400", 0, addrs);3518if (btv->sd_msp34xx)3519return;3520goto no_audio;3521}35223523case 2: {3524/* The user specified that we should probe for tda7432 */3525static const unsigned short addrs[] = {3526I2C_ADDR_TDA7432 >> 1,3527I2C_CLIENT_END3528};35293530if (v4l2_i2c_new_subdev(&btv->c.v4l2_dev,3531&btv->c.i2c_adap, "tda7432", 0, addrs))3532return;3533goto no_audio;3534}35353536case 3: {3537/* The user specified that we should probe for tvaudio */3538btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,3539&btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs());3540if (btv->sd_tvaudio)3541return;3542goto no_audio;3543}35443545default:3546printk(KERN_WARNING "bttv%d: unknown audiodev value!\n",3547btv->c.nr);3548return;3549}35503551/* There were no overrides, so now we try to discover this through the3552card definition */35533554/* probe for msp3400 first: this driver can detect whether or not3555it really is a msp3400, so it will return NULL when the device3556found is really something else (e.g. a tea6300). */3557if (!bttv_tvcards[btv->c.type].no_msp34xx) {3558btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,3559&btv->c.i2c_adap, "msp3400",35600, I2C_ADDRS(I2C_ADDR_MSP3400 >> 1));3561} else if (bttv_tvcards[btv->c.type].msp34xx_alt) {3562btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,3563&btv->c.i2c_adap, "msp3400",35640, I2C_ADDRS(I2C_ADDR_MSP3400_ALT >> 1));3565}35663567/* If we found a msp34xx, then we're done. */3568if (btv->sd_msp34xx)3569return;35703571/* it might also be a tda7432. */3572if (!bttv_tvcards[btv->c.type].no_tda7432) {3573static const unsigned short addrs[] = {3574I2C_ADDR_TDA7432 >> 1,3575I2C_CLIENT_END3576};35773578if (v4l2_i2c_new_subdev(&btv->c.v4l2_dev,3579&btv->c.i2c_adap, "tda7432", 0, addrs))3580return;3581}35823583/* Now see if we can find one of the tvaudio devices. */3584btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,3585&btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs());3586if (btv->sd_tvaudio)3587return;35883589no_audio:3590printk(KERN_WARNING "bttv%d: audio absent, no audio device found!\n",3591btv->c.nr);3592}359335943595/* initialize the tuner */3596void __devinit bttv_init_tuner(struct bttv *btv)3597{3598int addr = ADDR_UNSET;35993600if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)3601addr = bttv_tvcards[btv->c.type].tuner_addr;36023603if (btv->tuner_type != TUNER_ABSENT) {3604struct tuner_setup tun_setup;36053606/* Load tuner module before issuing tuner config call! */3607if (bttv_tvcards[btv->c.type].has_radio)3608v4l2_i2c_new_subdev(&btv->c.v4l2_dev,3609&btv->c.i2c_adap, "tuner",36100, v4l2_i2c_tuner_addrs(ADDRS_RADIO));3611v4l2_i2c_new_subdev(&btv->c.v4l2_dev,3612&btv->c.i2c_adap, "tuner",36130, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));3614v4l2_i2c_new_subdev(&btv->c.v4l2_dev,3615&btv->c.i2c_adap, "tuner",36160, v4l2_i2c_tuner_addrs(ADDRS_TV_WITH_DEMOD));36173618tun_setup.mode_mask = T_ANALOG_TV;3619tun_setup.type = btv->tuner_type;3620tun_setup.addr = addr;36213622if (bttv_tvcards[btv->c.type].has_radio)3623tun_setup.mode_mask |= T_RADIO;36243625bttv_call_all(btv, tuner, s_type_addr, &tun_setup);3626}36273628if (btv->tda9887_conf) {3629struct v4l2_priv_tun_config tda9887_cfg;36303631tda9887_cfg.tuner = TUNER_TDA9887;3632tda9887_cfg.priv = &btv->tda9887_conf;36333634bttv_call_all(btv, tuner, s_config, &tda9887_cfg);3635}3636}36373638/* ----------------------------------------------------------------------- */36393640static void modtec_eeprom(struct bttv *btv)3641{3642if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {3643btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;3644printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",3645btv->c.nr,&eeprom_data[0x1e]);3646} else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {3647btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;3648printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",3649btv->c.nr,&eeprom_data[0x1e]);3650} else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {3651btv->tuner_type=TUNER_PHILIPS_NTSC;3652printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",3653btv->c.nr,&eeprom_data[0x1e]);3654} else {3655printk("bttv%d: Modtec: Unknown TunerString: %s\n",3656btv->c.nr,&eeprom_data[0x1e]);3657}3658}36593660static void __devinit hauppauge_eeprom(struct bttv *btv)3661{3662struct tveeprom tv;36633664tveeprom_hauppauge_analog(&btv->i2c_client, &tv, eeprom_data);3665btv->tuner_type = tv.tuner_type;3666btv->has_radio = tv.has_radio;36673668printk("bttv%d: Hauppauge eeprom indicates model#%d\n",3669btv->c.nr, tv.model);36703671/*3672* Some of the 878 boards have duplicate PCI IDs. Switch the board3673* type based on model #.3674*/3675if(tv.model == 64900) {3676printk("bttv%d: Switching board type from %s to %s\n",3677btv->c.nr,3678bttv_tvcards[btv->c.type].name,3679bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name);3680btv->c.type = BTTV_BOARD_HAUPPAUGE_IMPACTVCB;3681}3682}36833684static int terratec_active_radio_upgrade(struct bttv *btv)3685{3686int freq;36873688btv->has_radio = 1;3689btv->has_matchbox = 1;3690btv->mbox_we = 0x10;3691btv->mbox_most = 0x20;3692btv->mbox_clk = 0x08;3693btv->mbox_data = 0x04;3694btv->mbox_mask = 0x3c;36953696btv->mbox_iow = 1 << 8;3697btv->mbox_ior = 1 << 9;3698btv->mbox_csel = 1 << 10;36993700freq=88000/62.5;3701tea5757_write(btv, 5 * freq + 0x358); /* write 0x1ed8 */3702if (0x1ed8 == tea5757_read(btv)) {3703printk("bttv%d: Terratec Active Radio Upgrade found.\n",3704btv->c.nr);3705btv->has_radio = 1;3706btv->has_saa6588 = 1;3707btv->has_matchbox = 1;3708} else {3709btv->has_radio = 0;3710btv->has_matchbox = 0;3711}3712return 0;3713}371437153716/* ----------------------------------------------------------------------- */37173718/*3719* minimal bootstrap for the WinTV/PVR -- upload altera firmware.3720*3721* The hcwamc.rbf firmware file is on the Hauppauge driver CD. Have3722* a look at Pvr/pvr45xxx.EXE (self-extracting zip archive, can be3723* unpacked with unzip).3724*/3725#define PVR_GPIO_DELAY 1037263727#define BTTV_ALT_DATA 0x0000013728#define BTTV_ALT_DCLK 0x1000003729#define BTTV_ALT_NCONFIG 0x80000037303731static int __devinit pvr_altera_load(struct bttv *btv, const u8 *micro,3732u32 microlen)3733{3734u32 n;3735u8 bits;3736int i;37373738gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG);3739gpio_write(0);3740udelay(PVR_GPIO_DELAY);37413742gpio_write(BTTV_ALT_NCONFIG);3743udelay(PVR_GPIO_DELAY);37443745for (n = 0; n < microlen; n++) {3746bits = micro[n];3747for (i = 0 ; i < 8 ; i++) {3748gpio_bits(BTTV_ALT_DCLK,0);3749if (bits & 0x01)3750gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);3751else3752gpio_bits(BTTV_ALT_DATA,0);3753gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);3754bits >>= 1;3755}3756}3757gpio_bits(BTTV_ALT_DCLK,0);3758udelay(PVR_GPIO_DELAY);37593760/* begin Altera init loop (Not necessary,but doesn't hurt) */3761for (i = 0 ; i < 30 ; i++) {3762gpio_bits(BTTV_ALT_DCLK,0);3763gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);3764}3765gpio_bits(BTTV_ALT_DCLK,0);3766return 0;3767}37683769static int __devinit pvr_boot(struct bttv *btv)3770{3771const struct firmware *fw_entry;3772int rc;37733774rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);3775if (rc != 0) {3776printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n",3777btv->c.nr);3778return rc;3779}3780rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);3781printk(KERN_INFO "bttv%d: altera firmware upload %s\n",3782btv->c.nr, (rc < 0) ? "failed" : "ok");3783release_firmware(fw_entry);3784return rc;3785}37863787/* ----------------------------------------------------------------------- */3788/* some osprey specific stuff */37893790static void __devinit osprey_eeprom(struct bttv *btv, const u8 ee[256])3791{3792int i;3793u32 serial = 0;3794int cardid = -1;37953796/* This code will nevery actually get called in this case.... */3797if (btv->c.type == BTTV_BOARD_UNKNOWN) {3798/* this might be an antique... check for MMAC label in eeprom */3799if (!strncmp(ee, "MMAC", 4)) {3800u8 checksum = 0;3801for (i = 0; i < 21; i++)3802checksum += ee[i];3803if (checksum != ee[21])3804return;3805cardid = BTTV_BOARD_OSPREY1x0_848;3806for (i = 12; i < 21; i++)3807serial *= 10, serial += ee[i] - '0';3808}3809} else {3810unsigned short type;38113812for (i = 4*16; i < 8*16; i += 16) {3813u16 checksum = ip_compute_csum(ee + i, 16);38143815if ((checksum&0xff) + (checksum>>8) == 0xff)3816break;3817}3818if (i >= 8*16)3819return;3820ee += i;38213822/* found a valid descriptor */3823type = get_unaligned_be16((__be16 *)(ee+4));38243825switch(type) {3826/* 848 based */3827case 0x0004:3828cardid = BTTV_BOARD_OSPREY1x0_848;3829break;3830case 0x0005:3831cardid = BTTV_BOARD_OSPREY101_848;3832break;38333834/* 878 based */3835case 0x0012:3836case 0x0013:3837cardid = BTTV_BOARD_OSPREY1x0;3838break;3839case 0x0014:3840case 0x0015:3841cardid = BTTV_BOARD_OSPREY1x1;3842break;3843case 0x0016:3844case 0x0017:3845case 0x0020:3846cardid = BTTV_BOARD_OSPREY1x1_SVID;3847break;3848case 0x0018:3849case 0x0019:3850case 0x001E:3851case 0x001F:3852cardid = BTTV_BOARD_OSPREY2xx;3853break;3854case 0x001A:3855case 0x001B:3856cardid = BTTV_BOARD_OSPREY2x0_SVID;3857break;3858case 0x0040:3859cardid = BTTV_BOARD_OSPREY500;3860break;3861case 0x0050:3862case 0x0056:3863cardid = BTTV_BOARD_OSPREY540;3864/* bttv_osprey_540_init(btv); */3865break;3866case 0x0060:3867case 0x0070:3868case 0x00A0:3869cardid = BTTV_BOARD_OSPREY2x0;3870/* enable output on select control lines */3871gpio_inout(0xffffff,0x000303);3872break;3873case 0x00D8:3874cardid = BTTV_BOARD_OSPREY440;3875break;3876default:3877/* unknown...leave generic, but get serial # */3878printk(KERN_INFO "bttv%d: "3879"osprey eeprom: unknown card type 0x%04x\n",3880btv->c.nr, type);3881break;3882}3883serial = get_unaligned_be32((__be32 *)(ee+6));3884}38853886printk(KERN_INFO "bttv%d: osprey eeprom: card=%d '%s' serial=%u\n",3887btv->c.nr, cardid,3888cardid>0 ? bttv_tvcards[cardid].name : "Unknown", serial);38893890if (cardid<0 || btv->c.type == cardid)3891return;38923893/* card type isn't set correctly */3894if (card[btv->c.nr] < bttv_num_tvcards) {3895printk(KERN_WARNING "bttv%d: osprey eeprom: "3896"Not overriding user specified card type\n", btv->c.nr);3897} else {3898printk(KERN_INFO "bttv%d: osprey eeprom: "3899"Changing card type from %d to %d\n", btv->c.nr,3900btv->c.type, cardid);3901btv->c.type = cardid;3902}3903}39043905/* ----------------------------------------------------------------------- */3906/* AVermedia specific stuff, from bktr_card.c */39073908static int tuner_0_table[] = {3909TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/,3910TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/,3911TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,3912TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,3913TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,3914TUNER_PHILIPS_FM1216ME_MK3 };39153916static int tuner_1_table[] = {3917TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,3918TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,3919TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,3920TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */3921TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};39223923static void __devinit avermedia_eeprom(struct bttv *btv)3924{3925int tuner_make, tuner_tv_fm, tuner_format, tuner_type = 0;39263927tuner_make = (eeprom_data[0x41] & 0x7);3928tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;3929tuner_format = (eeprom_data[0x42] & 0xf0) >> 4;3930btv->has_remote = (eeprom_data[0x42] & 0x01);39313932if (tuner_make == 0 || tuner_make == 2)3933if (tuner_format <= 0x0a)3934tuner_type = tuner_0_table[tuner_format];3935if (tuner_make == 1)3936if (tuner_format <= 9)3937tuner_type = tuner_1_table[tuner_format];39383939if (tuner_make == 4)3940if (tuner_format == 0x09)3941tuner_type = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */39423943printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=",3944btv->c.nr, eeprom_data[0x41], eeprom_data[0x42]);3945if (tuner_type) {3946btv->tuner_type = tuner_type;3947printk(KERN_CONT "%d", tuner_type);3948} else3949printk(KERN_CONT "Unknown type");3950printk(KERN_CONT " radio:%s remote control:%s\n",3951tuner_tv_fm ? "yes" : "no",3952btv->has_remote ? "yes" : "no");3953}39543955/*3956* For Voodoo TV/FM and Voodoo 200. These cards' tuners use a TDA98803957* analog demod, which is not I2C controlled like the newer and more common3958* TDA9887 series. Instead is has two tri-state input pins, S0 and S1,3959* that control the IF for the video and audio. Apparently, bttv GPIO3960* 0x10000 is connected to S0. S0 low selects a 38.9 MHz VIF for B/G/D/K/I3961* (i.e., PAL) while high selects 45.75 MHz for M/N (i.e., NTSC).3962*/3963u32 bttv_tda9880_setnorm(struct bttv *btv, u32 gpiobits)3964{39653966if (btv->audio == TVAUDIO_INPUT_TUNER) {3967if (bttv_tvnorms[btv->tvnorm].v4l2_id & V4L2_STD_MN)3968gpiobits |= 0x10000;3969else3970gpiobits &= ~0x10000;3971}39723973gpio_bits(bttv_tvcards[btv->c.type].gpiomask, gpiobits);3974return gpiobits;3975}397639773978/*3979* reset/enable the MSP on some Hauppauge cards3980* Thanks to Kyösti Mälkki ([email protected])!3981*3982* Hauppauge: pin 53983* Voodoo: pin 203984*/3985static void __devinit boot_msp34xx(struct bttv *btv, int pin)3986{3987int mask = (1 << pin);39883989gpio_inout(mask,mask);3990gpio_bits(mask,0);3991mdelay(2);3992udelay(500);3993gpio_bits(mask,mask);39943995if (bttv_gpio)3996bttv_gpio_tracking(btv,"msp34xx");3997if (bttv_verbose)3998printk(KERN_INFO "bttv%d: Hauppauge/Voodoo msp34xx: reset line "3999"init [%d]\n", btv->c.nr, pin);4000}40014002/* ----------------------------------------------------------------------- */4003/* Imagenation L-Model PXC200 Framegrabber */4004/* This is basically the same procedure as4005* used by Alessandro Rubini in his pxc2004006* driver, but using BTTV functions */40074008static void __devinit init_PXC200(struct bttv *btv)4009{4010static int vals[] __devinitdata = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d,40110x01, 0x02, 0x03, 0x04, 0x05, 0x06,40120x00 };4013unsigned int i;4014int tmp;4015u32 val;40164017/* Initialise GPIO-connevted stuff */4018gpio_inout(0xffffff, (1<<13));4019gpio_write(0);4020udelay(3);4021gpio_write(1<<13);4022/* GPIO inputs are pulled up, so no need to drive4023* reset pin any longer */4024gpio_bits(0xffffff, 0);4025if (bttv_gpio)4026bttv_gpio_tracking(btv,"pxc200");40274028/* we could/should try and reset/control the AD pots? but4029right now we simply turned off the crushing. Without4030this the AGC drifts drifts4031remember the EN is reverse logic -->4032setting BT848_ADC_AGC_EN disable the AGC4033[email protected]4034*/40354036btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);40374038/* Initialise MAX517 DAC */4039printk(KERN_INFO "Setting DAC reference voltage level ...\n");4040bttv_I2CWrite(btv,0x5E,0,0x80,1);40414042/* Initialise 12C508 PIC */4043/* The I2CWrite and I2CRead commmands are actually to the4044* same chips - but the R/W bit is included in the address4045* argument so the numbers are different */404640474048printk(KERN_INFO "Initialising 12C508 PIC chip ...\n");40494050/* First of all, enable the clock line. This is used in the PXC200-F */4051val = btread(BT848_GPIO_DMA_CTL);4052val |= BT848_GPIO_DMA_CTL_GPCLKMODE;4053btwrite(val, BT848_GPIO_DMA_CTL);40544055/* Then, push to 0 the reset pin long enough to reset the *4056* device same as above for the reset line, but not the same4057* value sent to the GPIO-connected stuff4058* which one is the good one? */4059gpio_inout(0xffffff,(1<<2));4060gpio_write(0);4061udelay(10);4062gpio_write(1<<2);40634064for (i = 0; i < ARRAY_SIZE(vals); i++) {4065tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);4066if (tmp != -1) {4067printk(KERN_INFO4068"I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",4069vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));4070}4071}40724073printk(KERN_INFO "PXC200 Initialised.\n");4074}4075407640774078/* ----------------------------------------------------------------------- */4079/*4080* The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock4081* it. This apparently involves the following procedure for each 878 chip:4082*4083* 1) write 0x00C3FEFF to the GPIO_OUT_EN register4084*4085* 2) write to GPIO_DATA4086* - 0x0E4087* - sleep 1ms4088* - 0x10 + 0x0E4089* - sleep 10ms4090* - 0x0E4091* read from GPIO_DATA into buf (uint_32)4092* - if ( data>>18 & 0x01 != 0) || ( buf>>19 & 0x01 != 1 )4093* error. ERROR_CPLD_Check_Failed stop.4094*4095* 3) write to GPIO_DATA4096* - write 0x4400 + 0x0E4097* - sleep 10ms4098* - write 0x4410 + 0x0E4099* - sleep 1ms4100* - write 0x0E4101* read from GPIO_DATA into buf (uint_32)4102* - if ( buf>>18 & 0x01 ) || ( buf>>19 & 0x01 != 0 )4103* error. ERROR_CPLD_Check_Failed.4104*/4105/* ----------------------------------------------------------------------- */4106static void4107init_RTV24 (struct bttv *btv)4108{4109uint32_t dataRead = 0;4110long watchdog_value = 0x0E;41114112printk (KERN_INFO4113"bttv%d: Adlink RTV-24 initialisation in progress ...\n",4114btv->c.nr);41154116btwrite (0x00c3feff, BT848_GPIO_OUT_EN);41174118btwrite (0 + watchdog_value, BT848_GPIO_DATA);4119msleep (1);4120btwrite (0x10 + watchdog_value, BT848_GPIO_DATA);4121msleep (10);4122btwrite (0 + watchdog_value, BT848_GPIO_DATA);41234124dataRead = btread (BT848_GPIO_DATA);41254126if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {4127printk (KERN_INFO4128"bttv%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",4129btv->c.nr, dataRead);4130}41314132btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);4133msleep (10);4134btwrite (0x4410 + watchdog_value, BT848_GPIO_DATA);4135msleep (1);4136btwrite (watchdog_value, BT848_GPIO_DATA);4137msleep (1);4138dataRead = btread (BT848_GPIO_DATA);41394140if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {4141printk (KERN_INFO4142"bttv%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",4143btv->c.nr, dataRead);41444145return;4146}41474148printk (KERN_INFO4149"bttv%d: Adlink RTV-24 initialisation complete.\n", btv->c.nr);4150}4151415241534154/* ----------------------------------------------------------------------- */4155/* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */4156/*4157* Copyright (c) 1999 Csaba Halasz <[email protected]>4158* This code is placed under the terms of the GNU General Public License4159*4160* Brutally hacked by Dan Sheridan <[email protected]> djs52 8/3/004161*/41624163static void bus_low(struct bttv *btv, int bit)4164{4165if (btv->mbox_ior) {4166gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,4167btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);4168udelay(5);4169}41704171gpio_bits(bit,0);4172udelay(5);41734174if (btv->mbox_ior) {4175gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);4176udelay(5);4177}4178}41794180static void bus_high(struct bttv *btv, int bit)4181{4182if (btv->mbox_ior) {4183gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,4184btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);4185udelay(5);4186}41874188gpio_bits(bit,bit);4189udelay(5);41904191if (btv->mbox_ior) {4192gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);4193udelay(5);4194}4195}41964197static int bus_in(struct bttv *btv, int bit)4198{4199if (btv->mbox_ior) {4200gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,4201btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);4202udelay(5);42034204gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);4205udelay(5);4206}4207return gpio_read() & (bit);4208}42094210/* TEA5757 register bits */4211#define TEA_FREQ 0:144212#define TEA_BUFFER 15:1542134214#define TEA_SIGNAL_STRENGTH 16:1742154216#define TEA_PORT1 18:184217#define TEA_PORT0 19:1942184219#define TEA_BAND 20:214220#define TEA_BAND_FM 04221#define TEA_BAND_MW 14222#define TEA_BAND_LW 24223#define TEA_BAND_SW 342244225#define TEA_MONO 22:224226#define TEA_ALLOW_STEREO 04227#define TEA_FORCE_MONO 142284229#define TEA_SEARCH_DIRECTION 23:234230#define TEA_SEARCH_DOWN 04231#define TEA_SEARCH_UP 142324233#define TEA_STATUS 24:244234#define TEA_STATUS_TUNED 04235#define TEA_STATUS_SEARCHING 142364237/* Low-level stuff */4238static int tea5757_read(struct bttv *btv)4239{4240unsigned long timeout;4241int value = 0;4242int i;42434244/* better safe than sorry */4245gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we);42464247if (btv->mbox_ior) {4248gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,4249btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);4250udelay(5);4251}42524253if (bttv_gpio)4254bttv_gpio_tracking(btv,"tea5757 read");42554256bus_low(btv,btv->mbox_we);4257bus_low(btv,btv->mbox_clk);42584259udelay(10);4260timeout= jiffies + msecs_to_jiffies(1000);42614262/* wait for DATA line to go low; error if it doesn't */4263while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))4264schedule();4265if (bus_in(btv,btv->mbox_data)) {4266printk(KERN_WARNING "bttv%d: tea5757: read timeout\n",btv->c.nr);4267return -1;4268}42694270dprintk("bttv%d: tea5757:",btv->c.nr);4271for (i = 0; i < 24; i++) {4272udelay(5);4273bus_high(btv,btv->mbox_clk);4274udelay(5);4275dprintk("%c",(bus_in(btv,btv->mbox_most) == 0)?'T':'-');4276bus_low(btv,btv->mbox_clk);4277value <<= 1;4278value |= (bus_in(btv,btv->mbox_data) == 0)?0:1; /* MSB first */4279dprintk("%c", (bus_in(btv,btv->mbox_most) == 0)?'S':'M');4280}4281dprintk("\nbttv%d: tea5757: read 0x%X\n", btv->c.nr, value);4282return value;4283}42844285static int tea5757_write(struct bttv *btv, int value)4286{4287int i;4288int reg = value;42894290gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we | btv->mbox_data);42914292if (btv->mbox_ior) {4293gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,4294btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);4295udelay(5);4296}4297if (bttv_gpio)4298bttv_gpio_tracking(btv,"tea5757 write");42994300dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value);4301bus_low(btv,btv->mbox_clk);4302bus_high(btv,btv->mbox_we);4303for (i = 0; i < 25; i++) {4304if (reg & 0x1000000)4305bus_high(btv,btv->mbox_data);4306else4307bus_low(btv,btv->mbox_data);4308reg <<= 1;4309bus_high(btv,btv->mbox_clk);4310udelay(10);4311bus_low(btv,btv->mbox_clk);4312udelay(10);4313}4314bus_low(btv,btv->mbox_we); /* unmute !!! */4315return 0;4316}43174318void tea5757_set_freq(struct bttv *btv, unsigned short freq)4319{4320dprintk("tea5757_set_freq %d\n",freq);4321tea5757_write(btv, 5 * freq + 0x358); /* add 10.7MHz (see docs) */4322}43234324/* RemoteVision MX (rv605) muxsel helper [Miguel Freitas]4325*4326* This is needed because rv605 don't use a normal multiplex, but a crosspoint4327* switch instead (CD22M3494E). This IC can have multiple active connections4328* between Xn (input) and Yn (output) pins. We need to clear any existing4329* connection prior to establish a new one, pulsing the STROBE pin.4330*4331* The board hardwire Y0 (xpoint) to MUX1 and MUXOUT to Yin.4332* GPIO pins are wired as:4333* GPIO[0:3] - AX[0:3] (xpoint) - P1[0:3] (microcontroller)4334* GPIO[4:6] - AY[0:2] (xpoint) - P1[4:6] (microcontroller)4335* GPIO[7] - DATA (xpoint) - P1[7] (microcontroller)4336* GPIO[8] - - P3[5] (microcontroller)4337* GPIO[9] - RESET (xpoint) - P3[6] (microcontroller)4338* GPIO[10] - STROBE (xpoint) - P3[7] (microcontroller)4339* GPINTR - - P3[4] (microcontroller)4340*4341* The microcontroller is a 80C32 like. It should be possible to change xpoint4342* configuration either directly (as we are doing) or using the microcontroller4343* which is also wired to I2C interface. I have no further info on the4344* microcontroller features, one would need to disassembly the firmware.4345* note: the vendor refused to give any information on this product, all4346* that stuff was found using a multimeter! :)4347*/4348static void rv605_muxsel(struct bttv *btv, unsigned int input)4349{4350static const u8 muxgpio[] = { 0x3, 0x1, 0x2, 0x4, 0xf, 0x7, 0xe, 0x0,43510xd, 0xb, 0xc, 0x6, 0x9, 0x5, 0x8, 0xa };43524353gpio_bits(0x07f, muxgpio[input]);43544355/* reset all conections */4356gpio_bits(0x200,0x200);4357mdelay(1);4358gpio_bits(0x200,0x000);4359mdelay(1);43604361/* create a new connection */4362gpio_bits(0x480,0x480);4363mdelay(1);4364gpio_bits(0x480,0x080);4365mdelay(1);4366}43674368/* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning]4369*4370* The CS16 (available on eBay cheap) is a PCI board with four Fusion4371* 878A chips, a PCI bridge, an Atmel microcontroller, four sync separator4372* chips, ten eight input analog multiplexors, a not chip and a few4373* other components.4374*4375* 16 inputs on a secondary bracket are provided and can be selected4376* from each of the four capture chips. Two of the eight input4377* multiplexors are used to select from any of the 16 input signals.4378*4379* Unsupported hardware capabilities:4380* . A video output monitor on the secondary bracket can be selected from4381* one of the 878A chips.4382* . Another passthrough but I haven't spent any time investigating it.4383* . Digital I/O (logic level connected to GPIO) is available from an4384* onboard header.4385*4386* The on chip input mux should always be set to 2.4387* GPIO[16:19] - Video input selection4388* GPIO[0:3] - Video output monitor select (only available from one 878A)4389* GPIO[?:?] - Digital I/O.4390*4391* There is an ATMEL microcontroller with an 8031 core on board. I have not4392* determined what function (if any) it provides. With the microcontroller4393* and sync separator chips a guess is that it might have to do with video4394* switching and maybe some digital I/O.4395*/4396static void tibetCS16_muxsel(struct bttv *btv, unsigned int input)4397{4398/* video mux */4399gpio_bits(0x0f0000, input << 16);4400}44014402static void tibetCS16_init(struct bttv *btv)4403{4404/* enable gpio bits, mask obtained via btSpy */4405gpio_inout(0xffffff, 0x0f7fff);4406gpio_write(0x0f7fff);4407}44084409/*4410* The following routines for the Kodicom-4400r get a little mind-twisting.4411* There is a "master" controller and three "slave" controllers, together4412* an analog switch which connects any of 16 cameras to any of the BT87A's.4413* The analog switch is controlled by the "master", but the detection order4414* of the four BT878A chips is in an order which I just don't understand.4415* The "master" is actually the second controller to be detected. The4416* logic on the board uses logical numbers for the 4 controllers, but4417* those numbers are different from the detection sequence. When working4418* with the analog switch, we need to "map" from the detection sequence4419* over to the board's logical controller number. This mapping sequence4420* is {3, 0, 2, 1}, i.e. the first controller to be detected is logical4421* unit 3, the second (which is the master) is logical unit 0, etc.4422* We need to maintain the status of the analog switch (which of the 164423* cameras is connected to which of the 4 controllers). Rather than4424* add to the bttv structure for this, we use the data reserved for4425* the mbox (unused for this card type).4426*/44274428/*4429* First a routine to set the analog switch, which controls which camera4430* is routed to which controller. The switch comprises an X-address4431* (gpio bits 0-3, representing the camera, ranging from 0-15), and a4432* Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).4433* A data value (gpio bit 7) of '1' enables the switch, and '0' disables4434* the switch. A STROBE bit (gpio bit 8) latches the data value into the4435* specified address. The idea is to set the address and data, then bring4436* STROBE high, and finally bring STROBE back to low.4437*/4438static void kodicom4400r_write(struct bttv *btv,4439unsigned char xaddr,4440unsigned char yaddr,4441unsigned char data) {4442unsigned int udata;44434444udata = (data << 7) | ((yaddr&3) << 4) | (xaddr&0xf);4445gpio_bits(0x1ff, udata); /* write ADDR and DAT */4446gpio_bits(0x1ff, udata | (1 << 8)); /* strobe high */4447gpio_bits(0x1ff, udata); /* strobe low */4448}44494450/*4451* Next the mux select. Both the "master" and "slave" 'cards' (controllers)4452* use this routine. The routine finds the "master" for the card, maps4453* the controller number from the detected position over to the logical4454* number, writes the appropriate data to the analog switch, and housekeeps4455* the local copy of the switch information. The parameter 'input' is the4456* requested camera number (0 - 15).4457*/4458static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input)4459{4460char *sw_status;4461int xaddr, yaddr;4462struct bttv *mctlr;4463static unsigned char map[4] = {3, 0, 2, 1};44644465mctlr = master[btv->c.nr];4466if (mctlr == NULL) { /* ignore if master not yet detected */4467return;4468}4469yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3; /* the '&' is for safety */4470yaddr = map[yaddr];4471sw_status = (char *)(&mctlr->mbox_we);4472xaddr = input & 0xf;4473/* Check if the controller/camera pair has changed, else ignore */4474if (sw_status[yaddr] != xaddr)4475{4476/* "open" the old switch, "close" the new one, save the new */4477kodicom4400r_write(mctlr, sw_status[yaddr], yaddr, 0);4478sw_status[yaddr] = xaddr;4479kodicom4400r_write(mctlr, xaddr, yaddr, 1);4480}4481}44824483/*4484* During initialisation, we need to reset the analog switch. We4485* also preset the switch to map the 4 connectors on the card to the4486* *user's* (see above description of kodicom4400r_muxsel) channels4487* 0 through 34488*/4489static void kodicom4400r_init(struct bttv *btv)4490{4491char *sw_status = (char *)(&btv->mbox_we);4492int ix;44934494gpio_inout(0x0003ff, 0x0003ff);4495gpio_write(1 << 9); /* reset MUX */4496gpio_write(0);4497/* Preset camera 0 to the 4 controllers */4498for (ix = 0; ix < 4; ix++) {4499sw_status[ix] = ix;4500kodicom4400r_write(btv, ix, ix, 1);4501}4502/*4503* Since this is the "master", we need to set up the4504* other three controller chips' pointers to this structure4505* for later use in the muxsel routine.4506*/4507if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3))4508return;4509master[btv->c.nr-1] = btv;4510master[btv->c.nr] = btv;4511master[btv->c.nr+1] = btv;4512master[btv->c.nr+2] = btv;4513}45144515/* The Grandtec X-Guard framegrabber card uses two Dual 4-channel4516* video multiplexers to provide up to 16 video inputs. These4517* multiplexers are controlled by the lower 8 GPIO pins of the4518* bt878. The multiplexers probably Pericom PI5V331Q or similar.45194520* xxx0 is pin xxx of multiplexer U5,4521* yyy1 is pin yyy of multiplexer U24522*/4523#define ENA0 0x014524#define ENB0 0x024525#define ENA1 0x044526#define ENB1 0x0845274528#define IN10 0x104529#define IN00 0x204530#define IN11 0x404531#define IN01 0x8045324533static void xguard_muxsel(struct bttv *btv, unsigned int input)4534{4535static const int masks[] = {4536ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10,4537ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10,4538ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11,4539ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11,4540};4541gpio_write(masks[input%16]);4542}4543static void picolo_tetra_init(struct bttv *btv)4544{4545/*This is the video input redirection fonctionality : I DID NOT USED IT. */4546btwrite (0x08<<16,BT848_GPIO_DATA);/*GPIO[19] [==> 4053 B+C] set to 1 */4547btwrite (0x04<<16,BT848_GPIO_DATA);/*GPIO[18] [==> 4053 A] set to 1*/4548}4549static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)4550{45514552dprintk (KERN_DEBUG "bttv%d : picolo_tetra_muxsel => input = %d\n",btv->c.nr,input);4553/*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/4554/*GPIO[20]&GPIO[21] used to choose the right input*/4555btwrite (input<<20,BT848_GPIO_DATA);45564557}45584559/*4560* ivc120_muxsel [Added by Alan Garfield <[email protected]>]4561*4562* The IVC120G security card has 4 i2c controlled TDA8540 matrix4563* swichers to provide 16 channels to MUX0. The TDA8540's have4564* 4 independent outputs and as such the IVC120G also has the4565* optional "Monitor Out" bus. This allows the card to be looking4566* at one input while the monitor is looking at another.4567*4568* Since I've couldn't be bothered figuring out how to add an4569* independent muxsel for the monitor bus, I've just set it to4570* whatever the card is looking at.4571*4572* OUT0 of the TDA8540's is connected to MUX0 (0x03)4573* OUT1 of the TDA8540's is connected to "Monitor Out" (0x0C)4574*4575* TDA8540_ALT3 IN0-3 = Channel 13 - 16 (0x03)4576* TDA8540_ALT4 IN0-3 = Channel 1 - 4 (0x03)4577* TDA8540_ALT5 IN0-3 = Channel 5 - 8 (0x03)4578* TDA8540_ALT6 IN0-3 = Channel 9 - 12 (0x03)4579*4580*/45814582/* All 7 possible sub-ids for the TDA8540 Matrix Switcher */4583#define I2C_TDA8540 0x904584#define I2C_TDA8540_ALT1 0x924585#define I2C_TDA8540_ALT2 0x944586#define I2C_TDA8540_ALT3 0x964587#define I2C_TDA8540_ALT4 0x984588#define I2C_TDA8540_ALT5 0x9a4589#define I2C_TDA8540_ALT6 0x9c45904591static void ivc120_muxsel(struct bttv *btv, unsigned int input)4592{4593/* Simple maths */4594int key = input % 4;4595int matrix = input / 4;45964597dprintk("bttv%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",4598btv->c.nr, input, matrix, key);45994600/* Handles the input selection on the TDA8540's */4601bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00,4602((matrix == 3) ? (key | key << 2) : 0x00), 1);4603bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x00,4604((matrix == 0) ? (key | key << 2) : 0x00), 1);4605bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x00,4606((matrix == 1) ? (key | key << 2) : 0x00), 1);4607bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00,4608((matrix == 2) ? (key | key << 2) : 0x00), 1);46094610/* Handles the output enables on the TDA8540's */4611bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02,4612((matrix == 3) ? 0x03 : 0x00), 1); /* 13 - 16 */4613bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02,4614((matrix == 0) ? 0x03 : 0x00), 1); /* 1-4 */4615bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02,4616((matrix == 1) ? 0x03 : 0x00), 1); /* 5-8 */4617bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02,4618((matrix == 2) ? 0x03 : 0x00), 1); /* 9-12 */46194620/* 878's MUX0 is already selected for input via muxsel values */4621}462246234624/* PXC200 muxsel helper4625* [email protected]4626* another transplant4627* from Alessandro Rubini ([email protected])4628*4629* There are 4 kinds of cards:4630* PXC200L which is bt8484631* PXC200F which is bt848 with PIC controlling mux4632* PXC200AL which is bt8784633* PXC200AF which is bt878 with PIC controlling mux4634*/4635#define PX_CFG_PXC200F 0x014636#define PX_FLAG_PXC200A 0x00001000 /* a pxc200A is bt-878 based */4637#define PX_I2C_PIC 0x0f4638#define PX_PXC200A_CARDID 0x200a12954639#define PX_I2C_CMD_CFG 0x0046404641static void PXC200_muxsel(struct bttv *btv, unsigned int input)4642{4643int rc;4644long mux;4645int bitmask;4646unsigned char buf[2];46474648/* Read PIC config to determine if this is a PXC200F */4649/* PX_I2C_CMD_CFG*/4650buf[0]=0;4651buf[1]=0;4652rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);4653if (rc) {4654printk(KERN_DEBUG "bttv%d: PXC200_muxsel: pic cfg write failed:%d\n", btv->c.nr,rc);4655/* not PXC ? do nothing */4656return;4657}46584659rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);4660if (!(rc & PX_CFG_PXC200F)) {4661printk(KERN_DEBUG "bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv->c.nr,rc);4662return;4663}466446654666/* The multiplexer in the 200F is handled by the GPIO port */4667/* get correct mapping between inputs */4668/* mux = bttv_tvcards[btv->type].muxsel[input] & 3; */4669/* ** not needed!? */4670mux = input;46714672/* make sure output pins are enabled */4673/* bitmask=0x30f; */4674bitmask=0x302;4675/* check whether we have a PXC200A */4676if (btv->cardid == PX_PXC200A_CARDID) {4677bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */4678bitmask |= 7<<4; /* the DAC */4679}4680btwrite(bitmask, BT848_GPIO_OUT_EN);46814682bitmask = btread(BT848_GPIO_DATA);4683if (btv->cardid == PX_PXC200A_CARDID)4684bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7);4685else /* older device */4686bitmask = (bitmask & ~0x300) | ((mux & 3) << 8);4687btwrite(bitmask,BT848_GPIO_DATA);46884689/*4690* Was "to be safe, set the bt848 to input 0"4691* Actually, since it's ok at load time, better not messing4692* with these bits (on PXC200AF you need to set mux 2 here)4693*4694* needed because bttv-driver sets mux before calling this function4695*/4696if (btv->cardid == PX_PXC200A_CARDID)4697btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM);4698else /* older device */4699btand(~BT848_IFORM_MUXSEL,BT848_IFORM);47004701printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux);4702}47034704static void phytec_muxsel(struct bttv *btv, unsigned int input)4705{4706unsigned int mux = input % 4;47074708if (input == btv->svhs)4709mux = 0;47104711gpio_bits(0x3, mux);4712}47134714/*4715* GeoVision GV-800(S) functions4716* Bruno Christo <[email protected]>4717*/47184719/* This is a function to control the analog switch, which determines which4720* camera is routed to which controller. The switch comprises an X-address4721* (gpio bits 0-3, representing the camera, ranging from 0-15), and a4722* Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).4723* A data value (gpio bit 18) of '1' enables the switch, and '0' disables4724* the switch. A STROBE bit (gpio bit 17) latches the data value into the4725* specified address. There is also a chip select (gpio bit 16).4726* The idea is to set the address and chip select together, bring4727* STROBE high, write the data, and finally bring STROBE back to low.4728*/4729static void gv800s_write(struct bttv *btv,4730unsigned char xaddr,4731unsigned char yaddr,4732unsigned char data) {4733/* On the "master" 878A:4734* GPIO bits 0-9 are used for the analog switch:4735* 00 - 03: camera selector4736* 04 - 06: 878A (controller) selector4737* 16: cselect4738* 17: strobe4739* 18: data (1->on, 0->off)4740* 19: reset4741*/4742const u32 ADDRESS = ((xaddr&0xf) | (yaddr&3)<<4);4743const u32 CSELECT = 1<<16;4744const u32 STROBE = 1<<17;4745const u32 DATA = data<<18;47464747gpio_bits(0x1007f, ADDRESS | CSELECT); /* write ADDRESS and CSELECT */4748gpio_bits(0x20000, STROBE); /* STROBE high */4749gpio_bits(0x40000, DATA); /* write DATA */4750gpio_bits(0x20000, ~STROBE); /* STROBE low */4751}47524753/*4754* GeoVision GV-800(S) muxsel4755*4756* Each of the 4 cards (controllers) use this function.4757* The controller using this function selects the input through the GPIO pins4758* of the "master" card. A pointer to this card is stored in master[btv->c.nr].4759*4760* The parameter 'input' is the requested camera number (0-4) on the controller.4761* The map array has the address of each input. Note that the addresses in the4762* array are in the sequence the original GeoVision driver uses, that is, set4763* every controller to input 0, then to input 1, 2, 3, repeat. This means that4764* the physical "camera 1" connector corresponds to controller 0 input 0,4765* "camera 2" corresponds to controller 1 input 0, and so on.4766*4767* After getting the input address, the function then writes the appropriate4768* data to the analog switch, and housekeeps the local copy of the switch4769* information.4770*/4771static void gv800s_muxsel(struct bttv *btv, unsigned int input)4772{4773struct bttv *mctlr;4774char *sw_status;4775int xaddr, yaddr;4776static unsigned int map[4][4] = { { 0x0, 0x4, 0xa, 0x6 },4777{ 0x1, 0x5, 0xb, 0x7 },4778{ 0x2, 0x8, 0xc, 0xe },4779{ 0x3, 0x9, 0xd, 0xf } };4780input = input%4;4781mctlr = master[btv->c.nr];4782if (mctlr == NULL) {4783/* do nothing until the "master" is detected */4784return;4785}4786yaddr = (btv->c.nr - mctlr->c.nr) & 3;4787sw_status = (char *)(&mctlr->mbox_we);4788xaddr = map[yaddr][input] & 0xf;47894790/* Check if the controller/camera pair has changed, ignore otherwise */4791if (sw_status[yaddr] != xaddr) {4792/* disable the old switch, enable the new one and save status */4793gv800s_write(mctlr, sw_status[yaddr], yaddr, 0);4794sw_status[yaddr] = xaddr;4795gv800s_write(mctlr, xaddr, yaddr, 1);4796}4797}47984799/* GeoVision GV-800(S) "master" chip init */4800static void gv800s_init(struct bttv *btv)4801{4802char *sw_status = (char *)(&btv->mbox_we);4803int ix;48044805gpio_inout(0xf107f, 0xf107f);4806gpio_write(1<<19); /* reset the analog MUX */4807gpio_write(0);48084809/* Preset camera 0 to the 4 controllers */4810for (ix = 0; ix < 4; ix++) {4811sw_status[ix] = ix;4812gv800s_write(btv, ix, ix, 1);4813}48144815/* Inputs on the "master" controller need this brightness fix */4816bttv_I2CWrite(btv, 0x18, 0x5, 0x90, 1);48174818if (btv->c.nr > BTTV_MAX-4)4819return;4820/*4821* Store the "master" controller pointer in the master4822* array for later use in the muxsel function.4823*/4824master[btv->c.nr] = btv;4825master[btv->c.nr+1] = btv;4826master[btv->c.nr+2] = btv;4827master[btv->c.nr+3] = btv;4828}48294830/* ----------------------------------------------------------------------- */4831/* motherboard chipset specific stuff */48324833void __init bttv_check_chipset(void)4834{4835int pcipci_fail = 0;4836struct pci_dev *dev = NULL;48374838if (pci_pci_problems & (PCIPCI_FAIL|PCIAGP_FAIL)) /* should check if target is AGP */4839pcipci_fail = 1;4840if (pci_pci_problems & (PCIPCI_TRITON|PCIPCI_NATOMA|PCIPCI_VIAETBF))4841triton1 = 1;4842if (pci_pci_problems & PCIPCI_VSFX)4843vsfx = 1;4844#ifdef PCIPCI_ALIMAGIK4845if (pci_pci_problems & PCIPCI_ALIMAGIK)4846latency = 0x0A;4847#endif484848494850/* print warnings about any quirks found */4851if (triton1)4852printk(KERN_INFO "bttv: Host bridge needs ETBF enabled.\n");4853if (vsfx)4854printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n");4855if (pcipci_fail) {4856printk(KERN_INFO "bttv: bttv and your chipset may not work "4857"together.\n");4858if (!no_overlay) {4859printk(KERN_INFO "bttv: overlay will be disabled.\n");4860no_overlay = 1;4861} else {4862printk(KERN_INFO "bttv: overlay forced. Use this "4863"option at your own risk.\n");4864}4865}4866if (UNSET != latency)4867printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency);4868while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,4869PCI_DEVICE_ID_INTEL_82441, dev))) {4870unsigned char b;4871pci_read_config_byte(dev, 0x53, &b);4872if (bttv_debug)4873printk(KERN_INFO "bttv: Host bridge: 82441FX Natoma, "4874"bufcon=0x%02x\n",b);4875}4876}48774878int __devinit bttv_handle_chipset(struct bttv *btv)4879{4880unsigned char command;48814882if (!triton1 && !vsfx && UNSET == latency)4883return 0;48844885if (bttv_verbose) {4886if (triton1)4887printk(KERN_INFO "bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->c.nr);4888if (vsfx && btv->id >= 878)4889printk(KERN_INFO "bttv%d: enabling VSFX\n",btv->c.nr);4890if (UNSET != latency)4891printk(KERN_INFO "bttv%d: setting pci timer to %d\n",4892btv->c.nr,latency);4893}48944895if (btv->id < 878) {4896/* bt848 (mis)uses a bit in the irq mask for etbf */4897if (triton1)4898btv->triton1 = BT848_INT_ETBF;4899} else {4900/* bt878 has a bit in the pci config space for it */4901pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command);4902if (triton1)4903command |= BT878_EN_TBFX;4904if (vsfx)4905command |= BT878_EN_VSFX;4906pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command);4907}4908if (UNSET != latency)4909pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency);4910return 0;4911}491249134914/*4915* Local variables:4916* c-basic-offset: 84917* End:4918*/491949204921