sdm660-ext-dai-links.c 59 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038
  1. /* Copyright (c) 2015-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. #include <linux/mfd/wcd9xxx/core.h>
  13. #include <linux/of.h>
  14. #include <sound/core.h>
  15. #include <sound/soc.h>
  16. #include <sound/soc-dapm.h>
  17. #include <sound/pcm.h>
  18. #include <sound/pcm_params.h>
  19. #include "qdsp6v2/msm-pcm-routing-v2.h"
  20. #include "../codecs/wcd9335.h"
  21. #include "sdm660-common.h"
  22. #include "sdm660-external.h"
  23. #define DEV_NAME_STR_LEN 32
  24. #define __CHIPSET__ "SDM660 "
  25. #define MSM_DAILINK_NAME(name) (__CHIPSET__#name)
  26. #define WCN_CDC_SLIM_RX_CH_MAX 2
  27. #define WCN_CDC_SLIM_TX_CH_MAX 3
  28. static struct snd_soc_card snd_soc_card_msm_card_tavil;
  29. static struct snd_soc_card snd_soc_card_msm_card_tasha;
  30. static struct snd_soc_ops msm_ext_slimbus_be_ops = {
  31. .hw_params = msm_snd_hw_params,
  32. };
  33. static struct snd_soc_ops msm_ext_cpe_ops = {
  34. .hw_params = msm_snd_cpe_hw_params,
  35. };
  36. static struct snd_soc_ops msm_ext_slimbus_2_be_ops = {
  37. .hw_params = msm_ext_slimbus_2_hw_params,
  38. };
  39. static struct snd_soc_ops msm_mi2s_be_ops = {
  40. .startup = msm_mi2s_snd_startup,
  41. .shutdown = msm_mi2s_snd_shutdown,
  42. };
  43. static struct snd_soc_ops msm_aux_pcm_be_ops = {
  44. .startup = msm_aux_pcm_snd_startup,
  45. .shutdown = msm_aux_pcm_snd_shutdown,
  46. };
  47. static int msm_wcn_init(struct snd_soc_pcm_runtime *rtd)
  48. {
  49. unsigned int rx_ch[WCN_CDC_SLIM_RX_CH_MAX] = {157, 158};
  50. unsigned int tx_ch[WCN_CDC_SLIM_TX_CH_MAX] = {159, 160, 161};
  51. struct snd_soc_dai *codec_dai = rtd->codec_dai;
  52. return snd_soc_dai_set_channel_map(codec_dai, ARRAY_SIZE(tx_ch),
  53. tx_ch, ARRAY_SIZE(rx_ch), rx_ch);
  54. }
  55. static int msm_wcn_hw_params(struct snd_pcm_substream *substream,
  56. struct snd_pcm_hw_params *params)
  57. {
  58. struct snd_soc_pcm_runtime *rtd = substream->private_data;
  59. struct snd_soc_dai *codec_dai = rtd->codec_dai;
  60. struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
  61. struct snd_soc_dai_link *dai_link = rtd->dai_link;
  62. u32 rx_ch[WCN_CDC_SLIM_RX_CH_MAX], tx_ch[WCN_CDC_SLIM_TX_CH_MAX];
  63. u32 rx_ch_cnt = 0, tx_ch_cnt = 0;
  64. int ret;
  65. dev_dbg(rtd->dev, "%s: %s_tx_dai_id_%d\n", __func__,
  66. codec_dai->name, codec_dai->id);
  67. ret = snd_soc_dai_get_channel_map(codec_dai,
  68. &tx_ch_cnt, tx_ch, &rx_ch_cnt, rx_ch);
  69. if (ret) {
  70. dev_err(rtd->dev,
  71. "%s: failed to get BTFM codec chan map\n, err:%d\n",
  72. __func__, ret);
  73. goto exit;
  74. }
  75. dev_dbg(rtd->dev, "%s: tx_ch_cnt(%d) id %d\n",
  76. __func__, tx_ch_cnt, dai_link->id);
  77. ret = snd_soc_dai_set_channel_map(cpu_dai,
  78. tx_ch_cnt, tx_ch, rx_ch_cnt, rx_ch);
  79. if (ret)
  80. dev_err(rtd->dev, "%s: failed to set cpu chan map, err:%d\n",
  81. __func__, ret);
  82. exit:
  83. return ret;
  84. }
  85. static struct snd_soc_ops msm_wcn_ops = {
  86. .hw_params = msm_wcn_hw_params,
  87. };
  88. /*TDM default offset currently only supporting TDM_RX_0 and TDM_TX_0 */
  89. static unsigned int tdm_slot_offset[TDM_PORT_MAX][TDM_SLOT_OFFSET_MAX] = {
  90. {0, 4, 8, 12, 16, 20, 24, 28},/* TX_0 | RX_0 */
  91. {AFE_SLOT_MAPPING_OFFSET_INVALID},/* TX_1 | RX_1 */
  92. {AFE_SLOT_MAPPING_OFFSET_INVALID},/* TX_2 | RX_2 */
  93. {AFE_SLOT_MAPPING_OFFSET_INVALID},/* TX_3 | RX_3 */
  94. {AFE_SLOT_MAPPING_OFFSET_INVALID},/* TX_4 | RX_4 */
  95. {AFE_SLOT_MAPPING_OFFSET_INVALID},/* TX_5 | RX_5 */
  96. {AFE_SLOT_MAPPING_OFFSET_INVALID},/* TX_6 | RX_6 */
  97. {AFE_SLOT_MAPPING_OFFSET_INVALID},/* TX_7 | RX_7 */
  98. };
  99. static unsigned int tdm_param_set_slot_mask(u16 port_id, int slot_width,
  100. int slots)
  101. {
  102. unsigned int slot_mask = 0;
  103. int i, j;
  104. unsigned int *slot_offset;
  105. for (i = TDM_0; i < TDM_PORT_MAX; i++) {
  106. slot_offset = tdm_slot_offset[i];
  107. for (j = 0; j < TDM_SLOT_OFFSET_MAX; j++) {
  108. if (slot_offset[j] != AFE_SLOT_MAPPING_OFFSET_INVALID)
  109. slot_mask |=
  110. (1 << ((slot_offset[j] * 8) / slot_width));
  111. else
  112. break;
  113. }
  114. }
  115. return slot_mask;
  116. }
  117. static int msm_tdm_snd_hw_params(struct snd_pcm_substream *substream,
  118. struct snd_pcm_hw_params *params)
  119. {
  120. struct snd_soc_pcm_runtime *rtd = substream->private_data;
  121. struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
  122. int ret = 0;
  123. int channels, slot_width, slots;
  124. unsigned int slot_mask;
  125. unsigned int *slot_offset;
  126. int offset_channels = 0;
  127. int i;
  128. pr_debug("%s: dai id = 0x%x\n", __func__, cpu_dai->id);
  129. channels = params_channels(params);
  130. switch (channels) {
  131. case 1:
  132. case 2:
  133. case 3:
  134. case 4:
  135. case 5:
  136. case 6:
  137. case 7:
  138. case 8:
  139. switch (params_format(params)) {
  140. case SNDRV_PCM_FORMAT_S32_LE:
  141. case SNDRV_PCM_FORMAT_S24_LE:
  142. case SNDRV_PCM_FORMAT_S16_LE:
  143. /*
  144. * up to 8 channels HW config should
  145. * use 32 bit slot width for max support of
  146. * stream bit width. (slot_width > bit_width)
  147. */
  148. slot_width = 32;
  149. break;
  150. default:
  151. pr_err("%s: invalid param format 0x%x\n",
  152. __func__, params_format(params));
  153. return -EINVAL;
  154. }
  155. slots = 8;
  156. slot_mask = tdm_param_set_slot_mask(cpu_dai->id,
  157. slot_width,
  158. slots);
  159. if (!slot_mask) {
  160. pr_err("%s: invalid slot_mask 0x%x\n",
  161. __func__, slot_mask);
  162. return -EINVAL;
  163. }
  164. break;
  165. default:
  166. pr_err("%s: invalid param channels %d\n",
  167. __func__, channels);
  168. return -EINVAL;
  169. }
  170. /* currently only supporting TDM_RX_0 and TDM_TX_0 */
  171. switch (cpu_dai->id) {
  172. case AFE_PORT_ID_PRIMARY_TDM_RX:
  173. case AFE_PORT_ID_SECONDARY_TDM_RX:
  174. case AFE_PORT_ID_TERTIARY_TDM_RX:
  175. case AFE_PORT_ID_QUATERNARY_TDM_RX:
  176. case AFE_PORT_ID_PRIMARY_TDM_TX:
  177. case AFE_PORT_ID_SECONDARY_TDM_TX:
  178. case AFE_PORT_ID_TERTIARY_TDM_TX:
  179. case AFE_PORT_ID_QUATERNARY_TDM_TX:
  180. slot_offset = tdm_slot_offset[TDM_0];
  181. break;
  182. default:
  183. pr_err("%s: dai id 0x%x not supported\n",
  184. __func__, cpu_dai->id);
  185. return -EINVAL;
  186. }
  187. for (i = 0; i < TDM_SLOT_OFFSET_MAX; i++) {
  188. if (slot_offset[i] != AFE_SLOT_MAPPING_OFFSET_INVALID)
  189. offset_channels++;
  190. else
  191. break;
  192. }
  193. if (offset_channels == 0) {
  194. pr_err("%s: slot offset not supported, offset_channels %d\n",
  195. __func__, offset_channels);
  196. return -EINVAL;
  197. }
  198. if (channels > offset_channels) {
  199. pr_err("%s: channels %d exceed offset_channels %d\n",
  200. __func__, channels, offset_channels);
  201. return -EINVAL;
  202. }
  203. if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
  204. ret = snd_soc_dai_set_tdm_slot(cpu_dai, 0, slot_mask,
  205. slots, slot_width);
  206. if (ret < 0) {
  207. pr_err("%s: failed to set tdm slot, err:%d\n",
  208. __func__, ret);
  209. goto end;
  210. }
  211. ret = snd_soc_dai_set_channel_map(cpu_dai, 0, NULL,
  212. channels, slot_offset);
  213. if (ret < 0) {
  214. pr_err("%s: failed to set channel map, err:%d\n",
  215. __func__, ret);
  216. goto end;
  217. }
  218. } else {
  219. ret = snd_soc_dai_set_tdm_slot(cpu_dai, slot_mask, 0,
  220. slots, slot_width);
  221. if (ret < 0) {
  222. pr_err("%s: failed to set tdm slot, err:%d\n",
  223. __func__, ret);
  224. goto end;
  225. }
  226. ret = snd_soc_dai_set_channel_map(cpu_dai, channels,
  227. slot_offset, 0, NULL);
  228. if (ret < 0) {
  229. pr_err("%s: failed to set channel map, err:%d\n",
  230. __func__, ret);
  231. goto end;
  232. }
  233. }
  234. end:
  235. return ret;
  236. }
  237. static struct snd_soc_ops msm_tdm_be_ops = {
  238. .hw_params = msm_tdm_snd_hw_params
  239. };
  240. static struct snd_soc_dai_link msm_ext_tasha_fe_dai[] = {
  241. /* tasha_vifeedback for speaker protection */
  242. {
  243. .name = LPASS_BE_SLIMBUS_4_TX,
  244. .stream_name = "Slimbus4 Capture",
  245. .cpu_dai_name = "msm-dai-q6-dev.16393",
  246. .platform_name = "msm-pcm-hostless",
  247. .codec_name = "tasha_codec",
  248. .codec_dai_name = "tasha_vifeedback",
  249. .id = MSM_BACKEND_DAI_SLIMBUS_4_TX,
  250. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  251. .ops = &msm_ext_slimbus_be_ops,
  252. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  253. .ignore_suspend = 1,
  254. },
  255. /* Ultrasound RX DAI Link */
  256. {
  257. .name = "SLIMBUS_2 Hostless Playback",
  258. .stream_name = "SLIMBUS_2 Hostless Playback",
  259. .cpu_dai_name = "msm-dai-q6-dev.16388",
  260. .platform_name = "msm-pcm-hostless",
  261. .codec_name = "tasha_codec",
  262. .codec_dai_name = "tasha_rx2",
  263. .ignore_suspend = 1,
  264. .dpcm_playback = 1,
  265. .dpcm_capture = 1,
  266. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  267. .ops = &msm_ext_slimbus_2_be_ops,
  268. },
  269. /* Ultrasound TX DAI Link */
  270. {
  271. .name = "SLIMBUS_2 Hostless Capture",
  272. .stream_name = "SLIMBUS_2 Hostless Capture",
  273. .cpu_dai_name = "msm-dai-q6-dev.16389",
  274. .platform_name = "msm-pcm-hostless",
  275. .codec_name = "tasha_codec",
  276. .codec_dai_name = "tasha_tx2",
  277. .ignore_suspend = 1,
  278. .dpcm_capture = 1,
  279. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  280. .ops = &msm_ext_slimbus_2_be_ops,
  281. },
  282. /* CPE LSM direct dai-link */
  283. {
  284. .name = "CPE Listen service",
  285. .stream_name = "CPE Listen Audio Service",
  286. .cpu_dai_name = "msm-dai-slim",
  287. .platform_name = "msm-cpe-lsm",
  288. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  289. SND_SOC_DPCM_TRIGGER_POST},
  290. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  291. .ignore_suspend = 1,
  292. .dpcm_capture = 1,
  293. .ignore_pmdown_time = 1,
  294. .codec_dai_name = "tasha_mad1",
  295. .codec_name = "tasha_codec",
  296. .ops = &msm_ext_cpe_ops,
  297. },
  298. {
  299. .name = "SLIMBUS_6 Hostless Playback",
  300. .stream_name = "SLIMBUS_6 Hostless",
  301. .cpu_dai_name = "SLIMBUS6_HOSTLESS",
  302. .platform_name = "msm-pcm-hostless",
  303. .dynamic = 1,
  304. .dpcm_playback = 1,
  305. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  306. SND_SOC_DPCM_TRIGGER_POST},
  307. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  308. .ignore_suspend = 1,
  309. /* this dailink has playback support */
  310. .ignore_pmdown_time = 1,
  311. .codec_dai_name = "snd-soc-dummy-dai",
  312. .codec_name = "snd-soc-dummy",
  313. },
  314. /* CPE LSM EC PP direct dai-link */
  315. {
  316. .name = "CPE Listen service ECPP",
  317. .stream_name = "CPE Listen Audio Service ECPP",
  318. .cpu_dai_name = "CPE_LSM_NOHOST",
  319. .platform_name = "msm-cpe-lsm.3",
  320. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  321. SND_SOC_DPCM_TRIGGER_POST},
  322. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  323. .ignore_suspend = 1,
  324. .ignore_pmdown_time = 1,
  325. .codec_dai_name = "tasha_cpe",
  326. .codec_name = "tasha_codec",
  327. },
  328. };
  329. static struct snd_soc_dai_link msm_ext_tavil_fe_dai[] = {
  330. {
  331. .name = LPASS_BE_SLIMBUS_4_TX,
  332. .stream_name = "Slimbus4 Capture",
  333. .cpu_dai_name = "msm-dai-q6-dev.16393",
  334. .platform_name = "msm-pcm-hostless",
  335. .codec_name = "tavil_codec",
  336. .codec_dai_name = "tavil_vifeedback",
  337. .id = MSM_BACKEND_DAI_SLIMBUS_4_TX,
  338. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  339. .ops = &msm_ext_slimbus_be_ops,
  340. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  341. .ignore_suspend = 1,
  342. },
  343. /* Ultrasound RX DAI Link */
  344. {
  345. .name = "SLIMBUS_2 Hostless Playback",
  346. .stream_name = "SLIMBUS_2 Hostless Playback",
  347. .cpu_dai_name = "msm-dai-q6-dev.16388",
  348. .platform_name = "msm-pcm-hostless",
  349. .codec_name = "tavil_codec",
  350. .codec_dai_name = "tavil_rx2",
  351. .ignore_suspend = 1,
  352. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  353. .ops = &msm_ext_slimbus_2_be_ops,
  354. },
  355. /* Ultrasound TX DAI Link */
  356. {
  357. .name = "SLIMBUS_2 Hostless Capture",
  358. .stream_name = "SLIMBUS_2 Hostless Capture",
  359. .cpu_dai_name = "msm-dai-q6-dev.16389",
  360. .platform_name = "msm-pcm-hostless",
  361. .codec_name = "tavil_codec",
  362. .codec_dai_name = "tavil_tx2",
  363. .ignore_suspend = 1,
  364. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  365. .ops = &msm_ext_slimbus_2_be_ops,
  366. },
  367. };
  368. static struct snd_soc_dai_link msm_ext_tasha_be_dai[] = {
  369. /* Backend DAI Links */
  370. {
  371. .name = LPASS_BE_SLIMBUS_0_RX,
  372. .stream_name = "Slimbus Playback",
  373. .cpu_dai_name = "msm-dai-q6-dev.16384",
  374. .platform_name = "msm-pcm-routing",
  375. .codec_name = "tasha_codec",
  376. .codec_dai_name = "tasha_mix_rx1",
  377. .no_pcm = 1,
  378. .dpcm_playback = 1,
  379. .id = MSM_BACKEND_DAI_SLIMBUS_0_RX,
  380. .init = &msm_audrx_init,
  381. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  382. /* this dainlink has playback support */
  383. .ignore_pmdown_time = 1,
  384. .ignore_suspend = 1,
  385. .ops = &msm_ext_slimbus_be_ops,
  386. },
  387. {
  388. .name = LPASS_BE_SLIMBUS_0_TX,
  389. .stream_name = "Slimbus Capture",
  390. .cpu_dai_name = "msm-dai-q6-dev.16385",
  391. .platform_name = "msm-pcm-routing",
  392. .codec_name = "tasha_codec",
  393. .codec_dai_name = "tasha_tx1",
  394. .no_pcm = 1,
  395. .dpcm_capture = 1,
  396. .id = MSM_BACKEND_DAI_SLIMBUS_0_TX,
  397. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  398. .ignore_suspend = 1,
  399. .ops = &msm_ext_slimbus_be_ops,
  400. },
  401. {
  402. .name = LPASS_BE_SLIMBUS_1_RX,
  403. .stream_name = "Slimbus1 Playback",
  404. .cpu_dai_name = "msm-dai-q6-dev.16386",
  405. .platform_name = "msm-pcm-routing",
  406. .codec_name = "tasha_codec",
  407. .codec_dai_name = "tasha_mix_rx1",
  408. .no_pcm = 1,
  409. .dpcm_playback = 1,
  410. .id = MSM_BACKEND_DAI_SLIMBUS_1_RX,
  411. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  412. .ops = &msm_ext_slimbus_be_ops,
  413. /* dai link has playback support */
  414. .ignore_pmdown_time = 1,
  415. .ignore_suspend = 1,
  416. },
  417. {
  418. .name = LPASS_BE_SLIMBUS_1_TX,
  419. .stream_name = "Slimbus1 Capture",
  420. .cpu_dai_name = "msm-dai-q6-dev.16387",
  421. .platform_name = "msm-pcm-routing",
  422. .codec_name = "tasha_codec",
  423. .codec_dai_name = "tasha_tx3",
  424. .no_pcm = 1,
  425. .dpcm_capture = 1,
  426. .id = MSM_BACKEND_DAI_SLIMBUS_1_TX,
  427. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  428. .ops = &msm_ext_slimbus_be_ops,
  429. .ignore_suspend = 1,
  430. },
  431. {
  432. .name = LPASS_BE_SLIMBUS_3_RX,
  433. .stream_name = "Slimbus3 Playback",
  434. .cpu_dai_name = "msm-dai-q6-dev.16390",
  435. .platform_name = "msm-pcm-routing",
  436. .codec_name = "tasha_codec",
  437. .codec_dai_name = "tasha_mix_rx1",
  438. .no_pcm = 1,
  439. .dpcm_playback = 1,
  440. .id = MSM_BACKEND_DAI_SLIMBUS_3_RX,
  441. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  442. .ops = &msm_ext_slimbus_be_ops,
  443. /* dai link has playback support */
  444. .ignore_pmdown_time = 1,
  445. .ignore_suspend = 1,
  446. },
  447. {
  448. .name = LPASS_BE_SLIMBUS_3_TX,
  449. .stream_name = "Slimbus3 Capture",
  450. .cpu_dai_name = "msm-dai-q6-dev.16391",
  451. .platform_name = "msm-pcm-routing",
  452. .codec_name = "tasha_codec",
  453. .codec_dai_name = "tasha_tx1",
  454. .no_pcm = 1,
  455. .dpcm_capture = 1,
  456. .dpcm_playback = 1,
  457. .id = MSM_BACKEND_DAI_SLIMBUS_3_TX,
  458. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  459. .ops = &msm_ext_slimbus_be_ops,
  460. .ignore_suspend = 1,
  461. },
  462. {
  463. .name = LPASS_BE_SLIMBUS_4_RX,
  464. .stream_name = "Slimbus4 Playback",
  465. .cpu_dai_name = "msm-dai-q6-dev.16392",
  466. .platform_name = "msm-pcm-routing",
  467. .codec_name = "tasha_codec",
  468. .codec_dai_name = "tasha_mix_rx1",
  469. .no_pcm = 1,
  470. .dpcm_playback = 1,
  471. .id = MSM_BACKEND_DAI_SLIMBUS_4_RX,
  472. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  473. .ops = &msm_ext_slimbus_be_ops,
  474. /* dai link has playback support */
  475. .ignore_pmdown_time = 1,
  476. .ignore_suspend = 1,
  477. },
  478. {
  479. .name = LPASS_BE_SLIMBUS_5_RX,
  480. .stream_name = "Slimbus5 Playback",
  481. .cpu_dai_name = "msm-dai-q6-dev.16394",
  482. .platform_name = "msm-pcm-routing",
  483. .codec_name = "tasha_codec",
  484. .codec_dai_name = "tasha_rx3",
  485. .no_pcm = 1,
  486. .dpcm_playback = 1,
  487. .id = MSM_BACKEND_DAI_SLIMBUS_5_RX,
  488. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  489. .ops = &msm_ext_slimbus_be_ops,
  490. /* dai link has playback support */
  491. .ignore_pmdown_time = 1,
  492. .ignore_suspend = 1,
  493. },
  494. /* MAD BE */
  495. {
  496. .name = LPASS_BE_SLIMBUS_5_TX,
  497. .stream_name = "Slimbus5 Capture",
  498. .cpu_dai_name = "msm-dai-q6-dev.16395",
  499. .platform_name = "msm-pcm-routing",
  500. .codec_name = "tasha_codec",
  501. .codec_dai_name = "tasha_mad1",
  502. .no_pcm = 1,
  503. .dpcm_capture = 1,
  504. .id = MSM_BACKEND_DAI_SLIMBUS_5_TX,
  505. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  506. .ops = &msm_ext_slimbus_be_ops,
  507. .ignore_suspend = 1,
  508. },
  509. {
  510. .name = LPASS_BE_SLIMBUS_6_RX,
  511. .stream_name = "Slimbus6 Playback",
  512. .cpu_dai_name = "msm-dai-q6-dev.16396",
  513. .platform_name = "msm-pcm-routing",
  514. .codec_name = "tasha_codec",
  515. .codec_dai_name = "tasha_rx4",
  516. .no_pcm = 1,
  517. .dpcm_playback = 1,
  518. .id = MSM_BACKEND_DAI_SLIMBUS_6_RX,
  519. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  520. .ops = &msm_ext_slimbus_be_ops,
  521. /* dai link has playback support */
  522. .ignore_pmdown_time = 1,
  523. .ignore_suspend = 1,
  524. },
  525. };
  526. static struct snd_soc_dai_link msm_ext_tavil_be_dai[] = {
  527. {
  528. .name = LPASS_BE_SLIMBUS_0_RX,
  529. .stream_name = "Slimbus Playback",
  530. .cpu_dai_name = "msm-dai-q6-dev.16384",
  531. .platform_name = "msm-pcm-routing",
  532. .codec_name = "tavil_codec",
  533. .codec_dai_name = "tavil_rx1",
  534. .no_pcm = 1,
  535. .dpcm_playback = 1,
  536. .id = MSM_BACKEND_DAI_SLIMBUS_0_RX,
  537. .init = &msm_audrx_init,
  538. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  539. /* this dainlink has playback support */
  540. .ignore_pmdown_time = 1,
  541. .ignore_suspend = 1,
  542. .ops = &msm_ext_slimbus_be_ops,
  543. },
  544. {
  545. .name = LPASS_BE_SLIMBUS_0_TX,
  546. .stream_name = "Slimbus Capture",
  547. .cpu_dai_name = "msm-dai-q6-dev.16385",
  548. .platform_name = "msm-pcm-routing",
  549. .codec_name = "tavil_codec",
  550. .codec_dai_name = "tavil_tx1",
  551. .no_pcm = 1,
  552. .dpcm_capture = 1,
  553. .id = MSM_BACKEND_DAI_SLIMBUS_0_TX,
  554. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  555. .ignore_suspend = 1,
  556. .ops = &msm_ext_slimbus_be_ops,
  557. },
  558. {
  559. .name = LPASS_BE_SLIMBUS_1_RX,
  560. .stream_name = "Slimbus1 Playback",
  561. .cpu_dai_name = "msm-dai-q6-dev.16386",
  562. .platform_name = "msm-pcm-routing",
  563. .codec_name = "tavil_codec",
  564. .codec_dai_name = "tavil_rx1",
  565. .no_pcm = 1,
  566. .dpcm_playback = 1,
  567. .id = MSM_BACKEND_DAI_SLIMBUS_1_RX,
  568. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  569. .ops = &msm_ext_slimbus_be_ops,
  570. /* dai link has playback support */
  571. .ignore_pmdown_time = 1,
  572. .ignore_suspend = 1,
  573. },
  574. {
  575. .name = LPASS_BE_SLIMBUS_1_TX,
  576. .stream_name = "Slimbus1 Capture",
  577. .cpu_dai_name = "msm-dai-q6-dev.16387",
  578. .platform_name = "msm-pcm-routing",
  579. .codec_name = "tavil_codec",
  580. .codec_dai_name = "tavil_tx3",
  581. .no_pcm = 1,
  582. .dpcm_capture = 1,
  583. .id = MSM_BACKEND_DAI_SLIMBUS_1_TX,
  584. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  585. .ops = &msm_ext_slimbus_be_ops,
  586. .ignore_suspend = 1,
  587. },
  588. {
  589. .name = LPASS_BE_SLIMBUS_2_RX,
  590. .stream_name = "Slimbus2 Playback",
  591. .cpu_dai_name = "msm-dai-q6-dev.16388",
  592. .platform_name = "msm-pcm-routing",
  593. .codec_name = "tavil_codec",
  594. .codec_dai_name = "tavil_rx2",
  595. .no_pcm = 1,
  596. .dpcm_playback = 1,
  597. .id = MSM_BACKEND_DAI_SLIMBUS_2_RX,
  598. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  599. .ops = &msm_ext_slimbus_be_ops,
  600. .ignore_pmdown_time = 1,
  601. .ignore_suspend = 1,
  602. },
  603. {
  604. .name = LPASS_BE_SLIMBUS_3_RX,
  605. .stream_name = "Slimbus3 Playback",
  606. .cpu_dai_name = "msm-dai-q6-dev.16390",
  607. .platform_name = "msm-pcm-routing",
  608. .codec_name = "tavil_codec",
  609. .codec_dai_name = "tavil_rx1",
  610. .no_pcm = 1,
  611. .dpcm_playback = 1,
  612. .id = MSM_BACKEND_DAI_SLIMBUS_3_RX,
  613. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  614. .ops = &msm_ext_slimbus_be_ops,
  615. /* dai link has playback support */
  616. .ignore_pmdown_time = 1,
  617. .ignore_suspend = 1,
  618. },
  619. {
  620. .name = LPASS_BE_SLIMBUS_3_TX,
  621. .stream_name = "Slimbus3 Capture",
  622. .cpu_dai_name = "msm-dai-q6-dev.16391",
  623. .platform_name = "msm-pcm-routing",
  624. .codec_name = "tavil_codec",
  625. .codec_dai_name = "tavil_tx1",
  626. .no_pcm = 1,
  627. .dpcm_capture = 1,
  628. .id = MSM_BACKEND_DAI_SLIMBUS_3_TX,
  629. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  630. .ops = &msm_ext_slimbus_be_ops,
  631. .ignore_suspend = 1,
  632. },
  633. {
  634. .name = LPASS_BE_SLIMBUS_4_RX,
  635. .stream_name = "Slimbus4 Playback",
  636. .cpu_dai_name = "msm-dai-q6-dev.16392",
  637. .platform_name = "msm-pcm-routing",
  638. .codec_name = "tavil_codec",
  639. .codec_dai_name = "tavil_rx1",
  640. .no_pcm = 1,
  641. .dpcm_playback = 1,
  642. .id = MSM_BACKEND_DAI_SLIMBUS_4_RX,
  643. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  644. .ops = &msm_ext_slimbus_be_ops,
  645. /* dai link has playback support */
  646. .ignore_pmdown_time = 1,
  647. .ignore_suspend = 1,
  648. },
  649. {
  650. .name = LPASS_BE_SLIMBUS_5_RX,
  651. .stream_name = "Slimbus5 Playback",
  652. .cpu_dai_name = "msm-dai-q6-dev.16394",
  653. .platform_name = "msm-pcm-routing",
  654. .codec_name = "tavil_codec",
  655. .codec_dai_name = "tavil_rx3",
  656. .no_pcm = 1,
  657. .dpcm_playback = 1,
  658. .id = MSM_BACKEND_DAI_SLIMBUS_5_RX,
  659. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  660. .ops = &msm_ext_slimbus_be_ops,
  661. /* dai link has playback support */
  662. .ignore_pmdown_time = 1,
  663. .ignore_suspend = 1,
  664. },
  665. /* MAD BE */
  666. {
  667. .name = LPASS_BE_SLIMBUS_5_TX,
  668. .stream_name = "Slimbus5 Capture",
  669. .cpu_dai_name = "msm-dai-q6-dev.16395",
  670. .platform_name = "msm-pcm-routing",
  671. .codec_name = "tavil_codec",
  672. .codec_dai_name = "tavil_mad1",
  673. .no_pcm = 1,
  674. .dpcm_capture = 1,
  675. .id = MSM_BACKEND_DAI_SLIMBUS_5_TX,
  676. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  677. .ops = &msm_ext_slimbus_be_ops,
  678. .ignore_suspend = 1,
  679. },
  680. {
  681. .name = LPASS_BE_SLIMBUS_6_RX,
  682. .stream_name = "Slimbus6 Playback",
  683. .cpu_dai_name = "msm-dai-q6-dev.16396",
  684. .platform_name = "msm-pcm-routing",
  685. .codec_name = "tavil_codec",
  686. .codec_dai_name = "tavil_rx4",
  687. .no_pcm = 1,
  688. .dpcm_playback = 1,
  689. .id = MSM_BACKEND_DAI_SLIMBUS_6_RX,
  690. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  691. .ops = &msm_ext_slimbus_be_ops,
  692. /* dai link has playback support */
  693. .ignore_pmdown_time = 1,
  694. .ignore_suspend = 1,
  695. },
  696. };
  697. static struct snd_soc_dai_link msm_ext_common_fe_dai[] = {
  698. /* FrontEnd DAI Links */
  699. {/* hw:x,0 */
  700. .name = MSM_DAILINK_NAME(Media1),
  701. .stream_name = "MultiMedia1",
  702. .cpu_dai_name = "MultiMedia1",
  703. .platform_name = "msm-pcm-dsp.0",
  704. .dynamic = 1,
  705. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  706. SND_SOC_DPCM_TRIGGER_POST},
  707. .codec_dai_name = "snd-soc-dummy-dai",
  708. .codec_name = "snd-soc-dummy",
  709. .ignore_suspend = 1,
  710. .dpcm_playback = 1,
  711. .dpcm_capture = 1,
  712. /* this dai link has playback support */
  713. .ignore_pmdown_time = 1,
  714. .id = MSM_FRONTEND_DAI_MULTIMEDIA1
  715. },
  716. {/* hw:x,1 */
  717. .name = MSM_DAILINK_NAME(Media2),
  718. .stream_name = "MultiMedia2",
  719. .cpu_dai_name = "MultiMedia2",
  720. .platform_name = "msm-pcm-dsp.0",
  721. .dynamic = 1,
  722. .dpcm_playback = 1,
  723. .dpcm_capture = 1,
  724. .codec_dai_name = "snd-soc-dummy-dai",
  725. .codec_name = "snd-soc-dummy",
  726. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  727. SND_SOC_DPCM_TRIGGER_POST},
  728. .ignore_suspend = 1,
  729. /* this dai link has playback support */
  730. .ignore_pmdown_time = 1,
  731. .id = MSM_FRONTEND_DAI_MULTIMEDIA2,
  732. },
  733. {/* hw:x,2 */
  734. .name = "VoiceMMode1",
  735. .stream_name = "VoiceMMode1",
  736. .cpu_dai_name = "VoiceMMode1",
  737. .platform_name = "msm-pcm-voice",
  738. .dynamic = 1,
  739. .dpcm_capture = 1,
  740. .dpcm_playback = 1,
  741. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  742. SND_SOC_DPCM_TRIGGER_POST},
  743. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  744. .ignore_suspend = 1,
  745. .ignore_pmdown_time = 1,
  746. .codec_dai_name = "snd-soc-dummy-dai",
  747. .codec_name = "snd-soc-dummy",
  748. .id = MSM_FRONTEND_DAI_VOICEMMODE1,
  749. },
  750. {/* hw:x,3 */
  751. .name = "MSM VoIP",
  752. .stream_name = "VoIP",
  753. .cpu_dai_name = "VoIP",
  754. .platform_name = "msm-voip-dsp",
  755. .dynamic = 1,
  756. .dpcm_playback = 1,
  757. .dpcm_capture = 1,
  758. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  759. SND_SOC_DPCM_TRIGGER_POST},
  760. .codec_dai_name = "snd-soc-dummy-dai",
  761. .codec_name = "snd-soc-dummy",
  762. .ignore_suspend = 1,
  763. /* this dai link has playback support */
  764. .ignore_pmdown_time = 1,
  765. .id = MSM_FRONTEND_DAI_VOIP,
  766. },
  767. {/* hw:x,4 */
  768. .name = MSM_DAILINK_NAME(ULL),
  769. .stream_name = "ULL",
  770. .cpu_dai_name = "MultiMedia3",
  771. .platform_name = "msm-pcm-dsp.2",
  772. .dynamic = 1,
  773. .dpcm_playback = 1,
  774. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  775. SND_SOC_DPCM_TRIGGER_POST},
  776. .codec_dai_name = "snd-soc-dummy-dai",
  777. .codec_name = "snd-soc-dummy",
  778. .ignore_suspend = 1,
  779. /* this dai link has playback support */
  780. .ignore_pmdown_time = 1,
  781. .id = MSM_FRONTEND_DAI_MULTIMEDIA3,
  782. },
  783. /* Hostless PCM purpose */
  784. {/* hw:x,5 */
  785. .name = "SLIMBUS_0 Hostless",
  786. .stream_name = "SLIMBUS_0 Hostless",
  787. .cpu_dai_name = "SLIMBUS0_HOSTLESS",
  788. .platform_name = "msm-pcm-hostless",
  789. .dynamic = 1,
  790. .dpcm_capture = 1,
  791. .dpcm_playback = 1,
  792. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  793. SND_SOC_DPCM_TRIGGER_POST},
  794. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  795. .ignore_suspend = 1,
  796. .ignore_pmdown_time = 1,
  797. /* This dai link has MI2S support */
  798. .codec_dai_name = "snd-soc-dummy-dai",
  799. .codec_name = "snd-soc-dummy",
  800. },
  801. {/* hw:x,6 */
  802. .name = "MSM AFE-PCM RX",
  803. .stream_name = "AFE-PROXY RX",
  804. .cpu_dai_name = "msm-dai-q6-dev.241",
  805. .codec_name = "msm-stub-codec.1",
  806. .codec_dai_name = "msm-stub-rx",
  807. .platform_name = "msm-pcm-afe",
  808. .ignore_suspend = 1,
  809. /* this dai link has playback support */
  810. .ignore_pmdown_time = 1,
  811. },
  812. {/* hw:x,7 */
  813. .name = "MSM AFE-PCM TX",
  814. .stream_name = "AFE-PROXY TX",
  815. .cpu_dai_name = "msm-dai-q6-dev.240",
  816. .codec_name = "msm-stub-codec.1",
  817. .codec_dai_name = "msm-stub-tx",
  818. .platform_name = "msm-pcm-afe",
  819. .ignore_suspend = 1,
  820. },
  821. {/* hw:x,8 */
  822. .name = MSM_DAILINK_NAME(Compress1),
  823. .stream_name = "Compress1",
  824. .cpu_dai_name = "MultiMedia4",
  825. .platform_name = "msm-compress-dsp",
  826. .async_ops = ASYNC_DPCM_SND_SOC_HW_PARAMS,
  827. .dynamic = 1,
  828. .dpcm_capture = 1,
  829. .dpcm_playback = 1,
  830. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  831. SND_SOC_DPCM_TRIGGER_POST},
  832. .codec_dai_name = "snd-soc-dummy-dai",
  833. .codec_name = "snd-soc-dummy",
  834. .ignore_suspend = 1,
  835. .ignore_pmdown_time = 1,
  836. /* this dai link has playback support */
  837. .id = MSM_FRONTEND_DAI_MULTIMEDIA4,
  838. },
  839. {/* hw:x,9*/
  840. .name = "AUXPCM Hostless",
  841. .stream_name = "AUXPCM Hostless",
  842. .cpu_dai_name = "AUXPCM_HOSTLESS",
  843. .platform_name = "msm-pcm-hostless",
  844. .dynamic = 1,
  845. .dpcm_capture = 1,
  846. .dpcm_playback = 1,
  847. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  848. SND_SOC_DPCM_TRIGGER_POST},
  849. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  850. .ignore_suspend = 1,
  851. /* this dai link has playback support */
  852. .ignore_pmdown_time = 1,
  853. .codec_dai_name = "snd-soc-dummy-dai",
  854. .codec_name = "snd-soc-dummy",
  855. },
  856. {/* hw:x,10 */
  857. .name = "SLIMBUS_1 Hostless",
  858. .stream_name = "SLIMBUS_1 Hostless",
  859. .cpu_dai_name = "SLIMBUS1_HOSTLESS",
  860. .platform_name = "msm-pcm-hostless",
  861. .dynamic = 1,
  862. .dpcm_capture = 1,
  863. .dpcm_playback = 1,
  864. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  865. SND_SOC_DPCM_TRIGGER_POST},
  866. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  867. .ignore_suspend = 1,
  868. .ignore_pmdown_time = 1, /* dai link has playback support */
  869. .codec_dai_name = "snd-soc-dummy-dai",
  870. .codec_name = "snd-soc-dummy",
  871. },
  872. {/* hw:x,11 */
  873. .name = "SLIMBUS_3 Hostless",
  874. .stream_name = "SLIMBUS_3 Hostless",
  875. .cpu_dai_name = "SLIMBUS3_HOSTLESS",
  876. .platform_name = "msm-pcm-hostless",
  877. .dynamic = 1,
  878. .dpcm_capture = 1,
  879. .dpcm_playback = 1,
  880. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  881. SND_SOC_DPCM_TRIGGER_POST},
  882. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  883. .ignore_suspend = 1,
  884. .ignore_pmdown_time = 1, /* dai link has playback support */
  885. .codec_dai_name = "snd-soc-dummy-dai",
  886. .codec_name = "snd-soc-dummy",
  887. },
  888. {/* hw:x,12 */
  889. .name = "SLIMBUS_4 Hostless",
  890. .stream_name = "SLIMBUS_4 Hostless",
  891. .cpu_dai_name = "SLIMBUS4_HOSTLESS",
  892. .platform_name = "msm-pcm-hostless",
  893. .dynamic = 1,
  894. .dpcm_capture = 1,
  895. .dpcm_playback = 1,
  896. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  897. SND_SOC_DPCM_TRIGGER_POST},
  898. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  899. .ignore_suspend = 1,
  900. .ignore_pmdown_time = 1, /* dai link has playback support */
  901. .codec_dai_name = "snd-soc-dummy-dai",
  902. .codec_name = "snd-soc-dummy",
  903. },
  904. {/* hw:x,13 */
  905. .name = MSM_DAILINK_NAME(LowLatency),
  906. .stream_name = "MultiMedia5",
  907. .cpu_dai_name = "MultiMedia5",
  908. .platform_name = "msm-pcm-dsp.1",
  909. .dynamic = 1,
  910. .dpcm_capture = 1,
  911. .dpcm_playback = 1,
  912. .codec_dai_name = "snd-soc-dummy-dai",
  913. .codec_name = "snd-soc-dummy",
  914. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  915. SND_SOC_DPCM_TRIGGER_POST},
  916. .ignore_suspend = 1,
  917. /* this dai link has playback support */
  918. .ignore_pmdown_time = 1,
  919. .id = MSM_FRONTEND_DAI_MULTIMEDIA5,
  920. },
  921. /* LSM FE */
  922. {/* hw:x,14 */
  923. .name = "Listen 1 Audio Service",
  924. .stream_name = "Listen 1 Audio Service",
  925. .cpu_dai_name = "LSM1",
  926. .platform_name = "msm-lsm-client",
  927. .dynamic = 1,
  928. .dpcm_capture = 1,
  929. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  930. SND_SOC_DPCM_TRIGGER_POST },
  931. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  932. .ignore_suspend = 1,
  933. .ignore_pmdown_time = 1,
  934. .codec_dai_name = "snd-soc-dummy-dai",
  935. .codec_name = "snd-soc-dummy",
  936. .id = MSM_FRONTEND_DAI_LSM1,
  937. },
  938. {/* hw:x,15 */
  939. .name = MSM_DAILINK_NAME(Compress2),
  940. .stream_name = "Compress2",
  941. .cpu_dai_name = "MultiMedia7",
  942. .platform_name = "msm-compress-dsp",
  943. .dynamic = 1,
  944. .dpcm_capture = 1,
  945. .dpcm_playback = 1,
  946. .codec_dai_name = "snd-soc-dummy-dai",
  947. .codec_name = "snd-soc-dummy",
  948. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  949. SND_SOC_DPCM_TRIGGER_POST},
  950. .ignore_suspend = 1,
  951. /* this dai link has playback support */
  952. .ignore_pmdown_time = 1,
  953. .id = MSM_FRONTEND_DAI_MULTIMEDIA7,
  954. },
  955. {/* hw:x,16 */
  956. .name = MSM_DAILINK_NAME(Compress3),
  957. .stream_name = "Compress3",
  958. .cpu_dai_name = "MultiMedia10",
  959. .platform_name = "msm-compress-dsp",
  960. .dynamic = 1,
  961. .dpcm_capture = 1,
  962. .dpcm_playback = 1,
  963. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  964. SND_SOC_DPCM_TRIGGER_POST},
  965. .codec_dai_name = "snd-soc-dummy-dai",
  966. .codec_name = "snd-soc-dummy",
  967. .ignore_suspend = 1,
  968. .ignore_pmdown_time = 1,
  969. /* this dai link has playback support */
  970. .id = MSM_FRONTEND_DAI_MULTIMEDIA10,
  971. },
  972. {/* hw:x,17 */
  973. .name = MSM_DAILINK_NAME(ULL_NOIRQ),
  974. .stream_name = "MM_NOIRQ",
  975. .cpu_dai_name = "MultiMedia8",
  976. .platform_name = "msm-pcm-dsp-noirq",
  977. .dynamic = 1,
  978. .dpcm_capture = 1,
  979. .dpcm_playback = 1,
  980. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  981. SND_SOC_DPCM_TRIGGER_POST},
  982. .codec_dai_name = "snd-soc-dummy-dai",
  983. .codec_name = "snd-soc-dummy",
  984. .ignore_suspend = 1,
  985. .ignore_pmdown_time = 1,
  986. /* this dai link has playback support */
  987. .id = MSM_FRONTEND_DAI_MULTIMEDIA8,
  988. },
  989. {/* hw:x,18 */
  990. .name = "HDMI_RX_HOSTLESS",
  991. .stream_name = "HDMI_RX_HOSTLESS",
  992. .cpu_dai_name = "HDMI_HOSTLESS",
  993. .platform_name = "msm-pcm-hostless",
  994. .dynamic = 1,
  995. .dpcm_playback = 1,
  996. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  997. SND_SOC_DPCM_TRIGGER_POST},
  998. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  999. .ignore_suspend = 1,
  1000. .ignore_pmdown_time = 1,
  1001. .codec_dai_name = "snd-soc-dummy-dai",
  1002. .codec_name = "snd-soc-dummy",
  1003. },
  1004. {/* hw:x,19 */
  1005. .name = "VoiceMMode2",
  1006. .stream_name = "VoiceMMode2",
  1007. .cpu_dai_name = "VoiceMMode2",
  1008. .platform_name = "msm-pcm-voice",
  1009. .dynamic = 1,
  1010. .dpcm_capture = 1,
  1011. .dpcm_playback = 1,
  1012. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  1013. SND_SOC_DPCM_TRIGGER_POST},
  1014. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  1015. .ignore_suspend = 1,
  1016. .ignore_pmdown_time = 1,
  1017. .codec_dai_name = "snd-soc-dummy-dai",
  1018. .codec_name = "snd-soc-dummy",
  1019. .id = MSM_FRONTEND_DAI_VOICEMMODE2,
  1020. },
  1021. {/* hw:x,20 */
  1022. .name = "Listen 2 Audio Service",
  1023. .stream_name = "Listen 2 Audio Service",
  1024. .cpu_dai_name = "LSM2",
  1025. .platform_name = "msm-lsm-client",
  1026. .dynamic = 1,
  1027. .dpcm_capture = 1,
  1028. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  1029. SND_SOC_DPCM_TRIGGER_POST },
  1030. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  1031. .ignore_suspend = 1,
  1032. .ignore_pmdown_time = 1,
  1033. .codec_dai_name = "snd-soc-dummy-dai",
  1034. .codec_name = "snd-soc-dummy",
  1035. .id = MSM_FRONTEND_DAI_LSM2,
  1036. },
  1037. {/* hw:x,21 */
  1038. .name = "Listen 3 Audio Service",
  1039. .stream_name = "Listen 3 Audio Service",
  1040. .cpu_dai_name = "LSM3",
  1041. .platform_name = "msm-lsm-client",
  1042. .dynamic = 1,
  1043. .dpcm_capture = 1,
  1044. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  1045. SND_SOC_DPCM_TRIGGER_POST },
  1046. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  1047. .ignore_suspend = 1,
  1048. .ignore_pmdown_time = 1,
  1049. .codec_dai_name = "snd-soc-dummy-dai",
  1050. .codec_name = "snd-soc-dummy",
  1051. .id = MSM_FRONTEND_DAI_LSM3,
  1052. },
  1053. {/* hw:x,22 */
  1054. .name = "Listen 4 Audio Service",
  1055. .stream_name = "Listen 4 Audio Service",
  1056. .cpu_dai_name = "LSM4",
  1057. .platform_name = "msm-lsm-client",
  1058. .dynamic = 1,
  1059. .dpcm_capture = 1,
  1060. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  1061. SND_SOC_DPCM_TRIGGER_POST },
  1062. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  1063. .ignore_suspend = 1,
  1064. .ignore_pmdown_time = 1,
  1065. .codec_dai_name = "snd-soc-dummy-dai",
  1066. .codec_name = "snd-soc-dummy",
  1067. .id = MSM_FRONTEND_DAI_LSM4,
  1068. },
  1069. {/* hw:x,23 */
  1070. .name = "Listen 5 Audio Service",
  1071. .stream_name = "Listen 5 Audio Service",
  1072. .cpu_dai_name = "LSM5",
  1073. .platform_name = "msm-lsm-client",
  1074. .dynamic = 1,
  1075. .dpcm_capture = 1,
  1076. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  1077. SND_SOC_DPCM_TRIGGER_POST },
  1078. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  1079. .ignore_suspend = 1,
  1080. .ignore_pmdown_time = 1,
  1081. .codec_dai_name = "snd-soc-dummy-dai",
  1082. .codec_name = "snd-soc-dummy",
  1083. .id = MSM_FRONTEND_DAI_LSM5,
  1084. },
  1085. {/* hw:x,24 */
  1086. .name = "Listen 6 Audio Service",
  1087. .stream_name = "Listen 6 Audio Service",
  1088. .cpu_dai_name = "LSM6",
  1089. .platform_name = "msm-lsm-client",
  1090. .dynamic = 1,
  1091. .dpcm_capture = 1,
  1092. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  1093. SND_SOC_DPCM_TRIGGER_POST },
  1094. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  1095. .ignore_suspend = 1,
  1096. .ignore_pmdown_time = 1,
  1097. .codec_dai_name = "snd-soc-dummy-dai",
  1098. .codec_name = "snd-soc-dummy",
  1099. .id = MSM_FRONTEND_DAI_LSM6
  1100. },
  1101. {/* hw:x,25 */
  1102. .name = "Listen 7 Audio Service",
  1103. .stream_name = "Listen 7 Audio Service",
  1104. .cpu_dai_name = "LSM7",
  1105. .platform_name = "msm-lsm-client",
  1106. .dynamic = 1,
  1107. .dpcm_capture = 1,
  1108. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  1109. SND_SOC_DPCM_TRIGGER_POST },
  1110. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  1111. .ignore_suspend = 1,
  1112. .ignore_pmdown_time = 1,
  1113. .codec_dai_name = "snd-soc-dummy-dai",
  1114. .codec_name = "snd-soc-dummy",
  1115. .id = MSM_FRONTEND_DAI_LSM7,
  1116. },
  1117. {/* hw:x,26 */
  1118. .name = "Listen 8 Audio Service",
  1119. .stream_name = "Listen 8 Audio Service",
  1120. .cpu_dai_name = "LSM8",
  1121. .platform_name = "msm-lsm-client",
  1122. .dynamic = 1,
  1123. .dpcm_capture = 1,
  1124. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  1125. SND_SOC_DPCM_TRIGGER_POST },
  1126. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  1127. .ignore_suspend = 1,
  1128. .ignore_pmdown_time = 1,
  1129. .codec_dai_name = "snd-soc-dummy-dai",
  1130. .codec_name = "snd-soc-dummy",
  1131. .id = MSM_FRONTEND_DAI_LSM8,
  1132. },
  1133. {/* hw:x,27 */
  1134. .name = MSM_DAILINK_NAME(Media9),
  1135. .stream_name = "MultiMedia9",
  1136. .cpu_dai_name = "MultiMedia9",
  1137. .platform_name = "msm-pcm-dsp.0",
  1138. .dynamic = 1,
  1139. .dpcm_capture = 1,
  1140. .dpcm_playback = 1,
  1141. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  1142. SND_SOC_DPCM_TRIGGER_POST},
  1143. .codec_dai_name = "snd-soc-dummy-dai",
  1144. .codec_name = "snd-soc-dummy",
  1145. .ignore_suspend = 1,
  1146. .ignore_pmdown_time = 1,
  1147. /* this dai link has playback support */
  1148. .id = MSM_FRONTEND_DAI_MULTIMEDIA9,
  1149. },
  1150. {/* hw:x,28 */
  1151. .name = MSM_DAILINK_NAME(Compress4),
  1152. .stream_name = "Compress4",
  1153. .cpu_dai_name = "MultiMedia11",
  1154. .platform_name = "msm-compress-dsp",
  1155. .dynamic = 1,
  1156. .dpcm_capture = 1,
  1157. .dpcm_playback = 1,
  1158. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  1159. SND_SOC_DPCM_TRIGGER_POST},
  1160. .codec_dai_name = "snd-soc-dummy-dai",
  1161. .codec_name = "snd-soc-dummy",
  1162. .ignore_suspend = 1,
  1163. .ignore_pmdown_time = 1,
  1164. /* this dai link has playback support */
  1165. .id = MSM_FRONTEND_DAI_MULTIMEDIA11,
  1166. },
  1167. {/* hw:x,29 */
  1168. .name = MSM_DAILINK_NAME(Compress5),
  1169. .stream_name = "Compress5",
  1170. .cpu_dai_name = "MultiMedia12",
  1171. .platform_name = "msm-compress-dsp",
  1172. .dynamic = 1,
  1173. .dpcm_capture = 1,
  1174. .dpcm_playback = 1,
  1175. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  1176. SND_SOC_DPCM_TRIGGER_POST},
  1177. .codec_dai_name = "snd-soc-dummy-dai",
  1178. .codec_name = "snd-soc-dummy",
  1179. .ignore_suspend = 1,
  1180. .ignore_pmdown_time = 1,
  1181. /* this dai link has playback support */
  1182. .id = MSM_FRONTEND_DAI_MULTIMEDIA12,
  1183. },
  1184. {/* hw:x,30 */
  1185. .name = MSM_DAILINK_NAME(Compress6),
  1186. .stream_name = "Compress6",
  1187. .cpu_dai_name = "MultiMedia13",
  1188. .platform_name = "msm-compress-dsp",
  1189. .dynamic = 1,
  1190. .dpcm_capture = 1,
  1191. .dpcm_playback = 1,
  1192. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  1193. SND_SOC_DPCM_TRIGGER_POST},
  1194. .codec_dai_name = "snd-soc-dummy-dai",
  1195. .codec_name = "snd-soc-dummy",
  1196. .ignore_suspend = 1,
  1197. .ignore_pmdown_time = 1,
  1198. /* this dai link has playback support */
  1199. .id = MSM_FRONTEND_DAI_MULTIMEDIA13,
  1200. },
  1201. {/* hw:x,31 */
  1202. .name = MSM_DAILINK_NAME(Compress7),
  1203. .stream_name = "Compress7",
  1204. .cpu_dai_name = "MultiMedia14",
  1205. .platform_name = "msm-compress-dsp",
  1206. .dynamic = 1,
  1207. .dpcm_capture = 1,
  1208. .dpcm_playback = 1,
  1209. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  1210. SND_SOC_DPCM_TRIGGER_POST},
  1211. .codec_dai_name = "snd-soc-dummy-dai",
  1212. .codec_name = "snd-soc-dummy",
  1213. .ignore_suspend = 1,
  1214. .ignore_pmdown_time = 1,
  1215. /* this dai link has playback support */
  1216. .id = MSM_FRONTEND_DAI_MULTIMEDIA14,
  1217. },
  1218. {/* hw:x,32 */
  1219. .name = MSM_DAILINK_NAME(Compress8),
  1220. .stream_name = "Compress8",
  1221. .cpu_dai_name = "MultiMedia15",
  1222. .platform_name = "msm-compress-dsp",
  1223. .dynamic = 1,
  1224. .dpcm_capture = 1,
  1225. .dpcm_playback = 1,
  1226. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  1227. SND_SOC_DPCM_TRIGGER_POST},
  1228. .codec_dai_name = "snd-soc-dummy-dai",
  1229. .codec_name = "snd-soc-dummy",
  1230. .ignore_suspend = 1,
  1231. .ignore_pmdown_time = 1,
  1232. /* this dai link has playback support */
  1233. .id = MSM_FRONTEND_DAI_MULTIMEDIA15,
  1234. },
  1235. {/* hw:x,33 */
  1236. .name = MSM_DAILINK_NAME(Compress9),
  1237. .stream_name = "Compress9",
  1238. .cpu_dai_name = "MultiMedia16",
  1239. .platform_name = "msm-compress-dsp",
  1240. .dynamic = 1,
  1241. .dpcm_capture = 1,
  1242. .dpcm_playback = 1,
  1243. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  1244. SND_SOC_DPCM_TRIGGER_POST},
  1245. .codec_dai_name = "snd-soc-dummy-dai",
  1246. .codec_name = "snd-soc-dummy",
  1247. .ignore_suspend = 1,
  1248. .ignore_pmdown_time = 1,
  1249. /* this dai link has playback support */
  1250. .id = MSM_FRONTEND_DAI_MULTIMEDIA16,
  1251. },
  1252. {/* hw:x,34 */
  1253. .name = "SLIMBUS_8 Hostless",
  1254. .stream_name = "SLIMBUS8_HOSTLESS Capture",
  1255. .cpu_dai_name = "SLIMBUS8_HOSTLESS",
  1256. .platform_name = "msm-pcm-hostless",
  1257. .dynamic = 1,
  1258. .dpcm_capture = 1,
  1259. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  1260. SND_SOC_DPCM_TRIGGER_POST},
  1261. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  1262. .ignore_suspend = 1,
  1263. .ignore_pmdown_time = 1,
  1264. .codec_dai_name = "snd-soc-dummy-dai",
  1265. .codec_name = "snd-soc-dummy",
  1266. },
  1267. {/* hw:x,35 */
  1268. .name = "SLIMBUS7 Hostless",
  1269. .stream_name = "SLIMBUS7 Hostless",
  1270. .cpu_dai_name = "SLIMBUS7_HOSTLESS",
  1271. .platform_name = "msm-pcm-hostless",
  1272. .dynamic = 1,
  1273. .dpcm_playback = 1,
  1274. .dpcm_capture = 1,
  1275. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  1276. SND_SOC_DPCM_TRIGGER_POST},
  1277. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  1278. .ignore_suspend = 1,
  1279. .ignore_pmdown_time = 1,
  1280. .codec_dai_name = "snd-soc-dummy-dai",
  1281. .codec_name = "snd-soc-dummy",
  1282. },
  1283. {/* hw:x,36 */
  1284. .name = "SDM660 HFP TX",
  1285. .stream_name = "MultiMedia6",
  1286. .cpu_dai_name = "MultiMedia6",
  1287. .platform_name = "msm-pcm-loopback",
  1288. .dynamic = 1,
  1289. .dpcm_playback = 1,
  1290. .dpcm_capture = 1,
  1291. .codec_dai_name = "snd-soc-dummy-dai",
  1292. .codec_name = "snd-soc-dummy",
  1293. .trigger = {SND_SOC_DPCM_TRIGGER_POST,
  1294. SND_SOC_DPCM_TRIGGER_POST},
  1295. .ignore_suspend = 1,
  1296. .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
  1297. .ignore_pmdown_time = 1,
  1298. .id = MSM_FRONTEND_DAI_MULTIMEDIA6,
  1299. },
  1300. };
  1301. static struct snd_soc_dai_link msm_ext_common_be_dai[] = {
  1302. {
  1303. .name = LPASS_BE_AFE_PCM_RX,
  1304. .stream_name = "AFE Playback",
  1305. .cpu_dai_name = "msm-dai-q6-dev.224",
  1306. .platform_name = "msm-pcm-routing",
  1307. .codec_name = "msm-stub-codec.1",
  1308. .codec_dai_name = "msm-stub-rx",
  1309. .no_pcm = 1,
  1310. .dpcm_playback = 1,
  1311. .id = MSM_BACKEND_DAI_AFE_PCM_RX,
  1312. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1313. /* this dai link has playback support */
  1314. .ignore_pmdown_time = 1,
  1315. .ignore_suspend = 1,
  1316. },
  1317. {
  1318. .name = LPASS_BE_AFE_PCM_TX,
  1319. .stream_name = "AFE Capture",
  1320. .cpu_dai_name = "msm-dai-q6-dev.225",
  1321. .platform_name = "msm-pcm-routing",
  1322. .codec_name = "msm-stub-codec.1",
  1323. .codec_dai_name = "msm-stub-tx",
  1324. .no_pcm = 1,
  1325. .dpcm_capture = 1,
  1326. .id = MSM_BACKEND_DAI_AFE_PCM_TX,
  1327. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1328. .ignore_suspend = 1,
  1329. },
  1330. /* Incall Record Uplink BACK END DAI Link */
  1331. {
  1332. .name = LPASS_BE_INCALL_RECORD_TX,
  1333. .stream_name = "Voice Uplink Capture",
  1334. .cpu_dai_name = "msm-dai-q6-dev.32772",
  1335. .platform_name = "msm-pcm-routing",
  1336. .codec_name = "msm-stub-codec.1",
  1337. .codec_dai_name = "msm-stub-tx",
  1338. .no_pcm = 1,
  1339. .dpcm_capture = 1,
  1340. .id = MSM_BACKEND_DAI_INCALL_RECORD_TX,
  1341. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  1342. .ignore_suspend = 1,
  1343. },
  1344. /* Incall Record Downlink BACK END DAI Link */
  1345. {
  1346. .name = LPASS_BE_INCALL_RECORD_RX,
  1347. .stream_name = "Voice Downlink Capture",
  1348. .cpu_dai_name = "msm-dai-q6-dev.32771",
  1349. .platform_name = "msm-pcm-routing",
  1350. .codec_name = "msm-stub-codec.1",
  1351. .codec_dai_name = "msm-stub-tx",
  1352. .no_pcm = 1,
  1353. .dpcm_capture = 1,
  1354. .id = MSM_BACKEND_DAI_INCALL_RECORD_RX,
  1355. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  1356. .ignore_suspend = 1,
  1357. },
  1358. /* Incall Music BACK END DAI Link */
  1359. {
  1360. .name = LPASS_BE_VOICE_PLAYBACK_TX,
  1361. .stream_name = "Voice Farend Playback",
  1362. .cpu_dai_name = "msm-dai-q6-dev.32773",
  1363. .platform_name = "msm-pcm-routing",
  1364. .codec_name = "msm-stub-codec.1",
  1365. .codec_dai_name = "msm-stub-rx",
  1366. .no_pcm = 1,
  1367. .dpcm_playback = 1,
  1368. .id = MSM_BACKEND_DAI_VOICE_PLAYBACK_TX,
  1369. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  1370. .ignore_suspend = 1,
  1371. },
  1372. /* Incall Music 2 BACK END DAI Link */
  1373. {
  1374. .name = LPASS_BE_VOICE2_PLAYBACK_TX,
  1375. .stream_name = "Voice2 Farend Playback",
  1376. .cpu_dai_name = "msm-dai-q6-dev.32770",
  1377. .platform_name = "msm-pcm-routing",
  1378. .codec_name = "msm-stub-codec.1",
  1379. .codec_dai_name = "msm-stub-rx",
  1380. .no_pcm = 1,
  1381. .dpcm_playback = 1,
  1382. .id = MSM_BACKEND_DAI_VOICE2_PLAYBACK_TX,
  1383. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  1384. .ignore_suspend = 1,
  1385. },
  1386. {
  1387. .name = LPASS_BE_USB_AUDIO_RX,
  1388. .stream_name = "USB Audio Playback",
  1389. .cpu_dai_name = "msm-dai-q6-dev.28672",
  1390. .platform_name = "msm-pcm-routing",
  1391. .codec_name = "msm-stub-codec.1",
  1392. .codec_dai_name = "msm-stub-rx",
  1393. .no_pcm = 1,
  1394. .dpcm_playback = 1,
  1395. .id = MSM_BACKEND_DAI_USB_RX,
  1396. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1397. .ignore_pmdown_time = 1,
  1398. .ignore_suspend = 1,
  1399. },
  1400. {
  1401. .name = LPASS_BE_USB_AUDIO_TX,
  1402. .stream_name = "USB Audio Capture",
  1403. .cpu_dai_name = "msm-dai-q6-dev.28673",
  1404. .platform_name = "msm-pcm-routing",
  1405. .codec_name = "msm-stub-codec.1",
  1406. .codec_dai_name = "msm-stub-tx",
  1407. .no_pcm = 1,
  1408. .dpcm_capture = 1,
  1409. .id = MSM_BACKEND_DAI_USB_TX,
  1410. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1411. .ignore_suspend = 1,
  1412. },
  1413. {
  1414. .name = LPASS_BE_PRI_TDM_RX_0,
  1415. .stream_name = "Primary TDM0 Playback",
  1416. .cpu_dai_name = "msm-dai-q6-tdm.36864",
  1417. .platform_name = "msm-pcm-routing",
  1418. .codec_name = "msm-stub-codec.1",
  1419. .codec_dai_name = "msm-stub-rx",
  1420. .no_pcm = 1,
  1421. .dpcm_playback = 1,
  1422. .id = MSM_BACKEND_DAI_PRI_TDM_RX_0,
  1423. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1424. .ops = &msm_tdm_be_ops,
  1425. .ignore_suspend = 1,
  1426. },
  1427. {
  1428. .name = LPASS_BE_PRI_TDM_TX_0,
  1429. .stream_name = "Primary TDM0 Capture",
  1430. .cpu_dai_name = "msm-dai-q6-tdm.36865",
  1431. .platform_name = "msm-pcm-routing",
  1432. .codec_name = "msm-stub-codec.1",
  1433. .codec_dai_name = "msm-stub-tx",
  1434. .no_pcm = 1,
  1435. .dpcm_capture = 1,
  1436. .id = MSM_BACKEND_DAI_PRI_TDM_TX_0,
  1437. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1438. .ops = &msm_tdm_be_ops,
  1439. .ignore_suspend = 1,
  1440. },
  1441. {
  1442. .name = LPASS_BE_SEC_TDM_RX_0,
  1443. .stream_name = "Secondary TDM0 Playback",
  1444. .cpu_dai_name = "msm-dai-q6-tdm.36880",
  1445. .platform_name = "msm-pcm-routing",
  1446. .codec_name = "msm-stub-codec.1",
  1447. .codec_dai_name = "msm-stub-rx",
  1448. .no_pcm = 1,
  1449. .dpcm_playback = 1,
  1450. .id = MSM_BACKEND_DAI_SEC_TDM_RX_0,
  1451. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1452. .ops = &msm_tdm_be_ops,
  1453. .ignore_suspend = 1,
  1454. },
  1455. {
  1456. .name = LPASS_BE_SEC_TDM_TX_0,
  1457. .stream_name = "Secondary TDM0 Capture",
  1458. .cpu_dai_name = "msm-dai-q6-tdm.36881",
  1459. .platform_name = "msm-pcm-routing",
  1460. .codec_name = "msm-stub-codec.1",
  1461. .codec_dai_name = "msm-stub-tx",
  1462. .no_pcm = 1,
  1463. .dpcm_capture = 1,
  1464. .id = MSM_BACKEND_DAI_SEC_TDM_TX_0,
  1465. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1466. .ops = &msm_tdm_be_ops,
  1467. .ignore_suspend = 1,
  1468. },
  1469. {
  1470. .name = LPASS_BE_TERT_TDM_RX_0,
  1471. .stream_name = "Tertiary TDM0 Playback",
  1472. .cpu_dai_name = "msm-dai-q6-tdm.36896",
  1473. .platform_name = "msm-pcm-routing",
  1474. .codec_name = "msm-stub-codec.1",
  1475. .codec_dai_name = "msm-stub-rx",
  1476. .no_pcm = 1,
  1477. .dpcm_playback = 1,
  1478. .id = MSM_BACKEND_DAI_TERT_TDM_RX_0,
  1479. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1480. .ops = &msm_tdm_be_ops,
  1481. .ignore_suspend = 1,
  1482. },
  1483. {
  1484. .name = LPASS_BE_TERT_TDM_TX_0,
  1485. .stream_name = "Tertiary TDM0 Capture",
  1486. .cpu_dai_name = "msm-dai-q6-tdm.36897",
  1487. .platform_name = "msm-pcm-routing",
  1488. .codec_name = "msm-stub-codec.1",
  1489. .codec_dai_name = "msm-stub-tx",
  1490. .no_pcm = 1,
  1491. .dpcm_capture = 1,
  1492. .id = MSM_BACKEND_DAI_TERT_TDM_TX_0,
  1493. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1494. .ops = &msm_tdm_be_ops,
  1495. .ignore_suspend = 1,
  1496. },
  1497. {
  1498. .name = LPASS_BE_QUAT_TDM_RX_0,
  1499. .stream_name = "Quaternary TDM0 Playback",
  1500. .cpu_dai_name = "msm-dai-q6-tdm.36912",
  1501. .platform_name = "msm-pcm-routing",
  1502. .codec_name = "msm-stub-codec.1",
  1503. .codec_dai_name = "msm-stub-rx",
  1504. .no_pcm = 1,
  1505. .dpcm_playback = 1,
  1506. .id = MSM_BACKEND_DAI_QUAT_TDM_RX_0,
  1507. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1508. .ops = &msm_tdm_be_ops,
  1509. .ignore_suspend = 1,
  1510. },
  1511. {
  1512. .name = LPASS_BE_QUAT_TDM_TX_0,
  1513. .stream_name = "Quaternary TDM0 Capture",
  1514. .cpu_dai_name = "msm-dai-q6-tdm.36913",
  1515. .platform_name = "msm-pcm-routing",
  1516. .codec_name = "msm-stub-codec.1",
  1517. .codec_dai_name = "msm-stub-tx",
  1518. .no_pcm = 1,
  1519. .dpcm_capture = 1,
  1520. .id = MSM_BACKEND_DAI_QUAT_TDM_TX_0,
  1521. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1522. .ops = &msm_tdm_be_ops,
  1523. .ignore_suspend = 1,
  1524. },
  1525. };
  1526. static struct snd_soc_dai_link msm_mi2s_be_dai_links[] = {
  1527. {
  1528. .name = LPASS_BE_PRI_MI2S_RX,
  1529. .stream_name = "Primary MI2S Playback",
  1530. .cpu_dai_name = "msm-dai-q6-mi2s.0",
  1531. .platform_name = "msm-pcm-routing",
  1532. .codec_name = "msm-stub-codec.1",
  1533. .codec_dai_name = "msm-stub-rx",
  1534. .no_pcm = 1,
  1535. .dpcm_playback = 1,
  1536. .id = MSM_BACKEND_DAI_PRI_MI2S_RX,
  1537. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1538. .ops = &msm_mi2s_be_ops,
  1539. .ignore_suspend = 1,
  1540. .ignore_pmdown_time = 1,
  1541. },
  1542. {
  1543. .name = LPASS_BE_PRI_MI2S_TX,
  1544. .stream_name = "Primary MI2S Capture",
  1545. .cpu_dai_name = "msm-dai-q6-mi2s.0",
  1546. .platform_name = "msm-pcm-routing",
  1547. .codec_name = "msm-stub-codec.1",
  1548. .codec_dai_name = "msm-stub-tx",
  1549. .no_pcm = 1,
  1550. .dpcm_capture = 1,
  1551. .id = MSM_BACKEND_DAI_PRI_MI2S_TX,
  1552. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1553. .ops = &msm_mi2s_be_ops,
  1554. .ignore_suspend = 1,
  1555. },
  1556. {
  1557. .name = LPASS_BE_SEC_MI2S_RX,
  1558. .stream_name = "Secondary MI2S Playback",
  1559. .cpu_dai_name = "msm-dai-q6-mi2s.1",
  1560. .platform_name = "msm-pcm-routing",
  1561. .codec_name = "msm-stub-codec.1",
  1562. .codec_dai_name = "msm-stub-rx",
  1563. .no_pcm = 1,
  1564. .dpcm_playback = 1,
  1565. .id = MSM_BACKEND_DAI_SECONDARY_MI2S_RX,
  1566. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1567. .ops = &msm_mi2s_be_ops,
  1568. .ignore_suspend = 1,
  1569. .ignore_pmdown_time = 1,
  1570. },
  1571. {
  1572. .name = LPASS_BE_SEC_MI2S_TX,
  1573. .stream_name = "Secondary MI2S Capture",
  1574. .cpu_dai_name = "msm-dai-q6-mi2s.1",
  1575. .platform_name = "msm-pcm-routing",
  1576. .codec_name = "msm-stub-codec.1",
  1577. .codec_dai_name = "msm-stub-tx",
  1578. .no_pcm = 1,
  1579. .dpcm_capture = 1,
  1580. .id = MSM_BACKEND_DAI_SECONDARY_MI2S_TX,
  1581. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1582. .ops = &msm_mi2s_be_ops,
  1583. .ignore_suspend = 1,
  1584. },
  1585. {
  1586. .name = LPASS_BE_TERT_MI2S_RX,
  1587. .stream_name = "Tertiary MI2S Playback",
  1588. .cpu_dai_name = "msm-dai-q6-mi2s.2",
  1589. .platform_name = "msm-pcm-routing",
  1590. .codec_name = "msm-stub-codec.1",
  1591. .codec_dai_name = "msm-stub-rx",
  1592. .no_pcm = 1,
  1593. .dpcm_playback = 1,
  1594. .id = MSM_BACKEND_DAI_TERTIARY_MI2S_RX,
  1595. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1596. .ops = &msm_mi2s_be_ops,
  1597. .ignore_suspend = 1,
  1598. .ignore_pmdown_time = 1,
  1599. },
  1600. {
  1601. .name = LPASS_BE_TERT_MI2S_TX,
  1602. .stream_name = "Tertiary MI2S Capture",
  1603. .cpu_dai_name = "msm-dai-q6-mi2s.2",
  1604. .platform_name = "msm-pcm-routing",
  1605. .codec_name = "msm-stub-codec.1",
  1606. .codec_dai_name = "msm-stub-tx",
  1607. .no_pcm = 1,
  1608. .dpcm_capture = 1,
  1609. .id = MSM_BACKEND_DAI_TERTIARY_MI2S_TX,
  1610. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1611. .ops = &msm_mi2s_be_ops,
  1612. .ignore_suspend = 1,
  1613. },
  1614. {
  1615. .name = LPASS_BE_QUAT_MI2S_RX,
  1616. .stream_name = "Quaternary MI2S Playback",
  1617. .cpu_dai_name = "msm-dai-q6-mi2s.3",
  1618. .platform_name = "msm-pcm-routing",
  1619. .codec_name = "msm-stub-codec.1",
  1620. .codec_dai_name = "msm-stub-rx",
  1621. .no_pcm = 1,
  1622. .dpcm_playback = 1,
  1623. .id = MSM_BACKEND_DAI_QUATERNARY_MI2S_RX,
  1624. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1625. .ops = &msm_mi2s_be_ops,
  1626. .ignore_suspend = 1,
  1627. .ignore_pmdown_time = 1,
  1628. },
  1629. {
  1630. .name = LPASS_BE_QUAT_MI2S_TX,
  1631. .stream_name = "Quaternary MI2S Capture",
  1632. .cpu_dai_name = "msm-dai-q6-mi2s.3",
  1633. .platform_name = "msm-pcm-routing",
  1634. .codec_name = "msm-stub-codec.1",
  1635. .codec_dai_name = "msm-stub-tx",
  1636. .no_pcm = 1,
  1637. .dpcm_capture = 1,
  1638. .id = MSM_BACKEND_DAI_QUATERNARY_MI2S_TX,
  1639. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1640. .ops = &msm_mi2s_be_ops,
  1641. .ignore_suspend = 1,
  1642. },
  1643. };
  1644. static struct snd_soc_dai_link msm_auxpcm_be_dai_links[] = {
  1645. /* Primary AUX PCM Backend DAI Links */
  1646. {
  1647. .name = LPASS_BE_AUXPCM_RX,
  1648. .stream_name = "AUX PCM Playback",
  1649. .cpu_dai_name = "msm-dai-q6-auxpcm.1",
  1650. .platform_name = "msm-pcm-routing",
  1651. .codec_name = "msm-stub-codec.1",
  1652. .codec_dai_name = "msm-stub-rx",
  1653. .no_pcm = 1,
  1654. .dpcm_playback = 1,
  1655. .id = MSM_BACKEND_DAI_AUXPCM_RX,
  1656. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1657. .ignore_pmdown_time = 1,
  1658. .ignore_suspend = 1,
  1659. .ops = &msm_aux_pcm_be_ops,
  1660. },
  1661. {
  1662. .name = LPASS_BE_AUXPCM_TX,
  1663. .stream_name = "AUX PCM Capture",
  1664. .cpu_dai_name = "msm-dai-q6-auxpcm.1",
  1665. .platform_name = "msm-pcm-routing",
  1666. .codec_name = "msm-stub-codec.1",
  1667. .codec_dai_name = "msm-stub-tx",
  1668. .no_pcm = 1,
  1669. .dpcm_capture = 1,
  1670. .id = MSM_BACKEND_DAI_AUXPCM_TX,
  1671. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1672. .ignore_pmdown_time = 1,
  1673. .ignore_suspend = 1,
  1674. .ops = &msm_aux_pcm_be_ops,
  1675. },
  1676. /* Secondary AUX PCM Backend DAI Links */
  1677. {
  1678. .name = LPASS_BE_SEC_AUXPCM_RX,
  1679. .stream_name = "Sec AUX PCM Playback",
  1680. .cpu_dai_name = "msm-dai-q6-auxpcm.2",
  1681. .platform_name = "msm-pcm-routing",
  1682. .codec_name = "msm-stub-codec.1",
  1683. .codec_dai_name = "msm-stub-rx",
  1684. .no_pcm = 1,
  1685. .dpcm_playback = 1,
  1686. .id = MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  1687. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1688. .ignore_pmdown_time = 1,
  1689. .ignore_suspend = 1,
  1690. .ops = &msm_aux_pcm_be_ops,
  1691. },
  1692. {
  1693. .name = LPASS_BE_SEC_AUXPCM_TX,
  1694. .stream_name = "Sec AUX PCM Capture",
  1695. .cpu_dai_name = "msm-dai-q6-auxpcm.2",
  1696. .platform_name = "msm-pcm-routing",
  1697. .codec_name = "msm-stub-codec.1",
  1698. .codec_dai_name = "msm-stub-tx",
  1699. .no_pcm = 1,
  1700. .dpcm_capture = 1,
  1701. .id = MSM_BACKEND_DAI_SEC_AUXPCM_TX,
  1702. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1703. .ignore_suspend = 1,
  1704. .ignore_pmdown_time = 1,
  1705. .ops = &msm_aux_pcm_be_ops,
  1706. },
  1707. /* Tertiary AUX PCM Backend DAI Links */
  1708. {
  1709. .name = LPASS_BE_TERT_AUXPCM_RX,
  1710. .stream_name = "Tert AUX PCM Playback",
  1711. .cpu_dai_name = "msm-dai-q6-auxpcm.3",
  1712. .platform_name = "msm-pcm-routing",
  1713. .codec_name = "msm-stub-codec.1",
  1714. .codec_dai_name = "msm-stub-rx",
  1715. .no_pcm = 1,
  1716. .dpcm_playback = 1,
  1717. .id = MSM_BACKEND_DAI_TERT_AUXPCM_RX,
  1718. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1719. .ignore_pmdown_time = 1,
  1720. .ignore_suspend = 1,
  1721. .ops = &msm_aux_pcm_be_ops,
  1722. },
  1723. {
  1724. .name = LPASS_BE_TERT_AUXPCM_TX,
  1725. .stream_name = "Tert AUX PCM Capture",
  1726. .cpu_dai_name = "msm-dai-q6-auxpcm.3",
  1727. .platform_name = "msm-pcm-routing",
  1728. .codec_name = "msm-stub-codec.1",
  1729. .codec_dai_name = "msm-stub-tx",
  1730. .no_pcm = 1,
  1731. .dpcm_capture = 1,
  1732. .id = MSM_BACKEND_DAI_TERT_AUXPCM_TX,
  1733. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1734. .ignore_suspend = 1,
  1735. .ignore_pmdown_time = 1,
  1736. .ops = &msm_aux_pcm_be_ops,
  1737. },
  1738. /* Quaternary AUX PCM Backend DAI Links */
  1739. {
  1740. .name = LPASS_BE_QUAT_AUXPCM_RX,
  1741. .stream_name = "Quat AUX PCM Playback",
  1742. .cpu_dai_name = "msm-dai-q6-auxpcm.4",
  1743. .platform_name = "msm-pcm-routing",
  1744. .codec_name = "msm-stub-codec.1",
  1745. .codec_dai_name = "msm-stub-rx",
  1746. .no_pcm = 1,
  1747. .dpcm_playback = 1,
  1748. .id = MSM_BACKEND_DAI_QUAT_AUXPCM_RX,
  1749. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1750. .ignore_pmdown_time = 1,
  1751. .ignore_suspend = 1,
  1752. .ops = &msm_aux_pcm_be_ops,
  1753. },
  1754. {
  1755. .name = LPASS_BE_QUAT_AUXPCM_TX,
  1756. .stream_name = "Quat AUX PCM Capture",
  1757. .cpu_dai_name = "msm-dai-q6-auxpcm.4",
  1758. .platform_name = "msm-pcm-routing",
  1759. .codec_name = "msm-stub-codec.1",
  1760. .codec_dai_name = "msm-stub-tx",
  1761. .no_pcm = 1,
  1762. .dpcm_capture = 1,
  1763. .id = MSM_BACKEND_DAI_QUAT_AUXPCM_TX,
  1764. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1765. .ignore_suspend = 1,
  1766. .ignore_pmdown_time = 1,
  1767. .ops = &msm_aux_pcm_be_ops,
  1768. },
  1769. };
  1770. static struct snd_soc_dai_link msm_wcn_be_dai_links[] = {
  1771. {
  1772. .name = LPASS_BE_SLIMBUS_7_RX,
  1773. .stream_name = "Slimbus7 Playback",
  1774. .cpu_dai_name = "msm-dai-q6-dev.16398",
  1775. .platform_name = "msm-pcm-routing",
  1776. .codec_name = "btfmslim_slave",
  1777. /* BT codec driver determines capabilities based on
  1778. * dai name, bt codecdai name should always contains
  1779. * supported usecase information
  1780. */
  1781. .codec_dai_name = "btfm_bt_sco_a2dp_slim_rx",
  1782. .no_pcm = 1,
  1783. .dpcm_playback = 1,
  1784. .id = MSM_BACKEND_DAI_SLIMBUS_7_RX,
  1785. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  1786. .ops = &msm_wcn_ops,
  1787. /* dai link has playback support */
  1788. .ignore_pmdown_time = 1,
  1789. .ignore_suspend = 1,
  1790. },
  1791. {
  1792. .name = LPASS_BE_SLIMBUS_7_TX,
  1793. .stream_name = "Slimbus7 Capture",
  1794. .cpu_dai_name = "msm-dai-q6-dev.16399",
  1795. .platform_name = "msm-pcm-routing",
  1796. .codec_name = "btfmslim_slave",
  1797. .codec_dai_name = "btfm_bt_sco_slim_tx",
  1798. .no_pcm = 1,
  1799. .dpcm_capture = 1,
  1800. .id = MSM_BACKEND_DAI_SLIMBUS_7_TX,
  1801. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  1802. .ops = &msm_wcn_ops,
  1803. .ignore_suspend = 1,
  1804. },
  1805. {
  1806. .name = LPASS_BE_SLIMBUS_8_TX,
  1807. .stream_name = "Slimbus8 Capture",
  1808. .cpu_dai_name = "msm-dai-q6-dev.16401",
  1809. .platform_name = "msm-pcm-routing",
  1810. .codec_name = "btfmslim_slave",
  1811. .codec_dai_name = "btfm_fm_slim_tx",
  1812. .no_pcm = 1,
  1813. .dpcm_capture = 1,
  1814. .id = MSM_BACKEND_DAI_SLIMBUS_8_TX,
  1815. .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
  1816. .init = &msm_wcn_init,
  1817. .ops = &msm_wcn_ops,
  1818. .ignore_suspend = 1,
  1819. },
  1820. };
  1821. static struct snd_soc_dai_link ext_disp_be_dai_link[] = {
  1822. /* DISP PORT BACK END DAI Link */
  1823. {
  1824. .name = LPASS_BE_DISPLAY_PORT,
  1825. .stream_name = "Display Port Playback",
  1826. .cpu_dai_name = "msm-dai-q6-dp.24608",
  1827. .platform_name = "msm-pcm-routing",
  1828. .codec_name = "msm-ext-disp-audio-codec-rx",
  1829. .codec_dai_name = "msm_dp_audio_codec_rx_dai",
  1830. .no_pcm = 1,
  1831. .dpcm_playback = 1,
  1832. .id = MSM_BACKEND_DAI_DISPLAY_PORT_RX,
  1833. .be_hw_params_fixup = msm_common_be_hw_params_fixup,
  1834. .ignore_pmdown_time = 1,
  1835. .ignore_suspend = 1,
  1836. },
  1837. };
  1838. static struct snd_soc_dai_link msm_ext_tasha_dai_links[
  1839. ARRAY_SIZE(msm_ext_common_fe_dai) +
  1840. ARRAY_SIZE(msm_ext_tasha_fe_dai) +
  1841. ARRAY_SIZE(msm_ext_common_be_dai) +
  1842. ARRAY_SIZE(msm_ext_tasha_be_dai) +
  1843. ARRAY_SIZE(msm_mi2s_be_dai_links) +
  1844. ARRAY_SIZE(msm_auxpcm_be_dai_links) +
  1845. ARRAY_SIZE(msm_wcn_be_dai_links) +
  1846. ARRAY_SIZE(ext_disp_be_dai_link)];
  1847. static struct snd_soc_dai_link msm_ext_tavil_dai_links[
  1848. ARRAY_SIZE(msm_ext_common_fe_dai) +
  1849. ARRAY_SIZE(msm_ext_tavil_fe_dai) +
  1850. ARRAY_SIZE(msm_ext_common_be_dai) +
  1851. ARRAY_SIZE(msm_ext_tavil_be_dai) +
  1852. ARRAY_SIZE(msm_mi2s_be_dai_links) +
  1853. ARRAY_SIZE(msm_auxpcm_be_dai_links) +
  1854. ARRAY_SIZE(msm_wcn_be_dai_links) +
  1855. ARRAY_SIZE(ext_disp_be_dai_link)];
  1856. /**
  1857. * populate_snd_card_dailinks - prepares dailink array and initializes card.
  1858. *
  1859. * @dev: device handle
  1860. *
  1861. * Returns card on success or NULL on failure.
  1862. */
  1863. struct snd_soc_card *populate_snd_card_dailinks(struct device *dev,
  1864. int snd_card_val)
  1865. {
  1866. struct snd_soc_card *card;
  1867. struct snd_soc_dai_link *msm_ext_dai_links = NULL;
  1868. int ret, len1, len2, len3, len4;
  1869. enum codec_variant codec_ver = 0;
  1870. if (snd_card_val == EXT_SND_CARD_TASHA) {
  1871. card = &snd_soc_card_msm_card_tasha;
  1872. } else if (snd_card_val == EXT_SND_CARD_TAVIL) {
  1873. card = &snd_soc_card_msm_card_tavil;
  1874. } else {
  1875. dev_err(dev, "%s: failing as no matching card name\n",
  1876. __func__);
  1877. return NULL;
  1878. }
  1879. card->dev = dev;
  1880. ret = snd_soc_of_parse_card_name(card, "qcom,model");
  1881. if (ret) {
  1882. dev_err(dev, "%s: parse card name failed, err:%d\n",
  1883. __func__, ret);
  1884. return NULL;
  1885. }
  1886. if (strnstr(card->name, "tasha", strlen(card->name))) {
  1887. codec_ver = tasha_codec_ver();
  1888. if (codec_ver == WCD9326)
  1889. card->name = "sdm660-tashalite-snd-card";
  1890. len1 = ARRAY_SIZE(msm_ext_common_fe_dai);
  1891. len2 = len1 + ARRAY_SIZE(msm_ext_tasha_fe_dai);
  1892. len3 = len2 + ARRAY_SIZE(msm_ext_common_be_dai);
  1893. memcpy(msm_ext_tasha_dai_links, msm_ext_common_fe_dai,
  1894. sizeof(msm_ext_common_fe_dai));
  1895. memcpy(msm_ext_tasha_dai_links + len1,
  1896. msm_ext_tasha_fe_dai, sizeof(msm_ext_tasha_fe_dai));
  1897. memcpy(msm_ext_tasha_dai_links + len2,
  1898. msm_ext_common_be_dai, sizeof(msm_ext_common_be_dai));
  1899. memcpy(msm_ext_tasha_dai_links + len3,
  1900. msm_ext_tasha_be_dai, sizeof(msm_ext_tasha_be_dai));
  1901. len4 = len3 + ARRAY_SIZE(msm_ext_tasha_be_dai);
  1902. if (of_property_read_bool(dev->of_node,
  1903. "qcom,mi2s-audio-intf")) {
  1904. memcpy(msm_ext_tasha_dai_links + len4,
  1905. msm_mi2s_be_dai_links,
  1906. sizeof(msm_mi2s_be_dai_links));
  1907. len4 += ARRAY_SIZE(msm_mi2s_be_dai_links);
  1908. }
  1909. if (of_property_read_bool(dev->of_node,
  1910. "qcom,auxpcm-audio-intf")) {
  1911. memcpy(msm_ext_tasha_dai_links + len4,
  1912. msm_auxpcm_be_dai_links,
  1913. sizeof(msm_auxpcm_be_dai_links));
  1914. len4 += ARRAY_SIZE(msm_auxpcm_be_dai_links);
  1915. }
  1916. if (of_property_read_bool(dev->of_node, "qcom,wcn-btfm")) {
  1917. dev_dbg(dev, "%s(): WCN BTFM support present\n",
  1918. __func__);
  1919. memcpy(msm_ext_tasha_dai_links + len4,
  1920. msm_wcn_be_dai_links,
  1921. sizeof(msm_wcn_be_dai_links));
  1922. len4 += ARRAY_SIZE(msm_wcn_be_dai_links);
  1923. }
  1924. if (of_property_read_bool(dev->of_node,
  1925. "qcom,ext-disp-audio-rx")) {
  1926. dev_dbg(dev, "%s(): ext disp audio support present\n",
  1927. __func__);
  1928. memcpy(msm_ext_tasha_dai_links + len4,
  1929. ext_disp_be_dai_link,
  1930. sizeof(ext_disp_be_dai_link));
  1931. len4 += ARRAY_SIZE(ext_disp_be_dai_link);
  1932. }
  1933. msm_ext_dai_links = msm_ext_tasha_dai_links;
  1934. } else if (strnstr(card->name, "tavil", strlen(card->name))) {
  1935. len1 = ARRAY_SIZE(msm_ext_common_fe_dai);
  1936. len2 = len1 + ARRAY_SIZE(msm_ext_tavil_fe_dai);
  1937. len3 = len2 + ARRAY_SIZE(msm_ext_common_be_dai);
  1938. memcpy(msm_ext_tavil_dai_links, msm_ext_common_fe_dai,
  1939. sizeof(msm_ext_common_fe_dai));
  1940. memcpy(msm_ext_tavil_dai_links + len1,
  1941. msm_ext_tavil_fe_dai, sizeof(msm_ext_tavil_fe_dai));
  1942. memcpy(msm_ext_tavil_dai_links + len2,
  1943. msm_ext_common_be_dai, sizeof(msm_ext_common_be_dai));
  1944. memcpy(msm_ext_tavil_dai_links + len3,
  1945. msm_ext_tavil_be_dai, sizeof(msm_ext_tavil_be_dai));
  1946. len4 = len3 + ARRAY_SIZE(msm_ext_tavil_be_dai);
  1947. if (of_property_read_bool(dev->of_node,
  1948. "qcom,mi2s-audio-intf")) {
  1949. memcpy(msm_ext_tavil_dai_links + len4,
  1950. msm_mi2s_be_dai_links,
  1951. sizeof(msm_mi2s_be_dai_links));
  1952. len4 += ARRAY_SIZE(msm_mi2s_be_dai_links);
  1953. }
  1954. if (of_property_read_bool(dev->of_node,
  1955. "qcom,auxpcm-audio-intf")) {
  1956. memcpy(msm_ext_tavil_dai_links + len4,
  1957. msm_auxpcm_be_dai_links,
  1958. sizeof(msm_auxpcm_be_dai_links));
  1959. len4 += ARRAY_SIZE(msm_auxpcm_be_dai_links);
  1960. }
  1961. if (of_property_read_bool(dev->of_node, "qcom,wcn-btfm")) {
  1962. dev_dbg(dev, "%s(): WCN BTFM support present\n",
  1963. __func__);
  1964. memcpy(msm_ext_tavil_dai_links + len4,
  1965. msm_wcn_be_dai_links,
  1966. sizeof(msm_wcn_be_dai_links));
  1967. len4 += ARRAY_SIZE(msm_wcn_be_dai_links);
  1968. }
  1969. if (of_property_read_bool(dev->of_node,
  1970. "qcom,ext-disp-audio-rx")) {
  1971. dev_dbg(dev, "%s(): ext disp audio support present\n",
  1972. __func__);
  1973. memcpy(msm_ext_tavil_dai_links + len4,
  1974. ext_disp_be_dai_link,
  1975. sizeof(ext_disp_be_dai_link));
  1976. len4 += ARRAY_SIZE(ext_disp_be_dai_link);
  1977. }
  1978. msm_ext_dai_links = msm_ext_tavil_dai_links;
  1979. } else {
  1980. dev_err(dev, "%s: failing as no matching card name\n",
  1981. __func__);
  1982. return NULL;
  1983. }
  1984. card->dai_link = msm_ext_dai_links;
  1985. card->num_links = len4;
  1986. return card;
  1987. }
  1988. EXPORT_SYMBOL(populate_snd_card_dailinks);