Date: Sun, 22 Feb 2004 04:34:54 +0800 From: Autrijus Tang <autrijus@autrijus.org> To: freebsd-multimedia@freebsd.org Cc: chris@chrisburkert.de Subject: [PATCH] fix snd_ich support for Asus M2400N Message-ID: <1077395693.3133.7.camel@localhost> In-Reply-To: <1077357399.2405.4.camel@localhost> References: <1077357399.2405.4.camel@localhost>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
(This is a folllow-up to misc/61388)
Hi. Here is a patch against -CURRENT that fixes ich4 support for
pcm0: <SigmaTel STAC9750/51 AC97 Codec>. It works by backporting
the legacy support for NAMBAR/NABMBAR from 5.1-RELEASE, instead
of using the newer and broken MMBAR/MBBAR.
Before this patch, dmesg shows:
pcm0: unable to map IO port space
device_probe_and_attach: pcm0 attach returned 6
After this patch, it becomes:
pcm0: <Intel ICH4 (82801DB)> port 0xe100-0xe13f,0xe000-0xe0ff irq 5 at device 31.5 on pci0
pcm0: <SigmaTel STAC9750/51 AC97 Codec>
Thanks,
/Autrijus/
--- /usr/src/sys/dev/sound/pci/ich.orig Sat Feb 21 17:40:43 2004
+++ /usr/src/sys/dev/sound/pci/ich.c Sun Feb 22 04:21:29 2004
@@ -693,12 +693,23 @@
}
/*
+ * By default, ich4 has NAMBAR and NABMBAR i/o spaces as
+ * read-only. Need to enable "legacy support", by poking into
+ * pci config space. The driver should use MMBAR and MBBAR,
+ * but doing so will mess things up here. ich4 has enough new
+ * features it warrants it's own driver.
+ */
+ if (pci_get_devid(dev) == ICH4ID) {
+ pci_write_config(dev, PCIR_ICH_LEGACY, ICH_LEGACY_ENABLE, 1);
+ }
+
+ /*
* Enable bus master. On ich4/5 this may prevent the detection of
* the primary codec becoming ready in ich_init().
*/
pci_enable_busmaster(dev);
- if ((pci_get_devid(dev) == ICH4ID) || (pci_get_devid(dev) == ICH5ID)) {
+ if (pci_get_devid(dev) == ICH5ID) {
sc->nambarid = PCIR_MMBAR;
sc->nabmbarid = PCIR_MBBAR;
sc->regtype = SYS_RES_MEMORY;
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)
iD8DBQBAN8DttLPdNzw1AaARAnIwAJ9Yx1u4/tr95aOB0wMI4Kmf6O0K3wCgik9R
uMTl8d6tx3JlkEk2WxxpDd4=
=EUVs
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1077395693.3133.7.camel>
