davinci_asp.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. * TI DaVinci Audio Serial Port support
  3. *
  4. * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation version 2.
  9. *
  10. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
  11. * kind, whether express or implied; without even the implied warranty
  12. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #ifndef __DAVINCI_ASP_H
  16. #define __DAVINCI_ASP_H
  17. #include <linux/genalloc.h>
  18. struct snd_platform_data {
  19. u32 tx_dma_offset;
  20. u32 rx_dma_offset;
  21. int asp_chan_q; /* event queue number for ASP channel */
  22. int ram_chan_q; /* event queue number for RAM channel */
  23. /*
  24. * Allowing this is more efficient and eliminates left and right swaps
  25. * caused by underruns, but will swap the left and right channels
  26. * when compared to previous behavior.
  27. */
  28. unsigned enable_channel_combine:1;
  29. unsigned sram_size_playback;
  30. unsigned sram_size_capture;
  31. struct gen_pool *sram_pool;
  32. /*
  33. * If McBSP peripheral gets the clock from an external pin,
  34. * there are three chooses, that are MCBSP_CLKX, MCBSP_CLKR
  35. * and MCBSP_CLKS.
  36. * Depending on different hardware connections it is possible
  37. * to use this setting to change the behaviour of McBSP
  38. * driver.
  39. */
  40. int clk_input_pin;
  41. /*
  42. * This flag works when both clock and FS are outputs for the cpu
  43. * and makes clock more accurate (FS is not symmetrical and the
  44. * clock is very fast.
  45. * The clock becoming faster is named
  46. * i2s continuous serial clock (I2S_SCK) and it is an externally
  47. * visible bit clock.
  48. *
  49. * first line : WordSelect
  50. * second line : ContinuousSerialClock
  51. * third line: SerialData
  52. *
  53. * SYMMETRICAL APPROACH:
  54. * _______________________ LEFT
  55. * _| RIGHT |______________________|
  56. * _ _ _ _ _ _ _ _
  57. * _| |_| |_ x16 _| |_| |_| |_| |_ x16 _| |_| |_
  58. * _ _ _ _ _ _ _ _
  59. * _/ \_/ \_ ... _/ \_/ \_/ \_/ \_ ... _/ \_/ \_
  60. * \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
  61. *
  62. * ACCURATE CLOCK APPROACH:
  63. * ______________ LEFT
  64. * _| RIGHT |_______________________________|
  65. * _ _ _ _ _ _ _ _ _
  66. * _| |_ x16 _| |_| |_ x16 _| |_| |_| |_| |_| |_| |
  67. * _ _ _ _ dummy cycles
  68. * _/ \_ ... _/ \_/ \_ ... _/ \__________________
  69. * \_/ \_/ \_/ \_/
  70. *
  71. */
  72. bool i2s_accurate_sck;
  73. /* McASP specific fields */
  74. int tdm_slots;
  75. u8 op_mode;
  76. u8 num_serializer;
  77. u8 *serial_dir;
  78. u8 version;
  79. u8 txnumevt;
  80. u8 rxnumevt;
  81. };
  82. enum {
  83. MCASP_VERSION_1 = 0, /* DM646x */
  84. MCASP_VERSION_2, /* DA8xx/OMAPL1x */
  85. MCASP_VERSION_3, /* TI81xx/AM33xx */
  86. };
  87. enum mcbsp_clk_input_pin {
  88. MCBSP_CLKR = 0, /* as in DM365 */
  89. MCBSP_CLKS,
  90. };
  91. #define INACTIVE_MODE 0
  92. #define TX_MODE 1
  93. #define RX_MODE 2
  94. #define DAVINCI_MCASP_IIS_MODE 0
  95. #define DAVINCI_MCASP_DIT_MODE 1
  96. #endif