diff options
author | Jon Smirl <jonsmirl@gmail.com> | 2009-05-26 08:34:08 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-05-26 16:12:50 -0400 |
commit | dbcc34756234596993a3b1304636f032e66d401f (patch) | |
tree | f1188f0c20ce402f778257bb0d905456ee213b14 /sound/soc/fsl/mpc5200_dma.h | |
parent | 0f89bdcac61536c5cb2a095a514657019573afb4 (diff) |
ASoC: Main rewite of the mpc5200 audio DMA code
Rewrite the mpc5200 audio DMA code to support both I2S and AC97.
Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/fsl/mpc5200_dma.h')
-rw-r--r-- | sound/soc/fsl/mpc5200_dma.h | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/sound/soc/fsl/mpc5200_dma.h b/sound/soc/fsl/mpc5200_dma.h index a33232c0c59e..2000803f06a7 100644 --- a/sound/soc/fsl/mpc5200_dma.h +++ b/sound/soc/fsl/mpc5200_dma.h | |||
@@ -5,8 +5,10 @@ | |||
5 | #ifndef __SOUND_SOC_FSL_MPC5200_DMA_H__ | 5 | #ifndef __SOUND_SOC_FSL_MPC5200_DMA_H__ |
6 | #define __SOUND_SOC_FSL_MPC5200_DMA_H__ | 6 | #define __SOUND_SOC_FSL_MPC5200_DMA_H__ |
7 | 7 | ||
8 | #define PSC_STREAM_NAME_LEN 32 | ||
9 | |||
8 | /** | 10 | /** |
9 | * psc_dma_stream - Data specific to a single stream (playback or capture) | 11 | * psc_ac97_stream - Data specific to a single stream (playback or capture) |
10 | * @active: flag indicating if the stream is active | 12 | * @active: flag indicating if the stream is active |
11 | * @psc_dma: pointer back to parent psc_dma data structure | 13 | * @psc_dma: pointer back to parent psc_dma data structure |
12 | * @bcom_task: bestcomm task structure | 14 | * @bcom_task: bestcomm task structure |
@@ -17,6 +19,9 @@ | |||
17 | * @period_bytes: size of DMA period in bytes | 19 | * @period_bytes: size of DMA period in bytes |
18 | */ | 20 | */ |
19 | struct psc_dma_stream { | 21 | struct psc_dma_stream { |
22 | struct snd_pcm_runtime *runtime; | ||
23 | snd_pcm_uframes_t appl_ptr; | ||
24 | |||
20 | int active; | 25 | int active; |
21 | struct psc_dma *psc_dma; | 26 | struct psc_dma *psc_dma; |
22 | struct bcom_task *bcom_task; | 27 | struct bcom_task *bcom_task; |
@@ -27,6 +32,7 @@ struct psc_dma_stream { | |||
27 | dma_addr_t period_next_pt; | 32 | dma_addr_t period_next_pt; |
28 | dma_addr_t period_current_pt; | 33 | dma_addr_t period_current_pt; |
29 | int period_bytes; | 34 | int period_bytes; |
35 | int period_size; | ||
30 | }; | 36 | }; |
31 | 37 | ||
32 | /** | 38 | /** |
@@ -48,9 +54,12 @@ struct psc_dma { | |||
48 | struct mpc52xx_psc_fifo __iomem *fifo_regs; | 54 | struct mpc52xx_psc_fifo __iomem *fifo_regs; |
49 | unsigned int irq; | 55 | unsigned int irq; |
50 | struct device *dev; | 56 | struct device *dev; |
51 | struct snd_soc_dai dai; | ||
52 | spinlock_t lock; | 57 | spinlock_t lock; |
53 | u32 sicr; | 58 | u32 sicr; |
59 | uint sysclk; | ||
60 | int imr; | ||
61 | int id; | ||
62 | unsigned int slots; | ||
54 | 63 | ||
55 | /* per-stream data */ | 64 | /* per-stream data */ |
56 | struct psc_dma_stream playback; | 65 | struct psc_dma_stream playback; |
@@ -58,24 +67,14 @@ struct psc_dma { | |||
58 | 67 | ||
59 | /* Statistics */ | 68 | /* Statistics */ |
60 | struct { | 69 | struct { |
61 | int overrun_count; | 70 | unsigned long overrun_count; |
62 | int underrun_count; | 71 | unsigned long underrun_count; |
63 | } stats; | 72 | } stats; |
64 | }; | 73 | }; |
65 | 74 | ||
75 | int mpc5200_audio_dma_create(struct of_device *op); | ||
76 | int mpc5200_audio_dma_destroy(struct of_device *op); | ||
66 | 77 | ||
67 | int psc_dma_startup(struct snd_pcm_substream *substream, | 78 | extern struct snd_soc_platform mpc5200_audio_dma_platform; |
68 | struct snd_soc_dai *dai); | ||
69 | |||
70 | int psc_dma_hw_free(struct snd_pcm_substream *substream, | ||
71 | struct snd_soc_dai *dai); | ||
72 | |||
73 | void psc_dma_shutdown(struct snd_pcm_substream *substream, | ||
74 | struct snd_soc_dai *dai); | ||
75 | |||
76 | int psc_dma_trigger(struct snd_pcm_substream *substream, int cmd, | ||
77 | struct snd_soc_dai *dai); | ||
78 | |||
79 | extern struct snd_soc_platform psc_dma_pcm_soc_platform; | ||
80 | 79 | ||
81 | #endif /* __SOUND_SOC_FSL_MPC5200_DMA_H__ */ | 80 | #endif /* __SOUND_SOC_FSL_MPC5200_DMA_H__ */ |