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/arch/zaurus | |
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/arch/zaurus')
-rw-r--r-- | sys/arch/zaurus/dev/zaurus_audio.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/sys/arch/zaurus/dev/zaurus_audio.c b/sys/arch/zaurus/dev/zaurus_audio.c index f50d886e759..5c21453d590 100644 --- a/sys/arch/zaurus/dev/zaurus_audio.c +++ b/sys/arch/zaurus/dev/zaurus_audio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zaurus_audio.c,v 1.10 2008/04/21 00:32:42 jakemsr Exp $ */ +/* $OpenBSD: zaurus_audio.c,v 1.11 2010/07/15 03:43:11 jakemsr Exp $ */ /* * Copyright (c) 2005 Christopher Pascoe <pascoe@openbsd.org> @@ -492,52 +492,55 @@ zaudio_query_encoding(void *hdl, struct audio_encoding *aep) aep->encoding = AUDIO_ENCODING_ULINEAR; aep->precision = 8; aep->flags = 0; - return (0); + break; case 1: strlcpy(aep->name, AudioEmulaw, sizeof(aep->name)); aep->encoding = AUDIO_ENCODING_ULAW; aep->precision = 8; aep->flags = AUDIO_ENCODINGFLAG_EMULATED; - return (0); + break; case 2: strlcpy(aep->name, AudioEalaw, sizeof(aep->name)); aep->encoding = AUDIO_ENCODING_ALAW; aep->precision = 8; aep->flags = AUDIO_ENCODINGFLAG_EMULATED; - return (0); + break; case 3: strlcpy(aep->name, AudioEslinear, sizeof(aep->name)); aep->encoding = AUDIO_ENCODING_SLINEAR; aep->precision = 8; aep->flags = AUDIO_ENCODINGFLAG_EMULATED; - return (0); + break; case 4: strlcpy(aep->name, AudioEslinear_le, sizeof(aep->name)); aep->encoding = AUDIO_ENCODING_SLINEAR_LE; aep->precision = 16; aep->flags = 0; - return (0); + break; case 5: strlcpy(aep->name, AudioEulinear_le, sizeof(aep->name)); aep->encoding = AUDIO_ENCODING_ULINEAR_LE; aep->precision = 16; aep->flags = AUDIO_ENCODINGFLAG_EMULATED; - return (0); + break; case 6: strlcpy(aep->name, AudioEslinear_be, sizeof(aep->name)); aep->encoding = AUDIO_ENCODING_SLINEAR_BE; aep->precision = 16; aep->flags = AUDIO_ENCODINGFLAG_EMULATED; - return (0); + break; case 7: strlcpy(aep->name, AudioEulinear_be, sizeof(aep->name)); aep->encoding = AUDIO_ENCODING_ULINEAR_BE; aep->precision = 16; aep->flags = AUDIO_ENCODINGFLAG_EMULATED; - return (0); + break; default: return (EINVAL); } + aep->bps = AUDIO_BPS(aep->precision); + aep->msb = 1; + return (0); } int @@ -716,6 +719,9 @@ zaudio_set_params(void *hdl, int setmode, int usemode, return (EINVAL); } + play->bps = AUDIO_BPS(play->precision); + play->msb = 1; + pxa2x0_i2s_setspeed(&sc->sc_i2s, &play->sample_rate); } @@ -752,6 +758,9 @@ zaudio_set_params(void *hdl, int setmode, int usemode, return (EINVAL); } + rec->bps = AUDIO_BPS(rec->precision); + rec->msb = 1; + pxa2x0_i2s_setspeed(sc, &rec->sample_rate); } #endif |