Lines Matching +full:dmic +full:- +full:codec

1 // SPDX-License-Identifier: GPL-2.0-only
3 // Copyright(c) 2021-2022 Intel Corporation
17 #include <sound/soc-acpi.h>
18 #include <sound/soc-component.h>
23 MODULE_PARM_DESC(i2s_test, "Probe I2S test-board and skip all other I2S boards");
57 if (mach->quirk_data == NULL) in dmi_match_quirk()
60 dmi_table = (struct dmi_system_id *)mach->quirk_data; in dmi_match_quirk()
72 /* supported I2S board codec configurations */
80 .tplg_filename = "rt286-tplg.bin",
88 .tplg_filename = "nau8825-tplg.bin",
96 .tplg_filename = "ssm4567-tplg.bin",
104 .tplg_filename = "max98357a-tplg.bin",
118 .tplg_filename = "rt286-tplg.bin",
128 .tplg_filename = "rt298-tplg.bin",
136 .tplg_filename = "max98927-tplg.bin",
145 .tplg_filename = "rt5514-tplg.bin",
153 .tplg_filename = "rt5663-tplg.bin",
161 .tplg_filename = "max98373-tplg.bin",
169 .tplg_filename = "max98357a-tplg.bin",
177 .tplg_filename = "da7219-tplg.bin",
185 .tplg_filename = "es8336-tplg.bin",
197 .tplg_filename = "rt298-tplg.bin",
206 .tplg_filename = "tdf8532-tplg.bin",
214 .tplg_filename = "max98357a-tplg.bin",
222 .tplg_filename = "da7219-tplg.bin",
234 .tplg_filename = "rt298-tplg.bin",
246 .tplg_filename = "rt274-tplg.bin",
254 .tplg_filename = "rt5682-tplg.bin",
266 .tplg_filename = "rt298-tplg.bin",
274 .tplg_filename = "rt274-tplg.bin",
286 .tplg_filename = "rt274-tplg.bin",
294 .tplg_filename = "rt298-tplg.bin",
302 .tplg_filename = "rt1308-tplg.bin",
310 .tplg_filename = "es8336-tplg.bin",
321 .tplg_filename = "i2s-test-tplg.bin",
328 .tplg_filename = "i2s-test-tplg.bin",
335 .tplg_filename = "i2s-test-tplg.bin",
342 .tplg_filename = "i2s-test-tplg.bin",
349 .tplg_filename = "i2s-test-tplg.bin",
356 .tplg_filename = "i2s-test-tplg.bin",
391 id = adev->base.pci->device; in avs_get_i2s_boards()
410 ret = avs_probe_platform_register(adev, "probe-platform"); in avs_register_probe_board()
414 mach.mach_params.platform = "probe-platform"; in avs_register_probe_board()
419 dev_err(adev->dev, "probe board register failed\n"); in avs_register_probe_board()
423 ret = devm_add_action(adev->dev, board_pdev_unregister, board); in avs_register_probe_board()
433 struct platform_device *codec, *board; in avs_register_dmic_board() local
437 if (!acpi_nhlt_find_endpoint(ACPI_NHLT_LINKTYPE_PDM, -1, -1, -1)) { in avs_register_dmic_board()
438 dev_dbg(adev->dev, "no DMIC endpoints present\n"); in avs_register_dmic_board()
442 codec = platform_device_register_simple("dmic-codec", PLATFORM_DEVID_NONE, NULL, 0); in avs_register_dmic_board()
443 if (IS_ERR(codec)) { in avs_register_dmic_board()
444 dev_err(adev->dev, "dmic codec register failed\n"); in avs_register_dmic_board()
445 return PTR_ERR(codec); in avs_register_dmic_board()
448 ret = devm_add_action(adev->dev, board_pdev_unregister, codec); in avs_register_dmic_board()
450 platform_device_unregister(codec); in avs_register_dmic_board()
454 ret = avs_dmic_platform_register(adev, "dmic-platform"); in avs_register_dmic_board()
458 mach.tplg_filename = "dmic-tplg.bin"; in avs_register_dmic_board()
459 mach.mach_params.platform = "dmic-platform"; in avs_register_dmic_board()
464 dev_err(adev->dev, "dmic board register failed\n"); in avs_register_dmic_board()
468 ret = devm_add_action(adev->dev, board_pdev_unregister, board); in avs_register_dmic_board()
484 num_ssps = adev->hw_cfg.i2s_caps.ctrl_count; in avs_register_i2s_board()
485 if (fls(mach->mach_params.i2s_link_mask) > num_ssps) { in avs_register_i2s_board()
486 dev_err(adev->dev, "Platform supports %d SSPs but board %s requires SSP%ld\n", in avs_register_i2s_board()
487 num_ssps, mach->drv_name, in avs_register_i2s_board()
488 (unsigned long)__fls(mach->mach_params.i2s_link_mask)); in avs_register_i2s_board()
489 return -ENODEV; in avs_register_i2s_board()
492 name = devm_kasprintf(adev->dev, GFP_KERNEL, "%s.%d-platform", mach->drv_name, in avs_register_i2s_board()
493 mach->mach_params.i2s_link_mask); in avs_register_i2s_board()
495 return -ENOMEM; in avs_register_i2s_board()
497 ret = avs_i2s_platform_register(adev, name, mach->mach_params.i2s_link_mask, mach->pdata); in avs_register_i2s_board()
501 mach->mach_params.platform = name; in avs_register_i2s_board()
503 board = platform_device_register_data(NULL, mach->drv_name, mach->mach_params.i2s_link_mask, in avs_register_i2s_board()
506 dev_err(adev->dev, "ssp board register failed\n"); in avs_register_i2s_board()
510 ret = devm_add_action(adev->dev, board_pdev_unregister, board); in avs_register_i2s_board()
525 if (!acpi_nhlt_find_endpoint(ACPI_NHLT_LINKTYPE_SSP, -1, -1, -1)) { in avs_register_i2s_boards()
526 dev_dbg(adev->dev, "no I2S endpoints present\n"); in avs_register_i2s_boards()
533 num_ssps = adev->hw_cfg.i2s_caps.ctrl_count; in avs_register_i2s_boards()
542 dev_warn(adev->dev, "register i2s %s failed: %d\n", mach->drv_name, in avs_register_i2s_boards()
550 dev_dbg(adev->dev, "no I2S endpoints supported\n"); in avs_register_i2s_boards()
554 for (mach = boards->machs; mach->id[0]; mach++) { in avs_register_i2s_boards()
555 if (!acpi_dev_present(mach->id, mach->uid, -1)) in avs_register_i2s_boards()
558 if (mach->machine_quirk) in avs_register_i2s_boards()
559 if (!mach->machine_quirk(mach)) in avs_register_i2s_boards()
564 dev_warn(adev->dev, "register i2s %s failed: %d\n", mach->drv_name, ret); in avs_register_i2s_boards()
570 static int avs_register_hda_board(struct avs_dev *adev, struct hda_codec *codec) in avs_register_hda_board() argument
574 struct hdac_device *hdev = &codec->core; in avs_register_hda_board()
578 pname = devm_kasprintf(adev->dev, GFP_KERNEL, "%s-platform", dev_name(&hdev->dev)); in avs_register_hda_board()
580 return -ENOMEM; in avs_register_hda_board()
586 mach.pdata = codec; in avs_register_hda_board()
588 mach.tplg_filename = devm_kasprintf(adev->dev, GFP_KERNEL, "hda-%08x-tplg.bin", in avs_register_hda_board()
589 hdev->vendor_id); in avs_register_hda_board()
591 return -ENOMEM; in avs_register_hda_board()
593 id = adev->base.core.idx * HDA_MAX_CODECS + hdev->addr; in avs_register_hda_board()
597 dev_err(adev->dev, "hda board register failed\n"); in avs_register_hda_board()
601 ret = devm_add_action(adev->dev, board_pdev_unregister, board); in avs_register_hda_board()
612 struct hdac_bus *bus = &adev->base.core; in avs_register_hda_boards()
616 if (!bus->num_codecs) { in avs_register_hda_boards()
617 dev_dbg(adev->dev, "no HDA endpoints present\n"); in avs_register_hda_boards()
621 list_for_each_entry(hdev, &bus->codec_list, list) { in avs_register_hda_boards()
622 struct hda_codec *codec; in avs_register_hda_boards() local
624 codec = dev_to_hda_codec(&hdev->dev); in avs_register_hda_boards()
626 ret = avs_register_hda_board(adev, codec); in avs_register_hda_boards()
628 dev_warn(adev->dev, "register hda-%08x failed: %d\n", in avs_register_hda_boards()
629 codec->core.vendor_id, ret); in avs_register_hda_boards()
642 dev_warn(adev->dev, "enumerate PROBE endpoints failed: %d\n", ret); in avs_register_all_boards()
647 dev_warn(adev->dev, "enumerate DMIC endpoints failed: %d\n", in avs_register_all_boards()
652 dev_warn(adev->dev, "enumerate I2S endpoints failed: %d\n", in avs_register_all_boards()
657 dev_warn(adev->dev, "enumerate HDA endpoints failed: %d\n", in avs_register_all_boards()
665 snd_soc_unregister_component(adev->dev); in avs_unregister_all_boards()