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/macppc | |
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/macppc')
-rw-r--r-- | sys/arch/macppc/dev/awacs.c | 7 | ||||
-rw-r--r-- | sys/arch/macppc/dev/i2s.c | 9 |
2 files changed, 14 insertions, 2 deletions
diff --git a/sys/arch/macppc/dev/awacs.c b/sys/arch/macppc/dev/awacs.c index be1e2629dff..38cebed5e65 100644 --- a/sys/arch/macppc/dev/awacs.c +++ b/sys/arch/macppc/dev/awacs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: awacs.c,v 1.24 2008/10/30 06:22:38 todd Exp $ */ +/* $OpenBSD: awacs.c,v 1.25 2010/07/15 03:43:11 jakemsr Exp $ */ /* $NetBSD: awacs.c,v 1.4 2001/02/26 21:07:51 wiz Exp $ */ /*- @@ -549,6 +549,9 @@ awacs_query_encoding(void *h, struct audio_encoding *ae) default: return (EINVAL); } + ae->bps = AUDIO_BPS(ae->precision); + ae->msb = 1; + return (0); } @@ -653,6 +656,8 @@ awacs_set_params(void *h, int setmode, int usemode, struct audio_params *play, default: return (EINVAL); } + p->bps = AUDIO_BPS(p->precision); + p->msb = 1; } /* Set the speed */ diff --git a/sys/arch/macppc/dev/i2s.c b/sys/arch/macppc/dev/i2s.c index 0e3989d0ab8..a1cfd0a0081 100644 --- a/sys/arch/macppc/dev/i2s.c +++ b/sys/arch/macppc/dev/i2s.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i2s.c,v 1.17 2008/11/07 19:53:20 todd Exp $ */ +/* $OpenBSD: i2s.c,v 1.18 2010/07/15 03:43:11 jakemsr Exp $ */ /* $NetBSD: i2s.c,v 1.1 2003/12/27 02:19:34 grant Exp $ */ /*- @@ -57,6 +57,8 @@ struct audio_params i2s_audio_default = { 44100, /* sample_rate */ AUDIO_ENCODING_SLINEAR_BE, /* encoding */ 16, /* precision */ + 2, /* bps */ + 1, /* msb */ 2, /* channels */ NULL, /* sw_code */ 1 /* factor */ @@ -308,6 +310,8 @@ i2s_query_encoding(h, ae) err = EINVAL; break; } + ae->bps = AUDIO_BPS(ae->precision); + ae->msb = 1; return (err); } @@ -457,6 +461,9 @@ i2s_set_params(h, setmode, usemode, play, rec) p->sample_rate = sc->sc_rate; + p->bps = AUDIO_BPS(p->precision); + p->msb = 1; + return 0; } |