From 8575d93386d6ce9a3d4961134018d4e6c6bed618 Mon Sep 17 00:00:00 2001 From: Vasiliy Kulikov Date: Sun, 21 Nov 2010 20:40:21 +0300 Subject: [PATCH 01/49] ASoC: s3c24xx: test wrong variable After clk_get() mclk is checked three times instead of mout_epll and sclk_spdif checks. Signed-off-by: Vasiliy Kulikov Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/s3c24xx/smdk_spdif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/s3c24xx/smdk_spdif.c b/sound/soc/s3c24xx/smdk_spdif.c index f31d22ad7c88..c8bd90488a87 100644 --- a/sound/soc/s3c24xx/smdk_spdif.c +++ b/sound/soc/s3c24xx/smdk_spdif.c @@ -38,7 +38,7 @@ static int set_audio_clock_heirachy(struct platform_device *pdev) } mout_epll = clk_get(NULL, "mout_epll"); - if (IS_ERR(fout_epll)) { + if (IS_ERR(mout_epll)) { printk(KERN_WARNING "%s: Cannot find mout_epll.\n", __func__); ret = -EINVAL; @@ -54,7 +54,7 @@ static int set_audio_clock_heirachy(struct platform_device *pdev) } sclk_spdif = clk_get(NULL, "sclk_spdif"); - if (IS_ERR(fout_epll)) { + if (IS_ERR(sclk_spdif)) { printk(KERN_WARNING "%s: Cannot find sclk_spdif.\n", __func__); ret = -EINVAL; From 13a2e06c5898d27aadabfdb9830169101b21432f Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Mon, 22 Nov 2010 08:20:54 +0800 Subject: [PATCH 02/49] ASoC: stac9766 - set reg_cache_default to stac9766_reg Looks like this is missing during multi-component conversion. Signed-off-by: Axel Lin Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/codecs/stac9766.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/codecs/stac9766.c b/sound/soc/codecs/stac9766.c index 00d67cc8e206..061f9e5a497b 100644 --- a/sound/soc/codecs/stac9766.c +++ b/sound/soc/codecs/stac9766.c @@ -383,6 +383,7 @@ static struct snd_soc_codec_driver soc_codec_dev_stac9766 = { .reg_cache_size = sizeof(stac9766_reg), .reg_word_size = sizeof(u16), .reg_cache_step = 2, + .reg_cache_default = stac9766_reg, }; static __devinit int stac9766_probe(struct platform_device *pdev) From b3915d1fb6557dda206f4644ba9aa96ffd9a99d2 Mon Sep 17 00:00:00 2001 From: Vasiliy Kulikov Date: Mon, 22 Nov 2010 18:59:13 +0300 Subject: [PATCH 03/49] ASoC: atmel: test wrong variable After clk_get() mclk is checked second time instead of pllb check. In patch v1 Jarkko Nikula noticed that PTR_ERR() is also has wrong argument. Signed-off-by: Vasiliy Kulikov Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/atmel/sam9g20_wm8731.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c index 293569dfd0ed..032e17dd8fdb 100644 --- a/sound/soc/atmel/sam9g20_wm8731.c +++ b/sound/soc/atmel/sam9g20_wm8731.c @@ -222,9 +222,9 @@ static int __init at91sam9g20ek_init(void) } pllb = clk_get(NULL, "pllb"); - if (IS_ERR(mclk)) { + if (IS_ERR(pllb)) { printk(KERN_ERR "ASoC: Failed to get PLLB\n"); - ret = PTR_ERR(mclk); + ret = PTR_ERR(pllb); goto err_mclk; } ret = clk_set_parent(mclk, pllb); From f71a4734b1ad7edccbfd9bd395df328ebbd94287 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Mon, 22 Nov 2010 19:11:48 +0000 Subject: [PATCH 04/49] ASoC: Fix multi-component mismerge in WM8523 Signed-off-by: Mark Brown Acked-by: Liam Girdwood --- sound/soc/codecs/wm8523.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sound/soc/codecs/wm8523.c b/sound/soc/codecs/wm8523.c index 712ef7c76f90..9a433a5396cb 100644 --- a/sound/soc/codecs/wm8523.c +++ b/sound/soc/codecs/wm8523.c @@ -146,7 +146,6 @@ static int wm8523_startup(struct snd_pcm_substream *substream, return -EINVAL; } - return 0; snd_pcm_hw_constraint_list(substream->runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &wm8523->rate_constraint); From eba19fdd818dfec3782ff095591e51c9bd617403 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Fri, 19 Nov 2010 16:09:15 +0000 Subject: [PATCH 05/49] ASoC: Restore WM8994 volatile and readable register operations They went AWOL during the multi-component merge. Signed-off-by: Mark Brown Acked-by: Liam Girdwood --- sound/soc/codecs/wm8994.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 830dfdd66c5f..ea3ee9fde2b1 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c @@ -4073,6 +4073,8 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8994 = { .resume = wm8994_resume, .read = wm8994_read, .write = wm8994_write, + .readable_register = wm8994_readable, + .volatile_register = wm8994_volatile, .set_bias_level = wm8994_set_bias_level, }; From 92a5288501685bf05fc348ee2a3115a9bd9ae36f Mon Sep 17 00:00:00 2001 From: Jesper Juhl Date: Mon, 22 Nov 2010 22:54:03 +0100 Subject: [PATCH 06/49] ASoC: MPC5200: Eliminate duplicate include of of_device.h Eliminate duplicate #include from sound/soc/fsl/mpc5200_dma.c Signed-off-by: Jesper Juhl Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/fsl/mpc5200_dma.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sound/soc/fsl/mpc5200_dma.c b/sound/soc/fsl/mpc5200_dma.c index dce6b551cd78..f92dca07cd35 100644 --- a/sound/soc/fsl/mpc5200_dma.c +++ b/sound/soc/fsl/mpc5200_dma.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include From 7a479b02843c8d78ef51a64d1168592258440c97 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Tue, 23 Nov 2010 14:14:07 +0800 Subject: [PATCH 07/49] ASoC: Do not update the cache if write to hardware failed Signed-off-by: Axel Lin Acked-by: Peter Ujfalusi Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/codecs/tpa6130a2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c index ee4fb201de60..d2c243095673 100644 --- a/sound/soc/codecs/tpa6130a2.c +++ b/sound/soc/codecs/tpa6130a2.c @@ -78,8 +78,10 @@ static int tpa6130a2_i2c_write(int reg, u8 value) if (data->power_state) { val = i2c_smbus_write_byte_data(tpa6130a2_client, reg, value); - if (val < 0) + if (val < 0) { dev_err(&tpa6130a2_client->dev, "Write failed\n"); + return val; + } } /* Either powered on or off, we save the context */ From bc5954f00e80c55140f546c80f34a8660bdd2c5f Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Tue, 23 Nov 2010 15:56:21 +0800 Subject: [PATCH 08/49] ASoC: max98088 - fix a memory leak Signed-off-by: Axel Lin Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/codecs/max98088.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c index 470cb93b1d1f..d63e28773eb1 100644 --- a/sound/soc/codecs/max98088.c +++ b/sound/soc/codecs/max98088.c @@ -2019,7 +2019,10 @@ err_access: static int max98088_remove(struct snd_soc_codec *codec) { + struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec); + max98088_set_bias_level(codec, SND_SOC_BIAS_OFF); + kfree(max98088->eq_texts); return 0; } From cd70978cb59fd20dccdfc790ea8bb308c2dfd1d6 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Tue, 23 Nov 2010 15:57:49 +0800 Subject: [PATCH 09/49] ASoC: wm8904 - fix memory leaks Signed-off-by: Axel Lin Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/codecs/wm8904.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index 33be84e506ea..fca60a0b57b8 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c @@ -2498,6 +2498,8 @@ static int wm8904_remove(struct snd_soc_codec *codec) wm8904_set_bias_level(codec, SND_SOC_BIAS_OFF); regulator_bulk_free(ARRAY_SIZE(wm8904->supplies), wm8904->supplies); + kfree(wm8904->retune_mobile_texts); + kfree(wm8904->drc_texts); return 0; } From 24fb2b1174ddc1f844e2008eb5b3105832860395 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Tue, 23 Nov 2010 15:58:39 +0800 Subject: [PATCH 10/49] ASoC: wm8994 - fix memory leaks Signed-off-by: Axel Lin Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/codecs/wm8994.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index ea3ee9fde2b1..4d3e6f1ac584 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c @@ -4061,6 +4061,8 @@ static int wm8994_codec_remove(struct snd_soc_codec *codec) wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC2_DET, wm8994); wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC1_SHRT, wm8994); wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC1_DET, wm8994); + kfree(wm8994->retune_mobile_texts); + kfree(wm8994->drc_texts); kfree(wm8994); return 0; From 08b1a38465cab8c2224a5202c7a3b5e5f5630894 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Wed, 24 Nov 2010 10:20:33 +0800 Subject: [PATCH 11/49] ASoC: wm8961 - clear WM8961_DACSLOPE bit for normal mode DACSLOPE bit of Register 06h ADC and DAC Control 2: 0: Normal mode 1: Sloping stop-band mode Thus in the case of normal mode, we should clear DACSLOPE bit. Signed-off-by: Axel Lin Acked-by: Liam Girdwood Signed-off-by: Mark Brown Cc: stable@kernel.org --- sound/soc/codecs/wm8961.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/wm8961.c b/sound/soc/codecs/wm8961.c index 4f326f604104..93fecf5f94c6 100644 --- a/sound/soc/codecs/wm8961.c +++ b/sound/soc/codecs/wm8961.c @@ -711,7 +711,7 @@ static int wm8961_hw_params(struct snd_pcm_substream *substream, if (fs <= 24000) reg |= WM8961_DACSLOPE; else - reg &= WM8961_DACSLOPE; + reg &= ~WM8961_DACSLOPE; snd_soc_write(codec, WM8961_ADC_DAC_CONTROL_2, reg); return 0; From 2f7dceeda4708f470fd927adb3861bd8ebbe2310 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Wed, 24 Nov 2010 10:21:54 +0800 Subject: [PATCH 12/49] ASoC: wm8961 - clear WM8961_MCLKDIV bit for freq <= 16500000 MCLKDIV bit of Register 04h Clocking1: 0 : Divide by 1 1 : Divide by 2 Thus in the case of freq <= 16500000, we should clear MCLKDIV bit. Signed-off-by: Axel Lin Acked-by: Liam Girdwood Signed-off-by: Mark Brown Cc: stable@kernel.org --- sound/soc/codecs/wm8961.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/wm8961.c b/sound/soc/codecs/wm8961.c index 93fecf5f94c6..8340485c9851 100644 --- a/sound/soc/codecs/wm8961.c +++ b/sound/soc/codecs/wm8961.c @@ -736,7 +736,7 @@ static int wm8961_set_sysclk(struct snd_soc_dai *dai, int clk_id, freq /= 2; } else { dev_dbg(codec->dev, "Using MCLK/1 for %dHz MCLK\n", freq); - reg &= WM8961_MCLKDIV; + reg &= ~WM8961_MCLKDIV; } snd_soc_write(codec, WM8961_CLOCKING1, reg); From 5c12d20145ce30f9f8b7415d36dace5fb4dcc4f0 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Wed, 24 Nov 2010 15:20:48 +0800 Subject: [PATCH 13/49] ASoC: Return proper error for omap3pandora_soc_init Return PTR_ERR(omap3pandora_dac_reg) instead of 0 if regulator_get failed. Signed-off-by: Axel Lin Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/omap/omap3pandora.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/omap/omap3pandora.c b/sound/soc/omap/omap3pandora.c index dbd9d96b5f92..4ee33ce2cb98 100644 --- a/sound/soc/omap/omap3pandora.c +++ b/sound/soc/omap/omap3pandora.c @@ -306,6 +306,7 @@ static int __init omap3pandora_soc_init(void) pr_err(PREFIX "Failed to get DAC regulator from %s: %ld\n", dev_name(&omap3pandora_snd_device->dev), PTR_ERR(omap3pandora_dac_reg)); + ret = PTR_ERR(omap3pandora_dac_reg); goto fail3; } From d6f443ae4c1d54379ad5953d7bcb89a63387184d Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Wed, 24 Nov 2010 16:44:23 +0800 Subject: [PATCH 14/49] ASoC: nuc900-ac97: fix a memory leak Signed-off-by: Axel Lin Acked-by: Liam Girdwood Acked-by: Wan ZongShun Signed-off-by: Mark Brown --- sound/soc/nuc900/nuc900-ac97.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/nuc900/nuc900-ac97.c b/sound/soc/nuc900/nuc900-ac97.c index 293dc748797c..e00e39dd6576 100644 --- a/sound/soc/nuc900/nuc900-ac97.c +++ b/sound/soc/nuc900/nuc900-ac97.c @@ -384,7 +384,6 @@ out0: static int __devexit nuc900_ac97_drvremove(struct platform_device *pdev) { - snd_soc_unregister_dai(&pdev->dev); clk_put(nuc900_ac97_data->clk); @@ -392,6 +391,7 @@ static int __devexit nuc900_ac97_drvremove(struct platform_device *pdev) release_mem_region(nuc900_ac97_data->res->start, resource_size(nuc900_ac97_data->res)); + kfree(nuc900_ac97_data); nuc900_ac97_data = NULL; return 0; From 846172dfe33c7ee07638e04f94dd90e21dfdc5ba Mon Sep 17 00:00:00 2001 From: Dmitry Artamonow Date: Thu, 25 Nov 2010 00:46:15 +0300 Subject: [PATCH 15/49] ASoC: fix SND_PXA2XX_LIB Kconfig warning Fix following warning observed when SND_PXA2XX_SOC is set and SND_ARM isn't: warning: (SND_PXA2XX_AC97 && SOUND && !M68K && SND && SND_ARM && ARCH_PXA || SND_PXA2XX_SOC && SOUND && !M68K && SND && SND_SOC && ARCH_PXA) selects SND_PXA2XX_LIB which has unmet direct dependencies (SOUND && !M68K && SND && SND_ARM) Signed-off-by: Dmitry Artamonow Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/pxa/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig index 37f191bbfdd9..580f48571303 100644 --- a/sound/soc/pxa/Kconfig +++ b/sound/soc/pxa/Kconfig @@ -1,6 +1,7 @@ config SND_PXA2XX_SOC tristate "SoC Audio for the Intel PXA2xx chip" depends on ARCH_PXA + select SND_ARM select SND_PXA2XX_LIB help Say Y or M if you want to add support for codecs attached to From 3b6bc354cb22b1069f88acdc7673d3476fbadfca Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Thu, 25 Nov 2010 17:23:55 +0800 Subject: [PATCH 16/49] ASoC: Call snd_soc_unregister_dais instead of snd_soc_unregister_dai in sh4_soc_dai_remove We call snd_soc_register_dais() in sh4_soc_dai_probe(), thus we should call snd_soc_unregister_dais() in sh4_soc_dai_remove(). Otherwise, we got "too many arguments to function 'snd_soc_unregister_dai'" error message. Signed-off-by: Axel Lin Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/sh/ssi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/sh/ssi.c b/sound/soc/sh/ssi.c index 40bbdf1591dc..05192d97b377 100644 --- a/sound/soc/sh/ssi.c +++ b/sound/soc/sh/ssi.c @@ -387,7 +387,7 @@ static int __devinit sh4_soc_dai_probe(struct platform_device *pdev) static int __devexit sh4_soc_dai_remove(struct platform_device *pdev) { - snd_soc_unregister_dai(&pdev->dev, ARRAY_SIZE(sh4_ssi_dai)); + snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(sh4_ssi_dai)); return 0; } From 4e1f86509732ccc39938974db0612d14afbca953 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Thu, 25 Nov 2010 15:07:25 +0800 Subject: [PATCH 17/49] ASoC: efika-audio-fabric: fix resource leak in efika_fabric_init error path Add missing platform_device_put() if platform_device_add() failed. Signed-off-by: Axel Lin Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/fsl/efika-audio-fabric.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/fsl/efika-audio-fabric.c b/sound/soc/fsl/efika-audio-fabric.c index 53251e6b5bd5..108b5d8bd0e9 100644 --- a/sound/soc/fsl/efika-audio-fabric.c +++ b/sound/soc/fsl/efika-audio-fabric.c @@ -76,6 +76,7 @@ static __init int efika_fabric_init(void) rc = platform_device_add(pdev); if (rc) { pr_err("efika_fabric_init: platform_device_add() failed\n"); + platform_device_put(pdev); return -ENODEV; } return 0; From 917dac0ff1754776b86967b0ec1750022d9c4265 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Thu, 25 Nov 2010 15:08:31 +0800 Subject: [PATCH 18/49] ASoC: pcm030-audio-fabric: fix resource leak in pcm030_fabric_init error path Add missing platform_device_put() if platform_device_add() failed. Signed-off-by: Axel Lin Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/fsl/pcm030-audio-fabric.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/fsl/pcm030-audio-fabric.c b/sound/soc/fsl/pcm030-audio-fabric.c index 25f27ec1dd6e..ba4d85e317ed 100644 --- a/sound/soc/fsl/pcm030-audio-fabric.c +++ b/sound/soc/fsl/pcm030-audio-fabric.c @@ -76,6 +76,7 @@ static __init int pcm030_fabric_init(void) rc = platform_device_add(pdev); if (rc) { pr_err("pcm030_fabric_init: platform_device_add() failed\n"); + platform_device_put(pdev); return -ENODEV; } return 0; From b193deead8637291138a8c1c49753ee686fa5b17 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Thu, 25 Nov 2010 10:44:59 +0800 Subject: [PATCH 19/49] ASoC: snd-soc-afeb9260: remove unneeded platform_device_del in error path Signed-off-by: Axel Lin Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/atmel/snd-soc-afeb9260.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sound/soc/atmel/snd-soc-afeb9260.c b/sound/soc/atmel/snd-soc-afeb9260.c index e3d283561c19..86e0f8586dc3 100644 --- a/sound/soc/atmel/snd-soc-afeb9260.c +++ b/sound/soc/atmel/snd-soc-afeb9260.c @@ -167,7 +167,6 @@ static int __init afeb9260_soc_init(void) return 0; err1: - platform_device_del(afeb9260_snd_device); platform_device_put(afeb9260_snd_device); return err; } From c7a734e58ed237ecac2608a70eb31ba64e21c768 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Thu, 25 Nov 2010 15:11:03 +0800 Subject: [PATCH 20/49] ASoC: sam9g20_wm8731: fix resource leak in at91sam9g20ek_init error path Fix the error path to properly free allocated resources. Signed-off-by: Axel Lin Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/atmel/sam9g20_wm8731.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c index 032e17dd8fdb..e521ada80542 100644 --- a/sound/soc/atmel/sam9g20_wm8731.c +++ b/sound/soc/atmel/sam9g20_wm8731.c @@ -240,6 +240,7 @@ static int __init at91sam9g20ek_init(void) if (!at91sam9g20ek_snd_device) { printk(KERN_ERR "ASoC: Platform device allocation failed\n"); ret = -ENOMEM; + goto err_mclk; } platform_set_drvdata(at91sam9g20ek_snd_device, @@ -248,11 +249,13 @@ static int __init at91sam9g20ek_init(void) ret = platform_device_add(at91sam9g20ek_snd_device); if (ret) { printk(KERN_ERR "ASoC: Platform device allocation failed\n"); - platform_device_put(at91sam9g20ek_snd_device); + goto err_device_add; } return ret; +err_device_add: + platform_device_put(at91sam9g20ek_snd_device); err_mclk: clk_put(mclk); mclk = NULL; From 14abca3dfc51c0a4f798183f131d63bfd6552bd4 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Thu, 25 Nov 2010 15:12:30 +0800 Subject: [PATCH 21/49] ASoC: simone: fix resource leak in simone_init error path Fix the error path to properly free allocated resources. Signed-off-by: Axel Lin Acked-by: Mika Westerberg Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/ep93xx/simone.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/sound/soc/ep93xx/simone.c b/sound/soc/ep93xx/simone.c index 4b0d19913728..286817946c56 100644 --- a/sound/soc/ep93xx/simone.c +++ b/sound/soc/ep93xx/simone.c @@ -54,24 +54,26 @@ static int __init simone_init(void) ret = platform_device_add(simone_snd_ac97_device); if (ret) - goto fail; + goto fail1; simone_snd_device = platform_device_alloc("soc-audio", -1); if (!simone_snd_device) { ret = -ENOMEM; - goto fail; + goto fail2; } platform_set_drvdata(simone_snd_device, &snd_soc_simone); ret = platform_device_add(simone_snd_device); - if (ret) { - platform_device_put(simone_snd_device); - goto fail; - } + if (ret) + goto fail3; - return ret; + return 0; -fail: +fail3: + platform_device_put(simone_snd_device); +fail2: + platform_device_del(simone_snd_ac97_device); +fail1: platform_device_put(simone_snd_ac97_device); return ret; } From ac8f924af555573e29b126ac5cef4fdd122ae517 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Thu, 25 Nov 2010 15:13:09 +0800 Subject: [PATCH 22/49] ASoC: imx-ssi: fix resource leak Fix imx_ssi_probe() error path and imx_ssi_remove() to properly free allocated resources. Signed-off-by: Axel Lin Acked-by: Sascha Hauer Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/imx/imx-ssi.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/sound/soc/imx/imx-ssi.c b/sound/soc/imx/imx-ssi.c index d2d98c75ee8a..390b6ffc2658 100644 --- a/sound/soc/imx/imx-ssi.c +++ b/sound/soc/imx/imx-ssi.c @@ -679,8 +679,11 @@ static int imx_ssi_probe(struct platform_device *pdev) } ssi->soc_platform_pdev_fiq = platform_device_alloc("imx-fiq-pcm-audio", pdev->id); - if (!ssi->soc_platform_pdev_fiq) + if (!ssi->soc_platform_pdev_fiq) { + ret = -ENOMEM; goto failed_pdev_fiq_alloc; + } + platform_set_drvdata(ssi->soc_platform_pdev_fiq, ssi); ret = platform_device_add(ssi->soc_platform_pdev_fiq); if (ret) { @@ -689,8 +692,11 @@ static int imx_ssi_probe(struct platform_device *pdev) } ssi->soc_platform_pdev = platform_device_alloc("imx-pcm-audio", pdev->id); - if (!ssi->soc_platform_pdev) + if (!ssi->soc_platform_pdev) { + ret = -ENOMEM; goto failed_pdev_alloc; + } + platform_set_drvdata(ssi->soc_platform_pdev, ssi); ret = platform_device_add(ssi->soc_platform_pdev); if (ret) { @@ -703,6 +709,7 @@ static int imx_ssi_probe(struct platform_device *pdev) failed_pdev_add: platform_device_put(ssi->soc_platform_pdev); failed_pdev_alloc: + platform_device_del(ssi->soc_platform_pdev_fiq); failed_pdev_fiq_add: platform_device_put(ssi->soc_platform_pdev_fiq); failed_pdev_fiq_alloc: @@ -726,8 +733,8 @@ static int __devexit imx_ssi_remove(struct platform_device *pdev) struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); struct imx_ssi *ssi = platform_get_drvdata(pdev); - platform_device_del(ssi->soc_platform_pdev); - platform_device_put(ssi->soc_platform_pdev); + platform_device_unregister(ssi->soc_platform_pdev); + platform_device_unregister(ssi->soc_platform_pdev_fiq); snd_soc_unregister_dai(&pdev->dev); From 09de9533348632fbbf32ce618f669882aa718817 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Thu, 25 Nov 2010 15:14:03 +0800 Subject: [PATCH 23/49] ASoC: phycore-ac97: fix resource leak Fix imx_phycore_init() error path and imx_phycore_exit() to properly free allocated resources. Signed-off-by: Axel Lin Acked-by: Sascha Hauer Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/imx/phycore-ac97.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/sound/soc/imx/phycore-ac97.c b/sound/soc/imx/phycore-ac97.c index 39f23734781a..9eabc28667e6 100644 --- a/sound/soc/imx/phycore-ac97.c +++ b/sound/soc/imx/phycore-ac97.c @@ -43,6 +43,7 @@ static struct snd_soc_card imx_phycore = { .num_links = ARRAY_SIZE(imx_phycore_dai_ac97), }; +static struct platform_device *imx_phycore_snd_ac97_device; static struct platform_device *imx_phycore_snd_device; static int __init imx_phycore_init(void) @@ -53,29 +54,42 @@ static int __init imx_phycore_init(void) /* return happy. We might run on a totally different machine */ return 0; - imx_phycore_snd_device = platform_device_alloc("soc-audio", -1); - if (!imx_phycore_snd_device) + imx_phycore_snd_ac97_device = platform_device_alloc("soc-audio", -1); + if (!imx_phycore_snd_ac97_device) return -ENOMEM; - platform_set_drvdata(imx_phycore_snd_device, &imx_phycore); - ret = platform_device_add(imx_phycore_snd_device); + platform_set_drvdata(imx_phycore_snd_ac97_device, &imx_phycore); + ret = platform_device_add(imx_phycore_snd_ac97_device); + if (ret) + goto fail1; imx_phycore_snd_device = platform_device_alloc("wm9712-codec", -1); - if (!imx_phycore_snd_device) - return -ENOMEM; + if (!imx_phycore_snd_device) { + ret = -ENOMEM; + goto fail2; + } ret = platform_device_add(imx_phycore_snd_device); if (ret) { printk(KERN_ERR "ASoC: Platform device allocation failed\n"); - platform_device_put(imx_phycore_snd_device); + goto fail3; } + return 0; + +fail3: + platform_device_put(imx_phycore_snd_device); +fail2: + platform_device_del(imx_phycore_snd_ac97_device); +fail1: + platform_device_put(imx_phycore_snd_ac97_device); return ret; } static void __exit imx_phycore_exit(void) { platform_device_unregister(imx_phycore_snd_device); + platform_device_unregister(imx_phycore_snd_ac97_device); } late_initcall(imx_phycore_init); From 8b6b30ab665d3bbb23180c39f6215e6f64516ed0 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Thu, 25 Nov 2010 11:33:14 +0800 Subject: [PATCH 24/49] ASoC: davinci-vcif - fix a memory leak Signed-off-by: Axel Lin Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/davinci/davinci-vcif.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/davinci/davinci-vcif.c b/sound/soc/davinci/davinci-vcif.c index fb4cc1edf339..9d2afccc3a2d 100644 --- a/sound/soc/davinci/davinci-vcif.c +++ b/sound/soc/davinci/davinci-vcif.c @@ -247,7 +247,10 @@ fail: static int davinci_vcif_remove(struct platform_device *pdev) { + struct davinci_vcif_dev *davinci_vcif_dev = dev_get_drvdata(&pdev->dev); + snd_soc_unregister_dai(&pdev->dev); + kfree(davinci_vcif_dev); return 0; } From fe99b55994f08d321cc5f621c3634b1de4961d01 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Wed, 24 Nov 2010 22:40:59 +0800 Subject: [PATCH 25/49] ASoC: tlv320aic3x - fix variable may be used uninitialized warning If aic3x_read failed , val is used uninitialized. Fix it by initializing val to 0. This patch fixes below compile warning: sound/soc/codecs/tlv320aic3x.c: In function 'aic3x_get_gpio': sound/soc/codecs/tlv320aic3x.c:1183: warning: 'val' may be used uninitialized in this function sound/soc/codecs/tlv320aic3x.c: In function 'aic3x_headset_detected': sound/soc/codecs/tlv320aic3x.c:1211: warning: 'val' may be used uninitialized in this function sound/soc/codecs/tlv320aic3x.c: In function 'aic3x_button_pressed': sound/soc/codecs/tlv320aic3x.c:1219: warning: 'val' may be used uninitialized in this function Signed-off-by: Axel Lin Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/codecs/tlv320aic3x.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c index fc687790188b..77b8f9ae29be 100644 --- a/sound/soc/codecs/tlv320aic3x.c +++ b/sound/soc/codecs/tlv320aic3x.c @@ -1176,7 +1176,7 @@ EXPORT_SYMBOL_GPL(aic3x_set_gpio); int aic3x_get_gpio(struct snd_soc_codec *codec, int gpio) { u8 reg = gpio ? AIC3X_GPIO2_REG : AIC3X_GPIO1_REG; - u8 val, bit = gpio ? 2: 1; + u8 val = 0, bit = gpio ? 2 : 1; aic3x_read(codec, reg, &val); return (val >> bit) & 1; @@ -1204,7 +1204,7 @@ EXPORT_SYMBOL_GPL(aic3x_set_headset_detection); int aic3x_headset_detected(struct snd_soc_codec *codec) { - u8 val; + u8 val = 0; aic3x_read(codec, AIC3X_HEADSET_DETECT_CTRL_B, &val); return (val >> 4) & 1; } @@ -1212,7 +1212,7 @@ EXPORT_SYMBOL_GPL(aic3x_headset_detected); int aic3x_button_pressed(struct snd_soc_codec *codec) { - u8 val; + u8 val = 0; aic3x_read(codec, AIC3X_HEADSET_DETECT_CTRL_B, &val); return (val >> 5) & 1; } From 25436180ee8bed6740f29d92c2030c759885c147 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Wed, 24 Nov 2010 22:24:01 +0800 Subject: [PATCH 26/49] ASoC: Fix resource reclaim for osk5912 In current implementation, there are resources leak in the error path. This patch properly reclaims the allocated resources in the error path. Also adds a missing clk_put in osk_soc_exit. Signed-off-by: Axel Lin Acked-by: Jarkko Nikula Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/omap/osk5912.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sound/soc/omap/osk5912.c b/sound/soc/omap/osk5912.c index f0e662556428..65ae00e976ef 100644 --- a/sound/soc/omap/osk5912.c +++ b/sound/soc/omap/osk5912.c @@ -177,7 +177,8 @@ static int __init osk_soc_init(void) tlv320aic23_mclk = clk_get(dev, "mclk"); if (IS_ERR(tlv320aic23_mclk)) { printk(KERN_ERR "Could not get mclk clock\n"); - return -ENODEV; + err = PTR_ERR(tlv320aic23_mclk); + goto err2; } /* @@ -188,7 +189,7 @@ static int __init osk_soc_init(void) if (clk_set_rate(tlv320aic23_mclk, CODEC_CLOCK)) { printk(KERN_ERR "Cannot set MCLK for AIC23 CODEC\n"); err = -ECANCELED; - goto err1; + goto err3; } } @@ -196,9 +197,12 @@ static int __init osk_soc_init(void) (uint) clk_get_rate(tlv320aic23_mclk), CODEC_CLOCK); return 0; -err1: + +err3: clk_put(tlv320aic23_mclk); +err2: platform_device_del(osk_snd_device); +err1: platform_device_put(osk_snd_device); return err; @@ -207,6 +211,7 @@ err1: static void __exit osk_soc_exit(void) { + clk_put(tlv320aic23_mclk); platform_device_unregister(osk_snd_device); } From 5a8f1d4701a50bc2a1e112f6c8e7d30f63597eae Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Mon, 29 Nov 2010 17:39:10 +0800 Subject: [PATCH 27/49] ASoC: Fix compile error for nuc900-ac97.c Fix below compile error by add a missing ';'. CC sound/soc/nuc900/nuc900-ac97.o sound/soc/nuc900/nuc900-ac97.c:300: warning: initialization from incompatible pointer type sound/soc/nuc900/nuc900-ac97.c:301: warning: initialization from incompatible pointer type sound/soc/nuc900/nuc900-ac97.c:318: error: expected ',' or ';' before 'static' sound/soc/nuc900/nuc900-ac97.c:405: error: 'nuc900_ac97_drvprobe' undeclared here (not in a function) make[3]: *** [sound/soc/nuc900/nuc900-ac97.o] Error 1 make[2]: *** [sound/soc/nuc900] Error 2 make[1]: *** [sound/soc] Error 2 make: *** [sound] Error 2 Signed-off-by: Axel Lin Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/nuc900/nuc900-ac97.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/nuc900/nuc900-ac97.c b/sound/soc/nuc900/nuc900-ac97.c index e00e39dd6576..4f056b4a102b 100644 --- a/sound/soc/nuc900/nuc900-ac97.c +++ b/sound/soc/nuc900/nuc900-ac97.c @@ -313,7 +313,7 @@ static struct snd_soc_dai_driver nuc900_ac97_dai = { .channels_max = 2, }, .ops = &nuc900_ac97_dai_ops, -} +}; static int __devinit nuc900_ac97_drvprobe(struct platform_device *pdev) { From e3edefbd4a9071daf388978355f69c37fbeae261 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Mon, 29 Nov 2010 17:40:05 +0800 Subject: [PATCH 28/49] ASoC: Fix prototype for nuc900_ac97_probe and nuc900_ac97_remove This patch fixes below compile warning: CC sound/soc/nuc900/nuc900-ac97.o sound/soc/nuc900/nuc900-ac97.c:300: warning: initialization from incompatible pointer type sound/soc/nuc900/nuc900-ac97.c:301: warning: initialization from incompatible pointer type Signed-off-by: Axel Lin Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/nuc900/nuc900-ac97.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sound/soc/nuc900/nuc900-ac97.c b/sound/soc/nuc900/nuc900-ac97.c index 4f056b4a102b..3d9d8b1636b2 100644 --- a/sound/soc/nuc900/nuc900-ac97.c +++ b/sound/soc/nuc900/nuc900-ac97.c @@ -263,8 +263,7 @@ static int nuc900_ac97_trigger(struct snd_pcm_substream *substream, return ret; } -static int nuc900_ac97_probe(struct platform_device *pdev, - struct snd_soc_dai *dai) +static int nuc900_ac97_probe(struct snd_soc_dai *dai) { struct nuc900_audio *nuc900_audio = nuc900_ac97_data; unsigned long val; @@ -284,12 +283,12 @@ static int nuc900_ac97_probe(struct platform_device *pdev, return 0; } -static void nuc900_ac97_remove(struct platform_device *pdev, - struct snd_soc_dai *dai) +static int nuc900_ac97_remove(struct snd_soc_dai *dai) { struct nuc900_audio *nuc900_audio = nuc900_ac97_data; clk_disable(nuc900_audio->clk); + return 0; } static struct snd_soc_dai_ops nuc900_ac97_dai_ops = { From a7a9820bae19775df1d6cc70d2571ee26e099413 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Mon, 29 Nov 2010 17:40:53 +0800 Subject: [PATCH 29/49] ASoC: Fix compile error for nuc900-pcm.c This patch fixes below error: CC sound/soc/nuc900/nuc900-pcm.o sound/soc/nuc900/nuc900-pcm.c: In function 'nuc900_dma_open': sound/soc/nuc900/nuc900-pcm.c:267: error: 'nuc900_ac97_data' undeclared (first use in this function) sound/soc/nuc900/nuc900-pcm.c:267: error: (Each undeclared identifier is reported only once sound/soc/nuc900/nuc900-pcm.c:267: error: for each function it appears in.) sound/soc/nuc900/nuc900-pcm.c: At top level: sound/soc/nuc900/nuc900-pcm.c:337: error: expected ',' or ';' before 'static' sound/soc/nuc900/nuc900-pcm.c:354: error: 'nuc900_soc_platform_probe' undeclared here (not in a function) make[3]: *** [sound/soc/nuc900/nuc900-pcm.o] Error 1 make[2]: *** [sound/soc/nuc900] Error 2 make[1]: *** [sound/soc] Error 2 make: *** [sound] Error 2 Signed-off-by: Axel Lin Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/nuc900/nuc900-audio.h | 2 ++ sound/soc/nuc900/nuc900-pcm.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/nuc900/nuc900-audio.h b/sound/soc/nuc900/nuc900-audio.h index aeed8ead2b2b..59f7e8ed1a68 100644 --- a/sound/soc/nuc900/nuc900-audio.h +++ b/sound/soc/nuc900/nuc900-audio.h @@ -110,4 +110,6 @@ struct nuc900_audio { }; +extern struct nuc900_audio *nuc900_ac97_data; + #endif /*end _NUC900_AUDIO_H */ diff --git a/sound/soc/nuc900/nuc900-pcm.c b/sound/soc/nuc900/nuc900-pcm.c index 195d1ac94771..2245f8b8edc1 100644 --- a/sound/soc/nuc900/nuc900-pcm.c +++ b/sound/soc/nuc900/nuc900-pcm.c @@ -332,7 +332,7 @@ static struct snd_soc_platform_driver nuc900_soc_platform = { .ops = &nuc900_dma_ops, .pcm_new = nuc900_dma_new, .pcm_free = nuc900_dma_free_dma_buffers, -} +}; static int __devinit nuc900_soc_platform_probe(struct platform_device *pdev) { From 3f90e5028a03be4496a04e4599b16f4420ff1304 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Mon, 29 Nov 2010 17:43:39 +0800 Subject: [PATCH 30/49] ASoC: Remove unneeded !! operations while checking return value of nuc900_checkready I think this unneededd !! operations just reduce the readability. Signed-off-by: Axel Lin Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/nuc900/nuc900-ac97.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/nuc900/nuc900-ac97.c b/sound/soc/nuc900/nuc900-ac97.c index 3d9d8b1636b2..dac6732da969 100644 --- a/sound/soc/nuc900/nuc900-ac97.c +++ b/sound/soc/nuc900/nuc900-ac97.c @@ -49,7 +49,7 @@ static unsigned short nuc900_ac97_read(struct snd_ac97 *ac97, mutex_lock(&ac97_mutex); val = nuc900_checkready(); - if (!!val) { + if (val) { dev_err(nuc900_audio->dev, "AC97 codec is not ready\n"); goto out; } @@ -102,7 +102,7 @@ static void nuc900_ac97_write(struct snd_ac97 *ac97, unsigned short reg, mutex_lock(&ac97_mutex); tmp = nuc900_checkready(); - if (!!tmp) + if (tmp) dev_err(nuc900_audio->dev, "AC97 codec is not ready\n"); /* clear the R_WB bit and write register index */ @@ -149,7 +149,7 @@ static void nuc900_ac97_warm_reset(struct snd_ac97 *ac97) udelay(100); val = nuc900_checkready(); - if (!!val) + if (val) dev_err(nuc900_audio->dev, "AC97 codec is not ready\n"); mutex_unlock(&ac97_mutex); From 67bd489aa309a680b1462ad635df29e8825152d2 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Mon, 29 Nov 2010 14:54:58 +0800 Subject: [PATCH 31/49] ASoC: Add missing dev_set_drvdata in mpc8610_hpcd_probe Otherwise, calling dev_get_drvdata in mpc8610_hpcd_remove returns NULL. Signed-off-by: Axel Lin Acked-by: Timur Tabi Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/fsl/mpc8610_hpcd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/fsl/mpc8610_hpcd.c b/sound/soc/fsl/mpc8610_hpcd.c index 0d7dcf1e4863..7d7847a1e66b 100644 --- a/sound/soc/fsl/mpc8610_hpcd.c +++ b/sound/soc/fsl/mpc8610_hpcd.c @@ -498,6 +498,7 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev) dev_err(&pdev->dev, "platform device add failed\n"); goto error; } + dev_set_drvdata(&pdev->dev, sound_device); of_node_put(codec_np); From 39a545559f8d5f13e8a4a7dfddcaad0e2ba9bcfb Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Mon, 29 Nov 2010 14:55:58 +0800 Subject: [PATCH 32/49] ASoC: Add missing dev_set_drvdata in p1022_ds_probe Otherwise, calling dev_get_drvdata in p1022_ds_remove returns NULL. Signed-off-by: Axel Lin Acked-by: Timur Tabi Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/fsl/p1022_ds.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/fsl/p1022_ds.c b/sound/soc/fsl/p1022_ds.c index 63b9eaa1ebc2..026b756961e0 100644 --- a/sound/soc/fsl/p1022_ds.c +++ b/sound/soc/fsl/p1022_ds.c @@ -498,6 +498,7 @@ static int p1022_ds_probe(struct platform_device *pdev) dev_err(&pdev->dev, "platform device add failed\n"); goto error; } + dev_set_drvdata(&pdev->dev, sound_device); of_node_put(codec_np); From 3f1af9d26fb02a99a60a045b8ae93ccc6fe50b97 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Mon, 29 Nov 2010 17:42:47 +0800 Subject: [PATCH 33/49] ASoC: Fix missing spin_unlock_irqrestore In nuc900_dma_hw_params(), if snd_pcm_lib_malloc_pages failed it returns without calling spin_unlock_irqrestore(). Since snd_pcm_lib_malloc_pages() does not touch struct nuc900_audio, we don't need to hold the lock while calling snd_pcm_lib_malloc_pages(). Fix it by moving spin_lock_irqsave() down to after snd_pcm_lib_malloc_pages(). In nuc900_dma_prepare(), spin_unlock_irqrestore() is missing in the error path. Fix it by removing the return in default case. Signed-off-by: Axel Lin Acked-by: Wan ZongShun Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/nuc900/nuc900-pcm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sound/soc/nuc900/nuc900-pcm.c b/sound/soc/nuc900/nuc900-pcm.c index 2245f8b8edc1..8263f56dc665 100644 --- a/sound/soc/nuc900/nuc900-pcm.c +++ b/sound/soc/nuc900/nuc900-pcm.c @@ -50,12 +50,12 @@ static int nuc900_dma_hw_params(struct snd_pcm_substream *substream, unsigned long flags; int ret = 0; - spin_lock_irqsave(&nuc900_audio->lock, flags); - ret = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params)); if (ret < 0) return ret; + spin_lock_irqsave(&nuc900_audio->lock, flags); + nuc900_audio->substream = substream; nuc900_audio->dma_addr[substream->stream] = runtime->dma_addr; nuc900_audio->buffersize[substream->stream] = @@ -169,6 +169,7 @@ static int nuc900_dma_prepare(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; struct nuc900_audio *nuc900_audio = runtime->private_data; unsigned long flags, val; + int ret = 0; spin_lock_irqsave(&nuc900_audio->lock, flags); @@ -197,10 +198,10 @@ static int nuc900_dma_prepare(struct snd_pcm_substream *substream) AUDIO_WRITE(nuc900_audio->mmio + ACTL_RESET, val); break; default: - return -EINVAL; + ret = -EINVAL; } spin_unlock_irqrestore(&nuc900_audio->lock, flags); - return 0; + return ret; } static int nuc900_dma_trigger(struct snd_pcm_substream *substream, int cmd) From b1d36b1c3573fd5adecbd313d30a8bdc8d7fbc5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gl=C3=B6ckner?= Date: Tue, 30 Nov 2010 01:00:16 +0100 Subject: [PATCH 34/49] s6000-i2s: fix compilation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A semicolon was missing. Signed-off-by: Daniel Glöckner Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/s6000/s6000-i2s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/s6000/s6000-i2s.c b/sound/soc/s6000/s6000-i2s.c index 8778faa174a6..3052f64b2403 100644 --- a/sound/soc/s6000/s6000-i2s.c +++ b/sound/soc/s6000/s6000-i2s.c @@ -434,7 +434,7 @@ static struct snd_soc_dai_driver s6000_i2s_dai = { .rate_max = 1562500, }, .ops = &s6000_i2s_dai_ops, -} +}; static int __devinit s6000_i2s_probe(struct platform_device *pdev) { From 9e4ea718d3c53f9f2a65ddddf95ffd7743be458e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gl=C3=B6ckner?= Date: Tue, 30 Nov 2010 01:00:17 +0100 Subject: [PATCH 35/49] s6000-pcm: fix compilation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit s6000_soc_platform has lost its forward declaration and there no longer is a name element in it, so use a string constant when calling request_irq. Signed-off-by: Daniel Glöckner Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/s6000/s6000-pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/s6000/s6000-pcm.c b/sound/soc/s6000/s6000-pcm.c index 271fd222bf19..ab3ccaec72d2 100644 --- a/sound/soc/s6000/s6000-pcm.c +++ b/sound/soc/s6000/s6000-pcm.c @@ -473,7 +473,7 @@ static int s6000_pcm_new(struct snd_card *card, } res = request_irq(params->irq, s6000_pcm_irq, IRQF_SHARED, - s6000_soc_platform.name, pcm); + "s6000-audio", pcm); if (res) { printk(KERN_ERR "s6000-pcm couldn't get IRQ\n"); return res; From b76fb39d49f67a484a6adc8f041d9ad833f6860e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gl=C3=B6ckner?= Date: Tue, 30 Nov 2010 01:00:18 +0100 Subject: [PATCH 36/49] s6105-ipcam: fix compilation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the s6105-ipcam ASoC driver had been converted to the multi-component API, a single reference to a former structure element remained, blocking successful compilation. Signed-off-by: Daniel Glöckner Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/s6000/s6105-ipcam.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/s6000/s6105-ipcam.c b/sound/soc/s6000/s6105-ipcam.c index 96c05e137538..c1244c5bc730 100644 --- a/sound/soc/s6000/s6105-ipcam.c +++ b/sound/soc/s6000/s6105-ipcam.c @@ -167,7 +167,7 @@ static int s6105_aic3x_init(struct snd_soc_pcm_runtime *rtd) snd_soc_dapm_sync(codec); - snd_ctl_add(codec->snd_card, snd_ctl_new1(&audio_out_mux, codec)); + snd_ctl_add(codec->card->snd_card, snd_ctl_new1(&audio_out_mux, codec)); return 0; } From 2062ea522bb58bb2aeee86d051b37136491ccd65 Mon Sep 17 00:00:00 2001 From: Dimitris Papastamos Date: Wed, 1 Dec 2010 09:38:55 +0000 Subject: [PATCH 37/49] ASoC: WM8731: Fix incorrect mask for bypass path disable According to the datasheet the bypass path enable/disable is bit 3 therefore we need 0x8 and not 0x4. Signed-off-by: Dimitris Papastamos Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/codecs/wm8731.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index 631385802eb4..e725c09a3e79 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c @@ -526,7 +526,7 @@ static int wm8731_probe(struct snd_soc_codec *codec) snd_soc_update_bits(codec, WM8731_RINVOL, 0x100, 0); /* Disable bypass path by default */ - snd_soc_update_bits(codec, WM8731_APANA, 0x4, 0); + snd_soc_update_bits(codec, WM8731_APANA, 0x8, 0); snd_soc_add_controls(codec, wm8731_snd_controls, ARRAY_SIZE(wm8731_snd_controls)); From 0ffd22b694b739b3dc3f80bc93726b581e8e8af5 Mon Sep 17 00:00:00 2001 From: Jarkko Nikula Date: Wed, 1 Dec 2010 11:01:20 +0200 Subject: [PATCH 38/49] ASoC: omap: N810: Don't select CONFIG_OMAP_MUX but make it as dependency Not all omap boards use kernel based pin multiplexing so CONFIG_SND_OMAP_SOC_N810 should not select it by default as it can make harm to other boards in multi-board kernels. Therefore put CONFIG_OMAP_MUX as a dependency to N810 ASoC machine driver. Thanks to Tony Lindgren for noticing. Signed-off-by: Jarkko Nikula Cc: Tony Lindgren Acked-by: Mark Brown Acked-by: Tony Lindgren Signed-off-by: Liam Girdwood --- sound/soc/omap/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig index d542ea2ff6be..a088db6d5091 100644 --- a/sound/soc/omap/Kconfig +++ b/sound/soc/omap/Kconfig @@ -12,8 +12,8 @@ config SND_OMAP_SOC_MCPDM config SND_OMAP_SOC_N810 tristate "SoC Audio support for Nokia N810" depends on SND_OMAP_SOC && MACH_NOKIA_N810 && I2C + depends on OMAP_MUX select SND_OMAP_SOC_MCBSP - select OMAP_MUX select SND_SOC_TLV320AIC3X help Say Y if you want to add support for SoC audio on Nokia N810. From 3fcc0afbb9c93f3599ba03273e59915670b6c2c2 Mon Sep 17 00:00:00 2001 From: Uk Kim Date: Sun, 5 Dec 2010 17:32:16 +0900 Subject: [PATCH 39/49] ASoC: Fix off by one error in WM8994 EQ register bank size Signed-off-by: Uk Kim Acked-by: Liam Girdwood Signed-off-by: Mark Brown Cc: stable@kernel.org --- include/linux/mfd/wm8994/pdata.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h index 5c51f367c061..add8a1b8bcf0 100644 --- a/include/linux/mfd/wm8994/pdata.h +++ b/include/linux/mfd/wm8994/pdata.h @@ -29,7 +29,7 @@ struct wm8994_ldo_pdata { #define WM8994_CONFIGURE_GPIO 0x8000 #define WM8994_DRC_REGS 5 -#define WM8994_EQ_REGS 19 +#define WM8994_EQ_REGS 20 /** * DRC configurations are specified with a label and a set of register From ed8cc471d75365f8590c76f580def899d58028c0 Mon Sep 17 00:00:00 2001 From: Uk Kim Date: Sun, 5 Dec 2010 17:26:07 +0900 Subject: [PATCH 40/49] ASoC: Fix swap of left and right channels for WM8993/4 speaker boost gain SPKOUTL_BOOST start from third bit, SPKOUTLR_BOOST start from 0 bit. Signed-off-by: Uk Kim Acked-by: Liam Girdwood Signed-off-by: Mark Brown Cc: stable@kernel.org --- sound/soc/codecs/wm_hubs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/wm_hubs.c b/sound/soc/codecs/wm_hubs.c index 19ca782ac970..0e24092722c3 100644 --- a/sound/soc/codecs/wm_hubs.c +++ b/sound/soc/codecs/wm_hubs.c @@ -293,7 +293,7 @@ SOC_DOUBLE_R("Speaker Switch", SOC_DOUBLE_R("Speaker ZC Switch", WM8993_SPEAKER_VOLUME_LEFT, WM8993_SPEAKER_VOLUME_RIGHT, 7, 1, 0), -SOC_DOUBLE_TLV("Speaker Boost Volume", WM8993_SPKOUT_BOOST, 0, 3, 7, 0, +SOC_DOUBLE_TLV("Speaker Boost Volume", WM8993_SPKOUT_BOOST, 3, 0, 7, 0, spkboost_tlv), SOC_ENUM("Speaker Reference", speaker_ref), SOC_ENUM("Speaker Mode", speaker_mode), From 1dcb4f38e5bc28dfce0f8c7eef184a090b03bfc7 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Mon, 6 Dec 2010 16:48:03 +0800 Subject: [PATCH 41/49] ASoC: Hold client_mutex while calling snd_soc_instantiate_cards() As the comments of snd_soc_instantiate_cards() said, snd_soc_instantiate_cards() must be called with client_mutex. Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- sound/soc/soc-core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 441285ade024..02ae7bea3b50 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3072,7 +3072,9 @@ int snd_soc_register_dais(struct device *dev, pr_debug("Registered DAI '%s'\n", dai->name); } + mutex_lock(&client_mutex); snd_soc_instantiate_cards(); + mutex_unlock(&client_mutex); return 0; err: From 681e36924788aeea2717c07cc42a21c9c86d7559 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Tue, 7 Dec 2010 20:56:30 +0800 Subject: [PATCH 42/49] ASoC: Fix resource leak if soc_register_ac97_dai_link failed Properly free the resources in the case of soc_register_ac97_dai_link failure. Signed-off-by: Axel Lin Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/soc-core.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 02ae7bea3b50..85b7d548f167 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1619,12 +1619,14 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card) #ifdef CONFIG_SND_SOC_AC97_BUS /* register any AC97 codecs */ for (i = 0; i < card->num_rtd; i++) { - ret = soc_register_ac97_dai_link(&card->rtd[i]); - if (ret < 0) { - printk(KERN_ERR "asoc: failed to register AC97 %s\n", card->name); - goto probe_dai_err; - } + ret = soc_register_ac97_dai_link(&card->rtd[i]); + if (ret < 0) { + printk(KERN_ERR "asoc: failed to register AC97 %s\n", card->name); + while (--i >= 0) + soc_unregister_ac97_dai_link(&card->rtd[i]); + goto probe_dai_err; } + } #endif card->instantiated = 1; From 6b464321d276e448d478c99202c19d83f2bd25f4 Mon Sep 17 00:00:00 2001 From: Jassi Brar Date: Tue, 7 Dec 2010 19:23:07 +0900 Subject: [PATCH 43/49] ASoC: WM8580: Debug BCLK and sample size In case of SNDRV_PCM_FORMAT_S32_LE, we need to set WM8580_AIF_LENGTH_32, rather than WM8580_AIF_LENGTH_24. Also, the BCLK has to be 64fs, for sample size of 20, 24 and 32 bits. Signed-off-by: Jassi Brar Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/codecs/wm8580.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c index a2e0ed59b376..879dff2714dd 100644 --- a/sound/soc/codecs/wm8580.c +++ b/sound/soc/codecs/wm8580.c @@ -491,16 +491,16 @@ static int wm8580_paif_hw_params(struct snd_pcm_substream *substream, paifa |= 0x8; break; case SNDRV_PCM_FORMAT_S20_3LE: - paifa |= 0x10; + paifa |= 0x0; paifb |= WM8580_AIF_LENGTH_20; break; case SNDRV_PCM_FORMAT_S24_LE: - paifa |= 0x10; + paifa |= 0x0; paifb |= WM8580_AIF_LENGTH_24; break; case SNDRV_PCM_FORMAT_S32_LE: - paifa |= 0x10; - paifb |= WM8580_AIF_LENGTH_24; + paifa |= 0x0; + paifb |= WM8580_AIF_LENGTH_32; break; default: return -EINVAL; From 2a7b1a00206895cfa444fd83477dca67a88a9d25 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Tue, 7 Dec 2010 15:32:38 +0000 Subject: [PATCH 44/49] ASoC: Correct WM8962 interrupt mask register read Fix mismerge from the out of tree BSP where this support was developed. Signed-off-by: Mark Brown --- sound/soc/codecs/wm8962.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index e8092745a207..1304ca91a11c 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c @@ -3339,7 +3339,7 @@ static irqreturn_t wm8962_irq(int irq, void *data) int mask; int active; - mask = snd_soc_read(codec, WM8962_INTERRUPT_STATUS_2); + mask = snd_soc_read(codec, WM8962_INTERRUPT_STATUS_2_MASK); active = snd_soc_read(codec, WM8962_INTERRUPT_STATUS_2); active &= ~mask; From 8a96b1e02029aa512199b1b6d281dcede9ed81f1 Mon Sep 17 00:00:00 2001 From: David Henningsson Date: Thu, 9 Dec 2010 07:17:27 +0100 Subject: [PATCH 45/49] ALSA: HDA: Quirk for Dell Vostro 320 to make microphone work BugLink: http://launchpad.net/497546 Confirmed that the ideapad model works better than the current quirk for Dell Vostro 320. Cc: stable@kernel.org (2.6.35+) Signed-off-by: David Henningsson Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_conexant.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 4ab5ea9f0530..76bd58a0e2b6 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -3096,8 +3096,7 @@ static const char *cxt5066_models[CXT5066_MODELS] = { static struct snd_pci_quirk cxt5066_cfg_tbl[] = { SND_PCI_QUIRK_MASK(0x1025, 0xff00, 0x0400, "Acer", CXT5066_IDEAPAD), SND_PCI_QUIRK(0x1028, 0x02d8, "Dell Vostro", CXT5066_DELL_VOSTRO), - SND_PCI_QUIRK(0x1028, 0x02f5, "Dell", - CXT5066_DELL_LAPTOP), + SND_PCI_QUIRK(0x1028, 0x02f5, "Dell Vostro 320", CXT5066_IDEAPAD), SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTRO), SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD), SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP), From fe67b24010c66a14d84117ac67d23ed1bcb18a71 Mon Sep 17 00:00:00 2001 From: David Henningsson Date: Wed, 15 Dec 2010 08:01:46 +0100 Subject: [PATCH 46/49] ALSA: HDA: Fix auto-mute on Lenovo Edge 14 BugLink: http://launchpad.net/bugs/690530 The SKU value of this machine dictates that auto-mute should be disabled. Since the SKU value is similar to the PCI SSID, the most likely conclusion is that the SKU value should be ignored. Signed-off-by: David Henningsson Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_realtek.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 2d7d7de8498a..e5fbd00293f7 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -14800,6 +14800,7 @@ static int alc269_resume(struct hda_codec *codec) enum { ALC269_FIXUP_SONY_VAIO, ALC269_FIXUP_DELL_M101Z, + ALC269_FIXUP_LENOVO_EDGE14, }; static const struct alc_fixup alc269_fixups[] = { @@ -14817,11 +14818,15 @@ static const struct alc_fixup alc269_fixups[] = { {} } }, + [ALC269_FIXUP_LENOVO_EDGE14] = { + .sku = ALC_FIXUP_SKU_IGNORE, + }, }; static struct snd_pci_quirk alc269_fixup_tbl[] = { SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), + SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_LENOVO_EDGE14), {} }; From ac612407932be18697b5ae9da0a80f138b8bea8e Mon Sep 17 00:00:00 2001 From: David Henningsson Date: Wed, 15 Dec 2010 09:18:18 +0100 Subject: [PATCH 47/49] ALSA: HDA: Enable subwoofer on Asus G73Jw Set default association/sequence right on pin 0x17 in order for the automatic parser to recognize the subwoofer correctly. Signed-off-by: David Henningsson Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_realtek.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index e5fbd00293f7..8e7948f56106 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -14801,6 +14801,7 @@ enum { ALC269_FIXUP_SONY_VAIO, ALC269_FIXUP_DELL_M101Z, ALC269_FIXUP_LENOVO_EDGE14, + ALC269_FIXUP_ASUS_G73JW, }; static const struct alc_fixup alc269_fixups[] = { @@ -14821,12 +14822,19 @@ static const struct alc_fixup alc269_fixups[] = { [ALC269_FIXUP_LENOVO_EDGE14] = { .sku = ALC_FIXUP_SKU_IGNORE, }, + [ALC269_FIXUP_ASUS_G73JW] = { + .pins = (const struct alc_pincfg[]) { + { 0x17, 0x99130111 }, /* subwoofer */ + { } + } + }, }; static struct snd_pci_quirk alc269_fixup_tbl[] = { SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_LENOVO_EDGE14), + SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), {} }; From 53e8c3239bcc7b89c76179fd33fb6faa3413c00d Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 17 Dec 2010 15:23:41 +0100 Subject: [PATCH 48/49] ALSA: hda - Fix conflict of Mic Boot controls Due to the recent change for multiple mics assignment, we need to handle the index of each Mic Boost control respectively. Otherwise the driver gets the control element conflicts, and gives the unsable state. Reference: kernel bug 25002 https://bugzilla.kernel.org/show_bug.cgi?id=25002 Reported-and-tested-by: Adam Williamson Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_realtek.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 8e7948f56106..427da45d7906 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -10830,7 +10830,8 @@ static int alc_auto_add_mic_boost(struct hda_codec *codec) { struct alc_spec *spec = codec->spec; struct auto_pin_cfg *cfg = &spec->autocfg; - int i, err; + int i, err, type; + int type_idx = 0; hda_nid_t nid; for (i = 0; i < cfg->num_inputs; i++) { @@ -10839,9 +10840,15 @@ static int alc_auto_add_mic_boost(struct hda_codec *codec) nid = cfg->inputs[i].pin; if (get_wcaps(codec, nid) & AC_WCAP_IN_AMP) { char label[32]; + type = cfg->inputs[i].type; + if (i > 0 && type == cfg->inputs[i - 1].type) + type_idx++; + else + type_idx = 0; snprintf(label, sizeof(label), "%s Boost", hda_get_autocfg_input_label(codec, cfg, i)); - err = add_control(spec, ALC_CTL_WIDGET_VOL, label, 0, + err = add_control(spec, ALC_CTL_WIDGET_VOL, label, + type_idx, HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_INPUT)); if (err < 0) return err; From 022c92befa539174125b0a1b5e52dd57affefe9f Mon Sep 17 00:00:00 2001 From: David Henningsson Date: Fri, 17 Dec 2010 20:43:04 +0100 Subject: [PATCH 49/49] ALSA: HDA: Add auto-mute for Thinkpad SL410/SL510 BugLink: http://launchpad.net/bugs/580006 SKU turns off auto-mute for these machines, so ignore the SKU. Signed-off-by: David Henningsson Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_realtek.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 427da45d7906..dd56d8833ad2 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -14807,7 +14807,7 @@ static int alc269_resume(struct hda_codec *codec) enum { ALC269_FIXUP_SONY_VAIO, ALC269_FIXUP_DELL_M101Z, - ALC269_FIXUP_LENOVO_EDGE14, + ALC269_FIXUP_SKU_IGNORE, ALC269_FIXUP_ASUS_G73JW, }; @@ -14826,7 +14826,7 @@ static const struct alc_fixup alc269_fixups[] = { {} } }, - [ALC269_FIXUP_LENOVO_EDGE14] = { + [ALC269_FIXUP_SKU_IGNORE] = { .sku = ALC_FIXUP_SKU_IGNORE, }, [ALC269_FIXUP_ASUS_G73JW] = { @@ -14840,7 +14840,8 @@ static const struct alc_fixup alc269_fixups[] = { static struct snd_pci_quirk alc269_fixup_tbl[] = { SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), - SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_LENOVO_EDGE14), + SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), + SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), {} };