msm-pcm-routing-v2.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. /* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. */
  12. #ifndef _MSM_PCM_ROUTING_H
  13. #define _MSM_PCM_ROUTING_H
  14. #include <sound/apr_audio-v2.h>
  15. #define LPASS_BE_PRI_I2S_RX "PRIMARY_I2S_RX"
  16. #define LPASS_BE_PRI_I2S_TX "PRIMARY_I2S_TX"
  17. #define LPASS_BE_SLIMBUS_0_RX "SLIMBUS_0_RX"
  18. #define LPASS_BE_SLIMBUS_0_TX "SLIMBUS_0_TX"
  19. #define LPASS_BE_HDMI "HDMI"
  20. #define LPASS_BE_INT_BT_SCO_RX "INT_BT_SCO_RX"
  21. #define LPASS_BE_INT_BT_SCO_TX "INT_BT_SCO_TX"
  22. #define LPASS_BE_INT_FM_RX "INT_FM_RX"
  23. #define LPASS_BE_INT_FM_TX "INT_FM_TX"
  24. #define LPASS_BE_AFE_PCM_RX "RT_PROXY_DAI_001_RX"
  25. #define LPASS_BE_AFE_PCM_TX "RT_PROXY_DAI_002_TX"
  26. #define LPASS_BE_AUXPCM_RX "AUX_PCM_RX"
  27. #define LPASS_BE_AUXPCM_TX "AUX_PCM_TX"
  28. #define LPASS_BE_SEC_AUXPCM_RX "SEC_AUX_PCM_RX"
  29. #define LPASS_BE_SEC_AUXPCM_TX "SEC_AUX_PCM_TX"
  30. #define LPASS_BE_VOICE_PLAYBACK_TX "VOICE_PLAYBACK_TX"
  31. #define LPASS_BE_VOICE2_PLAYBACK_TX "VOICE2_PLAYBACK_TX"
  32. #define LPASS_BE_INCALL_RECORD_RX "INCALL_RECORD_TX"
  33. #define LPASS_BE_INCALL_RECORD_TX "INCALL_RECORD_RX"
  34. #define LPASS_BE_SEC_I2S_RX "SECONDARY_I2S_RX"
  35. #define LPASS_BE_MI2S_RX "MI2S_RX"
  36. #define LPASS_BE_MI2S_TX "MI2S_TX"
  37. #define LPASS_BE_QUAT_MI2S_RX "QUAT_MI2S_RX"
  38. #define LPASS_BE_QUAT_MI2S_TX "QUAT_MI2S_TX"
  39. #define LPASS_BE_SEC_MI2S_RX "SEC_MI2S_RX"
  40. #define LPASS_BE_SEC_MI2S_TX "SEC_MI2S_TX"
  41. #define LPASS_BE_PRI_MI2S_RX "PRI_MI2S_RX"
  42. #define LPASS_BE_PRI_MI2S_TX "PRI_MI2S_TX"
  43. #if defined (CONFIG_SND_SOC_MAX98504) || defined (CONFIG_SND_SOC_MAX98505) \
  44. || defined (CONFIG_SND_SOC_MAX98506)
  45. #define LPASS_BE_TERT_MI2S_RX "TERT_MI2S_RX"
  46. #define LPASS_BE_TERT_MI2S_TX "TERT_MI2S_TX"
  47. #else
  48. #define LPASS_BE_TERT_MI2S_RX "TERTIARY_MI2S_RX"
  49. #define LPASS_BE_TERT_MI2S_TX "TERTIARY_MI2S_TX"
  50. #endif
  51. #define LPASS_BE_AUDIO_I2S_RX "AUDIO_I2S_RX"
  52. #define LPASS_BE_STUB_RX "STUB_RX"
  53. #define LPASS_BE_STUB_TX "STUB_TX"
  54. #define LPASS_BE_SLIMBUS_1_RX "SLIMBUS_1_RX"
  55. #define LPASS_BE_SLIMBUS_1_TX "SLIMBUS_1_TX"
  56. #define LPASS_BE_STUB_1_TX "STUB_1_TX"
  57. #define LPASS_BE_SLIMBUS_3_RX "SLIMBUS_3_RX"
  58. #define LPASS_BE_SLIMBUS_3_TX "SLIMBUS_3_TX"
  59. #define LPASS_BE_SLIMBUS_4_RX "SLIMBUS_4_RX"
  60. #define LPASS_BE_SLIMBUS_4_TX "SLIMBUS_4_TX"
  61. #define LPASS_BE_SLIMBUS_5_TX "SLIMBUS_5_TX"
  62. /* For multimedia front-ends, asm session is allocated dynamically.
  63. * Hence, asm session/multimedia front-end mapping has to be maintained.
  64. * Due to this reason, additional multimedia front-end must be placed before
  65. * non-multimedia front-ends.
  66. */
  67. enum {
  68. MSM_FRONTEND_DAI_MULTIMEDIA1 = 0,
  69. MSM_FRONTEND_DAI_MULTIMEDIA2,
  70. MSM_FRONTEND_DAI_MULTIMEDIA3,
  71. MSM_FRONTEND_DAI_MULTIMEDIA4,
  72. MSM_FRONTEND_DAI_MULTIMEDIA5,
  73. MSM_FRONTEND_DAI_MULTIMEDIA6,
  74. MSM_FRONTEND_DAI_MULTIMEDIA7,
  75. MSM_FRONTEND_DAI_MULTIMEDIA8,
  76. MSM_FRONTEND_DAI_MULTIMEDIA9,
  77. #ifdef CONFIG_JACK_AUDIO
  78. MSM_FRONTEND_DAI_MULTIMEDIA10,
  79. #endif
  80. MSM_FRONTEND_DAI_CS_VOICE,
  81. MSM_FRONTEND_DAI_VOIP,
  82. MSM_FRONTEND_DAI_AFE_RX,
  83. MSM_FRONTEND_DAI_AFE_TX,
  84. MSM_FRONTEND_DAI_VOICE_STUB,
  85. MSM_FRONTEND_DAI_VOLTE,
  86. MSM_FRONTEND_DAI_DTMF_RX,
  87. MSM_FRONTEND_DAI_VOICE2,
  88. MSM_FRONTEND_DAI_QCHAT,
  89. MSM_FRONTEND_DAI_LSM1,
  90. MSM_FRONTEND_DAI_LSM2,
  91. MSM_FRONTEND_DAI_LSM3,
  92. MSM_FRONTEND_DAI_LSM4,
  93. MSM_FRONTEND_DAI_LSM5,
  94. MSM_FRONTEND_DAI_LSM6,
  95. MSM_FRONTEND_DAI_LSM7,
  96. MSM_FRONTEND_DAI_LSM8,
  97. MSM_FRONTEND_DAI_VOWLAN,
  98. MSM_FRONTEND_DAI_MAX,
  99. };
  100. #ifdef CONFIG_JACK_AUDIO
  101. #define MSM_FRONTEND_DAI_MM_SIZE (MSM_FRONTEND_DAI_MULTIMEDIA10+ 1)
  102. #define MSM_FRONTEND_DAI_MM_MAX_ID MSM_FRONTEND_DAI_MULTIMEDIA10
  103. #else
  104. #define MSM_FRONTEND_DAI_MM_SIZE (MSM_FRONTEND_DAI_MULTIMEDIA9+ 1)
  105. #define MSM_FRONTEND_DAI_MM_MAX_ID MSM_FRONTEND_DAI_MULTIMEDIA9
  106. #endif
  107. enum {
  108. MSM_BACKEND_DAI_PRI_I2S_RX = 0,
  109. MSM_BACKEND_DAI_PRI_I2S_TX,
  110. MSM_BACKEND_DAI_SLIMBUS_0_RX,
  111. MSM_BACKEND_DAI_SLIMBUS_0_TX,
  112. MSM_BACKEND_DAI_HDMI_RX,
  113. MSM_BACKEND_DAI_INT_BT_SCO_RX,
  114. MSM_BACKEND_DAI_INT_BT_SCO_TX,
  115. MSM_BACKEND_DAI_INT_FM_RX,
  116. MSM_BACKEND_DAI_INT_FM_TX,
  117. MSM_BACKEND_DAI_AFE_PCM_RX,
  118. MSM_BACKEND_DAI_AFE_PCM_TX,
  119. MSM_BACKEND_DAI_AUXPCM_RX,
  120. MSM_BACKEND_DAI_AUXPCM_TX,
  121. MSM_BACKEND_DAI_VOICE_PLAYBACK_TX,
  122. MSM_BACKEND_DAI_VOICE2_PLAYBACK_TX,
  123. MSM_BACKEND_DAI_INCALL_RECORD_RX,
  124. MSM_BACKEND_DAI_INCALL_RECORD_TX,
  125. MSM_BACKEND_DAI_MI2S_RX,
  126. MSM_BACKEND_DAI_MI2S_TX,
  127. MSM_BACKEND_DAI_SEC_I2S_RX,
  128. MSM_BACKEND_DAI_SLIMBUS_1_RX,
  129. MSM_BACKEND_DAI_SLIMBUS_1_TX,
  130. MSM_BACKEND_DAI_SLIMBUS_4_RX,
  131. MSM_BACKEND_DAI_SLIMBUS_4_TX,
  132. MSM_BACKEND_DAI_SLIMBUS_3_RX,
  133. MSM_BACKEND_DAI_SLIMBUS_3_TX,
  134. MSM_BACKEND_DAI_SLIMBUS_5_TX,
  135. MSM_BACKEND_DAI_EXTPROC_RX,
  136. MSM_BACKEND_DAI_EXTPROC_TX,
  137. MSM_BACKEND_DAI_EXTPROC_EC_TX,
  138. MSM_BACKEND_DAI_QUATERNARY_MI2S_RX,
  139. MSM_BACKEND_DAI_QUATERNARY_MI2S_TX,
  140. MSM_BACKEND_DAI_SECONDARY_MI2S_RX,
  141. MSM_BACKEND_DAI_SECONDARY_MI2S_TX,
  142. MSM_BACKEND_DAI_PRI_MI2S_RX,
  143. MSM_BACKEND_DAI_PRI_MI2S_TX,
  144. MSM_BACKEND_DAI_TERTIARY_MI2S_RX,
  145. MSM_BACKEND_DAI_TERTIARY_MI2S_TX,
  146. MSM_BACKEND_DAI_AUDIO_I2S_RX,
  147. MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  148. MSM_BACKEND_DAI_SEC_AUXPCM_TX,
  149. MSM_BACKEND_DAI_MAX,
  150. };
  151. enum msm_pcm_routing_event {
  152. MSM_PCM_RT_EVT_BUF_RECFG,
  153. MSM_PCM_RT_EVT_DEVSWITCH,
  154. MSM_PCM_RT_EVT_MAX,
  155. };
  156. /* dai_id: front-end ID,
  157. * dspst_id: DSP audio stream ID
  158. * stream_type: playback or capture
  159. */
  160. void msm_pcm_routing_reg_phy_stream(int fedai_id, int perf_mode, int dspst_id,
  161. int stream_type);
  162. void msm_pcm_routing_reg_psthr_stream(int fedai_id, int dspst_id,
  163. int stream_type);
  164. struct msm_pcm_routing_evt {
  165. void (*event_func)(enum msm_pcm_routing_event, void *);
  166. void *priv_data;
  167. };
  168. void msm_pcm_routing_reg_phy_stream_v2(int fedai_id, bool perf_mode,
  169. int dspst_id, int stream_type,
  170. struct msm_pcm_routing_evt event_info);
  171. void msm_pcm_routing_dereg_phy_stream(int fedai_id, int stream_type);
  172. int msm_routing_check_backend_enabled(int fedai_id);
  173. int multi_ch_pcm_set_volume(unsigned volume);
  174. uint32_t get_adm_rx_topology(void);
  175. uint32_t get_adm_tx_topology(void);
  176. #endif /*_MSM_PCM_H*/