]> git.baikalelectronics.ru Git - kernel.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)
commit1ee17d067153b72646fc942cc7bc9d26e1ae0b96
treeaa5e59c9a4f43c9b75dbd90e602330c627a829ac
parented12c3cfcd93c4c25431772357318305601bec57
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: 83b2b113fbb9 ("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