]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blame - sound/soc/fsl/mpc5200_dma.h
ASoC/mpc5200: Improve printk debug output for trigger
[mirror_ubuntu-zesty-kernel.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 29 int period_bytes;
c4878274 30 int period_count;
89dd0842
JS
31};
32
33/**
cebe7767 34 * psc_dma - Private driver data
89dd0842
JS
35 * @name: short name for this device ("PSC0", "PSC1", etc)
36 * @psc_regs: pointer to the PSC's registers
37 * @fifo_regs: pointer to the PSC's FIFO registers
38 * @irq: IRQ of this PSC
39 * @dev: struct device pointer
40 * @dai: the CPU DAI for this device
41 * @sicr: Base value used in serial interface control register; mode is ORed
42 * with this value.
43 * @playback: Playback stream context data
44 * @capture: Capture stream context data
45 */
cebe7767 46struct psc_dma {
89dd0842
JS
47 char name[32];
48 struct mpc52xx_psc __iomem *psc_regs;
49 struct mpc52xx_psc_fifo __iomem *fifo_regs;
50 unsigned int irq;
51 struct device *dev;
89dd0842 52 spinlock_t lock;
0827d6ba 53 struct mutex mutex;
89dd0842 54 u32 sicr;
dbcc3475
JS
55 uint sysclk;
56 int imr;
57 int id;
58 unsigned int slots;
89dd0842
JS
59
60 /* per-stream data */
cebe7767
JS
61 struct psc_dma_stream playback;
62 struct psc_dma_stream capture;
89dd0842
JS
63
64 /* Statistics */
65 struct {
dbcc3475
JS
66 unsigned long overrun_count;
67 unsigned long underrun_count;
89dd0842
JS
68 } stats;
69};
70
dbcc3475
JS
71int mpc5200_audio_dma_create(struct of_device *op);
72int mpc5200_audio_dma_destroy(struct of_device *op);
89dd0842 73
dbcc3475 74extern struct snd_soc_platform mpc5200_audio_dma_platform;
89dd0842
JS
75
76#endif /* __SOUND_SOC_FSL_MPC5200_DMA_H__ */