ASoC: rt5682s: Enable ASRC auto-disable to fix pop during jack plug-in while playback
authorDerek Fang <derek.fang@realtek.com>
Fri, 1 Oct 2021 07:41:12 +0000 (15:41 +0800)
committerMark Brown <broonie@kernel.org>
Fri, 1 Oct 2021 18:35:03 +0000 (19:35 +0100)
commit04a8374c321db55834d5a9f3a9ceecb04b3cfbf5
tree56b3de1be19b5fadf50ab42ebca59e4388bc5354
parentbd8bec1408ab2336939bd69d93897bf19d0325ed
ASoC: rt5682s: Enable ASRC auto-disable to fix pop during jack plug-in while playback

When codec's ASRC was enabled, the DA and AD filters use
the reference clk which tracks the I2S clks.
And if the I2S clks' timing of open and close are not expected,
this patch allows the filters to switch to use sysclk if
ASRC's ref clks disappeared and could fix the below possible issues:
1. Avoid DA filter to keep surplus samples.
2. Avoid that AD filter works failed during dapm's power on.

For example,
if I2S clks were closed before dacdat during playback off
due to jack unplug, it causes ref clks disappeared and
DA filter remained some samples which will produce pop noise
on the next HP playback.
ASRC auto-disable could clear the samples during the playback off.

Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/20211001074113.2223-1-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt5682s.c
sound/soc/codecs/rt5682s.h