asp.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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 eventq_no; /* event queue number */
  44. unsigned int codec_fmt;
  45. /*
  46. * Allowing this is more efficient and eliminates left and right swaps
  47. * caused by underruns, but will swap the left and right channels
  48. * when compared to previous behavior.
  49. */
  50. unsigned enable_channel_combine:1;
  51. unsigned sram_size_playback;
  52. unsigned sram_size_capture;
  53. /*
  54. * If McBSP peripheral gets the clock from an external pin,
  55. * there are three chooses, that are MCBSP_CLKX, MCBSP_CLKR
  56. * and MCBSP_CLKS.
  57. * Depending on different hardware connections it is possible
  58. * to use this setting to change the behaviour of McBSP
  59. * driver. The dm365_clk_input_pin enum is available for dm365
  60. */
  61. int clk_input_pin;
  62. /*
  63. * This flag works when both clock and FS are outputs for the cpu
  64. * and makes clock more accurate (FS is not symmetrical and the
  65. * clock is very fast.
  66. * The clock becoming faster is named
  67. * i2s continuous serial clock (I2S_SCK) and it is an externally
  68. * visible bit clock.
  69. *
  70. * first line : WordSelect
  71. * second line : ContinuousSerialClock
  72. * third line: SerialData
  73. *
  74. * SYMMETRICAL APPROACH:
  75. * _______________________ LEFT
  76. * _| RIGHT |______________________|
  77. * _ _ _ _ _ _ _ _
  78. * _| |_| |_ x16 _| |_| |_| |_| |_ x16 _| |_| |_
  79. * _ _ _ _ _ _ _ _
  80. * _/ \_/ \_ ... _/ \_/ \_/ \_/ \_ ... _/ \_/ \_
  81. * \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
  82. *
  83. * ACCURATE CLOCK APPROACH:
  84. * ______________ LEFT
  85. * _| RIGHT |_______________________________|
  86. * _ _ _ _ _ _ _ _ _
  87. * _| |_ x16 _| |_| |_ x16 _| |_| |_| |_| |_| |_| |
  88. * _ _ _ _ dummy cycles
  89. * _/ \_ ... _/ \_/ \_ ... _/ \__________________
  90. * \_/ \_/ \_/ \_/
  91. *
  92. */
  93. bool i2s_accurate_sck;
  94. /* McASP specific fields */
  95. int tdm_slots;
  96. u8 op_mode;
  97. u8 num_serializer;
  98. u8 *serial_dir;
  99. u8 version;
  100. u8 txnumevt;
  101. u8 rxnumevt;
  102. };
  103. enum {
  104. MCASP_VERSION_1 = 0, /* DM646x */
  105. MCASP_VERSION_2, /* DA8xx/OMAPL1x */
  106. };
  107. enum dm365_clk_input_pin {
  108. MCBSP_CLKR = 0, /* DM365 */
  109. MCBSP_CLKS,
  110. };
  111. #define INACTIVE_MODE 0
  112. #define TX_MODE 1
  113. #define RX_MODE 2
  114. #define DAVINCI_MCASP_IIS_MODE 0
  115. #define DAVINCI_MCASP_DIT_MODE 1
  116. #endif /* __ASM_ARCH_DAVINCI_ASP_H */