summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/ac97.c8
-rw-r--r--sys/dev/ic/ac97.h5
-rw-r--r--sys/dev/pci/auixp.c10
3 files changed, 18 insertions, 5 deletions
diff --git a/sys/dev/ic/ac97.c b/sys/dev/ic/ac97.c
index 5df196602fc..fa50522dd6f 100644
--- a/sys/dev/ic/ac97.c
+++ b/sys/dev/ic/ac97.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ac97.c,v 1.59 2005/12/28 14:36:25 fgsch Exp $ */
+/* $OpenBSD: ac97.c,v 1.60 2006/04/27 21:40:00 matthieu Exp $ */
/*
* Copyright (c) 1999, 2000 Constantine Sapuntzakis
@@ -1132,7 +1132,11 @@ ac97_alc655_init(struct ac97_softc *as)
u_int16_t misc;
ac97_read(as, AC97_AV_REG_MISC, &misc);
- misc |= AC97_AV_MISC_SPDIFEN;
+ if (as->host_flags & AC97_HOST_DONT_ENABLE_SPDIF) {
+ misc &= ~AC97_AV_MISC_SPDIFEN;
+ } else {
+ misc |= AC97_AV_MISC_SPDIFEN;
+ }
misc &= ~AC97_AV_MISC_VREFDIS;
ac97_write(as, AC97_AV_REG_MISC, misc);
diff --git a/sys/dev/ic/ac97.h b/sys/dev/ic/ac97.h
index dc7a6121d1b..4cd38c28d4c 100644
--- a/sys/dev/ic/ac97.h
+++ b/sys/dev/ic/ac97.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ac97.h,v 1.18 2005/06/06 21:12:44 mjc Exp $ */
+/* $OpenBSD: ac97.h,v 1.19 2006/04/27 21:40:00 matthieu Exp $ */
/*
* Copyright (c) 1999 Constantine Sapuntzakis
@@ -35,7 +35,8 @@ struct ac97_codec_if;
enum ac97_host_flags {
AC97_HOST_DONT_READ = 0x1,
AC97_HOST_DONT_READANY = 0x2,
- AC97_HOST_SWAPPED_CHANNELS = 0x4
+ AC97_HOST_SWAPPED_CHANNELS = 0x4,
+ AC97_HOST_DONT_ENABLE_SPDIF = 0x8
};
struct ac97_host_if {
diff --git a/sys/dev/pci/auixp.c b/sys/dev/pci/auixp.c
index 2ef6f5402ca..923f555b940 100644
--- a/sys/dev/pci/auixp.c
+++ b/sys/dev/pci/auixp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auixp.c,v 1.5 2006/04/13 15:48:45 brad Exp $ */
+/* $OpenBSD: auixp.c,v 1.6 2006/04/27 21:40:01 matthieu Exp $ */
/* $NetBSD: auixp.c,v 1.9 2005/06/27 21:13:09 thorpej Exp $ */
/*
@@ -1568,11 +1568,14 @@ auixp_autodetect_codecs(struct auixp_softc *sc)
{
bus_space_tag_t iot;
bus_space_handle_t ioh;
+ pcireg_t subdev;
struct auixp_codec *codec;
int timeout, codec_nr;
iot = sc->sc_iot;
ioh = sc->sc_ioh;
+ subdev = pci_conf_read(sc->sc_pct, sc->sc_tag, PCI_SUBSYS_ID_REG);
+
/* ATI IXP can have upto 3 codecs; mark all codecs as not existing */
sc->sc_codec_not_ready_bits = 0;
sc->sc_num_codecs = 0;
@@ -1613,6 +1616,11 @@ auixp_autodetect_codecs(struct auixp_softc *sc)
codec->host_if.write = auixp_write_codec;
codec->host_if.reset = auixp_reset_codec;
codec->host_if.flags = auixp_flags_codec;
+ switch (subdev) {
+ case 0x1311462: /* MSI S270 */
+ codec->codec_flags = AC97_HOST_DONT_ENABLE_SPDIF;
+ break;
+ }
}
if (!(sc->sc_codec_not_ready_bits & ATI_REG_ISR_CODEC0_NOT_READY)) {