From e31c194672c8e700483f4be6037e12d507a9e05b Mon Sep 17 00:00:00 2001 From: Charles Keepax Date: Mon, 7 Jan 2013 16:41:45 +0000 Subject: ASoC: arizona: Disable free-running mode on FLL1 The free running mode can cause problems when attempting to bring up the FLL running from a defined clock source. This patch disables free-running mode. Signed-off-by: Charles Keepax Signed-off-by: Mark Brown --- sound/soc/codecs/arizona.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sound') diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c index 1d8bb5917594..c3592db994a8 100644 --- a/sound/soc/codecs/arizona.c +++ b/sound/soc/codecs/arizona.c @@ -1082,6 +1082,9 @@ int arizona_init_fll(struct arizona *arizona, int id, int base, int lock_irq, id, ret); } + regmap_update_bits(arizona->regmap, fll->base + 1, + ARIZONA_FLL1_FREERUN, 0); + return 0; } EXPORT_SYMBOL_GPL(arizona_init_fll); -- cgit v1.2.3 From 25b8d31488a3fb3611651991969526b2ea475764 Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Thu, 10 Jan 2013 23:43:56 +0800 Subject: ASoC: fsl: fix multiple definition of init_module With commit f2818d0 (ASoC: fsl: fix miscompilation of snd-soc-imx-pcm), we will see the following build error when building modules with CONFIG_SND_IMX_SOC=m in imx_v6_v7_defconfig. CC [M] sound/soc/fsl/phycore-ac97.o LD [M] sound/soc/fsl/snd-soc-fsl-ssi.o LD [M] sound/soc/fsl/snd-soc-fsl-utils.o LD [M] sound/soc/fsl/snd-soc-imx-ssi.o LD [M] sound/soc/fsl/snd-soc-imx-audmux.o LD [M] sound/soc/fsl/snd-soc-imx-pcm.o sound/soc/fsl/imx-pcm-dma.o: In function `init_module': imx-pcm-dma.c:(.init.text+0x0): multiple definition of `init_module' sound/soc/fsl/imx-pcm-fiq.o:imx-pcm-fiq.c:(.init.text+0x0): first defined here sound/soc/fsl/imx-pcm-dma.o: In function `cleanup_module': imx-pcm-dma.c:(.exit.text+0x0): multiple definition of `cleanup_module' sound/soc/fsl/imx-pcm-fiq.o:imx-pcm-fiq.c:(.exit.text+0x0): first defined here make[4]: *** [sound/soc/fsl/snd-soc-imx-pcm.o] Error 1 Instead of using bool for SND_SOC_IMX_PCM_FIQ and SND_SOC_IMX_PCM_DMA to fix the original issue, we should completely remove SND_SOC_IMX_PCM and have imx-pcm.o statically linked with imx-pcm-fiq.o or imx-pcm-dma.o. Signed-off-by: Shawn Guo Signed-off-by: Mark Brown --- sound/soc/fsl/Kconfig | 9 ++------- sound/soc/fsl/Makefile | 5 ++++- sound/soc/fsl/imx-pcm.c | 3 --- 3 files changed, 6 insertions(+), 11 deletions(-) (limited to 'sound') diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig index 3b98159d9645..a210c8d7b4bc 100644 --- a/sound/soc/fsl/Kconfig +++ b/sound/soc/fsl/Kconfig @@ -108,18 +108,13 @@ if SND_IMX_SOC config SND_SOC_IMX_SSI tristate -config SND_SOC_IMX_PCM - tristate - config SND_SOC_IMX_PCM_FIQ - bool + tristate select FIQ - select SND_SOC_IMX_PCM config SND_SOC_IMX_PCM_DMA - bool + tristate select SND_SOC_DMAENGINE_PCM - select SND_SOC_IMX_PCM config SND_SOC_IMX_AUDMUX tristate diff --git a/sound/soc/fsl/Makefile b/sound/soc/fsl/Makefile index afd34794db53..ec1457915d7c 100644 --- a/sound/soc/fsl/Makefile +++ b/sound/soc/fsl/Makefile @@ -41,7 +41,10 @@ endif obj-$(CONFIG_SND_SOC_IMX_SSI) += snd-soc-imx-ssi.o obj-$(CONFIG_SND_SOC_IMX_AUDMUX) += snd-soc-imx-audmux.o -obj-$(CONFIG_SND_SOC_IMX_PCM) += snd-soc-imx-pcm.o +obj-$(CONFIG_SND_SOC_IMX_PCM_FIQ) += snd-soc-imx-pcm-fiq.o +snd-soc-imx-pcm-fiq-y := imx-pcm-fiq.o imx-pcm.o +obj-$(CONFIG_SND_SOC_IMX_PCM_DMA) += snd-soc-imx-pcm-dma.o +snd-soc-imx-pcm-dma-y := imx-pcm-dma.o imx-pcm.o # i.MX Machine Support snd-soc-eukrea-tlv320-objs := eukrea-tlv320.o diff --git a/sound/soc/fsl/imx-pcm.c b/sound/soc/fsl/imx-pcm.c index d5cd9eff3b48..0c9f188ddc68 100644 --- a/sound/soc/fsl/imx-pcm.c +++ b/sound/soc/fsl/imx-pcm.c @@ -31,7 +31,6 @@ int snd_imx_pcm_mmap(struct snd_pcm_substream *substream, runtime->dma_bytes); return ret; } -EXPORT_SYMBOL_GPL(snd_imx_pcm_mmap); static int imx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream) { @@ -80,7 +79,6 @@ int imx_pcm_new(struct snd_soc_pcm_runtime *rtd) out: return ret; } -EXPORT_SYMBOL_GPL(imx_pcm_new); void imx_pcm_free(struct snd_pcm *pcm) { @@ -102,7 +100,6 @@ void imx_pcm_free(struct snd_pcm *pcm) buf->area = NULL; } } -EXPORT_SYMBOL_GPL(imx_pcm_free); MODULE_DESCRIPTION("Freescale i.MX PCM driver"); MODULE_AUTHOR("Sascha Hauer "); -- cgit v1.2.3 From 8784c77a6cb8e0e9aaec3b3438d1016348342b7f Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Thu, 10 Jan 2013 19:33:47 +0000 Subject: ASoC: dapm: Fix sense of regulator bypass mode Enable bypass when the regulator is idle, not when it is in use. This is consistent with what the few existing users actually want. Signed-off-by: Mark Brown --- sound/soc/soc-dapm.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'sound') diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 1e36bc81e5af..258acadb9e7d 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -1023,7 +1023,7 @@ int dapm_regulator_event(struct snd_soc_dapm_widget *w, if (SND_SOC_DAPM_EVENT_ON(event)) { if (w->invert & SND_SOC_DAPM_REGULATOR_BYPASS) { - ret = regulator_allow_bypass(w->regulator, true); + ret = regulator_allow_bypass(w->regulator, false); if (ret != 0) dev_warn(w->dapm->dev, "ASoC: Failed to bypass %s: %d\n", @@ -1033,7 +1033,7 @@ int dapm_regulator_event(struct snd_soc_dapm_widget *w, return regulator_enable(w->regulator); } else { if (w->invert & SND_SOC_DAPM_REGULATOR_BYPASS) { - ret = regulator_allow_bypass(w->regulator, false); + ret = regulator_allow_bypass(w->regulator, true); if (ret != 0) dev_warn(w->dapm->dev, "ASoC: Failed to unbypass %s: %d\n", @@ -3039,6 +3039,14 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm, w->name, ret); return NULL; } + + if (w->invert & SND_SOC_DAPM_REGULATOR_BYPASS) { + ret = regulator_allow_bypass(w->regulator, true); + if (ret != 0) + dev_warn(w->dapm->dev, + "ASoC: Failed to unbypass %s: %d\n", + w->name, ret); + } break; case snd_soc_dapm_clock_supply: #ifdef CONFIG_CLKDEV_LOOKUP -- cgit v1.2.3 From 7f39bb9e9f076f7e3cba89c987892eb573475d9a Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Fri, 11 Jan 2013 13:31:52 +0000 Subject: ASoC: wm5102: Correct AEC loopback mask The generated defines in the header are pre-shifted. Reported-by: Heather Lomond Signed-off-by: Mark Brown --- sound/soc/codecs/wm5102.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c index 7a9048dad1cd..1440b3f9b7bb 100644 --- a/sound/soc/codecs/wm5102.c +++ b/sound/soc/codecs/wm5102.c @@ -896,8 +896,7 @@ static const unsigned int wm5102_aec_loopback_values[] = { static const struct soc_enum wm5102_aec_loopback = SOC_VALUE_ENUM_SINGLE(ARIZONA_DAC_AEC_CONTROL_1, - ARIZONA_AEC_LOOPBACK_SRC_SHIFT, - ARIZONA_AEC_LOOPBACK_SRC_MASK, + ARIZONA_AEC_LOOPBACK_SRC_SHIFT, 0xf, ARRAY_SIZE(wm5102_aec_loopback_texts), wm5102_aec_loopback_texts, wm5102_aec_loopback_values); -- cgit v1.2.3 From 7d5cb4f7105e7cf12e58e6df5af0cbdb11060bca Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Fri, 11 Jan 2013 13:32:00 +0000 Subject: ASoC: wm5110: Correct AEC loopback mask The generated defines in the header are pre-shifted. Signed-off-by: Mark Brown --- sound/soc/codecs/wm5110.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c index ae80c8c28536..7a090968c4f7 100644 --- a/sound/soc/codecs/wm5110.c +++ b/sound/soc/codecs/wm5110.c @@ -344,8 +344,7 @@ static const unsigned int wm5110_aec_loopback_values[] = { static const struct soc_enum wm5110_aec_loopback = SOC_VALUE_ENUM_SINGLE(ARIZONA_DAC_AEC_CONTROL_1, - ARIZONA_AEC_LOOPBACK_SRC_SHIFT, - ARIZONA_AEC_LOOPBACK_SRC_MASK, + ARIZONA_AEC_LOOPBACK_SRC_SHIFT, 0xf, ARRAY_SIZE(wm5110_aec_loopback_texts), wm5110_aec_loopback_texts, wm5110_aec_loopback_values); -- cgit v1.2.3 From a80cc734282805e15b5e023751a4d02f7ffbcc91 Mon Sep 17 00:00:00 2001 From: Chris Rattray Date: Tue, 15 Jan 2013 13:22:36 +0000 Subject: ASoC: wm2200: correct mixer values and text Signed-off-by: Chris Rattray Signed-off-by: Mark Brown Cc: stable@vger.kernel.org --- sound/soc/codecs/wm2200.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/wm2200.c b/sound/soc/codecs/wm2200.c index e6cefe1ac677..d8c65f574658 100644 --- a/sound/soc/codecs/wm2200.c +++ b/sound/soc/codecs/wm2200.c @@ -1019,8 +1019,6 @@ static const char *wm2200_mixer_texts[] = { "EQR", "LHPF1", "LHPF2", - "LHPF3", - "LHPF4", "DSP1.1", "DSP1.2", "DSP1.3", @@ -1053,7 +1051,6 @@ static int wm2200_mixer_values[] = { 0x25, 0x50, /* EQ */ 0x51, - 0x52, 0x60, /* LHPF1 */ 0x61, /* LHPF2 */ 0x68, /* DSP1 */ -- cgit v1.2.3 From b59e0f82aa350e380142353fbd30706092ba6312 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Thu, 17 Jan 2013 14:15:59 +0900 Subject: ASoC: arizona: Use actual rather than desired BCLK when calculating LRCLK Otherwise we'll get the wrong LRCLK if we need to pick a higher BCLK than is required. Signed-off-by: Mark Brown Cc: stable@vger.kernel.org --- sound/soc/codecs/arizona.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound') diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c index c3592db994a8..ef62c435848e 100644 --- a/sound/soc/codecs/arizona.c +++ b/sound/soc/codecs/arizona.c @@ -685,7 +685,7 @@ static int arizona_hw_params(struct snd_pcm_substream *substream, } sr_val = i; - lrclk = snd_soc_params_to_bclk(params) / params_rate(params); + lrclk = rates[bclk] / params_rate(params); arizona_aif_dbg(dai, "BCLK %dHz LRCLK %dHz\n", rates[bclk], rates[bclk] / lrclk); -- cgit v1.2.3 From 7881fd0fb3ecc9e367ba998a4de533e7eecbdfeb Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Sun, 20 Jan 2013 19:01:03 +0900 Subject: ASoC: wm_adsp: Use GFP_DMA for things that may be DMAed Normally kmalloc() returns things that are DMA safe so not visible on all platforms but we do need to explicitly request DMA safe memory. Signed-off-by: Mark Brown --- sound/soc/codecs/wm_adsp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index 7b198c38f3ef..4196f2d54967 100644 --- a/sound/soc/codecs/wm_adsp.c +++ b/sound/soc/codecs/wm_adsp.c @@ -324,7 +324,7 @@ static int wm_adsp_load(struct wm_adsp *dsp) if (reg) { buf = kmemdup(region->data, le32_to_cpu(region->len), - GFP_KERNEL); + GFP_KERNEL | GFP_DMA); if (!buf) { adsp_err(dsp, "Out of memory\n"); return -ENOMEM; @@ -439,7 +439,7 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp) if (reg) { buf = kmemdup(blk->data, le32_to_cpu(blk->len), - GFP_KERNEL); + GFP_KERNEL | GFP_DMA); if (!buf) { adsp_err(dsp, "Out of memory\n"); return -ENOMEM; -- cgit v1.2.3 From a4cdbec758d2491a86ba94263b847768fa004fde Mon Sep 17 00:00:00 2001 From: Charles Keepax Date: Mon, 21 Jan 2013 09:02:31 +0000 Subject: ASoC: wm_adsp: Release firmware on error This patch correctly releases the firmware if the magic string in the firmware header does not match. Signed-off-by: Charles Keepax Signed-off-by: Mark Brown --- sound/soc/codecs/wm_adsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound') diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index 4196f2d54967..b6b654837585 100644 --- a/sound/soc/codecs/wm_adsp.c +++ b/sound/soc/codecs/wm_adsp.c @@ -396,7 +396,7 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp) hdr = (void*)&firmware->data[0]; if (memcmp(hdr->magic, "WMDR", 4) != 0) { adsp_err(dsp, "%s: invalid magic\n", file); - return -EINVAL; + goto out_fw; } adsp_dbg(dsp, "%s: v%d.%d.%d\n", file, -- cgit v1.2.3