aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/blackfin/bf5xx-ac97-pcm.c
diff options
context:
space:
mode:
authorBarry Song <barry.song@analog.com>2011-03-28 01:45:10 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-03-29 18:20:05 -0400
commit2c66cb99d134d787827ed1cd93cc59351ab66a95 (patch)
tree4c67200205b224947e9500b17af9537e54254a65 /sound/soc/blackfin/bf5xx-ac97-pcm.c
parentbfe4ee0a935dccf5980ecb5605c66fe50feb9056 (diff)
ASoC: Blackfin: push down SPORT settings from global variables
Now that we have multi-component support, take the time to unify the SPORT implementations a bit and make the setup dynamic. This kills off the global sport_handle which was shared across all the Blackfin machine drivers. The pin management aspect is off loaded to platform resources, and now multiple SPORTs can be instantiated simultaneously. Signed-off-by: Barry Song <barry.song@analog.com> Signed-off-by: Scott Jiang <scott.jiang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/blackfin/bf5xx-ac97-pcm.c')
-rw-r--r--sound/soc/blackfin/bf5xx-ac97-pcm.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sound/soc/blackfin/bf5xx-ac97-pcm.c b/sound/soc/blackfin/bf5xx-ac97-pcm.c
index e940d26048d0..98b44b316e78 100644
--- a/sound/soc/blackfin/bf5xx-ac97-pcm.c
+++ b/sound/soc/blackfin/bf5xx-ac97-pcm.c
@@ -243,6 +243,9 @@ static snd_pcm_uframes_t bf5xx_pcm_pointer(struct snd_pcm_substream *substream)
243 243
244static int bf5xx_pcm_open(struct snd_pcm_substream *substream) 244static int bf5xx_pcm_open(struct snd_pcm_substream *substream)
245{ 245{
246 struct snd_soc_pcm_runtime *rtd = substream->private_data;
247 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
248 struct sport_device *sport_handle = snd_soc_dai_get_drvdata(cpu_dai);
246 struct snd_pcm_runtime *runtime = substream->runtime; 249 struct snd_pcm_runtime *runtime = substream->runtime;
247 int ret; 250 int ret;
248 251
@@ -314,6 +317,9 @@ static struct snd_pcm_ops bf5xx_pcm_ac97_ops = {
314 317
315static int bf5xx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream) 318static int bf5xx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream)
316{ 319{
320 struct snd_soc_pcm_runtime *rtd = pcm->private_data;
321 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
322 struct sport_device *sport_handle = snd_soc_dai_get_drvdata(cpu_dai);
317 struct snd_pcm_substream *substream = pcm->streams[stream].substream; 323 struct snd_pcm_substream *substream = pcm->streams[stream].substream;
318 struct snd_dma_buffer *buf = &substream->dma_buffer; 324 struct snd_dma_buffer *buf = &substream->dma_buffer;
319 size_t size = bf5xx_pcm_hardware.buffer_bytes_max 325 size_t size = bf5xx_pcm_hardware.buffer_bytes_max
@@ -377,6 +383,9 @@ static void bf5xx_pcm_free_dma_buffers(struct snd_pcm *pcm)
377 struct snd_dma_buffer *buf; 383 struct snd_dma_buffer *buf;
378 int stream; 384 int stream;
379#if defined(CONFIG_SND_BF5XX_MMAP_SUPPORT) 385#if defined(CONFIG_SND_BF5XX_MMAP_SUPPORT)
386 struct snd_soc_pcm_runtime *rtd = pcm->private_data;
387 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
388 struct sport_device *sport_handle = snd_soc_dai_get_drvdata(cpu_dai);
380 size_t size = bf5xx_pcm_hardware.buffer_bytes_max * 389 size_t size = bf5xx_pcm_hardware.buffer_bytes_max *
381 sizeof(struct ac97_frame) / 4; 390 sizeof(struct ac97_frame) / 4;
382#endif 391#endif
@@ -405,8 +414,6 @@ static void bf5xx_pcm_free_dma_buffers(struct snd_pcm *pcm)
405 } 414 }
406#endif 415#endif
407 } 416 }
408 if (sport_handle)
409 sport_done(sport_handle);
410} 417}
411 418
412static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32); 419static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32);