aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/at91
diff options
context:
space:
mode:
authorFrank Mandarino <fmandarino@endrelia.com>2007-02-02 11:19:24 -0500
committerJaroslav Kysela <perex@suse.cz>2007-02-09 03:03:44 -0500
commit6297027629a9349301e08442b67deb9783a5e984 (patch)
treede1d9282e225c9d835a21d2bf4f34598fe9aaf71 /sound/soc/at91
parent171eb8f81d7b0706c1085d272e4955251ed9f05f (diff)
[ALSA] soc - ASoC 0.13 AT91xxxx DMA
This patch updates the AT91xxxx audio DMA driver to the new API in ASoC 0.13. Changes:- o Updated to use new 0.13 data structures. o Suspend and Resume now conditionally compiled. o #include guard around at91-pcm.h header. Signed-off-by: Frank Mandarino <fmandarino@endrelia.com> Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/soc/at91')
-rw-r--r--sound/soc/at91/at91-pcm.c7
-rw-r--r--sound/soc/at91/at91-pcm.h9
2 files changed, 11 insertions, 5 deletions
diff --git a/sound/soc/at91/at91-pcm.c b/sound/soc/at91/at91-pcm.c
index fd9d7327b239..e88b12e7cc40 100644
--- a/sound/soc/at91/at91-pcm.c
+++ b/sound/soc/at91/at91-pcm.c
@@ -125,7 +125,7 @@ static int at91_pcm_hw_params(struct snd_pcm_substream *substream,
125 snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer); 125 snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer);
126 runtime->dma_bytes = params_buffer_bytes(params); 126 runtime->dma_bytes = params_buffer_bytes(params);
127 127
128 prtd->params = rtd->cpu_dai->dma_data; 128 prtd->params = rtd->dai->cpu_dai->dma_data;
129 prtd->params->dma_intr_handler = at91_pcm_dma_irq; 129 prtd->params->dma_intr_handler = at91_pcm_dma_irq;
130 130
131 prtd->dma_buffer = runtime->dma_addr; 131 prtd->dma_buffer = runtime->dma_addr;
@@ -363,6 +363,7 @@ static void at91_pcm_free_dma_buffers(struct snd_pcm *pcm)
363 } 363 }
364} 364}
365 365
366#ifdef CONFIG_PM
366static int at91_pcm_suspend(struct platform_device *pdev, 367static int at91_pcm_suspend(struct platform_device *pdev,
367 struct snd_soc_cpu_dai *dai) 368 struct snd_soc_cpu_dai *dai)
368{ 369{
@@ -410,6 +411,10 @@ static int at91_pcm_resume(struct platform_device *pdev,
410 at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_enable); 411 at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_enable);
411 return 0; 412 return 0;
412} 413}
414#else
415#define at91_pcm_suspend NULL
416#define at91_pcm_resume NULL
417#endif
413 418
414struct snd_soc_platform at91_soc_platform = { 419struct snd_soc_platform at91_soc_platform = {
415 .name = "at91-audio", 420 .name = "at91-audio",
diff --git a/sound/soc/at91/at91-pcm.h b/sound/soc/at91/at91-pcm.h
index 6c3b095725c8..58d0f00a07b2 100644
--- a/sound/soc/at91/at91-pcm.h
+++ b/sound/soc/at91/at91-pcm.h
@@ -16,6 +16,9 @@
16 * published by the Free Software Foundation. 16 * published by the Free Software Foundation.
17 */ 17 */
18 18
19#ifndef _AT91_PCM_H
20#define _AT91_PCM_H
21
19#include <asm/arch/hardware.h> 22#include <asm/arch/hardware.h>
20 23
21struct at91_ssc_periph { 24struct at91_ssc_periph {
@@ -23,7 +26,6 @@ struct at91_ssc_periph {
23 u32 pid; 26 u32 pid;
24}; 27};
25 28
26
27/* 29/*
28 * Registers and status bits that are required by the PCM driver. 30 * Registers and status bits that are required by the PCM driver.
29 */ 31 */
@@ -44,7 +46,6 @@ struct at91_ssc_mask {
44 u32 pdc_disable; /* PDC recv/trans disable */ 46 u32 pdc_disable; /* PDC recv/trans disable */
45}; 47};
46 48
47
48/* 49/*
49 * This structure, shared between the PCM driver and the interface, 50 * This structure, shared between the PCM driver and the interface,
50 * contains all information required by the PCM driver to perform the 51 * contains all information required by the PCM driver to perform the
@@ -63,9 +64,9 @@ struct at91_pcm_dma_params {
63 void (*dma_intr_handler)(u32, struct snd_pcm_substream *); 64 void (*dma_intr_handler)(u32, struct snd_pcm_substream *);
64}; 65};
65 66
66extern struct snd_soc_cpu_dai at91_i2s_dai[3];
67extern struct snd_soc_platform at91_soc_platform; 67extern struct snd_soc_platform at91_soc_platform;
68 68
69
70#define at91_ssc_read(a) ((unsigned long) __raw_readl(a)) 69#define at91_ssc_read(a) ((unsigned long) __raw_readl(a))
71#define at91_ssc_write(a,v) __raw_writel((v),(a)) 70#define at91_ssc_write(a,v) __raw_writel((v),(a))
71
72#endif /* _AT91_PCM_H */