From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: broonie@kernel.org
Cc: myungjoo.ham@samsung.com, cw00.choi@samsung.com,
dmitry.torokhov@gmail.com, lgirdwood@gmail.com, lars@metafoo.de,
peter.ujfalusi@ti.com, jarkko.nikula@bitmer.com,
eric.y.miao@gmail.com, haojian.zhuang@gmail.com,
linux-kernel@vger.kernel.org,
patches@opensource.wolfsonmicro.com, alsa-devel@alsa-project.org,
linux@arm.linux.org.uk
Subject: [PATCH 09/17 v2] ASoC: wm8996: Update locking around use of DAPM pin API
Date: Tue, 18 Feb 2014 15:22:20 +0000 [thread overview]
Message-ID: <1392736948-26623-10-git-send-email-ckeepax@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1392736948-26623-1-git-send-email-ckeepax@opensource.wolfsonmicro.com>
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 | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c
index 1a7655b..d565d0a 100644
--- a/sound/soc/codecs/wm8996.c
+++ b/sound/soc/codecs/wm8996.c
@@ -2251,6 +2251,7 @@ int wm8996_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack,
wm8996_polarity_fn polarity_cb)
{
struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec);
+ struct snd_soc_dapm_context *dapm = &codec->dapm;
wm8996->jack = jack;
wm8996->detecting = true;
@@ -2267,8 +2268,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");
+ snd_soc_dapm_mutex_lock(dapm);
+
+ snd_soc_dapm_force_enable_pin_unlocked(dapm, "LDO2");
+ snd_soc_dapm_force_enable_pin_unlocked(dapm, "SYSCLK");
+
+ snd_soc_dapm_mutex_unlock(dapm);
/* We start off just enabling microphone detection - even a
* plain headphone will trigger detection.
--
1.7.2.5
next prev parent reply other threads:[~2014-02-18 15:22 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-18 15:22 [PATCH 00/17 v2] Update locking for snd_soc_dapm_xxxx_pin functions Charles Keepax
2014-02-18 15:22 ` Charles Keepax
2014-02-18 15:22 ` [PATCH 01/17 v2] Input - arizona-haptics: Fix double lock of dapm_mutex Charles Keepax
2014-02-20 3:54 ` Mark Brown
2014-02-20 4:20 ` Dmitry Torokhov
2014-02-20 9:12 ` Mark Brown
2014-02-18 15:22 ` [PATCH 02/17 v2] ASoC: dapm: Add helpers to lock/unlock DAPM mutex Charles Keepax
2014-02-18 15:22 ` Charles Keepax
2014-02-20 10:23 ` Mark Brown
2014-02-20 10:23 ` Mark Brown
2014-02-18 15:22 ` [PATCH 03/17 v2] ASoC: dapm: Add locking to snd_soc_dapm_xxxx_pin functions Charles Keepax
2014-02-18 15:22 ` Charles Keepax
2014-02-20 9:40 ` Mark Brown
2014-02-20 9:40 ` Mark Brown
2014-02-18 15:22 ` [PATCH 04/17 v2] ASoC: dapm: Add unlocked version of snd_soc_dapm_sync Charles Keepax
2014-02-18 15:22 ` Charles Keepax
2014-02-18 16:14 ` Lars-Peter Clausen
2014-02-19 3:28 ` Mark Brown
2014-02-20 10:24 ` Mark Brown
2014-02-18 15:22 ` [PATCH 05/17 v2] ASoC: adav80x: Update locking around use of DAPM pin API Charles Keepax
2014-02-18 16:12 ` Lars-Peter Clausen
2014-02-20 10:25 ` Mark Brown
2014-02-18 15:22 ` [PATCH 06/17 v2] ASoC: wm5100: " Charles Keepax
2014-02-18 15:22 ` Charles Keepax
2014-02-20 10:26 ` Mark Brown
2014-02-18 15:22 ` [PATCH 07/17 v2] ASoC: wm8962: " Charles Keepax
2014-02-20 10:26 ` Mark Brown
2014-02-18 15:22 ` [PATCH 08/17 v2] ASoC: wm8994: " Charles Keepax
2014-02-20 10:26 ` Mark Brown
2014-02-18 15:22 ` Charles Keepax [this message]
2014-02-20 10:27 ` [PATCH 09/17 v2] ASoC: wm8996: " Mark Brown
2014-02-18 15:22 ` [PATCH 10/17 v2] ASoC: mfld_machine: " Charles Keepax
2014-02-20 10:27 ` Mark Brown
2014-02-18 15:22 ` [PATCH 11/17 v2] ASoC: ams-delta: " Charles Keepax
2014-02-20 10:27 ` Mark Brown
2014-02-18 15:22 ` [PATCH 12/17 v2] ASoC: omap: n810: " Charles Keepax
2014-02-20 10:28 ` Mark Brown
2014-02-18 15:22 ` [PATCH 13/17 v2] ASoC: omap: rx51: " Charles Keepax
2014-02-20 10:28 ` Mark Brown
2014-02-18 15:22 ` [PATCH 14/17 v2] ASoC: pxa: corgi: " Charles Keepax
2014-02-20 10:53 ` Mark Brown
2014-02-18 15:22 ` [PATCH 15/17 v2] ASoC: pxa: magician: " Charles Keepax
2014-02-20 10:54 ` Mark Brown
2014-02-18 15:22 ` [PATCH 16/17 v2] ASoC: pxa: spitz: " Charles Keepax
2014-02-20 10:54 ` Mark Brown
2014-02-18 15:22 ` [PATCH 17/17 v2] ASoC: pxa: tosa: " Charles Keepax
2014-02-20 10:54 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1392736948-26623-10-git-send-email-ckeepax@opensource.wolfsonmicro.com \
--to=ckeepax@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=cw00.choi@samsung.com \
--cc=dmitry.torokhov@gmail.com \
--cc=eric.y.miao@gmail.com \
--cc=haojian.zhuang@gmail.com \
--cc=jarkko.nikula@bitmer.com \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=myungjoo.ham@samsung.com \
--cc=patches@opensource.wolfsonmicro.com \
--cc=peter.ujfalusi@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.