summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2012-06-11 11:27:19 -0600
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-06-12 11:38:48 +0800
commit3419ae781f1592b3d367107db6500090495490cd (patch)
treecdf058925b8126d184fd6dfaa003e2128ca730de /sound
parent9c699e0a9566cfb6245284ce4857d7a06b02f3b1 (diff)
downloadop-kernel-dev-3419ae781f1592b3d367107db6500090495490cd.zip
op-kernel-dev-3419ae781f1592b3d367107db6500090495490cd.tar.gz
ASoC: tegra+wm8903: turn of mic detect when card is removed
If mic detect is left enabled and the WM8903 detects a status change, the WM8903 driver will make a callback against the free()d jack, which will cause a crash. This problem can be triggered by fully initializing an audio card, then removing and re-inserting the machine driver module. Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/tegra/tegra_wm8903.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sound/soc/tegra/tegra_wm8903.c b/sound/soc/tegra/tegra_wm8903.c
index 0b0df49..3b6da91 100644
--- a/sound/soc/tegra/tegra_wm8903.c
+++ b/sound/soc/tegra/tegra_wm8903.c
@@ -346,6 +346,17 @@ static int tegra_wm8903_init(struct snd_soc_pcm_runtime *rtd)
return 0;
}
+static int tegra_wm8903_remove(struct snd_soc_card *card)
+{
+ struct snd_soc_pcm_runtime *rtd = &(card->rtd[0]);
+ struct snd_soc_dai *codec_dai = rtd->codec_dai;
+ struct snd_soc_codec *codec = codec_dai->codec;
+
+ wm8903_mic_detect(codec, NULL, 0, 0);
+
+ return 0;
+}
+
static struct snd_soc_dai_link tegra_wm8903_dai = {
.name = "WM8903",
.stream_name = "WM8903 PCM",
@@ -363,6 +374,8 @@ static struct snd_soc_card snd_soc_tegra_wm8903 = {
.dai_link = &tegra_wm8903_dai,
.num_links = 1,
+ .remove = tegra_wm8903_remove,
+
.controls = tegra_wm8903_controls,
.num_controls = ARRAY_SIZE(tegra_wm8903_controls),
.dapm_widgets = tegra_wm8903_dapm_widgets,
OpenPOWER on IntegriCloud