diff options
author | nate <nate@FreeBSD.org> | 1998-02-17 19:17:08 +0000 |
---|---|---|
committer | nate <nate@FreeBSD.org> | 1998-02-17 19:17:08 +0000 |
commit | 77f7d1058568bd70f67511976ce2c8693f5106e4 (patch) | |
tree | a22c393d65ae18da9b508b8658a78ddb2385385a /sys/dev/sound/isa/sb8.c | |
parent | d355ca7a628dffe4ffd363b4e1fe39172a6476c6 (diff) | |
download | FreeBSD-src-77f7d1058568bd70f67511976ce2c8693f5106e4.zip FreeBSD-src-77f7d1058568bd70f67511976ce2c8693f5106e4.tar.gz |
- Updated to Luigi's 2-15-98 code. The code in 2.2 is the same except for
select/poll and DEVFS changes, which are limited to an include/define
in sound.h and the actual select/poll implementation in sound.c
[ This commit is blind, but the code is similar enough that there will
hopefully be no problems. ]
Diffstat (limited to 'sys/dev/sound/isa/sb8.c')
-rw-r--r-- | sys/dev/sound/isa/sb8.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/dev/sound/isa/sb8.c b/sys/dev/sound/isa/sb8.c index 3d75aea..8af9908 100644 --- a/sys/dev/sound/isa/sb8.c +++ b/sys/dev/sound/isa/sb8.c @@ -208,6 +208,8 @@ sb_dsp_open(dev_t dev, int flags, int mode, struct proc * p) d->flags |= SND_F_NBIO ; sb_reset_dsp(d->io_base); + if (d->bd_flags & BD_F_ESS) + sb_cmd(d->io_base, 0xc6 ); /* enable extended ESS mode */ ask_init(d); return 0; @@ -420,6 +422,9 @@ sb_callback(snddev_info *d, int reason) sb_cmd3(d->io_base, c1 , l - 1) ; } else if (d->bd_flags & BD_F_ESS) { /* XXX this code is still incomplete */ + sb_cmd2(d->io_base, 0xb8, rd ? 4 : 0xe ) ; /* auto dma */ + sb_cmd2(d->io_base, 0xa8, d->flags & SND_F_STEREO ? 1 : 2) ; + sb_cmd2(d->io_base, 0xb9, 2) ; /* demand dma */ } else { /* SBPro -- stereo not supported */ u_char c ; if (!rd) @@ -429,6 +434,10 @@ sb_callback(snddev_info *d, int reason) c = (rd) ? 0x98 : 0x90 ; else c = (rd) ? 0x2c : 0x1c ; + if (d->flags & SND_F_STEREO) + sb_setmixer(d->io_base, 0xe, 2 ); + else + sb_setmixer(d->io_base, 0xe, 0 ); /* * some ESS extensions -- they can do 16 bits */ @@ -450,6 +459,8 @@ sb_callback(snddev_info *d, int reason) cmd = DSP_CMD_DMAPAUSE_16 ; if (d->bd_flags & BD_F_HISPEED) { sb_reset_dsp(d->io_base); + if (d->bd_flags & BD_F_ESS) + sb_cmd(d->io_base, 0xc6 ); /* enable extended ESS mode */ d->flags |= SND_F_INIT ; } else { sb_cmd(d->io_base, cmd); /* pause dma. */ @@ -481,7 +492,7 @@ sb_reset_dsp(int io_base) { int loopc; - outb(io_base + SBDSP_RST, 1); + outb(io_base + SBDSP_RST, 3); DELAY(100); outb(io_base + SBDSP_RST, 0); for (loopc = 0; loopc<100 && !(inb(DSP_DATA_AVAIL) & 0x80); loopc++) @@ -795,7 +806,9 @@ dsp_speed(snddev_info *d) * simultaneously using midi. * At the moment we do not support either... */ +#if 0 d->flags &= ~SND_F_STEREO; +#endif /* * here enforce speed limitations. |