summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authortg <tg@FreeBSD.org>2002-02-05 12:09:23 +0000
committertg <tg@FreeBSD.org>2002-02-05 12:09:23 +0000
commit7d6571799b12fc8f4c0c4b80c5ec9903bc5542f0 (patch)
tree67aa56328ab6a3a8a239587441598d1d608882b2 /sys
parent6a18ede7cd38d3c8ddd08197fafced885dece4f3 (diff)
downloadFreeBSD-src-7d6571799b12fc8f4c0c4b80c5ec9903bc5542f0.zip
FreeBSD-src-7d6571799b12fc8f4c0c4b80c5ec9903bc5542f0.tar.gz
Add support for the Aztech 2320 chip.
Reviewed by: cg Obtained from: NetBSD (partly)
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/sound/isa/mss.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/sys/dev/sound/isa/mss.c b/sys/dev/sound/isa/mss.c
index 1bd07db..825be32 100644
--- a/sys/dev/sound/isa/mss.c
+++ b/sys/dev/sound/isa/mss.c
@@ -33,6 +33,7 @@ SND_DECLARE_FILE("$FreeBSD$");
/* board-specific include files */
#include <dev/sound/isa/mss.h>
+#include <dev/sound/isa/sb.h>
#include <dev/sound/chip.h>
#include "mixer_if.h"
@@ -1870,6 +1871,40 @@ DRIVER_MODULE(snd_mss, isa, mss_driver, pcm_devclass, 0, 0);
MODULE_DEPEND(snd_mss, snd_pcm, PCM_MINVER, PCM_PREFVER, PCM_MAXVER);
MODULE_VERSION(snd_mss, 1);
+static int
+azt2320_mss_mode(struct mss_info *mss, device_t dev)
+{
+ struct resource *sbport;
+ int i, ret, rid;
+
+ rid = 0;
+ ret = -1;
+ sbport = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid,
+ 0, ~0, 1, RF_ACTIVE);
+ if (sbport) {
+ for (i = 0; i < 1000; i++) {
+ if ((port_rd(sbport, SBDSP_STATUS) & 0x80))
+ DELAY((i > 100) ? 1000 : 10);
+ else {
+ port_wr(sbport, SBDSP_CMD, 0x09);
+ break;
+ }
+ }
+ for (i = 0; i < 1000; i++) {
+ if ((port_rd(sbport, SBDSP_STATUS) & 0x80))
+ DELAY((i > 100) ? 1000 : 10);
+ else {
+ port_wr(sbport, SBDSP_CMD, 0x00);
+ ret = 0;
+ break;
+ }
+ }
+ DELAY(1000);
+ bus_release_resource(dev, SYS_RES_IOPORT, rid, sbport);
+ }
+ return ret;
+}
+
static struct isa_pnp_id pnpmss_ids[] = {
{0x0000630e, "CS423x"}, /* CSC0000 */
{0x0001630e, "CS423x-PCI"}, /* CSC0100 */
@@ -1880,6 +1915,7 @@ static struct isa_pnp_id pnpmss_ids[] = {
{0x5092143e, "OPTi925"}, /* OPT9250 XXX guess */
{0x0000143e, "OPTi924"}, /* OPT0924 */
{0x1022b839, "Neomagic 256AV (non-ac97)"}, /* NMX2210 */
+ {0x01005407, "Aztech 2320"}, /* AZT0001 */
#if 0
{0x0000561e, "GusPnP"}, /* GRV0000 */
#endif
@@ -1959,6 +1995,15 @@ pnpmss_attach(device_t dev)
mss->io_rid = 1;
break;
+ case 0x01005407: /* AZT0001 */
+ /* put into MSS mode first (snatched from NetBSD) */
+ if (azt2320_mss_mode(mss, dev) == -1)
+ return ENXIO;
+
+ mss->bd_flags |= BD_F_MSS_OFFSET;
+ mss->io_rid = 2;
+ break;
+
#if 0
case 0x0000561e: /* GRV0000 */
mss->bd_flags |= BD_F_MSS_OFFSET;
OpenPOWER on IntegriCloud