]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: mchp-i2s-mcc: Fix simultaneous capture and playback in master mode
authorCodrin Ciubotariu <codrin.ciubotariu@microchip.com>
Tue, 20 Aug 2019 16:24:11 +0000 (19:24 +0300)
committerMark Brown <broonie@kernel.org>
Tue, 20 Aug 2019 17:39:46 +0000 (18:39 +0100)
commitb486bb8c1c1cdf766d4120d6fbb4ae10d892352a
treeb5a16c15ab52b337f53fd27927ec3212c6a912f9
parent0191a4a3c43500a2929b242d4676caec3b1b8f0e
ASoC: mchp-i2s-mcc: Fix simultaneous capture and playback in master mode

This controller supports capture and playback running at the same time,
with the limitation that both capture and playback must be configured the
same way (sample rate, sample format, number of channels, etc). For this,
we have to assure that the configuration registers look the same when
capture and playback are initiated.
This patch fixes a bug in which the controller is in master mode and the
hw_params() callback fails for the second audio stream. The fail occurs
because the divisors are calculated after comparing the configuration
registers for capture and playback. The fix consists in calculating the
divisors before comparing the configuration registers. BCLK and LRC are
then configured and started only if the controller is not already running.

Fixes: 7e0cdf545a55 ("ASoC: mchp-i2s-mcc: add driver for I2SC Multi-Channel Controller")
Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20190820162411.24836-4-codrin.ciubotariu@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/atmel/mchp-i2s-mcc.c