2009-05-24 07:12:59 +08:00
|
|
|
/*
|
|
|
|
* Freescale MPC5200 Audio DMA driver
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __SOUND_SOC_FSL_MPC5200_DMA_H__
|
|
|
|
#define __SOUND_SOC_FSL_MPC5200_DMA_H__
|
|
|
|
|
|
|
|
/**
|
2009-05-24 07:13:01 +08:00
|
|
|
* psc_dma_stream - Data specific to a single stream (playback or capture)
|
2009-05-24 07:12:59 +08:00
|
|
|
* @active: flag indicating if the stream is active
|
2009-05-24 07:13:01 +08:00
|
|
|
* @psc_dma: pointer back to parent psc_dma data structure
|
2009-05-24 07:12:59 +08:00
|
|
|
* @bcom_task: bestcomm task structure
|
|
|
|
* @irq: irq number for bestcomm task
|
|
|
|
* @period_start: physical address of start of DMA region
|
|
|
|
* @period_end: physical address of end of DMA region
|
|
|
|
* @period_next_pt: physical address of next DMA buffer to enqueue
|
|
|
|
* @period_bytes: size of DMA period in bytes
|
|
|
|
*/
|
2009-05-24 07:13:01 +08:00
|
|
|
struct psc_dma_stream {
|
2009-05-24 07:12:59 +08:00
|
|
|
int active;
|
2009-05-24 07:13:01 +08:00
|
|
|
struct psc_dma *psc_dma;
|
2009-05-24 07:12:59 +08:00
|
|
|
struct bcom_task *bcom_task;
|
|
|
|
int irq;
|
|
|
|
struct snd_pcm_substream *stream;
|
|
|
|
dma_addr_t period_start;
|
|
|
|
dma_addr_t period_end;
|
|
|
|
dma_addr_t period_next_pt;
|
|
|
|
dma_addr_t period_current_pt;
|
|
|
|
int period_bytes;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2009-05-24 07:13:01 +08:00
|
|
|
* psc_dma - Private driver data
|
2009-05-24 07:12:59 +08:00
|
|
|
* @name: short name for this device ("PSC0", "PSC1", etc)
|
|
|
|
* @psc_regs: pointer to the PSC's registers
|
|
|
|
* @fifo_regs: pointer to the PSC's FIFO registers
|
|
|
|
* @irq: IRQ of this PSC
|
|
|
|
* @dev: struct device pointer
|
|
|
|
* @dai: the CPU DAI for this device
|
|
|
|
* @sicr: Base value used in serial interface control register; mode is ORed
|
|
|
|
* with this value.
|
|
|
|
* @playback: Playback stream context data
|
|
|
|
* @capture: Capture stream context data
|
|
|
|
*/
|
2009-05-24 07:13:01 +08:00
|
|
|
struct psc_dma {
|
2009-05-24 07:12:59 +08:00
|
|
|
char name[32];
|
|
|
|
struct mpc52xx_psc __iomem *psc_regs;
|
|
|
|
struct mpc52xx_psc_fifo __iomem *fifo_regs;
|
|
|
|
unsigned int irq;
|
|
|
|
struct device *dev;
|
|
|
|
struct snd_soc_dai dai;
|
|
|
|
spinlock_t lock;
|
|
|
|
u32 sicr;
|
|
|
|
|
|
|
|
/* per-stream data */
|
2009-05-24 07:13:01 +08:00
|
|
|
struct psc_dma_stream playback;
|
|
|
|
struct psc_dma_stream capture;
|
2009-05-24 07:12:59 +08:00
|
|
|
|
|
|
|
/* Statistics */
|
|
|
|
struct {
|
|
|
|
int overrun_count;
|
|
|
|
int underrun_count;
|
|
|
|
} stats;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-05-24 07:13:01 +08:00
|
|
|
int psc_dma_startup(struct snd_pcm_substream *substream,
|
2009-05-24 07:12:59 +08:00
|
|
|
struct snd_soc_dai *dai);
|
|
|
|
|
2009-05-24 07:13:01 +08:00
|
|
|
int psc_dma_hw_free(struct snd_pcm_substream *substream,
|
2009-05-24 07:12:59 +08:00
|
|
|
struct snd_soc_dai *dai);
|
|
|
|
|
2009-05-24 07:13:01 +08:00
|
|
|
void psc_dma_shutdown(struct snd_pcm_substream *substream,
|
2009-05-24 07:12:59 +08:00
|
|
|
struct snd_soc_dai *dai);
|
|
|
|
|
2009-05-24 07:13:01 +08:00
|
|
|
int psc_dma_trigger(struct snd_pcm_substream *substream, int cmd,
|
2009-05-24 07:12:59 +08:00
|
|
|
struct snd_soc_dai *dai);
|
|
|
|
|
2009-05-24 07:13:01 +08:00
|
|
|
extern struct snd_soc_platform psc_dma_pcm_soc_platform;
|
2009-05-24 07:12:59 +08:00
|
|
|
|
|
|
|
#endif /* __SOUND_SOC_FSL_MPC5200_DMA_H__ */
|