msm-pcm-routing-v2.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  1. /* Copyright (c) 2012-2017, 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 <dsp/apr_audio-v2.h>
  15. /*
  16. * These names are used by HAL to specify the BE. If any changes are
  17. * made to the string names or the max name length corresponding
  18. * changes need to be made in the HAL to ensure they still match.
  19. */
  20. #define LPASS_BE_NAME_MAX_LENGTH 24
  21. #define LPASS_BE_PRI_I2S_RX "PRIMARY_I2S_RX"
  22. #define LPASS_BE_PRI_I2S_TX "PRIMARY_I2S_TX"
  23. #define LPASS_BE_SLIMBUS_0_RX "SLIMBUS_0_RX"
  24. #define LPASS_BE_SLIMBUS_0_TX "SLIMBUS_0_TX"
  25. #define LPASS_BE_HDMI "HDMI"
  26. #define LPASS_BE_DISPLAY_PORT "DISPLAY_PORT"
  27. #define LPASS_BE_INT_BT_SCO_RX "INT_BT_SCO_RX"
  28. #define LPASS_BE_INT_BT_SCO_TX "INT_BT_SCO_TX"
  29. #define LPASS_BE_INT_BT_A2DP_RX "INT_BT_A2DP_RX"
  30. #define LPASS_BE_INT_FM_RX "INT_FM_RX"
  31. #define LPASS_BE_INT_FM_TX "INT_FM_TX"
  32. #define LPASS_BE_AFE_PCM_RX "RT_PROXY_DAI_001_RX"
  33. #define LPASS_BE_AFE_PCM_TX "RT_PROXY_DAI_002_TX"
  34. #define LPASS_BE_AUXPCM_RX "AUX_PCM_RX"
  35. #define LPASS_BE_AUXPCM_TX "AUX_PCM_TX"
  36. #define LPASS_BE_SEC_AUXPCM_RX "SEC_AUX_PCM_RX"
  37. #define LPASS_BE_SEC_AUXPCM_TX "SEC_AUX_PCM_TX"
  38. #define LPASS_BE_TERT_AUXPCM_RX "TERT_AUX_PCM_RX"
  39. #define LPASS_BE_TERT_AUXPCM_TX "TERT_AUX_PCM_TX"
  40. #define LPASS_BE_QUAT_AUXPCM_RX "QUAT_AUX_PCM_RX"
  41. #define LPASS_BE_QUAT_AUXPCM_TX "QUAT_AUX_PCM_TX"
  42. #define LPASS_BE_QUIN_AUXPCM_RX "QUIN_AUX_PCM_RX"
  43. #define LPASS_BE_QUIN_AUXPCM_TX "QUIN_AUX_PCM_TX"
  44. #define LPASS_BE_VOICE_PLAYBACK_TX "VOICE_PLAYBACK_TX"
  45. #define LPASS_BE_VOICE2_PLAYBACK_TX "VOICE2_PLAYBACK_TX"
  46. #define LPASS_BE_INCALL_RECORD_RX "INCALL_RECORD_RX"
  47. #define LPASS_BE_INCALL_RECORD_TX "INCALL_RECORD_TX"
  48. #define LPASS_BE_SEC_I2S_RX "SECONDARY_I2S_RX"
  49. #define LPASS_BE_SPDIF_RX "SPDIF_RX"
  50. #define LPASS_BE_MI2S_RX "MI2S_RX"
  51. #define LPASS_BE_MI2S_TX "MI2S_TX"
  52. #define LPASS_BE_QUAT_MI2S_RX "QUAT_MI2S_RX"
  53. #define LPASS_BE_QUAT_MI2S_TX "QUAT_MI2S_TX"
  54. #define LPASS_BE_SEC_MI2S_RX "SEC_MI2S_RX"
  55. #define LPASS_BE_SEC_MI2S_RX_SD1 "SEC_MI2S_RX_SD1"
  56. #define LPASS_BE_SEC_MI2S_TX "SEC_MI2S_TX"
  57. #define LPASS_BE_PRI_MI2S_RX "PRI_MI2S_RX"
  58. #define LPASS_BE_PRI_MI2S_TX "PRI_MI2S_TX"
  59. #define LPASS_BE_TERT_MI2S_RX "TERT_MI2S_RX"
  60. #define LPASS_BE_TERT_MI2S_TX "TERT_MI2S_TX"
  61. #define LPASS_BE_AUDIO_I2S_RX "AUDIO_I2S_RX"
  62. #define LPASS_BE_STUB_RX "STUB_RX"
  63. #define LPASS_BE_STUB_TX "STUB_TX"
  64. #define LPASS_BE_SLIMBUS_1_RX "SLIMBUS_1_RX"
  65. #define LPASS_BE_SLIMBUS_1_TX "SLIMBUS_1_TX"
  66. #define LPASS_BE_STUB_1_TX "STUB_1_TX"
  67. #define LPASS_BE_SLIMBUS_2_RX "SLIMBUS_2_RX"
  68. #define LPASS_BE_SLIMBUS_2_TX "SLIMBUS_2_TX"
  69. #define LPASS_BE_SLIMBUS_3_RX "SLIMBUS_3_RX"
  70. #define LPASS_BE_SLIMBUS_3_TX "SLIMBUS_3_TX"
  71. #define LPASS_BE_SLIMBUS_4_RX "SLIMBUS_4_RX"
  72. #define LPASS_BE_SLIMBUS_4_TX "SLIMBUS_4_TX"
  73. #define LPASS_BE_SLIMBUS_TX_VI "SLIMBUS_TX_VI"
  74. #define LPASS_BE_SLIMBUS_5_RX "SLIMBUS_5_RX"
  75. #define LPASS_BE_SLIMBUS_5_TX "SLIMBUS_5_TX"
  76. #define LPASS_BE_SLIMBUS_6_RX "SLIMBUS_6_RX"
  77. #define LPASS_BE_SLIMBUS_6_TX "SLIMBUS_6_TX"
  78. #define LPASS_BE_QUIN_MI2S_RX "QUIN_MI2S_RX"
  79. #define LPASS_BE_QUIN_MI2S_TX "QUIN_MI2S_TX"
  80. #define LPASS_BE_SENARY_MI2S_TX "SENARY_MI2S_TX"
  81. #define LPASS_BE_PRI_TDM_RX_0 "PRI_TDM_RX_0"
  82. #define LPASS_BE_PRI_TDM_TX_0 "PRI_TDM_TX_0"
  83. #define LPASS_BE_PRI_TDM_RX_1 "PRI_TDM_RX_1"
  84. #define LPASS_BE_PRI_TDM_TX_1 "PRI_TDM_TX_1"
  85. #define LPASS_BE_PRI_TDM_RX_2 "PRI_TDM_RX_2"
  86. #define LPASS_BE_PRI_TDM_TX_2 "PRI_TDM_TX_2"
  87. #define LPASS_BE_PRI_TDM_RX_3 "PRI_TDM_RX_3"
  88. #define LPASS_BE_PRI_TDM_TX_3 "PRI_TDM_TX_3"
  89. #define LPASS_BE_PRI_TDM_RX_4 "PRI_TDM_RX_4"
  90. #define LPASS_BE_PRI_TDM_TX_4 "PRI_TDM_TX_4"
  91. #define LPASS_BE_PRI_TDM_RX_5 "PRI_TDM_RX_5"
  92. #define LPASS_BE_PRI_TDM_TX_5 "PRI_TDM_TX_5"
  93. #define LPASS_BE_PRI_TDM_RX_6 "PRI_TDM_RX_6"
  94. #define LPASS_BE_PRI_TDM_TX_6 "PRI_TDM_TX_6"
  95. #define LPASS_BE_PRI_TDM_RX_7 "PRI_TDM_RX_7"
  96. #define LPASS_BE_PRI_TDM_TX_7 "PRI_TDM_TX_7"
  97. #define LPASS_BE_SEC_TDM_RX_0 "SEC_TDM_RX_0"
  98. #define LPASS_BE_SEC_TDM_TX_0 "SEC_TDM_TX_0"
  99. #define LPASS_BE_SEC_TDM_RX_1 "SEC_TDM_RX_1"
  100. #define LPASS_BE_SEC_TDM_TX_1 "SEC_TDM_TX_1"
  101. #define LPASS_BE_SEC_TDM_RX_2 "SEC_TDM_RX_2"
  102. #define LPASS_BE_SEC_TDM_TX_2 "SEC_TDM_TX_2"
  103. #define LPASS_BE_SEC_TDM_RX_3 "SEC_TDM_RX_3"
  104. #define LPASS_BE_SEC_TDM_TX_3 "SEC_TDM_TX_3"
  105. #define LPASS_BE_SEC_TDM_RX_4 "SEC_TDM_RX_4"
  106. #define LPASS_BE_SEC_TDM_TX_4 "SEC_TDM_TX_4"
  107. #define LPASS_BE_SEC_TDM_RX_5 "SEC_TDM_RX_5"
  108. #define LPASS_BE_SEC_TDM_TX_5 "SEC_TDM_TX_5"
  109. #define LPASS_BE_SEC_TDM_RX_6 "SEC_TDM_RX_6"
  110. #define LPASS_BE_SEC_TDM_TX_6 "SEC_TDM_TX_6"
  111. #define LPASS_BE_SEC_TDM_RX_7 "SEC_TDM_RX_7"
  112. #define LPASS_BE_SEC_TDM_TX_7 "SEC_TDM_TX_7"
  113. #define LPASS_BE_TERT_TDM_RX_0 "TERT_TDM_RX_0"
  114. #define LPASS_BE_TERT_TDM_TX_0 "TERT_TDM_TX_0"
  115. #define LPASS_BE_TERT_TDM_RX_1 "TERT_TDM_RX_1"
  116. #define LPASS_BE_TERT_TDM_TX_1 "TERT_TDM_TX_1"
  117. #define LPASS_BE_TERT_TDM_RX_2 "TERT_TDM_RX_2"
  118. #define LPASS_BE_TERT_TDM_TX_2 "TERT_TDM_TX_2"
  119. #define LPASS_BE_TERT_TDM_RX_3 "TERT_TDM_RX_3"
  120. #define LPASS_BE_TERT_TDM_TX_3 "TERT_TDM_TX_3"
  121. #define LPASS_BE_TERT_TDM_RX_4 "TERT_TDM_RX_4"
  122. #define LPASS_BE_TERT_TDM_TX_4 "TERT_TDM_TX_4"
  123. #define LPASS_BE_TERT_TDM_RX_5 "TERT_TDM_RX_5"
  124. #define LPASS_BE_TERT_TDM_TX_5 "TERT_TDM_TX_5"
  125. #define LPASS_BE_TERT_TDM_RX_6 "TERT_TDM_RX_6"
  126. #define LPASS_BE_TERT_TDM_TX_6 "TERT_TDM_TX_6"
  127. #define LPASS_BE_TERT_TDM_RX_7 "TERT_TDM_RX_7"
  128. #define LPASS_BE_TERT_TDM_TX_7 "TERT_TDM_TX_7"
  129. #define LPASS_BE_QUAT_TDM_RX_0 "QUAT_TDM_RX_0"
  130. #define LPASS_BE_QUAT_TDM_TX_0 "QUAT_TDM_TX_0"
  131. #define LPASS_BE_QUAT_TDM_RX_1 "QUAT_TDM_RX_1"
  132. #define LPASS_BE_QUAT_TDM_TX_1 "QUAT_TDM_TX_1"
  133. #define LPASS_BE_QUAT_TDM_RX_2 "QUAT_TDM_RX_2"
  134. #define LPASS_BE_QUAT_TDM_TX_2 "QUAT_TDM_TX_2"
  135. #define LPASS_BE_QUAT_TDM_RX_3 "QUAT_TDM_RX_3"
  136. #define LPASS_BE_QUAT_TDM_TX_3 "QUAT_TDM_TX_3"
  137. #define LPASS_BE_QUAT_TDM_RX_4 "QUAT_TDM_RX_4"
  138. #define LPASS_BE_QUAT_TDM_TX_4 "QUAT_TDM_TX_4"
  139. #define LPASS_BE_QUAT_TDM_RX_5 "QUAT_TDM_RX_5"
  140. #define LPASS_BE_QUAT_TDM_TX_5 "QUAT_TDM_TX_5"
  141. #define LPASS_BE_QUAT_TDM_RX_6 "QUAT_TDM_RX_6"
  142. #define LPASS_BE_QUAT_TDM_TX_6 "QUAT_TDM_TX_6"
  143. #define LPASS_BE_QUAT_TDM_RX_7 "QUAT_TDM_RX_7"
  144. #define LPASS_BE_QUAT_TDM_TX_7 "QUAT_TDM_TX_7"
  145. #define LPASS_BE_QUIN_TDM_RX_0 "QUIN_TDM_RX_0"
  146. #define LPASS_BE_QUIN_TDM_TX_0 "QUIN_TDM_TX_0"
  147. #define LPASS_BE_QUIN_TDM_RX_1 "QUIN_TDM_RX_1"
  148. #define LPASS_BE_QUIN_TDM_TX_1 "QUIN_TDM_TX_1"
  149. #define LPASS_BE_QUIN_TDM_RX_2 "QUIN_TDM_RX_2"
  150. #define LPASS_BE_QUIN_TDM_TX_2 "QUIN_TDM_TX_2"
  151. #define LPASS_BE_QUIN_TDM_RX_3 "QUIN_TDM_RX_3"
  152. #define LPASS_BE_QUIN_TDM_TX_3 "QUIN_TDM_TX_3"
  153. #define LPASS_BE_QUIN_TDM_RX_4 "QUIN_TDM_RX_4"
  154. #define LPASS_BE_QUIN_TDM_TX_4 "QUIN_TDM_TX_4"
  155. #define LPASS_BE_QUIN_TDM_RX_5 "QUIN_TDM_RX_5"
  156. #define LPASS_BE_QUIN_TDM_TX_5 "QUIN_TDM_TX_5"
  157. #define LPASS_BE_QUIN_TDM_RX_6 "QUIN_TDM_RX_6"
  158. #define LPASS_BE_QUIN_TDM_TX_6 "QUIN_TDM_TX_6"
  159. #define LPASS_BE_QUIN_TDM_RX_7 "QUIN_TDM_RX_7"
  160. #define LPASS_BE_QUIN_TDM_TX_7 "QUIN_TDM_TX_7"
  161. #define LPASS_BE_SLIMBUS_7_RX "SLIMBUS_7_RX"
  162. #define LPASS_BE_SLIMBUS_7_TX "SLIMBUS_7_TX"
  163. #define LPASS_BE_SLIMBUS_8_RX "SLIMBUS_8_RX"
  164. #define LPASS_BE_SLIMBUS_8_TX "SLIMBUS_8_TX"
  165. #define LPASS_BE_USB_AUDIO_RX "USB_AUDIO_RX"
  166. #define LPASS_BE_USB_AUDIO_TX "USB_AUDIO_TX"
  167. #define LPASS_BE_INT0_MI2S_RX "INT0_MI2S_RX"
  168. #define LPASS_BE_INT0_MI2S_TX "INT0_MI2S_TX"
  169. #define LPASS_BE_INT1_MI2S_RX "INT1_MI2S_RX"
  170. #define LPASS_BE_INT1_MI2S_TX "INT1_MI2S_TX"
  171. #define LPASS_BE_INT2_MI2S_RX "INT2_MI2S_RX"
  172. #define LPASS_BE_INT2_MI2S_TX "INT2_MI2S_TX"
  173. #define LPASS_BE_INT3_MI2S_RX "INT3_MI2S_RX"
  174. #define LPASS_BE_INT3_MI2S_TX "INT3_MI2S_TX"
  175. #define LPASS_BE_INT4_MI2S_RX "INT4_MI2S_RX"
  176. #define LPASS_BE_INT4_MI2S_TX "INT4_MI2S_TX"
  177. #define LPASS_BE_INT5_MI2S_RX "INT5_MI2S_RX"
  178. #define LPASS_BE_INT5_MI2S_TX "INT5_MI2S_TX"
  179. #define LPASS_BE_INT6_MI2S_RX "INT6_MI2S_RX"
  180. #define LPASS_BE_INT6_MI2S_TX "INT6_MI2S_TX"
  181. /* For multimedia front-ends, asm session is allocated dynamically.
  182. * Hence, asm session/multimedia front-end mapping has to be maintained.
  183. * Due to this reason, additional multimedia front-end must be placed before
  184. * non-multimedia front-ends.
  185. */
  186. enum {
  187. MSM_FRONTEND_DAI_MULTIMEDIA1 = 0,
  188. MSM_FRONTEND_DAI_MULTIMEDIA2,
  189. MSM_FRONTEND_DAI_MULTIMEDIA3,
  190. MSM_FRONTEND_DAI_MULTIMEDIA4,
  191. MSM_FRONTEND_DAI_MULTIMEDIA5,
  192. MSM_FRONTEND_DAI_MULTIMEDIA6,
  193. MSM_FRONTEND_DAI_MULTIMEDIA7,
  194. MSM_FRONTEND_DAI_MULTIMEDIA8,
  195. MSM_FRONTEND_DAI_MULTIMEDIA9,
  196. MSM_FRONTEND_DAI_MULTIMEDIA10,
  197. MSM_FRONTEND_DAI_MULTIMEDIA11,
  198. MSM_FRONTEND_DAI_MULTIMEDIA12,
  199. MSM_FRONTEND_DAI_MULTIMEDIA13,
  200. MSM_FRONTEND_DAI_MULTIMEDIA14,
  201. MSM_FRONTEND_DAI_MULTIMEDIA15,
  202. MSM_FRONTEND_DAI_MULTIMEDIA16,
  203. MSM_FRONTEND_DAI_MULTIMEDIA17,
  204. MSM_FRONTEND_DAI_MULTIMEDIA18,
  205. MSM_FRONTEND_DAI_MULTIMEDIA19,
  206. MSM_FRONTEND_DAI_MULTIMEDIA20,
  207. MSM_FRONTEND_DAI_VOIP,
  208. MSM_FRONTEND_DAI_AFE_RX,
  209. MSM_FRONTEND_DAI_AFE_TX,
  210. MSM_FRONTEND_DAI_VOICE_STUB,
  211. MSM_FRONTEND_DAI_DTMF_RX,
  212. MSM_FRONTEND_DAI_QCHAT,
  213. MSM_FRONTEND_DAI_VOLTE_STUB,
  214. MSM_FRONTEND_DAI_LSM1,
  215. MSM_FRONTEND_DAI_LSM2,
  216. MSM_FRONTEND_DAI_LSM3,
  217. MSM_FRONTEND_DAI_LSM4,
  218. MSM_FRONTEND_DAI_LSM5,
  219. MSM_FRONTEND_DAI_LSM6,
  220. MSM_FRONTEND_DAI_LSM7,
  221. MSM_FRONTEND_DAI_LSM8,
  222. MSM_FRONTEND_DAI_VOICE2_STUB,
  223. MSM_FRONTEND_DAI_VOICEMMODE1,
  224. MSM_FRONTEND_DAI_VOICEMMODE2,
  225. MSM_FRONTEND_DAI_MAX,
  226. };
  227. #define MSM_FRONTEND_DAI_MM_SIZE (MSM_FRONTEND_DAI_MULTIMEDIA20 + 1)
  228. #define MSM_FRONTEND_DAI_MM_MAX_ID MSM_FRONTEND_DAI_MULTIMEDIA20
  229. enum {
  230. MSM_BACKEND_DAI_PRI_I2S_RX = 0,
  231. MSM_BACKEND_DAI_PRI_I2S_TX,
  232. MSM_BACKEND_DAI_SLIMBUS_0_RX,
  233. MSM_BACKEND_DAI_SLIMBUS_0_TX,
  234. MSM_BACKEND_DAI_HDMI_RX,
  235. MSM_BACKEND_DAI_INT_BT_SCO_RX,
  236. MSM_BACKEND_DAI_INT_BT_SCO_TX,
  237. MSM_BACKEND_DAI_INT_FM_RX,
  238. MSM_BACKEND_DAI_INT_FM_TX,
  239. MSM_BACKEND_DAI_AFE_PCM_RX,
  240. MSM_BACKEND_DAI_AFE_PCM_TX,
  241. MSM_BACKEND_DAI_AUXPCM_RX,
  242. MSM_BACKEND_DAI_AUXPCM_TX,
  243. MSM_BACKEND_DAI_VOICE_PLAYBACK_TX,
  244. MSM_BACKEND_DAI_VOICE2_PLAYBACK_TX,
  245. MSM_BACKEND_DAI_INCALL_RECORD_RX,
  246. MSM_BACKEND_DAI_INCALL_RECORD_TX,
  247. MSM_BACKEND_DAI_MI2S_RX,
  248. MSM_BACKEND_DAI_MI2S_TX,
  249. MSM_BACKEND_DAI_SEC_I2S_RX,
  250. MSM_BACKEND_DAI_SLIMBUS_1_RX,
  251. MSM_BACKEND_DAI_SLIMBUS_1_TX,
  252. MSM_BACKEND_DAI_SLIMBUS_2_RX,
  253. MSM_BACKEND_DAI_SLIMBUS_2_TX,
  254. MSM_BACKEND_DAI_SLIMBUS_3_RX,
  255. MSM_BACKEND_DAI_SLIMBUS_3_TX,
  256. MSM_BACKEND_DAI_SLIMBUS_4_RX,
  257. MSM_BACKEND_DAI_SLIMBUS_4_TX,
  258. MSM_BACKEND_DAI_SLIMBUS_5_RX,
  259. MSM_BACKEND_DAI_SLIMBUS_5_TX,
  260. MSM_BACKEND_DAI_SLIMBUS_6_RX,
  261. MSM_BACKEND_DAI_SLIMBUS_6_TX,
  262. MSM_BACKEND_DAI_SLIMBUS_7_RX,
  263. MSM_BACKEND_DAI_SLIMBUS_7_TX,
  264. MSM_BACKEND_DAI_SLIMBUS_8_RX,
  265. MSM_BACKEND_DAI_SLIMBUS_8_TX,
  266. MSM_BACKEND_DAI_EXTPROC_RX,
  267. MSM_BACKEND_DAI_EXTPROC_TX,
  268. MSM_BACKEND_DAI_EXTPROC_EC_TX,
  269. MSM_BACKEND_DAI_QUATERNARY_MI2S_RX,
  270. MSM_BACKEND_DAI_QUATERNARY_MI2S_TX,
  271. MSM_BACKEND_DAI_SECONDARY_MI2S_RX,
  272. MSM_BACKEND_DAI_SECONDARY_MI2S_TX,
  273. MSM_BACKEND_DAI_PRI_MI2S_RX,
  274. MSM_BACKEND_DAI_PRI_MI2S_TX,
  275. MSM_BACKEND_DAI_TERTIARY_MI2S_RX,
  276. MSM_BACKEND_DAI_TERTIARY_MI2S_TX,
  277. MSM_BACKEND_DAI_AUDIO_I2S_RX,
  278. MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  279. MSM_BACKEND_DAI_SEC_AUXPCM_TX,
  280. MSM_BACKEND_DAI_SPDIF_RX,
  281. MSM_BACKEND_DAI_SECONDARY_MI2S_RX_SD1,
  282. MSM_BACKEND_DAI_QUINARY_MI2S_RX,
  283. MSM_BACKEND_DAI_QUINARY_MI2S_TX,
  284. MSM_BACKEND_DAI_SENARY_MI2S_TX,
  285. MSM_BACKEND_DAI_PRI_TDM_RX_0,
  286. MSM_BACKEND_DAI_PRI_TDM_TX_0,
  287. MSM_BACKEND_DAI_PRI_TDM_RX_1,
  288. MSM_BACKEND_DAI_PRI_TDM_TX_1,
  289. MSM_BACKEND_DAI_PRI_TDM_RX_2,
  290. MSM_BACKEND_DAI_PRI_TDM_TX_2,
  291. MSM_BACKEND_DAI_PRI_TDM_RX_3,
  292. MSM_BACKEND_DAI_PRI_TDM_TX_3,
  293. MSM_BACKEND_DAI_PRI_TDM_RX_4,
  294. MSM_BACKEND_DAI_PRI_TDM_TX_4,
  295. MSM_BACKEND_DAI_PRI_TDM_RX_5,
  296. MSM_BACKEND_DAI_PRI_TDM_TX_5,
  297. MSM_BACKEND_DAI_PRI_TDM_RX_6,
  298. MSM_BACKEND_DAI_PRI_TDM_TX_6,
  299. MSM_BACKEND_DAI_PRI_TDM_RX_7,
  300. MSM_BACKEND_DAI_PRI_TDM_TX_7,
  301. MSM_BACKEND_DAI_SEC_TDM_RX_0,
  302. MSM_BACKEND_DAI_SEC_TDM_TX_0,
  303. MSM_BACKEND_DAI_SEC_TDM_RX_1,
  304. MSM_BACKEND_DAI_SEC_TDM_TX_1,
  305. MSM_BACKEND_DAI_SEC_TDM_RX_2,
  306. MSM_BACKEND_DAI_SEC_TDM_TX_2,
  307. MSM_BACKEND_DAI_SEC_TDM_RX_3,
  308. MSM_BACKEND_DAI_SEC_TDM_TX_3,
  309. MSM_BACKEND_DAI_SEC_TDM_RX_4,
  310. MSM_BACKEND_DAI_SEC_TDM_TX_4,
  311. MSM_BACKEND_DAI_SEC_TDM_RX_5,
  312. MSM_BACKEND_DAI_SEC_TDM_TX_5,
  313. MSM_BACKEND_DAI_SEC_TDM_RX_6,
  314. MSM_BACKEND_DAI_SEC_TDM_TX_6,
  315. MSM_BACKEND_DAI_SEC_TDM_RX_7,
  316. MSM_BACKEND_DAI_SEC_TDM_TX_7,
  317. MSM_BACKEND_DAI_TERT_TDM_RX_0,
  318. MSM_BACKEND_DAI_TERT_TDM_TX_0,
  319. MSM_BACKEND_DAI_TERT_TDM_RX_1,
  320. MSM_BACKEND_DAI_TERT_TDM_TX_1,
  321. MSM_BACKEND_DAI_TERT_TDM_RX_2,
  322. MSM_BACKEND_DAI_TERT_TDM_TX_2,
  323. MSM_BACKEND_DAI_TERT_TDM_RX_3,
  324. MSM_BACKEND_DAI_TERT_TDM_TX_3,
  325. MSM_BACKEND_DAI_TERT_TDM_RX_4,
  326. MSM_BACKEND_DAI_TERT_TDM_TX_4,
  327. MSM_BACKEND_DAI_TERT_TDM_RX_5,
  328. MSM_BACKEND_DAI_TERT_TDM_TX_5,
  329. MSM_BACKEND_DAI_TERT_TDM_RX_6,
  330. MSM_BACKEND_DAI_TERT_TDM_TX_6,
  331. MSM_BACKEND_DAI_TERT_TDM_RX_7,
  332. MSM_BACKEND_DAI_TERT_TDM_TX_7,
  333. MSM_BACKEND_DAI_QUAT_TDM_RX_0,
  334. MSM_BACKEND_DAI_QUAT_TDM_TX_0,
  335. MSM_BACKEND_DAI_QUAT_TDM_RX_1,
  336. MSM_BACKEND_DAI_QUAT_TDM_TX_1,
  337. MSM_BACKEND_DAI_QUAT_TDM_RX_2,
  338. MSM_BACKEND_DAI_QUAT_TDM_TX_2,
  339. MSM_BACKEND_DAI_QUAT_TDM_RX_3,
  340. MSM_BACKEND_DAI_QUAT_TDM_TX_3,
  341. MSM_BACKEND_DAI_QUAT_TDM_RX_4,
  342. MSM_BACKEND_DAI_QUAT_TDM_TX_4,
  343. MSM_BACKEND_DAI_QUAT_TDM_RX_5,
  344. MSM_BACKEND_DAI_QUAT_TDM_TX_5,
  345. MSM_BACKEND_DAI_QUAT_TDM_RX_6,
  346. MSM_BACKEND_DAI_QUAT_TDM_TX_6,
  347. MSM_BACKEND_DAI_QUAT_TDM_RX_7,
  348. MSM_BACKEND_DAI_QUAT_TDM_TX_7,
  349. MSM_BACKEND_DAI_QUIN_TDM_RX_0,
  350. MSM_BACKEND_DAI_QUIN_TDM_TX_0,
  351. MSM_BACKEND_DAI_QUIN_TDM_RX_1,
  352. MSM_BACKEND_DAI_QUIN_TDM_TX_1,
  353. MSM_BACKEND_DAI_QUIN_TDM_RX_2,
  354. MSM_BACKEND_DAI_QUIN_TDM_TX_2,
  355. MSM_BACKEND_DAI_QUIN_TDM_RX_3,
  356. MSM_BACKEND_DAI_QUIN_TDM_TX_3,
  357. MSM_BACKEND_DAI_QUIN_TDM_RX_4,
  358. MSM_BACKEND_DAI_QUIN_TDM_TX_4,
  359. MSM_BACKEND_DAI_QUIN_TDM_RX_5,
  360. MSM_BACKEND_DAI_QUIN_TDM_TX_5,
  361. MSM_BACKEND_DAI_QUIN_TDM_RX_6,
  362. MSM_BACKEND_DAI_QUIN_TDM_TX_6,
  363. MSM_BACKEND_DAI_QUIN_TDM_RX_7,
  364. MSM_BACKEND_DAI_QUIN_TDM_TX_7,
  365. MSM_BACKEND_DAI_INT_BT_A2DP_RX,
  366. MSM_BACKEND_DAI_USB_RX,
  367. MSM_BACKEND_DAI_USB_TX,
  368. MSM_BACKEND_DAI_DISPLAY_PORT_RX,
  369. MSM_BACKEND_DAI_TERT_AUXPCM_RX,
  370. MSM_BACKEND_DAI_TERT_AUXPCM_TX,
  371. MSM_BACKEND_DAI_QUAT_AUXPCM_RX,
  372. MSM_BACKEND_DAI_QUAT_AUXPCM_TX,
  373. MSM_BACKEND_DAI_QUIN_AUXPCM_RX,
  374. MSM_BACKEND_DAI_QUIN_AUXPCM_TX,
  375. MSM_BACKEND_DAI_INT0_MI2S_RX,
  376. MSM_BACKEND_DAI_INT0_MI2S_TX,
  377. MSM_BACKEND_DAI_INT1_MI2S_RX,
  378. MSM_BACKEND_DAI_INT1_MI2S_TX,
  379. MSM_BACKEND_DAI_INT2_MI2S_RX,
  380. MSM_BACKEND_DAI_INT2_MI2S_TX,
  381. MSM_BACKEND_DAI_INT3_MI2S_RX,
  382. MSM_BACKEND_DAI_INT3_MI2S_TX,
  383. MSM_BACKEND_DAI_INT4_MI2S_RX,
  384. MSM_BACKEND_DAI_INT4_MI2S_TX,
  385. MSM_BACKEND_DAI_INT5_MI2S_RX,
  386. MSM_BACKEND_DAI_INT5_MI2S_TX,
  387. MSM_BACKEND_DAI_INT6_MI2S_RX,
  388. MSM_BACKEND_DAI_INT6_MI2S_TX,
  389. MSM_BACKEND_DAI_MAX,
  390. };
  391. enum msm_pcm_routing_event {
  392. MSM_PCM_RT_EVT_BUF_RECFG,
  393. MSM_PCM_RT_EVT_DEVSWITCH,
  394. MSM_PCM_RT_EVT_MAX,
  395. };
  396. enum {
  397. EXT_EC_REF_NONE = 0,
  398. EXT_EC_REF_PRI_MI2S_TX,
  399. EXT_EC_REF_SEC_MI2S_TX,
  400. EXT_EC_REF_TERT_MI2S_TX,
  401. EXT_EC_REF_QUAT_MI2S_TX,
  402. EXT_EC_REF_QUIN_MI2S_TX,
  403. EXT_EC_REF_SLIM_1_TX,
  404. };
  405. #define INVALID_SESSION -1
  406. #define SESSION_TYPE_RX 0
  407. #define SESSION_TYPE_TX 1
  408. #define MAX_SESSION_TYPES 2
  409. #define INT_RX_VOL_MAX_STEPS 0x2000
  410. #define INT_RX_VOL_GAIN 0x2000
  411. #define RELEASE_LOCK 0
  412. #define ACQUIRE_LOCK 1
  413. #define MSM_BACKEND_DAI_PP_PARAMS_REQ_MAX 2
  414. #define HDMI_RX_ID 0x8001
  415. #define ADM_PP_PARAM_MUTE_ID 0
  416. #define ADM_PP_PARAM_MUTE_BIT 1
  417. #define ADM_PP_PARAM_LATENCY_ID 1
  418. #define ADM_PP_PARAM_LATENCY_BIT 2
  419. #define BE_DAI_PORT_SESSIONS_IDX_MAX 4
  420. #define BE_DAI_FE_SESSIONS_IDX_MAX 2
  421. struct msm_pcm_routing_evt {
  422. void (*event_func)(enum msm_pcm_routing_event, void *);
  423. void *priv_data;
  424. };
  425. struct msm_pcm_routing_bdai_data {
  426. u16 port_id; /* AFE port ID */
  427. u8 active; /* track if this backend is enabled */
  428. /* Front-end sessions */
  429. unsigned long fe_sessions[BE_DAI_FE_SESSIONS_IDX_MAX];
  430. /*
  431. * Track Tx BE ports -> Rx BE ports.
  432. * port_sessions[0] used to track BE 0 to BE 63.
  433. * port_sessions[1] used to track BE 64 to BE 127.
  434. * port_sessions[2] used to track BE 128 to BE 191.
  435. * port_sessions[3] used to track BE 192 to BE 255.
  436. */
  437. u64 port_sessions[BE_DAI_PORT_SESSIONS_IDX_MAX];
  438. unsigned int sample_rate;
  439. unsigned int channel;
  440. unsigned int format;
  441. unsigned int adm_override_ch;
  442. u32 passthr_mode[MSM_FRONTEND_DAI_MAX];
  443. char *name;
  444. };
  445. struct msm_pcm_routing_fdai_data {
  446. u16 be_srate; /* track prior backend sample rate for flushing purpose */
  447. int strm_id; /* ASM stream ID */
  448. int perf_mode;
  449. struct msm_pcm_routing_evt event_info;
  450. };
  451. #define MAX_APP_TYPES 16
  452. struct msm_pcm_routing_app_type_data {
  453. int app_type;
  454. u32 sample_rate;
  455. int bit_width;
  456. };
  457. struct msm_pcm_stream_app_type_cfg {
  458. int app_type;
  459. int acdb_dev_id;
  460. int sample_rate;
  461. };
  462. /* dai_id: front-end ID,
  463. * dspst_id: DSP audio stream ID
  464. * stream_type: playback or capture
  465. */
  466. int msm_pcm_routing_reg_phy_stream(int fedai_id, int perf_mode, int dspst_id,
  467. int stream_type);
  468. void msm_pcm_routing_reg_psthr_stream(int fedai_id, int dspst_id,
  469. int stream_type);
  470. int msm_pcm_routing_reg_phy_compr_stream(int fedai_id, int perf_mode,
  471. int dspst_id, int stream_type,
  472. uint32_t compr_passthr);
  473. int msm_pcm_routing_reg_phy_stream_v2(int fedai_id, int perf_mode,
  474. int dspst_id, int stream_type,
  475. struct msm_pcm_routing_evt event_info);
  476. void msm_pcm_routing_dereg_phy_stream(int fedai_id, int stream_type);
  477. int msm_routing_check_backend_enabled(int fedai_id);
  478. void msm_pcm_routing_get_bedai_info(int be_idx,
  479. struct msm_pcm_routing_bdai_data *bedai);
  480. void msm_pcm_routing_get_fedai_info(int fe_idx, int sess_type,
  481. struct msm_pcm_routing_fdai_data *fe_dai);
  482. void msm_pcm_routing_acquire_lock(void);
  483. void msm_pcm_routing_release_lock(void);
  484. int msm_pcm_routing_reg_stream_app_type_cfg(
  485. int fedai_id, int session_type, int be_id,
  486. struct msm_pcm_stream_app_type_cfg *cfg_data);
  487. int msm_pcm_routing_get_stream_app_type_cfg(
  488. int fedai_id, int session_type, int *be_id,
  489. struct msm_pcm_stream_app_type_cfg *cfg_data);
  490. #endif /*_MSM_PCM_H*/