diff options
Diffstat (limited to 'sound/soc/samsung/dma.c')
-rw-r--r-- | sound/soc/samsung/dma.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c index 5cb3b88..fc56ed0 100644 --- a/sound/soc/samsung/dma.c +++ b/sound/soc/samsung/dma.c @@ -42,9 +42,9 @@ static const struct snd_pcm_hardware dma_hardware = { SNDRV_PCM_FMTBIT_S8, .channels_min = 2, .channels_max = 2, - .buffer_bytes_max = 128*1024, - .period_bytes_min = PAGE_SIZE, - .period_bytes_max = PAGE_SIZE*2, + .buffer_bytes_max = 128 * 1024, + .period_bytes_min = 128, + .period_bytes_max = 32 * 1024, .periods_min = 2, .periods_max = 128, .fifo_size = 32, @@ -191,6 +191,11 @@ static int dma_hw_params(struct snd_pcm_substream *substream, prtd->dma_start = runtime->dma_addr; prtd->dma_pos = prtd->dma_start; prtd->dma_end = prtd->dma_start + totbytes; + + pr_debug("DmaAddr=@%x Total=%lubytes PrdSz=%u #Prds=%u dma_area=0x%x\n", + prtd->dma_start, totbytes, params_period_bytes(params), + params_periods(params), (unsigned int)runtime->dma_area); + spin_unlock_irq(&prtd->lock); return 0; @@ -408,7 +413,11 @@ static void dma_free_dma_buffers(struct snd_pcm *pcm) pr_debug("Entered %s\n", __func__); +#ifdef CONFIG_S5P_INTERNAL_DMA + for (stream = 1; stream < 2; stream++) { +#else for (stream = 0; stream < 2; stream++) { +#endif substream = pcm->streams[stream].substream; if (!substream) continue; @@ -437,13 +446,14 @@ static int dma_new(struct snd_card *card, if (!card->dev->coherent_dma_mask) card->dev->coherent_dma_mask = 0xffffffff; +#ifndef CONFIG_S5P_INTERNAL_DMA if (dai->driver->playback.channels_min) { ret = preallocate_dma_buffer(pcm, SNDRV_PCM_STREAM_PLAYBACK); if (ret) goto out; } - +#endif if (dai->driver->capture.channels_min) { ret = preallocate_dma_buffer(pcm, SNDRV_PCM_STREAM_CAPTURE); @@ -454,11 +464,14 @@ out: return ret; } -static struct snd_soc_platform_driver samsung_asoc_platform = { +struct snd_soc_platform_driver samsung_asoc_platform = { .ops = &dma_ops, .pcm_new = dma_new, .pcm_free = dma_free_dma_buffers, }; +EXPORT_SYMBOL_GPL(samsung_asoc_platform); + +#ifndef CONFIG_S5P_INTERNAL_DMA static int __devinit samsung_asoc_platform_probe(struct platform_device *pdev) { @@ -493,6 +506,8 @@ static void __exit samsung_asoc_exit(void) } module_exit(samsung_asoc_exit); +#endif + MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>"); MODULE_DESCRIPTION("Samsung ASoC DMA Driver"); MODULE_LICENSE("GPL"); |