Skip site navigation (1)Skip section navigation (2)
Date:      02 Dec 1999 11:20:08 +0100
From:      Thomas Gellekum <tg@melaten.rwth-aachen.de>
To:        freebsd-multimedia@freebsd.org
Subject:   Aztech 2320 soundcard
Message-ID:  <kqk8mxk5k7.fsf@cip12.melaten.rwth-aachen.de>

next in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
The attached patch adds some support for soundcards based on Aztech's
2320. The method for switching the device into MSS mode was taken from
NetBSD. The diff is relative to -stable.

tg


[-- Attachment #2 --]
Index: ad1848.c
===================================================================
RCS file: /usr/cvs/src/sys/i386/isa/snd/Attic/ad1848.c,v
retrieving revision 1.20.2.1
diff -u -r1.20.2.1 ad1848.c
--- ad1848.c	1999/05/10 12:31:53	1.20.2.1
+++ ad1848.c	1999/12/01 17:03:09
@@ -47,6 +47,7 @@
  * board-specific include files
  */
 
+#include <i386/isa/snd/sbcard.h>
 #include <i386/isa/snd/mss.h>
 
 /*
@@ -1424,6 +1425,76 @@
  */
 
 #if NPNP > 0
+
+static char *azt2320_probe(u_long csn, u_long vend_id);
+static void
+azt2320_attach(u_long csn, u_long vend_id, char *name,
+	struct isa_device *dev);
+
+static struct pnp_device azt2320 = {
+  	"AZT2320",
+	azt2320_probe,
+	azt2320_attach,
+	&nsnd,
+	&tty_imask
+};
+DATA_SET(pnpdevice_set, azt2320);
+
+static char *
+azt2320_probe(u_long csn, u_long vend_id)
+{
+    if (vend_id == 0x20235407) {
+        struct pnp_cinfo d;
+	read_pnp_parms(&d, 1);
+	if (d.enable == 0) {
+	    printf("This is an AZT2320, but LDN 1 is disabled\n");
+	    return NULL;
+	}
+	return "Aztech 2320";
+    }
+    return NULL;
+}
+
+static void
+azt2320_attach(u_long csn, u_long vend_id, char *name,
+	struct isa_device *dev)
+{
+    struct pnp_cinfo d;
+    snddev_info tmp_d;
+
+    if (read_pnp_parms(&d, 1) == 0) {
+        printf("failed to read pnp parms\n");
+	return;
+    }
+    write_pnp_parms(&d, 1);
+    enable_pnp_card();
+
+    snddev_last_probed = &tmp_d;
+    if (vend_id == 0x20235407) {
+	tmp_d = mss_op_desc;
+
+	/*  put into WSS mode (snatched from NetBSD) */
+	while (inb(d.port[0] + SBDSP_STATUS) & 0x80)
+		;
+	outb(d.port[0] + SBDSP_CMD, 0x09);
+	while (inb(d.port[0] + SBDSP_STATUS) & 0x80)
+		;
+	outb(d.port[0] + SBDSP_CMD, 0x00);
+	DELAY(1000);
+
+	/* now fill in the device info */
+	dev->id_iobase = d.port[2] - 4;
+	tmp_d.io_base = dev->id_iobase;
+	tmp_d.alt_base = d.port[0];	/* soundblaster comp. but we don't
+					 * use that */
+	tmp_d.synth_base = d.port[1];
+	strcpy(tmp_d.name, name);
+	dev->id_drq = d.drq[0];
+	dev->id_irq = (1 << d.irq[0] );
+	dev->id_intr = pcmintr;
+	pcmattach(dev);
+    }
+}
 
 static char * cs423x_probe(u_long csn, u_long vend_id);
 static void 

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?kqk8mxk5k7.fsf>