please review snd_ich patch

Mathew Kanner mat at cnd.mcgill.ca
Mon Mar 29 15:32:39 PST 2004


Hello All,
	I'm going to commit a patch by Autrijus Tang
<autrijus at autrijus.org> that fixes snd_ich for him.  I've asked for
comments from the list and haven't really heard much so I thought I
would try a second time.
	So.

	I'm going to commit the following patch tommorow, please let
me know if it doesn't work for you.

	--Mat

	
-- 
	The state has no business in the bedrooms of the
	nation.
			- Pierre Elliott Trudeau
-------------- next part --------------
Index: sys/dev/sound/pci/ich.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/sound/pci/ich.c,v
retrieving revision 1.39
diff -u -r1.39 ich.c
--- sys/dev/sound/pci/ich.c	17 Mar 2004 17:50:44 -0000	1.39
+++ sys/dev/sound/pci/ich.c	28 Mar 2004 14:14:57 -0000
@@ -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;


More information about the freebsd-multimedia mailing list