From efd6947945fe5ebcf759e762f51c4e1d867edc49 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Fri, 18 Mar 2011 12:47:33 +0100 Subject: ASoC: zylonite: set .codec_dai_name in initializer Fix the initialization of .codec_dai_name in zylonite_dai initializer, do not mix it with the initialization of .codec_name which is set already a few lines above. Signed-off-by: Antonio Ospite Acked-by: Eric Miao Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/pxa/zylonite.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sound') diff --git a/sound/soc/pxa/zylonite.c b/sound/soc/pxa/zylonite.c index ac577263b3e3..b6445757fc54 100644 --- a/sound/soc/pxa/zylonite.c +++ b/sound/soc/pxa/zylonite.c @@ -167,7 +167,7 @@ static struct snd_soc_dai_link zylonite_dai[] = { .codec_name = "wm9713-codec", .platform_name = "pxa-pcm-audio", .cpu_dai_name = "pxa2xx-ac97", - .codec_name = "wm9713-hifi", + .codec_dai_name = "wm9713-hifi", .init = zylonite_wm9713_init, }, { @@ -176,7 +176,7 @@ static struct snd_soc_dai_link zylonite_dai[] = { .codec_name = "wm9713-codec", .platform_name = "pxa-pcm-audio", .cpu_dai_name = "pxa2xx-ac97-aux", - .codec_name = "wm9713-aux", + .codec_dai_name = "wm9713-aux", }, { .name = "WM9713 Voice", @@ -184,7 +184,7 @@ static struct snd_soc_dai_link zylonite_dai[] = { .codec_name = "wm9713-codec", .platform_name = "pxa-pcm-audio", .cpu_dai_name = "pxa-ssp-dai.2", - .codec_name = "wm9713-voice", + .codec_dai_name = "wm9713-voice", .ops = &zylonite_voice_ops, }, }; -- cgit v1.2.3 From 97c96c076b8ef86533f2427ea145a9cd0ec5564f Mon Sep 17 00:00:00 2001 From: Vasily Khoruzhick Date: Sat, 2 Apr 2011 10:54:47 +0300 Subject: ASoC: PXA: Fix oops in __pxa2xx_pcm_prepare pxa2xx_pcm_hw_free frees dma channel and sets prtd->dma_ch to -1, but does not set prtd->params to NULL, so if pxa2xx_pcm_hw_params will be called immediately, it leaves prtd->dma_ch initialized with -1, and it results in oops in __pxa2xx_pcm_prepare. This bug is triggered via SDL. This patch adds check for prtd->dma_ch to __pxa2xx_pcm_prepare and cleans prtd->params, so now it works properly. Signed-off-by: Vasily Khoruzhick Signed-off-by: Mark Brown --- sound/arm/pxa2xx-pcm-lib.c | 3 +++ sound/soc/pxa/pxa2xx-pcm.c | 1 + 2 files changed, 4 insertions(+) (limited to 'sound') diff --git a/sound/arm/pxa2xx-pcm-lib.c b/sound/arm/pxa2xx-pcm-lib.c index 8808b82311b1..76e0d5695075 100644 --- a/sound/arm/pxa2xx-pcm-lib.c +++ b/sound/arm/pxa2xx-pcm-lib.c @@ -140,6 +140,9 @@ int __pxa2xx_pcm_prepare(struct snd_pcm_substream *substream) if (!prtd || !prtd->params) return 0; + if (prtd->dma_ch == -1) + return -EINVAL; + DCSR(prtd->dma_ch) &= ~DCSR_RUN; DCSR(prtd->dma_ch) = 0; DCMD(prtd->dma_ch) = 0; diff --git a/sound/soc/pxa/pxa2xx-pcm.c b/sound/soc/pxa/pxa2xx-pcm.c index 02fb66416ddc..2ce0b2d891d5 100644 --- a/sound/soc/pxa/pxa2xx-pcm.c +++ b/sound/soc/pxa/pxa2xx-pcm.c @@ -65,6 +65,7 @@ static int pxa2xx_pcm_hw_free(struct snd_pcm_substream *substream) if (prtd->dma_ch >= 0) { pxa_free_dma(prtd->dma_ch); prtd->dma_ch = -1; + prtd->params = NULL; } return 0; -- cgit v1.2.3 From 00b317a41c5428b13eb7e5b4bbc691b1aa7afa80 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Fri, 1 Apr 2011 14:50:44 -0600 Subject: ASoC: format_register_str: Don't clip register values wordsize is used as the textual width of a register address. regsize is used as the textual width of a register value. The assignments to these values were swapped. In the case of WM8903, which has 8-bit register addresses and 16-bit register values, this caused the register values to be clipped to 2 digits instead of the full 4. Signed-off-by: Stephen Warren Signed-off-by: Mark Brown --- sound/soc/soc-core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sound') diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 4dda58926bc5..b76b74db0968 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -92,8 +92,8 @@ static int min_bytes_needed(unsigned long val) static int format_register_str(struct snd_soc_codec *codec, unsigned int reg, char *buf, size_t len) { - int wordsize = codec->driver->reg_word_size * 2; - int regsize = min_bytes_needed(codec->driver->reg_cache_size) * 2; + int wordsize = min_bytes_needed(codec->driver->reg_cache_size) * 2; + int regsize = codec->driver->reg_word_size * 2; int ret; char tmpbuf[len + 1]; char regbuf[regsize + 1]; @@ -132,8 +132,8 @@ static ssize_t soc_codec_reg_show(struct snd_soc_codec *codec, char *buf, size_t total = 0; loff_t p = 0; - wordsize = codec->driver->reg_word_size * 2; - regsize = min_bytes_needed(codec->driver->reg_cache_size) * 2; + wordsize = min_bytes_needed(codec->driver->reg_cache_size) * 2; + regsize = codec->driver->reg_word_size * 2; len = wordsize + regsize + 2 + 1; -- cgit v1.2.3