Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge series "ASoC: SOF: multi-cpu dais, IPC and Intel improvements for 5.7" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

Corrections for compatibility with the multi-cpu dai check for
min-channels, IPC simplifications, and removal of unnecessary
boot-related code for Intel platforms.

Amery Song (2):
ASoC: SOF: Intel: hda: remove unnecessary ROM IPC filter function
ASoC: SOF: Intel: remove unnecessary waitq before loading firmware

Bard Liao (2):
ASoC: SOF: Intel: hda-dai: add stream capability
ASoC: SOF: topology: connect dai widget to all cpu-dais

Karol Trzcinski (2):
ASoC: SOF: Make sof_ipc_ext_data enum more rigid
ASoC: SOF: Remove SOF_IPC_EXT_DMA_BUFFER

include/sound/sof/info.h | 22 +-------
sound/soc/sof/intel/cnl.c | 5 --
sound/soc/sof/intel/hda-dai.c | 96 ++++++++++++++++++++++++++++++++
sound/soc/sof/intel/hda-ipc.c | 20 +------
sound/soc/sof/intel/hda-loader.c | 3 -
sound/soc/sof/intel/hda.c | 3 -
sound/soc/sof/intel/hda.h | 1 -
sound/soc/sof/loader.c | 6 --
sound/soc/sof/sof-priv.h | 5 --
sound/soc/sof/topology.c | 8 ++-
10 files changed, 108 insertions(+), 61 deletions(-)

base-commit: 101247a3b86e1cc0e382b7e887a56176290fc957
--
2.20.1

+108 -61
+3 -19
include/sound/sof/info.h
··· 28 28 29 29 /* extended data types that can be appended onto end of sof_ipc_fw_ready */ 30 30 enum sof_ipc_ext_data { 31 - SOF_IPC_EXT_DMA_BUFFER = 0, 32 - SOF_IPC_EXT_WINDOW, 33 - SOF_IPC_EXT_CC_INFO, 31 + SOF_IPC_EXT_UNUSED = 0, 32 + SOF_IPC_EXT_WINDOW = 1, 33 + SOF_IPC_EXT_CC_INFO = 2, 34 34 }; 35 35 36 36 /* FW version - SOF_IPC_GLB_VERSION */ ··· 82 82 struct sof_ipc_cmd_hdr hdr; 83 83 uint32_t type; /**< SOF_IPC_EXT_ */ 84 84 } __packed; 85 - 86 - struct sof_ipc_dma_buffer_elem { 87 - struct sof_ipc_hdr hdr; 88 - uint32_t type; /**< SOF_IPC_REGION_ */ 89 - uint32_t id; /**< platform specific - used to map to host memory */ 90 - struct sof_ipc_host_buffer buffer; 91 - } __packed; 92 - 93 - /* extended data DMA buffers for IPC, trace and debug */ 94 - struct sof_ipc_dma_buffer_data { 95 - struct sof_ipc_ext_data_hdr ext_hdr; 96 - uint32_t num_buffers; 97 - 98 - /* host files in buffer[n].buffer */ 99 - struct sof_ipc_dma_buffer_elem buffer[]; 100 - } __packed; 101 85 102 86 struct sof_ipc_window_elem { 103 87 struct sof_ipc_hdr hdr;
-5
sound/soc/sof/intel/cnl.c
··· 65 65 hda_dsp_ipc_get_reply(sdev); 66 66 snd_sof_ipc_reply(sdev, msg); 67 67 68 - if (sdev->code_loading) { 69 - sdev->code_loading = 0; 70 - wake_up(&sdev->waitq); 71 - } 72 - 73 68 cnl_ipc_dsp_done(sdev); 74 69 75 70 spin_unlock_irq(&sdev->ipc_lock);
+96
sound/soc/sof/intel/hda-dai.c
··· 422 422 struct snd_soc_dai_driver skl_dai[] = { 423 423 { 424 424 .name = "SSP0 Pin", 425 + .playback = { 426 + .channels_min = 1, 427 + .channels_max = 8, 428 + }, 429 + .capture = { 430 + .channels_min = 1, 431 + .channels_max = 8, 432 + }, 425 433 }, 426 434 { 427 435 .name = "SSP1 Pin", 436 + .playback = { 437 + .channels_min = 1, 438 + .channels_max = 8, 439 + }, 440 + .capture = { 441 + .channels_min = 1, 442 + .channels_max = 8, 443 + }, 428 444 }, 429 445 { 430 446 .name = "SSP2 Pin", 447 + .playback = { 448 + .channels_min = 1, 449 + .channels_max = 8, 450 + }, 451 + .capture = { 452 + .channels_min = 1, 453 + .channels_max = 8, 454 + }, 431 455 }, 432 456 { 433 457 .name = "SSP3 Pin", 458 + .playback = { 459 + .channels_min = 1, 460 + .channels_max = 8, 461 + }, 462 + .capture = { 463 + .channels_min = 1, 464 + .channels_max = 8, 465 + }, 434 466 }, 435 467 { 436 468 .name = "SSP4 Pin", 469 + .playback = { 470 + .channels_min = 1, 471 + .channels_max = 8, 472 + }, 473 + .capture = { 474 + .channels_min = 1, 475 + .channels_max = 8, 476 + }, 437 477 }, 438 478 { 439 479 .name = "SSP5 Pin", 480 + .playback = { 481 + .channels_min = 1, 482 + .channels_max = 8, 483 + }, 484 + .capture = { 485 + .channels_min = 1, 486 + .channels_max = 8, 487 + }, 440 488 }, 441 489 { 442 490 .name = "DMIC01 Pin", 491 + .capture = { 492 + .channels_min = 1, 493 + .channels_max = 4, 494 + }, 443 495 }, 444 496 { 445 497 .name = "DMIC16k Pin", 498 + .capture = { 499 + .channels_min = 1, 500 + .channels_max = 4, 501 + }, 446 502 }, 447 503 #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) 448 504 { 449 505 .name = "iDisp1 Pin", 450 506 .ops = &hda_link_dai_ops, 507 + .playback = { 508 + .channels_min = 1, 509 + .channels_max = 8, 510 + }, 451 511 }, 452 512 { 453 513 .name = "iDisp2 Pin", 454 514 .ops = &hda_link_dai_ops, 515 + .playback = { 516 + .channels_min = 1, 517 + .channels_max = 8, 518 + }, 455 519 }, 456 520 { 457 521 .name = "iDisp3 Pin", 458 522 .ops = &hda_link_dai_ops, 523 + .playback = { 524 + .channels_min = 1, 525 + .channels_max = 8, 526 + }, 459 527 }, 460 528 { 461 529 .name = "iDisp4 Pin", 462 530 .ops = &hda_link_dai_ops, 531 + .playback = { 532 + .channels_min = 1, 533 + .channels_max = 8, 534 + }, 463 535 }, 464 536 { 465 537 .name = "Analog CPU DAI", 466 538 .ops = &hda_link_dai_ops, 539 + .playback = { 540 + .channels_min = 1, 541 + .channels_max = 16, 542 + }, 543 + .capture = { 544 + .channels_min = 1, 545 + .channels_max = 16, 546 + }, 467 547 }, 468 548 { 469 549 .name = "Digital CPU DAI", 470 550 .ops = &hda_link_dai_ops, 551 + .playback = { 552 + .channels_min = 1, 553 + .channels_max = 16, 554 + }, 555 + .capture = { 556 + .channels_min = 1, 557 + .channels_max = 16, 558 + }, 471 559 }, 472 560 { 473 561 .name = "Alt Analog CPU DAI", 474 562 .ops = &hda_link_dai_ops, 563 + .playback = { 564 + .channels_min = 1, 565 + .channels_max = 16, 566 + }, 567 + .capture = { 568 + .channels_min = 1, 569 + .channels_max = 16, 570 + }, 475 571 }, 476 572 #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_PROBES) 477 573 {
+3 -17
sound/soc/sof/intel/hda-ipc.c
··· 125 125 126 126 } 127 127 128 - static bool hda_dsp_ipc_is_sof(uint32_t msg) 129 - { 130 - return (msg & (HDA_DSP_IPC_PURGE_FW | 0xf << 9)) != msg || 131 - (msg & HDA_DSP_IPC_PURGE_FW) != HDA_DSP_IPC_PURGE_FW; 132 - } 133 - 134 128 /* IPC handler thread */ 135 129 irqreturn_t hda_dsp_ipc_irq_thread(int irq, void *context) 136 130 { ··· 170 176 */ 171 177 spin_lock_irq(&sdev->ipc_lock); 172 178 173 - /* handle immediate reply from DSP core - ignore ROM messages */ 174 - if (hda_dsp_ipc_is_sof(msg)) { 175 - hda_dsp_ipc_get_reply(sdev); 176 - snd_sof_ipc_reply(sdev, msg); 177 - } 178 - 179 - /* wake up sleeper if we are loading code */ 180 - if (sdev->code_loading) { 181 - sdev->code_loading = 0; 182 - wake_up(&sdev->waitq); 183 - } 179 + /* handle immediate reply from DSP core */ 180 + hda_dsp_ipc_get_reply(sdev); 181 + snd_sof_ipc_reply(sdev, msg); 184 182 185 183 /* set the done bit */ 186 184 hda_dsp_ipc_dsp_done(sdev);
-3
sound/soc/sof/intel/hda-loader.c
··· 179 179 /* code loader is special case that reuses stream ops */ 180 180 switch (cmd) { 181 181 case SNDRV_PCM_TRIGGER_START: 182 - wait_event_timeout(sdev->waitq, !sdev->code_loading, 183 - HDA_DSP_CL_TRIGGER_TIMEOUT); 184 - 185 182 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTCTL, 186 183 1 << hstream->index, 187 184 1 << hstream->index);
-3
sound/soc/sof/intel/hda.c
··· 584 584 hda_dsp_ctrl_ppcap_enable(sdev, true); 585 585 hda_dsp_ctrl_ppcap_int_enable(sdev, true); 586 586 587 - /* initialize waitq for code loading */ 588 - init_waitqueue_head(&sdev->waitq); 589 - 590 587 /* set default mailbox offset for FW ready message */ 591 588 sdev->dsp_box.offset = HDA_DSP_MBOX_UPLINK_OFFSET; 592 589
-1
sound/soc/sof/intel/hda.h
··· 175 175 * value cannot be read back within the specified time. 176 176 */ 177 177 #define HDA_DSP_STREAM_RUN_TIMEOUT 300 178 - #define HDA_DSP_CL_TRIGGER_TIMEOUT 300 179 178 180 179 #define HDA_DSP_SPIB_ENABLE 1 181 180 #define HDA_DSP_SPIB_DISABLE 0
-6
sound/soc/sof/loader.c
··· 95 95 96 96 /* process structure data */ 97 97 switch (ext_hdr->type) { 98 - case SOF_IPC_EXT_DMA_BUFFER: 99 - ret = 0; 100 - break; 101 98 case SOF_IPC_EXT_WINDOW: 102 99 ret = get_ext_windows(sdev, ext_hdr); 103 100 break; ··· 465 468 struct snd_sof_pdata *plat_data = sdev->pdata; 466 469 const char *fw_filename; 467 470 int ret; 468 - 469 - /* set code loading condition to true */ 470 - sdev->code_loading = 1; 471 471 472 472 /* Don't request firmware again if firmware is already requested */ 473 473 if (plat_data->fw)
-5
sound/soc/sof/sof-priv.h
··· 415 415 u32 enabled_cores_mask; /* keep track of enabled cores */ 416 416 417 417 /* FW configuration */ 418 - struct sof_ipc_dma_buffer_data *info_buffer; 419 418 struct sof_ipc_window *info_window; 420 419 421 420 /* IPC timeouts in ms */ 422 421 int ipc_timeout; 423 422 int boot_timeout; 424 - 425 - /* Wait queue for code loading */ 426 - wait_queue_head_t waitq; 427 - int code_loading; 428 423 429 424 #if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_PROBES) 430 425 unsigned int extractor_stream_tag;
+6 -2
sound/soc/sof/topology.c
··· 1240 1240 { 1241 1241 struct snd_soc_card *card = scomp->card; 1242 1242 struct snd_soc_pcm_runtime *rtd; 1243 + struct snd_soc_dai *cpu_dai; 1244 + int i; 1243 1245 1244 1246 list_for_each_entry(rtd, &card->rtd_list, list) { 1245 1247 dev_vdbg(scomp->dev, "tplg: check widget: %s stream: %s dai stream: %s\n", ··· 1256 1254 1257 1255 switch (w->id) { 1258 1256 case snd_soc_dapm_dai_out: 1259 - rtd->cpu_dai->capture_widget = w; 1257 + for_each_rtd_cpu_dais(rtd, i, cpu_dai) 1258 + cpu_dai->capture_widget = w; 1260 1259 dai->name = rtd->dai_link->name; 1261 1260 dev_dbg(scomp->dev, "tplg: connected widget %s -> DAI link %s\n", 1262 1261 w->name, rtd->dai_link->name); 1263 1262 break; 1264 1263 case snd_soc_dapm_dai_in: 1265 - rtd->cpu_dai->playback_widget = w; 1264 + for_each_rtd_cpu_dais(rtd, i, cpu_dai) 1265 + cpu_dai->playback_widget = w; 1266 1266 dai->name = rtd->dai_link->name; 1267 1267 dev_dbg(scomp->dev, "tplg: connected widget %s -> DAI link %s\n", 1268 1268 w->name, rtd->dai_link->name);