summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorHuang Chao <chao7.huang@samsung.com>2014-06-30 16:35:47 +0800
committerChanho Park <chanho61.park@samsung.com>2014-11-18 11:59:55 +0900
commit9a94fdf00b7933a489cd39ca94229ffae23d49ed (patch)
tree4d4c622e451677b16137108819a452a333111c38 /sound
parent609110cfe9592793cac94c1c12d45b04afa6be46 (diff)
downloadlinux-3.10-9a94fdf00b7933a489cd39ca94229ffae23d49ed.tar.gz
linux-3.10-9a94fdf00b7933a489cd39ca94229ffae23d49ed.tar.bz2
linux-3.10-9a94fdf00b7933a489cd39ca94229ffae23d49ed.zip
ASoC: samsung: i2s: Configure dmaengine playback/capture DAI DMA data
This patch configures the standard alsa dmaengine configure dai data. The dma address, width and maxburst size will be initialized during cpu dai probe process, in which the address width is assigned with a default value as four bytes. Then when the hardware parameters are configured as playback or capture are started, the dma address width will be configured again according to current sound channels. After the configuration, this patch will set the dai dma data into the private dma data field in snd_soc_dai structure. Change-Id: I46ece6472464d003a19d409441619ebbe4ef30cd Signed-off-by: Huang Chao <chao7.huang@samsung.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/samsung/i2s.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 08ab1d7de09..d80121e46d3 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -603,16 +603,19 @@ static int i2s_hw_params(struct snd_pcm_substream *substream,
break;
case 2:
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
- i2s->dma_playback.dma_size = 4;
+ i2s->snd_dma_playback.addr_width =
+ DMA_SLAVE_BUSWIDTH_4_BYTES;
else
- i2s->dma_capture.dma_size = 4;
+ i2s->snd_dma_capture.addr_width =
+ DMA_SLAVE_BUSWIDTH_4_BYTES;
break;
case 1:
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
- i2s->dma_playback.dma_size = 2;
+ i2s->snd_dma_playback.addr_width =
+ DMA_SLAVE_BUSWIDTH_2_BYTES;
else
- i2s->dma_capture.dma_size = 2;
-
+ i2s->snd_dma_capture.addr_width =
+ DMA_SLAVE_BUSWIDTH_2_BYTES;
break;
default:
dev_err(&i2s->pdev->dev, "%d channels not supported\n",
@@ -662,10 +665,10 @@ static int i2s_hw_params(struct snd_pcm_substream *substream,
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
snd_soc_dai_set_dma_data(dai, substream,
- (void *)&i2s->dma_playback);
+ (void *)&i2s->snd_dma_playback);
else
snd_soc_dai_set_dma_data(dai, substream,
- (void *)&i2s->dma_capture);
+ (void *)&i2s->snd_dma_capture);
i2s->frmclk = params_rate(params);
@@ -1248,16 +1251,14 @@ static int samsung_i2s_probe(struct platform_device *pdev)
}
regs_base = res->start;
- pri_dai->dma_playback.dma_addr = regs_base + I2STXD;
- pri_dai->dma_capture.dma_addr = regs_base + I2SRXD;
- pri_dai->dma_playback.client =
- (struct s3c2410_dma_client *)&pri_dai->dma_playback;
- pri_dai->dma_playback.ch_name = "tx";
- pri_dai->dma_capture.client =
- (struct s3c2410_dma_client *)&pri_dai->dma_capture;
- pri_dai->dma_capture.ch_name = "rx";
- pri_dai->dma_playback.dma_size = 4;
- pri_dai->dma_capture.dma_size = 4;
+ pri_dai->snd_dma_playback.addr = regs_base + I2STXD;
+ pri_dai->snd_dma_playback.addr_width =
+ DMA_SLAVE_BUSWIDTH_4_BYTES; /* Default address width */
+ pri_dai->snd_dma_playback.maxburst = 1;
+ pri_dai->snd_dma_capture.addr = regs_base + I2SRXD;
+ pri_dai->snd_dma_capture.addr_width =
+ DMA_SLAVE_BUSWIDTH_4_BYTES; /* Default address width */
+ pri_dai->snd_dma_capture.maxburst = 1;
pri_dai->base = regs_base;
pri_dai->quirks = quirks;
pri_dai->op_clk = ERR_PTR(-EINVAL);