Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: rt5682: fix the wrong jack type detected

Some powers were changed during the jack insert detection
and clk's enable/disable in CCF.
If in parallel, the influence has a chance to detect
the wrong jack type, so add a lock.

Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/20211214105033.471-1-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Derek Fang and committed by
Mark Brown
8deb34a9 db635ba4

+4
+4
sound/soc/codecs/rt5682.c
··· 929 929 unsigned int val, count; 930 930 931 931 if (jack_insert) { 932 + snd_soc_dapm_mutex_lock(dapm); 933 + 932 934 snd_soc_component_update_bits(component, RT5682_PWR_ANLG_1, 933 935 RT5682_PWR_VREF2 | RT5682_PWR_MB, 934 936 RT5682_PWR_VREF2 | RT5682_PWR_MB); ··· 981 979 snd_soc_component_update_bits(component, RT5682_MICBIAS_2, 982 980 RT5682_PWR_CLK25M_MASK | RT5682_PWR_CLK1M_MASK, 983 981 RT5682_PWR_CLK25M_PU | RT5682_PWR_CLK1M_PU); 982 + 983 + snd_soc_dapm_mutex_unlock(dapm); 984 984 } else { 985 985 rt5682_enable_push_button_irq(component, false); 986 986 snd_soc_component_update_bits(component, RT5682_CBJ_CTRL_1,