]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: nau8825: improve crosstalk measurement protection
authorJohn Hsu <KCHSU0@nuvoton.com>
Fri, 1 Dec 2017 02:01:37 +0000 (10:01 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 4 Dec 2017 18:14:49 +0000 (18:14 +0000)
commit96485bbc647d387207c83a59af4dd35aa6c7064a
tree7eb80dc2d6d0c482c81110e548f7916189eaa09a
parent6384a58858caa594978af920e2100bf55b5cd46a
ASoC: nau8825: improve crosstalk measurement protection

The sequence of crosstalk measurement is not robust. The driver
add more protections to make it stronger. The improvements as follows:
(1)Give backup table the default value. The values are the same
with the default of hardware registers. The impact will decline
once restoring the backup table in the wrong way.
(2)Add xtalk_baktab_initialized flag. The flag can keep the
initiation status of backup table. It helps to backup and restore
the backup-table correctly.
(3)Add cancel parameter in the restore function. The volume ramping
should do in crosstalk DONE state only. Otherwise, the delay action
is not allowed because the restore may happen during the jack
eject interruption.
(4)Add xtalk_protect condition check before scheduling work in ISR.
It makes sure the semaphore hold during the crosstalk measurement.
The sequence is still under protection from playback interference.

Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/nau8825.c
sound/soc/codecs/nau8825.h