ASoC/mpc5200: get rid of the appl_ptr tracking nonsense
[deliverable/linux.git] / sound / soc / fsl / mpc5200_dma.h
CommitLineData
89dd0842
JS
1/*
2 * Freescale MPC5200 Audio DMA driver
3 */
4
5#ifndef __SOUND_SOC_FSL_MPC5200_DMA_H__
6#define __SOUND_SOC_FSL_MPC5200_DMA_H__
7
dbcc3475
JS
8#define PSC_STREAM_NAME_LEN 32
9
89dd0842 10/**
dbcc3475 11 * psc_ac97_stream - Data specific to a single stream (playback or capture)
89dd0842 12 * @active: flag indicating if the stream is active
cebe7767 13 * @psc_dma: pointer back to parent psc_dma data structure
89dd0842
JS
14 * @bcom_task: bestcomm task structure
15 * @irq: irq number for bestcomm task
89dd0842
JS
16 * @period_end: physical address of end of DMA region
17 * @period_next_pt: physical address of next DMA buffer to enqueue
18 * @period_bytes: size of DMA period in bytes
19 */
cebe7767 20struct psc_dma_stream {
dbcc3475 21 struct snd_pcm_runtime *runtime;
89dd0842 22 int active;
cebe7767 23 struct psc_dma *psc_dma;
89dd0842
JS
24 struct bcom_task *bcom_task;
25 int irq;
26 struct snd_pcm_substream *stream;
8f159d72
GL
27 int period_next;
28 int period_current;
89dd0842
JS
29 int period_bytes;
30};
31
32/**
cebe7767 33 * psc_dma - Private driver data
89dd0842
JS
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
44 */
cebe7767 45struct psc_dma {
89dd0842
JS
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;
89dd0842 51 spinlock_t lock;
0827d6ba 52 struct mutex mutex;
89dd0842 53 u32 sicr;
dbcc3475
JS
54 uint sysclk;
55 int imr;
56 int id;
57 unsigned int slots;
89dd0842
JS
58
59 /* per-stream data */
cebe7767
JS
60 struct psc_dma_stream playback;
61 struct psc_dma_stream capture;
89dd0842
JS
62
63 /* Statistics */
64 struct {
dbcc3475
JS
65 unsigned long overrun_count;
66 unsigned long underrun_count;
89dd0842
JS
67 } stats;
68};
69
dbcc3475
JS
70int mpc5200_audio_dma_create(struct of_device *op);
71int mpc5200_audio_dma_destroy(struct of_device *op);
89dd0842 72
dbcc3475 73extern struct snd_soc_platform mpc5200_audio_dma_platform;
89dd0842
JS
74
75#endif /* __SOUND_SOC_FSL_MPC5200_DMA_H__ */
This page took 0.042658 seconds and 5 git commands to generate.