mpc5200_dma.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * Freescale MPC5200 Audio DMA driver
  3. */
  4. #ifndef __SOUND_SOC_FSL_MPC5200_DMA_H__
  5. #define __SOUND_SOC_FSL_MPC5200_DMA_H__
  6. #define PSC_STREAM_NAME_LEN 32
  7. /**
  8. * psc_ac97_stream - Data specific to a single stream (playback or capture)
  9. * @active: flag indicating if the stream is active
  10. * @psc_dma: pointer back to parent psc_dma data structure
  11. * @bcom_task: bestcomm task structure
  12. * @irq: irq number for bestcomm task
  13. * @period_end: physical address of end of DMA region
  14. * @period_next_pt: physical address of next DMA buffer to enqueue
  15. * @period_bytes: size of DMA period in bytes
  16. */
  17. struct psc_dma_stream {
  18. struct snd_pcm_runtime *runtime;
  19. snd_pcm_uframes_t appl_ptr;
  20. int active;
  21. struct psc_dma *psc_dma;
  22. struct bcom_task *bcom_task;
  23. int irq;
  24. struct snd_pcm_substream *stream;
  25. int period_next;
  26. int period_current;
  27. int period_bytes;
  28. };
  29. /**
  30. * psc_dma - Private driver data
  31. * @name: short name for this device ("PSC0", "PSC1", etc)
  32. * @psc_regs: pointer to the PSC's registers
  33. * @fifo_regs: pointer to the PSC's FIFO registers
  34. * @irq: IRQ of this PSC
  35. * @dev: struct device pointer
  36. * @dai: the CPU DAI for this device
  37. * @sicr: Base value used in serial interface control register; mode is ORed
  38. * with this value.
  39. * @playback: Playback stream context data
  40. * @capture: Capture stream context data
  41. */
  42. struct psc_dma {
  43. char name[32];
  44. struct mpc52xx_psc __iomem *psc_regs;
  45. struct mpc52xx_psc_fifo __iomem *fifo_regs;
  46. unsigned int irq;
  47. struct device *dev;
  48. spinlock_t lock;
  49. struct mutex mutex;
  50. u32 sicr;
  51. uint sysclk;
  52. int imr;
  53. int id;
  54. unsigned int slots;
  55. /* per-stream data */
  56. struct psc_dma_stream playback;
  57. struct psc_dma_stream capture;
  58. /* Statistics */
  59. struct {
  60. unsigned long overrun_count;
  61. unsigned long underrun_count;
  62. } stats;
  63. };
  64. int mpc5200_audio_dma_create(struct of_device *op);
  65. int mpc5200_audio_dma_destroy(struct of_device *op);
  66. extern struct snd_soc_platform mpc5200_audio_dma_platform;
  67. #endif /* __SOUND_SOC_FSL_MPC5200_DMA_H__ */