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 06/15] ASoC: wm8994: Update locking around use of DAPM pin API
Date: Mon, 17 Feb 2014 16:51:34 +0000 [thread overview]
Message-ID: <1392655903-24537-7-git-send-email-ckeepax@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1392655903-24537-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/wm8994.c | 40 ++++++++++++++++++++++++----------------
1 files changed, 24 insertions(+), 16 deletions(-)
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index b9be9cb..4788c4e 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -2552,38 +2552,46 @@ int wm8994_vmid_mode(struct snd_soc_codec *codec, enum wm8994_vmid_mode mode)
switch (mode) {
case WM8994_VMID_NORMAL:
+ mutex_lock(&codec->dapm.card->dapm_mutex);
+
if (wm8994->hubs.lineout1_se) {
- snd_soc_dapm_disable_pin(&codec->dapm,
- "LINEOUT1N Driver");
- snd_soc_dapm_disable_pin(&codec->dapm,
- "LINEOUT1P Driver");
+ snd_soc_dapm_disable_pin_locked(&codec->dapm,
+ "LINEOUT1N Driver");
+ snd_soc_dapm_disable_pin_locked(&codec->dapm,
+ "LINEOUT1P Driver");
}
if (wm8994->hubs.lineout2_se) {
- snd_soc_dapm_disable_pin(&codec->dapm,
- "LINEOUT2N Driver");
- snd_soc_dapm_disable_pin(&codec->dapm,
- "LINEOUT2P Driver");
+ snd_soc_dapm_disable_pin_locked(&codec->dapm,
+ "LINEOUT2N Driver");
+ snd_soc_dapm_disable_pin_locked(&codec->dapm,
+ "LINEOUT2P Driver");
}
+ mutex_unlock(&codec->dapm.card->dapm_mutex);
+
/* Do the sync with the old mode to allow it to clean up */
snd_soc_dapm_sync(&codec->dapm);
wm8994->vmid_mode = mode;
break;
case WM8994_VMID_FORCE:
+ mutex_lock(&codec->dapm.card->dapm_mutex);
+
if (wm8994->hubs.lineout1_se) {
- snd_soc_dapm_force_enable_pin(&codec->dapm,
- "LINEOUT1N Driver");
- snd_soc_dapm_force_enable_pin(&codec->dapm,
- "LINEOUT1P Driver");
+ snd_soc_dapm_force_enable_pin_locked(&codec->dapm,
+ "LINEOUT1N Driver");
+ snd_soc_dapm_force_enable_pin_locked(&codec->dapm,
+ "LINEOUT1P Driver");
}
if (wm8994->hubs.lineout2_se) {
- snd_soc_dapm_force_enable_pin(&codec->dapm,
- "LINEOUT2N Driver");
- snd_soc_dapm_force_enable_pin(&codec->dapm,
- "LINEOUT2P Driver");
+ snd_soc_dapm_force_enable_pin_locked(&codec->dapm,
+ "LINEOUT2N Driver");
+ snd_soc_dapm_force_enable_pin_locked(&codec->dapm,
+ "LINEOUT2P Driver");
}
+ mutex_unlock(&codec->dapm.card->dapm_mutex);
+
wm8994->vmid_mode = mode;
snd_soc_dapm_sync(&codec->dapm);
break;
--
1.7.2.5
next prev parent reply other threads:[~2014-02-17 17:02 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-17 16:51 [PATCH 00/15] Update locking for snd_soc_dapm_xxxx_pin functions Charles Keepax
2014-02-17 16:51 ` [PATCH 01/15] Input - arizona-haptics: Fix double lock of dapm_mutex Charles Keepax
2014-02-17 19:20 ` Dmitry Torokhov
2014-02-18 0:28 ` Mark Brown
2014-02-18 14:53 ` [alsa-devel] " Charles Keepax
2014-02-17 16:51 ` [PATCH 02/15] ASoC: dapm: Add locked version of snd_soc_dapm_xxxx_pin functions Charles Keepax
2014-02-17 17:06 ` Lars-Peter Clausen
2014-02-18 0:30 ` Mark Brown
2014-02-18 9:04 ` [alsa-devel] " Charles Keepax
2014-02-17 16:51 ` [PATCH 03/15] ASoC: adav80x: Update locking around use of DAPM pin API Charles Keepax
2014-02-18 0:33 ` Mark Brown
2014-02-17 16:51 ` [PATCH 04/15] ASoC: wm5100: " Charles Keepax
2014-02-18 0:47 ` Mark Brown
2014-02-18 9:24 ` [alsa-devel] " Charles Keepax
2014-02-17 16:51 ` [PATCH 05/15] ASoC: wm8962: " Charles Keepax
2014-02-17 16:51 ` Charles Keepax [this message]
2014-02-17 16:51 ` [PATCH 07/15] ASoC: wm8996: " Charles Keepax
2014-02-17 16:51 ` [PATCH 08/15] ASoC: mfld_machine: " Charles Keepax
2014-02-17 16:51 ` [PATCH 09/15] ASoC: ams-delta: " Charles Keepax
2014-02-17 16:51 ` [PATCH 10/15] ASoC: omap: n810: " Charles Keepax
2014-02-17 16:51 ` [PATCH 11/15] ASoC: omap: rx51: " Charles Keepax
2014-02-17 16:51 ` [PATCH 12/15] ASoC: pxa: corgi: " Charles Keepax
2014-02-17 16:51 ` [PATCH 13/15] ASoC: pxa: magician: " Charles Keepax
2014-02-17 16:51 ` [PATCH 14/15] ASoC: pxa: spitz: " Charles Keepax
2014-02-17 16:51 ` [PATCH 15/15] ASoC: pxa: tosa: " Charles Keepax
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=1392655903-24537-7-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox