mpc5200_dma.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. /**
  7. * psc_i2s_stream - Data specific to a single stream (playback or capture)
  8. * @active: flag indicating if the stream is active
  9. * @psc_i2s: pointer back to parent psc_i2s data structure
  10. * @bcom_task: bestcomm task structure
  11. * @irq: irq number for bestcomm task
  12. * @period_start: physical address of start of DMA region
  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_i2s_stream {
  18. int active;
  19. struct psc_i2s *psc_i2s;
  20. struct bcom_task *bcom_task;
  21. int irq;
  22. struct snd_pcm_substream *stream;
  23. dma_addr_t period_start;
  24. dma_addr_t period_end;
  25. dma_addr_t period_next_pt;
  26. dma_addr_t period_current_pt;
  27. int period_bytes;
  28. };
  29. /**
  30. * psc_i2s - 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_i2s {
  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. struct snd_soc_dai dai;
  49. spinlock_t lock;
  50. u32 sicr;
  51. /* per-stream data */
  52. struct psc_i2s_stream playback;
  53. struct psc_i2s_stream capture;
  54. /* Statistics */
  55. struct {
  56. int overrun_count;
  57. int underrun_count;
  58. } stats;
  59. };
  60. int psc_i2s_startup(struct snd_pcm_substream *substream,
  61. struct snd_soc_dai *dai);
  62. int psc_i2s_hw_free(struct snd_pcm_substream *substream,
  63. struct snd_soc_dai *dai);
  64. void psc_i2s_shutdown(struct snd_pcm_substream *substream,
  65. struct snd_soc_dai *dai);
  66. int psc_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
  67. struct snd_soc_dai *dai);
  68. extern struct snd_soc_platform psc_i2s_pcm_soc_platform;
  69. #endif /* __SOUND_SOC_FSL_MPC5200_DMA_H__ */