summaryrefslogtreecommitdiffstats
path: root/sys/dev/isa/gus.c
diff options
context:
space:
mode:
authorratchov <ratchov@openbsd.org>2015-05-11 06:46:21 +0000
committerratchov <ratchov@openbsd.org>2015-05-11 06:46:21 +0000
commitac2bb4f35e5a57326fc135134dc640899d0b5bd0 (patch)
tree1e63826ec7e7e40856b73e4c184d951aa1cec1ea /sys/dev/isa/gus.c
parentWhoops, need to pass through O_ACCMODE flags to the underlying __*_open() (diff)
downloadwireguard-openbsd-ac2bb4f35e5a57326fc135134dc640899d0b5bd0.tar.xz
wireguard-openbsd-ac2bb4f35e5a57326fc135134dc640899d0b5bd0.zip
Remove all audio format conversion code from the kernel (btw holding
the kernel_lock), as we already do better conversions in user-mode. Yet, no need for every single driver to fiddle with the conversion code as they are done transparently by common MI code. With help from armani and miod, support from mpi ok armani@
Diffstat (limited to 'sys/dev/isa/gus.c')
-rw-r--r--sys/dev/isa/gus.c53
1 files changed, 4 insertions, 49 deletions
diff --git a/sys/dev/isa/gus.c b/sys/dev/isa/gus.c
index ea3abdfc068..cc16c8ca3b1 100644
--- a/sys/dev/isa/gus.c
+++ b/sys/dev/isa/gus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gus.c,v 1.41 2014/09/14 14:17:25 jsg Exp $ */
+/* $OpenBSD: gus.c,v 1.42 2015/05/11 06:46:21 ratchov Exp $ */
/* $NetBSD: gus.c,v 1.51 1998/01/25 23:48:06 mycroft Exp $ */
/*-
@@ -106,8 +106,6 @@
#include <machine/cpufunc.h>
#include <sys/audioio.h>
#include <dev/audio_if.h>
-#include <dev/mulaw.h>
-#include <dev/auconv.h>
#include <dev/isa/isavar.h>
#include <dev/isa/isadmavar.h>
@@ -1485,12 +1483,8 @@ gus_set_params(void *addr, int setmode, int usemode, struct audio_params *p,
struct gus_softc *sc = addr;
switch (p->encoding) {
- case AUDIO_ENCODING_ULAW:
- case AUDIO_ENCODING_ALAW:
case AUDIO_ENCODING_SLINEAR_LE:
case AUDIO_ENCODING_ULINEAR_LE:
- case AUDIO_ENCODING_SLINEAR_BE:
- case AUDIO_ENCODING_ULINEAR_BE:
break;
default:
return (EINVAL);
@@ -1520,20 +1514,6 @@ gus_set_params(void *addr, int setmode, int usemode, struct audio_params *p,
if (setmode & AUMODE_PLAY)
sc->sc_orate = p->sample_rate;
- switch (p->encoding) {
- case AUDIO_ENCODING_ULAW:
- p->sw_code = mulaw_to_ulinear8;
- r->sw_code = ulinear8_to_mulaw;
- break;
- case AUDIO_ENCODING_ALAW:
- p->sw_code = alaw_to_ulinear8;
- r->sw_code = ulinear8_to_alaw;
- break;
- case AUDIO_ENCODING_ULINEAR_BE:
- case AUDIO_ENCODING_SLINEAR_BE:
- r->sw_code = p->sw_code = swap_bytes;
- break;
- }
p->bps = AUDIO_BPS(p->precision);
r->bps = AUDIO_BPS(r->precision);
p->msb = r->msb = 1;
@@ -3147,54 +3127,29 @@ gus_query_encoding(void *addr, struct audio_encoding *fp)
{
switch (fp->index) {
case 0:
- strlcpy(fp->name, AudioEmulaw, sizeof fp->name);
- fp->encoding = AUDIO_ENCODING_ULAW;
- fp->precision = 8;
- fp->flags = AUDIO_ENCODINGFLAG_EMULATED;
- break;
- case 1:
strlcpy(fp->name, AudioEslinear, sizeof fp->name);
fp->encoding = AUDIO_ENCODING_SLINEAR;
fp->precision = 8;
fp->flags = 0;
break;
- case 2:
+ case 1:
strlcpy(fp->name, AudioEslinear_le, sizeof fp->name);
fp->encoding = AUDIO_ENCODING_SLINEAR_LE;
fp->precision = 16;
fp->flags = 0;
break;
- case 3:
+ case 2:
strlcpy(fp->name, AudioEulinear, sizeof fp->name);
fp->encoding = AUDIO_ENCODING_ULINEAR;
fp->precision = 8;
fp->flags = 0;
break;
- case 4:
+ case 3:
strlcpy(fp->name, AudioEulinear_le, sizeof fp->name);
fp->encoding = AUDIO_ENCODING_ULINEAR_LE;
fp->precision = 16;
fp->flags = 0;
break;
- case 5:
- strlcpy(fp->name, AudioEslinear_be, sizeof fp->name);
- fp->encoding = AUDIO_ENCODING_SLINEAR_BE;
- fp->precision = 16;
- fp->flags = AUDIO_ENCODINGFLAG_EMULATED;
- break;
- case 6:
- strlcpy(fp->name, AudioEulinear_be, sizeof fp->name);
- fp->encoding = AUDIO_ENCODING_ULINEAR_BE;
- fp->precision = 16;
- fp->flags = AUDIO_ENCODINGFLAG_EMULATED;
- break;
- case 7:
- strlcpy(fp->name, AudioEalaw, sizeof fp->name);
- fp->encoding = AUDIO_ENCODING_ALAW;
- fp->precision = 8;
- fp->flags = AUDIO_ENCODINGFLAG_EMULATED;
- break;
-
default:
return(EINVAL);
/*NOTREACHED*/