aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/cirrus/ep93xx-i2s.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2013-03-22 14:12:10 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-03-26 14:16:52 +0000
commit453807f3006757a5661c4000262d7d9284b5214c (patch)
tree1ae1ad67cb1c31e16c762d7c4f744e4f07ff6fd2 /sound/soc/cirrus/ep93xx-i2s.c
parentASoC: atmel-pcm-dma: Do not use snd_dmaengine_pcm_{set,get}_data() (diff)
downloadlinux-dev-453807f3006757a5661c4000262d7d9284b5214c.tar.xz
linux-dev-453807f3006757a5661c4000262d7d9284b5214c.zip
ASoC: ep93xx: Use ep93xx_dma_params instead of ep93xx_pcm_dma_params
Currently the ep93xx_dma_params struct which is passed to the dmaengine driver is constructed at runtime from the ep93xx_pcm_dma_params that gets passed to the ep93xx PCM driver from one of the ep93xx DAI drivers. The ep93xx_pcm_dma_params struct is almost identical to the ep93xx_dma_params struct. The only missing field is the 'direction' field, which is computed at runtime in the PCM driver based on the current substream. Since we know in advance which ep93xx_pcm_dma_params struct is being used for which substream at compile time, we also already know which direction to use at compile time. So we can easily replace all instances of ep93xx_pcm_dma_params with their ep93xx_dma_params counterpart. This allows us to simplify the code in the ep93xx pcm driver quite a bit. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Reviewed-by: Ryan Mallon <rmallon@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/cirrus/ep93xx-i2s.c')
-rw-r--r--sound/soc/cirrus/ep93xx-i2s.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sound/soc/cirrus/ep93xx-i2s.c b/sound/soc/cirrus/ep93xx-i2s.c
index 323ed69b7975..aa124f86f60e 100644
--- a/sound/soc/cirrus/ep93xx-i2s.c
+++ b/sound/soc/cirrus/ep93xx-i2s.c
@@ -30,8 +30,6 @@
#include <mach/ep93xx-regs.h>
#include <linux/platform_data/dma-ep93xx.h>
-#include "ep93xx-pcm.h"
-
#define EP93XX_I2S_TXCLKCFG 0x00
#define EP93XX_I2S_RXCLKCFG 0x04
#define EP93XX_I2S_GLCTRL 0x0C
@@ -62,18 +60,20 @@ struct ep93xx_i2s_info {
struct clk *mclk;
struct clk *sclk;
struct clk *lrclk;
- struct ep93xx_pcm_dma_params *dma_params;
+ struct ep93xx_dma_data *dma_data;
void __iomem *regs;
};
-struct ep93xx_pcm_dma_params ep93xx_i2s_dma_params[] = {
+struct ep93xx_dma_data ep93xx_i2s_dma_data[] = {
[SNDRV_PCM_STREAM_PLAYBACK] = {
.name = "i2s-pcm-out",
.dma_port = EP93XX_DMA_I2S1,
+ .direction = DMA_MEM_TO_DEV,
},
[SNDRV_PCM_STREAM_CAPTURE] = {
.name = "i2s-pcm-in",
.dma_port = EP93XX_DMA_I2S1,
+ .direction = DMA_DEV_TO_MEM,
},
};
@@ -147,7 +147,7 @@ static int ep93xx_i2s_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
snd_soc_dai_set_dma_data(cpu_dai, substream,
- &info->dma_params[substream->stream]);
+ &info->dma_data[substream->stream]);
return 0;
}
@@ -403,7 +403,7 @@ static int ep93xx_i2s_probe(struct platform_device *pdev)
}
dev_set_drvdata(&pdev->dev, info);
- info->dma_params = ep93xx_i2s_dma_params;
+ info->dma_data = ep93xx_i2s_dma_data;
err = snd_soc_register_dai(&pdev->dev, &ep93xx_i2s_dai);
if (err)