ASoC: sof_es8336: reduce pop noise on speaker
authorZhu Ning <zhuning0077@gmail.com>
Fri, 28 Oct 2022 02:04:56 +0000 (10:04 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 7 Nov 2022 13:58:03 +0000 (13:58 +0000)
commit89cdb224f2abe37ec4ac21ba0d9ddeb5a6a9cf68
treed10de68ee933cf0e8b5c499503c862063dbf684c
parent3d59eaef49ca2db581156a7b77c9afc0546eefc0
ASoC: sof_es8336: reduce pop noise on speaker

The Speaker GPIO needs to be turned on slightly behind the codec turned on.
It also need to be turned off slightly before the codec turned down.
Current code uses delay in DAPM_EVENT to do it but the mdelay delays the
DAPM itself and thus has no effect. A delayed_work is added to turn on the
speaker.
The Speaker is turned off in .trigger since trigger is called slightly
before the DAPM events.

Signed-off-by: Zhu Ning <zhuning@everest-semi.com>
------------

v1: cancel delayed work while disabling speaker.
Link: https://lore.kernel.org/r/20221028020456.90286-1-zhuning0077@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/sof_es8336.c