at91-pcm.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * at91-pcm.h - ALSA PCM interface for the Atmel AT91 SoC
  3. *
  4. * Author: Frank Mandarino <fmandarino@endrelia.com>
  5. * Endrelia Technologies Inc.
  6. * Created: Mar 3, 2006
  7. *
  8. * Based on pxa2xx-pcm.h by:
  9. *
  10. * Author: Nicolas Pitre
  11. * Created: Nov 30, 2004
  12. * Copyright: MontaVista Software, Inc.
  13. *
  14. * This program is free software; you can redistribute it and/or modify
  15. * it under the terms of the GNU General Public License version 2 as
  16. * published by the Free Software Foundation.
  17. */
  18. #ifndef _AT91_PCM_H
  19. #define _AT91_PCM_H
  20. #include <asm/arch/hardware.h>
  21. struct at91_ssc_periph {
  22. void __iomem *base;
  23. u32 pid;
  24. };
  25. /*
  26. * Registers and status bits that are required by the PCM driver.
  27. */
  28. struct at91_pdc_regs {
  29. unsigned int xpr; /* PDC recv/trans pointer */
  30. unsigned int xcr; /* PDC recv/trans counter */
  31. unsigned int xnpr; /* PDC next recv/trans pointer */
  32. unsigned int xncr; /* PDC next recv/trans counter */
  33. unsigned int ptcr; /* PDC transfer control */
  34. };
  35. struct at91_ssc_mask {
  36. u32 ssc_enable; /* SSC recv/trans enable */
  37. u32 ssc_disable; /* SSC recv/trans disable */
  38. u32 ssc_endx; /* SSC ENDTX or ENDRX */
  39. u32 ssc_endbuf; /* SSC TXBUFE or RXBUFF */
  40. u32 pdc_enable; /* PDC recv/trans enable */
  41. u32 pdc_disable; /* PDC recv/trans disable */
  42. };
  43. /*
  44. * This structure, shared between the PCM driver and the interface,
  45. * contains all information required by the PCM driver to perform the
  46. * PDC DMA operation. All fields except dma_intr_handler() are initialized
  47. * by the interface. The dms_intr_handler() pointer is set by the PCM
  48. * driver and called by the interface SSC interrupt handler if it is
  49. * non-NULL.
  50. */
  51. struct at91_pcm_dma_params {
  52. char *name; /* stream identifier */
  53. int pdc_xfer_size; /* PDC counter increment in bytes */
  54. void __iomem *ssc_base; /* SSC base address */
  55. struct at91_pdc_regs *pdc; /* PDC receive or transmit registers */
  56. struct at91_ssc_mask *mask;/* SSC & PDC status bits */
  57. struct snd_pcm_substream *substream;
  58. void (*dma_intr_handler)(u32, struct snd_pcm_substream *);
  59. };
  60. extern struct snd_soc_platform at91_soc_platform;
  61. #define at91_ssc_read(a) ((unsigned long) __raw_readl(a))
  62. #define at91_ssc_write(a,v) __raw_writel((v),(a))
  63. #endif /* _AT91_PCM_H */