blob: 33e8e0aa2a896eff60c82cd59c3d930a11846bbb [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
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +053013#include <linux/of.h>
14#include <sound/core.h>
15#include <sound/soc.h>
16#include <sound/soc-dapm.h>
17#include <sound/pcm.h>
18#include <sound/pcm_params.h>
Laxminath Kasam7e057cf2017-08-09 23:55:15 +053019#include "msm-pcm-routing-v2.h"
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +053020#include "sdm660-common.h"
21#include "sdm660-external.h"
Laxminath Kasam605b42f2017-08-01 22:02:15 +053022#include "codecs/core.h"
23#include "codecs/wcd9335.h"
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +053024
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
Laxminath Kasam38070be2017-08-17 18:21:59 +053032static struct snd_soc_card snd_soc_card_msm_card_tavil = {
33 .name = "sdm670-tavil-snd-card",
34 .late_probe = msm_snd_card_tavil_late_probe,
35};
36
37static struct snd_soc_card snd_soc_card_msm_card_tasha = {
38 .name = "sdm670-tasha-snd-card",
39 .late_probe = msm_snd_card_tasha_late_probe,
40};
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +053041
42static struct snd_soc_ops msm_ext_slimbus_be_ops = {
43 .hw_params = msm_snd_hw_params,
44};
45
46static struct snd_soc_ops msm_ext_cpe_ops = {
47 .hw_params = msm_snd_cpe_hw_params,
48};
49
50static struct snd_soc_ops msm_ext_slimbus_2_be_ops = {
51 .hw_params = msm_ext_slimbus_2_hw_params,
52};
53
54static struct snd_soc_ops msm_mi2s_be_ops = {
55 .startup = msm_mi2s_snd_startup,
56 .shutdown = msm_mi2s_snd_shutdown,
57};
58
59static struct snd_soc_ops msm_aux_pcm_be_ops = {
60 .startup = msm_aux_pcm_snd_startup,
61 .shutdown = msm_aux_pcm_snd_shutdown,
62};
63
64static int msm_wcn_init(struct snd_soc_pcm_runtime *rtd)
65{
66 unsigned int rx_ch[WCN_CDC_SLIM_RX_CH_MAX] = {157, 158};
67 unsigned int tx_ch[WCN_CDC_SLIM_TX_CH_MAX] = {159, 160, 161};
68 struct snd_soc_dai *codec_dai = rtd->codec_dai;
69
70 return snd_soc_dai_set_channel_map(codec_dai, ARRAY_SIZE(tx_ch),
71 tx_ch, ARRAY_SIZE(rx_ch), rx_ch);
72}
73
74static int msm_wcn_hw_params(struct snd_pcm_substream *substream,
75 struct snd_pcm_hw_params *params)
76{
77 struct snd_soc_pcm_runtime *rtd = substream->private_data;
78 struct snd_soc_dai *codec_dai = rtd->codec_dai;
79 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
80 struct snd_soc_dai_link *dai_link = rtd->dai_link;
81 u32 rx_ch[WCN_CDC_SLIM_RX_CH_MAX], tx_ch[WCN_CDC_SLIM_TX_CH_MAX];
82 u32 rx_ch_cnt = 0, tx_ch_cnt = 0;
83 int ret;
84
85 dev_dbg(rtd->dev, "%s: %s_tx_dai_id_%d\n", __func__,
86 codec_dai->name, codec_dai->id);
87 ret = snd_soc_dai_get_channel_map(codec_dai,
88 &tx_ch_cnt, tx_ch, &rx_ch_cnt, rx_ch);
89 if (ret) {
90 dev_err(rtd->dev,
91 "%s: failed to get BTFM codec chan map\n, err:%d\n",
92 __func__, ret);
93 goto exit;
94 }
95
Asish Bhattacharya84f7f732017-07-25 16:29:27 +053096 dev_dbg(rtd->dev, "%s: tx_ch_cnt(%d) id %d\n",
97 __func__, tx_ch_cnt, dai_link->id);
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +053098
99 ret = snd_soc_dai_set_channel_map(cpu_dai,
100 tx_ch_cnt, tx_ch, rx_ch_cnt, rx_ch);
101 if (ret)
102 dev_err(rtd->dev, "%s: failed to set cpu chan map, err:%d\n",
103 __func__, ret);
104
105exit:
106 return ret;
107}
108
109static struct snd_soc_ops msm_wcn_ops = {
110 .hw_params = msm_wcn_hw_params,
111};
112
113/*TDM default offset currently only supporting TDM_RX_0 and TDM_TX_0 */
114static unsigned int tdm_slot_offset[TDM_PORT_MAX][TDM_SLOT_OFFSET_MAX] = {
115 {0, 4, 8, 12, 16, 20, 24, 28},/* TX_0 | RX_0 */
116 {AFE_SLOT_MAPPING_OFFSET_INVALID},/* TX_1 | RX_1 */
117 {AFE_SLOT_MAPPING_OFFSET_INVALID},/* TX_2 | RX_2 */
118 {AFE_SLOT_MAPPING_OFFSET_INVALID},/* TX_3 | RX_3 */
119 {AFE_SLOT_MAPPING_OFFSET_INVALID},/* TX_4 | RX_4 */
120 {AFE_SLOT_MAPPING_OFFSET_INVALID},/* TX_5 | RX_5 */
121 {AFE_SLOT_MAPPING_OFFSET_INVALID},/* TX_6 | RX_6 */
122 {AFE_SLOT_MAPPING_OFFSET_INVALID},/* TX_7 | RX_7 */
123};
124
125static unsigned int tdm_param_set_slot_mask(u16 port_id, int slot_width,
126 int slots)
127{
128 unsigned int slot_mask = 0;
129 int i, j;
130 unsigned int *slot_offset;
131
132 for (i = TDM_0; i < TDM_PORT_MAX; i++) {
133 slot_offset = tdm_slot_offset[i];
134
135 for (j = 0; j < TDM_SLOT_OFFSET_MAX; j++) {
136 if (slot_offset[j] != AFE_SLOT_MAPPING_OFFSET_INVALID)
137 slot_mask |=
138 (1 << ((slot_offset[j] * 8) / slot_width));
139 else
140 break;
141 }
142 }
143
144 return slot_mask;
145}
146
147static int msm_tdm_snd_hw_params(struct snd_pcm_substream *substream,
148 struct snd_pcm_hw_params *params)
149{
150 struct snd_soc_pcm_runtime *rtd = substream->private_data;
151 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
152 int ret = 0;
153 int channels, slot_width, slots;
154 unsigned int slot_mask;
155 unsigned int *slot_offset;
156 int offset_channels = 0;
157 int i;
158
159 pr_debug("%s: dai id = 0x%x\n", __func__, cpu_dai->id);
160
161 channels = params_channels(params);
162 switch (channels) {
163 case 1:
164 case 2:
165 case 3:
166 case 4:
167 case 5:
168 case 6:
169 case 7:
170 case 8:
171 switch (params_format(params)) {
172 case SNDRV_PCM_FORMAT_S32_LE:
173 case SNDRV_PCM_FORMAT_S24_LE:
174 case SNDRV_PCM_FORMAT_S16_LE:
175 /*
176 * up to 8 channels HW config should
177 * use 32 bit slot width for max support of
178 * stream bit width. (slot_width > bit_width)
179 */
180 slot_width = 32;
181 break;
182 default:
183 pr_err("%s: invalid param format 0x%x\n",
184 __func__, params_format(params));
185 return -EINVAL;
186 }
187 slots = 8;
188 slot_mask = tdm_param_set_slot_mask(cpu_dai->id,
189 slot_width,
190 slots);
191 if (!slot_mask) {
192 pr_err("%s: invalid slot_mask 0x%x\n",
193 __func__, slot_mask);
194 return -EINVAL;
195 }
196 break;
197 default:
198 pr_err("%s: invalid param channels %d\n",
199 __func__, channels);
200 return -EINVAL;
201 }
202 /* currently only supporting TDM_RX_0 and TDM_TX_0 */
203 switch (cpu_dai->id) {
204 case AFE_PORT_ID_PRIMARY_TDM_RX:
205 case AFE_PORT_ID_SECONDARY_TDM_RX:
206 case AFE_PORT_ID_TERTIARY_TDM_RX:
207 case AFE_PORT_ID_QUATERNARY_TDM_RX:
Rohit Kumard1754482017-09-10 22:57:39 +0530208 case AFE_PORT_ID_QUINARY_TDM_RX:
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530209 case AFE_PORT_ID_PRIMARY_TDM_TX:
210 case AFE_PORT_ID_SECONDARY_TDM_TX:
211 case AFE_PORT_ID_TERTIARY_TDM_TX:
212 case AFE_PORT_ID_QUATERNARY_TDM_TX:
Rohit Kumard1754482017-09-10 22:57:39 +0530213 case AFE_PORT_ID_QUINARY_TDM_TX:
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530214 slot_offset = tdm_slot_offset[TDM_0];
215 break;
216 default:
217 pr_err("%s: dai id 0x%x not supported\n",
218 __func__, cpu_dai->id);
219 return -EINVAL;
220 }
221
222 for (i = 0; i < TDM_SLOT_OFFSET_MAX; i++) {
223 if (slot_offset[i] != AFE_SLOT_MAPPING_OFFSET_INVALID)
224 offset_channels++;
225 else
226 break;
227 }
228
229 if (offset_channels == 0) {
230 pr_err("%s: slot offset not supported, offset_channels %d\n",
231 __func__, offset_channels);
232 return -EINVAL;
233 }
234
235 if (channels > offset_channels) {
236 pr_err("%s: channels %d exceed offset_channels %d\n",
237 __func__, channels, offset_channels);
238 return -EINVAL;
239 }
240
241 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
242 ret = snd_soc_dai_set_tdm_slot(cpu_dai, 0, slot_mask,
243 slots, slot_width);
244 if (ret < 0) {
245 pr_err("%s: failed to set tdm slot, err:%d\n",
246 __func__, ret);
247 goto end;
248 }
249
250 ret = snd_soc_dai_set_channel_map(cpu_dai, 0, NULL,
251 channels, slot_offset);
252 if (ret < 0) {
253 pr_err("%s: failed to set channel map, err:%d\n",
254 __func__, ret);
255 goto end;
256 }
257 } else {
258 ret = snd_soc_dai_set_tdm_slot(cpu_dai, slot_mask, 0,
259 slots, slot_width);
260 if (ret < 0) {
261 pr_err("%s: failed to set tdm slot, err:%d\n",
262 __func__, ret);
263 goto end;
264 }
265
266 ret = snd_soc_dai_set_channel_map(cpu_dai, channels,
267 slot_offset, 0, NULL);
268 if (ret < 0) {
269 pr_err("%s: failed to set channel map, err:%d\n",
270 __func__, ret);
271 goto end;
272 }
273 }
274end:
275 return ret;
276}
277
278static struct snd_soc_ops msm_tdm_be_ops = {
279 .hw_params = msm_tdm_snd_hw_params
280};
281
282static struct snd_soc_dai_link msm_ext_tasha_fe_dai[] = {
283 /* tasha_vifeedback for speaker protection */
284 {
285 .name = LPASS_BE_SLIMBUS_4_TX,
286 .stream_name = "Slimbus4 Capture",
287 .cpu_dai_name = "msm-dai-q6-dev.16393",
288 .platform_name = "msm-pcm-hostless",
289 .codec_name = "tasha_codec",
290 .codec_dai_name = "tasha_vifeedback",
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530291 .id = MSM_BACKEND_DAI_SLIMBUS_4_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530292 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
293 .ops = &msm_ext_slimbus_be_ops,
294 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
295 .ignore_suspend = 1,
296 },
297 /* Ultrasound RX DAI Link */
298 {
299 .name = "SLIMBUS_2 Hostless Playback",
300 .stream_name = "SLIMBUS_2 Hostless Playback",
301 .cpu_dai_name = "msm-dai-q6-dev.16388",
302 .platform_name = "msm-pcm-hostless",
303 .codec_name = "tasha_codec",
304 .codec_dai_name = "tasha_rx2",
305 .ignore_suspend = 1,
306 .dpcm_playback = 1,
307 .dpcm_capture = 1,
308 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
309 .ops = &msm_ext_slimbus_2_be_ops,
310 },
311 /* Ultrasound TX DAI Link */
312 {
313 .name = "SLIMBUS_2 Hostless Capture",
314 .stream_name = "SLIMBUS_2 Hostless Capture",
315 .cpu_dai_name = "msm-dai-q6-dev.16389",
316 .platform_name = "msm-pcm-hostless",
317 .codec_name = "tasha_codec",
318 .codec_dai_name = "tasha_tx2",
319 .ignore_suspend = 1,
320 .dpcm_capture = 1,
321 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
322 .ops = &msm_ext_slimbus_2_be_ops,
323 },
324 /* CPE LSM direct dai-link */
325 {
326 .name = "CPE Listen service",
327 .stream_name = "CPE Listen Audio Service",
328 .cpu_dai_name = "msm-dai-slim",
329 .platform_name = "msm-cpe-lsm",
330 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
331 SND_SOC_DPCM_TRIGGER_POST},
332 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
333 .ignore_suspend = 1,
334 .dpcm_capture = 1,
335 .ignore_pmdown_time = 1,
336 .codec_dai_name = "tasha_mad1",
337 .codec_name = "tasha_codec",
338 .ops = &msm_ext_cpe_ops,
339 },
340 {
341 .name = "SLIMBUS_6 Hostless Playback",
342 .stream_name = "SLIMBUS_6 Hostless",
343 .cpu_dai_name = "SLIMBUS6_HOSTLESS",
344 .platform_name = "msm-pcm-hostless",
345 .dynamic = 1,
346 .dpcm_playback = 1,
347 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
348 SND_SOC_DPCM_TRIGGER_POST},
349 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
350 .ignore_suspend = 1,
351 /* this dailink has playback support */
352 .ignore_pmdown_time = 1,
353 .codec_dai_name = "snd-soc-dummy-dai",
354 .codec_name = "snd-soc-dummy",
355 },
356 /* CPE LSM EC PP direct dai-link */
357 {
358 .name = "CPE Listen service ECPP",
359 .stream_name = "CPE Listen Audio Service ECPP",
360 .cpu_dai_name = "CPE_LSM_NOHOST",
361 .platform_name = "msm-cpe-lsm.3",
362 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
363 SND_SOC_DPCM_TRIGGER_POST},
364 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
365 .ignore_suspend = 1,
366 .ignore_pmdown_time = 1,
367 .codec_dai_name = "tasha_cpe",
368 .codec_name = "tasha_codec",
369 },
370};
371
372static struct snd_soc_dai_link msm_ext_tavil_fe_dai[] = {
373 {
374 .name = LPASS_BE_SLIMBUS_4_TX,
375 .stream_name = "Slimbus4 Capture",
376 .cpu_dai_name = "msm-dai-q6-dev.16393",
377 .platform_name = "msm-pcm-hostless",
378 .codec_name = "tavil_codec",
379 .codec_dai_name = "tavil_vifeedback",
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530380 .id = MSM_BACKEND_DAI_SLIMBUS_4_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530381 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
382 .ops = &msm_ext_slimbus_be_ops,
383 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
384 .ignore_suspend = 1,
385 },
386 /* Ultrasound RX DAI Link */
387 {
388 .name = "SLIMBUS_2 Hostless Playback",
389 .stream_name = "SLIMBUS_2 Hostless Playback",
390 .cpu_dai_name = "msm-dai-q6-dev.16388",
391 .platform_name = "msm-pcm-hostless",
392 .codec_name = "tavil_codec",
393 .codec_dai_name = "tavil_rx2",
394 .ignore_suspend = 1,
395 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
396 .ops = &msm_ext_slimbus_2_be_ops,
397 },
398 /* Ultrasound TX DAI Link */
399 {
400 .name = "SLIMBUS_2 Hostless Capture",
401 .stream_name = "SLIMBUS_2 Hostless Capture",
402 .cpu_dai_name = "msm-dai-q6-dev.16389",
403 .platform_name = "msm-pcm-hostless",
404 .codec_name = "tavil_codec",
405 .codec_dai_name = "tavil_tx2",
406 .ignore_suspend = 1,
407 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
408 .ops = &msm_ext_slimbus_2_be_ops,
409 },
410};
411
412static struct snd_soc_dai_link msm_ext_tasha_be_dai[] = {
413 /* Backend DAI Links */
414 {
415 .name = LPASS_BE_SLIMBUS_0_RX,
416 .stream_name = "Slimbus Playback",
417 .cpu_dai_name = "msm-dai-q6-dev.16384",
418 .platform_name = "msm-pcm-routing",
419 .codec_name = "tasha_codec",
420 .codec_dai_name = "tasha_mix_rx1",
421 .no_pcm = 1,
422 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530423 .id = MSM_BACKEND_DAI_SLIMBUS_0_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530424 .init = &msm_audrx_init,
425 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
426 /* this dainlink has playback support */
427 .ignore_pmdown_time = 1,
428 .ignore_suspend = 1,
429 .ops = &msm_ext_slimbus_be_ops,
430 },
431 {
432 .name = LPASS_BE_SLIMBUS_0_TX,
433 .stream_name = "Slimbus Capture",
434 .cpu_dai_name = "msm-dai-q6-dev.16385",
435 .platform_name = "msm-pcm-routing",
436 .codec_name = "tasha_codec",
437 .codec_dai_name = "tasha_tx1",
438 .no_pcm = 1,
439 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530440 .id = MSM_BACKEND_DAI_SLIMBUS_0_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530441 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
442 .ignore_suspend = 1,
443 .ops = &msm_ext_slimbus_be_ops,
444 },
445 {
446 .name = LPASS_BE_SLIMBUS_1_RX,
447 .stream_name = "Slimbus1 Playback",
448 .cpu_dai_name = "msm-dai-q6-dev.16386",
449 .platform_name = "msm-pcm-routing",
450 .codec_name = "tasha_codec",
451 .codec_dai_name = "tasha_mix_rx1",
452 .no_pcm = 1,
453 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530454 .id = MSM_BACKEND_DAI_SLIMBUS_1_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530455 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
456 .ops = &msm_ext_slimbus_be_ops,
457 /* dai link has playback support */
458 .ignore_pmdown_time = 1,
459 .ignore_suspend = 1,
460 },
461 {
462 .name = LPASS_BE_SLIMBUS_1_TX,
463 .stream_name = "Slimbus1 Capture",
464 .cpu_dai_name = "msm-dai-q6-dev.16387",
465 .platform_name = "msm-pcm-routing",
466 .codec_name = "tasha_codec",
467 .codec_dai_name = "tasha_tx3",
468 .no_pcm = 1,
469 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530470 .id = MSM_BACKEND_DAI_SLIMBUS_1_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530471 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
472 .ops = &msm_ext_slimbus_be_ops,
473 .ignore_suspend = 1,
474 },
475 {
476 .name = LPASS_BE_SLIMBUS_3_RX,
477 .stream_name = "Slimbus3 Playback",
478 .cpu_dai_name = "msm-dai-q6-dev.16390",
479 .platform_name = "msm-pcm-routing",
480 .codec_name = "tasha_codec",
481 .codec_dai_name = "tasha_mix_rx1",
482 .no_pcm = 1,
483 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530484 .id = MSM_BACKEND_DAI_SLIMBUS_3_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530485 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
486 .ops = &msm_ext_slimbus_be_ops,
487 /* dai link has playback support */
488 .ignore_pmdown_time = 1,
489 .ignore_suspend = 1,
490 },
491 {
492 .name = LPASS_BE_SLIMBUS_3_TX,
493 .stream_name = "Slimbus3 Capture",
494 .cpu_dai_name = "msm-dai-q6-dev.16391",
495 .platform_name = "msm-pcm-routing",
496 .codec_name = "tasha_codec",
497 .codec_dai_name = "tasha_tx1",
498 .no_pcm = 1,
499 .dpcm_capture = 1,
500 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530501 .id = MSM_BACKEND_DAI_SLIMBUS_3_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530502 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
503 .ops = &msm_ext_slimbus_be_ops,
504 .ignore_suspend = 1,
505 },
506 {
507 .name = LPASS_BE_SLIMBUS_4_RX,
508 .stream_name = "Slimbus4 Playback",
509 .cpu_dai_name = "msm-dai-q6-dev.16392",
510 .platform_name = "msm-pcm-routing",
511 .codec_name = "tasha_codec",
512 .codec_dai_name = "tasha_mix_rx1",
513 .no_pcm = 1,
514 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530515 .id = MSM_BACKEND_DAI_SLIMBUS_4_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530516 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
517 .ops = &msm_ext_slimbus_be_ops,
518 /* dai link has playback support */
519 .ignore_pmdown_time = 1,
520 .ignore_suspend = 1,
521 },
522 {
523 .name = LPASS_BE_SLIMBUS_5_RX,
524 .stream_name = "Slimbus5 Playback",
525 .cpu_dai_name = "msm-dai-q6-dev.16394",
526 .platform_name = "msm-pcm-routing",
527 .codec_name = "tasha_codec",
528 .codec_dai_name = "tasha_rx3",
529 .no_pcm = 1,
530 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530531 .id = MSM_BACKEND_DAI_SLIMBUS_5_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530532 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
533 .ops = &msm_ext_slimbus_be_ops,
534 /* dai link has playback support */
535 .ignore_pmdown_time = 1,
536 .ignore_suspend = 1,
537 },
538 /* MAD BE */
539 {
540 .name = LPASS_BE_SLIMBUS_5_TX,
541 .stream_name = "Slimbus5 Capture",
542 .cpu_dai_name = "msm-dai-q6-dev.16395",
543 .platform_name = "msm-pcm-routing",
544 .codec_name = "tasha_codec",
545 .codec_dai_name = "tasha_mad1",
546 .no_pcm = 1,
547 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530548 .id = MSM_BACKEND_DAI_SLIMBUS_5_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530549 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
550 .ops = &msm_ext_slimbus_be_ops,
551 .ignore_suspend = 1,
552 },
553 {
554 .name = LPASS_BE_SLIMBUS_6_RX,
555 .stream_name = "Slimbus6 Playback",
556 .cpu_dai_name = "msm-dai-q6-dev.16396",
557 .platform_name = "msm-pcm-routing",
558 .codec_name = "tasha_codec",
559 .codec_dai_name = "tasha_rx4",
560 .no_pcm = 1,
561 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530562 .id = MSM_BACKEND_DAI_SLIMBUS_6_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530563 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
564 .ops = &msm_ext_slimbus_be_ops,
565 /* dai link has playback support */
566 .ignore_pmdown_time = 1,
567 .ignore_suspend = 1,
568 },
569};
570
571static struct snd_soc_dai_link msm_ext_tavil_be_dai[] = {
572 {
573 .name = LPASS_BE_SLIMBUS_0_RX,
574 .stream_name = "Slimbus Playback",
575 .cpu_dai_name = "msm-dai-q6-dev.16384",
576 .platform_name = "msm-pcm-routing",
577 .codec_name = "tavil_codec",
578 .codec_dai_name = "tavil_rx1",
579 .no_pcm = 1,
580 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530581 .id = MSM_BACKEND_DAI_SLIMBUS_0_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530582 .init = &msm_audrx_init,
583 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
584 /* this dainlink has playback support */
585 .ignore_pmdown_time = 1,
586 .ignore_suspend = 1,
587 .ops = &msm_ext_slimbus_be_ops,
588 },
589 {
590 .name = LPASS_BE_SLIMBUS_0_TX,
591 .stream_name = "Slimbus Capture",
592 .cpu_dai_name = "msm-dai-q6-dev.16385",
593 .platform_name = "msm-pcm-routing",
594 .codec_name = "tavil_codec",
595 .codec_dai_name = "tavil_tx1",
596 .no_pcm = 1,
597 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530598 .id = MSM_BACKEND_DAI_SLIMBUS_0_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530599 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
600 .ignore_suspend = 1,
601 .ops = &msm_ext_slimbus_be_ops,
602 },
603 {
604 .name = LPASS_BE_SLIMBUS_1_RX,
605 .stream_name = "Slimbus1 Playback",
606 .cpu_dai_name = "msm-dai-q6-dev.16386",
607 .platform_name = "msm-pcm-routing",
608 .codec_name = "tavil_codec",
609 .codec_dai_name = "tavil_rx1",
610 .no_pcm = 1,
611 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530612 .id = MSM_BACKEND_DAI_SLIMBUS_1_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530613 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
614 .ops = &msm_ext_slimbus_be_ops,
615 /* dai link has playback support */
616 .ignore_pmdown_time = 1,
617 .ignore_suspend = 1,
618 },
619 {
620 .name = LPASS_BE_SLIMBUS_1_TX,
621 .stream_name = "Slimbus1 Capture",
622 .cpu_dai_name = "msm-dai-q6-dev.16387",
623 .platform_name = "msm-pcm-routing",
624 .codec_name = "tavil_codec",
625 .codec_dai_name = "tavil_tx3",
626 .no_pcm = 1,
627 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530628 .id = MSM_BACKEND_DAI_SLIMBUS_1_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530629 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
630 .ops = &msm_ext_slimbus_be_ops,
631 .ignore_suspend = 1,
632 },
633 {
634 .name = LPASS_BE_SLIMBUS_2_RX,
635 .stream_name = "Slimbus2 Playback",
636 .cpu_dai_name = "msm-dai-q6-dev.16388",
637 .platform_name = "msm-pcm-routing",
638 .codec_name = "tavil_codec",
639 .codec_dai_name = "tavil_rx2",
640 .no_pcm = 1,
641 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530642 .id = MSM_BACKEND_DAI_SLIMBUS_2_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530643 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
644 .ops = &msm_ext_slimbus_be_ops,
645 .ignore_pmdown_time = 1,
646 .ignore_suspend = 1,
647 },
648 {
649 .name = LPASS_BE_SLIMBUS_3_RX,
650 .stream_name = "Slimbus3 Playback",
651 .cpu_dai_name = "msm-dai-q6-dev.16390",
652 .platform_name = "msm-pcm-routing",
653 .codec_name = "tavil_codec",
654 .codec_dai_name = "tavil_rx1",
655 .no_pcm = 1,
656 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530657 .id = MSM_BACKEND_DAI_SLIMBUS_3_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530658 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
659 .ops = &msm_ext_slimbus_be_ops,
660 /* dai link has playback support */
661 .ignore_pmdown_time = 1,
662 .ignore_suspend = 1,
663 },
664 {
665 .name = LPASS_BE_SLIMBUS_3_TX,
666 .stream_name = "Slimbus3 Capture",
667 .cpu_dai_name = "msm-dai-q6-dev.16391",
668 .platform_name = "msm-pcm-routing",
669 .codec_name = "tavil_codec",
670 .codec_dai_name = "tavil_tx1",
671 .no_pcm = 1,
672 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530673 .id = MSM_BACKEND_DAI_SLIMBUS_3_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530674 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
675 .ops = &msm_ext_slimbus_be_ops,
676 .ignore_suspend = 1,
677 },
678 {
679 .name = LPASS_BE_SLIMBUS_4_RX,
680 .stream_name = "Slimbus4 Playback",
681 .cpu_dai_name = "msm-dai-q6-dev.16392",
682 .platform_name = "msm-pcm-routing",
683 .codec_name = "tavil_codec",
684 .codec_dai_name = "tavil_rx1",
685 .no_pcm = 1,
686 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530687 .id = MSM_BACKEND_DAI_SLIMBUS_4_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530688 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
689 .ops = &msm_ext_slimbus_be_ops,
690 /* dai link has playback support */
691 .ignore_pmdown_time = 1,
692 .ignore_suspend = 1,
693 },
694 {
695 .name = LPASS_BE_SLIMBUS_5_RX,
696 .stream_name = "Slimbus5 Playback",
697 .cpu_dai_name = "msm-dai-q6-dev.16394",
698 .platform_name = "msm-pcm-routing",
699 .codec_name = "tavil_codec",
700 .codec_dai_name = "tavil_rx3",
701 .no_pcm = 1,
702 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530703 .id = MSM_BACKEND_DAI_SLIMBUS_5_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530704 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
705 .ops = &msm_ext_slimbus_be_ops,
706 /* dai link has playback support */
707 .ignore_pmdown_time = 1,
708 .ignore_suspend = 1,
709 },
710 /* MAD BE */
711 {
712 .name = LPASS_BE_SLIMBUS_5_TX,
713 .stream_name = "Slimbus5 Capture",
714 .cpu_dai_name = "msm-dai-q6-dev.16395",
715 .platform_name = "msm-pcm-routing",
716 .codec_name = "tavil_codec",
717 .codec_dai_name = "tavil_mad1",
718 .no_pcm = 1,
719 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530720 .id = MSM_BACKEND_DAI_SLIMBUS_5_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530721 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
722 .ops = &msm_ext_slimbus_be_ops,
723 .ignore_suspend = 1,
724 },
725 {
726 .name = LPASS_BE_SLIMBUS_6_RX,
727 .stream_name = "Slimbus6 Playback",
728 .cpu_dai_name = "msm-dai-q6-dev.16396",
729 .platform_name = "msm-pcm-routing",
730 .codec_name = "tavil_codec",
731 .codec_dai_name = "tavil_rx4",
732 .no_pcm = 1,
733 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530734 .id = MSM_BACKEND_DAI_SLIMBUS_6_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530735 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
736 .ops = &msm_ext_slimbus_be_ops,
737 /* dai link has playback support */
738 .ignore_pmdown_time = 1,
739 .ignore_suspend = 1,
740 },
741};
742
743static struct snd_soc_dai_link msm_ext_common_fe_dai[] = {
744 /* FrontEnd DAI Links */
745 {/* hw:x,0 */
746 .name = MSM_DAILINK_NAME(Media1),
747 .stream_name = "MultiMedia1",
748 .cpu_dai_name = "MultiMedia1",
749 .platform_name = "msm-pcm-dsp.0",
750 .dynamic = 1,
751 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
752 SND_SOC_DPCM_TRIGGER_POST},
753 .codec_dai_name = "snd-soc-dummy-dai",
754 .codec_name = "snd-soc-dummy",
755 .ignore_suspend = 1,
756 .dpcm_playback = 1,
757 .dpcm_capture = 1,
758 /* this dai link has playback support */
759 .ignore_pmdown_time = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530760 .id = MSM_FRONTEND_DAI_MULTIMEDIA1
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530761 },
762 {/* hw:x,1 */
763 .name = MSM_DAILINK_NAME(Media2),
764 .stream_name = "MultiMedia2",
765 .cpu_dai_name = "MultiMedia2",
766 .platform_name = "msm-pcm-dsp.0",
767 .dynamic = 1,
768 .dpcm_playback = 1,
769 .dpcm_capture = 1,
770 .codec_dai_name = "snd-soc-dummy-dai",
771 .codec_name = "snd-soc-dummy",
772 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
773 SND_SOC_DPCM_TRIGGER_POST},
774 .ignore_suspend = 1,
775 /* this dai link has playback support */
776 .ignore_pmdown_time = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530777 .id = MSM_FRONTEND_DAI_MULTIMEDIA2,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530778 },
779 {/* hw:x,2 */
780 .name = "VoiceMMode1",
781 .stream_name = "VoiceMMode1",
782 .cpu_dai_name = "VoiceMMode1",
783 .platform_name = "msm-pcm-voice",
784 .dynamic = 1,
785 .dpcm_capture = 1,
786 .dpcm_playback = 1,
787 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
788 SND_SOC_DPCM_TRIGGER_POST},
789 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
790 .ignore_suspend = 1,
791 .ignore_pmdown_time = 1,
792 .codec_dai_name = "snd-soc-dummy-dai",
793 .codec_name = "snd-soc-dummy",
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530794 .id = MSM_FRONTEND_DAI_VOICEMMODE1,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530795 },
796 {/* hw:x,3 */
797 .name = "MSM VoIP",
798 .stream_name = "VoIP",
799 .cpu_dai_name = "VoIP",
800 .platform_name = "msm-voip-dsp",
801 .dynamic = 1,
802 .dpcm_playback = 1,
803 .dpcm_capture = 1,
804 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
805 SND_SOC_DPCM_TRIGGER_POST},
806 .codec_dai_name = "snd-soc-dummy-dai",
807 .codec_name = "snd-soc-dummy",
808 .ignore_suspend = 1,
809 /* this dai link has playback support */
810 .ignore_pmdown_time = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530811 .id = MSM_FRONTEND_DAI_VOIP,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530812 },
813 {/* hw:x,4 */
814 .name = MSM_DAILINK_NAME(ULL),
815 .stream_name = "ULL",
816 .cpu_dai_name = "MultiMedia3",
817 .platform_name = "msm-pcm-dsp.2",
818 .dynamic = 1,
819 .dpcm_playback = 1,
820 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
821 SND_SOC_DPCM_TRIGGER_POST},
822 .codec_dai_name = "snd-soc-dummy-dai",
823 .codec_name = "snd-soc-dummy",
824 .ignore_suspend = 1,
825 /* this dai link has playback support */
826 .ignore_pmdown_time = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530827 .id = MSM_FRONTEND_DAI_MULTIMEDIA3,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530828 },
829 /* Hostless PCM purpose */
830 {/* hw:x,5 */
831 .name = "SLIMBUS_0 Hostless",
832 .stream_name = "SLIMBUS_0 Hostless",
833 .cpu_dai_name = "SLIMBUS0_HOSTLESS",
834 .platform_name = "msm-pcm-hostless",
835 .dynamic = 1,
836 .dpcm_capture = 1,
837 .dpcm_playback = 1,
838 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
839 SND_SOC_DPCM_TRIGGER_POST},
840 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
841 .ignore_suspend = 1,
842 .ignore_pmdown_time = 1,
843 /* This dai link has MI2S support */
844 .codec_dai_name = "snd-soc-dummy-dai",
845 .codec_name = "snd-soc-dummy",
846 },
847 {/* hw:x,6 */
848 .name = "MSM AFE-PCM RX",
849 .stream_name = "AFE-PROXY RX",
850 .cpu_dai_name = "msm-dai-q6-dev.241",
851 .codec_name = "msm-stub-codec.1",
852 .codec_dai_name = "msm-stub-rx",
853 .platform_name = "msm-pcm-afe",
854 .ignore_suspend = 1,
855 /* this dai link has playback support */
856 .ignore_pmdown_time = 1,
857 },
858 {/* hw:x,7 */
859 .name = "MSM AFE-PCM TX",
860 .stream_name = "AFE-PROXY TX",
861 .cpu_dai_name = "msm-dai-q6-dev.240",
862 .codec_name = "msm-stub-codec.1",
863 .codec_dai_name = "msm-stub-tx",
864 .platform_name = "msm-pcm-afe",
865 .ignore_suspend = 1,
866 },
867 {/* hw:x,8 */
868 .name = MSM_DAILINK_NAME(Compress1),
869 .stream_name = "Compress1",
870 .cpu_dai_name = "MultiMedia4",
871 .platform_name = "msm-compress-dsp",
872 .async_ops = ASYNC_DPCM_SND_SOC_HW_PARAMS,
873 .dynamic = 1,
874 .dpcm_capture = 1,
875 .dpcm_playback = 1,
876 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
877 SND_SOC_DPCM_TRIGGER_POST},
878 .codec_dai_name = "snd-soc-dummy-dai",
879 .codec_name = "snd-soc-dummy",
880 .ignore_suspend = 1,
881 .ignore_pmdown_time = 1,
882 /* this dai link has playback support */
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530883 .id = MSM_FRONTEND_DAI_MULTIMEDIA4,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530884 },
885 {/* hw:x,9*/
886 .name = "AUXPCM Hostless",
887 .stream_name = "AUXPCM Hostless",
888 .cpu_dai_name = "AUXPCM_HOSTLESS",
889 .platform_name = "msm-pcm-hostless",
890 .dynamic = 1,
891 .dpcm_capture = 1,
892 .dpcm_playback = 1,
893 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
894 SND_SOC_DPCM_TRIGGER_POST},
895 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
896 .ignore_suspend = 1,
897 /* this dai link has playback support */
898 .ignore_pmdown_time = 1,
899 .codec_dai_name = "snd-soc-dummy-dai",
900 .codec_name = "snd-soc-dummy",
901 },
902 {/* hw:x,10 */
903 .name = "SLIMBUS_1 Hostless",
904 .stream_name = "SLIMBUS_1 Hostless",
905 .cpu_dai_name = "SLIMBUS1_HOSTLESS",
906 .platform_name = "msm-pcm-hostless",
907 .dynamic = 1,
908 .dpcm_capture = 1,
909 .dpcm_playback = 1,
910 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
911 SND_SOC_DPCM_TRIGGER_POST},
912 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
913 .ignore_suspend = 1,
914 .ignore_pmdown_time = 1, /* dai link has playback support */
915 .codec_dai_name = "snd-soc-dummy-dai",
916 .codec_name = "snd-soc-dummy",
917 },
918 {/* hw:x,11 */
919 .name = "SLIMBUS_3 Hostless",
920 .stream_name = "SLIMBUS_3 Hostless",
921 .cpu_dai_name = "SLIMBUS3_HOSTLESS",
922 .platform_name = "msm-pcm-hostless",
923 .dynamic = 1,
924 .dpcm_capture = 1,
925 .dpcm_playback = 1,
926 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
927 SND_SOC_DPCM_TRIGGER_POST},
928 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
929 .ignore_suspend = 1,
930 .ignore_pmdown_time = 1, /* dai link has playback support */
931 .codec_dai_name = "snd-soc-dummy-dai",
932 .codec_name = "snd-soc-dummy",
933 },
934 {/* hw:x,12 */
935 .name = "SLIMBUS_4 Hostless",
936 .stream_name = "SLIMBUS_4 Hostless",
937 .cpu_dai_name = "SLIMBUS4_HOSTLESS",
938 .platform_name = "msm-pcm-hostless",
939 .dynamic = 1,
940 .dpcm_capture = 1,
941 .dpcm_playback = 1,
942 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
943 SND_SOC_DPCM_TRIGGER_POST},
944 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
945 .ignore_suspend = 1,
946 .ignore_pmdown_time = 1, /* dai link has playback support */
947 .codec_dai_name = "snd-soc-dummy-dai",
948 .codec_name = "snd-soc-dummy",
949 },
950 {/* hw:x,13 */
951 .name = MSM_DAILINK_NAME(LowLatency),
952 .stream_name = "MultiMedia5",
953 .cpu_dai_name = "MultiMedia5",
954 .platform_name = "msm-pcm-dsp.1",
955 .dynamic = 1,
956 .dpcm_capture = 1,
957 .dpcm_playback = 1,
958 .codec_dai_name = "snd-soc-dummy-dai",
959 .codec_name = "snd-soc-dummy",
960 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
961 SND_SOC_DPCM_TRIGGER_POST},
962 .ignore_suspend = 1,
963 /* this dai link has playback support */
964 .ignore_pmdown_time = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530965 .id = MSM_FRONTEND_DAI_MULTIMEDIA5,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530966 },
967 /* LSM FE */
968 {/* hw:x,14 */
969 .name = "Listen 1 Audio Service",
970 .stream_name = "Listen 1 Audio Service",
971 .cpu_dai_name = "LSM1",
972 .platform_name = "msm-lsm-client",
973 .dynamic = 1,
974 .dpcm_capture = 1,
975 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
976 SND_SOC_DPCM_TRIGGER_POST },
977 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
978 .ignore_suspend = 1,
979 .ignore_pmdown_time = 1,
980 .codec_dai_name = "snd-soc-dummy-dai",
981 .codec_name = "snd-soc-dummy",
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530982 .id = MSM_FRONTEND_DAI_LSM1,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530983 },
984 {/* hw:x,15 */
985 .name = MSM_DAILINK_NAME(Compress2),
986 .stream_name = "Compress2",
987 .cpu_dai_name = "MultiMedia7",
988 .platform_name = "msm-compress-dsp",
989 .dynamic = 1,
990 .dpcm_capture = 1,
991 .dpcm_playback = 1,
992 .codec_dai_name = "snd-soc-dummy-dai",
993 .codec_name = "snd-soc-dummy",
994 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
995 SND_SOC_DPCM_TRIGGER_POST},
996 .ignore_suspend = 1,
997 /* this dai link has playback support */
998 .ignore_pmdown_time = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530999 .id = MSM_FRONTEND_DAI_MULTIMEDIA7,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301000 },
1001 {/* hw:x,16 */
Laxminath Kasam38070be2017-08-17 18:21:59 +05301002 .name = MSM_DAILINK_NAME(MultiMedia10),
1003 .stream_name = "MultiMedia10",
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301004 .cpu_dai_name = "MultiMedia10",
Laxminath Kasam38070be2017-08-17 18:21:59 +05301005 .platform_name = "msm-pcm-dsp.1",
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301006 .dynamic = 1,
1007 .dpcm_capture = 1,
1008 .dpcm_playback = 1,
Laxminath Kasam38070be2017-08-17 18:21:59 +05301009 .dpcm_capture = 1,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301010 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1011 SND_SOC_DPCM_TRIGGER_POST},
1012 .codec_dai_name = "snd-soc-dummy-dai",
1013 .codec_name = "snd-soc-dummy",
1014 .ignore_suspend = 1,
1015 .ignore_pmdown_time = 1,
1016 /* this dai link has playback support */
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301017 .id = MSM_FRONTEND_DAI_MULTIMEDIA10,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301018 },
1019 {/* hw:x,17 */
1020 .name = MSM_DAILINK_NAME(ULL_NOIRQ),
1021 .stream_name = "MM_NOIRQ",
1022 .cpu_dai_name = "MultiMedia8",
1023 .platform_name = "msm-pcm-dsp-noirq",
1024 .dynamic = 1,
1025 .dpcm_capture = 1,
1026 .dpcm_playback = 1,
1027 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1028 SND_SOC_DPCM_TRIGGER_POST},
1029 .codec_dai_name = "snd-soc-dummy-dai",
1030 .codec_name = "snd-soc-dummy",
1031 .ignore_suspend = 1,
1032 .ignore_pmdown_time = 1,
1033 /* this dai link has playback support */
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301034 .id = MSM_FRONTEND_DAI_MULTIMEDIA8,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301035 },
1036 {/* hw:x,18 */
1037 .name = "HDMI_RX_HOSTLESS",
1038 .stream_name = "HDMI_RX_HOSTLESS",
1039 .cpu_dai_name = "HDMI_HOSTLESS",
1040 .platform_name = "msm-pcm-hostless",
1041 .dynamic = 1,
1042 .dpcm_playback = 1,
1043 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1044 SND_SOC_DPCM_TRIGGER_POST},
1045 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
1046 .ignore_suspend = 1,
1047 .ignore_pmdown_time = 1,
1048 .codec_dai_name = "snd-soc-dummy-dai",
1049 .codec_name = "snd-soc-dummy",
1050 },
1051 {/* hw:x,19 */
1052 .name = "VoiceMMode2",
1053 .stream_name = "VoiceMMode2",
1054 .cpu_dai_name = "VoiceMMode2",
1055 .platform_name = "msm-pcm-voice",
1056 .dynamic = 1,
1057 .dpcm_capture = 1,
1058 .dpcm_playback = 1,
1059 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1060 SND_SOC_DPCM_TRIGGER_POST},
1061 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
1062 .ignore_suspend = 1,
1063 .ignore_pmdown_time = 1,
1064 .codec_dai_name = "snd-soc-dummy-dai",
1065 .codec_name = "snd-soc-dummy",
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301066 .id = MSM_FRONTEND_DAI_VOICEMMODE2,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301067 },
1068 {/* hw:x,20 */
1069 .name = "Listen 2 Audio Service",
1070 .stream_name = "Listen 2 Audio Service",
1071 .cpu_dai_name = "LSM2",
1072 .platform_name = "msm-lsm-client",
1073 .dynamic = 1,
1074 .dpcm_capture = 1,
1075 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1076 SND_SOC_DPCM_TRIGGER_POST },
1077 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
1078 .ignore_suspend = 1,
1079 .ignore_pmdown_time = 1,
1080 .codec_dai_name = "snd-soc-dummy-dai",
1081 .codec_name = "snd-soc-dummy",
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301082 .id = MSM_FRONTEND_DAI_LSM2,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301083 },
1084 {/* hw:x,21 */
1085 .name = "Listen 3 Audio Service",
1086 .stream_name = "Listen 3 Audio Service",
1087 .cpu_dai_name = "LSM3",
1088 .platform_name = "msm-lsm-client",
1089 .dynamic = 1,
1090 .dpcm_capture = 1,
1091 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1092 SND_SOC_DPCM_TRIGGER_POST },
1093 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
1094 .ignore_suspend = 1,
1095 .ignore_pmdown_time = 1,
1096 .codec_dai_name = "snd-soc-dummy-dai",
1097 .codec_name = "snd-soc-dummy",
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301098 .id = MSM_FRONTEND_DAI_LSM3,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301099 },
1100 {/* hw:x,22 */
1101 .name = "Listen 4 Audio Service",
1102 .stream_name = "Listen 4 Audio Service",
1103 .cpu_dai_name = "LSM4",
1104 .platform_name = "msm-lsm-client",
1105 .dynamic = 1,
1106 .dpcm_capture = 1,
1107 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1108 SND_SOC_DPCM_TRIGGER_POST },
1109 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
1110 .ignore_suspend = 1,
1111 .ignore_pmdown_time = 1,
1112 .codec_dai_name = "snd-soc-dummy-dai",
1113 .codec_name = "snd-soc-dummy",
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301114 .id = MSM_FRONTEND_DAI_LSM4,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301115 },
1116 {/* hw:x,23 */
1117 .name = "Listen 5 Audio Service",
1118 .stream_name = "Listen 5 Audio Service",
1119 .cpu_dai_name = "LSM5",
1120 .platform_name = "msm-lsm-client",
1121 .dynamic = 1,
1122 .dpcm_capture = 1,
1123 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1124 SND_SOC_DPCM_TRIGGER_POST },
1125 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
1126 .ignore_suspend = 1,
1127 .ignore_pmdown_time = 1,
1128 .codec_dai_name = "snd-soc-dummy-dai",
1129 .codec_name = "snd-soc-dummy",
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301130 .id = MSM_FRONTEND_DAI_LSM5,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301131 },
1132 {/* hw:x,24 */
1133 .name = "Listen 6 Audio Service",
1134 .stream_name = "Listen 6 Audio Service",
1135 .cpu_dai_name = "LSM6",
1136 .platform_name = "msm-lsm-client",
1137 .dynamic = 1,
1138 .dpcm_capture = 1,
1139 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1140 SND_SOC_DPCM_TRIGGER_POST },
1141 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
1142 .ignore_suspend = 1,
1143 .ignore_pmdown_time = 1,
1144 .codec_dai_name = "snd-soc-dummy-dai",
1145 .codec_name = "snd-soc-dummy",
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301146 .id = MSM_FRONTEND_DAI_LSM6
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301147 },
1148 {/* hw:x,25 */
1149 .name = "Listen 7 Audio Service",
1150 .stream_name = "Listen 7 Audio Service",
1151 .cpu_dai_name = "LSM7",
1152 .platform_name = "msm-lsm-client",
1153 .dynamic = 1,
1154 .dpcm_capture = 1,
1155 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1156 SND_SOC_DPCM_TRIGGER_POST },
1157 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
1158 .ignore_suspend = 1,
1159 .ignore_pmdown_time = 1,
1160 .codec_dai_name = "snd-soc-dummy-dai",
1161 .codec_name = "snd-soc-dummy",
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301162 .id = MSM_FRONTEND_DAI_LSM7,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301163 },
1164 {/* hw:x,26 */
1165 .name = "Listen 8 Audio Service",
1166 .stream_name = "Listen 8 Audio Service",
1167 .cpu_dai_name = "LSM8",
1168 .platform_name = "msm-lsm-client",
1169 .dynamic = 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",
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301178 .id = MSM_FRONTEND_DAI_LSM8,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301179 },
1180 {/* hw:x,27 */
1181 .name = MSM_DAILINK_NAME(Media9),
1182 .stream_name = "MultiMedia9",
1183 .cpu_dai_name = "MultiMedia9",
1184 .platform_name = "msm-pcm-dsp.0",
1185 .dynamic = 1,
1186 .dpcm_capture = 1,
1187 .dpcm_playback = 1,
1188 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1189 SND_SOC_DPCM_TRIGGER_POST},
1190 .codec_dai_name = "snd-soc-dummy-dai",
1191 .codec_name = "snd-soc-dummy",
1192 .ignore_suspend = 1,
1193 .ignore_pmdown_time = 1,
1194 /* this dai link has playback support */
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301195 .id = MSM_FRONTEND_DAI_MULTIMEDIA9,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301196 },
1197 {/* hw:x,28 */
1198 .name = MSM_DAILINK_NAME(Compress4),
1199 .stream_name = "Compress4",
1200 .cpu_dai_name = "MultiMedia11",
1201 .platform_name = "msm-compress-dsp",
1202 .dynamic = 1,
1203 .dpcm_capture = 1,
1204 .dpcm_playback = 1,
1205 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1206 SND_SOC_DPCM_TRIGGER_POST},
1207 .codec_dai_name = "snd-soc-dummy-dai",
1208 .codec_name = "snd-soc-dummy",
1209 .ignore_suspend = 1,
1210 .ignore_pmdown_time = 1,
1211 /* this dai link has playback support */
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301212 .id = MSM_FRONTEND_DAI_MULTIMEDIA11,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301213 },
1214 {/* hw:x,29 */
1215 .name = MSM_DAILINK_NAME(Compress5),
1216 .stream_name = "Compress5",
1217 .cpu_dai_name = "MultiMedia12",
1218 .platform_name = "msm-compress-dsp",
1219 .dynamic = 1,
1220 .dpcm_capture = 1,
1221 .dpcm_playback = 1,
1222 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1223 SND_SOC_DPCM_TRIGGER_POST},
1224 .codec_dai_name = "snd-soc-dummy-dai",
1225 .codec_name = "snd-soc-dummy",
1226 .ignore_suspend = 1,
1227 .ignore_pmdown_time = 1,
1228 /* this dai link has playback support */
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301229 .id = MSM_FRONTEND_DAI_MULTIMEDIA12,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301230 },
1231 {/* hw:x,30 */
1232 .name = MSM_DAILINK_NAME(Compress6),
1233 .stream_name = "Compress6",
1234 .cpu_dai_name = "MultiMedia13",
1235 .platform_name = "msm-compress-dsp",
1236 .dynamic = 1,
1237 .dpcm_capture = 1,
1238 .dpcm_playback = 1,
1239 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1240 SND_SOC_DPCM_TRIGGER_POST},
1241 .codec_dai_name = "snd-soc-dummy-dai",
1242 .codec_name = "snd-soc-dummy",
1243 .ignore_suspend = 1,
1244 .ignore_pmdown_time = 1,
1245 /* this dai link has playback support */
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301246 .id = MSM_FRONTEND_DAI_MULTIMEDIA13,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301247 },
1248 {/* hw:x,31 */
1249 .name = MSM_DAILINK_NAME(Compress7),
1250 .stream_name = "Compress7",
1251 .cpu_dai_name = "MultiMedia14",
1252 .platform_name = "msm-compress-dsp",
1253 .dynamic = 1,
1254 .dpcm_capture = 1,
1255 .dpcm_playback = 1,
1256 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1257 SND_SOC_DPCM_TRIGGER_POST},
1258 .codec_dai_name = "snd-soc-dummy-dai",
1259 .codec_name = "snd-soc-dummy",
1260 .ignore_suspend = 1,
1261 .ignore_pmdown_time = 1,
1262 /* this dai link has playback support */
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301263 .id = MSM_FRONTEND_DAI_MULTIMEDIA14,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301264 },
1265 {/* hw:x,32 */
1266 .name = MSM_DAILINK_NAME(Compress8),
1267 .stream_name = "Compress8",
1268 .cpu_dai_name = "MultiMedia15",
1269 .platform_name = "msm-compress-dsp",
1270 .dynamic = 1,
1271 .dpcm_capture = 1,
1272 .dpcm_playback = 1,
1273 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1274 SND_SOC_DPCM_TRIGGER_POST},
1275 .codec_dai_name = "snd-soc-dummy-dai",
1276 .codec_name = "snd-soc-dummy",
1277 .ignore_suspend = 1,
1278 .ignore_pmdown_time = 1,
1279 /* this dai link has playback support */
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301280 .id = MSM_FRONTEND_DAI_MULTIMEDIA15,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301281 },
1282 {/* hw:x,33 */
Asish Bhattacharya34504582017-08-08 12:55:01 +05301283 .name = MSM_DAILINK_NAME(ULL_NOIRQ_2),
1284 .stream_name = "MM_NOIRQ_2",
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301285 .cpu_dai_name = "MultiMedia16",
Asish Bhattacharya34504582017-08-08 12:55:01 +05301286 .platform_name = "msm-pcm-dsp-noirq",
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301287 .dynamic = 1,
1288 .dpcm_capture = 1,
1289 .dpcm_playback = 1,
1290 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1291 SND_SOC_DPCM_TRIGGER_POST},
1292 .codec_dai_name = "snd-soc-dummy-dai",
1293 .codec_name = "snd-soc-dummy",
1294 .ignore_suspend = 1,
1295 .ignore_pmdown_time = 1,
1296 /* this dai link has playback support */
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301297 .id = MSM_FRONTEND_DAI_MULTIMEDIA16,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301298 },
1299 {/* hw:x,34 */
1300 .name = "SLIMBUS_8 Hostless",
1301 .stream_name = "SLIMBUS8_HOSTLESS Capture",
1302 .cpu_dai_name = "SLIMBUS8_HOSTLESS",
1303 .platform_name = "msm-pcm-hostless",
1304 .dynamic = 1,
1305 .dpcm_capture = 1,
1306 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1307 SND_SOC_DPCM_TRIGGER_POST},
1308 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
1309 .ignore_suspend = 1,
1310 .ignore_pmdown_time = 1,
1311 .codec_dai_name = "snd-soc-dummy-dai",
1312 .codec_name = "snd-soc-dummy",
1313 },
1314 {/* hw:x,35 */
1315 .name = "SLIMBUS7 Hostless",
1316 .stream_name = "SLIMBUS7 Hostless",
1317 .cpu_dai_name = "SLIMBUS7_HOSTLESS",
1318 .platform_name = "msm-pcm-hostless",
1319 .dynamic = 1,
1320 .dpcm_playback = 1,
1321 .dpcm_capture = 1,
1322 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1323 SND_SOC_DPCM_TRIGGER_POST},
1324 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
1325 .ignore_suspend = 1,
1326 .ignore_pmdown_time = 1,
1327 .codec_dai_name = "snd-soc-dummy-dai",
1328 .codec_name = "snd-soc-dummy",
1329 },
1330 {/* hw:x,36 */
1331 .name = "SDM660 HFP TX",
1332 .stream_name = "MultiMedia6",
1333 .cpu_dai_name = "MultiMedia6",
1334 .platform_name = "msm-pcm-loopback",
1335 .dynamic = 1,
1336 .dpcm_playback = 1,
1337 .dpcm_capture = 1,
1338 .codec_dai_name = "snd-soc-dummy-dai",
1339 .codec_name = "snd-soc-dummy",
1340 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1341 SND_SOC_DPCM_TRIGGER_POST},
1342 .ignore_suspend = 1,
1343 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
1344 .ignore_pmdown_time = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301345 .id = MSM_FRONTEND_DAI_MULTIMEDIA6,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301346 },
1347};
1348
1349static struct snd_soc_dai_link msm_ext_common_be_dai[] = {
1350 {
1351 .name = LPASS_BE_AFE_PCM_RX,
1352 .stream_name = "AFE Playback",
1353 .cpu_dai_name = "msm-dai-q6-dev.224",
1354 .platform_name = "msm-pcm-routing",
1355 .codec_name = "msm-stub-codec.1",
1356 .codec_dai_name = "msm-stub-rx",
1357 .no_pcm = 1,
1358 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301359 .id = MSM_BACKEND_DAI_AFE_PCM_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301360 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1361 /* this dai link has playback support */
1362 .ignore_pmdown_time = 1,
1363 .ignore_suspend = 1,
1364 },
1365 {
1366 .name = LPASS_BE_AFE_PCM_TX,
1367 .stream_name = "AFE Capture",
1368 .cpu_dai_name = "msm-dai-q6-dev.225",
1369 .platform_name = "msm-pcm-routing",
1370 .codec_name = "msm-stub-codec.1",
1371 .codec_dai_name = "msm-stub-tx",
1372 .no_pcm = 1,
1373 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301374 .id = MSM_BACKEND_DAI_AFE_PCM_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301375 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1376 .ignore_suspend = 1,
1377 },
1378 /* Incall Record Uplink BACK END DAI Link */
1379 {
1380 .name = LPASS_BE_INCALL_RECORD_TX,
1381 .stream_name = "Voice Uplink Capture",
1382 .cpu_dai_name = "msm-dai-q6-dev.32772",
1383 .platform_name = "msm-pcm-routing",
1384 .codec_name = "msm-stub-codec.1",
1385 .codec_dai_name = "msm-stub-tx",
1386 .no_pcm = 1,
1387 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301388 .id = MSM_BACKEND_DAI_INCALL_RECORD_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301389 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
1390 .ignore_suspend = 1,
1391 },
1392 /* Incall Record Downlink BACK END DAI Link */
1393 {
1394 .name = LPASS_BE_INCALL_RECORD_RX,
1395 .stream_name = "Voice Downlink Capture",
1396 .cpu_dai_name = "msm-dai-q6-dev.32771",
1397 .platform_name = "msm-pcm-routing",
1398 .codec_name = "msm-stub-codec.1",
1399 .codec_dai_name = "msm-stub-tx",
1400 .no_pcm = 1,
1401 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301402 .id = MSM_BACKEND_DAI_INCALL_RECORD_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301403 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
1404 .ignore_suspend = 1,
1405 },
1406 /* Incall Music BACK END DAI Link */
1407 {
1408 .name = LPASS_BE_VOICE_PLAYBACK_TX,
1409 .stream_name = "Voice Farend Playback",
1410 .cpu_dai_name = "msm-dai-q6-dev.32773",
1411 .platform_name = "msm-pcm-routing",
1412 .codec_name = "msm-stub-codec.1",
1413 .codec_dai_name = "msm-stub-rx",
1414 .no_pcm = 1,
1415 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301416 .id = MSM_BACKEND_DAI_VOICE_PLAYBACK_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301417 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
1418 .ignore_suspend = 1,
1419 },
1420 /* Incall Music 2 BACK END DAI Link */
1421 {
1422 .name = LPASS_BE_VOICE2_PLAYBACK_TX,
1423 .stream_name = "Voice2 Farend Playback",
1424 .cpu_dai_name = "msm-dai-q6-dev.32770",
1425 .platform_name = "msm-pcm-routing",
1426 .codec_name = "msm-stub-codec.1",
1427 .codec_dai_name = "msm-stub-rx",
1428 .no_pcm = 1,
1429 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301430 .id = MSM_BACKEND_DAI_VOICE2_PLAYBACK_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301431 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
1432 .ignore_suspend = 1,
1433 },
1434 {
1435 .name = LPASS_BE_USB_AUDIO_RX,
1436 .stream_name = "USB Audio Playback",
1437 .cpu_dai_name = "msm-dai-q6-dev.28672",
1438 .platform_name = "msm-pcm-routing",
1439 .codec_name = "msm-stub-codec.1",
1440 .codec_dai_name = "msm-stub-rx",
1441 .no_pcm = 1,
1442 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301443 .id = MSM_BACKEND_DAI_USB_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301444 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1445 .ignore_pmdown_time = 1,
1446 .ignore_suspend = 1,
1447 },
1448 {
1449 .name = LPASS_BE_USB_AUDIO_TX,
1450 .stream_name = "USB Audio Capture",
1451 .cpu_dai_name = "msm-dai-q6-dev.28673",
1452 .platform_name = "msm-pcm-routing",
1453 .codec_name = "msm-stub-codec.1",
1454 .codec_dai_name = "msm-stub-tx",
1455 .no_pcm = 1,
1456 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301457 .id = MSM_BACKEND_DAI_USB_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301458 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1459 .ignore_suspend = 1,
1460 },
1461 {
1462 .name = LPASS_BE_PRI_TDM_RX_0,
1463 .stream_name = "Primary TDM0 Playback",
1464 .cpu_dai_name = "msm-dai-q6-tdm.36864",
1465 .platform_name = "msm-pcm-routing",
1466 .codec_name = "msm-stub-codec.1",
1467 .codec_dai_name = "msm-stub-rx",
1468 .no_pcm = 1,
1469 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301470 .id = MSM_BACKEND_DAI_PRI_TDM_RX_0,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301471 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1472 .ops = &msm_tdm_be_ops,
1473 .ignore_suspend = 1,
1474 },
1475 {
1476 .name = LPASS_BE_PRI_TDM_TX_0,
1477 .stream_name = "Primary TDM0 Capture",
1478 .cpu_dai_name = "msm-dai-q6-tdm.36865",
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,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301484 .id = MSM_BACKEND_DAI_PRI_TDM_TX_0,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301485 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1486 .ops = &msm_tdm_be_ops,
1487 .ignore_suspend = 1,
1488 },
1489 {
1490 .name = LPASS_BE_SEC_TDM_RX_0,
1491 .stream_name = "Secondary TDM0 Playback",
1492 .cpu_dai_name = "msm-dai-q6-tdm.36880",
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,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301498 .id = MSM_BACKEND_DAI_SEC_TDM_RX_0,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301499 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1500 .ops = &msm_tdm_be_ops,
1501 .ignore_suspend = 1,
1502 },
1503 {
1504 .name = LPASS_BE_SEC_TDM_TX_0,
1505 .stream_name = "Secondary TDM0 Capture",
1506 .cpu_dai_name = "msm-dai-q6-tdm.36881",
1507 .platform_name = "msm-pcm-routing",
1508 .codec_name = "msm-stub-codec.1",
1509 .codec_dai_name = "msm-stub-tx",
1510 .no_pcm = 1,
1511 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301512 .id = MSM_BACKEND_DAI_SEC_TDM_TX_0,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301513 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1514 .ops = &msm_tdm_be_ops,
1515 .ignore_suspend = 1,
1516 },
1517 {
1518 .name = LPASS_BE_TERT_TDM_RX_0,
1519 .stream_name = "Tertiary TDM0 Playback",
1520 .cpu_dai_name = "msm-dai-q6-tdm.36896",
1521 .platform_name = "msm-pcm-routing",
1522 .codec_name = "msm-stub-codec.1",
1523 .codec_dai_name = "msm-stub-rx",
1524 .no_pcm = 1,
1525 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301526 .id = MSM_BACKEND_DAI_TERT_TDM_RX_0,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301527 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1528 .ops = &msm_tdm_be_ops,
1529 .ignore_suspend = 1,
1530 },
1531 {
1532 .name = LPASS_BE_TERT_TDM_TX_0,
1533 .stream_name = "Tertiary TDM0 Capture",
1534 .cpu_dai_name = "msm-dai-q6-tdm.36897",
1535 .platform_name = "msm-pcm-routing",
1536 .codec_name = "msm-stub-codec.1",
1537 .codec_dai_name = "msm-stub-tx",
1538 .no_pcm = 1,
1539 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301540 .id = MSM_BACKEND_DAI_TERT_TDM_TX_0,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301541 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1542 .ops = &msm_tdm_be_ops,
1543 .ignore_suspend = 1,
1544 },
1545 {
1546 .name = LPASS_BE_QUAT_TDM_RX_0,
1547 .stream_name = "Quaternary TDM0 Playback",
1548 .cpu_dai_name = "msm-dai-q6-tdm.36912",
1549 .platform_name = "msm-pcm-routing",
1550 .codec_name = "msm-stub-codec.1",
1551 .codec_dai_name = "msm-stub-rx",
1552 .no_pcm = 1,
1553 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301554 .id = MSM_BACKEND_DAI_QUAT_TDM_RX_0,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301555 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1556 .ops = &msm_tdm_be_ops,
1557 .ignore_suspend = 1,
1558 },
1559 {
1560 .name = LPASS_BE_QUAT_TDM_TX_0,
1561 .stream_name = "Quaternary TDM0 Capture",
1562 .cpu_dai_name = "msm-dai-q6-tdm.36913",
1563 .platform_name = "msm-pcm-routing",
1564 .codec_name = "msm-stub-codec.1",
1565 .codec_dai_name = "msm-stub-tx",
1566 .no_pcm = 1,
1567 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301568 .id = MSM_BACKEND_DAI_QUAT_TDM_TX_0,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301569 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1570 .ops = &msm_tdm_be_ops,
1571 .ignore_suspend = 1,
1572 },
Rohit Kumard1754482017-09-10 22:57:39 +05301573 {
1574 .name = LPASS_BE_QUIN_TDM_RX_0,
1575 .stream_name = "Quinary TDM0 Playback",
Rohit kumar091ff792017-10-11 18:35:07 +05301576 .cpu_dai_name = "msm-dai-q6-tdm.36928",
Rohit Kumard1754482017-09-10 22:57:39 +05301577 .platform_name = "msm-pcm-routing",
1578 .codec_name = "msm-stub-codec.1",
1579 .codec_dai_name = "msm-stub-rx",
1580 .no_pcm = 1,
1581 .dpcm_playback = 1,
1582 .id = MSM_BACKEND_DAI_QUIN_TDM_RX_0,
1583 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1584 .ops = &msm_tdm_be_ops,
1585 .ignore_suspend = 1,
1586 },
1587 {
1588 .name = LPASS_BE_QUIN_TDM_TX_0,
1589 .stream_name = "Quinary TDM0 Capture",
Rohit kumar091ff792017-10-11 18:35:07 +05301590 .cpu_dai_name = "msm-dai-q6-tdm.36929",
Rohit Kumard1754482017-09-10 22:57:39 +05301591 .platform_name = "msm-pcm-routing",
1592 .codec_name = "msm-stub-codec.1",
1593 .codec_dai_name = "msm-stub-tx",
1594 .no_pcm = 1,
1595 .dpcm_capture = 1,
1596 .id = MSM_BACKEND_DAI_QUIN_TDM_TX_0,
1597 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1598 .ops = &msm_tdm_be_ops,
1599 .ignore_suspend = 1,
1600 },
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301601};
1602
1603static struct snd_soc_dai_link msm_mi2s_be_dai_links[] = {
1604 {
1605 .name = LPASS_BE_PRI_MI2S_RX,
1606 .stream_name = "Primary MI2S Playback",
1607 .cpu_dai_name = "msm-dai-q6-mi2s.0",
1608 .platform_name = "msm-pcm-routing",
1609 .codec_name = "msm-stub-codec.1",
1610 .codec_dai_name = "msm-stub-rx",
1611 .no_pcm = 1,
1612 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301613 .id = MSM_BACKEND_DAI_PRI_MI2S_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301614 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1615 .ops = &msm_mi2s_be_ops,
1616 .ignore_suspend = 1,
1617 .ignore_pmdown_time = 1,
1618 },
1619 {
1620 .name = LPASS_BE_PRI_MI2S_TX,
1621 .stream_name = "Primary MI2S Capture",
1622 .cpu_dai_name = "msm-dai-q6-mi2s.0",
1623 .platform_name = "msm-pcm-routing",
1624 .codec_name = "msm-stub-codec.1",
1625 .codec_dai_name = "msm-stub-tx",
1626 .no_pcm = 1,
1627 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301628 .id = MSM_BACKEND_DAI_PRI_MI2S_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301629 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1630 .ops = &msm_mi2s_be_ops,
1631 .ignore_suspend = 1,
1632 },
1633 {
1634 .name = LPASS_BE_SEC_MI2S_RX,
1635 .stream_name = "Secondary MI2S Playback",
1636 .cpu_dai_name = "msm-dai-q6-mi2s.1",
1637 .platform_name = "msm-pcm-routing",
1638 .codec_name = "msm-stub-codec.1",
1639 .codec_dai_name = "msm-stub-rx",
1640 .no_pcm = 1,
1641 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301642 .id = MSM_BACKEND_DAI_SECONDARY_MI2S_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301643 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1644 .ops = &msm_mi2s_be_ops,
1645 .ignore_suspend = 1,
1646 .ignore_pmdown_time = 1,
1647 },
1648 {
1649 .name = LPASS_BE_SEC_MI2S_TX,
1650 .stream_name = "Secondary MI2S Capture",
1651 .cpu_dai_name = "msm-dai-q6-mi2s.1",
1652 .platform_name = "msm-pcm-routing",
1653 .codec_name = "msm-stub-codec.1",
1654 .codec_dai_name = "msm-stub-tx",
1655 .no_pcm = 1,
1656 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301657 .id = MSM_BACKEND_DAI_SECONDARY_MI2S_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301658 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1659 .ops = &msm_mi2s_be_ops,
1660 .ignore_suspend = 1,
1661 },
1662 {
1663 .name = LPASS_BE_TERT_MI2S_RX,
1664 .stream_name = "Tertiary MI2S Playback",
1665 .cpu_dai_name = "msm-dai-q6-mi2s.2",
1666 .platform_name = "msm-pcm-routing",
1667 .codec_name = "msm-stub-codec.1",
1668 .codec_dai_name = "msm-stub-rx",
1669 .no_pcm = 1,
1670 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301671 .id = MSM_BACKEND_DAI_TERTIARY_MI2S_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301672 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1673 .ops = &msm_mi2s_be_ops,
1674 .ignore_suspend = 1,
1675 .ignore_pmdown_time = 1,
1676 },
1677 {
1678 .name = LPASS_BE_TERT_MI2S_TX,
1679 .stream_name = "Tertiary MI2S Capture",
1680 .cpu_dai_name = "msm-dai-q6-mi2s.2",
1681 .platform_name = "msm-pcm-routing",
1682 .codec_name = "msm-stub-codec.1",
1683 .codec_dai_name = "msm-stub-tx",
1684 .no_pcm = 1,
1685 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301686 .id = MSM_BACKEND_DAI_TERTIARY_MI2S_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301687 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1688 .ops = &msm_mi2s_be_ops,
1689 .ignore_suspend = 1,
1690 },
1691 {
1692 .name = LPASS_BE_QUAT_MI2S_RX,
1693 .stream_name = "Quaternary MI2S Playback",
1694 .cpu_dai_name = "msm-dai-q6-mi2s.3",
1695 .platform_name = "msm-pcm-routing",
1696 .codec_name = "msm-stub-codec.1",
1697 .codec_dai_name = "msm-stub-rx",
1698 .no_pcm = 1,
1699 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301700 .id = MSM_BACKEND_DAI_QUATERNARY_MI2S_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301701 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1702 .ops = &msm_mi2s_be_ops,
1703 .ignore_suspend = 1,
1704 .ignore_pmdown_time = 1,
1705 },
1706 {
1707 .name = LPASS_BE_QUAT_MI2S_TX,
1708 .stream_name = "Quaternary MI2S Capture",
1709 .cpu_dai_name = "msm-dai-q6-mi2s.3",
1710 .platform_name = "msm-pcm-routing",
1711 .codec_name = "msm-stub-codec.1",
1712 .codec_dai_name = "msm-stub-tx",
1713 .no_pcm = 1,
1714 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301715 .id = MSM_BACKEND_DAI_QUATERNARY_MI2S_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301716 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1717 .ops = &msm_mi2s_be_ops,
1718 .ignore_suspend = 1,
1719 },
Rohit Kumard1754482017-09-10 22:57:39 +05301720 {
1721 .name = LPASS_BE_QUIN_MI2S_RX,
1722 .stream_name = "Quinary MI2S Playback",
Rohit kumar20df5452017-10-16 15:35:56 +05301723 .cpu_dai_name = "msm-dai-q6-mi2s.4",
Rohit Kumard1754482017-09-10 22:57:39 +05301724 .platform_name = "msm-pcm-routing",
1725 .codec_name = "msm-stub-codec.1",
1726 .codec_dai_name = "msm-stub-rx",
1727 .no_pcm = 1,
1728 .dpcm_playback = 1,
1729 .id = MSM_BACKEND_DAI_QUINARY_MI2S_RX,
1730 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1731 .ops = &msm_mi2s_be_ops,
1732 .ignore_suspend = 1,
1733 .ignore_pmdown_time = 1,
1734 },
1735 {
1736 .name = LPASS_BE_QUIN_MI2S_TX,
1737 .stream_name = "Quinary MI2S Capture",
Rohit kumar20df5452017-10-16 15:35:56 +05301738 .cpu_dai_name = "msm-dai-q6-mi2s.4",
Rohit Kumard1754482017-09-10 22:57:39 +05301739 .platform_name = "msm-pcm-routing",
1740 .codec_name = "msm-stub-codec.1",
1741 .codec_dai_name = "msm-stub-tx",
1742 .no_pcm = 1,
1743 .dpcm_capture = 1,
1744 .id = MSM_BACKEND_DAI_QUINARY_MI2S_TX,
1745 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1746 .ops = &msm_mi2s_be_ops,
1747 .ignore_suspend = 1,
1748 },
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301749};
1750
1751static struct snd_soc_dai_link msm_auxpcm_be_dai_links[] = {
1752 /* Primary AUX PCM Backend DAI Links */
1753 {
1754 .name = LPASS_BE_AUXPCM_RX,
1755 .stream_name = "AUX PCM Playback",
1756 .cpu_dai_name = "msm-dai-q6-auxpcm.1",
1757 .platform_name = "msm-pcm-routing",
1758 .codec_name = "msm-stub-codec.1",
1759 .codec_dai_name = "msm-stub-rx",
1760 .no_pcm = 1,
1761 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301762 .id = MSM_BACKEND_DAI_AUXPCM_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301763 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1764 .ignore_pmdown_time = 1,
1765 .ignore_suspend = 1,
1766 .ops = &msm_aux_pcm_be_ops,
1767 },
1768 {
1769 .name = LPASS_BE_AUXPCM_TX,
1770 .stream_name = "AUX PCM Capture",
1771 .cpu_dai_name = "msm-dai-q6-auxpcm.1",
1772 .platform_name = "msm-pcm-routing",
1773 .codec_name = "msm-stub-codec.1",
1774 .codec_dai_name = "msm-stub-tx",
1775 .no_pcm = 1,
1776 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301777 .id = MSM_BACKEND_DAI_AUXPCM_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301778 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1779 .ignore_pmdown_time = 1,
1780 .ignore_suspend = 1,
1781 .ops = &msm_aux_pcm_be_ops,
1782 },
1783 /* Secondary AUX PCM Backend DAI Links */
1784 {
1785 .name = LPASS_BE_SEC_AUXPCM_RX,
1786 .stream_name = "Sec AUX PCM Playback",
1787 .cpu_dai_name = "msm-dai-q6-auxpcm.2",
1788 .platform_name = "msm-pcm-routing",
1789 .codec_name = "msm-stub-codec.1",
1790 .codec_dai_name = "msm-stub-rx",
1791 .no_pcm = 1,
1792 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301793 .id = MSM_BACKEND_DAI_SEC_AUXPCM_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301794 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1795 .ignore_pmdown_time = 1,
1796 .ignore_suspend = 1,
1797 .ops = &msm_aux_pcm_be_ops,
1798 },
1799 {
1800 .name = LPASS_BE_SEC_AUXPCM_TX,
1801 .stream_name = "Sec AUX PCM Capture",
1802 .cpu_dai_name = "msm-dai-q6-auxpcm.2",
1803 .platform_name = "msm-pcm-routing",
1804 .codec_name = "msm-stub-codec.1",
1805 .codec_dai_name = "msm-stub-tx",
1806 .no_pcm = 1,
1807 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301808 .id = MSM_BACKEND_DAI_SEC_AUXPCM_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301809 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1810 .ignore_suspend = 1,
1811 .ignore_pmdown_time = 1,
1812 .ops = &msm_aux_pcm_be_ops,
1813 },
1814 /* Tertiary AUX PCM Backend DAI Links */
1815 {
1816 .name = LPASS_BE_TERT_AUXPCM_RX,
1817 .stream_name = "Tert AUX PCM Playback",
1818 .cpu_dai_name = "msm-dai-q6-auxpcm.3",
1819 .platform_name = "msm-pcm-routing",
1820 .codec_name = "msm-stub-codec.1",
1821 .codec_dai_name = "msm-stub-rx",
1822 .no_pcm = 1,
1823 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301824 .id = MSM_BACKEND_DAI_TERT_AUXPCM_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301825 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1826 .ignore_pmdown_time = 1,
1827 .ignore_suspend = 1,
1828 .ops = &msm_aux_pcm_be_ops,
1829 },
1830 {
1831 .name = LPASS_BE_TERT_AUXPCM_TX,
1832 .stream_name = "Tert AUX PCM Capture",
1833 .cpu_dai_name = "msm-dai-q6-auxpcm.3",
1834 .platform_name = "msm-pcm-routing",
1835 .codec_name = "msm-stub-codec.1",
1836 .codec_dai_name = "msm-stub-tx",
1837 .no_pcm = 1,
1838 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301839 .id = MSM_BACKEND_DAI_TERT_AUXPCM_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301840 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1841 .ignore_suspend = 1,
1842 .ignore_pmdown_time = 1,
1843 .ops = &msm_aux_pcm_be_ops,
1844 },
1845 /* Quaternary AUX PCM Backend DAI Links */
1846 {
1847 .name = LPASS_BE_QUAT_AUXPCM_RX,
1848 .stream_name = "Quat AUX PCM Playback",
1849 .cpu_dai_name = "msm-dai-q6-auxpcm.4",
1850 .platform_name = "msm-pcm-routing",
1851 .codec_name = "msm-stub-codec.1",
1852 .codec_dai_name = "msm-stub-rx",
1853 .no_pcm = 1,
1854 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301855 .id = MSM_BACKEND_DAI_QUAT_AUXPCM_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301856 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1857 .ignore_pmdown_time = 1,
1858 .ignore_suspend = 1,
1859 .ops = &msm_aux_pcm_be_ops,
1860 },
1861 {
1862 .name = LPASS_BE_QUAT_AUXPCM_TX,
1863 .stream_name = "Quat AUX PCM Capture",
1864 .cpu_dai_name = "msm-dai-q6-auxpcm.4",
1865 .platform_name = "msm-pcm-routing",
1866 .codec_name = "msm-stub-codec.1",
1867 .codec_dai_name = "msm-stub-tx",
1868 .no_pcm = 1,
1869 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301870 .id = MSM_BACKEND_DAI_QUAT_AUXPCM_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301871 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1872 .ignore_suspend = 1,
1873 .ignore_pmdown_time = 1,
1874 .ops = &msm_aux_pcm_be_ops,
1875 },
Rohit Kumard1754482017-09-10 22:57:39 +05301876 /* Quinary AUX PCM Backend DAI Links */
1877 {
1878 .name = LPASS_BE_QUIN_AUXPCM_RX,
1879 .stream_name = "Quin AUX PCM Playback",
1880 .cpu_dai_name = "msm-dai-q6-auxpcm.5",
1881 .platform_name = "msm-pcm-routing",
1882 .codec_name = "msm-stub-codec.1",
1883 .codec_dai_name = "msm-stub-rx",
1884 .no_pcm = 1,
1885 .dpcm_playback = 1,
1886 .id = MSM_BACKEND_DAI_QUIN_AUXPCM_RX,
1887 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1888 .ignore_pmdown_time = 1,
1889 .ignore_suspend = 1,
1890 .ops = &msm_aux_pcm_be_ops,
1891 },
1892 {
1893 .name = LPASS_BE_QUIN_AUXPCM_TX,
1894 .stream_name = "Quin AUX PCM Capture",
1895 .cpu_dai_name = "msm-dai-q6-auxpcm.5",
1896 .platform_name = "msm-pcm-routing",
1897 .codec_name = "msm-stub-codec.1",
1898 .codec_dai_name = "msm-stub-tx",
1899 .no_pcm = 1,
1900 .dpcm_capture = 1,
1901 .id = MSM_BACKEND_DAI_QUIN_AUXPCM_TX,
1902 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1903 .ignore_suspend = 1,
1904 .ignore_pmdown_time = 1,
1905 .ops = &msm_aux_pcm_be_ops,
1906 },
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301907};
1908
1909static struct snd_soc_dai_link msm_wcn_be_dai_links[] = {
1910 {
1911 .name = LPASS_BE_SLIMBUS_7_RX,
1912 .stream_name = "Slimbus7 Playback",
1913 .cpu_dai_name = "msm-dai-q6-dev.16398",
1914 .platform_name = "msm-pcm-routing",
1915 .codec_name = "btfmslim_slave",
1916 /* BT codec driver determines capabilities based on
1917 * dai name, bt codecdai name should always contains
1918 * supported usecase information
1919 */
1920 .codec_dai_name = "btfm_bt_sco_a2dp_slim_rx",
1921 .no_pcm = 1,
1922 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301923 .id = MSM_BACKEND_DAI_SLIMBUS_7_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301924 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
1925 .ops = &msm_wcn_ops,
1926 /* dai link has playback support */
1927 .ignore_pmdown_time = 1,
1928 .ignore_suspend = 1,
1929 },
1930 {
1931 .name = LPASS_BE_SLIMBUS_7_TX,
1932 .stream_name = "Slimbus7 Capture",
1933 .cpu_dai_name = "msm-dai-q6-dev.16399",
1934 .platform_name = "msm-pcm-routing",
1935 .codec_name = "btfmslim_slave",
1936 .codec_dai_name = "btfm_bt_sco_slim_tx",
1937 .no_pcm = 1,
1938 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301939 .id = MSM_BACKEND_DAI_SLIMBUS_7_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301940 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
1941 .ops = &msm_wcn_ops,
1942 .ignore_suspend = 1,
1943 },
1944 {
1945 .name = LPASS_BE_SLIMBUS_8_TX,
1946 .stream_name = "Slimbus8 Capture",
1947 .cpu_dai_name = "msm-dai-q6-dev.16401",
1948 .platform_name = "msm-pcm-routing",
1949 .codec_name = "btfmslim_slave",
1950 .codec_dai_name = "btfm_fm_slim_tx",
1951 .no_pcm = 1,
1952 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301953 .id = MSM_BACKEND_DAI_SLIMBUS_8_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301954 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
1955 .init = &msm_wcn_init,
1956 .ops = &msm_wcn_ops,
1957 .ignore_suspend = 1,
1958 },
1959};
1960
1961static struct snd_soc_dai_link ext_disp_be_dai_link[] = {
1962 /* DISP PORT BACK END DAI Link */
1963 {
1964 .name = LPASS_BE_DISPLAY_PORT,
1965 .stream_name = "Display Port Playback",
1966 .cpu_dai_name = "msm-dai-q6-dp.24608",
1967 .platform_name = "msm-pcm-routing",
1968 .codec_name = "msm-ext-disp-audio-codec-rx",
1969 .codec_dai_name = "msm_dp_audio_codec_rx_dai",
1970 .no_pcm = 1,
1971 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301972 .id = MSM_BACKEND_DAI_DISPLAY_PORT_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301973 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1974 .ignore_pmdown_time = 1,
1975 .ignore_suspend = 1,
1976 },
1977};
1978
1979static struct snd_soc_dai_link msm_ext_tasha_dai_links[
1980ARRAY_SIZE(msm_ext_common_fe_dai) +
1981ARRAY_SIZE(msm_ext_tasha_fe_dai) +
1982ARRAY_SIZE(msm_ext_common_be_dai) +
1983ARRAY_SIZE(msm_ext_tasha_be_dai) +
1984ARRAY_SIZE(msm_mi2s_be_dai_links) +
1985ARRAY_SIZE(msm_auxpcm_be_dai_links) +
1986ARRAY_SIZE(msm_wcn_be_dai_links) +
1987ARRAY_SIZE(ext_disp_be_dai_link)];
1988
1989static struct snd_soc_dai_link msm_ext_tavil_dai_links[
1990ARRAY_SIZE(msm_ext_common_fe_dai) +
1991ARRAY_SIZE(msm_ext_tavil_fe_dai) +
1992ARRAY_SIZE(msm_ext_common_be_dai) +
1993ARRAY_SIZE(msm_ext_tavil_be_dai) +
1994ARRAY_SIZE(msm_mi2s_be_dai_links) +
1995ARRAY_SIZE(msm_auxpcm_be_dai_links) +
1996ARRAY_SIZE(msm_wcn_be_dai_links) +
1997ARRAY_SIZE(ext_disp_be_dai_link)];
1998
1999/**
2000 * populate_snd_card_dailinks - prepares dailink array and initializes card.
2001 *
2002 * @dev: device handle
2003 *
2004 * Returns card on success or NULL on failure.
2005 */
2006struct snd_soc_card *populate_snd_card_dailinks(struct device *dev,
2007 int snd_card_val)
2008{
2009 struct snd_soc_card *card;
2010 struct snd_soc_dai_link *msm_ext_dai_links = NULL;
2011 int ret, len1, len2, len3, len4;
2012 enum codec_variant codec_ver = 0;
2013
2014 if (snd_card_val == EXT_SND_CARD_TASHA) {
2015 card = &snd_soc_card_msm_card_tasha;
2016 } else if (snd_card_val == EXT_SND_CARD_TAVIL) {
2017 card = &snd_soc_card_msm_card_tavil;
2018 } else {
2019 dev_err(dev, "%s: failing as no matching card name\n",
2020 __func__);
2021 return NULL;
2022 }
2023
2024 card->dev = dev;
2025 ret = snd_soc_of_parse_card_name(card, "qcom,model");
2026 if (ret) {
2027 dev_err(dev, "%s: parse card name failed, err:%d\n",
2028 __func__, ret);
2029 return NULL;
2030 }
2031
2032 if (strnstr(card->name, "tasha", strlen(card->name))) {
2033 codec_ver = tasha_codec_ver();
2034 if (codec_ver == WCD9326)
2035 card->name = "sdm660-tashalite-snd-card";
2036
2037 len1 = ARRAY_SIZE(msm_ext_common_fe_dai);
2038 len2 = len1 + ARRAY_SIZE(msm_ext_tasha_fe_dai);
2039 len3 = len2 + ARRAY_SIZE(msm_ext_common_be_dai);
2040 memcpy(msm_ext_tasha_dai_links, msm_ext_common_fe_dai,
2041 sizeof(msm_ext_common_fe_dai));
2042 memcpy(msm_ext_tasha_dai_links + len1,
2043 msm_ext_tasha_fe_dai, sizeof(msm_ext_tasha_fe_dai));
2044 memcpy(msm_ext_tasha_dai_links + len2,
2045 msm_ext_common_be_dai, sizeof(msm_ext_common_be_dai));
2046 memcpy(msm_ext_tasha_dai_links + len3,
2047 msm_ext_tasha_be_dai, sizeof(msm_ext_tasha_be_dai));
2048 len4 = len3 + ARRAY_SIZE(msm_ext_tasha_be_dai);
2049 if (of_property_read_bool(dev->of_node,
2050 "qcom,mi2s-audio-intf")) {
2051 memcpy(msm_ext_tasha_dai_links + len4,
2052 msm_mi2s_be_dai_links,
2053 sizeof(msm_mi2s_be_dai_links));
2054 len4 += ARRAY_SIZE(msm_mi2s_be_dai_links);
2055 }
2056 if (of_property_read_bool(dev->of_node,
2057 "qcom,auxpcm-audio-intf")) {
2058 memcpy(msm_ext_tasha_dai_links + len4,
2059 msm_auxpcm_be_dai_links,
2060 sizeof(msm_auxpcm_be_dai_links));
2061 len4 += ARRAY_SIZE(msm_auxpcm_be_dai_links);
2062 }
2063 if (of_property_read_bool(dev->of_node, "qcom,wcn-btfm")) {
2064 dev_dbg(dev, "%s(): WCN BTFM support present\n",
2065 __func__);
2066 memcpy(msm_ext_tasha_dai_links + len4,
2067 msm_wcn_be_dai_links,
2068 sizeof(msm_wcn_be_dai_links));
2069 len4 += ARRAY_SIZE(msm_wcn_be_dai_links);
2070 }
2071 if (of_property_read_bool(dev->of_node,
2072 "qcom,ext-disp-audio-rx")) {
2073 dev_dbg(dev, "%s(): ext disp audio support present\n",
2074 __func__);
2075 memcpy(msm_ext_tasha_dai_links + len4,
2076 ext_disp_be_dai_link,
2077 sizeof(ext_disp_be_dai_link));
2078 len4 += ARRAY_SIZE(ext_disp_be_dai_link);
2079 }
2080 msm_ext_dai_links = msm_ext_tasha_dai_links;
2081 } else if (strnstr(card->name, "tavil", strlen(card->name))) {
2082 len1 = ARRAY_SIZE(msm_ext_common_fe_dai);
2083 len2 = len1 + ARRAY_SIZE(msm_ext_tavil_fe_dai);
2084 len3 = len2 + ARRAY_SIZE(msm_ext_common_be_dai);
2085 memcpy(msm_ext_tavil_dai_links, msm_ext_common_fe_dai,
2086 sizeof(msm_ext_common_fe_dai));
2087 memcpy(msm_ext_tavil_dai_links + len1,
2088 msm_ext_tavil_fe_dai, sizeof(msm_ext_tavil_fe_dai));
2089 memcpy(msm_ext_tavil_dai_links + len2,
2090 msm_ext_common_be_dai, sizeof(msm_ext_common_be_dai));
2091 memcpy(msm_ext_tavil_dai_links + len3,
2092 msm_ext_tavil_be_dai, sizeof(msm_ext_tavil_be_dai));
2093 len4 = len3 + ARRAY_SIZE(msm_ext_tavil_be_dai);
2094 if (of_property_read_bool(dev->of_node,
2095 "qcom,mi2s-audio-intf")) {
2096 memcpy(msm_ext_tavil_dai_links + len4,
2097 msm_mi2s_be_dai_links,
2098 sizeof(msm_mi2s_be_dai_links));
2099 len4 += ARRAY_SIZE(msm_mi2s_be_dai_links);
2100 }
2101 if (of_property_read_bool(dev->of_node,
2102 "qcom,auxpcm-audio-intf")) {
2103 memcpy(msm_ext_tavil_dai_links + len4,
2104 msm_auxpcm_be_dai_links,
2105 sizeof(msm_auxpcm_be_dai_links));
2106 len4 += ARRAY_SIZE(msm_auxpcm_be_dai_links);
2107 }
2108 if (of_property_read_bool(dev->of_node, "qcom,wcn-btfm")) {
2109 dev_dbg(dev, "%s(): WCN BTFM support present\n",
2110 __func__);
2111 memcpy(msm_ext_tavil_dai_links + len4,
2112 msm_wcn_be_dai_links,
2113 sizeof(msm_wcn_be_dai_links));
2114 len4 += ARRAY_SIZE(msm_wcn_be_dai_links);
2115 }
2116 if (of_property_read_bool(dev->of_node,
2117 "qcom,ext-disp-audio-rx")) {
2118 dev_dbg(dev, "%s(): ext disp audio support present\n",
2119 __func__);
2120 memcpy(msm_ext_tavil_dai_links + len4,
2121 ext_disp_be_dai_link,
2122 sizeof(ext_disp_be_dai_link));
2123 len4 += ARRAY_SIZE(ext_disp_be_dai_link);
2124 }
2125 msm_ext_dai_links = msm_ext_tavil_dai_links;
2126 } else {
2127 dev_err(dev, "%s: failing as no matching card name\n",
2128 __func__);
2129 return NULL;
2130 }
2131 card->dai_link = msm_ext_dai_links;
2132 card->num_links = len4;
2133
2134 return card;
2135}
2136EXPORT_SYMBOL(populate_snd_card_dailinks);