ASoC: Rename the PSC functions to DMA
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / sound / soc / fsl / mpc5200_dma.h
bloba33232c0c59ef58968def37a53e91583182437a9
1 /*
2 * Freescale MPC5200 Audio DMA driver
3 */
5 #ifndef __SOUND_SOC_FSL_MPC5200_DMA_H__
6 #define __SOUND_SOC_FSL_MPC5200_DMA_H__
8 /**
9 * psc_dma_stream - Data specific to a single stream (playback or capture)
10 * @active: flag indicating if the stream is active
11 * @psc_dma: pointer back to parent psc_dma data structure
12 * @bcom_task: bestcomm task structure
13 * @irq: irq number for bestcomm task
14 * @period_start: physical address of start of DMA region
15 * @period_end: physical address of end of DMA region
16 * @period_next_pt: physical address of next DMA buffer to enqueue
17 * @period_bytes: size of DMA period in bytes
19 struct psc_dma_stream {
20 int active;
21 struct psc_dma *psc_dma;
22 struct bcom_task *bcom_task;
23 int irq;
24 struct snd_pcm_substream *stream;
25 dma_addr_t period_start;
26 dma_addr_t period_end;
27 dma_addr_t period_next_pt;
28 dma_addr_t period_current_pt;
29 int period_bytes;
32 /**
33 * psc_dma - Private driver data
34 * @name: short name for this device ("PSC0", "PSC1", etc)
35 * @psc_regs: pointer to the PSC's registers
36 * @fifo_regs: pointer to the PSC's FIFO registers
37 * @irq: IRQ of this PSC
38 * @dev: struct device pointer
39 * @dai: the CPU DAI for this device
40 * @sicr: Base value used in serial interface control register; mode is ORed
41 * with this value.
42 * @playback: Playback stream context data
43 * @capture: Capture stream context data
45 struct psc_dma {
46 char name[32];
47 struct mpc52xx_psc __iomem *psc_regs;
48 struct mpc52xx_psc_fifo __iomem *fifo_regs;
49 unsigned int irq;
50 struct device *dev;
51 struct snd_soc_dai dai;
52 spinlock_t lock;
53 u32 sicr;
55 /* per-stream data */
56 struct psc_dma_stream playback;
57 struct psc_dma_stream capture;
59 /* Statistics */
60 struct {
61 int overrun_count;
62 int underrun_count;
63 } stats;
67 int psc_dma_startup(struct snd_pcm_substream *substream,
68 struct snd_soc_dai *dai);
70 int psc_dma_hw_free(struct snd_pcm_substream *substream,
71 struct snd_soc_dai *dai);
73 void psc_dma_shutdown(struct snd_pcm_substream *substream,
74 struct snd_soc_dai *dai);
76 int psc_dma_trigger(struct snd_pcm_substream *substream, int cmd,
77 struct snd_soc_dai *dai);
79 extern struct snd_soc_platform psc_dma_pcm_soc_platform;
81 #endif /* __SOUND_SOC_FSL_MPC5200_DMA_H__ */