ASoC: mchp-pdmc: fix poc noise at capture startup
authorClaudiu Beznea <claudiu.beznea@microchip.com>
Tue, 28 Feb 2023 11:01:45 +0000 (13:01 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 28 Feb 2023 13:58:50 +0000 (13:58 +0000)
commitc5682e2ba1327d08987a7cabc7b5b40bf3bc131f
tree36f312634153420cdb4d945eded77ff5d6ecd2ae
parent143a2f011c4471511887807822d3fd71f25f5169
ASoC: mchp-pdmc: fix poc noise at capture startup

Microchip PDMC IP doesn't filter microphone noises on startup. By default,
it captures data received from digital microphones after
the MCHP_PDMC_MR.EN bits are set. Thus when enable is set on PDMC side the
digital microphones might not be ready yet and PDMC captures data from then
in this time. This data captured is poc noise. To avoid this the software
workaround is to the following:
1/ enable PDMC channel
2/ wait 150ms (on SAMA7G5-EK setup)
3/ execute 16 dummy reads from RHR
4/ clear interrupts
5/ enable interrupts
6/ enable DMA channel

Fixes: 50291652af52 ("ASoC: atmel: mchp-pdmc: add PDMC driver")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230228110145.3770525-4-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/atmel/mchp-pdmc.c