aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/s3c24xx/s3c24xx-pcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/s3c24xx/s3c24xx-pcm.c')
-rw-r--r--sound/soc/s3c24xx/s3c24xx-pcm.c49
1 files changed, 25 insertions, 24 deletions
diff --git a/sound/soc/s3c24xx/s3c24xx-pcm.c b/sound/soc/s3c24xx/s3c24xx-pcm.c
index 4107a87d4de3..29a6c82f873a 100644
--- a/sound/soc/s3c24xx/s3c24xx-pcm.c
+++ b/sound/soc/s3c24xx/s3c24xx-pcm.c
@@ -24,7 +24,6 @@
24#include <linux/slab.h> 24#include <linux/slab.h>
25#include <linux/dma-mapping.h> 25#include <linux/dma-mapping.h>
26 26
27#include <sound/driver.h>
28#include <sound/core.h> 27#include <sound/core.h>
29#include <sound/pcm.h> 28#include <sound/pcm.h>
30#include <sound/pcm_params.h> 29#include <sound/pcm_params.h>
@@ -49,7 +48,9 @@ static const struct snd_pcm_hardware s3c24xx_pcm_hardware = {
49 .info = SNDRV_PCM_INFO_INTERLEAVED | 48 .info = SNDRV_PCM_INFO_INTERLEAVED |
50 SNDRV_PCM_INFO_BLOCK_TRANSFER | 49 SNDRV_PCM_INFO_BLOCK_TRANSFER |
51 SNDRV_PCM_INFO_MMAP | 50 SNDRV_PCM_INFO_MMAP |
52 SNDRV_PCM_INFO_MMAP_VALID, 51 SNDRV_PCM_INFO_MMAP_VALID |
52 SNDRV_PCM_INFO_PAUSE |
53 SNDRV_PCM_INFO_RESUME,
53 .formats = SNDRV_PCM_FMTBIT_S16_LE | 54 .formats = SNDRV_PCM_FMTBIT_S16_LE |
54 SNDRV_PCM_FMTBIT_U16_LE | 55 SNDRV_PCM_FMTBIT_U16_LE |
55 SNDRV_PCM_FMTBIT_U8 | 56 SNDRV_PCM_FMTBIT_U8 |
@@ -176,28 +177,6 @@ static int s3c24xx_pcm_hw_params(struct snd_pcm_substream *substream,
176 } 177 }
177 } 178 }
178 179
179 /* channel needs configuring for mem=>device, increment memory addr,
180 * sync to pclk, half-word transfers to the IIS-FIFO. */
181 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
182 s3c2410_dma_devconfig(prtd->params->channel,
183 S3C2410_DMASRC_MEM, S3C2410_DISRCC_INC |
184 S3C2410_DISRCC_APB, prtd->params->dma_addr);
185
186 s3c2410_dma_config(prtd->params->channel,
187 prtd->params->dma_size,
188 S3C2410_DCON_SYNC_PCLK |
189 S3C2410_DCON_HANDSHAKE);
190 } else {
191 s3c2410_dma_config(prtd->params->channel,
192 prtd->params->dma_size,
193 S3C2410_DCON_HANDSHAKE |
194 S3C2410_DCON_SYNC_PCLK);
195
196 s3c2410_dma_devconfig(prtd->params->channel,
197 S3C2410_DMASRC_HW, 0x3,
198 prtd->params->dma_addr);
199 }
200
201 s3c2410_dma_set_buffdone_fn(prtd->params->channel, 180 s3c2410_dma_set_buffdone_fn(prtd->params->channel,
202 s3c24xx_audio_buffdone); 181 s3c24xx_audio_buffdone);
203 182
@@ -246,6 +225,28 @@ static int s3c24xx_pcm_prepare(struct snd_pcm_substream *substream)
246 if (!prtd->params) 225 if (!prtd->params)
247 return 0; 226 return 0;
248 227
228 /* channel needs configuring for mem=>device, increment memory addr,
229 * sync to pclk, half-word transfers to the IIS-FIFO. */
230 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
231 s3c2410_dma_devconfig(prtd->params->channel,
232 S3C2410_DMASRC_MEM, S3C2410_DISRCC_INC |
233 S3C2410_DISRCC_APB, prtd->params->dma_addr);
234
235 s3c2410_dma_config(prtd->params->channel,
236 prtd->params->dma_size,
237 S3C2410_DCON_SYNC_PCLK |
238 S3C2410_DCON_HANDSHAKE);
239 } else {
240 s3c2410_dma_config(prtd->params->channel,
241 prtd->params->dma_size,
242 S3C2410_DCON_HANDSHAKE |
243 S3C2410_DCON_SYNC_PCLK);
244
245 s3c2410_dma_devconfig(prtd->params->channel,
246 S3C2410_DMASRC_HW, 0x3,
247 prtd->params->dma_addr);
248 }
249
249 /* flush the DMA channel */ 250 /* flush the DMA channel */
250 s3c2410_dma_ctrl(prtd->params->channel, S3C2410_DMAOP_FLUSH); 251 s3c2410_dma_ctrl(prtd->params->channel, S3C2410_DMAOP_FLUSH);
251 prtd->dma_loaded = 0; 252 prtd->dma_loaded = 0;