summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/nau8825.h
diff options
context:
space:
mode:
authorJohn Hsu <KCHSU0@nuvoton.com>2017-12-01 05:01:37 +0300
committerMark Brown <broonie@kernel.org>2017-12-04 21:14:49 +0300
commitfa25b4f59f1de9536104b632ec4c4c0b8f8e54ec (patch)
tree7eb80dc2d6d0c482c81110e548f7916189eaa09a /sound/soc/codecs/nau8825.h
parent70424d8e6e15abd32e189130be220d0063e082bc (diff)
downloadlinux-fa25b4f59f1de9536104b632ec4c4c0b8f8e54ec.tar.xz
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>
Diffstat (limited to 'sound/soc/codecs/nau8825.h')
-rw-r--r--sound/soc/codecs/nau8825.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/soc/codecs/nau8825.h b/sound/soc/codecs/nau8825.h
index 199d6ea4dcdc..f7e732125882 100644
--- a/sound/soc/codecs/nau8825.h
+++ b/sound/soc/codecs/nau8825.h
@@ -477,6 +477,7 @@ struct nau8825 {
bool xtalk_protect;
int imp_rms[NAU8825_XTALK_IMM];
int xtalk_enable;
+ bool xtalk_baktab_initialized; /* True if initialized. */
};
int nau8825_enable_jack_detect(struct snd_soc_codec *codec,