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