]> 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)
commitc99f761c99c31933f9cc4c629b2d2f4a79095dd1
treeaa5e59c9a4f43c9b75dbd90e602330c627a829ac
parente25990f471771159b1f747664ea42c4855125c64
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: 55c36b1e4fab ("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