From: ratchov Date: Tue, 30 Aug 2016 11:20:09 +0000 (+0000) Subject: Properly set "msb" and "bps" fields for both play and rec directions. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=347c0a49b5e6c0070e1b82f3bea2dbab79903741;p=openbsd 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@ --- 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; }