--- linux-2.4.0-test1-ac10/drivers/char/bt848.h Sun Aug 23 22:32:25 1998 +++ linux/drivers/char/bt848.h Sat Jun 17 16:32:48 2000 @@ -336,7 +336,7 @@ -/* Bt848A and Bt849 only !! */ +/* Bt848A and higher only !! */ #define BT848_TGLB 0x080 #define BT848_TGCTRL 0x084 #define BT848_FCAP 0x0E8 --- linux-2.4.0-test1-ac10/drivers/char/bttv.c Wed Jun 7 20:30:03 2000 +++ linux/drivers/char/bttv.c Sat Jun 17 16:32:48 2000 @@ -92,7 +92,7 @@ #endif static int triton1=0; static unsigned int radio[BTTV_MAX]; -static unsigned int card[BTTV_MAX] = { 0, 0, 0, 0 }; +static unsigned int card[BTTV_MAX] = { -1, -1, -1, -1 }; static unsigned int pll[BTTV_MAX] = { -1, -1, -1, -1}; static unsigned int fieldnr = 0; static unsigned int verbose = 1; @@ -286,7 +286,7 @@ void * mem; unsigned long adr, page; - mem=vmalloc(size); + mem=vmalloc_32(size); if (mem) { memset(mem, 0, size); /* Clear the ram out, no junk to the user */ @@ -659,7 +659,8 @@ } -/* Imagenation L-Model PXC200 Framegrabber */ +/* ----------------------------------------------------------------------- */ +/* Imagenation L-Model PXC200 Framegrabber */ /* This is basically the same procedure as * used by Alessandro Rubini in his pxc200 * driver, but using BTTV functions */ @@ -670,7 +671,7 @@ 0x00 }; int i,tmp; - /* Initialise GPIO-connevted stuff */ + /* Initialise GPIO-connevted stuff */ btwrite(1<<13,BT848_GPIO_OUT_EN); /* Reset pin only */ btwrite(0,BT848_GPIO_DATA); udelay(3); @@ -708,6 +709,134 @@ } /* ----------------------------------------------------------------------- */ +/* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */ +/* + * Copyright (c) 1999 Csaba Halasz + * This code is placed under the terms of the GNU General Public License + * + * Brutally hacked by Dan Sheridan djs52 8/3/00 + */ + +/* bus bits on the GPIO port */ +#define TEA_WE 6 +#define TEA_DATA 9 +#define TEA_CLK 8 +#define TEA_MOST 7 + +#define BUS_LOW(bit) btand(~(1<> TEA_##bit) & 1) + +/* TEA5757 register bits */ +#define TEA_FREQ 0:14 +#define TEA_BUFFER 15:15 + +#define TEA_SIGNAL_STRENGTH 16:17 + +#define TEA_PORT1 18:18 +#define TEA_PORT0 19:19 + +#define TEA_BAND 20:21 +#define TEA_BAND_FM 0 +#define TEA_BAND_MW 1 +#define TEA_BAND_LW 2 +#define TEA_BAND_SW 3 + +#define TEA_MONO 22:22 +#define TEA_ALLOW_STEREO 0 +#define TEA_FORCE_MONO 1 + +#define TEA_SEARCH_DIRECTION 23:23 +#define TEA_SEARCH_DOWN 0 +#define TEA_SEARCH_UP 1 + +#define TEA_STATUS 24:24 +#define TEA_STATUS_TUNED 0 +#define TEA_STATUS_SEARCHING 1 + +/* Low-level stuff */ +int tea_read(struct bttv *btv) +{ + int value = 0; + long timeout; + int i; + + /* better safe than sorry */ + btaor((1<nr,cards[n].name,id); - if (verbose) - printk(KERN_INFO "bttv%d: => card=%d (%s)\n", - btv->nr,cards[n].cardnr, - tvcards[cards[n].cardnr].name); + printk(KERN_INFO "bttv%d: card id: %s (0x%08x) => card=%d\n", + btv->nr,cards[n].name,id,cards[n].cardnr); return cards[n].cardnr; } else { /* 404 */ @@ -2020,7 +2161,7 @@ /* * Open a bttv card. Right now the flags stuff is just playing */ - + static int bttv_open(struct video_device *dev, int flags) { struct bttv *btv = (struct bttv *)dev; @@ -2477,6 +2618,8 @@ return -EFAULT; btv->win.freq=v; call_i2c_clients(btv,cmd,&v); + if (btv->type == BTTV_MIROPRO && btv->radio) + tea5757_set_freq(btv,v); return 0; } @@ -3115,52 +3258,48 @@ btwrite(0, BT848_GPIO_OUT_EN); - /* Default the card to the user-selected one. */ - if (card[btv->nr] >= 0 && card[btv->nr] < TVCARDS) - btv->type=card[btv->nr]; - - /* If we were asked to auto-detect, then do so! */ - if (btv->type == BTTV_UNKNOWN) { - - /* many bt878 cards have a eeprom @ 0xa0 => read ID - and try to identify it */ - if (I2CRead(btv, I2C_HAUPEE, "eeprom") >= 0) { - eeprom = 0xa0; - readee(btv,eeprom_data,0xa0); - dump_eeprom(btv,0xa0); /* DEBUG */ - type = idcard_eeprom(btv); - if (-1 != type) { - btv->type = type; - } else if (btv->id <= 849) { - /* for unknown bt848, assume old Hauppauge */ - btv->type=BTTV_HAUPPAUGE; - } - - /* STB cards have a eeprom @ 0xae (old bt848) */ - } else if (I2CRead(btv, I2C_STBEE, "eeprom")>=0) { - btv->type=BTTV_STB; + /* try to autodetect the card */ + /* many bt878 cards have a eeprom @ 0xa0 => read ID + and try to identify it */ + if (I2CRead(btv, I2C_HAUPEE, "eeprom") >= 0) { + eeprom = 0xa0; + readee(btv,eeprom_data,0xa0); + dump_eeprom(btv,0xa0); /* DEBUG */ + type = idcard_eeprom(btv); + if (-1 != type) { + btv->type = type; + } else if (btv->id <= 849) { + /* for unknown bt848, assume old Hauppauge */ + btv->type=BTTV_HAUPPAUGE; } - -#if 0 - /* check for msp34xx */ - if (I2CRead(btv, 0x80, "msp3400")>=0) - btv->type = BTTV_MIROPRO; - else - btv->type = BTTV_MIRO; -#endif + + /* STB cards have a eeprom @ 0xae (old bt848) */ + } else if (I2CRead(btv, I2C_STBEE, "eeprom")>=0) { + btv->type=BTTV_STB; } - /* print which board we have found */ - sprintf(btv->video_dev.name,"BT%d%s(%.22s)", + /* let the user override the autodetected type */ + if (card[btv->nr] >= 0 && card[btv->nr] < 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" : "", tvcards[btv->type].name); - printk(KERN_INFO "bttv%d: model: %s\n",btv->nr,btv->video_dev.name); + printk(KERN_INFO "bttv%d: model: %s [%s]\n",btv->nr,btv->video_dev.name, + (card[btv->nr] >= 0 && card[btv->nr] < TVCARDS) ? + "insmod option" : "autodetected"); /* board specific initialisations */ if (btv->type == BTTV_MIRO || btv->type == BTTV_MIROPRO) { /* auto detect tuner for MIRO cards */ btv->tuner_type=((btread(BT848_GPIO_DATA)>>10)-1)&7; + if (btv->type == BTTV_MIROPRO) { + if (verbose) + printk(KERN_INFO "Initializing TEA5757...\n"); + init_tea5757(btv); + } } if (btv->type == BTTV_HAUPPAUGE || btv->type == BTTV_HAUPPAUGE878) { /* pick up some config infos from the eeprom */ @@ -3174,7 +3313,6 @@ if (btv->type == BTTV_PXC200) init_PXC200(btv); - /* pll configuration */ if (!(btv->id==848 && btv->revision==0x11)) { /* defaults from card list */ @@ -3202,7 +3340,7 @@ } } - + /* tuner configuration */ if (-1 != tvcards[btv->type].tuner_type) btv->tuner_type = tvcards[btv->type].tuner_type; @@ -3466,7 +3604,7 @@ btv->bus_vbi_even=virt_to_bus(btv->risc_jmp+6); btwrite(virt_to_bus(btv->risc_jmp+2), BT848_RISC_STRT_ADD); - btv->vbibuf=(unsigned char *) vmalloc(VBIBUF_SIZE); + btv->vbibuf=(unsigned char *) vmalloc_32(VBIBUF_SIZE); if (!btv->vbibuf) return -1; if (!(btv->gbuf = kmalloc(sizeof(struct bttv_gbuf)*gbuffers,GFP_KERNEL))) --- linux-2.4.0-test1-ac10/drivers/char/bttv.h Wed Jun 7 23:26:35 2000 +++ linux/drivers/char/bttv.h Sat Jun 17 16:32:48 2000 @@ -21,7 +21,7 @@ #ifndef _BTTV_H_ #define _BTTV_H_ -#define BTTV_VERSION_CODE KERNEL_VERSION(0,7,31) +#define BTTV_VERSION_CODE KERNEL_VERSION(0,7,33) #ifndef PCI_GET_DRIVER_DATA # define PCI_GET_DRIVER_DATA(pdev) ((pdev)->driver_data) @@ -283,6 +283,9 @@ #define BTTV_PV951 0x2a #define BTTV_ONAIR_TV 0x2b #define BTTV_SIGMA_TVII_FM 0x2c +#define BTTV_MATRIX_VISION2 0x2d +#define BTTV_ZOLTRIX_GENIE 0x2e +#define BTTV_TERRATVRADIO 0x2f #define PLL_NONE 0 #define PLL_28 1 @@ -306,7 +309,7 @@ #define I2C_TDA7432 0x8a #define I2C_TDA8425 0x82 #define I2C_TDA9840 0x84 -#define I2C_TDA9850 0xb6 +#define I2C_TDA9850 0xb6 /* also used by 9855,9873 */ #define I2C_TDA9875 0xb0 #define I2C_HAUPEE 0xa0 #define I2C_STBEE 0xae --- linux-2.4.0-test1-ac10/Documentation/video4linux/bttv/CARDLIST Wed Jun 7 20:30:00 2000 +++ linux/Documentation/video4linux/bttv/CARDLIST Sat Jun 17 16:32:49 2000 @@ -44,6 +44,9 @@ card=42 - ProVideo PV951 card=43 - Little OnAir TV card=44 - Sigma TVII-FM + card=45 - MATRIX-Vision MV-Delta 2 + card=46 - Zoltrix Genie TV + card=47 - Terratec TV/Radio+ tuner.o type=0 - Temic PAL