diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-03-03 21:28:29 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-03-03 21:28:29 +0000 |
commit | a7df380cafb148d822f25f6ea8fac752987d7520 (patch) | |
tree | b5046bd2d9e7dcc16800f146ef01c50a328ff645 /sys | |
parent | 4ce01b3e3607c1f9dfbe8359bf16f596a9bd28a4 (diff) |
new AC97_HOST_DONT_READANY flag for ac97 chipsets that are _really_ on drugs
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/ac97.c | 37 | ||||
-rw-r--r-- | sys/dev/ic/ac97.h | 5 |
2 files changed, 23 insertions, 19 deletions
diff --git a/sys/dev/ic/ac97.c b/sys/dev/ic/ac97.c index aa7236a77a8..17b2b87a3fc 100644 --- a/sys/dev/ic/ac97.c +++ b/sys/dev/ic/ac97.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ac97.c,v 1.10 2000/07/27 16:34:45 deraadt Exp $ */ +/* $OpenBSD: ac97.c,v 1.11 2001/03/03 21:28:27 deraadt Exp $ */ /* * Copyright (c) 1999, 2000 Constantine Sapuntzakis @@ -387,9 +387,10 @@ ac97_read(as, reg, val) { int error; - if ((as->host_flags & AC97_HOST_DONT_READ) && + if (((as->host_flags & AC97_HOST_DONT_READ) && (reg != AC97_REG_VENDOR_ID1 && reg != AC97_REG_VENDOR_ID2 && - reg != AC97_REG_RESET)) { + reg != AC97_REG_RESET)) || + (as->host_flags & AC97_HOST_DONT_READANY)) { *val = as->shadow_reg[reg >> 1]; return; } @@ -585,21 +586,23 @@ ac97_attach(host_if) id = (id1 << 16) | id2; - printf("ac97: codec id 0x%8x", id); - for (i = 0; ac97codecid[i].id; i++) { - if (ac97codecid[i].id == id) - printf(" (%s)", ac97codecid[i].name); - } - printf("\nac97: codec features "); - for (i = j = 0; i < 10; i++) { - if (caps & (1 << i)) { - printf("%s%s", j? ", " : "", ac97feature[i]); - j++; + if (id) { + printf("ac97: codec id 0x%08x", id); + for (i = 0; ac97codecid[i].id; i++) { + if (ac97codecid[i].id == id) + printf(" (%s)", ac97codecid[i].name); } - } - - printf("%s%s\n", j? ", " : "", - ac97enhancement[(caps >> 10) & 0x1f]); + printf("\nac97: codec features "); + for (i = j = 0; i < 10; i++) { + if (caps & (1 << i)) { + printf("%s%s", j? ", " : "", ac97feature[i]); + j++; + } + } + printf("%s%s\n", j? ", " : "", + ac97enhancement[(caps >> 10) & 0x1f]); + } else + printf("ac97: codec id not read\n"); ac97_setup_source_info(as); diff --git a/sys/dev/ic/ac97.h b/sys/dev/ic/ac97.h index 7ece224573b..d1e4cba16f0 100644 --- a/sys/dev/ic/ac97.h +++ b/sys/dev/ic/ac97.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ac97.h,v 1.4 2000/07/19 09:01:35 csapuntz Exp $ */ +/* $OpenBSD: ac97.h,v 1.5 2001/03/03 21:28:28 deraadt Exp $ */ /* * Copyright (c) 1999 Constantine Sapuntzakis @@ -41,7 +41,8 @@ struct ac97_host_if { void (*reset)(void *arg); enum ac97_host_flags { - AC97_HOST_DONT_READ = 0x1 + AC97_HOST_DONT_READ = 0x1, + AC97_HOST_DONT_READANY = 0x2 }; enum ac97_host_flags (*flags)(void *arg); |