--- linux-2.4.0-test1-ac10/drivers/char/bttv.c Wed Jun 7 20:30:03 2000 +++ linux/drivers/char/bttv.c Sat Jun 10 19:56:00 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; @@ -716,13 +716,16 @@ } cards[] __devinitdata = { { 0x00011002, BTTV_HAUPPAUGE878, "ATI TV Wonder" }, { 0x00011461, BTTV_AVPHONE98, "AVerMedia TVPhone98" }, + { 0x00021461, BTTV_AVERMEDIA98, "Avermedia TVCapture 98" }, { 0x00031461, BTTV_AVPHONE98, "AVerMedia TVPhone98" }, { 0x00041461, BTTV_AVPHONE98, "AVerMedia TVPhone98" }, { 0x10b42636, BTTV_HAUPPAUGE878, "STB ???" }, { 0x1118153b, BTTV_TERRATVALUE, "Terratec TV Value" }, { 0x1200bd11, BTTV_PINNACLERAVE, "Pinnacle PCTV Rave" }, { 0x13eb0070, BTTV_HAUPPAUGE878, "Hauppauge WinTV" }, +#if 0 /* probably wrong */ { 0x14610002, BTTV_AVERMEDIA98, "Avermedia TVCapture 98" }, +#endif { 0x18501851, BTTV_CHRONOS_VS2, "Chronos Video Shuttle II" }, { 0x18521852, BTTV_TYPHOON_TVIEW, "Typhoon TView TV/FM Tuner" }, { 0x263610b4, BTTV_STB2, "STB TV PCI FM, P/N 6000704" }, @@ -926,6 +929,9 @@ { "Sigma TVII-FM", 2, 1, 0, -1, 3, {2, 3, 1, 1}, {1, 1, 0, 2, 3},0, 0,0,0,0,0,0,0,0, PLL_NONE, -1 }, + { "MATRIX-Vision MV-Delta 2", + 5, 1, -1, 3, 0, { 2, 3, 1, 0, 0},{0 }, 0, + 0,0,0,0,0,0,0,0, PLL_28, -1 }, }; #define TVCARDS (sizeof(tvcards)/sizeof(struct tvcard)) @@ -966,12 +972,8 @@ if (n != -1) { /* found it */ - printk(KERN_INFO "bttv%d: id: %s (0x%08x)\n", - btv->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 */ @@ -3115,47 +3117,38 @@ 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) { @@ -3174,7 +3167,6 @@ if (btv->type == BTTV_PXC200) init_PXC200(btv); - /* pll configuration */ if (!(btv->id==848 && btv->revision==0x11)) { /* defaults from card list */ @@ -3202,7 +3194,7 @@ } } - + /* tuner configuration */ if (-1 != tvcards[btv->type].tuner_type) btv->tuner_type = tvcards[btv->type].tuner_type; --- linux-2.4.0-test1-ac10/drivers/char/bttv.h Wed Jun 7 23:26:35 2000 +++ linux/drivers/char/bttv.h Sat Jun 10 19:56:00 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,32) #ifndef PCI_GET_DRIVER_DATA # define PCI_GET_DRIVER_DATA(pdev) ((pdev)->driver_data) @@ -283,6 +283,7 @@ #define BTTV_PV951 0x2a #define BTTV_ONAIR_TV 0x2b #define BTTV_SIGMA_TVII_FM 0x2c +#define BTTV_MATRIX_VISION2 0x2d #define PLL_NONE 0 #define PLL_28 1 --- linux-2.4.0-test1-ac10/Documentation/video4linux/bttv/CARDLIST Wed Jun 7 20:30:00 2000 +++ linux/Documentation/video4linux/bttv/CARDLIST Sat Jun 10 19:56:00 2000 @@ -44,6 +44,7 @@ card=42 - ProVideo PV951 card=43 - Little OnAir TV card=44 - Sigma TVII-FM + card=45 - MATRIX-Vision MV-Delta 2 tuner.o type=0 - Temic PAL