asp.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /*
  2. * <mach/asp.h> - DaVinci Audio Serial Port support
  3. */
  4. #ifndef __ASM_ARCH_DAVINCI_ASP_H
  5. #define __ASM_ARCH_DAVINCI_ASP_H
  6. #include <mach/irqs.h>
  7. #include <mach/edma.h>
  8. /* Bases of dm644x and dm355 register banks */
  9. #define DAVINCI_ASP0_BASE 0x01E02000
  10. #define DAVINCI_ASP1_BASE 0x01E04000
  11. /* Bases of dm365 register banks */
  12. #define DAVINCI_DM365_ASP0_BASE 0x01D02000
  13. /* Bases of dm646x register banks */
  14. #define DAVINCI_DM646X_MCASP0_REG_BASE 0x01D01000
  15. #define DAVINCI_DM646X_MCASP1_REG_BASE 0x01D01800
  16. /* Bases of da850/da830 McASP0 register banks */
  17. #define DAVINCI_DA8XX_MCASP0_REG_BASE 0x01D00000
  18. /* Bases of da830 McASP1 register banks */
  19. #define DAVINCI_DA830_MCASP1_REG_BASE 0x01D04000
  20. /* EDMA channels of dm644x and dm355 */
  21. #define DAVINCI_DMA_ASP0_TX 2
  22. #define DAVINCI_DMA_ASP0_RX 3
  23. #define DAVINCI_DMA_ASP1_TX 8
  24. #define DAVINCI_DMA_ASP1_RX 9
  25. /* EDMA channels of dm646x */
  26. #define DAVINCI_DM646X_DMA_MCASP0_AXEVT0 6
  27. #define DAVINCI_DM646X_DMA_MCASP0_AREVT0 9
  28. #define DAVINCI_DM646X_DMA_MCASP1_AXEVT1 12
  29. /* EDMA channels of da850/da830 McASP0 */
  30. #define DAVINCI_DA8XX_DMA_MCASP0_AREVT 0
  31. #define DAVINCI_DA8XX_DMA_MCASP0_AXEVT 1
  32. /* EDMA channels of da830 McASP1 */
  33. #define DAVINCI_DA830_DMA_MCASP1_AREVT 2
  34. #define DAVINCI_DA830_DMA_MCASP1_AXEVT 3
  35. /* Interrupts */
  36. #define DAVINCI_ASP0_RX_INT IRQ_MBRINT
  37. #define DAVINCI_ASP0_TX_INT IRQ_MBXINT
  38. #define DAVINCI_ASP1_RX_INT IRQ_MBRINT
  39. #define DAVINCI_ASP1_TX_INT IRQ_MBXINT
  40. struct snd_platform_data {
  41. u32 tx_dma_offset;
  42. u32 rx_dma_offset;
  43. enum dma_event_q asp_chan_q; /* event queue number for ASP channel */
  44. enum dma_event_q ram_chan_q; /* event queue number for RAM channel */
  45. unsigned int codec_fmt;
  46. /*
  47. * Allowing this is more efficient and eliminates left and right swaps
  48. * caused by underruns, but will swap the left and right channels
  49. * when compared to previous behavior.
  50. */
  51. unsigned enable_channel_combine:1;
  52. unsigned sram_size_playback;
  53. unsigned sram_size_capture;
  54. /*
  55. * If McBSP peripheral gets the clock from an external pin,
  56. * there are three chooses, that are MCBSP_CLKX, MCBSP_CLKR
  57. * and MCBSP_CLKS.
  58. * Depending on different hardware connections it is possible
  59. * to use this setting to change the behaviour of McBSP
  60. * driver. The dm365_clk_input_pin enum is available for dm365
  61. */
  62. int clk_input_pin;
  63. /*
  64. * This flag works when both clock and FS are outputs for the cpu
  65. * and makes clock more accurate (FS is not symmetrical and the
  66. * clock is very fast.
  67. * The clock becoming faster is named
  68. * i2s continuous serial clock (I2S_SCK) and it is an externally
  69. * visible bit clock.
  70. *
  71. * first line : WordSelect
  72. * second line : ContinuousSerialClock
  73. * third line: SerialData
  74. *
  75. * SYMMETRICAL APPROACH:
  76. * _______________________ LEFT
  77. * _| RIGHT |______________________|
  78. * _ _ _ _ _ _ _ _
  79. * _| |_| |_ x16 _| |_| |_| |_| |_ x16 _| |_| |_
  80. * _ _ _ _ _ _ _ _
  81. * _/ \_/ \_ ... _/ \_/ \_/ \_/ \_ ... _/ \_/ \_
  82. * \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
  83. *
  84. * ACCURATE CLOCK APPROACH:
  85. * ______________ LEFT
  86. * _| RIGHT |_______________________________|
  87. * _ _ _ _ _ _ _ _ _
  88. * _| |_ x16 _| |_| |_ x16 _| |_| |_| |_| |_| |_| |
  89. * _ _ _ _ dummy cycles
  90. * _/ \_ ... _/ \_/ \_ ... _/ \__________________
  91. * \_/ \_/ \_/ \_/
  92. *
  93. */
  94. bool i2s_accurate_sck;
  95. /* McASP specific fields */
  96. int tdm_slots;
  97. u8 op_mode;
  98. u8 num_serializer;
  99. u8 *serial_dir;
  100. u8 version;
  101. u8 txnumevt;
  102. u8 rxnumevt;
  103. };
  104. enum {
  105. MCASP_VERSION_1 = 0, /* DM646x */
  106. MCASP_VERSION_2, /* DA8xx/OMAPL1x */
  107. };
  108. enum dm365_clk_input_pin {
  109. MCBSP_CLKR = 0, /* DM365 */
  110. MCBSP_CLKS,
  111. };
  112. #define INACTIVE_MODE 0
  113. #define TX_MODE 1
  114. #define RX_MODE 2
  115. #define DAVINCI_MCASP_IIS_MODE 0
  116. #define DAVINCI_MCASP_DIT_MODE 1
  117. #endif /* __ASM_ARCH_DAVINCI_ASP_H */