diff options
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/hppa/gsc/harmony.c | 10 | ||||
-rw-r--r-- | sys/arch/macppc/dev/awacs.c | 7 | ||||
-rw-r--r-- | sys/arch/macppc/dev/i2s.c | 9 | ||||
-rw-r--r-- | sys/arch/sgi/dev/mavb.c | 12 | ||||
-rw-r--r-- | sys/arch/sparc/dev/amd7930.c | 17 | ||||
-rw-r--r-- | sys/arch/sparc/dev/cs4231.c | 7 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/ce4231.c | 7 | ||||
-rw-r--r-- | sys/arch/zaurus/dev/zaurus_audio.c | 27 |
8 files changed, 73 insertions, 23 deletions
diff --git a/sys/arch/hppa/gsc/harmony.c b/sys/arch/hppa/gsc/harmony.c index 8dc70d91c79..a9b6bf36fd7 100644 --- a/sys/arch/hppa/gsc/harmony.c +++ b/sys/arch/hppa/gsc/harmony.c @@ -1,4 +1,4 @@ -/* $OpenBSD: harmony.c,v 1.26 2008/04/21 00:32:42 jakemsr Exp $ */ +/* $OpenBSD: harmony.c,v 1.27 2010/07/15 03:43:11 jakemsr Exp $ */ /* * Copyright (c) 2003 Jason L. Wright (jason@thought.net) @@ -464,6 +464,8 @@ harmony_query_encoding(void *vsc, struct audio_encoding *fp) default: err = EINVAL; } + fp->bps = AUDIO_BPS(fp->precision); + fp->msb = 1; return (err); } @@ -558,9 +560,13 @@ harmony_set_params(void *vsc, int setmode, int usemode, else return (EINVAL); - bits |= harmony_speed_bits(sc, &p->sample_rate); p->sw_code = pswcode; r->sw_code = rswcode; + p->bps = AUDIO_BPS(p->precision); + r->bps = AUDIO_BPS(r->precision); + p->msb = r->msb = 1; + + bits |= harmony_speed_bits(sc, &p->sample_rate); sc->sc_cntlbits = bits; sc->sc_need_commit = 1; 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; } diff --git a/sys/arch/sgi/dev/mavb.c b/sys/arch/sgi/dev/mavb.c index 78deca07723..b6fe1327577 100644 --- a/sys/arch/sgi/dev/mavb.c +++ b/sys/arch/sgi/dev/mavb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mavb.c,v 1.12 2010/07/02 03:24:50 blambert Exp $ */ +/* $OpenBSD: mavb.c,v 1.13 2010/07/15 03:43:11 jakemsr Exp $ */ /* * Copyright (c) 2005 Mark Kettenis @@ -262,6 +262,8 @@ mavb_query_encoding(void *hdl, struct audio_encoding *ae) default: return (EINVAL); } + ae->bps = AUDIO_BPS(ae->precision); + ae->msb = 1; return (0); } @@ -374,6 +376,8 @@ mavb_get_default_params(void *hdl, int mode, struct audio_params *p) p->sample_rate = 48000; p->encoding = AUDIO_ENCODING_SLINEAR_BE; p->precision = 16; + p->bps = 2; + p->msb = 1; p->channels = 2; p->factor = 2; if (mode == AUMODE_PLAY) @@ -535,6 +539,9 @@ mavb_set_params(void *hdl, int setmode, int usemode, error = mavb_set_play_format(sc, play->encoding); if (error) return (error); + + play->bps = AUDIO_BPS(play->precision); + play->msb = 1; } if (setmode & AUMODE_RECORD) { @@ -569,6 +576,9 @@ mavb_set_params(void *hdl, int setmode, int usemode, error = mavb_set_rec_format(sc, rec->encoding); if (error) return (error); + + rec->bps = AUDIO_BPS(rec->precision); + rec->msb = 1; } return (0); diff --git a/sys/arch/sparc/dev/amd7930.c b/sys/arch/sparc/dev/amd7930.c index 9c84d7fa035..410c123ead6 100644 --- a/sys/arch/sparc/dev/amd7930.c +++ b/sys/arch/sparc/dev/amd7930.c @@ -1,4 +1,4 @@ -/* $OpenBSD: amd7930.c,v 1.32 2009/04/10 20:53:51 miod Exp $ */ +/* $OpenBSD: amd7930.c,v 1.33 2010/07/15 03:43:11 jakemsr Exp $ */ /* $NetBSD: amd7930.c,v 1.37 1998/03/30 14:23:40 pk Exp $ */ /* @@ -389,12 +389,13 @@ amd7930_set_params(addr, setmode, usemode, p, r) int setmode, usemode; struct audio_params *p, *r; { - if (p->sample_rate < 7500 || p->sample_rate > 8500 || - p->encoding != AUDIO_ENCODING_ULAW || - p->precision != 8 || - p->channels != 1) - return (EINVAL); - p->sample_rate = 8000; /* no other rates supported by amd chip */ + p->encoding = AUDIO_ENCODING_ULAW; + p->precision = 8; + p->bps = 1; + p->msb = 1; + p->channels = 1; + /* no other rates supported by amd chip */ + p->sample_rate = 8000; return (0); } @@ -409,6 +410,8 @@ amd7930_query_encoding(addr, fp) strlcpy(fp->name, AudioEmulaw, sizeof fp->name); fp->encoding = AUDIO_ENCODING_ULAW; fp->precision = 8; + fp->bps = 1; + fp->msb = 1; fp->flags = 0; break; default: diff --git a/sys/arch/sparc/dev/cs4231.c b/sys/arch/sparc/dev/cs4231.c index bb5671f33e6..830871b3820 100644 --- a/sys/arch/sparc/dev/cs4231.c +++ b/sys/arch/sparc/dev/cs4231.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cs4231.c,v 1.28 2010/06/18 23:47:24 miod Exp $ */ +/* $OpenBSD: cs4231.c,v 1.29 2010/07/15 03:43:11 jakemsr Exp $ */ /* * Copyright (c) 1999 Jason L. Wright (jason@thought.net) @@ -645,6 +645,8 @@ cs4231_query_encoding(addr, fp) default: err = EINVAL; } + fp->bps = AUDIO_BPS(fp->precision); + fp->msb = 1; return (err); } @@ -735,6 +737,9 @@ cs4231_set_params(addr, setmode, usemode, p, r) p->sw_code = pswcode; r->sw_code = rswcode; + p->bps = AUDIO_BPS(p->precision); + r->bps = AUDIO_BPS(r->precision); + p->msb = r->msb = 1; sc->sc_format_bits = bits; sc->sc_channels = p->channels; diff --git a/sys/arch/sparc64/dev/ce4231.c b/sys/arch/sparc64/dev/ce4231.c index 9a16ed0e114..93f9cab66bf 100644 --- a/sys/arch/sparc64/dev/ce4231.c +++ b/sys/arch/sparc64/dev/ce4231.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ce4231.c,v 1.25 2010/02/22 00:43:30 jakemsr Exp $ */ +/* $OpenBSD: ce4231.c,v 1.26 2010/07/15 03:43:11 jakemsr Exp $ */ /* * Copyright (c) 1999 Jason L. Wright (jason@thought.net) @@ -694,6 +694,8 @@ ce4231_query_encoding(addr, fp) default: err = EINVAL; } + fp->bps = AUDIO_BPS(fp->precision); + fp->msb = 1; return (err); } @@ -780,6 +782,9 @@ ce4231_set_params(addr, setmode, usemode, p, r) p->sw_code = pswcode; r->sw_code = rswcode; + p->bps = AUDIO_BPS(p->precision); + r->bps = AUDIO_BPS(r->precision); + p->msb = r->msb = 1; sc->sc_format_bits = bits; sc->sc_channels = p->channels; 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 |