lkml.org 
[lkml]   [2014]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 07/15] ASoC: wm8996: Update locking around use of DAPM pin API
Date
The pin updates in this driver look like they are intended to be done
atomically, update to do so.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---
sound/soc/codecs/wm8996.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c
index 1a7655b..a391128 100644
--- a/sound/soc/codecs/wm8996.c
+++ b/sound/soc/codecs/wm8996.c
@@ -2267,8 +2267,12 @@ int wm8996_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack,
WM8996_MICB2_DISCH, 0);

/* LDO2 powers the microphones, SYSCLK clocks detection */
- snd_soc_dapm_force_enable_pin(&codec->dapm, "LDO2");
- snd_soc_dapm_force_enable_pin(&codec->dapm, "SYSCLK");
+ mutex_lock(&codec->dapm.card->dapm_mutex);
+
+ snd_soc_dapm_force_enable_pin_locked(&codec->dapm, "LDO2");
+ snd_soc_dapm_force_enable_pin_locked(&codec->dapm, "SYSCLK");
+
+ mutex_unlock(&codec->dapm.card->dapm_mutex);

/* We start off just enabling microphone detection - even a
* plain headphone will trigger detection.
--
1.7.2.5


\
 
 \ /
  Last update: 2014-02-17 18:21    [W:0.669 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site