diff options
author | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2010-07-15 03:43:13 +0000 |
---|---|---|
committer | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2010-07-15 03:43:13 +0000 |
commit | 59cb4ff01f7202d2e69dd3011fd755605b7cc8da (patch) | |
tree | 454f4c2562bc96d6f292a0ddccc5df0e49f30ea2 /sys/dev/pci/eap.c | |
parent | a6e9a1c865707ccd6904e98b221c6be74b97f4d9 (diff) |
add two new members to structs audio_encoding and audio_prinfo.
for both structs, the new members are 'bps' and 'msb', which
describe the number of bytes per sample and data alignment in the
sample, respectively. drivers must properly set these fields in
the 'query_encoding', 'set_parameters' and 'get_default_params'
hardware interface methods.
discussed with ratchov, deraadt
Diffstat (limited to 'sys/dev/pci/eap.c')
-rw-r--r-- | sys/dev/pci/eap.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/sys/dev/pci/eap.c b/sys/dev/pci/eap.c index 799dd2d2675..148642476f0 100644 --- a/sys/dev/pci/eap.c +++ b/sys/dev/pci/eap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eap.c,v 1.39 2010/06/20 10:22:25 ratchov Exp $ */ +/* $OpenBSD: eap.c,v 1.40 2010/07/15 03:43:11 jakemsr Exp $ */ /* $NetBSD: eap.c,v 1.46 2001/09/03 15:07:37 reinoud Exp $ */ /* @@ -765,52 +765,56 @@ eap_query_encoding(void *addr, struct audio_encoding *fp) fp->encoding = AUDIO_ENCODING_ULINEAR; fp->precision = 8; fp->flags = 0; - return (0); + break; case 1: strlcpy(fp->name, AudioEmulaw, sizeof fp->name); fp->encoding = AUDIO_ENCODING_ULAW; fp->precision = 8; fp->flags = AUDIO_ENCODINGFLAG_EMULATED; - return (0); + break; case 2: strlcpy(fp->name, AudioEalaw, sizeof fp->name); fp->encoding = AUDIO_ENCODING_ALAW; fp->precision = 8; fp->flags = AUDIO_ENCODINGFLAG_EMULATED; - return (0); + break; case 3: strlcpy(fp->name, AudioEslinear, sizeof fp->name); fp->encoding = AUDIO_ENCODING_SLINEAR; fp->precision = 8; fp->flags = AUDIO_ENCODINGFLAG_EMULATED; - return (0); + break; case 4: strlcpy(fp->name, AudioEslinear_le, sizeof fp->name); fp->encoding = AUDIO_ENCODING_SLINEAR_LE; fp->precision = 16; fp->flags = 0; - return (0); + break; case 5: strlcpy(fp->name, AudioEulinear_le, sizeof fp->name); fp->encoding = AUDIO_ENCODING_ULINEAR_LE; fp->precision = 16; fp->flags = AUDIO_ENCODINGFLAG_EMULATED; - return (0); + break; case 6: strlcpy(fp->name, AudioEslinear_be, sizeof fp->name); fp->encoding = AUDIO_ENCODING_SLINEAR_BE; fp->precision = 16; fp->flags = AUDIO_ENCODINGFLAG_EMULATED; - return (0); + break; case 7: strlcpy(fp->name, AudioEulinear_be, sizeof fp->name); fp->encoding = AUDIO_ENCODING_ULINEAR_BE; fp->precision = 16; fp->flags = AUDIO_ENCODINGFLAG_EMULATED; - return (0); + break; default: return (EINVAL); } + fp->bps = AUDIO_BPS(fp->precision); + fp->msb = 1; + + return (0); } void @@ -904,6 +908,8 @@ eap_set_params(void *addr, int setmode, int usemode, default: return (EINVAL); } + p->bps = AUDIO_BPS(p->precision); + p->msb = 1; } if (!sc->sc_1371) { |