⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bttv-cards.c

📁 一个2.4.21版本的嵌入式linux内核
💻 C
📖 第 1 页 / 共 5 页
字号:
		GPIO2:     HEF4052 nENABLE		GPIO3-7:   n.c.		GPIO8-13:  IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]		GPIO14,15: ??		GPIO16-21: n.c.		GPIO22,23: ??		??       : mtu8b56ep microcontroller for IR (GPIO wiring unknown)*/},{        /* Arthur Tetzlaff-Deas, DSP Design Ltd <software@dspdesign.com> */        .name           = "DSP Design TCVIDEO",        .video_inputs   = 4,        .svhs           = -1,        .muxsel         = { 2, 3, 1, 0},        .pll            = PLL_28,        .tuner_type     = -1,},{        /* ---- card 0x50 ---------------------------------- */	.name           = "Hauppauge WinTV PVR",        .video_inputs   = 4,        .audio_inputs   = 1,        .tuner          = 0,        .svhs           = 2,        .muxsel         = { 2, 0, 1, 1},        .needs_tvaudio  = 1,        .pll            = PLL_28,        .tuner_type     = -1,	.gpiomask       = 7,	.audiomux       = {7},},{	.name           = "GV-BCTV5/PCI",	.video_inputs   = 3,	.audio_inputs   = 1,	.tuner          = 0,	.svhs           = 2,	.gpiomask       = 0x010f00,	.muxsel         = {2, 3, 1, 0},	.audiomux       = {0x10000, 0, 0x10000, 0, 0, 0},	.no_msp34xx     = 1,	.pll            = PLL_28,	.tuner_type     = TUNER_PHILIPS_NTSC_M,	.audio_hook     = gvbctv3pci_audio,},{	.name           = "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */	.video_inputs   = 4,                  /* id-inputs-clock */	.audio_inputs   = 0,	.tuner          = -1,	.svhs           = 3,	.muxsel         = { 3, 2, 0, 1 },	.pll            = PLL_28,	.tuner_type     = -1,        .no_msp34xx     = 1,        .no_tda9875     = 1,        .no_tda7432     = 1,},{	.name           = "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */	.video_inputs   = 3,	.audio_inputs   = 0,	.tuner          = -1,	.svhs           = 2,	.muxsel         = { 2, 3, 1 },	.pll            = PLL_28,	.tuner_type     = -1,        .no_msp34xx     = 1,        .no_tda9875     = 1,        .no_tda7432     = 1,},{	/* ---- card 0x54 ---------------------------------- */	.name           = "Osprey 101 (848)", /* 0x05-40C0-C1 */	.video_inputs   = 2,	.audio_inputs   = 0,	.tuner          = -1,	.svhs           = 1,	.muxsel         = { 3, 1 },	.pll            = PLL_28,	.tuner_type     = -1,        .no_msp34xx     = 1,        .no_tda9875     = 1,        .no_tda7432     = 1,},{	.name           = "Osprey 101/151",       /* 0x1(4|5)-0004-C4 */	.video_inputs   = 1,	.audio_inputs   = 0,	.tuner          = -1,	.svhs           = -1,	.muxsel         = { 0 },	.pll            = PLL_28,	.tuner_type     = -1,        .no_msp34xx     = 1,        .no_tda9875     = 1,        .no_tda7432     = 1,},{	.name           = "Osprey 101/151 w/ svid",  /* 0x(16|17|20)-00C4-C1 */	.video_inputs   = 2,	.audio_inputs   = 0,	.tuner          = -1,	.svhs           = 1,	.muxsel         = { 0, 1 },	.pll            = PLL_28,	.tuner_type     = -1,        .no_msp34xx     = 1,        .no_tda9875     = 1,        .no_tda7432     = 1,},{	.name           = "Osprey 200/201/250/251",  /* 0x1(8|9|E|F)-0004-C4 */	.video_inputs   = 1,	.audio_inputs   = 1,	.tuner          = -1,	.svhs           = -1,	.muxsel         = { 0 },	.pll            = PLL_28,	.tuner_type     = -1,        .no_msp34xx     = 1,        .no_tda9875     = 1,        .no_tda7432     = 1,},{		/* ---- card 0x58 ---------------------------------- */	.name           = "Osprey 200/250",   /* 0x1(A|B)-00C4-C1 */	.video_inputs   = 2,	.audio_inputs   = 1,	.tuner          = -1,	.svhs           = 1,	.muxsel         = { 0, 1 },	.pll            = PLL_28,	.tuner_type     = -1,        .no_msp34xx     = 1,        .no_tda9875     = 1,        .no_tda7432     = 1,},{	.name           = "Osprey 210/220",   /* 0x1(A|B)-04C0-C1 */	.video_inputs   = 2,	.audio_inputs   = 1,	.tuner          = -1,	.svhs           = 1,	.muxsel         = { 2, 3 },	.pll            = PLL_28,	.tuner_type     = -1,        .no_msp34xx     = 1,        .no_tda9875     = 1,        .no_tda7432     = 1,},{	.name           = "Osprey 500",   /* 500 */	.video_inputs   = 2,	.audio_inputs   = 1,	.tuner          = -1,	.svhs           = 1,	.muxsel         = { 2, 3 },	.pll            = PLL_28,	.tuner_type     = -1,        .no_msp34xx     = 1,        .no_tda9875     = 1,        .no_tda7432     = 1,},{       .name           = "Osprey 540",   /* 540 */       .video_inputs   = 4,       .audio_inputs   = 1,       .tuner          = -1,#if 0 /* TODO ... */       .svhs           = OSPREY540_SVID_ANALOG,       .muxsel         = {       [OSPREY540_COMP_ANALOG] = 2,                               [OSPREY540_SVID_ANALOG] = 3, },#endif       .pll            = PLL_28,       .tuner_type     = -1,       .no_msp34xx     = 1,       .no_tda9875     = 1,       .no_tda7432     = 1,#if 0 /* TODO ... */       .muxsel_hook    = osprey_540_muxsel,       .picture_hook   = osprey_540_set_picture,#endif},{	/* ---- card 0x5C ---------------------------------- */	.name           = "Osprey 2000",  /* 2000 */	.video_inputs   = 2,	.audio_inputs   = 1,	.tuner          = -1,	.svhs           = 1,	.muxsel         = { 2, 3 },	.pll            = PLL_28,	.tuner_type     = -1,        .no_msp34xx     = 1,        .no_tda9875     = 1,        .no_tda7432     = 1,      /* must avoid, conflicts with the bt860 */},{	/* M G Berberich <berberic@forwiss.uni-passau.de> */	.name           = "IDS Eagle",	.video_inputs   = 4,	.audio_inputs   = 0,	.tuner          = -1,	.tuner_type     = -1,	.svhs           = -1,	.gpiomask       = 0,	.muxsel         = { 0, 1, 2, 3 },	.muxsel_hook    = eagle_muxsel,	.no_msp34xx     = 1,	.no_tda9875     = 1,	.pll            = PLL_28,},{	.name           = "Pinnacle PCTV Sat",	.video_inputs   = 2,	.audio_inputs   = 0,	.svhs           = 1,	.tuner          = -1,	.tuner_type     = -1,	.no_msp34xx     = 1,	.no_tda9875     = 1,	.no_tda7432     = 1,   	.muxsel         = { 3, 0, 1, 2},	.needs_tvaudio  = 0, 	.pll            = PLL_28,},{        .name           = "Formac ProTV II",        .video_inputs   = 4,        .audio_inputs   = 1,        .tuner          = 0,        .svhs           = 3,        .gpiomask       = 2,	// TV, Comp1, Composite over SVID con, SVID        .muxsel         = { 2, 3, 1, 1},        .audiomux       = { 2, 2, 0, 0, 0 },         .pll            = PLL_28,	.has_radio      = 1,        .tuner_type     = TUNER_PHILIPS_PAL,      /* sound routing:           GPIO=0x00,0x01,0x03: mute (?)              0x02: both TV and radio (tuner: FM1216/I)         The card has onboard audio connectors labeled "cdrom" and "board",	 not soldered here, though unknown wiring.         Card lacks: external audio in, pci subsystem id.       */},{	/* ---- card 0x60 ---------------------------------- */	.name           = "MachTV",        .video_inputs   = 3,        .audio_inputs   = 1,        .tuner          = 0,        .svhs           = -1,        .gpiomask       = 7,        .muxsel         = { 2, 3, 1, 1},        .audiomux       = { 0, 1, 2, 3, 4},        .needs_tvaudio  = 1,        .tuner_type     = 5,	.pll            = 1,},{	.name           = "Euresys Picolo",	.video_inputs   = 3,	.audio_inputs   = 0,	.tuner          = -1,	.svhs           = 2,	.gpiomask       = 0,	.no_msp34xx     = 1,	.no_tda9875     = 1,	.no_tda7432     = 1,	.muxsel         = { 2, 0, 1},	.pll            = PLL_28,},{	/* Luc Van Hoeylandt <luc@e-magic.be> */	.name           = "ProVideo PV150", /* 0x4f */	.video_inputs   = 2,	.audio_inputs   = 0,	.tuner          = -1,	.svhs           = -1,	.gpiomask       = 0,	.muxsel         = { 2, 3 },	.audiomux       = { 0 },	.needs_tvaudio  = 0,	.no_msp34xx     = 1,	.pll            = PLL_28,	.tuner_type     = -1,},{	/* Hiroshi Takekawa <sian@big.or.jp> */	/* This card lacks subsystem ID */	.name           = "AD-TVK503", /* 0x63 */	.video_inputs   = 4,	.audio_inputs   = 1,	.tuner          = 0,	.svhs           = 2,	.gpiomask       = 0x001e8007,	.muxsel         = { 2, 3, 1, 0 },                         /* Tuner,      Radio, external, internal, mute, stereo */	.audiomux       = { 0x00060000, 0x000, 0x000000, 0x000000, 0x07, 0x0000 }, /* Sub: 0x00180000 */	.needs_tvaudio  = 0,	.no_msp34xx     = 1,	.pll            = PLL_28,	.tuner_type     = 2,	.audio_hook	= adtvk503_audio,}};const unsigned int bttv_num_tvcards =	(sizeof(bttv_tvcards)/sizeof(bttv_tvcards[0]));/* ----------------------------------------------------------------------- */static unsigned char eeprom_data[256];/* * identify card */void __devinit bttv_idcard(struct bttv *btv){	unsigned int gpiobits;	int i,type;	unsigned short tmp;	/* read PCI subsystem ID */	pci_read_config_word(btv->dev, PCI_SUBSYSTEM_ID, &tmp);	btv->cardid = tmp << 16;	pci_read_config_word(btv->dev, PCI_SUBSYSTEM_VENDOR_ID, &tmp);	btv->cardid |= tmp;	if (0 != btv->cardid && 0xffffffff != btv->cardid) {		/* look for the card */		for (type = -1, i = 0; cards[i].id != 0; i++)			if (cards[i].id  == btv->cardid)				type = i;				if (type != -1) {			/* found it */			printk(KERN_INFO "bttv%d: detected: %s [card=%d], "			       "PCI subsystem ID is %04x:%04x\n",			       btv->nr,cards[type].name,cards[type].cardnr,			       btv->cardid & 0xffff, btv->cardid >> 16);			btv->type = cards[type].cardnr;		} else {			/* 404 */			printk(KERN_INFO "bttv%d: subsystem: %04x:%04x (UNKNOWN)\n",			       btv->nr, btv->cardid&0xffff, btv->cardid>>16);			printk(KERN_DEBUG "please mail id, board name and "			       "the correct card= insmod option to kraxel@bytesex.org\n");		}	} 	/* let the user override the autodetected type */	if (card[btv->nr] < bttv_num_tvcards)		btv->type=card[btv->nr];		/* print which card config we are using */	sprintf(btv->video_dev.name,"BT%d%s(%.23s)",		btv->id,		(btv->id==848 && btv->revision==0x12) ? "A" : "",		bttv_tvcards[btv->type].name);	printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->nr,	       btv->video_dev.name,btv->type,	       card[btv->nr] < bttv_num_tvcards	       ? "insmod option" : "autodetected");	/* overwrite gpio stuff ?? */	if (UNSET == audioall && UNSET == audiomux[0])		return;	if (UNSET != audiomux[0]) {		gpiobits = 0;		for (i = 0; i < 5; i++) {			bttv_tvcards[btv->type].audiomux[i] = audiomux[i];			gpiobits |= audiomux[i];		}	} else {		gpiobits = audioall;		for (i = 0; i < 5; i++) {			bttv_tvcards[btv->type].audiomux[i] = audioall;		}	}	bttv_tvcards[btv->type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;	printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",	       btv->nr,bttv_tvcards[btv->type].gpiomask);	for (i = 0; i < 5; i++) {		printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->type].audiomux[i]);	}	printk("\n");}/* * (most) board specific initialisations goes here *//* Some Modular Technology cards have an eeprom, but no subsystem ID */void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256]){	int type = -1;		if (0 == strncmp(eeprom_data,"GET.MM20xPCTV",13))		type = BTTV_MODTEC_205;	else if (0 == strncmp(eeprom_data+20,"Picolo",7))		type = BTTV_EURESYS_PICOLO;	else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)                type = BTTV_HAUPPAUGE; /* old bt848 */	if (-1 != type) {		btv->type = type;		printk("bttv%d: detected by eeprom: %s [card=%d]\n",		       btv->nr, bttv_tvcards[btv->type].name, btv->type);	}}static void flyvideo_gpio(struct bttv *btv){ 	int gpio,outbits,has_remote,has_radio,is_capture_only,is_lr90,has_tda9820_tda9821;	int tuner=-1,ttype;		outbits = btread(BT848_GPIO_OUT_EN);	btwrite(0x00, BT848_GPIO_OUT_EN);	udelay(8);  // without this we would see the 0x1800 mask	gpio=btread(BT848_GPIO_DATA);	btwrite(outbits, BT848_GPIO_OUT_EN);	// all cards provide GPIO info, some have an additional eeprom	// LR50: GPIO coding can be found lower right CP1 .. CP9	//       CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.	//       GPIO14-12: n.c.	// LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878)		// lowest 3 bytes are remote control codes (no handshake needed)        // xxxFFF: No remote control chip soldered        // xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered 	// Note: Some bits are Audio_Mask !	ttype=(gpio&0x0f0000)>>16;	switch(ttype) {	case 0x0: tuner=2; // NTSC, e.g. TPI8NSR11P		break;        case 0x2: tuner=39;// LG NTSC (newer TAPC series) TAPC-H701P		break;	case 0x4: tuner=5; // Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216		break;	case 0x6: tuner=37; // LG PAL (newer TAPC series) TAPC-G702P		break;	case 0xC: tuner=3; // Philips SECAM(+PAL) FQ1216ME or FI1216MF		break;	default:		printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->nr);	}	has_remote          =   gpio & 0x800000;	has_radio	    =   gpio & 0x400000;	//   unknown                   0x200000;	//   unknown2                  0x100000;        is_capture_only     = !(gpio & 0x008000); //GPIO15	has_tda9820_tda9821 = !(gpio & 0x004000);	is_lr90             = !(gpio & 0x002000); // else LR26/LR50 (LR38/LR51 f. capture only)        //		        gpio & 0x001000 // output bit for audio routing

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -