From 890255e704826a20caec54dcec1926316baf4263 Mon Sep 17 00:00:00 2001 From: Robert Jarzmik Date: Sat, 30 Jun 2012 19:25:08 +0200 Subject: ASoC: mioa701: convert to snd_soc_register_card API The mioa701 board code is converted to the snd_soc_register_card() and snd_soc_unregister_card() APIs. Signed-off-by: Robert Jarzmik Signed-off-by: Mark Brown --- sound/soc/pxa/mioa701_wm9713.c | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) (limited to 'sound') diff --git a/sound/soc/pxa/mioa701_wm9713.c b/sound/soc/pxa/mioa701_wm9713.c index 9c585af59b5f..8687c1c65d29 100644 --- a/sound/soc/pxa/mioa701_wm9713.c +++ b/sound/soc/pxa/mioa701_wm9713.c @@ -186,36 +186,27 @@ static struct snd_soc_card mioa701 = { .num_links = ARRAY_SIZE(mioa701_dai), }; -static struct platform_device *mioa701_snd_device; - -static int mioa701_wm9713_probe(struct platform_device *pdev) +static int __devinit mioa701_wm9713_probe(struct platform_device *pdev) { - int ret; + int rc; if (!machine_is_mioa701()) return -ENODEV; - dev_warn(&pdev->dev, "Be warned that incorrect mixers/muxes setup will" - "lead to overheating and possible destruction of your device." - "Do not use without a good knowledge of mio's board design!\n"); - - mioa701_snd_device = platform_device_alloc("soc-audio", -1); - if (!mioa701_snd_device) - return -ENOMEM; - - platform_set_drvdata(mioa701_snd_device, &mioa701); - - ret = platform_device_add(mioa701_snd_device); - if (!ret) - return 0; - - platform_device_put(mioa701_snd_device); - return ret; + mioa701.dev = &pdev->dev; + rc = snd_soc_register_card(&mioa701); + if (!rc) + dev_warn(&pdev->dev, "Be warned that incorrect mixers/muxes setup will" + "lead to overheating and possible destruction of your device." + " Do not use without a good knowledge of mio's board design!\n"); + return rc; } static int __devexit mioa701_wm9713_remove(struct platform_device *pdev) { - platform_device_unregister(mioa701_snd_device); + struct snd_soc_card *card = platform_get_drvdata(pdev); + + snd_soc_unregister_card(card); return 0; } -- cgit v1.2.3 From 32fee7afe763344ef53bbd4e737aa6168a9308aa Mon Sep 17 00:00:00 2001 From: Benoît Thébaudeau Date: Mon, 2 Jul 2012 13:45:21 +0200 Subject: ASoC: dapm: Fix dapm_set_path_status() connect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dapm_set_path_status() sets connect incorrectly in the case max > 1 with invert. In that case, the raw disconnect value should be max, which corresponds to the userspace value 0. This use case currently does not appear upstream, but it could break SOC_DAPM_SINGLE() or SOC_DAPM_SINGLE_TLV() elsewhere or in the future. This patch completes commit 3a9abe8. Cc: Liam Girdwood Cc: Mark Brown Cc: Signed-off-by: Benoît Thébaudeau Signed-off-by: Mark Brown --- sound/soc/soc-dapm.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sound') diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 89eae93445cf..5be4f9a2edb8 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -321,11 +321,10 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w, val = soc_widget_read(w, reg); val = (val >> shift) & mask; + if (invert) + val = max - val; - if ((invert && !val) || (!invert && val)) - p->connect = 1; - else - p->connect = 0; + p->connect = !!val; } break; case snd_soc_dapm_mux: { -- cgit v1.2.3 From 01005a729a17ab419f61a366e22f3419e7a2c3fe Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Fri, 6 Jul 2012 16:57:05 +0100 Subject: ASoC: dapm: Fix locking during codec shutdown Codec shutdown performs a DAPM power sequence that might cause conflicts and/or race conditions if another stream power event is running simultaneously. Use card's dapm mutex to protect any potential race condition between them. Signed-off-by: Misael Lopez Cruz Signed-off-by: Liam Girdwood Signed-off-by: Mark Brown Cc: stable@vger.kernel.org --- sound/soc/soc-dapm.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sound') diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 5be4f9a2edb8..114f2af5f304 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -3537,10 +3537,13 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_free); static void soc_dapm_shutdown_codec(struct snd_soc_dapm_context *dapm) { + struct snd_soc_card *card = dapm->card; struct snd_soc_dapm_widget *w; LIST_HEAD(down_list); int powerdown = 0; + mutex_lock(&card->dapm_mutex); + list_for_each_entry(w, &dapm->card->widgets, list) { if (w->dapm != dapm) continue; @@ -3563,6 +3566,8 @@ static void soc_dapm_shutdown_codec(struct snd_soc_dapm_context *dapm) snd_soc_dapm_set_bias_level(dapm, SND_SOC_BIAS_STANDBY); } + + mutex_unlock(&card->dapm_mutex); } /* -- cgit v1.2.3 From 4123128ee4854a955dd4a94b31991f8cc38c9b5e Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Fri, 6 Jul 2012 16:56:16 +0100 Subject: ASoC: dapm: Make sure all dapm contexts are updated Make sure we set the bias level for all DAPM contexts when changing level. Signed-off-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/soc-dapm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sound') diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 114f2af5f304..7c9cd276c2fc 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -288,9 +288,9 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_dapm_context *dapm, if (dapm->codec->driver->set_bias_level) ret = dapm->codec->driver->set_bias_level(dapm->codec, level); - else - dapm->bias_level = level; - } + } else + dapm->bias_level = level; + if (ret != 0) goto out; -- cgit v1.2.3 From d66a547cddb9124cea6308c33e1f54c7c8db288f Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Fri, 6 Jul 2012 12:19:10 +0200 Subject: ASoC: omap-mcpdm: Add missing MODULE_ALIAS The MODULE_ALIAS() was missing from the driver. Signed-off-by: Peter Ujfalusi Signed-off-by: Mark Brown --- sound/soc/omap/omap-mcpdm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sound') diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c index 59d47ab5b15d..2c66e2498a45 100644 --- a/sound/soc/omap/omap-mcpdm.c +++ b/sound/soc/omap/omap-mcpdm.c @@ -527,6 +527,7 @@ static struct platform_driver asoc_mcpdm_driver = { module_platform_driver(asoc_mcpdm_driver); +MODULE_ALIAS("platform:omap-mcpdm"); MODULE_AUTHOR("Misael Lopez Cruz "); MODULE_DESCRIPTION("OMAP PDM SoC Interface"); MODULE_LICENSE("GPL"); -- cgit v1.2.3 From 0ff97ebf0804d2e519d578fcb4db03f104d2ca8c Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Fri, 20 Jul 2012 17:29:34 +0100 Subject: ASoC: dapm: Fix _PRE and _POST events for DAPM performance improvements Ever since the DAPM performance improvements we've been marking all widgets as not dirty after each DAPM run. Since _PRE and _POST events aren't part of the DAPM graph this has rendered them non-functional, they will never be marked dirty again and thus will never be run again. Fix this by skipping them when marking widgets as not dirty. Signed-off-by: Mark Brown Acked-by: Liam Girdwood Cc: stable@vger.kernel.org --- sound/soc/soc-dapm.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sound') diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index f7a13f720529..025060b26fb7 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -1598,7 +1598,15 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event) } list_for_each_entry(w, &card->widgets, list) { - list_del_init(&w->dirty); + switch (w->id) { + case snd_soc_dapm_pre: + case snd_soc_dapm_post: + /* These widgets always need to be powered */ + break; + default: + list_del_init(&w->dirty); + break; + } if (w->power) { d = w->dapm; -- cgit v1.2.3