Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mpc5200_dma.h
Go to the documentation of this file.
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 
8 #define PSC_STREAM_NAME_LEN 32
9 
23  int active;
24  struct psc_dma *psc_dma;
26  int irq;
32 
33  /* AC97 state */
35 };
36 
50 struct psc_dma {
51  char name[32];
54  unsigned int irq;
55  struct device *dev;
57  struct mutex mutex;
60  int imr;
61  int id;
62  unsigned int slots;
63 
64  /* per-stream data */
67 
68  /* Statistics */
69  struct {
70  unsigned long overrun_count;
71  unsigned long underrun_count;
72  } stats;
73 };
74 
75 /* Utility for retrieving psc_dma_stream structure from a substream */
76 static inline struct psc_dma_stream *
77 to_psc_dma_stream(struct snd_pcm_substream *substream, struct psc_dma *psc_dma)
78 {
79  if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE)
80  return &psc_dma->capture;
81  return &psc_dma->playback;
82 }
83 
86 
87 #endif /* __SOUND_SOC_FSL_MPC5200_DMA_H__ */