1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) 2 // 3 // This file is provided under a dual BSD/GPLv2 license. When using or 4 // redistributing this file, you may do so under either license. 5 // 6 // Copyright(c) 2018 Intel Corporation. All rights reserved. 7 // 8 // Authors: Keyon Jie <yang.jie@linux.intel.com> 9 // 10 11 #include <sound/pcm_params.h> 12 #include <sound/hdaudio_ext.h> 13 #include "../sof-priv.h" 14 #include "../sof-audio.h" 15 #include "hda.h" 16 17 #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) 18 19 #if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_PROBES) 20 #include "../sof-probes.h" 21 #endif 22 23 struct hda_pipe_params { 24 u32 ch; 25 u32 s_freq; 26 u32 s_fmt; 27 u8 linktype; 28 snd_pcm_format_t format; 29 int link_index; 30 int stream; 31 unsigned int link_bps; 32 }; 33 34 /* 35 * This function checks if the host dma channel corresponding 36 * to the link DMA stream_tag argument is assigned to one 37 * of the FEs connected to the BE DAI. 38 */ 39 static bool hda_check_fes(struct snd_soc_pcm_runtime *rtd, 40 int dir, int stream_tag) 41 { 42 struct snd_pcm_substream *fe_substream; 43 struct hdac_stream *fe_hstream; 44 struct snd_soc_dpcm *dpcm; 45 46 for_each_dpcm_fe(rtd, dir, dpcm) { 47 fe_substream = snd_soc_dpcm_get_substream(dpcm->fe, dir); 48 fe_hstream = fe_substream->runtime->private_data; 49 if (fe_hstream->stream_tag == stream_tag) 50 return true; 51 } 52 53 return false; 54 } 55 56 static struct hdac_ext_stream * 57 hda_link_stream_assign(struct hdac_bus *bus, 58 struct snd_pcm_substream *substream) 59 { 60 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 61 struct sof_intel_hda_stream *hda_stream; 62 const struct sof_intel_dsp_desc *chip; 63 struct snd_sof_dev *sdev; 64 struct hdac_ext_stream *res = NULL; 65 struct hdac_stream *hstream = NULL; 66 67 int stream_dir = substream->stream; 68 69 if (!bus->ppcap) { 70 dev_err(bus->dev, "stream type not supported\n"); 71 return NULL; 72 } 73 74 spin_lock_irq(&bus->reg_lock); 75 list_for_each_entry(hstream, &bus->stream_list, list) { 76 struct hdac_ext_stream *hext_stream = 77 stream_to_hdac_ext_stream(hstream); 78 if (hstream->direction != substream->stream) 79 continue; 80 81 hda_stream = hstream_to_sof_hda_stream(hext_stream); 82 sdev = hda_stream->sdev; 83 chip = get_chip_info(sdev->pdata); 84 85 /* check if link is available */ 86 if (!hext_stream->link_locked) { 87 /* 88 * choose the first available link for platforms that do not have the 89 * PROCEN_FMT_QUIRK set. 90 */ 91 if (!(chip->quirks & SOF_INTEL_PROCEN_FMT_QUIRK)) { 92 res = hext_stream; 93 break; 94 } 95 96 if (hstream->opened) { 97 /* 98 * check if the stream tag matches the stream 99 * tag of one of the connected FEs 100 */ 101 if (hda_check_fes(rtd, stream_dir, 102 hstream->stream_tag)) { 103 res = hext_stream; 104 break; 105 } 106 } else { 107 res = hext_stream; 108 109 /* 110 * This must be a hostless stream. 111 * So reserve the host DMA channel. 112 */ 113 hda_stream->host_reserved = 1; 114 break; 115 } 116 } 117 } 118 119 if (res) { 120 /* 121 * Decouple host and link DMA. The decoupled flag 122 * is updated in snd_hdac_ext_stream_decouple(). 123 */ 124 if (!res->decoupled) 125 snd_hdac_ext_stream_decouple_locked(bus, res, true); 126 127 res->link_locked = 1; 128 res->link_substream = substream; 129 } 130 spin_unlock_irq(&bus->reg_lock); 131 132 return res; 133 } 134 135 static int hda_link_dma_params(struct hdac_ext_stream *hext_stream, 136 struct hda_pipe_params *params) 137 { 138 struct hdac_stream *hstream = &hext_stream->hstream; 139 unsigned char stream_tag = hstream->stream_tag; 140 struct hdac_bus *bus = hstream->bus; 141 struct hdac_ext_link *link; 142 unsigned int format_val; 143 144 snd_hdac_ext_stream_decouple(bus, hext_stream, true); 145 snd_hdac_ext_link_stream_reset(hext_stream); 146 147 format_val = snd_hdac_calc_stream_format(params->s_freq, params->ch, 148 params->format, 149 params->link_bps, 0); 150 151 dev_dbg(bus->dev, "format_val=%d, rate=%d, ch=%d, format=%d\n", 152 format_val, params->s_freq, params->ch, params->format); 153 154 snd_hdac_ext_link_stream_setup(hext_stream, format_val); 155 156 if (hext_stream->hstream.direction == SNDRV_PCM_STREAM_PLAYBACK) { 157 list_for_each_entry(link, &bus->hlink_list, list) { 158 if (link->index == params->link_index) 159 snd_hdac_ext_link_set_stream_id(link, 160 stream_tag); 161 } 162 } 163 164 hext_stream->link_prepared = 1; 165 166 return 0; 167 } 168 169 /* Update config for the DAI widget */ 170 static struct sof_ipc_dai_config *hda_dai_update_config(struct snd_soc_dapm_widget *w, 171 int channel) 172 { 173 struct snd_sof_widget *swidget = w->dobj.private; 174 struct sof_ipc_dai_config *config; 175 struct snd_sof_dai *sof_dai; 176 177 if (!swidget) 178 return NULL; 179 180 sof_dai = swidget->private; 181 182 if (!sof_dai || !sof_dai->dai_config) { 183 dev_err(swidget->scomp->dev, "error: No config for DAI %s\n", w->name); 184 return NULL; 185 } 186 187 config = &sof_dai->dai_config[sof_dai->current_config]; 188 189 /* update config with stream tag */ 190 config->hda.link_dma_ch = channel; 191 192 return config; 193 } 194 195 static int hda_link_dai_widget_update(struct sof_intel_hda_stream *hda_stream, 196 struct snd_soc_dapm_widget *w, 197 int channel, bool widget_setup) 198 { 199 struct snd_sof_dev *sdev = hda_stream->sdev; 200 struct sof_ipc_dai_config *config; 201 202 config = hda_dai_update_config(w, channel); 203 if (!config) { 204 dev_err(sdev->dev, "error: no config for DAI %s\n", w->name); 205 return -ENOENT; 206 } 207 208 /* set up/free DAI widget and send DAI_CONFIG IPC */ 209 if (widget_setup) 210 return hda_ctrl_dai_widget_setup(w, SOF_DAI_CONFIG_FLAGS_2_STEP_STOP); 211 212 return hda_ctrl_dai_widget_free(w, SOF_DAI_CONFIG_FLAGS_NONE); 213 } 214 215 static int hda_link_hw_params(struct snd_pcm_substream *substream, 216 struct snd_pcm_hw_params *params, 217 struct snd_soc_dai *dai) 218 { 219 struct hdac_stream *hstream = substream->runtime->private_data; 220 struct hdac_bus *bus = hstream->bus; 221 struct hdac_ext_stream *hext_stream; 222 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 223 struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); 224 struct sof_intel_hda_stream *hda_stream; 225 struct hda_pipe_params p_params = {0}; 226 struct snd_soc_dapm_widget *w; 227 struct hdac_ext_link *link; 228 int stream_tag; 229 int ret; 230 231 /* get stored dma data if resuming from system suspend */ 232 hext_stream = snd_soc_dai_get_dma_data(dai, substream); 233 if (!hext_stream) { 234 hext_stream = hda_link_stream_assign(bus, substream); 235 if (!hext_stream) 236 return -EBUSY; 237 238 snd_soc_dai_set_dma_data(dai, substream, (void *)hext_stream); 239 } 240 241 stream_tag = hdac_stream(hext_stream)->stream_tag; 242 243 hda_stream = hstream_to_sof_hda_stream(hext_stream); 244 245 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 246 w = dai->playback_widget; 247 else 248 w = dai->capture_widget; 249 250 /* set up the DAI widget and send the DAI_CONFIG with the new tag */ 251 ret = hda_link_dai_widget_update(hda_stream, w, stream_tag - 1, true); 252 if (ret < 0) 253 return ret; 254 255 link = snd_hdac_ext_bus_get_link(bus, codec_dai->component->name); 256 if (!link) 257 return -EINVAL; 258 259 /* set the hdac_stream in the codec dai */ 260 snd_soc_dai_set_stream(codec_dai, hdac_stream(hext_stream), substream->stream); 261 262 p_params.s_fmt = snd_pcm_format_width(params_format(params)); 263 p_params.ch = params_channels(params); 264 p_params.s_freq = params_rate(params); 265 p_params.stream = substream->stream; 266 p_params.link_index = link->index; 267 p_params.format = params_format(params); 268 269 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 270 p_params.link_bps = codec_dai->driver->playback.sig_bits; 271 else 272 p_params.link_bps = codec_dai->driver->capture.sig_bits; 273 274 return hda_link_dma_params(hext_stream, &p_params); 275 } 276 277 static int hda_link_pcm_prepare(struct snd_pcm_substream *substream, 278 struct snd_soc_dai *dai) 279 { 280 struct hdac_ext_stream *hext_stream = 281 snd_soc_dai_get_dma_data(dai, substream); 282 struct snd_sof_dev *sdev = 283 snd_soc_component_get_drvdata(dai->component); 284 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 285 int stream = substream->stream; 286 287 if (hext_stream->link_prepared) 288 return 0; 289 290 dev_dbg(sdev->dev, "hda: prepare stream dir %d\n", substream->stream); 291 292 return hda_link_hw_params(substream, &rtd->dpcm[stream].hw_params, 293 dai); 294 } 295 296 static int hda_link_dai_config_pause_push_ipc(struct snd_soc_dapm_widget *w) 297 { 298 struct snd_sof_widget *swidget = w->dobj.private; 299 struct snd_soc_component *component = swidget->scomp; 300 struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(component); 301 struct sof_ipc_dai_config *config; 302 struct snd_sof_dai *sof_dai; 303 struct sof_ipc_reply reply; 304 int ret; 305 306 sof_dai = swidget->private; 307 308 if (!sof_dai || !sof_dai->dai_config) { 309 dev_err(sdev->dev, "No config for DAI %s\n", w->name); 310 return -EINVAL; 311 } 312 313 config = &sof_dai->dai_config[sof_dai->current_config]; 314 315 /* set PAUSE command flag */ 316 config->flags = FIELD_PREP(SOF_DAI_CONFIG_FLAGS_CMD_MASK, SOF_DAI_CONFIG_FLAGS_PAUSE); 317 318 ret = sof_ipc_tx_message(sdev->ipc, config->hdr.cmd, config, config->hdr.size, 319 &reply, sizeof(reply)); 320 if (ret < 0) 321 dev_err(sdev->dev, "DAI config for %s failed during pause push\n", w->name); 322 323 return ret; 324 } 325 326 static int hda_link_pcm_trigger(struct snd_pcm_substream *substream, 327 int cmd, struct snd_soc_dai *dai) 328 { 329 struct hdac_ext_stream *hext_stream = 330 snd_soc_dai_get_dma_data(dai, substream); 331 struct sof_intel_hda_stream *hda_stream; 332 struct snd_soc_pcm_runtime *rtd; 333 struct snd_soc_dapm_widget *w; 334 struct hdac_ext_link *link; 335 struct hdac_stream *hstream; 336 struct hdac_bus *bus; 337 int stream_tag; 338 int ret; 339 340 hstream = substream->runtime->private_data; 341 bus = hstream->bus; 342 rtd = asoc_substream_to_rtd(substream); 343 344 link = snd_hdac_ext_bus_get_link(bus, asoc_rtd_to_codec(rtd, 0)->component->name); 345 if (!link) 346 return -EINVAL; 347 348 hda_stream = hstream_to_sof_hda_stream(hext_stream); 349 350 dev_dbg(dai->dev, "In %s cmd=%d\n", __func__, cmd); 351 352 w = snd_soc_dai_get_widget(dai, substream->stream); 353 354 switch (cmd) { 355 case SNDRV_PCM_TRIGGER_START: 356 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 357 snd_hdac_ext_link_stream_start(hext_stream); 358 break; 359 case SNDRV_PCM_TRIGGER_SUSPEND: 360 case SNDRV_PCM_TRIGGER_STOP: 361 snd_hdac_ext_link_stream_clear(hext_stream); 362 363 /* 364 * free DAI widget during stop/suspend to keep widget use_count's balanced. 365 */ 366 ret = hda_link_dai_widget_update(hda_stream, w, DMA_CHAN_INVALID, false); 367 if (ret < 0) 368 return ret; 369 370 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 371 stream_tag = hdac_stream(hext_stream)->stream_tag; 372 snd_hdac_ext_link_clear_stream_id(link, stream_tag); 373 } 374 375 hext_stream->link_prepared = 0; 376 break; 377 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 378 snd_hdac_ext_link_stream_clear(hext_stream); 379 380 ret = hda_link_dai_config_pause_push_ipc(w); 381 if (ret < 0) 382 return ret; 383 break; 384 default: 385 return -EINVAL; 386 } 387 return 0; 388 } 389 390 static int hda_link_hw_free(struct snd_pcm_substream *substream, 391 struct snd_soc_dai *dai) 392 { 393 unsigned int stream_tag; 394 struct sof_intel_hda_stream *hda_stream; 395 struct hdac_bus *bus; 396 struct hdac_ext_link *link; 397 struct hdac_stream *hstream; 398 struct snd_soc_pcm_runtime *rtd; 399 struct hdac_ext_stream *hext_stream; 400 struct snd_soc_dapm_widget *w; 401 int ret; 402 403 hstream = substream->runtime->private_data; 404 bus = hstream->bus; 405 rtd = asoc_substream_to_rtd(substream); 406 hext_stream = snd_soc_dai_get_dma_data(dai, substream); 407 408 if (!hext_stream) { 409 dev_dbg(dai->dev, 410 "%s: hext_stream is not assigned\n", __func__); 411 return -EINVAL; 412 } 413 414 hda_stream = hstream_to_sof_hda_stream(hext_stream); 415 416 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 417 w = dai->playback_widget; 418 else 419 w = dai->capture_widget; 420 421 /* free the link DMA channel in the FW and the DAI widget */ 422 ret = hda_link_dai_widget_update(hda_stream, w, DMA_CHAN_INVALID, false); 423 if (ret < 0) 424 return ret; 425 426 link = snd_hdac_ext_bus_get_link(bus, asoc_rtd_to_codec(rtd, 0)->component->name); 427 if (!link) 428 return -EINVAL; 429 430 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 431 stream_tag = hdac_stream(hext_stream)->stream_tag; 432 snd_hdac_ext_link_clear_stream_id(link, stream_tag); 433 } 434 435 snd_soc_dai_set_dma_data(dai, substream, NULL); 436 snd_hdac_ext_stream_release(hext_stream, HDAC_EXT_STREAM_TYPE_LINK); 437 hext_stream->link_prepared = 0; 438 439 /* free the host DMA channel reserved by hostless streams */ 440 hda_stream->host_reserved = 0; 441 442 return 0; 443 } 444 445 static const struct snd_soc_dai_ops hda_link_dai_ops = { 446 .hw_params = hda_link_hw_params, 447 .hw_free = hda_link_hw_free, 448 .trigger = hda_link_pcm_trigger, 449 .prepare = hda_link_pcm_prepare, 450 }; 451 452 #endif 453 454 /* only one flag used so far to harden hw_params/hw_free/trigger/prepare */ 455 struct ssp_dai_dma_data { 456 bool setup; 457 }; 458 459 static int ssp_dai_setup_or_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai, 460 bool setup) 461 { 462 struct snd_soc_component *component; 463 struct snd_sof_widget *swidget; 464 struct snd_soc_dapm_widget *w; 465 struct sof_ipc_fw_version *v; 466 struct snd_sof_dev *sdev; 467 468 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 469 w = dai->playback_widget; 470 else 471 w = dai->capture_widget; 472 473 swidget = w->dobj.private; 474 component = swidget->scomp; 475 sdev = snd_soc_component_get_drvdata(component); 476 v = &sdev->fw_ready.version; 477 478 /* DAI_CONFIG IPC during hw_params is not supported in older firmware */ 479 if (v->abi_version < SOF_ABI_VER(3, 18, 0)) 480 return 0; 481 482 if (setup) 483 return hda_ctrl_dai_widget_setup(w, SOF_DAI_CONFIG_FLAGS_NONE); 484 485 return hda_ctrl_dai_widget_free(w, SOF_DAI_CONFIG_FLAGS_NONE); 486 } 487 488 static int ssp_dai_startup(struct snd_pcm_substream *substream, 489 struct snd_soc_dai *dai) 490 { 491 struct ssp_dai_dma_data *dma_data; 492 493 dma_data = kzalloc(sizeof(*dma_data), GFP_KERNEL); 494 if (!dma_data) 495 return -ENOMEM; 496 497 snd_soc_dai_set_dma_data(dai, substream, dma_data); 498 499 return 0; 500 } 501 502 static int ssp_dai_setup(struct snd_pcm_substream *substream, 503 struct snd_soc_dai *dai, 504 bool setup) 505 { 506 struct ssp_dai_dma_data *dma_data; 507 int ret = 0; 508 509 dma_data = snd_soc_dai_get_dma_data(dai, substream); 510 if (!dma_data) { 511 dev_err(dai->dev, "%s: failed to get dma_data\n", __func__); 512 return -EIO; 513 } 514 515 if (dma_data->setup != setup) { 516 ret = ssp_dai_setup_or_free(substream, dai, setup); 517 if (!ret) 518 dma_data->setup = setup; 519 } 520 return ret; 521 } 522 523 static int ssp_dai_hw_params(struct snd_pcm_substream *substream, 524 struct snd_pcm_hw_params *params, 525 struct snd_soc_dai *dai) 526 { 527 /* params are ignored for now */ 528 return ssp_dai_setup(substream, dai, true); 529 } 530 531 static int ssp_dai_prepare(struct snd_pcm_substream *substream, 532 struct snd_soc_dai *dai) 533 { 534 /* 535 * the SSP will only be reconfigured during resume operations and 536 * not in case of xruns 537 */ 538 return ssp_dai_setup(substream, dai, true); 539 } 540 541 static int ssp_dai_trigger(struct snd_pcm_substream *substream, 542 int cmd, struct snd_soc_dai *dai) 543 { 544 if (cmd != SNDRV_PCM_TRIGGER_SUSPEND) 545 return 0; 546 547 return ssp_dai_setup(substream, dai, false); 548 } 549 550 static int ssp_dai_hw_free(struct snd_pcm_substream *substream, 551 struct snd_soc_dai *dai) 552 { 553 return ssp_dai_setup(substream, dai, false); 554 } 555 556 static void ssp_dai_shutdown(struct snd_pcm_substream *substream, 557 struct snd_soc_dai *dai) 558 { 559 struct ssp_dai_dma_data *dma_data; 560 561 dma_data = snd_soc_dai_get_dma_data(dai, substream); 562 if (!dma_data) { 563 dev_err(dai->dev, "%s: failed to get dma_data\n", __func__); 564 return; 565 } 566 snd_soc_dai_set_dma_data(dai, substream, NULL); 567 kfree(dma_data); 568 } 569 570 static const struct snd_soc_dai_ops ssp_dai_ops = { 571 .startup = ssp_dai_startup, 572 .hw_params = ssp_dai_hw_params, 573 .prepare = ssp_dai_prepare, 574 .trigger = ssp_dai_trigger, 575 .hw_free = ssp_dai_hw_free, 576 .shutdown = ssp_dai_shutdown, 577 }; 578 579 /* 580 * common dai driver for skl+ platforms. 581 * some products who use this DAI array only physically have a subset of 582 * the DAIs, but no harm is done here by adding the whole set. 583 */ 584 struct snd_soc_dai_driver skl_dai[] = { 585 { 586 .name = "SSP0 Pin", 587 .ops = &ssp_dai_ops, 588 .playback = { 589 .channels_min = 1, 590 .channels_max = 8, 591 }, 592 .capture = { 593 .channels_min = 1, 594 .channels_max = 8, 595 }, 596 }, 597 { 598 .name = "SSP1 Pin", 599 .ops = &ssp_dai_ops, 600 .playback = { 601 .channels_min = 1, 602 .channels_max = 8, 603 }, 604 .capture = { 605 .channels_min = 1, 606 .channels_max = 8, 607 }, 608 }, 609 { 610 .name = "SSP2 Pin", 611 .ops = &ssp_dai_ops, 612 .playback = { 613 .channels_min = 1, 614 .channels_max = 8, 615 }, 616 .capture = { 617 .channels_min = 1, 618 .channels_max = 8, 619 }, 620 }, 621 { 622 .name = "SSP3 Pin", 623 .ops = &ssp_dai_ops, 624 .playback = { 625 .channels_min = 1, 626 .channels_max = 8, 627 }, 628 .capture = { 629 .channels_min = 1, 630 .channels_max = 8, 631 }, 632 }, 633 { 634 .name = "SSP4 Pin", 635 .ops = &ssp_dai_ops, 636 .playback = { 637 .channels_min = 1, 638 .channels_max = 8, 639 }, 640 .capture = { 641 .channels_min = 1, 642 .channels_max = 8, 643 }, 644 }, 645 { 646 .name = "SSP5 Pin", 647 .ops = &ssp_dai_ops, 648 .playback = { 649 .channels_min = 1, 650 .channels_max = 8, 651 }, 652 .capture = { 653 .channels_min = 1, 654 .channels_max = 8, 655 }, 656 }, 657 { 658 .name = "DMIC01 Pin", 659 .capture = { 660 .channels_min = 1, 661 .channels_max = 4, 662 }, 663 }, 664 { 665 .name = "DMIC16k Pin", 666 .capture = { 667 .channels_min = 1, 668 .channels_max = 4, 669 }, 670 }, 671 #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) 672 { 673 .name = "iDisp1 Pin", 674 .ops = &hda_link_dai_ops, 675 .playback = { 676 .channels_min = 1, 677 .channels_max = 8, 678 }, 679 }, 680 { 681 .name = "iDisp2 Pin", 682 .ops = &hda_link_dai_ops, 683 .playback = { 684 .channels_min = 1, 685 .channels_max = 8, 686 }, 687 }, 688 { 689 .name = "iDisp3 Pin", 690 .ops = &hda_link_dai_ops, 691 .playback = { 692 .channels_min = 1, 693 .channels_max = 8, 694 }, 695 }, 696 { 697 .name = "iDisp4 Pin", 698 .ops = &hda_link_dai_ops, 699 .playback = { 700 .channels_min = 1, 701 .channels_max = 8, 702 }, 703 }, 704 { 705 .name = "Analog CPU DAI", 706 .ops = &hda_link_dai_ops, 707 .playback = { 708 .channels_min = 1, 709 .channels_max = 16, 710 }, 711 .capture = { 712 .channels_min = 1, 713 .channels_max = 16, 714 }, 715 }, 716 { 717 .name = "Digital CPU DAI", 718 .ops = &hda_link_dai_ops, 719 .playback = { 720 .channels_min = 1, 721 .channels_max = 16, 722 }, 723 .capture = { 724 .channels_min = 1, 725 .channels_max = 16, 726 }, 727 }, 728 { 729 .name = "Alt Analog CPU DAI", 730 .ops = &hda_link_dai_ops, 731 .playback = { 732 .channels_min = 1, 733 .channels_max = 16, 734 }, 735 .capture = { 736 .channels_min = 1, 737 .channels_max = 16, 738 }, 739 }, 740 #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_PROBES) 741 { 742 .name = "Probe Extraction CPU DAI", 743 .compress_new = snd_soc_new_compress, 744 .cops = &sof_probe_compr_ops, 745 .capture = { 746 .stream_name = "Probe Extraction", 747 .channels_min = 1, 748 .channels_max = 8, 749 .rates = SNDRV_PCM_RATE_48000, 750 .rate_min = 48000, 751 .rate_max = 48000, 752 }, 753 }, 754 #endif 755 #endif 756 }; 757