From e75fa9b1f9d430edeb848db329f924996bc964d6 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 3 May 2013 14:39:19 +0530 Subject: ASoC: Samsung: Remove redundant platform_set_drvdata() Commit 0998d06310 (device-core: Ensure drvdata = NULL when no driver is bound) removes the need to set driver data field to NULL. Signed-off-by: Sachin Kamat Signed-off-by: Mark Brown --- sound/soc/samsung/smdk_wm8580pcm.c | 1 - sound/soc/samsung/smdk_wm8994pcm.c | 1 - 2 files changed, 2 deletions(-) (limited to 'sound/soc/samsung') diff --git a/sound/soc/samsung/smdk_wm8580pcm.c b/sound/soc/samsung/smdk_wm8580pcm.c index e43bd4294f99..23a9204b106d 100644 --- a/sound/soc/samsung/smdk_wm8580pcm.c +++ b/sound/soc/samsung/smdk_wm8580pcm.c @@ -176,7 +176,6 @@ static int snd_smdk_probe(struct platform_device *pdev) static int snd_smdk_remove(struct platform_device *pdev) { snd_soc_unregister_card(&smdk_pcm); - platform_set_drvdata(pdev, NULL); return 0; } diff --git a/sound/soc/samsung/smdk_wm8994pcm.c b/sound/soc/samsung/smdk_wm8994pcm.c index 3688a32000a2..0c84ca099612 100644 --- a/sound/soc/samsung/smdk_wm8994pcm.c +++ b/sound/soc/samsung/smdk_wm8994pcm.c @@ -146,7 +146,6 @@ static int snd_smdk_probe(struct platform_device *pdev) static int snd_smdk_remove(struct platform_device *pdev) { snd_soc_unregister_card(&smdk_pcm); - platform_set_drvdata(pdev, NULL); return 0; } -- cgit v1.2.1 From 200ceb962f7b00815259bf3cb2df5a0ac15eb99d Mon Sep 17 00:00:00 2001 From: Barry Song <21cnbao@gmail.com> Date: Sat, 18 May 2013 20:25:00 +0800 Subject: ASoC: dfbmcs320: make the driver common for other BT modules DFBM-CS320 is only one of bluetooth modules using CSR bluetooth chips, we don't want everyone to have a seperate codec driver. anyway, the feature of Bluetooth SCO is same on all platforms, so this patch makes the DFBM-CS320 driver become a common BT SCO link driver. Signed-off-by: Barry Song Signed-off-by: Mark Brown --- sound/soc/samsung/Kconfig | 2 +- sound/soc/samsung/neo1973_wm8753.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sound/soc/samsung') diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig index 475fb0d8b3c6..ae0ea87b7d7b 100644 --- a/sound/soc/samsung/Kconfig +++ b/sound/soc/samsung/Kconfig @@ -39,7 +39,7 @@ config SND_SOC_SAMSUNG_NEO1973_WM8753 depends on SND_SOC_SAMSUNG && MACH_NEO1973_GTA02 select SND_S3C24XX_I2S select SND_SOC_WM8753 - select SND_SOC_DFBMCS320 + select SND_SOC_SCO help Say Y here to enable audio support for the Openmoko Neo1973 Smartphones. diff --git a/sound/soc/samsung/neo1973_wm8753.c b/sound/soc/samsung/neo1973_wm8753.c index e591c386917a..807db417d234 100644 --- a/sound/soc/samsung/neo1973_wm8753.c +++ b/sound/soc/samsung/neo1973_wm8753.c @@ -373,7 +373,7 @@ static struct snd_soc_dai_link neo1973_dai[] = { { /* Voice via BT */ .name = "Bluetooth", .stream_name = "Voice", - .cpu_dai_name = "dfbmcs320-pcm", + .cpu_dai_name = "bt-sco-pcm", .codec_dai_name = "wm8753-voice", .codec_name = "wm8753.0-001a", .ops = &neo1973_voice_ops, -- cgit v1.2.1 From 939d3c6a6c56d1db6ab7e44ddf11de60f0122d1a Mon Sep 17 00:00:00 2001 From: Charles Keepax Date: Mon, 27 May 2013 09:46:53 +0100 Subject: ASoC: bells: Hookup DMICs for Bells Signed-off-by: Charles Keepax Signed-off-by: Mark Brown --- sound/soc/samsung/bells.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'sound/soc/samsung') diff --git a/sound/soc/samsung/bells.c b/sound/soc/samsung/bells.c index ceed466af9ff..29e246803626 100644 --- a/sound/soc/samsung/bells.c +++ b/sound/soc/samsung/bells.c @@ -350,8 +350,16 @@ static struct snd_soc_codec_conf bells_codec_conf[] = { }, }; +static struct snd_soc_dapm_widget bells_widgets[] = { + SND_SOC_DAPM_MIC("DMIC", NULL), +}; + static struct snd_soc_dapm_route bells_routes[] = { { "Sub CLK_SYS", NULL, "OPCLK" }, + + { "DMIC", NULL, "MICBIAS2" }, + { "IN2L", NULL, "DMIC" }, + { "IN2R", NULL, "DMIC" }, }; static struct snd_soc_card bells_cards[] = { @@ -365,6 +373,8 @@ static struct snd_soc_card bells_cards[] = { .late_probe = bells_late_probe, + .dapm_widgets = bells_widgets, + .num_dapm_widgets = ARRAY_SIZE(bells_widgets), .dapm_routes = bells_routes, .num_dapm_routes = ARRAY_SIZE(bells_routes), @@ -383,6 +393,8 @@ static struct snd_soc_card bells_cards[] = { .late_probe = bells_late_probe, + .dapm_widgets = bells_widgets, + .num_dapm_widgets = ARRAY_SIZE(bells_widgets), .dapm_routes = bells_routes, .num_dapm_routes = ARRAY_SIZE(bells_routes), @@ -401,6 +413,8 @@ static struct snd_soc_card bells_cards[] = { .late_probe = bells_late_probe, + .dapm_widgets = bells_widgets, + .num_dapm_widgets = ARRAY_SIZE(bells_widgets), .dapm_routes = bells_routes, .num_dapm_routes = ARRAY_SIZE(bells_routes), -- cgit v1.2.1 From 04c9548c78f7bb00c438cb8005bf4ec25b5720fe Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 21 Jun 2013 18:09:49 +0200 Subject: ASoC: samsung: Fix a typo of CONFIG_SND_SOC_BT_SCO ... instead of CONFIG_SND_SOC_SCO. Introduced in the commit 200ceb96. Signed-off-by: Takashi Iwai --- sound/soc/samsung/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/soc/samsung') diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig index ae0ea87b7d7b..9855dfc3e3ec 100644 --- a/sound/soc/samsung/Kconfig +++ b/sound/soc/samsung/Kconfig @@ -39,7 +39,7 @@ config SND_SOC_SAMSUNG_NEO1973_WM8753 depends on SND_SOC_SAMSUNG && MACH_NEO1973_GTA02 select SND_S3C24XX_I2S select SND_SOC_WM8753 - select SND_SOC_SCO + select SND_SOC_BT_SCO help Say Y here to enable audio support for the Openmoko Neo1973 Smartphones. -- cgit v1.2.1 From 5d45ee3cdbca031d3a59422314f4d65dfacdc03b Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Wed, 26 Jun 2013 10:29:02 +0100 Subject: ASoC: samsung-ac97: Use devm_clk_get() Reviewed-by: Jingoo Han Signed-off-by: Mark Brown --- sound/soc/samsung/ac97.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sound/soc/samsung') diff --git a/sound/soc/samsung/ac97.c b/sound/soc/samsung/ac97.c index cb88ead98917..1c85999f3fc3 100644 --- a/sound/soc/samsung/ac97.c +++ b/sound/soc/samsung/ac97.c @@ -440,7 +440,7 @@ static int s3c_ac97_probe(struct platform_device *pdev) goto err1; } - s3c_ac97.ac97_clk = clk_get(&pdev->dev, "ac97"); + s3c_ac97.ac97_clk = devm_clk_get(&pdev->dev, "ac97"); if (IS_ERR(s3c_ac97.ac97_clk)) { dev_err(&pdev->dev, "ac97 failed to get ac97_clock\n"); ret = -ENODEV; @@ -480,7 +480,6 @@ err5: err4: err3: clk_disable_unprepare(s3c_ac97.ac97_clk); - clk_put(s3c_ac97.ac97_clk); err2: iounmap(s3c_ac97.regs); err1: @@ -501,7 +500,6 @@ static int s3c_ac97_remove(struct platform_device *pdev) free_irq(irq_res->start, NULL); clk_disable_unprepare(s3c_ac97.ac97_clk); - clk_put(s3c_ac97.ac97_clk); iounmap(s3c_ac97.regs); -- cgit v1.2.1 From 25fd0bfd53b96f774f49aa333b02d2f3a07d68fe Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Wed, 26 Jun 2013 10:34:37 +0100 Subject: ASoC: samsung-ac97: Convert to devm_ioremap_resource() Reviewed-by: Jingoo Han Signed-off-by: Mark Brown --- sound/soc/samsung/ac97.c | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) (limited to 'sound/soc/samsung') diff --git a/sound/soc/samsung/ac97.c b/sound/soc/samsung/ac97.c index 1c85999f3fc3..04d7fd461484 100644 --- a/sound/soc/samsung/ac97.c +++ b/sound/soc/samsung/ac97.c @@ -417,11 +417,9 @@ static int s3c_ac97_probe(struct platform_device *pdev) return -ENXIO; } - if (!request_mem_region(mem_res->start, - resource_size(mem_res), "ac97")) { - dev_err(&pdev->dev, "Unable to request register region\n"); - return -EBUSY; - } + s3c_ac97.regs = devm_ioremap_resource(&pdev->dev, mem_res); + if (IS_ERR(s3c_ac97.regs)) + return PTR_ERR(s3c_ac97.regs); s3c_ac97_pcm_out.channel = dmatx_res->start; s3c_ac97_pcm_out.dma_addr = mem_res->start + S3C_AC97_PCM_DATA; @@ -433,13 +431,6 @@ static int s3c_ac97_probe(struct platform_device *pdev) init_completion(&s3c_ac97.done); mutex_init(&s3c_ac97.lock); - s3c_ac97.regs = ioremap(mem_res->start, resource_size(mem_res)); - if (s3c_ac97.regs == NULL) { - dev_err(&pdev->dev, "Unable to ioremap register region\n"); - ret = -ENXIO; - goto err1; - } - s3c_ac97.ac97_clk = devm_clk_get(&pdev->dev, "ac97"); if (IS_ERR(s3c_ac97.ac97_clk)) { dev_err(&pdev->dev, "ac97 failed to get ac97_clock\n"); @@ -481,16 +472,13 @@ err4: err3: clk_disable_unprepare(s3c_ac97.ac97_clk); err2: - iounmap(s3c_ac97.regs); -err1: - release_mem_region(mem_res->start, resource_size(mem_res)); return ret; } static int s3c_ac97_remove(struct platform_device *pdev) { - struct resource *mem_res, *irq_res; + struct resource *irq_res; asoc_dma_platform_unregister(&pdev->dev); snd_soc_unregister_component(&pdev->dev); @@ -501,12 +489,6 @@ static int s3c_ac97_remove(struct platform_device *pdev) clk_disable_unprepare(s3c_ac97.ac97_clk); - iounmap(s3c_ac97.regs); - - mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (mem_res) - release_mem_region(mem_res->start, resource_size(mem_res)); - return 0; } -- cgit v1.2.1 From b047e1cce8fe32475ab61846772943a5e4c0a908 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Wed, 26 Jun 2013 12:45:59 +0100 Subject: ASoC: ac97: Support multi-platform AC'97 Currently we can only have a single platform built in with AC'97 support due to the use of a global variable to provide the bus operations. Fix this by making that variable a pointer and having the bus drivers set the operations prior to registering. This is not a particularly good or nice approach but it avoids blocking multiplatform and a real fix involves fixing the fairly deep problems with AC'97 support - we should be converting it to a real bus. Acked-by: Arnd Bergmann Reviewed-by: Stephen Warren Signed-off-by: Mark Brown --- sound/soc/samsung/ac97.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'sound/soc/samsung') diff --git a/sound/soc/samsung/ac97.c b/sound/soc/samsung/ac97.c index 04d7fd461484..2dd623fa3882 100644 --- a/sound/soc/samsung/ac97.c +++ b/sound/soc/samsung/ac97.c @@ -214,13 +214,12 @@ static irqreturn_t s3c_ac97_irq(int irq, void *dev_id) return IRQ_HANDLED; } -struct snd_ac97_bus_ops soc_ac97_ops = { +static struct snd_ac97_bus_ops s3c_ac97_ops = { .read = s3c_ac97_read, .write = s3c_ac97_write, .warm_reset = s3c_ac97_warm_reset, .reset = s3c_ac97_cold_reset, }; -EXPORT_SYMBOL_GPL(soc_ac97_ops); static int s3c_ac97_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, @@ -452,6 +451,12 @@ static int s3c_ac97_probe(struct platform_device *pdev) goto err4; } + ret = snd_soc_set_ac97_ops(&s3c_ac97_ops); + if (ret != 0) { + dev_err(&pdev->dev, "Failed to set AC'97 ops: %d\n", ret); + goto err4; + } + ret = snd_soc_register_component(&pdev->dev, &s3c_ac97_component, s3c_ac97_dai, ARRAY_SIZE(s3c_ac97_dai)); if (ret) @@ -472,7 +477,7 @@ err4: err3: clk_disable_unprepare(s3c_ac97.ac97_clk); err2: - + snd_soc_set_ac97_ops(NULL); return ret; } @@ -488,6 +493,7 @@ static int s3c_ac97_remove(struct platform_device *pdev) free_irq(irq_res->start, NULL); clk_disable_unprepare(s3c_ac97.ac97_clk); + snd_soc_set_ac97_ops(NULL); return 0; } -- cgit v1.2.1