From cb6f66a2d278e57a6c9d8fb59bd9ebd8ab3965c2 Mon Sep 17 00:00:00 2001 From: Chih-Chung Chang Date: Mon, 15 Jul 2013 09:38:46 -0700 Subject: ASoC: max98088 - fix element type of the register cache. The registers of max98088 are 8 bits, not 16 bits. This bug causes the contents of registers to be overwritten with bad values when the codec is suspended and then resumed. Signed-off-by: Chih-Chung Chang Signed-off-by: Dylan Reid Signed-off-by: Mark Brown Cc: stable@vger.kernel.org --- sound/soc/codecs/max98088.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound') diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c index 3eeada57e87d..566a367c94fa 100644 --- a/sound/soc/codecs/max98088.c +++ b/sound/soc/codecs/max98088.c @@ -1612,7 +1612,7 @@ static int max98088_dai2_digital_mute(struct snd_soc_dai *codec_dai, int mute) static void max98088_sync_cache(struct snd_soc_codec *codec) { - u16 *reg_cache = codec->reg_cache; + u8 *reg_cache = codec->reg_cache; int i; if (!codec->cache_sync) -- cgit v1.2.3-59-g8ed1b From 46a5905e1cd4a9d9d238ec7beece49ce49e2ad85 Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Tue, 16 Jul 2013 09:17:27 +0800 Subject: ASoC: sgtl5000: defer the probe if clock is not found It's not always the case that clock is already available when sgtl5000 get probed at the first time, e.g. the clock is provided by CPU DAI which may be probed after sgtl5000. So let's defer the probe when devm_clk_get() call fails and give it chance to try later. It fixes the regression on imx28 since commit 9e13f34 (ASoC: sgtl5000: Let the codec acquire its clock). [ 1.927637] sgtl5000 0-000a: Failed to get mclock: -2 [ 1.934280] sgtl5000: probe of 0-000a failed with error -2 [ 1.945906] mxs-sgtl5000 sound.13: ASoC: CODEC (null) not registered [ 1.953787] mxs-sgtl5000 sound.13: snd_soc_register_card failed (-517) [ 1.960865] platform sound.13: Driver mxs-sgtl5000 requests probe deferral Signed-off-by: Shawn Guo Signed-off-by: Mark Brown --- sound/soc/codecs/sgtl5000.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sound') diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index d659d3adcfb3..6c8a9e7bee25 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -1527,6 +1527,9 @@ static int sgtl5000_i2c_probe(struct i2c_client *client, if (IS_ERR(sgtl5000->mclk)) { ret = PTR_ERR(sgtl5000->mclk); dev_err(&client->dev, "Failed to get mclock: %d\n", ret); + /* Defer the probe to see if the clk will be provided later */ + if (ret == -ENOENT) + return -EPROBE_DEFER; return ret; } -- cgit v1.2.3-59-g8ed1b From 83e2e4eeb85fd45ff592b79ea11a19df49df872e Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Fri, 19 Jul 2013 09:53:25 -0700 Subject: ASoC: ep93xx: fix build of ep93xx-ac97.c Fix the build of this driver. It was broken by: Commit 453807f3006757a5661c4000262d7d9284b5214c ASoC: ep93xx: Use ep93xx_dma_params instead of ep93xx_pcm_dma_params The removed struct ep93xx_pcm_dma_params use the member 'dma_port' to select the dma channel. The struct ep93xx_dma_data uses the member 'port'. Signed-off-by: H Hartley Sweeten Cc: Ryan Mallon Cc: Lars-Peter Clausen Cc: Mark Brown Cc: Liam Girdwood Cc: Jaroslav Kysela Cc: Takashi Iwai Signed-off-by: Mark Brown --- sound/soc/cirrus/ep93xx-ac97.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sound') diff --git a/sound/soc/cirrus/ep93xx-ac97.c b/sound/soc/cirrus/ep93xx-ac97.c index ac73c607410a..04491f0e8d1b 100644 --- a/sound/soc/cirrus/ep93xx-ac97.c +++ b/sound/soc/cirrus/ep93xx-ac97.c @@ -102,13 +102,13 @@ static struct ep93xx_ac97_info *ep93xx_ac97_info; static struct ep93xx_dma_data ep93xx_ac97_pcm_out = { .name = "ac97-pcm-out", - .dma_port = EP93XX_DMA_AAC1, + .port = EP93XX_DMA_AAC1, .direction = DMA_MEM_TO_DEV, }; static struct ep93xx_dma_data ep93xx_ac97_pcm_in = { .name = "ac97-pcm-in", - .dma_port = EP93XX_DMA_AAC1, + .port = EP93XX_DMA_AAC1, .direction = DMA_DEV_TO_MEM, }; -- cgit v1.2.3-59-g8ed1b From b5c745fb75b7e5ab06e9c99d63427595a234cc89 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 22 Jul 2013 09:56:54 +0300 Subject: ASoC: core: double free in snd_soc_add_platform() There are three callers for this function, and none of them want it to free platform for them. It leads to a double free. Signed-off-by: Dan Carpenter Signed-off-by: Mark Brown --- sound/soc/soc-core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sound') diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 0ec070cf7231..d82ee386eab5 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3908,10 +3908,8 @@ int snd_soc_add_platform(struct device *dev, struct snd_soc_platform *platform, { /* create platform component name */ platform->name = fmt_single_name(dev, &platform->id); - if (platform->name == NULL) { - kfree(platform); + if (platform->name == NULL) return -ENOMEM; - } platform->dev = dev; platform->driver = platform_drv; -- cgit v1.2.3-59-g8ed1b From 647ab784c507763bfda79155f125b6edd1244806 Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Sun, 21 Jul 2013 10:34:09 +0800 Subject: ASoC: tegra: correct playback_dma_data setup The errors were caused by copy/paste mistake in below commit since v3.10: 3489d50 ASoC: tegra: Use common DAI DMA data struct It also corrects slave_id initialization in tegra20_ac97 driver. Signed-off-by: Richard Zhao Acked-by: Stephen Warren Acked-by: Lucas Stach Signed-off-by: Mark Brown Cc: # 3.10 --- sound/soc/tegra/tegra20_ac97.c | 6 +++--- sound/soc/tegra/tegra20_spdif.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'sound') diff --git a/sound/soc/tegra/tegra20_ac97.c b/sound/soc/tegra/tegra20_ac97.c index e58233f7df61..6c486625321b 100644 --- a/sound/soc/tegra/tegra20_ac97.c +++ b/sound/soc/tegra/tegra20_ac97.c @@ -389,9 +389,9 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev) ac97->capture_dma_data.slave_id = of_dma[1]; ac97->playback_dma_data.addr = mem->start + TEGRA20_AC97_FIFO_TX1; - ac97->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; - ac97->capture_dma_data.maxburst = 4; - ac97->capture_dma_data.slave_id = of_dma[0]; + ac97->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; + ac97->playback_dma_data.maxburst = 4; + ac97->playback_dma_data.slave_id = of_dma[1]; ret = tegra_asoc_utils_init(&ac97->util_data, &pdev->dev); if (ret) diff --git a/sound/soc/tegra/tegra20_spdif.c b/sound/soc/tegra/tegra20_spdif.c index 5eaa12cdc6eb..551b3c93ce93 100644 --- a/sound/soc/tegra/tegra20_spdif.c +++ b/sound/soc/tegra/tegra20_spdif.c @@ -323,8 +323,8 @@ static int tegra20_spdif_platform_probe(struct platform_device *pdev) } spdif->playback_dma_data.addr = mem->start + TEGRA20_SPDIF_DATA_OUT; - spdif->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; - spdif->capture_dma_data.maxburst = 4; + spdif->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; + spdif->playback_dma_data.maxburst = 4; spdif->playback_dma_data.slave_id = dmareq->start; pm_runtime_enable(&pdev->dev); -- cgit v1.2.3-59-g8ed1b