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