/*1* Freescale MPC5200 Audio DMA driver2*/34#ifndef __SOUND_SOC_FSL_MPC5200_DMA_H__5#define __SOUND_SOC_FSL_MPC5200_DMA_H__67#define PSC_STREAM_NAME_LEN 3289/**10* psc_ac97_stream - Data specific to a single stream (playback or capture)11* @active: flag indicating if the stream is active12* @psc_dma: pointer back to parent psc_dma data structure13* @bcom_task: bestcomm task structure14* @irq: irq number for bestcomm task15* @period_end: physical address of end of DMA region16* @period_next_pt: physical address of next DMA buffer to enqueue17* @period_bytes: size of DMA period in bytes18* @ac97_slot_bits: Enable bits for turning on the correct AC97 slot19*/20struct psc_dma_stream {21struct snd_pcm_runtime *runtime;22int active;23struct psc_dma *psc_dma;24struct bcom_task *bcom_task;25int irq;26struct snd_pcm_substream *stream;27int period_next;28int period_current;29int period_bytes;30int period_count;3132/* AC97 state */33u32 ac97_slot_bits;34};3536/**37* psc_dma - Private driver data38* @name: short name for this device ("PSC0", "PSC1", etc)39* @psc_regs: pointer to the PSC's registers40* @fifo_regs: pointer to the PSC's FIFO registers41* @irq: IRQ of this PSC42* @dev: struct device pointer43* @dai: the CPU DAI for this device44* @sicr: Base value used in serial interface control register; mode is ORed45* with this value.46* @playback: Playback stream context data47* @capture: Capture stream context data48*/49struct psc_dma {50char name[32];51struct mpc52xx_psc __iomem *psc_regs;52struct mpc52xx_psc_fifo __iomem *fifo_regs;53unsigned int irq;54struct device *dev;55spinlock_t lock;56struct mutex mutex;57u32 sicr;58uint sysclk;59int imr;60int id;61unsigned int slots;6263/* per-stream data */64struct psc_dma_stream playback;65struct psc_dma_stream capture;6667/* Statistics */68struct {69unsigned long overrun_count;70unsigned long underrun_count;71} stats;72};7374/* Utility for retrieving psc_dma_stream structure from a substream */75static inline struct psc_dma_stream *76to_psc_dma_stream(struct snd_pcm_substream *substream, struct psc_dma *psc_dma)77{78if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE)79return &psc_dma->capture;80return &psc_dma->playback;81}8283#endif /* __SOUND_SOC_FSL_MPC5200_DMA_H__ */848586