summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2003-03-09 01:52:15 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2003-03-09 01:52:15 +0000
commitf4c123e03e861f72bb5bc9c320daf2b709089106 (patch)
tree2c7d801a1eeb0105d3f97054120f6dbd78e0c2dc /sys
parent2949a9a65fb1e0c08b5478e097b240e3e6401119 (diff)
flag stereo channels as reversed. those rare people without swapped stereo
can use config -e to set flags to 0x0001. ok deraadt@ mickey@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/autri.c9
-rw-r--r--sys/dev/pci/autrivar.h3
2 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/pci/autri.c b/sys/dev/pci/autri.c
index edb3cc3b341..023f9bc327a 100644
--- a/sys/dev/pci/autri.c
+++ b/sys/dev/pci/autri.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autri.c,v 1.11 2002/11/29 04:59:59 fgsch Exp $ */
+/* $OpenBSD: autri.c,v 1.12 2003/03/09 01:52:14 tedu Exp $ */
/*
* Copyright (c) 2001 SOMEYA Yoshihiko and KUROSAWA Takahiro.
@@ -463,7 +463,9 @@ autri_reset_codec(sc_)
enum ac97_host_flags
autri_flags_codec(void *v)
{
- return (AC97_HOST_DONT_READ);
+ struct autri_codec_softc *sc = v;
+
+ return (sc->flags);
}
/*
@@ -557,6 +559,9 @@ autri_attach(parent, self, aux)
codec->host_if.read = autri_read_codec;
codec->host_if.write = autri_write_codec;
codec->host_if.flags = autri_flags_codec;
+ codec->flags = AC97_HOST_DONT_READ | AC97_HOST_SWAPPED_CHANNELS;
+ if (sc->sc_dev.dv_cfdata->cf_flags & 0x0001)
+ codec->flags &= ~AC97_HOST_SWAPPED_CHANNELS;
if ((r = ac97_attach(&codec->host_if)) != 0) {
printf("%s: can't attach codec (error 0x%X)\n",
diff --git a/sys/dev/pci/autrivar.h b/sys/dev/pci/autrivar.h
index f7f3aa3d2d2..d1e64507b7f 100644
--- a/sys/dev/pci/autrivar.h
+++ b/sys/dev/pci/autrivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: autrivar.h,v 1.2 2001/11/26 18:10:52 mickey Exp $ */
+/* $OpenBSD: autrivar.h,v 1.3 2003/03/09 01:52:14 tedu Exp $ */
/*
* Copyright (c) 2001 SOMEYA Yoshihiko and KUROSAWA Takahiro.
@@ -48,6 +48,7 @@ struct autri_codec_softc {
int status_addr;
struct ac97_host_if host_if;
struct ac97_codec_if *codec_if;
+ int flags;
};
struct autri_chstatus {