From 46fdd8b11d4ab58af126344dcbc0bd565174db16 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sat, 20 Apr 2013 19:29:06 +0200 Subject: ASoC: spear: Setup dma data in DAI probe This allows us to access the DAI DMA data when we create the PCM. We'll use this when converting spear to generic DMA engine PCM driver. Signed-off-by: Lars-Peter Clausen Signed-off-by: Mark Brown diff --git a/sound/soc/spear/spdif_in.c b/sound/soc/spear/spdif_in.c index 14d57e8..82c8387 100644 --- a/sound/soc/spear/spdif_in.c +++ b/sound/soc/spear/spdif_in.c @@ -49,15 +49,12 @@ static void spdif_in_configure(struct spdif_in_dev *host) writel(0xF, host->io_base + SPDIF_IN_IRQ_MASK); } -static int spdif_in_startup(struct snd_pcm_substream *substream, - struct snd_soc_dai *cpu_dai) +static int spdif_in_dai_probe(struct snd_soc_dai *dai) { - struct spdif_in_dev *host = snd_soc_dai_get_drvdata(cpu_dai); + struct spdif_in_dev *host = snd_soc_dai_get_drvdata(dai); - if (substream->stream != SNDRV_PCM_STREAM_CAPTURE) - return -EINVAL; + dai->capture_dma_data = &host->dma_params; - snd_soc_dai_set_dma_data(cpu_dai, substream, (void *)&host->dma_params); return 0; } @@ -70,7 +67,6 @@ static void spdif_in_shutdown(struct snd_pcm_substream *substream, return; writel(0x0, host->io_base + SPDIF_IN_IRQ_MASK); - snd_soc_dai_set_dma_data(dai, substream, NULL); } static void spdif_in_format(struct spdif_in_dev *host, u32 format) @@ -151,13 +147,13 @@ static int spdif_in_trigger(struct snd_pcm_substream *substream, int cmd, } static struct snd_soc_dai_ops spdif_in_dai_ops = { - .startup = spdif_in_startup, .shutdown = spdif_in_shutdown, .trigger = spdif_in_trigger, .hw_params = spdif_in_hw_params, }; struct snd_soc_dai_driver spdif_in_dai = { + .probe = spdif_in_dai_probe, .capture = { .channels_min = 2, .channels_max = 2, diff --git a/sound/soc/spear/spdif_out.c b/sound/soc/spear/spdif_out.c index 1e3c3dd..12b4f2f 100644 --- a/sound/soc/spear/spdif_out.c +++ b/sound/soc/spear/spdif_out.c @@ -62,8 +62,6 @@ static int spdif_out_startup(struct snd_pcm_substream *substream, if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) return -EINVAL; - snd_soc_dai_set_dma_data(cpu_dai, substream, (void *)&host->dma_params); - ret = clk_enable(host->clk); if (ret) return ret; @@ -84,7 +82,6 @@ static void spdif_out_shutdown(struct snd_pcm_substream *substream, clk_disable(host->clk); host->running = false; - snd_soc_dai_set_dma_data(dai, substream, NULL); } static void spdif_out_clock(struct spdif_out_dev *host, u32 core_freq, @@ -245,6 +242,10 @@ static const struct snd_kcontrol_new spdif_out_controls[] = { int spdif_soc_dai_probe(struct snd_soc_dai *dai) { + struct spdif_out_dev *host = snd_soc_dai_get_drvdata(dai); + + dai->playback_dma_data = &host->dma_params; + return snd_soc_add_dai_controls(dai, spdif_out_controls, ARRAY_SIZE(spdif_out_controls)); } -- cgit v0.10.2 From 52c102e534fd46a25aacab37bbaaa593929a2ca1 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sat, 20 Apr 2013 19:29:07 +0200 Subject: ASoC: spear: Use generic dmaengine PCM Use the generic dmaengine PCM driver instead of a custom implementation. Signed-off-by: Lars-Peter Clausen Signed-off-by: Mark Brown diff --git a/sound/soc/spear/spear_pcm.c b/sound/soc/spear/spear_pcm.c index 2fbd489..4707f2b 100644 --- a/sound/soc/spear/spear_pcm.c +++ b/sound/soc/spear/spear_pcm.c @@ -13,19 +13,13 @@ #include #include -#include -#include #include -#include -#include -#include #include #include -#include #include #include -static struct snd_pcm_hardware spear_pcm_hardware = { +static const struct snd_pcm_hardware spear_pcm_hardware = { .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME), @@ -37,149 +31,33 @@ static struct snd_pcm_hardware spear_pcm_hardware = { .fifo_size = 0, /* fifo size in bytes */ }; -static int spear_pcm_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params) +static struct dma_chan *spear_pcm_request_chan(struct snd_soc_pcm_runtime *rtd, + struct snd_pcm_substream *substream) { - snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer); + struct spear_dma_data *dma_data; - return 0; -} - -static int spear_pcm_hw_free(struct snd_pcm_substream *substream) -{ - snd_pcm_set_runtime_buffer(substream, NULL); - - return 0; -} - -static int spear_pcm_open(struct snd_pcm_substream *substream) -{ - struct snd_soc_pcm_runtime *rtd = substream->private_data; - - struct spear_dma_data *dma_data = (struct spear_dma_data *) - snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); - int ret; - - ret = snd_soc_set_runtime_hwparams(substream, &spear_pcm_hardware); - if (ret) - return ret; + dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); - return snd_dmaengine_pcm_open_request_chan(substream, dma_data->filter, - dma_data); + return snd_dmaengine_pcm_request_channel(dma_data->filter, dma_data); } -static int spear_pcm_mmap(struct snd_pcm_substream *substream, - struct vm_area_struct *vma) -{ - struct snd_pcm_runtime *runtime = substream->runtime; - - return dma_mmap_writecombine(substream->pcm->card->dev, vma, - runtime->dma_area, runtime->dma_addr, - runtime->dma_bytes); -} - -static struct snd_pcm_ops spear_pcm_ops = { - .open = spear_pcm_open, - .close = snd_dmaengine_pcm_close_release_chan, - .ioctl = snd_pcm_lib_ioctl, - .hw_params = spear_pcm_hw_params, - .hw_free = spear_pcm_hw_free, - .trigger = snd_dmaengine_pcm_trigger, - .pointer = snd_dmaengine_pcm_pointer, - .mmap = spear_pcm_mmap, -}; - -static int -spear_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream, - size_t size) -{ - struct snd_pcm_substream *substream = pcm->streams[stream].substream; - struct snd_dma_buffer *buf = &substream->dma_buffer; - - buf->dev.type = SNDRV_DMA_TYPE_DEV; - buf->dev.dev = pcm->card->dev; - buf->private_data = NULL; - - buf->area = dma_alloc_writecombine(pcm->card->dev, size, - &buf->addr, GFP_KERNEL); - if (!buf->area) - return -ENOMEM; - - dev_info(buf->dev.dev, - " preallocate_dma_buffer: area=%p, addr=%p, size=%d\n", - (void *)buf->area, (void *)buf->addr, size); - - buf->bytes = size; - return 0; -} - -static void spear_pcm_free(struct snd_pcm *pcm) -{ - struct snd_pcm_substream *substream; - struct snd_dma_buffer *buf; - int stream; - - for (stream = 0; stream < 2; stream++) { - substream = pcm->streams[stream].substream; - if (!substream) - continue; - - buf = &substream->dma_buffer; - if (!buf || !buf->area) - continue; - - dma_free_writecombine(pcm->card->dev, buf->bytes, - buf->area, buf->addr); - buf->area = NULL; - } -} - -static u64 spear_pcm_dmamask = DMA_BIT_MASK(32); - -static int spear_pcm_new(struct snd_soc_pcm_runtime *rtd) -{ - struct snd_card *card = rtd->card->snd_card; - int ret; - - if (!card->dev->dma_mask) - card->dev->dma_mask = &spear_pcm_dmamask; - if (!card->dev->coherent_dma_mask) - card->dev->coherent_dma_mask = DMA_BIT_MASK(32); - - if (rtd->cpu_dai->driver->playback.channels_min) { - ret = spear_pcm_preallocate_dma_buffer(rtd->pcm, - SNDRV_PCM_STREAM_PLAYBACK, - spear_pcm_hardware.buffer_bytes_max); - if (ret) - return ret; - } - - if (rtd->cpu_dai->driver->capture.channels_min) { - ret = spear_pcm_preallocate_dma_buffer(rtd->pcm, - SNDRV_PCM_STREAM_CAPTURE, - spear_pcm_hardware.buffer_bytes_max); - if (ret) - return ret; - } - - return 0; -} - -static struct snd_soc_platform_driver spear_soc_platform = { - .ops = &spear_pcm_ops, - .pcm_new = spear_pcm_new, - .pcm_free = spear_pcm_free, +static const struct snd_dmaengine_pcm_config spear_dmaengine_pcm_config = { + .pcm_hardware = &spear_pcm_hardware, + .compat_request_channel = spear_pcm_request_chan, + .prealloc_buffer_size = 16 * 1024, }; static int spear_soc_platform_probe(struct platform_device *pdev) { - return snd_soc_register_platform(&pdev->dev, &spear_soc_platform); + return snd_dmaengine_pcm_register(&pdev->dev, + &spear_dmaengine_pcm_config, + SND_DMAENGINE_PCM_FLAG_NO_DT | + SND_DMAENGINE_PCM_FLAG_COMPAT); } static int spear_soc_platform_remove(struct platform_device *pdev) { - snd_soc_unregister_platform(&pdev->dev); - + snd_dmaengine_pcm_unregister(&pdev->dev); return 0; } -- cgit v0.10.2 From bfcc74e6101a978b3987e767815595e5a9fec2ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Wed, 8 May 2013 11:47:38 +0200 Subject: ASoC: SPEAr spdif_{in,out}: use devm for clk and a few more cleanups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drop dev_set_drvdata as this is handled in the core and use devm_request_and_ioremap instead of devm_ioremap to properly register the address range used Signed-off-by: Uwe Kleine-König Signed-off-by: Mark Brown diff --git a/sound/soc/spear/spdif_in.c b/sound/soc/spear/spdif_in.c index 82c8387..643ada6 100644 --- a/sound/soc/spear/spdif_in.c +++ b/sound/soc/spear/spdif_in.c @@ -231,7 +231,7 @@ static int spdif_in_probe(struct platform_device *pdev) if (host->irq < 0) return -EINVAL; - host->clk = clk_get(&pdev->dev, NULL); + host->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(host->clk)) return PTR_ERR(host->clk); @@ -253,7 +253,6 @@ static int spdif_in_probe(struct platform_device *pdev) ret = devm_request_irq(&pdev->dev, host->irq, spdif_in_irq, 0, "spdif-in", host); if (ret) { - clk_put(host->clk); dev_warn(&pdev->dev, "request_irq failed\n"); return ret; } @@ -273,14 +272,10 @@ static int spdif_in_remove(struct platform_device *pdev) struct spdif_in_dev *host = dev_get_drvdata(&pdev->dev); snd_soc_unregister_component(&pdev->dev); - dev_set_drvdata(&pdev->dev, NULL); - - clk_put(host->clk); return 0; } - static struct platform_driver spdif_in_driver = { .probe = spdif_in_probe, .remove = spdif_in_remove, diff --git a/sound/soc/spear/spdif_out.c b/sound/soc/spear/spdif_out.c index 12b4f2f..fd25cc5 100644 --- a/sound/soc/spear/spdif_out.c +++ b/sound/soc/spear/spdif_out.c @@ -298,14 +298,14 @@ static int spdif_out_probe(struct platform_device *pdev) return -ENOMEM; } - host->io_base = devm_ioremap(&pdev->dev, res->start, + host->io_base = devm_request_and_ioremap(&pdev->dev, res->start, resource_size(res)); if (!host->io_base) { dev_warn(&pdev->dev, "ioremap failed\n"); return -ENOMEM; } - host->clk = clk_get(&pdev->dev, NULL); + host->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(host->clk)) return PTR_ERR(host->clk); @@ -334,9 +334,6 @@ static int spdif_out_remove(struct platform_device *pdev) struct spdif_out_dev *host = dev_get_drvdata(&pdev->dev); snd_soc_unregister_component(&pdev->dev); - dev_set_drvdata(&pdev->dev, NULL); - - clk_put(host->clk); return 0; } -- cgit v0.10.2 From 169cc48982f2583de1fea89e7becb1304730a34e Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Tue, 14 May 2013 22:19:49 +0200 Subject: ASoC: spear: spdif_in: Staticize non exported struct The spdif_in_dai struct is not used outside of spdif_in.c, so make it static. Signed-off-by: Lars-Peter Clausen Acked-by: Rajeev Kumar Signed-off-by: Mark Brown diff --git a/sound/soc/spear/spdif_in.c b/sound/soc/spear/spdif_in.c index 643ada6..f0071dd 100644 --- a/sound/soc/spear/spdif_in.c +++ b/sound/soc/spear/spdif_in.c @@ -152,7 +152,7 @@ static struct snd_soc_dai_ops spdif_in_dai_ops = { .hw_params = spdif_in_hw_params, }; -struct snd_soc_dai_driver spdif_in_dai = { +static struct snd_soc_dai_driver spdif_in_dai = { .probe = spdif_in_dai_probe, .capture = { .channels_min = 2, -- cgit v0.10.2 From 19c7efcd24a71d0f707cecd3c0cee5f4a1289b1e Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Tue, 14 May 2013 22:19:50 +0200 Subject: ASoC: spear: spdif_out: Staticize unexported function The spdif_soc_dai_probe function is only used in spdif_out.c, so make it static. Signed-off-by: Lars-Peter Clausen Acked-by: Rajeev Kumar Signed-off-by: Mark Brown diff --git a/sound/soc/spear/spdif_out.c b/sound/soc/spear/spdif_out.c index fd25cc5..4bde512 100644 --- a/sound/soc/spear/spdif_out.c +++ b/sound/soc/spear/spdif_out.c @@ -240,7 +240,7 @@ static const struct snd_kcontrol_new spdif_out_controls[] = { spdif_mute_get, spdif_mute_put), }; -int spdif_soc_dai_probe(struct snd_soc_dai *dai) +static int spdif_soc_dai_probe(struct snd_soc_dai *dai) { struct spdif_out_dev *host = snd_soc_dai_get_drvdata(dai); -- cgit v0.10.2 From e58070ee4fdf797c47cb296992ce8db3df715eca Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Mon, 10 Jun 2013 16:19:40 +0530 Subject: ASoC: Add Kconfig and Makefile to support SPEAr audio driver This patch adds Kconfig and Makefile to support SPEAr Audio driver. Signed-off-by: Rajeev Kumar Signed-off-by: Mark Brown diff --git a/sound/soc/Kconfig b/sound/soc/Kconfig index 9e675c7..45eeaa9 100644 --- a/sound/soc/Kconfig +++ b/sound/soc/Kconfig @@ -51,6 +51,7 @@ source "sound/soc/pxa/Kconfig" source "sound/soc/samsung/Kconfig" source "sound/soc/s6000/Kconfig" source "sound/soc/sh/Kconfig" +source "sound/soc/spear/Kconfig" source "sound/soc/tegra/Kconfig" source "sound/soc/txx9/Kconfig" source "sound/soc/ux500/Kconfig" diff --git a/sound/soc/Makefile b/sound/soc/Makefile index 197b6ae..bc02614 100644 --- a/sound/soc/Makefile +++ b/sound/soc/Makefile @@ -29,6 +29,7 @@ obj-$(CONFIG_SND_SOC) += pxa/ obj-$(CONFIG_SND_SOC) += samsung/ obj-$(CONFIG_SND_SOC) += s6000/ obj-$(CONFIG_SND_SOC) += sh/ +obj-$(CONFIG_SND_SOC) += spear/ obj-$(CONFIG_SND_SOC) += tegra/ obj-$(CONFIG_SND_SOC) += txx9/ obj-$(CONFIG_SND_SOC) += ux500/ diff --git a/sound/soc/spear/Kconfig b/sound/soc/spear/Kconfig new file mode 100644 index 0000000..3b7cdad --- /dev/null +++ b/sound/soc/spear/Kconfig @@ -0,0 +1,39 @@ +config SND_SPEAR_EVM + tristate "SoC Audio support for SPEAr EVM" + select SND_DESIGNWARE_I2S + select SND_SOC_STA529 + select SND_SPEAR_SOC + help + Say Y if you want to add support for SoC audio on SPEAr + platform + +config SND_SPEAR1340_EVM + tristate "SoC Audio support for SPEAr1340 EVM" + select SND_DESIGNWARE_I2S + select SND_SOC_STA529 + select SND_SPEAR_SPDIF_OUT + select SND_SPEAR_SPDIF_IN + select SND_SOC_SPDIF + select SND_SPEAR_SOC + help + Say Y if you want to add support for SoC audio on SPEAr1340 + platform + +config SND_SPEAR_SOC + tristate "SoC Audio for the ST chip" + depends on SND_DESIGNWARE_I2S || SND_SPEAR_SPDIF_OUT || \ + SND_SPEAR_SPDIF_IN + help + Say Y or M if you want to add support for any of the audio + controllers (I2S/SPDIF). You will also need to select + the audio interface codecs to support below. + +config SND_SPEAR_SPDIF_OUT + tristate "SPEAr SPDIF Out Device Driver" + help + Say Y or M if you want to add support for SPDIF OUT driver. + +config SND_SPEAR_SPDIF_IN + tristate "SPEAr SPDIF IN Device Driver" + help + Say Y or M if you want to add support for SPDIF IN driver. diff --git a/sound/soc/spear/Makefile b/sound/soc/spear/Makefile new file mode 100644 index 0000000..b365126 --- /dev/null +++ b/sound/soc/spear/Makefile @@ -0,0 +1,7 @@ +# SPEAR Platform Support +obj-$(CONFIG_SND_SPEAR_SOC) += spear_pcm.o +obj-$(CONFIG_SND_SPEAR_SPDIF_IN) += spdif_in.o +obj-$(CONFIG_SND_SPEAR_SPDIF_OUT) += spdif_out.o + +# SPEAR Machine Support +obj-$(CONFIG_SND_SPEAR_EVM) += spear_evb.o -- cgit v0.10.2 From d8f4e17fdd4f5e6fe6ef07496296fa88e150beda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Wed, 12 Jun 2013 22:18:01 +0200 Subject: ASoC: SPEAr spdif_{in,out}: fix fallout of previous cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The patch that resulted in bfcc74e (ASoC: SPEAr spdif_{in,out}: use devm for clk and a few more cleanups) was broken and applied on a newer tree than it was created for. So bfcc74e introduced unbalanced clk handling, two warnings about unused variables and passed 3 arguments to a function only taking 2. This commit fixes that. Signed-off-by: Uwe Kleine-König Signed-off-by: Mark Brown diff --git a/sound/soc/spear/spdif_in.c b/sound/soc/spear/spdif_in.c index f0071dd..63acfeb 100644 --- a/sound/soc/spear/spdif_in.c +++ b/sound/soc/spear/spdif_in.c @@ -257,20 +257,12 @@ static int spdif_in_probe(struct platform_device *pdev) return ret; } - ret = snd_soc_register_component(&pdev->dev, &spdif_in_component, + return snd_soc_register_component(&pdev->dev, &spdif_in_component, &spdif_in_dai, 1); - if (ret != 0) { - clk_put(host->clk); - return ret; - } - - return 0; } static int spdif_in_remove(struct platform_device *pdev) { - struct spdif_in_dev *host = dev_get_drvdata(&pdev->dev); - snd_soc_unregister_component(&pdev->dev); return 0; diff --git a/sound/soc/spear/spdif_out.c b/sound/soc/spear/spdif_out.c index 4bde512..a4a8748 100644 --- a/sound/soc/spear/spdif_out.c +++ b/sound/soc/spear/spdif_out.c @@ -298,8 +298,7 @@ static int spdif_out_probe(struct platform_device *pdev) return -ENOMEM; } - host->io_base = devm_request_and_ioremap(&pdev->dev, res->start, - resource_size(res)); + host->io_base = devm_request_and_ioremap(&pdev->dev, res); if (!host->io_base) { dev_warn(&pdev->dev, "ioremap failed\n"); return -ENOMEM; @@ -321,18 +320,11 @@ static int spdif_out_probe(struct platform_device *pdev) ret = snd_soc_register_component(&pdev->dev, &spdif_out_component, &spdif_out_dai, 1); - if (ret != 0) { - clk_put(host->clk); - return ret; - } - - return 0; + return ret; } static int spdif_out_remove(struct platform_device *pdev) { - struct spdif_out_dev *host = dev_get_drvdata(&pdev->dev); - snd_soc_unregister_component(&pdev->dev); return 0; -- cgit v0.10.2 From 6df2610c150c3e7088ac9b82df3e9ee732802409 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Fri, 14 Jun 2013 12:26:20 +0100 Subject: ASoC: SPEAr: Add dependency on dmaengine helpers I'd be very surprised if anyone has used the Kconfig... Signed-off-by: Mark Brown diff --git a/sound/soc/spear/Kconfig b/sound/soc/spear/Kconfig index 3b7cdad..5b744ed 100644 --- a/sound/soc/spear/Kconfig +++ b/sound/soc/spear/Kconfig @@ -27,6 +27,7 @@ config SND_SPEAR_SOC Say Y or M if you want to add support for any of the audio controllers (I2S/SPDIF). You will also need to select the audio interface codecs to support below. + select SND_SOC_DMAENGINE_PCM config SND_SPEAR_SPDIF_OUT tristate "SPEAr SPDIF Out Device Driver" -- cgit v0.10.2 From 41139938cd63e9bf1a1eda62cb2add8dd8b561b4 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Fri, 14 Jun 2013 12:28:46 +0100 Subject: ASoC: SPEAr: Hide component drivers in Kconfig The individual component drivers are only useful with a machine driver and should be selected by the machine drivers so shouldn't have help text of their own in order to hide them in interactive configuration. Signed-off-by: Mark Brown diff --git a/sound/soc/spear/Kconfig b/sound/soc/spear/Kconfig index 5b744ed..e3851d6 100644 --- a/sound/soc/spear/Kconfig +++ b/sound/soc/spear/Kconfig @@ -20,21 +20,11 @@ config SND_SPEAR1340_EVM platform config SND_SPEAR_SOC - tristate "SoC Audio for the ST chip" - depends on SND_DESIGNWARE_I2S || SND_SPEAR_SPDIF_OUT || \ - SND_SPEAR_SPDIF_IN - help - Say Y or M if you want to add support for any of the audio - controllers (I2S/SPDIF). You will also need to select - the audio interface codecs to support below. + tristate select SND_SOC_DMAENGINE_PCM config SND_SPEAR_SPDIF_OUT - tristate "SPEAr SPDIF Out Device Driver" - help - Say Y or M if you want to add support for SPDIF OUT driver. + tristate config SND_SPEAR_SPDIF_IN - tristate "SPEAr SPDIF IN Device Driver" - help - Say Y or M if you want to add support for SPDIF IN driver. + tristate -- cgit v0.10.2 From fc7fe01518b0a29750313a7cc9dc8f8a0416a6b4 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Mon, 17 Jun 2013 08:58:52 +0100 Subject: ASoC: spear: Remove nonexistant EVM options The source wasn't added. Stephen Rothwell Signed-off-by: Mark Brown diff --git a/sound/soc/spear/Kconfig b/sound/soc/spear/Kconfig index e3851d6..3567d73 100644 --- a/sound/soc/spear/Kconfig +++ b/sound/soc/spear/Kconfig @@ -1,24 +1,3 @@ -config SND_SPEAR_EVM - tristate "SoC Audio support for SPEAr EVM" - select SND_DESIGNWARE_I2S - select SND_SOC_STA529 - select SND_SPEAR_SOC - help - Say Y if you want to add support for SoC audio on SPEAr - platform - -config SND_SPEAR1340_EVM - tristate "SoC Audio support for SPEAr1340 EVM" - select SND_DESIGNWARE_I2S - select SND_SOC_STA529 - select SND_SPEAR_SPDIF_OUT - select SND_SPEAR_SPDIF_IN - select SND_SOC_SPDIF - select SND_SPEAR_SOC - help - Say Y if you want to add support for SoC audio on SPEAr1340 - platform - config SND_SPEAR_SOC tristate select SND_SOC_DMAENGINE_PCM diff --git a/sound/soc/spear/Makefile b/sound/soc/spear/Makefile index b365126..9f47bb4 100644 --- a/sound/soc/spear/Makefile +++ b/sound/soc/spear/Makefile @@ -2,6 +2,3 @@ obj-$(CONFIG_SND_SPEAR_SOC) += spear_pcm.o obj-$(CONFIG_SND_SPEAR_SPDIF_IN) += spdif_in.o obj-$(CONFIG_SND_SPEAR_SPDIF_OUT) += spdif_out.o - -# SPEAR Machine Support -obj-$(CONFIG_SND_SPEAR_EVM) += spear_evb.o -- cgit v0.10.2 From 1d26f752ace99c30ceadb4e5c106736b15da99e1 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Mon, 17 Jun 2013 09:02:11 +0100 Subject: ASoC: spear: Normalise module names Signed-off-by: Mark Brown diff --git a/sound/soc/spear/Makefile b/sound/soc/spear/Makefile index 9f47bb4..c4ea716 100644 --- a/sound/soc/spear/Makefile +++ b/sound/soc/spear/Makefile @@ -1,4 +1,8 @@ # SPEAR Platform Support -obj-$(CONFIG_SND_SPEAR_SOC) += spear_pcm.o -obj-$(CONFIG_SND_SPEAR_SPDIF_IN) += spdif_in.o -obj-$(CONFIG_SND_SPEAR_SPDIF_OUT) += spdif_out.o +snd-soc-spear-pcm-objs := spear_pcm.o +snd-soc-spear-spdif-in-objs := spdif_in.o +snd-soc-spear-spdif-out-objs := spdif_out.o + +obj-$(CONFIG_SND_SPEAR_SOC) += snd-soc-spear-pcm.o +obj-$(CONFIG_SND_SPEAR_SPDIF_IN) += snd-soc-spear-spdif-in.o +obj-$(CONFIG_SND_SPEAR_SPDIF_OUT) += snd-soc-spear-spdif-out.o -- cgit v0.10.2 From fc09cfbe3e3535897456c12f37fa83024bdab92d Mon Sep 17 00:00:00 2001 From: Tushar Behera Date: Mon, 17 Jun 2013 16:10:57 +0530 Subject: ASoC: spear: Convert to use devm_ioremap_resource Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()") introduced devm_ioremap_resource() and deprecated the use of devm_request_and_ioremap(). devm_request_mem_region is called in devm_ioremap_resource(). Hence that part can also be removed. Since devm_ioremap_resource prints error message on failure, there is no need to print an explicit warning message. Signed-off-by: Tushar Behera CC: alsa-devel@alsa-project.org CC: Liam Girdwood CC: Mark Brown Signed-off-by: Mark Brown diff --git a/sound/soc/spear/spdif_out.c b/sound/soc/spear/spdif_out.c index a4a8748..2fdf68c 100644 --- a/sound/soc/spear/spdif_out.c +++ b/sound/soc/spear/spdif_out.c @@ -282,27 +282,16 @@ static int spdif_out_probe(struct platform_device *pdev) struct resource *res; int ret; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -EINVAL; - - if (!devm_request_mem_region(&pdev->dev, res->start, - resource_size(res), pdev->name)) { - dev_warn(&pdev->dev, "Failed to get memory resourse\n"); - return -ENOENT; - } - host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL); if (!host) { dev_warn(&pdev->dev, "kzalloc fail\n"); return -ENOMEM; } - host->io_base = devm_request_and_ioremap(&pdev->dev, res); - if (!host->io_base) { - dev_warn(&pdev->dev, "ioremap failed\n"); - return -ENOMEM; - } + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + host->io_base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(host->io_base)) + return PTR_ERR(host->io_base); host->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(host->clk)) -- cgit v0.10.2