Lines Matching refs:sdev
52 struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(component); in hda_ctrl_dai_widget_setup() local
53 const struct sof_ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg; in hda_ctrl_dai_widget_setup()
58 dev_err(sdev->dev, "%s: No DAI for DAI widget %s\n", __func__, w->name); in hda_ctrl_dai_widget_setup()
69 ret = tplg_ops->dai_config(sdev, swidget, flags, data); in hda_ctrl_dai_widget_setup()
71 dev_err(sdev->dev, "%s: DAI config failed for widget %s\n", __func__, in hda_ctrl_dai_widget_setup()
85 struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(component); in hda_ctrl_dai_widget_free() local
86 const struct sof_ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg; in hda_ctrl_dai_widget_free()
90 dev_err(sdev->dev, "%s: No DAI for BE DAI widget %s\n", __func__, w->name); in hda_ctrl_dai_widget_free()
102 ret = tplg_ops->dai_config(sdev, swidget, flags, data); in hda_ctrl_dai_widget_free()
104 dev_err(sdev->dev, "%s: DAI config failed for widget '%s'\n", __func__, in hda_ctrl_dai_widget_free()
158 void hda_common_enable_sdw_irq(struct snd_sof_dev *sdev, bool enable) in hda_common_enable_sdw_irq() argument
162 hdev = sdev->pdata->hw_pdata; in hda_common_enable_sdw_irq()
167 snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPIC2, in hda_common_enable_sdw_irq()
172 void hda_sdw_int_enable(struct snd_sof_dev *sdev, bool enable) in hda_sdw_int_enable() argument
176 chip = get_chip_info(sdev->pdata); in hda_sdw_int_enable()
178 chip->enable_sdw_irq(sdev, enable); in hda_sdw_int_enable()
181 static int hda_sdw_acpi_scan(struct snd_sof_dev *sdev) in hda_sdw_acpi_scan() argument
187 handle = ACPI_HANDLE(sdev->dev); in hda_sdw_acpi_scan()
190 hdev = sdev->pdata->hw_pdata; in hda_sdw_acpi_scan()
199 static int hda_sdw_probe(struct snd_sof_dev *sdev) in hda_sdw_probe() argument
205 hdev = sdev->pdata->hw_pdata; in hda_sdw_probe()
210 res.mmio_base = sdev->bar[HDA_DSP_BAR]; in hda_sdw_probe()
213 res.irq = sdev->ipc_irq; in hda_sdw_probe()
215 res.parent = sdev->dev; in hda_sdw_probe()
217 res.dev = sdev->dev; in hda_sdw_probe()
232 dev_err(sdev->dev, "error: SoundWire probe failed\n"); in hda_sdw_probe()
242 int hda_sdw_check_lcount_common(struct snd_sof_dev *sdev) in hda_sdw_check_lcount_common() argument
248 hdev = sdev->pdata->hw_pdata; in hda_sdw_check_lcount_common()
251 caps = snd_sof_dsp_read(sdev, HDA_DSP_BAR, ctx->shim_base + SDW_SHIM_LCAP); in hda_sdw_check_lcount_common()
256 dev_err(sdev->dev, in hda_sdw_check_lcount_common()
265 static int hda_sdw_check_lcount(struct snd_sof_dev *sdev) in hda_sdw_check_lcount() argument
269 chip = get_chip_info(sdev->pdata); in hda_sdw_check_lcount()
271 return chip->read_sdw_lcount(sdev); in hda_sdw_check_lcount()
276 int hda_sdw_startup(struct snd_sof_dev *sdev) in hda_sdw_startup() argument
279 struct snd_sof_pdata *pdata = sdev->pdata; in hda_sdw_startup()
282 hdev = sdev->pdata->hw_pdata; in hda_sdw_startup()
290 ret = hda_sdw_check_lcount(sdev); in hda_sdw_startup()
297 static int hda_sdw_exit(struct snd_sof_dev *sdev) in hda_sdw_exit() argument
301 hdev = sdev->pdata->hw_pdata; in hda_sdw_exit()
303 hda_sdw_int_enable(sdev, false); in hda_sdw_exit()
312 bool hda_common_check_sdw_irq(struct snd_sof_dev *sdev) in hda_common_check_sdw_irq() argument
318 hdev = sdev->pdata->hw_pdata; in hda_common_check_sdw_irq()
324 irq_status = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPIS2); in hda_common_check_sdw_irq()
338 static bool hda_dsp_check_sdw_irq(struct snd_sof_dev *sdev) in hda_dsp_check_sdw_irq() argument
342 chip = get_chip_info(sdev->pdata); in hda_dsp_check_sdw_irq()
344 return chip->check_sdw_irq(sdev); in hda_dsp_check_sdw_irq()
354 static bool hda_sdw_check_wakeen_irq(struct snd_sof_dev *sdev) in hda_sdw_check_wakeen_irq() argument
358 hdev = sdev->pdata->hw_pdata; in hda_sdw_check_wakeen_irq()
360 snd_sof_dsp_read(sdev, HDA_DSP_BAR, in hda_sdw_check_wakeen_irq()
367 void hda_sdw_process_wakeen(struct snd_sof_dev *sdev) in hda_sdw_process_wakeen() argument
371 hdev = sdev->pdata->hw_pdata; in hda_sdw_process_wakeen()
379 static inline int hda_sdw_acpi_scan(struct snd_sof_dev *sdev) in hda_sdw_acpi_scan() argument
384 static inline int hda_sdw_probe(struct snd_sof_dev *sdev) in hda_sdw_probe() argument
389 static inline int hda_sdw_exit(struct snd_sof_dev *sdev) in hda_sdw_exit() argument
394 static inline bool hda_dsp_check_sdw_irq(struct snd_sof_dev *sdev) in hda_dsp_check_sdw_irq() argument
404 static inline bool hda_sdw_check_wakeen_irq(struct snd_sof_dev *sdev) in hda_sdw_check_wakeen_irq() argument
531 static void hda_dsp_get_state(struct snd_sof_dev *sdev, const char *level) in hda_dsp_get_state() argument
533 const struct sof_intel_dsp_desc *chip = get_chip_info(sdev->pdata); in hda_dsp_get_state()
537 fsr = snd_sof_dsp_read(sdev, HDA_DSP_BAR, chip->rom_status_reg); in hda_dsp_get_state()
556 dev_printk(level, sdev->dev, "%#010x: unknown ROM status value\n", fsr); in hda_dsp_get_state()
568 dev_printk(level, sdev->dev, in hda_dsp_get_state()
573 dev_printk(level, sdev->dev, "%#010x: module: %s, state: %s, %s\n", in hda_dsp_get_state()
578 error_code = snd_sof_dsp_read(sdev, HDA_DSP_BAR, chip->rom_status_reg + 4); in hda_dsp_get_state()
588 dev_printk(level, sdev->dev, "status code: %#x (%s)\n", error_code, in hda_dsp_get_state()
591 dev_printk(level, sdev->dev, "error code: %#x (%s)\n", error_code, in hda_dsp_get_state()
595 static void hda_dsp_get_registers(struct snd_sof_dev *sdev, in hda_dsp_get_registers() argument
600 u32 offset = sdev->dsp_oops_offset; in hda_dsp_get_registers()
603 sof_mailbox_read(sdev, offset, xoops, sizeof(*xoops)); in hda_dsp_get_registers()
609 dev_err(sdev->dev, "invalid header size 0x%x. FW oops is bogus\n", in hda_dsp_get_registers()
614 sof_block_read(sdev, sdev->mmio_bar, offset, in hda_dsp_get_registers()
619 sof_block_read(sdev, sdev->mmio_bar, offset, stack, in hda_dsp_get_registers()
624 static void hda_dsp_dump_ext_rom_status(struct snd_sof_dev *sdev, const char *level, in hda_dsp_dump_ext_rom_status() argument
633 chip = get_chip_info(sdev->pdata); in hda_dsp_dump_ext_rom_status()
635 value = snd_sof_dsp_read(sdev, HDA_DSP_BAR, chip->rom_status_reg + i * 0x4); in hda_dsp_dump_ext_rom_status()
639 dev_printk(level, sdev->dev, "extended rom status: %s", msg); in hda_dsp_dump_ext_rom_status()
643 void hda_dsp_dump(struct snd_sof_dev *sdev, u32 flags) in hda_dsp_dump() argument
651 hda_dsp_get_state(sdev, level); in hda_dsp_dump()
654 if (flags & SOF_DBG_DUMP_REGS && sdev->pdata->ipc_type == SOF_IPC) { in hda_dsp_dump()
655 u32 status = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_SRAM_REG_FW_STATUS); in hda_dsp_dump()
656 u32 panic = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_SRAM_REG_FW_TRACEP); in hda_dsp_dump()
658 hda_dsp_get_registers(sdev, &xoops, &panic_info, stack, in hda_dsp_dump()
660 sof_print_oops_and_stack(sdev, level, status, panic, &xoops, in hda_dsp_dump()
663 hda_dsp_dump_ext_rom_status(sdev, level, flags); in hda_dsp_dump()
667 static bool hda_check_ipc_irq(struct snd_sof_dev *sdev) in hda_check_ipc_irq() argument
671 chip = get_chip_info(sdev->pdata); in hda_check_ipc_irq()
673 return chip->check_ipc_irq(sdev); in hda_check_ipc_irq()
678 void hda_ipc_irq_dump(struct snd_sof_dev *sdev) in hda_ipc_irq_dump() argument
687 adspis = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPIS); in hda_ipc_irq_dump()
688 intsts = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTSTS); in hda_ipc_irq_dump()
689 intctl = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTCTL); in hda_ipc_irq_dump()
690 ppsts = snd_sof_dsp_read(sdev, HDA_DSP_PP_BAR, SOF_HDA_REG_PP_PPSTS); in hda_ipc_irq_dump()
691 rirbsts = snd_sof_dsp_read8(sdev, HDA_DSP_HDA_BAR, AZX_REG_RIRBSTS); in hda_ipc_irq_dump()
693 dev_err(sdev->dev, "hda irq intsts 0x%8.8x intlctl 0x%8.8x rirb %2.2x\n", in hda_ipc_irq_dump()
695 dev_err(sdev->dev, "dsp irq ppsts 0x%8.8x adspis 0x%8.8x\n", ppsts, adspis); in hda_ipc_irq_dump()
698 void hda_ipc_dump(struct snd_sof_dev *sdev) in hda_ipc_dump() argument
704 hda_ipc_irq_dump(sdev); in hda_ipc_dump()
707 hipcie = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCIE); in hda_ipc_dump()
708 hipct = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCT); in hda_ipc_dump()
709 hipcctl = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCCTL); in hda_ipc_dump()
713 dev_err(sdev->dev, "host status 0x%8.8x dsp status 0x%8.8x mask 0x%8.8x\n", in hda_ipc_dump()
717 void hda_ipc4_dump(struct snd_sof_dev *sdev) in hda_ipc4_dump() argument
721 hda_ipc_irq_dump(sdev); in hda_ipc4_dump()
723 hipci = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCI); in hda_ipc4_dump()
724 hipcie = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCIE); in hda_ipc4_dump()
725 hipct = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCT); in hda_ipc4_dump()
726 hipcte = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCTE); in hda_ipc4_dump()
727 hipcctl = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCCTL); in hda_ipc4_dump()
731 dev_err(sdev->dev, "Host IPC initiator: %#x|%#x, target: %#x|%#x, ctl: %#x\n", in hda_ipc4_dump()
735 bool hda_ipc4_tx_is_busy(struct snd_sof_dev *sdev) in hda_ipc4_tx_is_busy() argument
737 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in hda_ipc4_tx_is_busy()
741 val = snd_sof_dsp_read(sdev, HDA_DSP_BAR, chip->ipc_req); in hda_ipc4_tx_is_busy()
746 static int hda_init(struct snd_sof_dev *sdev) in hda_init() argument
750 struct pci_dev *pci = to_pci_dev(sdev->dev); in hda_init()
753 hbus = sof_to_hbus(sdev); in hda_init()
754 bus = sof_to_bus(sdev); in hda_init()
757 sof_hda_bus_init(sdev, &pci->dev); in hda_init()
780 sdev->bar[HDA_DSP_HDA_BAR] = bus->remap_addr; in hda_init()
783 ret = hda_codec_i915_init(sdev); in hda_init()
785 dev_warn(sdev->dev, "init of i915 and HDMI codec failed\n"); in hda_init()
788 ret = hda_dsp_ctrl_get_caps(sdev); in hda_init()
790 dev_err(sdev->dev, "error: get caps error\n"); in hda_init()
795 static int check_dmic_num(struct snd_sof_dev *sdev) in check_dmic_num() argument
797 struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata; in check_dmic_num()
803 dmic_num = intel_nhlt_get_dmic_geo(sdev->dev, nhlt); in check_dmic_num()
807 dev_dbg(sdev->dev, in check_dmic_num()
814 dev_dbg(sdev->dev, "invalid dmic_number %d\n", dmic_num); in check_dmic_num()
821 static int check_nhlt_ssp_mask(struct snd_sof_dev *sdev) in check_nhlt_ssp_mask() argument
823 struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata; in check_nhlt_ssp_mask()
834 dev_info(sdev->dev, "NHLT_DEVICE_I2S detected, ssp_mask %#x\n", ssp_mask); in check_nhlt_ssp_mask()
840 static int check_nhlt_ssp_mclk_mask(struct snd_sof_dev *sdev, int ssp_num) in check_nhlt_ssp_mclk_mask() argument
842 struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata; in check_nhlt_ssp_mclk_mask()
854 static const char *fixup_tplg_name(struct snd_sof_dev *sdev, in fixup_tplg_name() argument
871 tplg_filename = devm_kasprintf(sdev->dev, GFP_KERNEL, in fixup_tplg_name()
879 static int dmic_detect_topology_fixup(struct snd_sof_dev *sdev, in dmic_detect_topology_fixup() argument
889 dmic_num = check_dmic_num(sdev); in dmic_detect_topology_fixup()
914 fixed_tplg_filename = fixup_tplg_name(sdev, default_tplg_filename, in dmic_detect_topology_fixup()
921 dev_info(sdev->dev, "DMICs detected in NHLT tables: %d\n", dmic_num); in dmic_detect_topology_fixup()
928 static int hda_init_caps(struct snd_sof_dev *sdev) in hda_init_caps() argument
930 struct hdac_bus *bus = sof_to_bus(sdev); in hda_init_caps()
931 struct snd_sof_pdata *pdata = sdev->pdata; in hda_init_caps()
938 dev_dbg(sdev->dev, "PP capability, will probe DSP later.\n"); in hda_init_caps()
941 ret = hda_dsp_ctrl_init_chip(sdev); in hda_init_caps()
951 ret = hda_sdw_acpi_scan(sdev); in hda_init_caps()
953 dev_dbg(sdev->dev, "skipping SoundWire, not detected with ACPI scan\n"); in hda_init_caps()
959 dev_dbg(sdev->dev, "skipping SoundWire, no links enabled\n"); in hda_init_caps()
970 ret = hda_sdw_probe(sdev); in hda_init_caps()
972 dev_err(sdev->dev, "error: SoundWire probe error\n"); in hda_init_caps()
979 hda_codec_probe_bus(sdev); in hda_init_caps()
982 hda_codec_i915_display_power(sdev, false); in hda_init_caps()
991 struct snd_sof_dev *sdev = context; in hda_dsp_interrupt_handler() local
997 if (snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTSTS) & in hda_dsp_interrupt_handler()
1001 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, in hda_dsp_interrupt_handler()
1014 struct snd_sof_dev *sdev = context; in hda_dsp_interrupt_thread() local
1015 struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata; in hda_dsp_interrupt_thread()
1018 if (hda_dsp_check_stream_irq(sdev)) { in hda_dsp_interrupt_thread()
1019 trace_sof_intel_hda_irq(sdev, "stream"); in hda_dsp_interrupt_thread()
1020 hda_dsp_stream_threaded_handler(irq, sdev); in hda_dsp_interrupt_thread()
1023 if (hda_check_ipc_irq(sdev)) { in hda_dsp_interrupt_thread()
1024 trace_sof_intel_hda_irq(sdev, "ipc"); in hda_dsp_interrupt_thread()
1025 sof_ops(sdev)->irq_thread(irq, sdev); in hda_dsp_interrupt_thread()
1028 if (hda_dsp_check_sdw_irq(sdev)) { in hda_dsp_interrupt_thread()
1029 trace_sof_intel_hda_irq(sdev, "sdw"); in hda_dsp_interrupt_thread()
1033 if (hda_sdw_check_wakeen_irq(sdev)) { in hda_dsp_interrupt_thread()
1034 trace_sof_intel_hda_irq(sdev, "wakeen"); in hda_dsp_interrupt_thread()
1035 hda_sdw_process_wakeen(sdev); in hda_dsp_interrupt_thread()
1038 hda_codec_check_for_state_change(sdev); in hda_dsp_interrupt_thread()
1041 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, in hda_dsp_interrupt_thread()
1049 int hda_dsp_probe(struct snd_sof_dev *sdev) in hda_dsp_probe() argument
1051 struct pci_dev *pci = to_pci_dev(sdev->dev); in hda_dsp_probe()
1065 dev_err(sdev->dev, "error: the DSP is not enabled on this platform, aborting probe\n"); in hda_dsp_probe()
1068 …dev_err(sdev->dev, "error: unknown PCI class/subclass/prog-if 0x%06x found, aborting probe\n", pci… in hda_dsp_probe()
1071 dev_info(sdev->dev, "DSP detected with PCI class/subclass/prog-if 0x%06x\n", pci->class); in hda_dsp_probe()
1073 chip = get_chip_info(sdev->pdata); in hda_dsp_probe()
1075 dev_err(sdev->dev, "error: no such device supported, chip id:%x\n", in hda_dsp_probe()
1081 sdev->num_cores = chip->cores_num; in hda_dsp_probe()
1083 hdev = devm_kzalloc(sdev->dev, sizeof(*hdev), GFP_KERNEL); in hda_dsp_probe()
1086 sdev->pdata->hw_pdata = hdev; in hda_dsp_probe()
1089 hdev->dmic_dev = platform_device_register_data(sdev->dev, "dmic-codec", in hda_dsp_probe()
1093 dev_err(sdev->dev, "error: failed to create DMIC device\n"); in hda_dsp_probe()
1104 hdev->no_ipc_position = sof_ops(sdev)->pcm_pointer ? 1 : 0; in hda_dsp_probe()
1108 bus = sof_to_bus(sdev); in hda_dsp_probe()
1109 ret = hda_init(sdev); in hda_dsp_probe()
1114 sdev->bar[HDA_DSP_BAR] = pci_ioremap_bar(pci, HDA_DSP_BAR); in hda_dsp_probe()
1115 if (!sdev->bar[HDA_DSP_BAR]) { in hda_dsp_probe()
1116 dev_err(sdev->dev, "error: ioremap error\n"); in hda_dsp_probe()
1121 sdev->mmio_bar = HDA_DSP_BAR; in hda_dsp_probe()
1122 sdev->mailbox_bar = HDA_DSP_BAR; in hda_dsp_probe()
1126 dev_dbg(sdev->dev, "DMA mask is 32 bit\n"); in hda_dsp_probe()
1132 ret = hda_dsp_stream_init(sdev); in hda_dsp_probe()
1134 dev_err(sdev->dev, "error: failed to init streams\n"); in hda_dsp_probe()
1149 dev_info(sdev->dev, "use msi interrupt mode\n"); in hda_dsp_probe()
1150 sdev->ipc_irq = pci_irq_vector(pci, 0); in hda_dsp_probe()
1152 sdev->msi_enabled = true; in hda_dsp_probe()
1155 if (!sdev->msi_enabled) { in hda_dsp_probe()
1156 dev_info(sdev->dev, "use legacy interrupt mode\n"); in hda_dsp_probe()
1161 sdev->ipc_irq = pci->irq; in hda_dsp_probe()
1164 dev_dbg(sdev->dev, "using IPC IRQ %d\n", sdev->ipc_irq); in hda_dsp_probe()
1165 ret = request_threaded_irq(sdev->ipc_irq, hda_dsp_interrupt_handler, in hda_dsp_probe()
1167 IRQF_SHARED, "AudioDSP", sdev); in hda_dsp_probe()
1169 dev_err(sdev->dev, "error: failed to register IPC IRQ %d\n", in hda_dsp_probe()
1170 sdev->ipc_irq); in hda_dsp_probe()
1181 snd_sof_pci_update_bits(sdev, PCI_TCSEL, 0x07, 0); in hda_dsp_probe()
1184 ret = hda_init_caps(sdev); in hda_dsp_probe()
1189 hda_dsp_ctrl_ppcap_enable(sdev, true); in hda_dsp_probe()
1190 hda_dsp_ctrl_ppcap_int_enable(sdev, true); in hda_dsp_probe()
1193 sdev->dsp_box.offset = HDA_DSP_MBOX_UPLINK_OFFSET; in hda_dsp_probe()
1199 hdev->nhlt = intel_nhlt_init(sdev->dev); in hda_dsp_probe()
1204 free_irq(sdev->ipc_irq, sdev); in hda_dsp_probe()
1206 if (sdev->msi_enabled) in hda_dsp_probe()
1209 hda_dsp_stream_free(sdev); in hda_dsp_probe()
1211 iounmap(sdev->bar[HDA_DSP_BAR]); in hda_dsp_probe()
1215 hda_codec_i915_exit(sdev); in hda_dsp_probe()
1220 int hda_dsp_remove(struct snd_sof_dev *sdev) in hda_dsp_remove() argument
1222 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in hda_dsp_remove()
1224 struct hdac_bus *bus = sof_to_bus(sdev); in hda_dsp_remove()
1225 struct pci_dev *pci = to_pci_dev(sdev->dev); in hda_dsp_remove()
1234 hda_codec_device_remove(sdev); in hda_dsp_remove()
1236 hda_sdw_exit(sdev); in hda_dsp_remove()
1242 snd_sof_dsp_update_bits(sdev, HDA_DSP_PP_BAR, SOF_HDA_REG_PP_PPCTL, in hda_dsp_remove()
1246 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTCTL, in hda_dsp_remove()
1251 chip->power_down_dsp(sdev); in hda_dsp_remove()
1254 snd_sof_dsp_update_bits(sdev, HDA_DSP_PP_BAR, SOF_HDA_REG_PP_PPCTL, in hda_dsp_remove()
1257 free_irq(sdev->ipc_irq, sdev); in hda_dsp_remove()
1258 if (sdev->msi_enabled) in hda_dsp_remove()
1261 hda_dsp_stream_free(sdev); in hda_dsp_remove()
1263 hda_bus_ml_free(sof_to_bus(sdev)); in hda_dsp_remove()
1265 iounmap(sdev->bar[HDA_DSP_BAR]); in hda_dsp_remove()
1268 sof_hda_bus_exit(sdev); in hda_dsp_remove()
1270 hda_codec_i915_exit(sdev); in hda_dsp_remove()
1275 int hda_power_down_dsp(struct snd_sof_dev *sdev) in hda_power_down_dsp() argument
1277 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in hda_power_down_dsp()
1280 return hda_dsp_core_reset_power_down(sdev, chip->host_managed_cores_mask); in hda_power_down_dsp()
1284 static void hda_generic_machine_select(struct snd_sof_dev *sdev, in hda_generic_machine_select() argument
1287 struct hdac_bus *bus = sof_to_bus(sdev); in hda_generic_machine_select()
1290 struct snd_sof_pdata *pdata = sdev->pdata; in hda_generic_machine_select()
1338 ret = dmic_detect_topology_fixup(sdev, &tplg_filename, idisp_str, &dmic_num, in hda_generic_machine_select()
1366 static void hda_generic_machine_select(struct snd_sof_dev *sdev, in hda_generic_machine_select() argument
1378 static bool link_slaves_found(struct snd_sof_dev *sdev, in link_slaves_found() argument
1382 struct hdac_bus *bus = sof_to_bus(sdev); in link_slaves_found()
1451 static struct snd_soc_acpi_mach *hda_sdw_machine_select(struct snd_sof_dev *sdev) in hda_sdw_machine_select() argument
1453 struct snd_sof_pdata *pdata = sdev->pdata; in hda_sdw_machine_select()
1494 if (!link_slaves_found(sdev, link, hdev->sdw)) in hda_sdw_machine_select()
1508 mach->mach_params.platform = dev_name(sdev->dev); in hda_sdw_machine_select()
1527 ret = dmic_detect_topology_fixup(sdev, &tplg_filename, "", in hda_sdw_machine_select()
1536 dev_dbg(sdev->dev, in hda_sdw_machine_select()
1544 dev_info(sdev->dev, "No SoundWire machine driver found\n"); in hda_sdw_machine_select()
1550 static struct snd_soc_acpi_mach *hda_sdw_machine_select(struct snd_sof_dev *sdev) in hda_sdw_machine_select() argument
1557 struct snd_sof_dev *sdev) in hda_set_mach_params() argument
1559 struct snd_sof_pdata *pdata = sdev->pdata; in hda_set_mach_params()
1564 mach_params->platform = dev_name(sdev->dev); in hda_set_mach_params()
1569 struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev) in hda_machine_select() argument
1571 struct snd_sof_pdata *sof_pdata = sdev->pdata; in hda_machine_select()
1591 mach->mach_params.dmic_num = check_dmic_num(sdev); in hda_machine_select()
1596 tplg_filename = devm_kasprintf(sdev->dev, GFP_KERNEL, in hda_machine_select()
1615 mach->mach_params.i2s_link_mask = check_nhlt_ssp_mask(sdev); in hda_machine_select()
1620 const struct sof_intel_dsp_desc *chip = get_chip_info(sdev->pdata); in hda_machine_select()
1626 dev_warn(sdev->dev, "More than one SSP exposed by NHLT, choosing MSB\n"); in hda_machine_select()
1632 dev_err(sdev->dev, "Invalid SSP %d, max on this platform is %d\n", in hda_machine_select()
1637 tplg_filename = devm_kasprintf(sdev->dev, GFP_KERNEL, in hda_machine_select()
1648 mclk_mask = check_nhlt_ssp_mclk_mask(sdev, ssp_num); in hda_machine_select()
1651 dev_err(sdev->dev, "Invalid MCLK configuration\n"); in hda_machine_select()
1655 dev_dbg(sdev->dev, "MCLK mask %#x found in NHLT\n", mclk_mask); in hda_machine_select()
1658 dev_info(sdev->dev, "Overriding topology with MCLK mask %#x from NHLT\n", mclk_mask); in hda_machine_select()
1659 sdev->mclk_id_override = true; in hda_machine_select()
1660 sdev->mclk_id_quirk = (mclk_mask & BIT(0)) ? 0 : 1; in hda_machine_select()
1665 tplg_filename = devm_kasprintf(sdev->dev, GFP_KERNEL, in hda_machine_select()
1677 … dev_info(sdev->dev, "Overriding topology with MCLK %d from kernel_parameter\n", mclk_id_override); in hda_machine_select()
1678 sdev->mclk_id_override = true; in hda_machine_select()
1679 sdev->mclk_id_quirk = mclk_id_override; in hda_machine_select()
1687 mach = hda_sdw_machine_select(sdev); in hda_machine_select()
1693 hda_generic_machine_select(sdev, &mach); in hda_machine_select()
1695 dev_warn(sdev->dev, "warning: No matching ASoC machine driver found\n"); in hda_machine_select()
1714 int hda_register_clients(struct snd_sof_dev *sdev) in hda_register_clients() argument
1716 return hda_probes_register(sdev); in hda_register_clients()
1719 void hda_unregister_clients(struct snd_sof_dev *sdev) in hda_unregister_clients() argument
1721 hda_probes_unregister(sdev); in hda_unregister_clients()