]> asedeno.scripts.mit.edu Git - linux.git/commit
ASoC: cs42xx8: Fix MFREQ selection issue for async mode
authorShengjiu Wang <shengjiu.wang@nxp.com>
Tue, 16 Jul 2019 09:45:47 +0000 (17:45 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 22 Jul 2019 12:00:30 +0000 (13:00 +0100)
commit48dfd37a0f85400610153101c72222bf01523699
treeaa5e59c9a4f43c9b75dbd90e602330c627a829ac
parent8dd26dff00c0636b1d8621acaeef3f6f3a39dd77
ASoC: cs42xx8: Fix MFREQ selection issue for async mode

When sample rate of TX is different with sample rate of RX in
async mode, the MFreq selection will be wrong.

For example, sysclk = 24.576MHz, TX rate = 96000Hz, RX rate = 48000Hz.
Then ratio of TX = 256, ratio of RX = 512, For MFreq is shared by TX
and RX instance, the correct value of MFreq is 2 for both TX and RX.

But original method will cause MFreq = 0 for TX, MFreq = 2 for RX.
If TX is started after RX, RX will be impacted, RX work abnormal with
MFreq = 0.

This patch is to select proper MFreq value according to TX rate and
RX rate.

Fixes: 0c516b4ff85c ("ASoC: cs42xx8: Add codec driver support for CS42448/CS42888")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/20190716094547.46787-1-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/cs42xx8.c