From 220d9f259536e22afef30347b7b42148640282a7 Mon Sep 17 00:00:00 2001 From: Javier Martin Date: Thu, 12 Jan 2012 12:30:38 +0100 Subject: ASoC: Fix DMA channel leak in imx-pcm-dma-mx2 driver. "snd_imx_pcm_hw_params" callback can be called several times by the user (i.e. OSS emulation) leading to a DMA channel leak. Signed-off-by: Javier Martin Signed-off-by: Mark Brown --- sound/soc/imx/imx-pcm-dma-mx2.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'sound') diff --git a/sound/soc/imx/imx-pcm-dma-mx2.c b/sound/soc/imx/imx-pcm-dma-mx2.c index 1cf2fe889f6..7d7fbb5d2a9 100644 --- a/sound/soc/imx/imx-pcm-dma-mx2.c +++ b/sound/soc/imx/imx-pcm-dma-mx2.c @@ -88,11 +88,13 @@ static int imx_ssi_dma_alloc(struct snd_pcm_substream *substream, iprtd->dma_data.dma_request = dma_params->dma; /* Try to grab a DMA channel */ - dma_cap_zero(mask); - dma_cap_set(DMA_SLAVE, mask); - iprtd->dma_chan = dma_request_channel(mask, filter, iprtd); - if (!iprtd->dma_chan) - return -EINVAL; + if (!iprtd->dma_chan) { + dma_cap_zero(mask); + dma_cap_set(DMA_SLAVE, mask); + iprtd->dma_chan = dma_request_channel(mask, filter, iprtd); + if (!iprtd->dma_chan) + return -EINVAL; + } switch (params_format(params)) { case SNDRV_PCM_FORMAT_S16_LE: -- cgit v1.2.3 From f7cb8a4be1cb46b03ccf517d505b3474c810853d Mon Sep 17 00:00:00 2001 From: Zeng Zhaoming Date: Mon, 16 Jan 2012 15:18:11 +0800 Subject: ASoC: sgtl5000: update author email address Update MODULE_AUTHOR email address. Signed-off-by: Zeng Zhaoming Signed-off-by: Mark Brown --- sound/soc/codecs/sgtl5000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound') diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index fc9b127206e..a809d7025c5 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -1457,5 +1457,5 @@ static void __exit sgtl5000_exit(void) module_exit(sgtl5000_exit); MODULE_DESCRIPTION("Freescale SGTL5000 ALSA SoC Codec Driver"); -MODULE_AUTHOR("Zeng Zhaoming "); +MODULE_AUTHOR("Zeng Zhaoming "); MODULE_LICENSE("GPL"); -- cgit v1.2.3 From e7c80e2a8b403c10d805f48596efac741cce754d Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Mon, 16 Jan 2012 15:23:31 +0000 Subject: ASoC: dapm - Fix check for codec context in dapm_power_widgets(). Fixes a NULL pointer dereference in dapm_power_widgets() if the dapm context has no codec. Signed-off-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/soc-dapm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound') diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 3ad1f59b802..1f55ded4047 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -1426,7 +1426,7 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event) dapm->target_bias_level = SND_SOC_BIAS_ON; break; case SND_SOC_DAPM_STREAM_STOP: - if (dapm->codec->active) + if (dapm->codec && dapm->codec->active) dapm->target_bias_level = SND_SOC_BIAS_ON; else dapm->target_bias_level = SND_SOC_BIAS_STANDBY; -- cgit v1.2.3 From 675c496ba4e751ea5b895c83219e3bb034f648ba Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Mon, 16 Jan 2012 15:25:37 +0000 Subject: ASoC: core - Free platform DAPM context at platform removal. Fix platform removal by freeing the platform DAPM resources and remove it from the DAPM list. Signed-off-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/soc-core.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sound') diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 3986520b467..b5ecf6d2321 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -907,6 +907,10 @@ static void soc_remove_dai_link(struct snd_soc_card *card, int num, int order) if (err < 0) printk(KERN_ERR "asoc: failed to remove %s\n", platform->name); } + + /* Make sure all DAPM widgets are freed */ + snd_soc_dapm_free(&platform->dapm); + platform->probed = 0; list_del(&platform->card_list); module_put(platform->dev->driver->owner); -- cgit v1.2.3 From 986b2f2c21b308e21160a40359b81370f8fee6ec Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Tue, 17 Jan 2012 16:28:59 +0000 Subject: ASoC: Wait for WM8993 FLL to stabilise Ensure the FLL is locked before we return from set_fll(). Signed-off-by: Mark Brown --- sound/soc/codecs/wm8993.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sound') diff --git a/sound/soc/codecs/wm8993.c b/sound/soc/codecs/wm8993.c index 2b40c93601e..7c7fd925db8 100644 --- a/sound/soc/codecs/wm8993.c +++ b/sound/soc/codecs/wm8993.c @@ -444,6 +444,12 @@ static int _wm8993_set_fll(struct snd_soc_codec *codec, int fll_id, int source, /* Enable the FLL */ snd_soc_write(codec, WM8993_FLL_CONTROL_1, reg1 | WM8993_FLL_ENA); + /* Both overestimates */ + if (Fref < 1000000) + msleep(3); + else + msleep(1); + dev_dbg(codec->dev, "FLL enabled at %dHz->%dHz\n", Fref, Fout); wm8993->fll_fref = Fref; -- cgit v1.2.3