From 237eeb1c044fdd0f406a8484ee31884e34b9dfc5 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Thu, 28 Nov 2013 08:50:34 +0100 Subject: ASoC: ep93xx: Use devm_snd_dmaengine_pcm_register() Makes the code slightly shorter. Signed-off-by: Lars-Peter Clausen Signed-off-by: Mark Brown --- sound/soc/cirrus/ep93xx-pcm.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'sound/soc/cirrus/ep93xx-pcm.c') diff --git a/sound/soc/cirrus/ep93xx-pcm.c b/sound/soc/cirrus/ep93xx-pcm.c index cfe517e68009..fdb8b8feb4ed 100644 --- a/sound/soc/cirrus/ep93xx-pcm.c +++ b/sound/soc/cirrus/ep93xx-pcm.c @@ -78,19 +78,13 @@ static const struct snd_dmaengine_pcm_config ep93xx_dmaengine_pcm_config = { static int ep93xx_soc_platform_probe(struct platform_device *pdev) { - return snd_dmaengine_pcm_register(&pdev->dev, + return devm_snd_dmaengine_pcm_register(&pdev->dev, &ep93xx_dmaengine_pcm_config, SND_DMAENGINE_PCM_FLAG_NO_RESIDUE | SND_DMAENGINE_PCM_FLAG_NO_DT | SND_DMAENGINE_PCM_FLAG_COMPAT); } -static int ep93xx_soc_platform_remove(struct platform_device *pdev) -{ - snd_dmaengine_pcm_unregister(&pdev->dev); - return 0; -} - static struct platform_driver ep93xx_pcm_driver = { .driver = { .name = "ep93xx-pcm-audio", @@ -98,7 +92,6 @@ static struct platform_driver ep93xx_pcm_driver = { }, .probe = ep93xx_soc_platform_probe, - .remove = ep93xx_soc_platform_remove, }; module_platform_driver(ep93xx_pcm_driver); -- cgit v1.2.1 From 6f2032a18969d22740a865e0b4f2e48cf5338f36 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Tue, 10 Dec 2013 12:34:45 -0700 Subject: ASoC: ep93xx: get rid of ep93xx-pcm-audio struct device Modify the ep93xx PCM driver so that it's a utility library that can be registered on each DAI, rather than a separate struct device. This is more in line with how many recent DT-converted platforms operate, and avoids the need for yet another struct device. Signed-off-by: Stephen Warren Signed-off-by: Mark Brown --- sound/soc/cirrus/ep93xx-pcm.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'sound/soc/cirrus/ep93xx-pcm.c') diff --git a/sound/soc/cirrus/ep93xx-pcm.c b/sound/soc/cirrus/ep93xx-pcm.c index fdb8b8feb4ed..198c5405f2ce 100644 --- a/sound/soc/cirrus/ep93xx-pcm.c +++ b/sound/soc/cirrus/ep93xx-pcm.c @@ -23,6 +23,8 @@ #include +#include "ep93xx-pcm.h" + static const struct snd_pcm_hardware ep93xx_pcm_hardware = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | @@ -76,27 +78,16 @@ static const struct snd_dmaengine_pcm_config ep93xx_dmaengine_pcm_config = { .prealloc_buffer_size = 131072, }; -static int ep93xx_soc_platform_probe(struct platform_device *pdev) +int devm_ep93xx_pcm_platform_register(struct device *dev) { - return devm_snd_dmaengine_pcm_register(&pdev->dev, + return devm_snd_dmaengine_pcm_register(dev, &ep93xx_dmaengine_pcm_config, SND_DMAENGINE_PCM_FLAG_NO_RESIDUE | SND_DMAENGINE_PCM_FLAG_NO_DT | SND_DMAENGINE_PCM_FLAG_COMPAT); } - -static struct platform_driver ep93xx_pcm_driver = { - .driver = { - .name = "ep93xx-pcm-audio", - .owner = THIS_MODULE, - }, - - .probe = ep93xx_soc_platform_probe, -}; - -module_platform_driver(ep93xx_pcm_driver); +EXPORT_SYMBOL_GPL(devm_ep93xx_pcm_platform_register); MODULE_AUTHOR("Ryan Mallon"); MODULE_DESCRIPTION("EP93xx ALSA PCM interface"); MODULE_LICENSE("GPL"); -MODULE_ALIAS("platform:ep93xx-pcm-audio"); -- cgit v1.2.1 From a8983d4b0a8c439bddae0c9fd1e8a4cf7c402262 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Tue, 10 Dec 2013 12:34:46 -0700 Subject: ASoC: ep93xx: remove custom DMA alloc compat function ep93xx_compat_request_channel() is almost identical to dmaengine_pcm_compat_request_channel(), with the exception that the latter: a) Assumes that the DAI DMA data is a struct snd_dmaengine_dai_dma_data pointer rather than some custom type. b) dma_data->filter_data rather than dma_data should be passed to snd_dmaengine_pcm_request_channel() as the filter data. Make minor changes to the ep93xx DAI drivers so that those two conditions are met. This allows removal of the custom .compat_request_channel(). Signed-off-by: Stephen Warren Signed-off-by: Mark Brown --- sound/soc/cirrus/ep93xx-pcm.c | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'sound/soc/cirrus/ep93xx-pcm.c') diff --git a/sound/soc/cirrus/ep93xx-pcm.c b/sound/soc/cirrus/ep93xx-pcm.c index 198c5405f2ce..ca6698d75736 100644 --- a/sound/soc/cirrus/ep93xx-pcm.c +++ b/sound/soc/cirrus/ep93xx-pcm.c @@ -59,22 +59,9 @@ static bool ep93xx_pcm_dma_filter(struct dma_chan *chan, void *filter_param) return false; } -static struct dma_chan *ep93xx_compat_request_channel( - struct snd_soc_pcm_runtime *rtd, - struct snd_pcm_substream *substream) -{ - struct snd_dmaengine_dai_dma_data *dma_data; - - dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); - - return snd_dmaengine_pcm_request_channel(ep93xx_pcm_dma_filter, - dma_data); -} - static const struct snd_dmaengine_pcm_config ep93xx_dmaengine_pcm_config = { .pcm_hardware = &ep93xx_pcm_hardware, .compat_filter_fn = ep93xx_pcm_dma_filter, - .compat_request_channel = ep93xx_compat_request_channel, .prealloc_buffer_size = 131072, }; -- cgit v1.2.1 From 111bd7b18e13c66552e9a672000eeacacd414a65 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Fri, 20 Dec 2013 14:20:11 +0100 Subject: ASoC: ep93xx: Don't set unused struct snd_pcm_hardware fields The ASoC core assumes that the PCM component of the ASoC card transparently moves data around and does not impose any restrictions on the memory layout or the transfer speed. It ignores all fields from the snd_pcm_hardware struct for the PCM driver that are related to this. Setting these fields in the PCM driver might suggest otherwise though, so rather not set them. Signed-off-by: Lars-Peter Clausen Signed-off-by: Mark Brown --- sound/soc/cirrus/ep93xx-pcm.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'sound/soc/cirrus/ep93xx-pcm.c') diff --git a/sound/soc/cirrus/ep93xx-pcm.c b/sound/soc/cirrus/ep93xx-pcm.c index ca6698d75736..5f664471d99e 100644 --- a/sound/soc/cirrus/ep93xx-pcm.c +++ b/sound/soc/cirrus/ep93xx-pcm.c @@ -30,15 +30,6 @@ static const struct snd_pcm_hardware ep93xx_pcm_hardware = { SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER), - - .rates = SNDRV_PCM_RATE_8000_192000, - .rate_min = SNDRV_PCM_RATE_8000, - .rate_max = SNDRV_PCM_RATE_192000, - - .formats = (SNDRV_PCM_FMTBIT_S16_LE | - SNDRV_PCM_FMTBIT_S24_LE | - SNDRV_PCM_FMTBIT_S32_LE), - .buffer_bytes_max = 131072, .period_bytes_min = 32, .period_bytes_max = 32768, -- cgit v1.2.1