q6audio-v2.c 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995
  1. /* Copyright (c) 2012-2018, 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. #include <linux/slab.h>
  13. #include <linux/wait.h>
  14. #include <linux/sched.h>
  15. #include <linux/jiffies.h>
  16. #include <linux/uaccess.h>
  17. #include <linux/atomic.h>
  18. #include <dsp/q6afe-v2.h>
  19. #include <dsp/q6audio-v2.h>
  20. int q6audio_get_port_index(u16 port_id)
  21. {
  22. switch (port_id) {
  23. case PRIMARY_I2S_RX: return IDX_PRIMARY_I2S_RX;
  24. case PRIMARY_I2S_TX: return IDX_PRIMARY_I2S_TX;
  25. case AFE_PORT_ID_PRIMARY_PCM_RX:
  26. return IDX_AFE_PORT_ID_PRIMARY_PCM_RX;
  27. case AFE_PORT_ID_PRIMARY_PCM_TX:
  28. return IDX_AFE_PORT_ID_PRIMARY_PCM_TX;
  29. case AFE_PORT_ID_SECONDARY_PCM_RX:
  30. return IDX_AFE_PORT_ID_SECONDARY_PCM_RX;
  31. case AFE_PORT_ID_SECONDARY_PCM_TX:
  32. return IDX_AFE_PORT_ID_SECONDARY_PCM_TX;
  33. case AFE_PORT_ID_TERTIARY_PCM_RX:
  34. return IDX_AFE_PORT_ID_TERTIARY_PCM_RX;
  35. case AFE_PORT_ID_TERTIARY_PCM_TX:
  36. return IDX_AFE_PORT_ID_TERTIARY_PCM_TX;
  37. case AFE_PORT_ID_QUATERNARY_PCM_RX:
  38. return IDX_AFE_PORT_ID_QUATERNARY_PCM_RX;
  39. case AFE_PORT_ID_QUATERNARY_PCM_TX:
  40. return IDX_AFE_PORT_ID_QUATERNARY_PCM_TX;
  41. case AFE_PORT_ID_QUINARY_PCM_RX:
  42. return IDX_AFE_PORT_ID_QUINARY_PCM_RX;
  43. case AFE_PORT_ID_QUINARY_PCM_TX:
  44. return IDX_AFE_PORT_ID_QUINARY_PCM_TX;
  45. case SECONDARY_I2S_RX: return IDX_SECONDARY_I2S_RX;
  46. case SECONDARY_I2S_TX: return IDX_SECONDARY_I2S_TX;
  47. case MI2S_RX: return IDX_MI2S_RX;
  48. case MI2S_TX: return IDX_MI2S_TX;
  49. case HDMI_RX: return IDX_HDMI_RX;
  50. case DISPLAY_PORT_RX: return IDX_DISPLAY_PORT_RX;
  51. case AFE_PORT_ID_PRIMARY_SPDIF_RX: return IDX_PRIMARY_SPDIF_RX;
  52. case AFE_PORT_ID_PRIMARY_SPDIF_TX: return IDX_PRIMARY_SPDIF_TX;
  53. case AFE_PORT_ID_SECONDARY_SPDIF_RX: return IDX_SECONDARY_SPDIF_RX;
  54. case AFE_PORT_ID_SECONDARY_SPDIF_TX: return IDX_SECONDARY_SPDIF_TX;
  55. case RSVD_2: return IDX_RSVD_2;
  56. case RSVD_3: return IDX_RSVD_3;
  57. case DIGI_MIC_TX: return IDX_DIGI_MIC_TX;
  58. case VOICE_RECORD_RX: return IDX_VOICE_RECORD_RX;
  59. case VOICE_RECORD_TX: return IDX_VOICE_RECORD_TX;
  60. case VOICE_PLAYBACK_TX: return IDX_VOICE_PLAYBACK_TX;
  61. case VOICE2_PLAYBACK_TX: return IDX_VOICE2_PLAYBACK_TX;
  62. case SLIMBUS_0_RX: return IDX_SLIMBUS_0_RX;
  63. case SLIMBUS_0_TX: return IDX_SLIMBUS_0_TX;
  64. case SLIMBUS_1_RX: return IDX_SLIMBUS_1_RX;
  65. case SLIMBUS_1_TX: return IDX_SLIMBUS_1_TX;
  66. case SLIMBUS_2_RX: return IDX_SLIMBUS_2_RX;
  67. case SLIMBUS_2_TX: return IDX_SLIMBUS_2_TX;
  68. case SLIMBUS_3_RX: return IDX_SLIMBUS_3_RX;
  69. case SLIMBUS_3_TX: return IDX_SLIMBUS_3_TX;
  70. case SLIMBUS_4_RX: return IDX_SLIMBUS_4_RX;
  71. case SLIMBUS_4_TX: return IDX_SLIMBUS_4_TX;
  72. case SLIMBUS_5_RX: return IDX_SLIMBUS_5_RX;
  73. case SLIMBUS_5_TX: return IDX_SLIMBUS_5_TX;
  74. case SLIMBUS_6_RX: return IDX_SLIMBUS_6_RX;
  75. case SLIMBUS_6_TX: return IDX_SLIMBUS_6_TX;
  76. case SLIMBUS_7_RX: return IDX_SLIMBUS_7_RX;
  77. case SLIMBUS_7_TX: return IDX_SLIMBUS_7_TX;
  78. case SLIMBUS_8_RX: return IDX_SLIMBUS_8_RX;
  79. case SLIMBUS_8_TX: return IDX_SLIMBUS_8_TX;
  80. case INT_BT_SCO_RX: return IDX_INT_BT_SCO_RX;
  81. case INT_BT_SCO_TX: return IDX_INT_BT_SCO_TX;
  82. case INT_BT_A2DP_RX: return IDX_INT_BT_A2DP_RX;
  83. case INT_FM_RX: return IDX_INT_FM_RX;
  84. case INT_FM_TX: return IDX_INT_FM_TX;
  85. case RT_PROXY_PORT_001_RX: return IDX_RT_PROXY_PORT_001_RX;
  86. case RT_PROXY_PORT_001_TX: return IDX_RT_PROXY_PORT_001_TX;
  87. case AFE_PORT_ID_PRIMARY_MI2S_RX:
  88. return IDX_AFE_PORT_ID_PRIMARY_MI2S_RX;
  89. case AFE_PORT_ID_PRIMARY_MI2S_TX:
  90. return IDX_AFE_PORT_ID_PRIMARY_MI2S_TX;
  91. case AFE_PORT_ID_QUATERNARY_MI2S_RX:
  92. return IDX_AFE_PORT_ID_QUATERNARY_MI2S_RX;
  93. case AFE_PORT_ID_QUATERNARY_MI2S_TX:
  94. return IDX_AFE_PORT_ID_QUATERNARY_MI2S_TX;
  95. case AFE_PORT_ID_SECONDARY_MI2S_RX:
  96. return IDX_AFE_PORT_ID_SECONDARY_MI2S_RX;
  97. case AFE_PORT_ID_SECONDARY_MI2S_TX:
  98. return IDX_AFE_PORT_ID_SECONDARY_MI2S_TX;
  99. case AFE_PORT_ID_TERTIARY_MI2S_RX:
  100. return IDX_AFE_PORT_ID_TERTIARY_MI2S_RX;
  101. case AFE_PORT_ID_TERTIARY_MI2S_TX:
  102. return IDX_AFE_PORT_ID_TERTIARY_MI2S_TX;
  103. case AFE_PORT_ID_QUINARY_MI2S_RX:
  104. return IDX_AFE_PORT_ID_QUINARY_MI2S_RX;
  105. case AFE_PORT_ID_QUINARY_MI2S_TX:
  106. return IDX_AFE_PORT_ID_QUINARY_MI2S_TX;
  107. case AUDIO_PORT_ID_I2S_RX:
  108. return IDX_AUDIO_PORT_ID_I2S_RX;
  109. case AFE_PORT_ID_SECONDARY_MI2S_RX_SD1:
  110. return IDX_AFE_PORT_ID_SECONDARY_MI2S_RX_SD1;
  111. case AFE_PORT_ID_PRIMARY_TDM_RX:
  112. return IDX_AFE_PORT_ID_PRIMARY_TDM_RX_0;
  113. case AFE_PORT_ID_PRIMARY_TDM_TX:
  114. return IDX_AFE_PORT_ID_PRIMARY_TDM_TX_0;
  115. case AFE_PORT_ID_PRIMARY_TDM_RX_1:
  116. return IDX_AFE_PORT_ID_PRIMARY_TDM_RX_1;
  117. case AFE_PORT_ID_PRIMARY_TDM_TX_1:
  118. return IDX_AFE_PORT_ID_PRIMARY_TDM_TX_1;
  119. case AFE_PORT_ID_PRIMARY_TDM_RX_2:
  120. return IDX_AFE_PORT_ID_PRIMARY_TDM_RX_2;
  121. case AFE_PORT_ID_PRIMARY_TDM_TX_2:
  122. return IDX_AFE_PORT_ID_PRIMARY_TDM_TX_2;
  123. case AFE_PORT_ID_PRIMARY_TDM_RX_3:
  124. return IDX_AFE_PORT_ID_PRIMARY_TDM_RX_3;
  125. case AFE_PORT_ID_PRIMARY_TDM_TX_3:
  126. return IDX_AFE_PORT_ID_PRIMARY_TDM_TX_3;
  127. case AFE_PORT_ID_PRIMARY_TDM_RX_4:
  128. return IDX_AFE_PORT_ID_PRIMARY_TDM_RX_4;
  129. case AFE_PORT_ID_PRIMARY_TDM_TX_4:
  130. return IDX_AFE_PORT_ID_PRIMARY_TDM_TX_4;
  131. case AFE_PORT_ID_PRIMARY_TDM_RX_5:
  132. return IDX_AFE_PORT_ID_PRIMARY_TDM_RX_5;
  133. case AFE_PORT_ID_PRIMARY_TDM_TX_5:
  134. return IDX_AFE_PORT_ID_PRIMARY_TDM_TX_5;
  135. case AFE_PORT_ID_PRIMARY_TDM_RX_6:
  136. return IDX_AFE_PORT_ID_PRIMARY_TDM_RX_6;
  137. case AFE_PORT_ID_PRIMARY_TDM_TX_6:
  138. return IDX_AFE_PORT_ID_PRIMARY_TDM_TX_6;
  139. case AFE_PORT_ID_PRIMARY_TDM_RX_7:
  140. return IDX_AFE_PORT_ID_PRIMARY_TDM_RX_7;
  141. case AFE_PORT_ID_PRIMARY_TDM_TX_7:
  142. return IDX_AFE_PORT_ID_PRIMARY_TDM_TX_7;
  143. case AFE_PORT_ID_SECONDARY_TDM_RX:
  144. return IDX_AFE_PORT_ID_SECONDARY_TDM_RX_0;
  145. case AFE_PORT_ID_SECONDARY_TDM_TX:
  146. return IDX_AFE_PORT_ID_SECONDARY_TDM_TX_0;
  147. case AFE_PORT_ID_SECONDARY_TDM_RX_1:
  148. return IDX_AFE_PORT_ID_SECONDARY_TDM_RX_1;
  149. case AFE_PORT_ID_SECONDARY_TDM_TX_1:
  150. return IDX_AFE_PORT_ID_SECONDARY_TDM_TX_1;
  151. case AFE_PORT_ID_SECONDARY_TDM_RX_2:
  152. return IDX_AFE_PORT_ID_SECONDARY_TDM_RX_2;
  153. case AFE_PORT_ID_SECONDARY_TDM_TX_2:
  154. return IDX_AFE_PORT_ID_SECONDARY_TDM_TX_2;
  155. case AFE_PORT_ID_SECONDARY_TDM_RX_3:
  156. return IDX_AFE_PORT_ID_SECONDARY_TDM_RX_3;
  157. case AFE_PORT_ID_SECONDARY_TDM_TX_3:
  158. return IDX_AFE_PORT_ID_SECONDARY_TDM_TX_3;
  159. case AFE_PORT_ID_SECONDARY_TDM_RX_4:
  160. return IDX_AFE_PORT_ID_SECONDARY_TDM_RX_4;
  161. case AFE_PORT_ID_SECONDARY_TDM_TX_4:
  162. return IDX_AFE_PORT_ID_SECONDARY_TDM_TX_4;
  163. case AFE_PORT_ID_SECONDARY_TDM_RX_5:
  164. return IDX_AFE_PORT_ID_SECONDARY_TDM_RX_5;
  165. case AFE_PORT_ID_SECONDARY_TDM_TX_5:
  166. return IDX_AFE_PORT_ID_SECONDARY_TDM_TX_5;
  167. case AFE_PORT_ID_SECONDARY_TDM_RX_6:
  168. return IDX_AFE_PORT_ID_SECONDARY_TDM_RX_6;
  169. case AFE_PORT_ID_SECONDARY_TDM_TX_6:
  170. return IDX_AFE_PORT_ID_SECONDARY_TDM_TX_6;
  171. case AFE_PORT_ID_SECONDARY_TDM_RX_7:
  172. return IDX_AFE_PORT_ID_SECONDARY_TDM_RX_7;
  173. case AFE_PORT_ID_SECONDARY_TDM_TX_7:
  174. return IDX_AFE_PORT_ID_SECONDARY_TDM_TX_7;
  175. case AFE_PORT_ID_TERTIARY_TDM_RX:
  176. return IDX_AFE_PORT_ID_TERTIARY_TDM_RX_0;
  177. case AFE_PORT_ID_TERTIARY_TDM_TX:
  178. return IDX_AFE_PORT_ID_TERTIARY_TDM_TX_0;
  179. case AFE_PORT_ID_TERTIARY_TDM_RX_1:
  180. return IDX_AFE_PORT_ID_TERTIARY_TDM_RX_1;
  181. case AFE_PORT_ID_TERTIARY_TDM_TX_1:
  182. return IDX_AFE_PORT_ID_TERTIARY_TDM_TX_1;
  183. case AFE_PORT_ID_TERTIARY_TDM_RX_2:
  184. return IDX_AFE_PORT_ID_TERTIARY_TDM_RX_2;
  185. case AFE_PORT_ID_TERTIARY_TDM_TX_2:
  186. return IDX_AFE_PORT_ID_TERTIARY_TDM_TX_2;
  187. case AFE_PORT_ID_TERTIARY_TDM_RX_3:
  188. return IDX_AFE_PORT_ID_TERTIARY_TDM_RX_3;
  189. case AFE_PORT_ID_TERTIARY_TDM_TX_3:
  190. return IDX_AFE_PORT_ID_TERTIARY_TDM_TX_3;
  191. case AFE_PORT_ID_TERTIARY_TDM_RX_4:
  192. return IDX_AFE_PORT_ID_TERTIARY_TDM_RX_4;
  193. case AFE_PORT_ID_TERTIARY_TDM_TX_4:
  194. return IDX_AFE_PORT_ID_TERTIARY_TDM_TX_4;
  195. case AFE_PORT_ID_TERTIARY_TDM_RX_5:
  196. return IDX_AFE_PORT_ID_TERTIARY_TDM_RX_5;
  197. case AFE_PORT_ID_TERTIARY_TDM_TX_5:
  198. return IDX_AFE_PORT_ID_TERTIARY_TDM_TX_5;
  199. case AFE_PORT_ID_TERTIARY_TDM_RX_6:
  200. return IDX_AFE_PORT_ID_TERTIARY_TDM_RX_6;
  201. case AFE_PORT_ID_TERTIARY_TDM_TX_6:
  202. return IDX_AFE_PORT_ID_TERTIARY_TDM_TX_6;
  203. case AFE_PORT_ID_TERTIARY_TDM_RX_7:
  204. return IDX_AFE_PORT_ID_TERTIARY_TDM_RX_7;
  205. case AFE_PORT_ID_TERTIARY_TDM_TX_7:
  206. return IDX_AFE_PORT_ID_TERTIARY_TDM_TX_7;
  207. case AFE_PORT_ID_QUATERNARY_TDM_RX:
  208. return IDX_AFE_PORT_ID_QUATERNARY_TDM_RX_0;
  209. case AFE_PORT_ID_QUATERNARY_TDM_TX:
  210. return IDX_AFE_PORT_ID_QUATERNARY_TDM_TX_0;
  211. case AFE_PORT_ID_QUATERNARY_TDM_RX_1:
  212. return IDX_AFE_PORT_ID_QUATERNARY_TDM_RX_1;
  213. case AFE_PORT_ID_QUATERNARY_TDM_TX_1:
  214. return IDX_AFE_PORT_ID_QUATERNARY_TDM_TX_1;
  215. case AFE_PORT_ID_QUATERNARY_TDM_RX_2:
  216. return IDX_AFE_PORT_ID_QUATERNARY_TDM_RX_2;
  217. case AFE_PORT_ID_QUATERNARY_TDM_TX_2:
  218. return IDX_AFE_PORT_ID_QUATERNARY_TDM_TX_2;
  219. case AFE_PORT_ID_QUATERNARY_TDM_RX_3:
  220. return IDX_AFE_PORT_ID_QUATERNARY_TDM_RX_3;
  221. case AFE_PORT_ID_QUATERNARY_TDM_TX_3:
  222. return IDX_AFE_PORT_ID_QUATERNARY_TDM_TX_3;
  223. case AFE_PORT_ID_QUATERNARY_TDM_RX_4:
  224. return IDX_AFE_PORT_ID_QUATERNARY_TDM_RX_4;
  225. case AFE_PORT_ID_QUATERNARY_TDM_TX_4:
  226. return IDX_AFE_PORT_ID_QUATERNARY_TDM_TX_4;
  227. case AFE_PORT_ID_QUATERNARY_TDM_RX_5:
  228. return IDX_AFE_PORT_ID_QUATERNARY_TDM_RX_5;
  229. case AFE_PORT_ID_QUATERNARY_TDM_TX_5:
  230. return IDX_AFE_PORT_ID_QUATERNARY_TDM_TX_5;
  231. case AFE_PORT_ID_QUATERNARY_TDM_RX_6:
  232. return IDX_AFE_PORT_ID_QUATERNARY_TDM_RX_6;
  233. case AFE_PORT_ID_QUATERNARY_TDM_TX_6:
  234. return IDX_AFE_PORT_ID_QUATERNARY_TDM_TX_6;
  235. case AFE_PORT_ID_QUATERNARY_TDM_RX_7:
  236. return IDX_AFE_PORT_ID_QUATERNARY_TDM_RX_7;
  237. case AFE_PORT_ID_QUATERNARY_TDM_TX_7:
  238. return IDX_AFE_PORT_ID_QUATERNARY_TDM_TX_7;
  239. case AFE_PORT_ID_QUINARY_TDM_RX:
  240. return IDX_AFE_PORT_ID_QUINARY_TDM_RX_0;
  241. case AFE_PORT_ID_QUINARY_TDM_TX:
  242. return IDX_AFE_PORT_ID_QUINARY_TDM_TX_0;
  243. case AFE_PORT_ID_QUINARY_TDM_RX_1:
  244. return IDX_AFE_PORT_ID_QUINARY_TDM_RX_1;
  245. case AFE_PORT_ID_QUINARY_TDM_TX_1:
  246. return IDX_AFE_PORT_ID_QUINARY_TDM_TX_1;
  247. case AFE_PORT_ID_QUINARY_TDM_RX_2:
  248. return IDX_AFE_PORT_ID_QUINARY_TDM_RX_2;
  249. case AFE_PORT_ID_QUINARY_TDM_TX_2:
  250. return IDX_AFE_PORT_ID_QUINARY_TDM_TX_2;
  251. case AFE_PORT_ID_QUINARY_TDM_RX_3:
  252. return IDX_AFE_PORT_ID_QUINARY_TDM_RX_3;
  253. case AFE_PORT_ID_QUINARY_TDM_TX_3:
  254. return IDX_AFE_PORT_ID_QUINARY_TDM_TX_3;
  255. case AFE_PORT_ID_QUINARY_TDM_RX_4:
  256. return IDX_AFE_PORT_ID_QUINARY_TDM_RX_4;
  257. case AFE_PORT_ID_QUINARY_TDM_TX_4:
  258. return IDX_AFE_PORT_ID_QUINARY_TDM_TX_4;
  259. case AFE_PORT_ID_QUINARY_TDM_RX_5:
  260. return IDX_AFE_PORT_ID_QUINARY_TDM_RX_5;
  261. case AFE_PORT_ID_QUINARY_TDM_TX_5:
  262. return IDX_AFE_PORT_ID_QUINARY_TDM_TX_5;
  263. case AFE_PORT_ID_QUINARY_TDM_RX_6:
  264. return IDX_AFE_PORT_ID_QUINARY_TDM_RX_6;
  265. case AFE_PORT_ID_QUINARY_TDM_TX_6:
  266. return IDX_AFE_PORT_ID_QUINARY_TDM_TX_6;
  267. case AFE_PORT_ID_QUINARY_TDM_RX_7:
  268. return IDX_AFE_PORT_ID_QUINARY_TDM_RX_7;
  269. case AFE_PORT_ID_QUINARY_TDM_TX_7:
  270. return IDX_AFE_PORT_ID_QUINARY_TDM_TX_7;
  271. case AFE_PORT_ID_SENARY_MI2S_TX:
  272. return IDX_AFE_PORT_ID_SENARY_MI2S_TX;
  273. case AFE_PORT_ID_USB_RX:
  274. return IDX_AFE_PORT_ID_USB_RX;
  275. case AFE_PORT_ID_USB_TX:
  276. return IDX_AFE_PORT_ID_USB_TX;
  277. case AFE_PORT_ID_INT0_MI2S_RX:
  278. return IDX_AFE_PORT_ID_INT0_MI2S_RX;
  279. case AFE_PORT_ID_INT0_MI2S_TX:
  280. return IDX_AFE_PORT_ID_INT0_MI2S_TX;
  281. case AFE_PORT_ID_INT1_MI2S_RX:
  282. return IDX_AFE_PORT_ID_INT1_MI2S_RX;
  283. case AFE_PORT_ID_INT1_MI2S_TX:
  284. return IDX_AFE_PORT_ID_INT1_MI2S_TX;
  285. case AFE_PORT_ID_INT2_MI2S_RX:
  286. return IDX_AFE_PORT_ID_INT2_MI2S_RX;
  287. case AFE_PORT_ID_INT2_MI2S_TX:
  288. return IDX_AFE_PORT_ID_INT2_MI2S_TX;
  289. case AFE_PORT_ID_INT3_MI2S_RX:
  290. return IDX_AFE_PORT_ID_INT3_MI2S_RX;
  291. case AFE_PORT_ID_INT3_MI2S_TX:
  292. return IDX_AFE_PORT_ID_INT3_MI2S_TX;
  293. case AFE_PORT_ID_INT4_MI2S_RX:
  294. return IDX_AFE_PORT_ID_INT4_MI2S_RX;
  295. case AFE_PORT_ID_INT4_MI2S_TX:
  296. return IDX_AFE_PORT_ID_INT4_MI2S_TX;
  297. case AFE_PORT_ID_INT5_MI2S_RX:
  298. return IDX_AFE_PORT_ID_INT5_MI2S_RX;
  299. case AFE_PORT_ID_INT5_MI2S_TX:
  300. return IDX_AFE_PORT_ID_INT5_MI2S_TX;
  301. case AFE_PORT_ID_INT6_MI2S_RX:
  302. return IDX_AFE_PORT_ID_INT6_MI2S_RX;
  303. case AFE_PORT_ID_INT6_MI2S_TX:
  304. return IDX_AFE_PORT_ID_INT6_MI2S_TX;
  305. case AFE_PORT_ID_WSA_CODEC_DMA_RX_0:
  306. return IDX_AFE_PORT_ID_WSA_CODEC_DMA_RX_0;
  307. case AFE_PORT_ID_WSA_CODEC_DMA_TX_0:
  308. return IDX_AFE_PORT_ID_WSA_CODEC_DMA_TX_0;
  309. case AFE_PORT_ID_WSA_CODEC_DMA_RX_1:
  310. return IDX_AFE_PORT_ID_WSA_CODEC_DMA_RX_1;
  311. case AFE_PORT_ID_WSA_CODEC_DMA_TX_1:
  312. return IDX_AFE_PORT_ID_WSA_CODEC_DMA_TX_1;
  313. case AFE_PORT_ID_WSA_CODEC_DMA_TX_2:
  314. return IDX_AFE_PORT_ID_WSA_CODEC_DMA_TX_2;
  315. case AFE_PORT_ID_VA_CODEC_DMA_TX_0:
  316. return IDX_AFE_PORT_ID_VA_CODEC_DMA_TX_0;
  317. case AFE_PORT_ID_VA_CODEC_DMA_TX_1:
  318. return IDX_AFE_PORT_ID_VA_CODEC_DMA_TX_1;
  319. default: return -EINVAL;
  320. }
  321. }
  322. int q6audio_get_port_id(u16 port_id)
  323. {
  324. switch (port_id) {
  325. case PRIMARY_I2S_RX: return PRIMARY_I2S_RX;
  326. case PRIMARY_I2S_TX: return PRIMARY_I2S_TX;
  327. case AFE_PORT_ID_PRIMARY_PCM_RX:
  328. return AFE_PORT_ID_PRIMARY_PCM_RX;
  329. case AFE_PORT_ID_PRIMARY_PCM_TX:
  330. return AFE_PORT_ID_PRIMARY_PCM_TX;
  331. case AFE_PORT_ID_SECONDARY_PCM_RX:
  332. return AFE_PORT_ID_SECONDARY_PCM_RX;
  333. case AFE_PORT_ID_SECONDARY_PCM_TX:
  334. return AFE_PORT_ID_SECONDARY_PCM_TX;
  335. case AFE_PORT_ID_TERTIARY_PCM_RX:
  336. return AFE_PORT_ID_TERTIARY_PCM_RX;
  337. case AFE_PORT_ID_TERTIARY_PCM_TX:
  338. return AFE_PORT_ID_TERTIARY_PCM_TX;
  339. case AFE_PORT_ID_QUATERNARY_PCM_RX:
  340. return AFE_PORT_ID_QUATERNARY_PCM_RX;
  341. case AFE_PORT_ID_QUATERNARY_PCM_TX:
  342. return AFE_PORT_ID_QUATERNARY_PCM_TX;
  343. case AFE_PORT_ID_QUINARY_PCM_RX:
  344. return AFE_PORT_ID_QUINARY_PCM_RX;
  345. case AFE_PORT_ID_QUINARY_PCM_TX:
  346. return AFE_PORT_ID_QUINARY_PCM_TX;
  347. case SECONDARY_I2S_RX: return AFE_PORT_ID_SECONDARY_MI2S_RX;
  348. case SECONDARY_I2S_TX: return AFE_PORT_ID_SECONDARY_MI2S_TX;
  349. case MI2S_RX: return AFE_PORT_ID_PRIMARY_MI2S_RX;
  350. case MI2S_TX: return AFE_PORT_ID_PRIMARY_MI2S_TX;
  351. case HDMI_RX: return AFE_PORT_ID_MULTICHAN_HDMI_RX;
  352. case DISPLAY_PORT_RX:
  353. return AFE_PORT_ID_HDMI_OVER_DP_RX;
  354. case AFE_PORT_ID_PRIMARY_SPDIF_RX:
  355. return AFE_PORT_ID_PRIMARY_SPDIF_RX;
  356. case AFE_PORT_ID_PRIMARY_SPDIF_TX:
  357. return AFE_PORT_ID_PRIMARY_SPDIF_TX;
  358. case AFE_PORT_ID_SECONDARY_SPDIF_RX:
  359. return AFE_PORT_ID_SECONDARY_SPDIF_RX;
  360. case AFE_PORT_ID_SECONDARY_SPDIF_TX:
  361. return AFE_PORT_ID_SECONDARY_SPDIF_TX;
  362. case RSVD_2: return IDX_RSVD_2;
  363. case RSVD_3: return IDX_RSVD_3;
  364. case DIGI_MIC_TX: return AFE_PORT_ID_DIGITAL_MIC_TX;
  365. case VOICE_RECORD_RX: return AFE_PORT_ID_VOICE_RECORD_RX;
  366. case VOICE_RECORD_TX: return AFE_PORT_ID_VOICE_RECORD_TX;
  367. case VOICE_PLAYBACK_TX: return AFE_PORT_ID_VOICE_PLAYBACK_TX;
  368. case VOICE2_PLAYBACK_TX: return AFE_PORT_ID_VOICE2_PLAYBACK_TX;
  369. case SLIMBUS_0_RX: return AFE_PORT_ID_SLIMBUS_MULTI_CHAN_0_RX;
  370. case SLIMBUS_0_TX: return AFE_PORT_ID_SLIMBUS_MULTI_CHAN_0_TX;
  371. case SLIMBUS_1_RX: return AFE_PORT_ID_SLIMBUS_MULTI_CHAN_1_RX;
  372. case SLIMBUS_1_TX: return AFE_PORT_ID_SLIMBUS_MULTI_CHAN_1_TX;
  373. case SLIMBUS_2_RX: return AFE_PORT_ID_SLIMBUS_MULTI_CHAN_2_RX;
  374. case SLIMBUS_2_TX: return AFE_PORT_ID_SLIMBUS_MULTI_CHAN_2_TX;
  375. case SLIMBUS_3_RX: return AFE_PORT_ID_SLIMBUS_MULTI_CHAN_3_RX;
  376. case SLIMBUS_3_TX: return AFE_PORT_ID_SLIMBUS_MULTI_CHAN_3_TX;
  377. case SLIMBUS_4_RX: return AFE_PORT_ID_SLIMBUS_MULTI_CHAN_4_RX;
  378. case SLIMBUS_4_TX: return AFE_PORT_ID_SLIMBUS_MULTI_CHAN_4_TX;
  379. case SLIMBUS_5_RX: return AFE_PORT_ID_SLIMBUS_MULTI_CHAN_5_RX;
  380. case SLIMBUS_5_TX: return AFE_PORT_ID_SLIMBUS_MULTI_CHAN_5_TX;
  381. case SLIMBUS_6_RX: return AFE_PORT_ID_SLIMBUS_MULTI_CHAN_6_RX;
  382. case SLIMBUS_6_TX: return AFE_PORT_ID_SLIMBUS_MULTI_CHAN_6_TX;
  383. case SLIMBUS_7_RX: return AFE_PORT_ID_SLIMBUS_MULTI_CHAN_7_RX;
  384. case SLIMBUS_7_TX: return AFE_PORT_ID_SLIMBUS_MULTI_CHAN_7_TX;
  385. case SLIMBUS_8_RX: return AFE_PORT_ID_SLIMBUS_MULTI_CHAN_8_RX;
  386. case SLIMBUS_8_TX: return AFE_PORT_ID_SLIMBUS_MULTI_CHAN_8_TX;
  387. case INT_BT_SCO_RX: return AFE_PORT_ID_INTERNAL_BT_SCO_RX;
  388. case INT_BT_SCO_TX: return AFE_PORT_ID_INTERNAL_BT_SCO_TX;
  389. case INT_BT_A2DP_RX: return AFE_PORT_ID_INTERNAL_BT_A2DP_RX;
  390. case INT_FM_RX: return AFE_PORT_ID_INTERNAL_FM_RX;
  391. case INT_FM_TX: return AFE_PORT_ID_INTERNAL_FM_TX;
  392. case RT_PROXY_PORT_001_RX: return AFE_PORT_ID_RT_PROXY_PORT_001_RX;
  393. case RT_PROXY_PORT_001_TX: return AFE_PORT_ID_RT_PROXY_PORT_001_TX;
  394. case AFE_PORT_ID_PRIMARY_MI2S_RX:
  395. return AFE_PORT_ID_PRIMARY_MI2S_RX;
  396. case AFE_PORT_ID_PRIMARY_MI2S_TX:
  397. return AFE_PORT_ID_PRIMARY_MI2S_TX;
  398. case AFE_PORT_ID_QUATERNARY_MI2S_RX:
  399. return AFE_PORT_ID_QUATERNARY_MI2S_RX;
  400. case AFE_PORT_ID_QUATERNARY_MI2S_TX:
  401. return AFE_PORT_ID_QUATERNARY_MI2S_TX;
  402. case AFE_PORT_ID_SECONDARY_MI2S_RX:
  403. return AFE_PORT_ID_SECONDARY_MI2S_RX;
  404. case AFE_PORT_ID_SECONDARY_MI2S_TX:
  405. return AFE_PORT_ID_SECONDARY_MI2S_TX;
  406. case AFE_PORT_ID_TERTIARY_MI2S_RX:
  407. return AFE_PORT_ID_TERTIARY_MI2S_RX;
  408. case AFE_PORT_ID_TERTIARY_MI2S_TX:
  409. return AFE_PORT_ID_TERTIARY_MI2S_TX;
  410. case AFE_PORT_ID_QUINARY_MI2S_RX:
  411. return AFE_PORT_ID_QUINARY_MI2S_RX;
  412. case AFE_PORT_ID_QUINARY_MI2S_TX:
  413. return AFE_PORT_ID_QUINARY_MI2S_TX;
  414. case AUDIO_PORT_ID_I2S_RX:
  415. return AUDIO_PORT_ID_I2S_RX;
  416. case AFE_PORT_ID_SECONDARY_MI2S_RX_SD1:
  417. return AFE_PORT_ID_SECONDARY_MI2S_RX_SD1;
  418. case AFE_PORT_ID_PRIMARY_TDM_RX:
  419. return AFE_PORT_ID_PRIMARY_TDM_RX;
  420. case AFE_PORT_ID_PRIMARY_TDM_TX:
  421. return AFE_PORT_ID_PRIMARY_TDM_TX;
  422. case AFE_PORT_ID_PRIMARY_TDM_RX_1:
  423. return AFE_PORT_ID_PRIMARY_TDM_RX_1;
  424. case AFE_PORT_ID_PRIMARY_TDM_TX_1:
  425. return AFE_PORT_ID_PRIMARY_TDM_TX_1;
  426. case AFE_PORT_ID_PRIMARY_TDM_RX_2:
  427. return AFE_PORT_ID_PRIMARY_TDM_RX_2;
  428. case AFE_PORT_ID_PRIMARY_TDM_TX_2:
  429. return AFE_PORT_ID_PRIMARY_TDM_TX_2;
  430. case AFE_PORT_ID_PRIMARY_TDM_RX_3:
  431. return AFE_PORT_ID_PRIMARY_TDM_RX_3;
  432. case AFE_PORT_ID_PRIMARY_TDM_TX_3:
  433. return AFE_PORT_ID_PRIMARY_TDM_TX_3;
  434. case AFE_PORT_ID_PRIMARY_TDM_RX_4:
  435. return AFE_PORT_ID_PRIMARY_TDM_RX_4;
  436. case AFE_PORT_ID_PRIMARY_TDM_TX_4:
  437. return AFE_PORT_ID_PRIMARY_TDM_TX_4;
  438. case AFE_PORT_ID_PRIMARY_TDM_RX_5:
  439. return AFE_PORT_ID_PRIMARY_TDM_RX_5;
  440. case AFE_PORT_ID_PRIMARY_TDM_TX_5:
  441. return AFE_PORT_ID_PRIMARY_TDM_TX_5;
  442. case AFE_PORT_ID_PRIMARY_TDM_RX_6:
  443. return AFE_PORT_ID_PRIMARY_TDM_RX_6;
  444. case AFE_PORT_ID_PRIMARY_TDM_TX_6:
  445. return AFE_PORT_ID_PRIMARY_TDM_TX_6;
  446. case AFE_PORT_ID_PRIMARY_TDM_RX_7:
  447. return AFE_PORT_ID_PRIMARY_TDM_RX_7;
  448. case AFE_PORT_ID_PRIMARY_TDM_TX_7:
  449. return AFE_PORT_ID_PRIMARY_TDM_TX_7;
  450. case AFE_PORT_ID_SECONDARY_TDM_RX:
  451. return AFE_PORT_ID_SECONDARY_TDM_RX;
  452. case AFE_PORT_ID_SECONDARY_TDM_TX:
  453. return AFE_PORT_ID_SECONDARY_TDM_TX;
  454. case AFE_PORT_ID_SECONDARY_TDM_RX_1:
  455. return AFE_PORT_ID_SECONDARY_TDM_RX_1;
  456. case AFE_PORT_ID_SECONDARY_TDM_TX_1:
  457. return AFE_PORT_ID_SECONDARY_TDM_TX_1;
  458. case AFE_PORT_ID_SECONDARY_TDM_RX_2:
  459. return AFE_PORT_ID_SECONDARY_TDM_RX_2;
  460. case AFE_PORT_ID_SECONDARY_TDM_TX_2:
  461. return AFE_PORT_ID_SECONDARY_TDM_TX_2;
  462. case AFE_PORT_ID_SECONDARY_TDM_RX_3:
  463. return AFE_PORT_ID_SECONDARY_TDM_RX_3;
  464. case AFE_PORT_ID_SECONDARY_TDM_TX_3:
  465. return AFE_PORT_ID_SECONDARY_TDM_TX_3;
  466. case AFE_PORT_ID_SECONDARY_TDM_RX_4:
  467. return AFE_PORT_ID_SECONDARY_TDM_RX_4;
  468. case AFE_PORT_ID_SECONDARY_TDM_TX_4:
  469. return AFE_PORT_ID_SECONDARY_TDM_TX_4;
  470. case AFE_PORT_ID_SECONDARY_TDM_RX_5:
  471. return AFE_PORT_ID_SECONDARY_TDM_RX_5;
  472. case AFE_PORT_ID_SECONDARY_TDM_TX_5:
  473. return AFE_PORT_ID_SECONDARY_TDM_TX_5;
  474. case AFE_PORT_ID_SECONDARY_TDM_RX_6:
  475. return AFE_PORT_ID_SECONDARY_TDM_RX_6;
  476. case AFE_PORT_ID_SECONDARY_TDM_TX_6:
  477. return AFE_PORT_ID_SECONDARY_TDM_TX_6;
  478. case AFE_PORT_ID_SECONDARY_TDM_RX_7:
  479. return AFE_PORT_ID_SECONDARY_TDM_RX_7;
  480. case AFE_PORT_ID_SECONDARY_TDM_TX_7:
  481. return AFE_PORT_ID_SECONDARY_TDM_TX_7;
  482. case AFE_PORT_ID_TERTIARY_TDM_RX:
  483. return AFE_PORT_ID_TERTIARY_TDM_RX;
  484. case AFE_PORT_ID_TERTIARY_TDM_TX:
  485. return AFE_PORT_ID_TERTIARY_TDM_TX;
  486. case AFE_PORT_ID_TERTIARY_TDM_RX_1:
  487. return AFE_PORT_ID_TERTIARY_TDM_RX_1;
  488. case AFE_PORT_ID_TERTIARY_TDM_TX_1:
  489. return AFE_PORT_ID_TERTIARY_TDM_TX_1;
  490. case AFE_PORT_ID_TERTIARY_TDM_RX_2:
  491. return AFE_PORT_ID_TERTIARY_TDM_RX_2;
  492. case AFE_PORT_ID_TERTIARY_TDM_TX_2:
  493. return AFE_PORT_ID_TERTIARY_TDM_TX_2;
  494. case AFE_PORT_ID_TERTIARY_TDM_RX_3:
  495. return AFE_PORT_ID_TERTIARY_TDM_RX_3;
  496. case AFE_PORT_ID_TERTIARY_TDM_TX_3:
  497. return AFE_PORT_ID_TERTIARY_TDM_TX_3;
  498. case AFE_PORT_ID_TERTIARY_TDM_RX_4:
  499. return AFE_PORT_ID_TERTIARY_TDM_RX_4;
  500. case AFE_PORT_ID_TERTIARY_TDM_TX_4:
  501. return AFE_PORT_ID_TERTIARY_TDM_TX_4;
  502. case AFE_PORT_ID_TERTIARY_TDM_RX_5:
  503. return AFE_PORT_ID_TERTIARY_TDM_RX_5;
  504. case AFE_PORT_ID_TERTIARY_TDM_TX_5:
  505. return AFE_PORT_ID_TERTIARY_TDM_TX_5;
  506. case AFE_PORT_ID_TERTIARY_TDM_RX_6:
  507. return AFE_PORT_ID_TERTIARY_TDM_RX_6;
  508. case AFE_PORT_ID_TERTIARY_TDM_TX_6:
  509. return AFE_PORT_ID_TERTIARY_TDM_TX_6;
  510. case AFE_PORT_ID_TERTIARY_TDM_RX_7:
  511. return AFE_PORT_ID_TERTIARY_TDM_RX_7;
  512. case AFE_PORT_ID_TERTIARY_TDM_TX_7:
  513. return AFE_PORT_ID_TERTIARY_TDM_TX_7;
  514. case AFE_PORT_ID_QUATERNARY_TDM_RX:
  515. return AFE_PORT_ID_QUATERNARY_TDM_RX;
  516. case AFE_PORT_ID_QUATERNARY_TDM_TX:
  517. return AFE_PORT_ID_QUATERNARY_TDM_TX;
  518. case AFE_PORT_ID_QUATERNARY_TDM_RX_1:
  519. return AFE_PORT_ID_QUATERNARY_TDM_RX_1;
  520. case AFE_PORT_ID_QUATERNARY_TDM_TX_1:
  521. return AFE_PORT_ID_QUATERNARY_TDM_TX_1;
  522. case AFE_PORT_ID_QUATERNARY_TDM_RX_2:
  523. return AFE_PORT_ID_QUATERNARY_TDM_RX_2;
  524. case AFE_PORT_ID_QUATERNARY_TDM_TX_2:
  525. return AFE_PORT_ID_QUATERNARY_TDM_TX_2;
  526. case AFE_PORT_ID_QUATERNARY_TDM_RX_3:
  527. return AFE_PORT_ID_QUATERNARY_TDM_RX_3;
  528. case AFE_PORT_ID_QUATERNARY_TDM_TX_3:
  529. return AFE_PORT_ID_QUATERNARY_TDM_TX_3;
  530. case AFE_PORT_ID_QUATERNARY_TDM_RX_4:
  531. return AFE_PORT_ID_QUATERNARY_TDM_RX_4;
  532. case AFE_PORT_ID_QUATERNARY_TDM_TX_4:
  533. return AFE_PORT_ID_QUATERNARY_TDM_TX_4;
  534. case AFE_PORT_ID_QUATERNARY_TDM_RX_5:
  535. return AFE_PORT_ID_QUATERNARY_TDM_RX_5;
  536. case AFE_PORT_ID_QUATERNARY_TDM_TX_5:
  537. return AFE_PORT_ID_QUATERNARY_TDM_TX_5;
  538. case AFE_PORT_ID_QUATERNARY_TDM_RX_6:
  539. return AFE_PORT_ID_QUATERNARY_TDM_RX_6;
  540. case AFE_PORT_ID_QUATERNARY_TDM_TX_6:
  541. return AFE_PORT_ID_QUATERNARY_TDM_TX_6;
  542. case AFE_PORT_ID_QUATERNARY_TDM_RX_7:
  543. return AFE_PORT_ID_QUATERNARY_TDM_RX_7;
  544. case AFE_PORT_ID_QUATERNARY_TDM_TX_7:
  545. return AFE_PORT_ID_QUATERNARY_TDM_TX_7;
  546. case AFE_PORT_ID_QUINARY_TDM_RX:
  547. return AFE_PORT_ID_QUINARY_TDM_RX;
  548. case AFE_PORT_ID_QUINARY_TDM_TX:
  549. return AFE_PORT_ID_QUINARY_TDM_TX;
  550. case AFE_PORT_ID_QUINARY_TDM_RX_1:
  551. return AFE_PORT_ID_QUINARY_TDM_RX_1;
  552. case AFE_PORT_ID_QUINARY_TDM_TX_1:
  553. return AFE_PORT_ID_QUINARY_TDM_TX_1;
  554. case AFE_PORT_ID_QUINARY_TDM_RX_2:
  555. return AFE_PORT_ID_QUINARY_TDM_RX_2;
  556. case AFE_PORT_ID_QUINARY_TDM_TX_2:
  557. return AFE_PORT_ID_QUINARY_TDM_TX_2;
  558. case AFE_PORT_ID_QUINARY_TDM_RX_3:
  559. return AFE_PORT_ID_QUINARY_TDM_RX_3;
  560. case AFE_PORT_ID_QUINARY_TDM_TX_3:
  561. return AFE_PORT_ID_QUINARY_TDM_TX_3;
  562. case AFE_PORT_ID_QUINARY_TDM_RX_4:
  563. return AFE_PORT_ID_QUINARY_TDM_RX_4;
  564. case AFE_PORT_ID_QUINARY_TDM_TX_4:
  565. return AFE_PORT_ID_QUINARY_TDM_TX_4;
  566. case AFE_PORT_ID_QUINARY_TDM_RX_5:
  567. return AFE_PORT_ID_QUINARY_TDM_RX_5;
  568. case AFE_PORT_ID_QUINARY_TDM_TX_5:
  569. return AFE_PORT_ID_QUINARY_TDM_TX_5;
  570. case AFE_PORT_ID_QUINARY_TDM_RX_6:
  571. return AFE_PORT_ID_QUINARY_TDM_RX_6;
  572. case AFE_PORT_ID_QUINARY_TDM_TX_6:
  573. return AFE_PORT_ID_QUINARY_TDM_TX_6;
  574. case AFE_PORT_ID_QUINARY_TDM_RX_7:
  575. return AFE_PORT_ID_QUINARY_TDM_RX_7;
  576. case AFE_PORT_ID_QUINARY_TDM_TX_7:
  577. return AFE_PORT_ID_QUINARY_TDM_TX_7;
  578. case AFE_PORT_ID_SENARY_MI2S_TX:
  579. return AFE_PORT_ID_SENARY_MI2S_TX;
  580. case AFE_PORT_ID_USB_RX:
  581. return AFE_PORT_ID_USB_RX;
  582. case AFE_PORT_ID_USB_TX:
  583. return AFE_PORT_ID_USB_TX;
  584. case AFE_PORT_ID_INT0_MI2S_RX:
  585. return AFE_PORT_ID_INT0_MI2S_RX;
  586. case AFE_PORT_ID_INT0_MI2S_TX:
  587. return AFE_PORT_ID_INT0_MI2S_TX;
  588. case AFE_PORT_ID_INT1_MI2S_RX:
  589. return AFE_PORT_ID_INT1_MI2S_RX;
  590. case AFE_PORT_ID_INT1_MI2S_TX:
  591. return AFE_PORT_ID_INT1_MI2S_TX;
  592. case AFE_PORT_ID_INT2_MI2S_RX:
  593. return AFE_PORT_ID_INT2_MI2S_RX;
  594. case AFE_PORT_ID_INT2_MI2S_TX:
  595. return AFE_PORT_ID_INT2_MI2S_TX;
  596. case AFE_PORT_ID_INT3_MI2S_RX:
  597. return AFE_PORT_ID_INT3_MI2S_RX;
  598. case AFE_PORT_ID_INT3_MI2S_TX:
  599. return AFE_PORT_ID_INT3_MI2S_TX;
  600. case AFE_PORT_ID_INT4_MI2S_RX:
  601. return AFE_PORT_ID_INT4_MI2S_RX;
  602. case AFE_PORT_ID_INT4_MI2S_TX:
  603. return AFE_PORT_ID_INT4_MI2S_TX;
  604. case AFE_PORT_ID_INT5_MI2S_RX:
  605. return AFE_PORT_ID_INT5_MI2S_RX;
  606. case AFE_PORT_ID_INT5_MI2S_TX:
  607. return AFE_PORT_ID_INT5_MI2S_TX;
  608. case AFE_PORT_ID_INT6_MI2S_RX:
  609. return AFE_PORT_ID_INT6_MI2S_RX;
  610. case AFE_PORT_ID_INT6_MI2S_TX:
  611. return AFE_PORT_ID_INT6_MI2S_TX;
  612. case AFE_PORT_ID_WSA_CODEC_DMA_RX_0:
  613. return AFE_PORT_ID_WSA_CODEC_DMA_RX_0;
  614. case AFE_PORT_ID_WSA_CODEC_DMA_TX_0:
  615. return AFE_PORT_ID_WSA_CODEC_DMA_TX_0;
  616. case AFE_PORT_ID_WSA_CODEC_DMA_RX_1:
  617. return AFE_PORT_ID_WSA_CODEC_DMA_RX_1;
  618. case AFE_PORT_ID_WSA_CODEC_DMA_TX_1:
  619. return AFE_PORT_ID_WSA_CODEC_DMA_TX_1;
  620. case AFE_PORT_ID_WSA_CODEC_DMA_TX_2:
  621. return AFE_PORT_ID_WSA_CODEC_DMA_TX_2;
  622. case AFE_PORT_ID_VA_CODEC_DMA_TX_0:
  623. return AFE_PORT_ID_VA_CODEC_DMA_TX_0;
  624. case AFE_PORT_ID_VA_CODEC_DMA_TX_1:
  625. return AFE_PORT_ID_VA_CODEC_DMA_TX_1;
  626. default:
  627. pr_warn("%s: Invalid port_id %d\n", __func__, port_id);
  628. return -EINVAL;
  629. }
  630. }
  631. int q6audio_convert_virtual_to_portid(u16 port_id)
  632. {
  633. int ret;
  634. /* if port_id is virtual, convert to physical..
  635. * if port_id is already physical, return physical
  636. */
  637. if (q6audio_validate_port(port_id) < 0) {
  638. if (port_id == RT_PROXY_DAI_001_RX ||
  639. port_id == RT_PROXY_DAI_001_TX ||
  640. port_id == RT_PROXY_DAI_002_RX ||
  641. port_id == RT_PROXY_DAI_002_TX)
  642. ret = VIRTUAL_ID_TO_PORTID(port_id);
  643. else
  644. ret = -EINVAL;
  645. } else
  646. ret = port_id;
  647. return ret;
  648. }
  649. int q6audio_is_digital_pcm_interface(u16 port_id)
  650. {
  651. int ret = 0;
  652. switch (port_id) {
  653. case PRIMARY_I2S_RX:
  654. case PRIMARY_I2S_TX:
  655. case AFE_PORT_ID_PRIMARY_PCM_RX:
  656. case AFE_PORT_ID_PRIMARY_PCM_TX:
  657. case AFE_PORT_ID_SECONDARY_PCM_RX:
  658. case AFE_PORT_ID_SECONDARY_PCM_TX:
  659. case AFE_PORT_ID_TERTIARY_PCM_RX:
  660. case AFE_PORT_ID_TERTIARY_PCM_TX:
  661. case AFE_PORT_ID_QUATERNARY_PCM_RX:
  662. case AFE_PORT_ID_QUATERNARY_PCM_TX:
  663. case AFE_PORT_ID_QUINARY_PCM_RX:
  664. case AFE_PORT_ID_QUINARY_PCM_TX:
  665. case SECONDARY_I2S_RX:
  666. case SECONDARY_I2S_TX:
  667. case MI2S_RX:
  668. case MI2S_TX:
  669. case AFE_PORT_ID_TERTIARY_MI2S_TX:
  670. case AFE_PORT_ID_TERTIARY_MI2S_RX:
  671. case AFE_PORT_ID_QUINARY_MI2S_TX:
  672. case AFE_PORT_ID_QUINARY_MI2S_RX:
  673. case AFE_PORT_ID_QUATERNARY_MI2S_RX:
  674. case AFE_PORT_ID_QUATERNARY_MI2S_TX:
  675. case AFE_PORT_ID_PRIMARY_MI2S_RX:
  676. case AFE_PORT_ID_PRIMARY_MI2S_TX:
  677. case AFE_PORT_ID_SECONDARY_MI2S_RX:
  678. case AFE_PORT_ID_SECONDARY_MI2S_TX:
  679. case AUDIO_PORT_ID_I2S_RX:
  680. case AFE_PORT_ID_SECONDARY_MI2S_RX_SD1:
  681. case AFE_PORT_ID_PRIMARY_TDM_RX:
  682. case AFE_PORT_ID_PRIMARY_TDM_TX:
  683. case AFE_PORT_ID_PRIMARY_TDM_RX_1:
  684. case AFE_PORT_ID_PRIMARY_TDM_TX_1:
  685. case AFE_PORT_ID_PRIMARY_TDM_RX_2:
  686. case AFE_PORT_ID_PRIMARY_TDM_TX_2:
  687. case AFE_PORT_ID_PRIMARY_TDM_RX_3:
  688. case AFE_PORT_ID_PRIMARY_TDM_TX_3:
  689. case AFE_PORT_ID_PRIMARY_TDM_RX_4:
  690. case AFE_PORT_ID_PRIMARY_TDM_TX_4:
  691. case AFE_PORT_ID_PRIMARY_TDM_RX_5:
  692. case AFE_PORT_ID_PRIMARY_TDM_TX_5:
  693. case AFE_PORT_ID_PRIMARY_TDM_RX_6:
  694. case AFE_PORT_ID_PRIMARY_TDM_TX_6:
  695. case AFE_PORT_ID_PRIMARY_TDM_RX_7:
  696. case AFE_PORT_ID_PRIMARY_TDM_TX_7:
  697. case AFE_PORT_ID_SECONDARY_TDM_RX:
  698. case AFE_PORT_ID_SECONDARY_TDM_TX:
  699. case AFE_PORT_ID_SECONDARY_TDM_RX_1:
  700. case AFE_PORT_ID_SECONDARY_TDM_TX_1:
  701. case AFE_PORT_ID_SECONDARY_TDM_RX_2:
  702. case AFE_PORT_ID_SECONDARY_TDM_TX_2:
  703. case AFE_PORT_ID_SECONDARY_TDM_RX_3:
  704. case AFE_PORT_ID_SECONDARY_TDM_TX_3:
  705. case AFE_PORT_ID_SECONDARY_TDM_RX_4:
  706. case AFE_PORT_ID_SECONDARY_TDM_TX_4:
  707. case AFE_PORT_ID_SECONDARY_TDM_RX_5:
  708. case AFE_PORT_ID_SECONDARY_TDM_TX_5:
  709. case AFE_PORT_ID_SECONDARY_TDM_RX_6:
  710. case AFE_PORT_ID_SECONDARY_TDM_TX_6:
  711. case AFE_PORT_ID_SECONDARY_TDM_RX_7:
  712. case AFE_PORT_ID_SECONDARY_TDM_TX_7:
  713. case AFE_PORT_ID_TERTIARY_TDM_RX:
  714. case AFE_PORT_ID_TERTIARY_TDM_TX:
  715. case AFE_PORT_ID_TERTIARY_TDM_RX_1:
  716. case AFE_PORT_ID_TERTIARY_TDM_TX_1:
  717. case AFE_PORT_ID_TERTIARY_TDM_RX_2:
  718. case AFE_PORT_ID_TERTIARY_TDM_TX_2:
  719. case AFE_PORT_ID_TERTIARY_TDM_RX_3:
  720. case AFE_PORT_ID_TERTIARY_TDM_TX_3:
  721. case AFE_PORT_ID_TERTIARY_TDM_RX_4:
  722. case AFE_PORT_ID_TERTIARY_TDM_TX_4:
  723. case AFE_PORT_ID_TERTIARY_TDM_RX_5:
  724. case AFE_PORT_ID_TERTIARY_TDM_TX_5:
  725. case AFE_PORT_ID_TERTIARY_TDM_RX_6:
  726. case AFE_PORT_ID_TERTIARY_TDM_TX_6:
  727. case AFE_PORT_ID_TERTIARY_TDM_RX_7:
  728. case AFE_PORT_ID_TERTIARY_TDM_TX_7:
  729. case AFE_PORT_ID_QUATERNARY_TDM_RX:
  730. case AFE_PORT_ID_QUATERNARY_TDM_TX:
  731. case AFE_PORT_ID_QUATERNARY_TDM_RX_1:
  732. case AFE_PORT_ID_QUATERNARY_TDM_TX_1:
  733. case AFE_PORT_ID_QUATERNARY_TDM_RX_2:
  734. case AFE_PORT_ID_QUATERNARY_TDM_TX_2:
  735. case AFE_PORT_ID_QUATERNARY_TDM_RX_3:
  736. case AFE_PORT_ID_QUATERNARY_TDM_TX_3:
  737. case AFE_PORT_ID_QUATERNARY_TDM_RX_4:
  738. case AFE_PORT_ID_QUATERNARY_TDM_TX_4:
  739. case AFE_PORT_ID_QUATERNARY_TDM_RX_5:
  740. case AFE_PORT_ID_QUATERNARY_TDM_TX_5:
  741. case AFE_PORT_ID_QUATERNARY_TDM_RX_6:
  742. case AFE_PORT_ID_QUATERNARY_TDM_TX_6:
  743. case AFE_PORT_ID_QUATERNARY_TDM_RX_7:
  744. case AFE_PORT_ID_QUATERNARY_TDM_TX_7:
  745. case AFE_PORT_ID_QUINARY_TDM_RX:
  746. case AFE_PORT_ID_QUINARY_TDM_TX:
  747. case AFE_PORT_ID_QUINARY_TDM_RX_1:
  748. case AFE_PORT_ID_QUINARY_TDM_TX_1:
  749. case AFE_PORT_ID_QUINARY_TDM_RX_2:
  750. case AFE_PORT_ID_QUINARY_TDM_TX_2:
  751. case AFE_PORT_ID_QUINARY_TDM_RX_3:
  752. case AFE_PORT_ID_QUINARY_TDM_TX_3:
  753. case AFE_PORT_ID_QUINARY_TDM_RX_4:
  754. case AFE_PORT_ID_QUINARY_TDM_TX_4:
  755. case AFE_PORT_ID_QUINARY_TDM_RX_5:
  756. case AFE_PORT_ID_QUINARY_TDM_TX_5:
  757. case AFE_PORT_ID_QUINARY_TDM_RX_6:
  758. case AFE_PORT_ID_QUINARY_TDM_TX_6:
  759. case AFE_PORT_ID_QUINARY_TDM_RX_7:
  760. case AFE_PORT_ID_QUINARY_TDM_TX_7:
  761. case AFE_PORT_ID_SENARY_MI2S_TX:
  762. case AFE_PORT_ID_INT0_MI2S_RX:
  763. case AFE_PORT_ID_INT0_MI2S_TX:
  764. case AFE_PORT_ID_INT1_MI2S_RX:
  765. case AFE_PORT_ID_INT1_MI2S_TX:
  766. case AFE_PORT_ID_INT2_MI2S_RX:
  767. case AFE_PORT_ID_INT2_MI2S_TX:
  768. case AFE_PORT_ID_INT3_MI2S_RX:
  769. case AFE_PORT_ID_INT3_MI2S_TX:
  770. case AFE_PORT_ID_INT4_MI2S_RX:
  771. case AFE_PORT_ID_INT4_MI2S_TX:
  772. case AFE_PORT_ID_INT5_MI2S_RX:
  773. case AFE_PORT_ID_INT5_MI2S_TX:
  774. case AFE_PORT_ID_INT6_MI2S_RX:
  775. case AFE_PORT_ID_INT6_MI2S_TX:
  776. case AFE_PORT_ID_WSA_CODEC_DMA_RX_0:
  777. case AFE_PORT_ID_WSA_CODEC_DMA_TX_0:
  778. case AFE_PORT_ID_WSA_CODEC_DMA_RX_1:
  779. case AFE_PORT_ID_WSA_CODEC_DMA_TX_1:
  780. case AFE_PORT_ID_WSA_CODEC_DMA_TX_2:
  781. case AFE_PORT_ID_VA_CODEC_DMA_TX_0:
  782. case AFE_PORT_ID_VA_CODEC_DMA_TX_1:
  783. case AFE_PORT_ID_PRIMARY_SPDIF_RX:
  784. case AFE_PORT_ID_PRIMARY_SPDIF_TX:
  785. case AFE_PORT_ID_SECONDARY_SPDIF_RX:
  786. case AFE_PORT_ID_SECONDARY_SPDIF_TX:
  787. break;
  788. default:
  789. ret = -EINVAL;
  790. }
  791. return ret;
  792. }
  793. /**
  794. * q6audio_validate_port -
  795. * validates port id
  796. *
  797. * @port_id: port id to validate
  798. *
  799. * Returns 0 on success or error on invalid port
  800. */
  801. int q6audio_validate_port(u16 port_id)
  802. {
  803. int ret;
  804. switch (port_id) {
  805. case PRIMARY_I2S_RX:
  806. case PRIMARY_I2S_TX:
  807. case AFE_PORT_ID_PRIMARY_PCM_RX:
  808. case AFE_PORT_ID_PRIMARY_PCM_TX:
  809. case AFE_PORT_ID_SECONDARY_PCM_RX:
  810. case AFE_PORT_ID_SECONDARY_PCM_TX:
  811. case AFE_PORT_ID_TERTIARY_PCM_RX:
  812. case AFE_PORT_ID_TERTIARY_PCM_TX:
  813. case AFE_PORT_ID_QUATERNARY_PCM_RX:
  814. case AFE_PORT_ID_QUATERNARY_PCM_TX:
  815. case AFE_PORT_ID_QUINARY_PCM_RX:
  816. case AFE_PORT_ID_QUINARY_PCM_TX:
  817. case SECONDARY_I2S_RX:
  818. case SECONDARY_I2S_TX:
  819. case MI2S_RX:
  820. case MI2S_TX:
  821. case HDMI_RX:
  822. case DISPLAY_PORT_RX:
  823. case RSVD_2:
  824. case RSVD_3:
  825. case DIGI_MIC_TX:
  826. case VOICE_RECORD_RX:
  827. case VOICE_RECORD_TX:
  828. case VOICE_PLAYBACK_TX:
  829. case VOICE2_PLAYBACK_TX:
  830. case SLIMBUS_0_RX:
  831. case SLIMBUS_0_TX:
  832. case SLIMBUS_1_RX:
  833. case SLIMBUS_1_TX:
  834. case SLIMBUS_2_RX:
  835. case SLIMBUS_2_TX:
  836. case SLIMBUS_3_RX:
  837. case SLIMBUS_3_TX:
  838. case SLIMBUS_4_RX:
  839. case SLIMBUS_4_TX:
  840. case SLIMBUS_5_RX:
  841. case SLIMBUS_5_TX:
  842. case SLIMBUS_6_RX:
  843. case SLIMBUS_6_TX:
  844. case SLIMBUS_7_RX:
  845. case SLIMBUS_7_TX:
  846. case SLIMBUS_8_RX:
  847. case SLIMBUS_8_TX:
  848. case INT_BT_SCO_RX:
  849. case INT_BT_SCO_TX:
  850. case INT_BT_A2DP_RX:
  851. case INT_FM_RX:
  852. case INT_FM_TX:
  853. case RT_PROXY_PORT_001_RX:
  854. case RT_PROXY_PORT_001_TX:
  855. case AFE_PORT_ID_PRIMARY_MI2S_RX:
  856. case AFE_PORT_ID_PRIMARY_MI2S_TX:
  857. case AFE_PORT_ID_QUATERNARY_MI2S_RX:
  858. case AFE_PORT_ID_QUATERNARY_MI2S_TX:
  859. case AFE_PORT_ID_SECONDARY_MI2S_RX:
  860. case AFE_PORT_ID_SECONDARY_MI2S_TX:
  861. case AFE_PORT_ID_PRIMARY_SPDIF_RX:
  862. case AFE_PORT_ID_PRIMARY_SPDIF_TX:
  863. case AFE_PORT_ID_SECONDARY_SPDIF_RX:
  864. case AFE_PORT_ID_SECONDARY_SPDIF_TX:
  865. case AFE_PORT_ID_TERTIARY_MI2S_RX:
  866. case AFE_PORT_ID_TERTIARY_MI2S_TX:
  867. case AFE_PORT_ID_QUINARY_MI2S_RX:
  868. case AFE_PORT_ID_QUINARY_MI2S_TX:
  869. case AFE_PORT_ID_SECONDARY_MI2S_RX_SD1:
  870. case AFE_PORT_ID_PRIMARY_TDM_RX:
  871. case AFE_PORT_ID_PRIMARY_TDM_TX:
  872. case AFE_PORT_ID_PRIMARY_TDM_RX_1:
  873. case AFE_PORT_ID_PRIMARY_TDM_TX_1:
  874. case AFE_PORT_ID_PRIMARY_TDM_RX_2:
  875. case AFE_PORT_ID_PRIMARY_TDM_TX_2:
  876. case AFE_PORT_ID_PRIMARY_TDM_RX_3:
  877. case AFE_PORT_ID_PRIMARY_TDM_TX_3:
  878. case AFE_PORT_ID_PRIMARY_TDM_RX_4:
  879. case AFE_PORT_ID_PRIMARY_TDM_TX_4:
  880. case AFE_PORT_ID_PRIMARY_TDM_RX_5:
  881. case AFE_PORT_ID_PRIMARY_TDM_TX_5:
  882. case AFE_PORT_ID_PRIMARY_TDM_RX_6:
  883. case AFE_PORT_ID_PRIMARY_TDM_TX_6:
  884. case AFE_PORT_ID_PRIMARY_TDM_RX_7:
  885. case AFE_PORT_ID_PRIMARY_TDM_TX_7:
  886. case AFE_PORT_ID_SECONDARY_TDM_RX:
  887. case AFE_PORT_ID_SECONDARY_TDM_TX:
  888. case AFE_PORT_ID_SECONDARY_TDM_RX_1:
  889. case AFE_PORT_ID_SECONDARY_TDM_TX_1:
  890. case AFE_PORT_ID_SECONDARY_TDM_RX_2:
  891. case AFE_PORT_ID_SECONDARY_TDM_TX_2:
  892. case AFE_PORT_ID_SECONDARY_TDM_RX_3:
  893. case AFE_PORT_ID_SECONDARY_TDM_TX_3:
  894. case AFE_PORT_ID_SECONDARY_TDM_RX_4:
  895. case AFE_PORT_ID_SECONDARY_TDM_TX_4:
  896. case AFE_PORT_ID_SECONDARY_TDM_RX_5:
  897. case AFE_PORT_ID_SECONDARY_TDM_TX_5:
  898. case AFE_PORT_ID_SECONDARY_TDM_RX_6:
  899. case AFE_PORT_ID_SECONDARY_TDM_TX_6:
  900. case AFE_PORT_ID_SECONDARY_TDM_RX_7:
  901. case AFE_PORT_ID_SECONDARY_TDM_TX_7:
  902. case AFE_PORT_ID_TERTIARY_TDM_RX:
  903. case AFE_PORT_ID_TERTIARY_TDM_TX:
  904. case AFE_PORT_ID_TERTIARY_TDM_RX_1:
  905. case AFE_PORT_ID_TERTIARY_TDM_TX_1:
  906. case AFE_PORT_ID_TERTIARY_TDM_RX_2:
  907. case AFE_PORT_ID_TERTIARY_TDM_TX_2:
  908. case AFE_PORT_ID_TERTIARY_TDM_RX_3:
  909. case AFE_PORT_ID_TERTIARY_TDM_TX_3:
  910. case AFE_PORT_ID_TERTIARY_TDM_RX_4:
  911. case AFE_PORT_ID_TERTIARY_TDM_TX_4:
  912. case AFE_PORT_ID_TERTIARY_TDM_RX_5:
  913. case AFE_PORT_ID_TERTIARY_TDM_TX_5:
  914. case AFE_PORT_ID_TERTIARY_TDM_RX_6:
  915. case AFE_PORT_ID_TERTIARY_TDM_TX_6:
  916. case AFE_PORT_ID_TERTIARY_TDM_RX_7:
  917. case AFE_PORT_ID_TERTIARY_TDM_TX_7:
  918. case AFE_PORT_ID_QUATERNARY_TDM_RX:
  919. case AFE_PORT_ID_QUATERNARY_TDM_TX:
  920. case AFE_PORT_ID_QUATERNARY_TDM_RX_1:
  921. case AFE_PORT_ID_QUATERNARY_TDM_TX_1:
  922. case AFE_PORT_ID_QUATERNARY_TDM_RX_2:
  923. case AFE_PORT_ID_QUATERNARY_TDM_TX_2:
  924. case AFE_PORT_ID_QUATERNARY_TDM_RX_3:
  925. case AFE_PORT_ID_QUATERNARY_TDM_TX_3:
  926. case AFE_PORT_ID_QUATERNARY_TDM_RX_4:
  927. case AFE_PORT_ID_QUATERNARY_TDM_TX_4:
  928. case AFE_PORT_ID_QUATERNARY_TDM_RX_5:
  929. case AFE_PORT_ID_QUATERNARY_TDM_TX_5:
  930. case AFE_PORT_ID_QUATERNARY_TDM_RX_6:
  931. case AFE_PORT_ID_QUATERNARY_TDM_TX_6:
  932. case AFE_PORT_ID_QUATERNARY_TDM_RX_7:
  933. case AFE_PORT_ID_QUATERNARY_TDM_TX_7:
  934. case AFE_PORT_ID_QUINARY_TDM_RX:
  935. case AFE_PORT_ID_QUINARY_TDM_TX:
  936. case AFE_PORT_ID_QUINARY_TDM_RX_1:
  937. case AFE_PORT_ID_QUINARY_TDM_TX_1:
  938. case AFE_PORT_ID_QUINARY_TDM_RX_2:
  939. case AFE_PORT_ID_QUINARY_TDM_TX_2:
  940. case AFE_PORT_ID_QUINARY_TDM_RX_3:
  941. case AFE_PORT_ID_QUINARY_TDM_TX_3:
  942. case AFE_PORT_ID_QUINARY_TDM_RX_4:
  943. case AFE_PORT_ID_QUINARY_TDM_TX_4:
  944. case AFE_PORT_ID_QUINARY_TDM_RX_5:
  945. case AFE_PORT_ID_QUINARY_TDM_TX_5:
  946. case AFE_PORT_ID_QUINARY_TDM_RX_6:
  947. case AFE_PORT_ID_QUINARY_TDM_TX_6:
  948. case AFE_PORT_ID_QUINARY_TDM_RX_7:
  949. case AFE_PORT_ID_QUINARY_TDM_TX_7:
  950. case AFE_PORT_ID_SENARY_MI2S_TX:
  951. case AFE_PORT_ID_USB_RX:
  952. case AFE_PORT_ID_USB_TX:
  953. case AFE_PORT_ID_INT0_MI2S_RX:
  954. case AFE_PORT_ID_INT0_MI2S_TX:
  955. case AFE_PORT_ID_INT1_MI2S_RX:
  956. case AFE_PORT_ID_INT1_MI2S_TX:
  957. case AFE_PORT_ID_INT2_MI2S_RX:
  958. case AFE_PORT_ID_INT2_MI2S_TX:
  959. case AFE_PORT_ID_INT3_MI2S_RX:
  960. case AFE_PORT_ID_INT3_MI2S_TX:
  961. case AFE_PORT_ID_INT4_MI2S_RX:
  962. case AFE_PORT_ID_INT4_MI2S_TX:
  963. case AFE_PORT_ID_INT5_MI2S_RX:
  964. case AFE_PORT_ID_INT5_MI2S_TX:
  965. case AFE_PORT_ID_INT6_MI2S_RX:
  966. case AFE_PORT_ID_INT6_MI2S_TX:
  967. case AFE_PORT_ID_WSA_CODEC_DMA_RX_0:
  968. case AFE_PORT_ID_WSA_CODEC_DMA_TX_0:
  969. case AFE_PORT_ID_WSA_CODEC_DMA_RX_1:
  970. case AFE_PORT_ID_WSA_CODEC_DMA_TX_1:
  971. case AFE_PORT_ID_WSA_CODEC_DMA_TX_2:
  972. case AFE_PORT_ID_VA_CODEC_DMA_TX_0:
  973. case AFE_PORT_ID_VA_CODEC_DMA_TX_1:
  974. {
  975. ret = 0;
  976. break;
  977. }
  978. default:
  979. ret = -EINVAL;
  980. }
  981. return ret;
  982. }
  983. EXPORT_SYMBOL(q6audio_validate_port);