summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2016-08-30 11:20:10 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2016-08-30 11:20:10 +0000
commit846a1d42ddb11a7f5ff062e19775ee08d2d17da7 (patch)
tree0fa7bf0ab7584079cfb8f84d8a8831ee1c7f4a04
parent9d5b3b7aa0cd1b12576d138bf02a5314ede5e0d6 (diff)
Properly set "msb" and "bps" fields for both play and rec directions.
Fixes "audio0: different play and record parameters ... " errors, and probably other unreported errors. help and ok landry@
-rw-r--r--sys/arch/macppc/dev/i2s.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/sys/arch/macppc/dev/i2s.c b/sys/arch/macppc/dev/i2s.c
index 4c77c94dc87..8b9a1443ad1 100644
--- a/sys/arch/macppc/dev/i2s.c
+++ b/sys/arch/macppc/dev/i2s.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i2s.c,v 1.32 2016/06/26 06:50:26 mglocker Exp $ */
+/* $OpenBSD: i2s.c,v 1.33 2016/08/30 11:20:09 ratchov Exp $ */
/* $NetBSD: i2s.c,v 1.1 2003/12/27 02:19:34 grant Exp $ */
/*-
@@ -295,13 +295,9 @@ i2s_set_params(h, setmode, usemode, play, rec)
p->precision = 16;
if (p->channels > 2)
p->channels = 2;
-
- switch (p->encoding) {
- case AUDIO_ENCODING_SLINEAR_BE:
- break;
- default:
- return (EINVAL);
- }
+ p->bps = AUDIO_BPS(p->precision);
+ p->msb = 1;
+ p->encoding = AUDIO_ENCODING_SLINEAR_BE;
}
/* Set the speed */
@@ -309,10 +305,6 @@ i2s_set_params(h, setmode, usemode, play, rec)
return EINVAL;
p->sample_rate = sc->sc_rate;
-
- p->bps = AUDIO_BPS(p->precision);
- p->msb = 1;
-
return 0;
}