davinci_asp.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. struct snd_platform_data {
  18. u32 tx_dma_offset;
  19. u32 rx_dma_offset;
  20. int asp_chan_q; /* event queue number for ASP channel */
  21. int ram_chan_q; /* event queue number for RAM channel */
  22. unsigned int codec_fmt;
  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. /*
  32. * If McBSP peripheral gets the clock from an external pin,
  33. * there are three chooses, that are MCBSP_CLKX, MCBSP_CLKR
  34. * and MCBSP_CLKS.
  35. * Depending on different hardware connections it is possible
  36. * to use this setting to change the behaviour of McBSP
  37. * driver.
  38. */
  39. int clk_input_pin;
  40. /*
  41. * This flag works when both clock and FS are outputs for the cpu
  42. * and makes clock more accurate (FS is not symmetrical and the
  43. * clock is very fast.
  44. * The clock becoming faster is named
  45. * i2s continuous serial clock (I2S_SCK) and it is an externally
  46. * visible bit clock.
  47. *
  48. * first line : WordSelect
  49. * second line : ContinuousSerialClock
  50. * third line: SerialData
  51. *
  52. * SYMMETRICAL APPROACH:
  53. * _______________________ LEFT
  54. * _| RIGHT |______________________|
  55. * _ _ _ _ _ _ _ _
  56. * _| |_| |_ x16 _| |_| |_| |_| |_ x16 _| |_| |_
  57. * _ _ _ _ _ _ _ _
  58. * _/ \_/ \_ ... _/ \_/ \_/ \_/ \_ ... _/ \_/ \_
  59. * \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
  60. *
  61. * ACCURATE CLOCK APPROACH:
  62. * ______________ LEFT
  63. * _| RIGHT |_______________________________|
  64. * _ _ _ _ _ _ _ _ _
  65. * _| |_ x16 _| |_| |_ x16 _| |_| |_| |_| |_| |_| |
  66. * _ _ _ _ dummy cycles
  67. * _/ \_ ... _/ \_/ \_ ... _/ \__________________
  68. * \_/ \_/ \_/ \_/
  69. *
  70. */
  71. bool i2s_accurate_sck;
  72. /* McASP specific fields */
  73. int tdm_slots;
  74. u8 op_mode;
  75. u8 num_serializer;
  76. u8 *serial_dir;
  77. u8 version;
  78. u8 txnumevt;
  79. u8 rxnumevt;
  80. };
  81. enum {
  82. MCASP_VERSION_1 = 0, /* DM646x */
  83. MCASP_VERSION_2, /* DA8xx/OMAPL1x */
  84. MCASP_VERSION_3, /* TI81xx/AM33xx */
  85. };
  86. enum mcbsp_clk_input_pin {
  87. MCBSP_CLKR = 0, /* as in DM365 */
  88. MCBSP_CLKS,
  89. };
  90. #define INACTIVE_MODE 0
  91. #define TX_MODE 1
  92. #define RX_MODE 2
  93. #define DAVINCI_MCASP_IIS_MODE 0
  94. #define DAVINCI_MCASP_DIT_MODE 1
  95. #endif