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

ASoC: rt5645: Lock mutex in rt5645_enable_push_button_irq

rt5645_enable_push_button_irq uses snd_soc_dapm_*_unlocked
functions, so it needs to lock the required dapm mutex.

Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Nicolas Boichat and committed by
Mark Brown
22f5d9f8 345b0f50

+6
+6
sound/soc/codecs/rt5645.c
··· 2762 2762 struct rt5645_priv *rt5645 = snd_soc_codec_get_drvdata(codec); 2763 2763 2764 2764 if (enable) { 2765 + snd_soc_dapm_mutex_lock(&codec->dapm); 2765 2766 snd_soc_dapm_force_enable_pin_unlocked(&codec->dapm, 2766 2767 "ADC L power"); 2767 2768 snd_soc_dapm_force_enable_pin_unlocked(&codec->dapm, ··· 2772 2771 snd_soc_dapm_force_enable_pin_unlocked(&codec->dapm, 2773 2772 "Mic Det Power"); 2774 2773 snd_soc_dapm_sync_unlocked(&codec->dapm); 2774 + snd_soc_dapm_mutex_unlock(&codec->dapm); 2775 + 2775 2776 snd_soc_update_bits(codec, 2776 2777 RT5645_INT_IRQ_ST, 0x8, 0x8); 2777 2778 snd_soc_update_bits(codec, ··· 2784 2781 } else { 2785 2782 snd_soc_update_bits(codec, RT5650_4BTN_IL_CMD2, 0x8000, 0x0); 2786 2783 snd_soc_update_bits(codec, RT5645_INT_IRQ_ST, 0x8, 0x0); 2784 + 2785 + snd_soc_dapm_mutex_lock(&codec->dapm); 2787 2786 snd_soc_dapm_disable_pin_unlocked(&codec->dapm, 2788 2787 "ADC L power"); 2789 2788 snd_soc_dapm_disable_pin_unlocked(&codec->dapm, ··· 2796 2791 snd_soc_dapm_disable_pin_unlocked(&codec->dapm, 2797 2792 "Mic Det Power"); 2798 2793 snd_soc_dapm_sync_unlocked(&codec->dapm); 2794 + snd_soc_dapm_mutex_unlock(&codec->dapm); 2799 2795 } 2800 2796 } 2801 2797