ac97: pci id list

This commit is contained in:
cinap_lenrek 2011-05-19 17:21:55 +00:00
parent d2235d27ea
commit 334c58f95e

View file

@ -8,7 +8,6 @@
typedef struct Hwdesc Hwdesc; typedef struct Hwdesc Hwdesc;
typedef struct Ctlr Ctlr; typedef struct Ctlr Ctlr;
static uint sis7012 = 0;
enum { enum {
Ioc = 1<<31, Ioc = 1<<31,
@ -70,6 +69,7 @@ struct Ctlr {
int hardrate; int hardrate;
int attachok; int attachok;
int sis7012;
/* for probe */ /* for probe */
Pcidev *pcidev; Pcidev *pcidev;
@ -207,7 +207,7 @@ ac97interrupt(Ureg *, void *arg)
ilock(ctlr); ilock(ctlr);
if(stat & Point){ if(stat & Point){
if(sis7012) if(ctlr->sis7012)
csr16w(ctlr, Out + Picb, csr16r(ctlr, Out + Picb) & ~Dch); csr16w(ctlr, Out + Picb, csr16r(ctlr, Out + Picb) & ~Dch);
else else
csr16w(ctlr, Out + Sr, csr16r(ctlr, Out + Sr) & ~Dch); csr16w(ctlr, Out + Sr, csr16r(ctlr, Out + Sr) & ~Dch);
@ -428,51 +428,25 @@ ac97match(Pcidev *p)
{ {
/* not all of the matched devices have been tested */ /* not all of the matched devices have been tested */
while(p = pcimatch(p, 0, 0)) while(p = pcimatch(p, 0, 0))
switch(p->vid){ switch((p->vid<<16)|p->did){
default: case (0x1039<<16)|0x7012:
break; case (0x1022<<16)|0x746d:
case 0x1039: case (0x1022<<16)|0x7445:
switch(p->did){ case (0x10de<<16)|0x01b1:
default: case (0x10de<<16)|0x006a:
break; case (0x10de<<16)|0x00da:
case 0x7012: case (0x10de<<16)|0x00ea:
sis7012 = 1; case (0x8086<<16)|0x2415:
case (0x8086<<16)|0x2425:
case (0x8086<<16)|0x2445:
case (0x8086<<16)|0x2485:
case (0x8086<<16)|0x24c5:
case (0x8086<<16)|0x24d5:
case (0x8086<<16)|0x25a6:
case (0x8086<<16)|0x266e:
case (0x8086<<16)|0x7195:
return p; return p;
} }
case 0x1022:
switch(p->did){
default:
break;
case 0x746d:
case 0x7445:
return p;
}
case 0x10de:
switch(p->did){
default:
break;
case 0x01b1:
case 0x006a:
case 0x00da:
case 0x00ea:
return p;
}
case 0x8086:
switch(p->did){
default:
break;
case 0x2415:
case 0x2425:
case 0x2445:
case 0x2485:
case 0x24c5:
case 0x24d5:
case 0x25a6:
case 0x266e:
case 0x7195:
return p;
}
}
return nil; return nil;
} }
@ -519,6 +493,9 @@ Found:
ctlr->targetrate = 44100; ctlr->targetrate = 44100;
ctlr->hardrate = 44100; ctlr->hardrate = 44100;
if(p->vid == 0x1039 && p->did == 0x7012)
ctlr->sis7012 = 1;
if(p->mem[0].size == 64){ if(p->mem[0].size == 64){
ctlr->port = p->mem[0].bar & ~3; ctlr->port = p->mem[0].bar & ~3;
ctlr->mixport = p->mem[1].bar & ~3; ctlr->mixport = p->mem[1].bar & ~3;
@ -549,7 +526,7 @@ Found:
for(i = 0; i < Ndesc; i++){ for(i = 0; i < Ndesc; i++){
int size, off = i * (Bufsize/Ndesc); int size, off = i * (Bufsize/Ndesc);
if(sis7012) if(ctlr->sis7012)
size = (Bufsize/Ndesc); size = (Bufsize/Ndesc);
else else
size = (Bufsize/Ndesc) / 2; size = (Bufsize/Ndesc) / 2;