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/maestro.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/maestro.c')
-rw-r--r-- | sys/dev/pci/maestro.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/sys/dev/pci/maestro.c b/sys/dev/pci/maestro.c index 63036064786..dea2b251000 100644 --- a/sys/dev/pci/maestro.c +++ b/sys/dev/pci/maestro.c @@ -1,4 +1,4 @@ -/* $OpenBSD: maestro.c,v 1.28 2010/04/08 00:23:53 tedu Exp $ */ +/* $OpenBSD: maestro.c,v 1.29 2010/07/15 03:43:11 jakemsr Exp $ */ /* $FreeBSD: /c/ncvs/src/sys/dev/sound/pci/maestro.c,v 1.3 2000/11/21 12:22:11 julian Exp $ */ /* * FreeBSD's ESS Agogo/Maestro driver @@ -974,18 +974,18 @@ maestro_query_devinfo(self, cp) } struct audio_encoding maestro_tab[] = { - {0, AudioEslinear_le, AUDIO_ENCODING_SLINEAR_LE, 16, 0}, - {1, AudioEslinear, AUDIO_ENCODING_SLINEAR, 8, 0}, - {2, AudioEulinear, AUDIO_ENCODING_ULINEAR, 8, 0}, - {3, AudioEslinear_be, AUDIO_ENCODING_SLINEAR_BE, 16, + {0, AudioEslinear_le, AUDIO_ENCODING_SLINEAR_LE, 16, 2, 1, 0}, + {1, AudioEslinear, AUDIO_ENCODING_SLINEAR, 8, 1, 1, 0}, + {2, AudioEulinear, AUDIO_ENCODING_ULINEAR, 8, 1, 1, 0}, + {3, AudioEslinear_be, AUDIO_ENCODING_SLINEAR_BE, 16, 2, 1, AUDIO_ENCODINGFLAG_EMULATED}, - {4, AudioEulinear_le, AUDIO_ENCODING_ULINEAR_LE, 16, + {4, AudioEulinear_le, AUDIO_ENCODING_ULINEAR_LE, 16, 2, 1, AUDIO_ENCODINGFLAG_EMULATED}, - {5, AudioEulinear_be, AUDIO_ENCODING_ULINEAR_BE, 16, + {5, AudioEulinear_be, AUDIO_ENCODING_ULINEAR_BE, 16, 2, 1, AUDIO_ENCODINGFLAG_EMULATED}, - {6, AudioEmulaw, AUDIO_ENCODING_ULAW, 8, + {6, AudioEmulaw, AUDIO_ENCODING_ULAW, 8, 1, 1, AUDIO_ENCODINGFLAG_EMULATED}, - {7, AudioEalaw, AUDIO_ENCODING_ALAW, 8, + {7, AudioEalaw, AUDIO_ENCODING_ALAW, 8, 1, 1, AUDIO_ENCODINGFLAG_EMULATED} }; @@ -1117,6 +1117,9 @@ maestro_set_params(hdl, setmode, usemode, play, rec) else if (play->encoding != AUDIO_ENCODING_SLINEAR_LE) return (EINVAL); + play->bps = AUDIO_BPS(play->precision); + play->msb = 1; + maestro_set_speed(&sc->play, &play->sample_rate); return (0); } |