blob: a76c16d76d00730a2094c2f6280cd7e5b82ca9ac [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:
208 case AFE_PORT_ID_PRIMARY_TDM_TX:
209 case AFE_PORT_ID_SECONDARY_TDM_TX:
210 case AFE_PORT_ID_TERTIARY_TDM_TX:
211 case AFE_PORT_ID_QUATERNARY_TDM_TX:
212 slot_offset = tdm_slot_offset[TDM_0];
213 break;
214 default:
215 pr_err("%s: dai id 0x%x not supported\n",
216 __func__, cpu_dai->id);
217 return -EINVAL;
218 }
219
220 for (i = 0; i < TDM_SLOT_OFFSET_MAX; i++) {
221 if (slot_offset[i] != AFE_SLOT_MAPPING_OFFSET_INVALID)
222 offset_channels++;
223 else
224 break;
225 }
226
227 if (offset_channels == 0) {
228 pr_err("%s: slot offset not supported, offset_channels %d\n",
229 __func__, offset_channels);
230 return -EINVAL;
231 }
232
233 if (channels > offset_channels) {
234 pr_err("%s: channels %d exceed offset_channels %d\n",
235 __func__, channels, offset_channels);
236 return -EINVAL;
237 }
238
239 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
240 ret = snd_soc_dai_set_tdm_slot(cpu_dai, 0, slot_mask,
241 slots, slot_width);
242 if (ret < 0) {
243 pr_err("%s: failed to set tdm slot, err:%d\n",
244 __func__, ret);
245 goto end;
246 }
247
248 ret = snd_soc_dai_set_channel_map(cpu_dai, 0, NULL,
249 channels, slot_offset);
250 if (ret < 0) {
251 pr_err("%s: failed to set channel map, err:%d\n",
252 __func__, ret);
253 goto end;
254 }
255 } else {
256 ret = snd_soc_dai_set_tdm_slot(cpu_dai, slot_mask, 0,
257 slots, slot_width);
258 if (ret < 0) {
259 pr_err("%s: failed to set tdm slot, err:%d\n",
260 __func__, ret);
261 goto end;
262 }
263
264 ret = snd_soc_dai_set_channel_map(cpu_dai, channels,
265 slot_offset, 0, NULL);
266 if (ret < 0) {
267 pr_err("%s: failed to set channel map, err:%d\n",
268 __func__, ret);
269 goto end;
270 }
271 }
272end:
273 return ret;
274}
275
276static struct snd_soc_ops msm_tdm_be_ops = {
277 .hw_params = msm_tdm_snd_hw_params
278};
279
280static struct snd_soc_dai_link msm_ext_tasha_fe_dai[] = {
281 /* tasha_vifeedback for speaker protection */
282 {
283 .name = LPASS_BE_SLIMBUS_4_TX,
284 .stream_name = "Slimbus4 Capture",
285 .cpu_dai_name = "msm-dai-q6-dev.16393",
286 .platform_name = "msm-pcm-hostless",
287 .codec_name = "tasha_codec",
288 .codec_dai_name = "tasha_vifeedback",
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530289 .id = MSM_BACKEND_DAI_SLIMBUS_4_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530290 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
291 .ops = &msm_ext_slimbus_be_ops,
292 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
293 .ignore_suspend = 1,
294 },
295 /* Ultrasound RX DAI Link */
296 {
297 .name = "SLIMBUS_2 Hostless Playback",
298 .stream_name = "SLIMBUS_2 Hostless Playback",
299 .cpu_dai_name = "msm-dai-q6-dev.16388",
300 .platform_name = "msm-pcm-hostless",
301 .codec_name = "tasha_codec",
302 .codec_dai_name = "tasha_rx2",
303 .ignore_suspend = 1,
304 .dpcm_playback = 1,
305 .dpcm_capture = 1,
306 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
307 .ops = &msm_ext_slimbus_2_be_ops,
308 },
309 /* Ultrasound TX DAI Link */
310 {
311 .name = "SLIMBUS_2 Hostless Capture",
312 .stream_name = "SLIMBUS_2 Hostless Capture",
313 .cpu_dai_name = "msm-dai-q6-dev.16389",
314 .platform_name = "msm-pcm-hostless",
315 .codec_name = "tasha_codec",
316 .codec_dai_name = "tasha_tx2",
317 .ignore_suspend = 1,
318 .dpcm_capture = 1,
319 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
320 .ops = &msm_ext_slimbus_2_be_ops,
321 },
322 /* CPE LSM direct dai-link */
323 {
324 .name = "CPE Listen service",
325 .stream_name = "CPE Listen Audio Service",
326 .cpu_dai_name = "msm-dai-slim",
327 .platform_name = "msm-cpe-lsm",
328 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
329 SND_SOC_DPCM_TRIGGER_POST},
330 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
331 .ignore_suspend = 1,
332 .dpcm_capture = 1,
333 .ignore_pmdown_time = 1,
334 .codec_dai_name = "tasha_mad1",
335 .codec_name = "tasha_codec",
336 .ops = &msm_ext_cpe_ops,
337 },
338 {
339 .name = "SLIMBUS_6 Hostless Playback",
340 .stream_name = "SLIMBUS_6 Hostless",
341 .cpu_dai_name = "SLIMBUS6_HOSTLESS",
342 .platform_name = "msm-pcm-hostless",
343 .dynamic = 1,
344 .dpcm_playback = 1,
345 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
346 SND_SOC_DPCM_TRIGGER_POST},
347 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
348 .ignore_suspend = 1,
349 /* this dailink has playback support */
350 .ignore_pmdown_time = 1,
351 .codec_dai_name = "snd-soc-dummy-dai",
352 .codec_name = "snd-soc-dummy",
353 },
354 /* CPE LSM EC PP direct dai-link */
355 {
356 .name = "CPE Listen service ECPP",
357 .stream_name = "CPE Listen Audio Service ECPP",
358 .cpu_dai_name = "CPE_LSM_NOHOST",
359 .platform_name = "msm-cpe-lsm.3",
360 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
361 SND_SOC_DPCM_TRIGGER_POST},
362 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
363 .ignore_suspend = 1,
364 .ignore_pmdown_time = 1,
365 .codec_dai_name = "tasha_cpe",
366 .codec_name = "tasha_codec",
367 },
368};
369
370static struct snd_soc_dai_link msm_ext_tavil_fe_dai[] = {
371 {
372 .name = LPASS_BE_SLIMBUS_4_TX,
373 .stream_name = "Slimbus4 Capture",
374 .cpu_dai_name = "msm-dai-q6-dev.16393",
375 .platform_name = "msm-pcm-hostless",
376 .codec_name = "tavil_codec",
377 .codec_dai_name = "tavil_vifeedback",
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530378 .id = MSM_BACKEND_DAI_SLIMBUS_4_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530379 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
380 .ops = &msm_ext_slimbus_be_ops,
381 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
382 .ignore_suspend = 1,
383 },
384 /* Ultrasound RX DAI Link */
385 {
386 .name = "SLIMBUS_2 Hostless Playback",
387 .stream_name = "SLIMBUS_2 Hostless Playback",
388 .cpu_dai_name = "msm-dai-q6-dev.16388",
389 .platform_name = "msm-pcm-hostless",
390 .codec_name = "tavil_codec",
391 .codec_dai_name = "tavil_rx2",
392 .ignore_suspend = 1,
393 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
394 .ops = &msm_ext_slimbus_2_be_ops,
395 },
396 /* Ultrasound TX DAI Link */
397 {
398 .name = "SLIMBUS_2 Hostless Capture",
399 .stream_name = "SLIMBUS_2 Hostless Capture",
400 .cpu_dai_name = "msm-dai-q6-dev.16389",
401 .platform_name = "msm-pcm-hostless",
402 .codec_name = "tavil_codec",
403 .codec_dai_name = "tavil_tx2",
404 .ignore_suspend = 1,
405 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
406 .ops = &msm_ext_slimbus_2_be_ops,
407 },
408};
409
410static struct snd_soc_dai_link msm_ext_tasha_be_dai[] = {
411 /* Backend DAI Links */
412 {
413 .name = LPASS_BE_SLIMBUS_0_RX,
414 .stream_name = "Slimbus Playback",
415 .cpu_dai_name = "msm-dai-q6-dev.16384",
416 .platform_name = "msm-pcm-routing",
417 .codec_name = "tasha_codec",
418 .codec_dai_name = "tasha_mix_rx1",
419 .no_pcm = 1,
420 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530421 .id = MSM_BACKEND_DAI_SLIMBUS_0_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530422 .init = &msm_audrx_init,
423 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
424 /* this dainlink has playback support */
425 .ignore_pmdown_time = 1,
426 .ignore_suspend = 1,
427 .ops = &msm_ext_slimbus_be_ops,
428 },
429 {
430 .name = LPASS_BE_SLIMBUS_0_TX,
431 .stream_name = "Slimbus Capture",
432 .cpu_dai_name = "msm-dai-q6-dev.16385",
433 .platform_name = "msm-pcm-routing",
434 .codec_name = "tasha_codec",
435 .codec_dai_name = "tasha_tx1",
436 .no_pcm = 1,
437 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530438 .id = MSM_BACKEND_DAI_SLIMBUS_0_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530439 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
440 .ignore_suspend = 1,
441 .ops = &msm_ext_slimbus_be_ops,
442 },
443 {
444 .name = LPASS_BE_SLIMBUS_1_RX,
445 .stream_name = "Slimbus1 Playback",
446 .cpu_dai_name = "msm-dai-q6-dev.16386",
447 .platform_name = "msm-pcm-routing",
448 .codec_name = "tasha_codec",
449 .codec_dai_name = "tasha_mix_rx1",
450 .no_pcm = 1,
451 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530452 .id = MSM_BACKEND_DAI_SLIMBUS_1_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530453 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
454 .ops = &msm_ext_slimbus_be_ops,
455 /* dai link has playback support */
456 .ignore_pmdown_time = 1,
457 .ignore_suspend = 1,
458 },
459 {
460 .name = LPASS_BE_SLIMBUS_1_TX,
461 .stream_name = "Slimbus1 Capture",
462 .cpu_dai_name = "msm-dai-q6-dev.16387",
463 .platform_name = "msm-pcm-routing",
464 .codec_name = "tasha_codec",
465 .codec_dai_name = "tasha_tx3",
466 .no_pcm = 1,
467 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530468 .id = MSM_BACKEND_DAI_SLIMBUS_1_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530469 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
470 .ops = &msm_ext_slimbus_be_ops,
471 .ignore_suspend = 1,
472 },
473 {
474 .name = LPASS_BE_SLIMBUS_3_RX,
475 .stream_name = "Slimbus3 Playback",
476 .cpu_dai_name = "msm-dai-q6-dev.16390",
477 .platform_name = "msm-pcm-routing",
478 .codec_name = "tasha_codec",
479 .codec_dai_name = "tasha_mix_rx1",
480 .no_pcm = 1,
481 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530482 .id = MSM_BACKEND_DAI_SLIMBUS_3_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530483 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
484 .ops = &msm_ext_slimbus_be_ops,
485 /* dai link has playback support */
486 .ignore_pmdown_time = 1,
487 .ignore_suspend = 1,
488 },
489 {
490 .name = LPASS_BE_SLIMBUS_3_TX,
491 .stream_name = "Slimbus3 Capture",
492 .cpu_dai_name = "msm-dai-q6-dev.16391",
493 .platform_name = "msm-pcm-routing",
494 .codec_name = "tasha_codec",
495 .codec_dai_name = "tasha_tx1",
496 .no_pcm = 1,
497 .dpcm_capture = 1,
498 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530499 .id = MSM_BACKEND_DAI_SLIMBUS_3_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530500 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
501 .ops = &msm_ext_slimbus_be_ops,
502 .ignore_suspend = 1,
503 },
504 {
505 .name = LPASS_BE_SLIMBUS_4_RX,
506 .stream_name = "Slimbus4 Playback",
507 .cpu_dai_name = "msm-dai-q6-dev.16392",
508 .platform_name = "msm-pcm-routing",
509 .codec_name = "tasha_codec",
510 .codec_dai_name = "tasha_mix_rx1",
511 .no_pcm = 1,
512 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530513 .id = MSM_BACKEND_DAI_SLIMBUS_4_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530514 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
515 .ops = &msm_ext_slimbus_be_ops,
516 /* dai link has playback support */
517 .ignore_pmdown_time = 1,
518 .ignore_suspend = 1,
519 },
520 {
521 .name = LPASS_BE_SLIMBUS_5_RX,
522 .stream_name = "Slimbus5 Playback",
523 .cpu_dai_name = "msm-dai-q6-dev.16394",
524 .platform_name = "msm-pcm-routing",
525 .codec_name = "tasha_codec",
526 .codec_dai_name = "tasha_rx3",
527 .no_pcm = 1,
528 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530529 .id = MSM_BACKEND_DAI_SLIMBUS_5_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530530 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
531 .ops = &msm_ext_slimbus_be_ops,
532 /* dai link has playback support */
533 .ignore_pmdown_time = 1,
534 .ignore_suspend = 1,
535 },
536 /* MAD BE */
537 {
538 .name = LPASS_BE_SLIMBUS_5_TX,
539 .stream_name = "Slimbus5 Capture",
540 .cpu_dai_name = "msm-dai-q6-dev.16395",
541 .platform_name = "msm-pcm-routing",
542 .codec_name = "tasha_codec",
543 .codec_dai_name = "tasha_mad1",
544 .no_pcm = 1,
545 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530546 .id = MSM_BACKEND_DAI_SLIMBUS_5_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530547 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
548 .ops = &msm_ext_slimbus_be_ops,
549 .ignore_suspend = 1,
550 },
551 {
552 .name = LPASS_BE_SLIMBUS_6_RX,
553 .stream_name = "Slimbus6 Playback",
554 .cpu_dai_name = "msm-dai-q6-dev.16396",
555 .platform_name = "msm-pcm-routing",
556 .codec_name = "tasha_codec",
557 .codec_dai_name = "tasha_rx4",
558 .no_pcm = 1,
559 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530560 .id = MSM_BACKEND_DAI_SLIMBUS_6_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530561 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
562 .ops = &msm_ext_slimbus_be_ops,
563 /* dai link has playback support */
564 .ignore_pmdown_time = 1,
565 .ignore_suspend = 1,
566 },
567};
568
569static struct snd_soc_dai_link msm_ext_tavil_be_dai[] = {
570 {
571 .name = LPASS_BE_SLIMBUS_0_RX,
572 .stream_name = "Slimbus Playback",
573 .cpu_dai_name = "msm-dai-q6-dev.16384",
574 .platform_name = "msm-pcm-routing",
575 .codec_name = "tavil_codec",
576 .codec_dai_name = "tavil_rx1",
577 .no_pcm = 1,
578 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530579 .id = MSM_BACKEND_DAI_SLIMBUS_0_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530580 .init = &msm_audrx_init,
581 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
582 /* this dainlink has playback support */
583 .ignore_pmdown_time = 1,
584 .ignore_suspend = 1,
585 .ops = &msm_ext_slimbus_be_ops,
586 },
587 {
588 .name = LPASS_BE_SLIMBUS_0_TX,
589 .stream_name = "Slimbus Capture",
590 .cpu_dai_name = "msm-dai-q6-dev.16385",
591 .platform_name = "msm-pcm-routing",
592 .codec_name = "tavil_codec",
593 .codec_dai_name = "tavil_tx1",
594 .no_pcm = 1,
595 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530596 .id = MSM_BACKEND_DAI_SLIMBUS_0_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530597 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
598 .ignore_suspend = 1,
599 .ops = &msm_ext_slimbus_be_ops,
600 },
601 {
602 .name = LPASS_BE_SLIMBUS_1_RX,
603 .stream_name = "Slimbus1 Playback",
604 .cpu_dai_name = "msm-dai-q6-dev.16386",
605 .platform_name = "msm-pcm-routing",
606 .codec_name = "tavil_codec",
607 .codec_dai_name = "tavil_rx1",
608 .no_pcm = 1,
609 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530610 .id = MSM_BACKEND_DAI_SLIMBUS_1_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530611 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
612 .ops = &msm_ext_slimbus_be_ops,
613 /* dai link has playback support */
614 .ignore_pmdown_time = 1,
615 .ignore_suspend = 1,
616 },
617 {
618 .name = LPASS_BE_SLIMBUS_1_TX,
619 .stream_name = "Slimbus1 Capture",
620 .cpu_dai_name = "msm-dai-q6-dev.16387",
621 .platform_name = "msm-pcm-routing",
622 .codec_name = "tavil_codec",
623 .codec_dai_name = "tavil_tx3",
624 .no_pcm = 1,
625 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530626 .id = MSM_BACKEND_DAI_SLIMBUS_1_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530627 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
628 .ops = &msm_ext_slimbus_be_ops,
629 .ignore_suspend = 1,
630 },
631 {
632 .name = LPASS_BE_SLIMBUS_2_RX,
633 .stream_name = "Slimbus2 Playback",
634 .cpu_dai_name = "msm-dai-q6-dev.16388",
635 .platform_name = "msm-pcm-routing",
636 .codec_name = "tavil_codec",
637 .codec_dai_name = "tavil_rx2",
638 .no_pcm = 1,
639 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530640 .id = MSM_BACKEND_DAI_SLIMBUS_2_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530641 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
642 .ops = &msm_ext_slimbus_be_ops,
643 .ignore_pmdown_time = 1,
644 .ignore_suspend = 1,
645 },
646 {
647 .name = LPASS_BE_SLIMBUS_3_RX,
648 .stream_name = "Slimbus3 Playback",
649 .cpu_dai_name = "msm-dai-q6-dev.16390",
650 .platform_name = "msm-pcm-routing",
651 .codec_name = "tavil_codec",
652 .codec_dai_name = "tavil_rx1",
653 .no_pcm = 1,
654 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530655 .id = MSM_BACKEND_DAI_SLIMBUS_3_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530656 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
657 .ops = &msm_ext_slimbus_be_ops,
658 /* dai link has playback support */
659 .ignore_pmdown_time = 1,
660 .ignore_suspend = 1,
661 },
662 {
663 .name = LPASS_BE_SLIMBUS_3_TX,
664 .stream_name = "Slimbus3 Capture",
665 .cpu_dai_name = "msm-dai-q6-dev.16391",
666 .platform_name = "msm-pcm-routing",
667 .codec_name = "tavil_codec",
668 .codec_dai_name = "tavil_tx1",
669 .no_pcm = 1,
670 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530671 .id = MSM_BACKEND_DAI_SLIMBUS_3_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530672 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
673 .ops = &msm_ext_slimbus_be_ops,
674 .ignore_suspend = 1,
675 },
676 {
677 .name = LPASS_BE_SLIMBUS_4_RX,
678 .stream_name = "Slimbus4 Playback",
679 .cpu_dai_name = "msm-dai-q6-dev.16392",
680 .platform_name = "msm-pcm-routing",
681 .codec_name = "tavil_codec",
682 .codec_dai_name = "tavil_rx1",
683 .no_pcm = 1,
684 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530685 .id = MSM_BACKEND_DAI_SLIMBUS_4_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530686 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
687 .ops = &msm_ext_slimbus_be_ops,
688 /* dai link has playback support */
689 .ignore_pmdown_time = 1,
690 .ignore_suspend = 1,
691 },
692 {
693 .name = LPASS_BE_SLIMBUS_5_RX,
694 .stream_name = "Slimbus5 Playback",
695 .cpu_dai_name = "msm-dai-q6-dev.16394",
696 .platform_name = "msm-pcm-routing",
697 .codec_name = "tavil_codec",
698 .codec_dai_name = "tavil_rx3",
699 .no_pcm = 1,
700 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530701 .id = MSM_BACKEND_DAI_SLIMBUS_5_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530702 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
703 .ops = &msm_ext_slimbus_be_ops,
704 /* dai link has playback support */
705 .ignore_pmdown_time = 1,
706 .ignore_suspend = 1,
707 },
708 /* MAD BE */
709 {
710 .name = LPASS_BE_SLIMBUS_5_TX,
711 .stream_name = "Slimbus5 Capture",
712 .cpu_dai_name = "msm-dai-q6-dev.16395",
713 .platform_name = "msm-pcm-routing",
714 .codec_name = "tavil_codec",
715 .codec_dai_name = "tavil_mad1",
716 .no_pcm = 1,
717 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530718 .id = MSM_BACKEND_DAI_SLIMBUS_5_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530719 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
720 .ops = &msm_ext_slimbus_be_ops,
721 .ignore_suspend = 1,
722 },
723 {
724 .name = LPASS_BE_SLIMBUS_6_RX,
725 .stream_name = "Slimbus6 Playback",
726 .cpu_dai_name = "msm-dai-q6-dev.16396",
727 .platform_name = "msm-pcm-routing",
728 .codec_name = "tavil_codec",
729 .codec_dai_name = "tavil_rx4",
730 .no_pcm = 1,
731 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530732 .id = MSM_BACKEND_DAI_SLIMBUS_6_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530733 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
734 .ops = &msm_ext_slimbus_be_ops,
735 /* dai link has playback support */
736 .ignore_pmdown_time = 1,
737 .ignore_suspend = 1,
738 },
739};
740
741static struct snd_soc_dai_link msm_ext_common_fe_dai[] = {
742 /* FrontEnd DAI Links */
743 {/* hw:x,0 */
744 .name = MSM_DAILINK_NAME(Media1),
745 .stream_name = "MultiMedia1",
746 .cpu_dai_name = "MultiMedia1",
747 .platform_name = "msm-pcm-dsp.0",
748 .dynamic = 1,
749 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
750 SND_SOC_DPCM_TRIGGER_POST},
751 .codec_dai_name = "snd-soc-dummy-dai",
752 .codec_name = "snd-soc-dummy",
753 .ignore_suspend = 1,
754 .dpcm_playback = 1,
755 .dpcm_capture = 1,
756 /* this dai link has playback support */
757 .ignore_pmdown_time = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530758 .id = MSM_FRONTEND_DAI_MULTIMEDIA1
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530759 },
760 {/* hw:x,1 */
761 .name = MSM_DAILINK_NAME(Media2),
762 .stream_name = "MultiMedia2",
763 .cpu_dai_name = "MultiMedia2",
764 .platform_name = "msm-pcm-dsp.0",
765 .dynamic = 1,
766 .dpcm_playback = 1,
767 .dpcm_capture = 1,
768 .codec_dai_name = "snd-soc-dummy-dai",
769 .codec_name = "snd-soc-dummy",
770 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
771 SND_SOC_DPCM_TRIGGER_POST},
772 .ignore_suspend = 1,
773 /* this dai link has playback support */
774 .ignore_pmdown_time = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530775 .id = MSM_FRONTEND_DAI_MULTIMEDIA2,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530776 },
777 {/* hw:x,2 */
778 .name = "VoiceMMode1",
779 .stream_name = "VoiceMMode1",
780 .cpu_dai_name = "VoiceMMode1",
781 .platform_name = "msm-pcm-voice",
782 .dynamic = 1,
783 .dpcm_capture = 1,
784 .dpcm_playback = 1,
785 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
786 SND_SOC_DPCM_TRIGGER_POST},
787 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
788 .ignore_suspend = 1,
789 .ignore_pmdown_time = 1,
790 .codec_dai_name = "snd-soc-dummy-dai",
791 .codec_name = "snd-soc-dummy",
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530792 .id = MSM_FRONTEND_DAI_VOICEMMODE1,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530793 },
794 {/* hw:x,3 */
795 .name = "MSM VoIP",
796 .stream_name = "VoIP",
797 .cpu_dai_name = "VoIP",
798 .platform_name = "msm-voip-dsp",
799 .dynamic = 1,
800 .dpcm_playback = 1,
801 .dpcm_capture = 1,
802 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
803 SND_SOC_DPCM_TRIGGER_POST},
804 .codec_dai_name = "snd-soc-dummy-dai",
805 .codec_name = "snd-soc-dummy",
806 .ignore_suspend = 1,
807 /* this dai link has playback support */
808 .ignore_pmdown_time = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530809 .id = MSM_FRONTEND_DAI_VOIP,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530810 },
811 {/* hw:x,4 */
812 .name = MSM_DAILINK_NAME(ULL),
813 .stream_name = "ULL",
814 .cpu_dai_name = "MultiMedia3",
815 .platform_name = "msm-pcm-dsp.2",
816 .dynamic = 1,
817 .dpcm_playback = 1,
818 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
819 SND_SOC_DPCM_TRIGGER_POST},
820 .codec_dai_name = "snd-soc-dummy-dai",
821 .codec_name = "snd-soc-dummy",
822 .ignore_suspend = 1,
823 /* this dai link has playback support */
824 .ignore_pmdown_time = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530825 .id = MSM_FRONTEND_DAI_MULTIMEDIA3,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530826 },
827 /* Hostless PCM purpose */
828 {/* hw:x,5 */
829 .name = "SLIMBUS_0 Hostless",
830 .stream_name = "SLIMBUS_0 Hostless",
831 .cpu_dai_name = "SLIMBUS0_HOSTLESS",
832 .platform_name = "msm-pcm-hostless",
833 .dynamic = 1,
834 .dpcm_capture = 1,
835 .dpcm_playback = 1,
836 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
837 SND_SOC_DPCM_TRIGGER_POST},
838 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
839 .ignore_suspend = 1,
840 .ignore_pmdown_time = 1,
841 /* This dai link has MI2S support */
842 .codec_dai_name = "snd-soc-dummy-dai",
843 .codec_name = "snd-soc-dummy",
844 },
845 {/* hw:x,6 */
846 .name = "MSM AFE-PCM RX",
847 .stream_name = "AFE-PROXY RX",
848 .cpu_dai_name = "msm-dai-q6-dev.241",
849 .codec_name = "msm-stub-codec.1",
850 .codec_dai_name = "msm-stub-rx",
851 .platform_name = "msm-pcm-afe",
852 .ignore_suspend = 1,
853 /* this dai link has playback support */
854 .ignore_pmdown_time = 1,
855 },
856 {/* hw:x,7 */
857 .name = "MSM AFE-PCM TX",
858 .stream_name = "AFE-PROXY TX",
859 .cpu_dai_name = "msm-dai-q6-dev.240",
860 .codec_name = "msm-stub-codec.1",
861 .codec_dai_name = "msm-stub-tx",
862 .platform_name = "msm-pcm-afe",
863 .ignore_suspend = 1,
864 },
865 {/* hw:x,8 */
866 .name = MSM_DAILINK_NAME(Compress1),
867 .stream_name = "Compress1",
868 .cpu_dai_name = "MultiMedia4",
869 .platform_name = "msm-compress-dsp",
870 .async_ops = ASYNC_DPCM_SND_SOC_HW_PARAMS,
871 .dynamic = 1,
872 .dpcm_capture = 1,
873 .dpcm_playback = 1,
874 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
875 SND_SOC_DPCM_TRIGGER_POST},
876 .codec_dai_name = "snd-soc-dummy-dai",
877 .codec_name = "snd-soc-dummy",
878 .ignore_suspend = 1,
879 .ignore_pmdown_time = 1,
880 /* this dai link has playback support */
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530881 .id = MSM_FRONTEND_DAI_MULTIMEDIA4,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530882 },
883 {/* hw:x,9*/
884 .name = "AUXPCM Hostless",
885 .stream_name = "AUXPCM Hostless",
886 .cpu_dai_name = "AUXPCM_HOSTLESS",
887 .platform_name = "msm-pcm-hostless",
888 .dynamic = 1,
889 .dpcm_capture = 1,
890 .dpcm_playback = 1,
891 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
892 SND_SOC_DPCM_TRIGGER_POST},
893 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
894 .ignore_suspend = 1,
895 /* this dai link has playback support */
896 .ignore_pmdown_time = 1,
897 .codec_dai_name = "snd-soc-dummy-dai",
898 .codec_name = "snd-soc-dummy",
899 },
900 {/* hw:x,10 */
901 .name = "SLIMBUS_1 Hostless",
902 .stream_name = "SLIMBUS_1 Hostless",
903 .cpu_dai_name = "SLIMBUS1_HOSTLESS",
904 .platform_name = "msm-pcm-hostless",
905 .dynamic = 1,
906 .dpcm_capture = 1,
907 .dpcm_playback = 1,
908 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
909 SND_SOC_DPCM_TRIGGER_POST},
910 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
911 .ignore_suspend = 1,
912 .ignore_pmdown_time = 1, /* dai link has playback support */
913 .codec_dai_name = "snd-soc-dummy-dai",
914 .codec_name = "snd-soc-dummy",
915 },
916 {/* hw:x,11 */
917 .name = "SLIMBUS_3 Hostless",
918 .stream_name = "SLIMBUS_3 Hostless",
919 .cpu_dai_name = "SLIMBUS3_HOSTLESS",
920 .platform_name = "msm-pcm-hostless",
921 .dynamic = 1,
922 .dpcm_capture = 1,
923 .dpcm_playback = 1,
924 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
925 SND_SOC_DPCM_TRIGGER_POST},
926 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
927 .ignore_suspend = 1,
928 .ignore_pmdown_time = 1, /* dai link has playback support */
929 .codec_dai_name = "snd-soc-dummy-dai",
930 .codec_name = "snd-soc-dummy",
931 },
932 {/* hw:x,12 */
933 .name = "SLIMBUS_4 Hostless",
934 .stream_name = "SLIMBUS_4 Hostless",
935 .cpu_dai_name = "SLIMBUS4_HOSTLESS",
936 .platform_name = "msm-pcm-hostless",
937 .dynamic = 1,
938 .dpcm_capture = 1,
939 .dpcm_playback = 1,
940 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
941 SND_SOC_DPCM_TRIGGER_POST},
942 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
943 .ignore_suspend = 1,
944 .ignore_pmdown_time = 1, /* dai link has playback support */
945 .codec_dai_name = "snd-soc-dummy-dai",
946 .codec_name = "snd-soc-dummy",
947 },
948 {/* hw:x,13 */
949 .name = MSM_DAILINK_NAME(LowLatency),
950 .stream_name = "MultiMedia5",
951 .cpu_dai_name = "MultiMedia5",
952 .platform_name = "msm-pcm-dsp.1",
953 .dynamic = 1,
954 .dpcm_capture = 1,
955 .dpcm_playback = 1,
956 .codec_dai_name = "snd-soc-dummy-dai",
957 .codec_name = "snd-soc-dummy",
958 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
959 SND_SOC_DPCM_TRIGGER_POST},
960 .ignore_suspend = 1,
961 /* this dai link has playback support */
962 .ignore_pmdown_time = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530963 .id = MSM_FRONTEND_DAI_MULTIMEDIA5,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530964 },
965 /* LSM FE */
966 {/* hw:x,14 */
967 .name = "Listen 1 Audio Service",
968 .stream_name = "Listen 1 Audio Service",
969 .cpu_dai_name = "LSM1",
970 .platform_name = "msm-lsm-client",
971 .dynamic = 1,
972 .dpcm_capture = 1,
973 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
974 SND_SOC_DPCM_TRIGGER_POST },
975 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
976 .ignore_suspend = 1,
977 .ignore_pmdown_time = 1,
978 .codec_dai_name = "snd-soc-dummy-dai",
979 .codec_name = "snd-soc-dummy",
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530980 .id = MSM_FRONTEND_DAI_LSM1,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530981 },
982 {/* hw:x,15 */
983 .name = MSM_DAILINK_NAME(Compress2),
984 .stream_name = "Compress2",
985 .cpu_dai_name = "MultiMedia7",
986 .platform_name = "msm-compress-dsp",
987 .dynamic = 1,
988 .dpcm_capture = 1,
989 .dpcm_playback = 1,
990 .codec_dai_name = "snd-soc-dummy-dai",
991 .codec_name = "snd-soc-dummy",
992 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
993 SND_SOC_DPCM_TRIGGER_POST},
994 .ignore_suspend = 1,
995 /* this dai link has playback support */
996 .ignore_pmdown_time = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +0530997 .id = MSM_FRONTEND_DAI_MULTIMEDIA7,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530998 },
999 {/* hw:x,16 */
Laxminath Kasam38070be2017-08-17 18:21:59 +05301000 .name = MSM_DAILINK_NAME(MultiMedia10),
1001 .stream_name = "MultiMedia10",
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301002 .cpu_dai_name = "MultiMedia10",
Laxminath Kasam38070be2017-08-17 18:21:59 +05301003 .platform_name = "msm-pcm-dsp.1",
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301004 .dynamic = 1,
1005 .dpcm_capture = 1,
1006 .dpcm_playback = 1,
Laxminath Kasam38070be2017-08-17 18:21:59 +05301007 .dpcm_capture = 1,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301008 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1009 SND_SOC_DPCM_TRIGGER_POST},
1010 .codec_dai_name = "snd-soc-dummy-dai",
1011 .codec_name = "snd-soc-dummy",
1012 .ignore_suspend = 1,
1013 .ignore_pmdown_time = 1,
1014 /* this dai link has playback support */
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301015 .id = MSM_FRONTEND_DAI_MULTIMEDIA10,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301016 },
1017 {/* hw:x,17 */
1018 .name = MSM_DAILINK_NAME(ULL_NOIRQ),
1019 .stream_name = "MM_NOIRQ",
1020 .cpu_dai_name = "MultiMedia8",
1021 .platform_name = "msm-pcm-dsp-noirq",
1022 .dynamic = 1,
1023 .dpcm_capture = 1,
1024 .dpcm_playback = 1,
1025 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1026 SND_SOC_DPCM_TRIGGER_POST},
1027 .codec_dai_name = "snd-soc-dummy-dai",
1028 .codec_name = "snd-soc-dummy",
1029 .ignore_suspend = 1,
1030 .ignore_pmdown_time = 1,
1031 /* this dai link has playback support */
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301032 .id = MSM_FRONTEND_DAI_MULTIMEDIA8,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301033 },
1034 {/* hw:x,18 */
1035 .name = "HDMI_RX_HOSTLESS",
1036 .stream_name = "HDMI_RX_HOSTLESS",
1037 .cpu_dai_name = "HDMI_HOSTLESS",
1038 .platform_name = "msm-pcm-hostless",
1039 .dynamic = 1,
1040 .dpcm_playback = 1,
1041 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1042 SND_SOC_DPCM_TRIGGER_POST},
1043 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
1044 .ignore_suspend = 1,
1045 .ignore_pmdown_time = 1,
1046 .codec_dai_name = "snd-soc-dummy-dai",
1047 .codec_name = "snd-soc-dummy",
1048 },
1049 {/* hw:x,19 */
1050 .name = "VoiceMMode2",
1051 .stream_name = "VoiceMMode2",
1052 .cpu_dai_name = "VoiceMMode2",
1053 .platform_name = "msm-pcm-voice",
1054 .dynamic = 1,
1055 .dpcm_capture = 1,
1056 .dpcm_playback = 1,
1057 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1058 SND_SOC_DPCM_TRIGGER_POST},
1059 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
1060 .ignore_suspend = 1,
1061 .ignore_pmdown_time = 1,
1062 .codec_dai_name = "snd-soc-dummy-dai",
1063 .codec_name = "snd-soc-dummy",
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301064 .id = MSM_FRONTEND_DAI_VOICEMMODE2,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301065 },
1066 {/* hw:x,20 */
1067 .name = "Listen 2 Audio Service",
1068 .stream_name = "Listen 2 Audio Service",
1069 .cpu_dai_name = "LSM2",
1070 .platform_name = "msm-lsm-client",
1071 .dynamic = 1,
1072 .dpcm_capture = 1,
1073 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1074 SND_SOC_DPCM_TRIGGER_POST },
1075 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
1076 .ignore_suspend = 1,
1077 .ignore_pmdown_time = 1,
1078 .codec_dai_name = "snd-soc-dummy-dai",
1079 .codec_name = "snd-soc-dummy",
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301080 .id = MSM_FRONTEND_DAI_LSM2,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301081 },
1082 {/* hw:x,21 */
1083 .name = "Listen 3 Audio Service",
1084 .stream_name = "Listen 3 Audio Service",
1085 .cpu_dai_name = "LSM3",
1086 .platform_name = "msm-lsm-client",
1087 .dynamic = 1,
1088 .dpcm_capture = 1,
1089 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1090 SND_SOC_DPCM_TRIGGER_POST },
1091 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
1092 .ignore_suspend = 1,
1093 .ignore_pmdown_time = 1,
1094 .codec_dai_name = "snd-soc-dummy-dai",
1095 .codec_name = "snd-soc-dummy",
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301096 .id = MSM_FRONTEND_DAI_LSM3,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301097 },
1098 {/* hw:x,22 */
1099 .name = "Listen 4 Audio Service",
1100 .stream_name = "Listen 4 Audio Service",
1101 .cpu_dai_name = "LSM4",
1102 .platform_name = "msm-lsm-client",
1103 .dynamic = 1,
1104 .dpcm_capture = 1,
1105 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1106 SND_SOC_DPCM_TRIGGER_POST },
1107 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
1108 .ignore_suspend = 1,
1109 .ignore_pmdown_time = 1,
1110 .codec_dai_name = "snd-soc-dummy-dai",
1111 .codec_name = "snd-soc-dummy",
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301112 .id = MSM_FRONTEND_DAI_LSM4,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301113 },
1114 {/* hw:x,23 */
1115 .name = "Listen 5 Audio Service",
1116 .stream_name = "Listen 5 Audio Service",
1117 .cpu_dai_name = "LSM5",
1118 .platform_name = "msm-lsm-client",
1119 .dynamic = 1,
1120 .dpcm_capture = 1,
1121 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1122 SND_SOC_DPCM_TRIGGER_POST },
1123 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
1124 .ignore_suspend = 1,
1125 .ignore_pmdown_time = 1,
1126 .codec_dai_name = "snd-soc-dummy-dai",
1127 .codec_name = "snd-soc-dummy",
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301128 .id = MSM_FRONTEND_DAI_LSM5,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301129 },
1130 {/* hw:x,24 */
1131 .name = "Listen 6 Audio Service",
1132 .stream_name = "Listen 6 Audio Service",
1133 .cpu_dai_name = "LSM6",
1134 .platform_name = "msm-lsm-client",
1135 .dynamic = 1,
1136 .dpcm_capture = 1,
1137 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1138 SND_SOC_DPCM_TRIGGER_POST },
1139 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
1140 .ignore_suspend = 1,
1141 .ignore_pmdown_time = 1,
1142 .codec_dai_name = "snd-soc-dummy-dai",
1143 .codec_name = "snd-soc-dummy",
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301144 .id = MSM_FRONTEND_DAI_LSM6
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301145 },
1146 {/* hw:x,25 */
1147 .name = "Listen 7 Audio Service",
1148 .stream_name = "Listen 7 Audio Service",
1149 .cpu_dai_name = "LSM7",
1150 .platform_name = "msm-lsm-client",
1151 .dynamic = 1,
1152 .dpcm_capture = 1,
1153 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1154 SND_SOC_DPCM_TRIGGER_POST },
1155 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
1156 .ignore_suspend = 1,
1157 .ignore_pmdown_time = 1,
1158 .codec_dai_name = "snd-soc-dummy-dai",
1159 .codec_name = "snd-soc-dummy",
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301160 .id = MSM_FRONTEND_DAI_LSM7,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301161 },
1162 {/* hw:x,26 */
1163 .name = "Listen 8 Audio Service",
1164 .stream_name = "Listen 8 Audio Service",
1165 .cpu_dai_name = "LSM8",
1166 .platform_name = "msm-lsm-client",
1167 .dynamic = 1,
1168 .dpcm_capture = 1,
1169 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1170 SND_SOC_DPCM_TRIGGER_POST },
1171 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
1172 .ignore_suspend = 1,
1173 .ignore_pmdown_time = 1,
1174 .codec_dai_name = "snd-soc-dummy-dai",
1175 .codec_name = "snd-soc-dummy",
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301176 .id = MSM_FRONTEND_DAI_LSM8,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301177 },
1178 {/* hw:x,27 */
1179 .name = MSM_DAILINK_NAME(Media9),
1180 .stream_name = "MultiMedia9",
1181 .cpu_dai_name = "MultiMedia9",
1182 .platform_name = "msm-pcm-dsp.0",
1183 .dynamic = 1,
1184 .dpcm_capture = 1,
1185 .dpcm_playback = 1,
1186 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1187 SND_SOC_DPCM_TRIGGER_POST},
1188 .codec_dai_name = "snd-soc-dummy-dai",
1189 .codec_name = "snd-soc-dummy",
1190 .ignore_suspend = 1,
1191 .ignore_pmdown_time = 1,
1192 /* this dai link has playback support */
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301193 .id = MSM_FRONTEND_DAI_MULTIMEDIA9,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301194 },
1195 {/* hw:x,28 */
1196 .name = MSM_DAILINK_NAME(Compress4),
1197 .stream_name = "Compress4",
1198 .cpu_dai_name = "MultiMedia11",
1199 .platform_name = "msm-compress-dsp",
1200 .dynamic = 1,
1201 .dpcm_capture = 1,
1202 .dpcm_playback = 1,
1203 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1204 SND_SOC_DPCM_TRIGGER_POST},
1205 .codec_dai_name = "snd-soc-dummy-dai",
1206 .codec_name = "snd-soc-dummy",
1207 .ignore_suspend = 1,
1208 .ignore_pmdown_time = 1,
1209 /* this dai link has playback support */
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301210 .id = MSM_FRONTEND_DAI_MULTIMEDIA11,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301211 },
1212 {/* hw:x,29 */
1213 .name = MSM_DAILINK_NAME(Compress5),
1214 .stream_name = "Compress5",
1215 .cpu_dai_name = "MultiMedia12",
1216 .platform_name = "msm-compress-dsp",
1217 .dynamic = 1,
1218 .dpcm_capture = 1,
1219 .dpcm_playback = 1,
1220 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1221 SND_SOC_DPCM_TRIGGER_POST},
1222 .codec_dai_name = "snd-soc-dummy-dai",
1223 .codec_name = "snd-soc-dummy",
1224 .ignore_suspend = 1,
1225 .ignore_pmdown_time = 1,
1226 /* this dai link has playback support */
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301227 .id = MSM_FRONTEND_DAI_MULTIMEDIA12,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301228 },
1229 {/* hw:x,30 */
1230 .name = MSM_DAILINK_NAME(Compress6),
1231 .stream_name = "Compress6",
1232 .cpu_dai_name = "MultiMedia13",
1233 .platform_name = "msm-compress-dsp",
1234 .dynamic = 1,
1235 .dpcm_capture = 1,
1236 .dpcm_playback = 1,
1237 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1238 SND_SOC_DPCM_TRIGGER_POST},
1239 .codec_dai_name = "snd-soc-dummy-dai",
1240 .codec_name = "snd-soc-dummy",
1241 .ignore_suspend = 1,
1242 .ignore_pmdown_time = 1,
1243 /* this dai link has playback support */
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301244 .id = MSM_FRONTEND_DAI_MULTIMEDIA13,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301245 },
1246 {/* hw:x,31 */
1247 .name = MSM_DAILINK_NAME(Compress7),
1248 .stream_name = "Compress7",
1249 .cpu_dai_name = "MultiMedia14",
1250 .platform_name = "msm-compress-dsp",
1251 .dynamic = 1,
1252 .dpcm_capture = 1,
1253 .dpcm_playback = 1,
1254 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1255 SND_SOC_DPCM_TRIGGER_POST},
1256 .codec_dai_name = "snd-soc-dummy-dai",
1257 .codec_name = "snd-soc-dummy",
1258 .ignore_suspend = 1,
1259 .ignore_pmdown_time = 1,
1260 /* this dai link has playback support */
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301261 .id = MSM_FRONTEND_DAI_MULTIMEDIA14,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301262 },
1263 {/* hw:x,32 */
1264 .name = MSM_DAILINK_NAME(Compress8),
1265 .stream_name = "Compress8",
1266 .cpu_dai_name = "MultiMedia15",
1267 .platform_name = "msm-compress-dsp",
1268 .dynamic = 1,
1269 .dpcm_capture = 1,
1270 .dpcm_playback = 1,
1271 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1272 SND_SOC_DPCM_TRIGGER_POST},
1273 .codec_dai_name = "snd-soc-dummy-dai",
1274 .codec_name = "snd-soc-dummy",
1275 .ignore_suspend = 1,
1276 .ignore_pmdown_time = 1,
1277 /* this dai link has playback support */
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301278 .id = MSM_FRONTEND_DAI_MULTIMEDIA15,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301279 },
1280 {/* hw:x,33 */
Asish Bhattacharya34504582017-08-08 12:55:01 +05301281 .name = MSM_DAILINK_NAME(ULL_NOIRQ_2),
1282 .stream_name = "MM_NOIRQ_2",
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301283 .cpu_dai_name = "MultiMedia16",
Asish Bhattacharya34504582017-08-08 12:55:01 +05301284 .platform_name = "msm-pcm-dsp-noirq",
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301285 .dynamic = 1,
1286 .dpcm_capture = 1,
1287 .dpcm_playback = 1,
1288 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1289 SND_SOC_DPCM_TRIGGER_POST},
1290 .codec_dai_name = "snd-soc-dummy-dai",
1291 .codec_name = "snd-soc-dummy",
1292 .ignore_suspend = 1,
1293 .ignore_pmdown_time = 1,
1294 /* this dai link has playback support */
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301295 .id = MSM_FRONTEND_DAI_MULTIMEDIA16,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301296 },
1297 {/* hw:x,34 */
1298 .name = "SLIMBUS_8 Hostless",
1299 .stream_name = "SLIMBUS8_HOSTLESS Capture",
1300 .cpu_dai_name = "SLIMBUS8_HOSTLESS",
1301 .platform_name = "msm-pcm-hostless",
1302 .dynamic = 1,
1303 .dpcm_capture = 1,
1304 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1305 SND_SOC_DPCM_TRIGGER_POST},
1306 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
1307 .ignore_suspend = 1,
1308 .ignore_pmdown_time = 1,
1309 .codec_dai_name = "snd-soc-dummy-dai",
1310 .codec_name = "snd-soc-dummy",
1311 },
1312 {/* hw:x,35 */
1313 .name = "SLIMBUS7 Hostless",
1314 .stream_name = "SLIMBUS7 Hostless",
1315 .cpu_dai_name = "SLIMBUS7_HOSTLESS",
1316 .platform_name = "msm-pcm-hostless",
1317 .dynamic = 1,
1318 .dpcm_playback = 1,
1319 .dpcm_capture = 1,
1320 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1321 SND_SOC_DPCM_TRIGGER_POST},
1322 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
1323 .ignore_suspend = 1,
1324 .ignore_pmdown_time = 1,
1325 .codec_dai_name = "snd-soc-dummy-dai",
1326 .codec_name = "snd-soc-dummy",
1327 },
1328 {/* hw:x,36 */
1329 .name = "SDM660 HFP TX",
1330 .stream_name = "MultiMedia6",
1331 .cpu_dai_name = "MultiMedia6",
1332 .platform_name = "msm-pcm-loopback",
1333 .dynamic = 1,
1334 .dpcm_playback = 1,
1335 .dpcm_capture = 1,
1336 .codec_dai_name = "snd-soc-dummy-dai",
1337 .codec_name = "snd-soc-dummy",
1338 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
1339 SND_SOC_DPCM_TRIGGER_POST},
1340 .ignore_suspend = 1,
1341 .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
1342 .ignore_pmdown_time = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301343 .id = MSM_FRONTEND_DAI_MULTIMEDIA6,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301344 },
1345};
1346
1347static struct snd_soc_dai_link msm_ext_common_be_dai[] = {
1348 {
1349 .name = LPASS_BE_AFE_PCM_RX,
1350 .stream_name = "AFE Playback",
1351 .cpu_dai_name = "msm-dai-q6-dev.224",
1352 .platform_name = "msm-pcm-routing",
1353 .codec_name = "msm-stub-codec.1",
1354 .codec_dai_name = "msm-stub-rx",
1355 .no_pcm = 1,
1356 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301357 .id = MSM_BACKEND_DAI_AFE_PCM_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301358 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1359 /* this dai link has playback support */
1360 .ignore_pmdown_time = 1,
1361 .ignore_suspend = 1,
1362 },
1363 {
1364 .name = LPASS_BE_AFE_PCM_TX,
1365 .stream_name = "AFE Capture",
1366 .cpu_dai_name = "msm-dai-q6-dev.225",
1367 .platform_name = "msm-pcm-routing",
1368 .codec_name = "msm-stub-codec.1",
1369 .codec_dai_name = "msm-stub-tx",
1370 .no_pcm = 1,
1371 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301372 .id = MSM_BACKEND_DAI_AFE_PCM_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301373 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1374 .ignore_suspend = 1,
1375 },
1376 /* Incall Record Uplink BACK END DAI Link */
1377 {
1378 .name = LPASS_BE_INCALL_RECORD_TX,
1379 .stream_name = "Voice Uplink Capture",
1380 .cpu_dai_name = "msm-dai-q6-dev.32772",
1381 .platform_name = "msm-pcm-routing",
1382 .codec_name = "msm-stub-codec.1",
1383 .codec_dai_name = "msm-stub-tx",
1384 .no_pcm = 1,
1385 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301386 .id = MSM_BACKEND_DAI_INCALL_RECORD_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301387 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
1388 .ignore_suspend = 1,
1389 },
1390 /* Incall Record Downlink BACK END DAI Link */
1391 {
1392 .name = LPASS_BE_INCALL_RECORD_RX,
1393 .stream_name = "Voice Downlink Capture",
1394 .cpu_dai_name = "msm-dai-q6-dev.32771",
1395 .platform_name = "msm-pcm-routing",
1396 .codec_name = "msm-stub-codec.1",
1397 .codec_dai_name = "msm-stub-tx",
1398 .no_pcm = 1,
1399 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301400 .id = MSM_BACKEND_DAI_INCALL_RECORD_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301401 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
1402 .ignore_suspend = 1,
1403 },
1404 /* Incall Music BACK END DAI Link */
1405 {
1406 .name = LPASS_BE_VOICE_PLAYBACK_TX,
1407 .stream_name = "Voice Farend Playback",
1408 .cpu_dai_name = "msm-dai-q6-dev.32773",
1409 .platform_name = "msm-pcm-routing",
1410 .codec_name = "msm-stub-codec.1",
1411 .codec_dai_name = "msm-stub-rx",
1412 .no_pcm = 1,
1413 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301414 .id = MSM_BACKEND_DAI_VOICE_PLAYBACK_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301415 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
1416 .ignore_suspend = 1,
1417 },
1418 /* Incall Music 2 BACK END DAI Link */
1419 {
1420 .name = LPASS_BE_VOICE2_PLAYBACK_TX,
1421 .stream_name = "Voice2 Farend Playback",
1422 .cpu_dai_name = "msm-dai-q6-dev.32770",
1423 .platform_name = "msm-pcm-routing",
1424 .codec_name = "msm-stub-codec.1",
1425 .codec_dai_name = "msm-stub-rx",
1426 .no_pcm = 1,
1427 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301428 .id = MSM_BACKEND_DAI_VOICE2_PLAYBACK_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301429 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
1430 .ignore_suspend = 1,
1431 },
1432 {
1433 .name = LPASS_BE_USB_AUDIO_RX,
1434 .stream_name = "USB Audio Playback",
1435 .cpu_dai_name = "msm-dai-q6-dev.28672",
1436 .platform_name = "msm-pcm-routing",
1437 .codec_name = "msm-stub-codec.1",
1438 .codec_dai_name = "msm-stub-rx",
1439 .no_pcm = 1,
1440 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301441 .id = MSM_BACKEND_DAI_USB_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301442 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1443 .ignore_pmdown_time = 1,
1444 .ignore_suspend = 1,
1445 },
1446 {
1447 .name = LPASS_BE_USB_AUDIO_TX,
1448 .stream_name = "USB Audio Capture",
1449 .cpu_dai_name = "msm-dai-q6-dev.28673",
1450 .platform_name = "msm-pcm-routing",
1451 .codec_name = "msm-stub-codec.1",
1452 .codec_dai_name = "msm-stub-tx",
1453 .no_pcm = 1,
1454 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301455 .id = MSM_BACKEND_DAI_USB_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301456 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1457 .ignore_suspend = 1,
1458 },
1459 {
1460 .name = LPASS_BE_PRI_TDM_RX_0,
1461 .stream_name = "Primary TDM0 Playback",
1462 .cpu_dai_name = "msm-dai-q6-tdm.36864",
1463 .platform_name = "msm-pcm-routing",
1464 .codec_name = "msm-stub-codec.1",
1465 .codec_dai_name = "msm-stub-rx",
1466 .no_pcm = 1,
1467 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301468 .id = MSM_BACKEND_DAI_PRI_TDM_RX_0,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301469 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1470 .ops = &msm_tdm_be_ops,
1471 .ignore_suspend = 1,
1472 },
1473 {
1474 .name = LPASS_BE_PRI_TDM_TX_0,
1475 .stream_name = "Primary TDM0 Capture",
1476 .cpu_dai_name = "msm-dai-q6-tdm.36865",
1477 .platform_name = "msm-pcm-routing",
1478 .codec_name = "msm-stub-codec.1",
1479 .codec_dai_name = "msm-stub-tx",
1480 .no_pcm = 1,
1481 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301482 .id = MSM_BACKEND_DAI_PRI_TDM_TX_0,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301483 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1484 .ops = &msm_tdm_be_ops,
1485 .ignore_suspend = 1,
1486 },
1487 {
1488 .name = LPASS_BE_SEC_TDM_RX_0,
1489 .stream_name = "Secondary TDM0 Playback",
1490 .cpu_dai_name = "msm-dai-q6-tdm.36880",
1491 .platform_name = "msm-pcm-routing",
1492 .codec_name = "msm-stub-codec.1",
1493 .codec_dai_name = "msm-stub-rx",
1494 .no_pcm = 1,
1495 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301496 .id = MSM_BACKEND_DAI_SEC_TDM_RX_0,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301497 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1498 .ops = &msm_tdm_be_ops,
1499 .ignore_suspend = 1,
1500 },
1501 {
1502 .name = LPASS_BE_SEC_TDM_TX_0,
1503 .stream_name = "Secondary TDM0 Capture",
1504 .cpu_dai_name = "msm-dai-q6-tdm.36881",
1505 .platform_name = "msm-pcm-routing",
1506 .codec_name = "msm-stub-codec.1",
1507 .codec_dai_name = "msm-stub-tx",
1508 .no_pcm = 1,
1509 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301510 .id = MSM_BACKEND_DAI_SEC_TDM_TX_0,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301511 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1512 .ops = &msm_tdm_be_ops,
1513 .ignore_suspend = 1,
1514 },
1515 {
1516 .name = LPASS_BE_TERT_TDM_RX_0,
1517 .stream_name = "Tertiary TDM0 Playback",
1518 .cpu_dai_name = "msm-dai-q6-tdm.36896",
1519 .platform_name = "msm-pcm-routing",
1520 .codec_name = "msm-stub-codec.1",
1521 .codec_dai_name = "msm-stub-rx",
1522 .no_pcm = 1,
1523 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301524 .id = MSM_BACKEND_DAI_TERT_TDM_RX_0,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301525 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1526 .ops = &msm_tdm_be_ops,
1527 .ignore_suspend = 1,
1528 },
1529 {
1530 .name = LPASS_BE_TERT_TDM_TX_0,
1531 .stream_name = "Tertiary TDM0 Capture",
1532 .cpu_dai_name = "msm-dai-q6-tdm.36897",
1533 .platform_name = "msm-pcm-routing",
1534 .codec_name = "msm-stub-codec.1",
1535 .codec_dai_name = "msm-stub-tx",
1536 .no_pcm = 1,
1537 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301538 .id = MSM_BACKEND_DAI_TERT_TDM_TX_0,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301539 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1540 .ops = &msm_tdm_be_ops,
1541 .ignore_suspend = 1,
1542 },
1543 {
1544 .name = LPASS_BE_QUAT_TDM_RX_0,
1545 .stream_name = "Quaternary TDM0 Playback",
1546 .cpu_dai_name = "msm-dai-q6-tdm.36912",
1547 .platform_name = "msm-pcm-routing",
1548 .codec_name = "msm-stub-codec.1",
1549 .codec_dai_name = "msm-stub-rx",
1550 .no_pcm = 1,
1551 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301552 .id = MSM_BACKEND_DAI_QUAT_TDM_RX_0,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301553 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1554 .ops = &msm_tdm_be_ops,
1555 .ignore_suspend = 1,
1556 },
1557 {
1558 .name = LPASS_BE_QUAT_TDM_TX_0,
1559 .stream_name = "Quaternary TDM0 Capture",
1560 .cpu_dai_name = "msm-dai-q6-tdm.36913",
1561 .platform_name = "msm-pcm-routing",
1562 .codec_name = "msm-stub-codec.1",
1563 .codec_dai_name = "msm-stub-tx",
1564 .no_pcm = 1,
1565 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301566 .id = MSM_BACKEND_DAI_QUAT_TDM_TX_0,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301567 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1568 .ops = &msm_tdm_be_ops,
1569 .ignore_suspend = 1,
1570 },
1571};
1572
1573static struct snd_soc_dai_link msm_mi2s_be_dai_links[] = {
1574 {
1575 .name = LPASS_BE_PRI_MI2S_RX,
1576 .stream_name = "Primary MI2S Playback",
1577 .cpu_dai_name = "msm-dai-q6-mi2s.0",
1578 .platform_name = "msm-pcm-routing",
1579 .codec_name = "msm-stub-codec.1",
1580 .codec_dai_name = "msm-stub-rx",
1581 .no_pcm = 1,
1582 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301583 .id = MSM_BACKEND_DAI_PRI_MI2S_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301584 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1585 .ops = &msm_mi2s_be_ops,
1586 .ignore_suspend = 1,
1587 .ignore_pmdown_time = 1,
1588 },
1589 {
1590 .name = LPASS_BE_PRI_MI2S_TX,
1591 .stream_name = "Primary MI2S Capture",
1592 .cpu_dai_name = "msm-dai-q6-mi2s.0",
1593 .platform_name = "msm-pcm-routing",
1594 .codec_name = "msm-stub-codec.1",
1595 .codec_dai_name = "msm-stub-tx",
1596 .no_pcm = 1,
1597 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301598 .id = MSM_BACKEND_DAI_PRI_MI2S_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301599 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1600 .ops = &msm_mi2s_be_ops,
1601 .ignore_suspend = 1,
1602 },
1603 {
1604 .name = LPASS_BE_SEC_MI2S_RX,
1605 .stream_name = "Secondary MI2S Playback",
1606 .cpu_dai_name = "msm-dai-q6-mi2s.1",
1607 .platform_name = "msm-pcm-routing",
1608 .codec_name = "msm-stub-codec.1",
1609 .codec_dai_name = "msm-stub-rx",
1610 .no_pcm = 1,
1611 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301612 .id = MSM_BACKEND_DAI_SECONDARY_MI2S_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301613 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1614 .ops = &msm_mi2s_be_ops,
1615 .ignore_suspend = 1,
1616 .ignore_pmdown_time = 1,
1617 },
1618 {
1619 .name = LPASS_BE_SEC_MI2S_TX,
1620 .stream_name = "Secondary MI2S Capture",
1621 .cpu_dai_name = "msm-dai-q6-mi2s.1",
1622 .platform_name = "msm-pcm-routing",
1623 .codec_name = "msm-stub-codec.1",
1624 .codec_dai_name = "msm-stub-tx",
1625 .no_pcm = 1,
1626 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301627 .id = MSM_BACKEND_DAI_SECONDARY_MI2S_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301628 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1629 .ops = &msm_mi2s_be_ops,
1630 .ignore_suspend = 1,
1631 },
1632 {
1633 .name = LPASS_BE_TERT_MI2S_RX,
1634 .stream_name = "Tertiary MI2S Playback",
1635 .cpu_dai_name = "msm-dai-q6-mi2s.2",
1636 .platform_name = "msm-pcm-routing",
1637 .codec_name = "msm-stub-codec.1",
1638 .codec_dai_name = "msm-stub-rx",
1639 .no_pcm = 1,
1640 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301641 .id = MSM_BACKEND_DAI_TERTIARY_MI2S_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301642 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1643 .ops = &msm_mi2s_be_ops,
1644 .ignore_suspend = 1,
1645 .ignore_pmdown_time = 1,
1646 },
1647 {
1648 .name = LPASS_BE_TERT_MI2S_TX,
1649 .stream_name = "Tertiary MI2S Capture",
1650 .cpu_dai_name = "msm-dai-q6-mi2s.2",
1651 .platform_name = "msm-pcm-routing",
1652 .codec_name = "msm-stub-codec.1",
1653 .codec_dai_name = "msm-stub-tx",
1654 .no_pcm = 1,
1655 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301656 .id = MSM_BACKEND_DAI_TERTIARY_MI2S_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301657 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1658 .ops = &msm_mi2s_be_ops,
1659 .ignore_suspend = 1,
1660 },
1661 {
1662 .name = LPASS_BE_QUAT_MI2S_RX,
1663 .stream_name = "Quaternary MI2S Playback",
1664 .cpu_dai_name = "msm-dai-q6-mi2s.3",
1665 .platform_name = "msm-pcm-routing",
1666 .codec_name = "msm-stub-codec.1",
1667 .codec_dai_name = "msm-stub-rx",
1668 .no_pcm = 1,
1669 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301670 .id = MSM_BACKEND_DAI_QUATERNARY_MI2S_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301671 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1672 .ops = &msm_mi2s_be_ops,
1673 .ignore_suspend = 1,
1674 .ignore_pmdown_time = 1,
1675 },
1676 {
1677 .name = LPASS_BE_QUAT_MI2S_TX,
1678 .stream_name = "Quaternary MI2S Capture",
1679 .cpu_dai_name = "msm-dai-q6-mi2s.3",
1680 .platform_name = "msm-pcm-routing",
1681 .codec_name = "msm-stub-codec.1",
1682 .codec_dai_name = "msm-stub-tx",
1683 .no_pcm = 1,
1684 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301685 .id = MSM_BACKEND_DAI_QUATERNARY_MI2S_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301686 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1687 .ops = &msm_mi2s_be_ops,
1688 .ignore_suspend = 1,
1689 },
1690};
1691
1692static struct snd_soc_dai_link msm_auxpcm_be_dai_links[] = {
1693 /* Primary AUX PCM Backend DAI Links */
1694 {
1695 .name = LPASS_BE_AUXPCM_RX,
1696 .stream_name = "AUX PCM Playback",
1697 .cpu_dai_name = "msm-dai-q6-auxpcm.1",
1698 .platform_name = "msm-pcm-routing",
1699 .codec_name = "msm-stub-codec.1",
1700 .codec_dai_name = "msm-stub-rx",
1701 .no_pcm = 1,
1702 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301703 .id = MSM_BACKEND_DAI_AUXPCM_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301704 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1705 .ignore_pmdown_time = 1,
1706 .ignore_suspend = 1,
1707 .ops = &msm_aux_pcm_be_ops,
1708 },
1709 {
1710 .name = LPASS_BE_AUXPCM_TX,
1711 .stream_name = "AUX PCM Capture",
1712 .cpu_dai_name = "msm-dai-q6-auxpcm.1",
1713 .platform_name = "msm-pcm-routing",
1714 .codec_name = "msm-stub-codec.1",
1715 .codec_dai_name = "msm-stub-tx",
1716 .no_pcm = 1,
1717 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301718 .id = MSM_BACKEND_DAI_AUXPCM_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301719 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1720 .ignore_pmdown_time = 1,
1721 .ignore_suspend = 1,
1722 .ops = &msm_aux_pcm_be_ops,
1723 },
1724 /* Secondary AUX PCM Backend DAI Links */
1725 {
1726 .name = LPASS_BE_SEC_AUXPCM_RX,
1727 .stream_name = "Sec AUX PCM Playback",
1728 .cpu_dai_name = "msm-dai-q6-auxpcm.2",
1729 .platform_name = "msm-pcm-routing",
1730 .codec_name = "msm-stub-codec.1",
1731 .codec_dai_name = "msm-stub-rx",
1732 .no_pcm = 1,
1733 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301734 .id = MSM_BACKEND_DAI_SEC_AUXPCM_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301735 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1736 .ignore_pmdown_time = 1,
1737 .ignore_suspend = 1,
1738 .ops = &msm_aux_pcm_be_ops,
1739 },
1740 {
1741 .name = LPASS_BE_SEC_AUXPCM_TX,
1742 .stream_name = "Sec AUX PCM Capture",
1743 .cpu_dai_name = "msm-dai-q6-auxpcm.2",
1744 .platform_name = "msm-pcm-routing",
1745 .codec_name = "msm-stub-codec.1",
1746 .codec_dai_name = "msm-stub-tx",
1747 .no_pcm = 1,
1748 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301749 .id = MSM_BACKEND_DAI_SEC_AUXPCM_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301750 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1751 .ignore_suspend = 1,
1752 .ignore_pmdown_time = 1,
1753 .ops = &msm_aux_pcm_be_ops,
1754 },
1755 /* Tertiary AUX PCM Backend DAI Links */
1756 {
1757 .name = LPASS_BE_TERT_AUXPCM_RX,
1758 .stream_name = "Tert AUX PCM Playback",
1759 .cpu_dai_name = "msm-dai-q6-auxpcm.3",
1760 .platform_name = "msm-pcm-routing",
1761 .codec_name = "msm-stub-codec.1",
1762 .codec_dai_name = "msm-stub-rx",
1763 .no_pcm = 1,
1764 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301765 .id = MSM_BACKEND_DAI_TERT_AUXPCM_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301766 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1767 .ignore_pmdown_time = 1,
1768 .ignore_suspend = 1,
1769 .ops = &msm_aux_pcm_be_ops,
1770 },
1771 {
1772 .name = LPASS_BE_TERT_AUXPCM_TX,
1773 .stream_name = "Tert AUX PCM Capture",
1774 .cpu_dai_name = "msm-dai-q6-auxpcm.3",
1775 .platform_name = "msm-pcm-routing",
1776 .codec_name = "msm-stub-codec.1",
1777 .codec_dai_name = "msm-stub-tx",
1778 .no_pcm = 1,
1779 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301780 .id = MSM_BACKEND_DAI_TERT_AUXPCM_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301781 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1782 .ignore_suspend = 1,
1783 .ignore_pmdown_time = 1,
1784 .ops = &msm_aux_pcm_be_ops,
1785 },
1786 /* Quaternary AUX PCM Backend DAI Links */
1787 {
1788 .name = LPASS_BE_QUAT_AUXPCM_RX,
1789 .stream_name = "Quat AUX PCM Playback",
1790 .cpu_dai_name = "msm-dai-q6-auxpcm.4",
1791 .platform_name = "msm-pcm-routing",
1792 .codec_name = "msm-stub-codec.1",
1793 .codec_dai_name = "msm-stub-rx",
1794 .no_pcm = 1,
1795 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301796 .id = MSM_BACKEND_DAI_QUAT_AUXPCM_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301797 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1798 .ignore_pmdown_time = 1,
1799 .ignore_suspend = 1,
1800 .ops = &msm_aux_pcm_be_ops,
1801 },
1802 {
1803 .name = LPASS_BE_QUAT_AUXPCM_TX,
1804 .stream_name = "Quat AUX PCM Capture",
1805 .cpu_dai_name = "msm-dai-q6-auxpcm.4",
1806 .platform_name = "msm-pcm-routing",
1807 .codec_name = "msm-stub-codec.1",
1808 .codec_dai_name = "msm-stub-tx",
1809 .no_pcm = 1,
1810 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301811 .id = MSM_BACKEND_DAI_QUAT_AUXPCM_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301812 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1813 .ignore_suspend = 1,
1814 .ignore_pmdown_time = 1,
1815 .ops = &msm_aux_pcm_be_ops,
1816 },
1817};
1818
1819static struct snd_soc_dai_link msm_wcn_be_dai_links[] = {
1820 {
1821 .name = LPASS_BE_SLIMBUS_7_RX,
1822 .stream_name = "Slimbus7 Playback",
1823 .cpu_dai_name = "msm-dai-q6-dev.16398",
1824 .platform_name = "msm-pcm-routing",
1825 .codec_name = "btfmslim_slave",
1826 /* BT codec driver determines capabilities based on
1827 * dai name, bt codecdai name should always contains
1828 * supported usecase information
1829 */
1830 .codec_dai_name = "btfm_bt_sco_a2dp_slim_rx",
1831 .no_pcm = 1,
1832 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301833 .id = MSM_BACKEND_DAI_SLIMBUS_7_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301834 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
1835 .ops = &msm_wcn_ops,
1836 /* dai link has playback support */
1837 .ignore_pmdown_time = 1,
1838 .ignore_suspend = 1,
1839 },
1840 {
1841 .name = LPASS_BE_SLIMBUS_7_TX,
1842 .stream_name = "Slimbus7 Capture",
1843 .cpu_dai_name = "msm-dai-q6-dev.16399",
1844 .platform_name = "msm-pcm-routing",
1845 .codec_name = "btfmslim_slave",
1846 .codec_dai_name = "btfm_bt_sco_slim_tx",
1847 .no_pcm = 1,
1848 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301849 .id = MSM_BACKEND_DAI_SLIMBUS_7_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301850 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
1851 .ops = &msm_wcn_ops,
1852 .ignore_suspend = 1,
1853 },
1854 {
1855 .name = LPASS_BE_SLIMBUS_8_TX,
1856 .stream_name = "Slimbus8 Capture",
1857 .cpu_dai_name = "msm-dai-q6-dev.16401",
1858 .platform_name = "msm-pcm-routing",
1859 .codec_name = "btfmslim_slave",
1860 .codec_dai_name = "btfm_fm_slim_tx",
1861 .no_pcm = 1,
1862 .dpcm_capture = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301863 .id = MSM_BACKEND_DAI_SLIMBUS_8_TX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301864 .be_hw_params_fixup = msm_ext_be_hw_params_fixup,
1865 .init = &msm_wcn_init,
1866 .ops = &msm_wcn_ops,
1867 .ignore_suspend = 1,
1868 },
1869};
1870
1871static struct snd_soc_dai_link ext_disp_be_dai_link[] = {
1872 /* DISP PORT BACK END DAI Link */
1873 {
1874 .name = LPASS_BE_DISPLAY_PORT,
1875 .stream_name = "Display Port Playback",
1876 .cpu_dai_name = "msm-dai-q6-dp.24608",
1877 .platform_name = "msm-pcm-routing",
1878 .codec_name = "msm-ext-disp-audio-codec-rx",
1879 .codec_dai_name = "msm_dp_audio_codec_rx_dai",
1880 .no_pcm = 1,
1881 .dpcm_playback = 1,
Asish Bhattacharya84f7f732017-07-25 16:29:27 +05301882 .id = MSM_BACKEND_DAI_DISPLAY_PORT_RX,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301883 .be_hw_params_fixup = msm_common_be_hw_params_fixup,
1884 .ignore_pmdown_time = 1,
1885 .ignore_suspend = 1,
1886 },
1887};
1888
1889static struct snd_soc_dai_link msm_ext_tasha_dai_links[
1890ARRAY_SIZE(msm_ext_common_fe_dai) +
1891ARRAY_SIZE(msm_ext_tasha_fe_dai) +
1892ARRAY_SIZE(msm_ext_common_be_dai) +
1893ARRAY_SIZE(msm_ext_tasha_be_dai) +
1894ARRAY_SIZE(msm_mi2s_be_dai_links) +
1895ARRAY_SIZE(msm_auxpcm_be_dai_links) +
1896ARRAY_SIZE(msm_wcn_be_dai_links) +
1897ARRAY_SIZE(ext_disp_be_dai_link)];
1898
1899static struct snd_soc_dai_link msm_ext_tavil_dai_links[
1900ARRAY_SIZE(msm_ext_common_fe_dai) +
1901ARRAY_SIZE(msm_ext_tavil_fe_dai) +
1902ARRAY_SIZE(msm_ext_common_be_dai) +
1903ARRAY_SIZE(msm_ext_tavil_be_dai) +
1904ARRAY_SIZE(msm_mi2s_be_dai_links) +
1905ARRAY_SIZE(msm_auxpcm_be_dai_links) +
1906ARRAY_SIZE(msm_wcn_be_dai_links) +
1907ARRAY_SIZE(ext_disp_be_dai_link)];
1908
1909/**
1910 * populate_snd_card_dailinks - prepares dailink array and initializes card.
1911 *
1912 * @dev: device handle
1913 *
1914 * Returns card on success or NULL on failure.
1915 */
1916struct snd_soc_card *populate_snd_card_dailinks(struct device *dev,
1917 int snd_card_val)
1918{
1919 struct snd_soc_card *card;
1920 struct snd_soc_dai_link *msm_ext_dai_links = NULL;
1921 int ret, len1, len2, len3, len4;
1922 enum codec_variant codec_ver = 0;
1923
1924 if (snd_card_val == EXT_SND_CARD_TASHA) {
1925 card = &snd_soc_card_msm_card_tasha;
1926 } else if (snd_card_val == EXT_SND_CARD_TAVIL) {
1927 card = &snd_soc_card_msm_card_tavil;
1928 } else {
1929 dev_err(dev, "%s: failing as no matching card name\n",
1930 __func__);
1931 return NULL;
1932 }
1933
1934 card->dev = dev;
1935 ret = snd_soc_of_parse_card_name(card, "qcom,model");
1936 if (ret) {
1937 dev_err(dev, "%s: parse card name failed, err:%d\n",
1938 __func__, ret);
1939 return NULL;
1940 }
1941
1942 if (strnstr(card->name, "tasha", strlen(card->name))) {
1943 codec_ver = tasha_codec_ver();
1944 if (codec_ver == WCD9326)
1945 card->name = "sdm660-tashalite-snd-card";
1946
1947 len1 = ARRAY_SIZE(msm_ext_common_fe_dai);
1948 len2 = len1 + ARRAY_SIZE(msm_ext_tasha_fe_dai);
1949 len3 = len2 + ARRAY_SIZE(msm_ext_common_be_dai);
1950 memcpy(msm_ext_tasha_dai_links, msm_ext_common_fe_dai,
1951 sizeof(msm_ext_common_fe_dai));
1952 memcpy(msm_ext_tasha_dai_links + len1,
1953 msm_ext_tasha_fe_dai, sizeof(msm_ext_tasha_fe_dai));
1954 memcpy(msm_ext_tasha_dai_links + len2,
1955 msm_ext_common_be_dai, sizeof(msm_ext_common_be_dai));
1956 memcpy(msm_ext_tasha_dai_links + len3,
1957 msm_ext_tasha_be_dai, sizeof(msm_ext_tasha_be_dai));
1958 len4 = len3 + ARRAY_SIZE(msm_ext_tasha_be_dai);
1959 if (of_property_read_bool(dev->of_node,
1960 "qcom,mi2s-audio-intf")) {
1961 memcpy(msm_ext_tasha_dai_links + len4,
1962 msm_mi2s_be_dai_links,
1963 sizeof(msm_mi2s_be_dai_links));
1964 len4 += ARRAY_SIZE(msm_mi2s_be_dai_links);
1965 }
1966 if (of_property_read_bool(dev->of_node,
1967 "qcom,auxpcm-audio-intf")) {
1968 memcpy(msm_ext_tasha_dai_links + len4,
1969 msm_auxpcm_be_dai_links,
1970 sizeof(msm_auxpcm_be_dai_links));
1971 len4 += ARRAY_SIZE(msm_auxpcm_be_dai_links);
1972 }
1973 if (of_property_read_bool(dev->of_node, "qcom,wcn-btfm")) {
1974 dev_dbg(dev, "%s(): WCN BTFM support present\n",
1975 __func__);
1976 memcpy(msm_ext_tasha_dai_links + len4,
1977 msm_wcn_be_dai_links,
1978 sizeof(msm_wcn_be_dai_links));
1979 len4 += ARRAY_SIZE(msm_wcn_be_dai_links);
1980 }
1981 if (of_property_read_bool(dev->of_node,
1982 "qcom,ext-disp-audio-rx")) {
1983 dev_dbg(dev, "%s(): ext disp audio support present\n",
1984 __func__);
1985 memcpy(msm_ext_tasha_dai_links + len4,
1986 ext_disp_be_dai_link,
1987 sizeof(ext_disp_be_dai_link));
1988 len4 += ARRAY_SIZE(ext_disp_be_dai_link);
1989 }
1990 msm_ext_dai_links = msm_ext_tasha_dai_links;
1991 } else if (strnstr(card->name, "tavil", strlen(card->name))) {
1992 len1 = ARRAY_SIZE(msm_ext_common_fe_dai);
1993 len2 = len1 + ARRAY_SIZE(msm_ext_tavil_fe_dai);
1994 len3 = len2 + ARRAY_SIZE(msm_ext_common_be_dai);
1995 memcpy(msm_ext_tavil_dai_links, msm_ext_common_fe_dai,
1996 sizeof(msm_ext_common_fe_dai));
1997 memcpy(msm_ext_tavil_dai_links + len1,
1998 msm_ext_tavil_fe_dai, sizeof(msm_ext_tavil_fe_dai));
1999 memcpy(msm_ext_tavil_dai_links + len2,
2000 msm_ext_common_be_dai, sizeof(msm_ext_common_be_dai));
2001 memcpy(msm_ext_tavil_dai_links + len3,
2002 msm_ext_tavil_be_dai, sizeof(msm_ext_tavil_be_dai));
2003 len4 = len3 + ARRAY_SIZE(msm_ext_tavil_be_dai);
2004 if (of_property_read_bool(dev->of_node,
2005 "qcom,mi2s-audio-intf")) {
2006 memcpy(msm_ext_tavil_dai_links + len4,
2007 msm_mi2s_be_dai_links,
2008 sizeof(msm_mi2s_be_dai_links));
2009 len4 += ARRAY_SIZE(msm_mi2s_be_dai_links);
2010 }
2011 if (of_property_read_bool(dev->of_node,
2012 "qcom,auxpcm-audio-intf")) {
2013 memcpy(msm_ext_tavil_dai_links + len4,
2014 msm_auxpcm_be_dai_links,
2015 sizeof(msm_auxpcm_be_dai_links));
2016 len4 += ARRAY_SIZE(msm_auxpcm_be_dai_links);
2017 }
2018 if (of_property_read_bool(dev->of_node, "qcom,wcn-btfm")) {
2019 dev_dbg(dev, "%s(): WCN BTFM support present\n",
2020 __func__);
2021 memcpy(msm_ext_tavil_dai_links + len4,
2022 msm_wcn_be_dai_links,
2023 sizeof(msm_wcn_be_dai_links));
2024 len4 += ARRAY_SIZE(msm_wcn_be_dai_links);
2025 }
2026 if (of_property_read_bool(dev->of_node,
2027 "qcom,ext-disp-audio-rx")) {
2028 dev_dbg(dev, "%s(): ext disp audio support present\n",
2029 __func__);
2030 memcpy(msm_ext_tavil_dai_links + len4,
2031 ext_disp_be_dai_link,
2032 sizeof(ext_disp_be_dai_link));
2033 len4 += ARRAY_SIZE(ext_disp_be_dai_link);
2034 }
2035 msm_ext_dai_links = msm_ext_tavil_dai_links;
2036 } else {
2037 dev_err(dev, "%s: failing as no matching card name\n",
2038 __func__);
2039 return NULL;
2040 }
2041 card->dai_link = msm_ext_dai_links;
2042 card->num_links = len4;
2043
2044 return card;
2045}
2046EXPORT_SYMBOL(populate_snd_card_dailinks);