Lines Matching refs:sdev

48 static u32 hda_get_interface_mask(struct snd_sof_dev *sdev)  in hda_get_interface_mask()  argument
53 chip = get_chip_info(sdev->pdata); in hda_get_interface_mask()
83 return interface_mask[sdev->dspless_mode_selected]; in hda_get_interface_mask()
143 void hda_common_enable_sdw_irq(struct snd_sof_dev *sdev, bool enable) in hda_common_enable_sdw_irq() argument
147 hdev = sdev->pdata->hw_pdata; in hda_common_enable_sdw_irq()
152 snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPIC2, in hda_common_enable_sdw_irq()
157 void hda_sdw_int_enable(struct snd_sof_dev *sdev, bool enable) in hda_sdw_int_enable() argument
159 u32 interface_mask = hda_get_interface_mask(sdev); in hda_sdw_int_enable()
165 chip = get_chip_info(sdev->pdata); in hda_sdw_int_enable()
167 chip->enable_sdw_irq(sdev, enable); in hda_sdw_int_enable()
170 static int hda_sdw_acpi_scan(struct snd_sof_dev *sdev) in hda_sdw_acpi_scan() argument
172 u32 interface_mask = hda_get_interface_mask(sdev); in hda_sdw_acpi_scan()
180 handle = ACPI_HANDLE(sdev->dev); in hda_sdw_acpi_scan()
183 hdev = sdev->pdata->hw_pdata; in hda_sdw_acpi_scan()
192 static int hda_sdw_probe(struct snd_sof_dev *sdev) in hda_sdw_probe() argument
199 hdev = sdev->pdata->hw_pdata; in hda_sdw_probe()
203 chip = get_chip_info(sdev->pdata); in hda_sdw_probe()
205 res.mmio_base = sdev->bar[HDA_DSP_BAR]; in hda_sdw_probe()
216 res.eml_lock = hdac_bus_eml_get_mutex(sof_to_bus(sdev), true, in hda_sdw_probe()
221 res.mmio_base = sdev->bar[HDA_DSP_HDA_BAR]; in hda_sdw_probe()
231 res.irq = sdev->ipc_irq; in hda_sdw_probe()
233 res.parent = sdev->dev; in hda_sdw_probe()
235 res.dev = sdev->dev; in hda_sdw_probe()
237 res.hbus = sof_to_bus(sdev); in hda_sdw_probe()
251 dev_err(sdev->dev, "error: SoundWire probe failed\n"); in hda_sdw_probe()
261 int hda_sdw_check_lcount_common(struct snd_sof_dev *sdev) in hda_sdw_check_lcount_common() argument
267 hdev = sdev->pdata->hw_pdata; in hda_sdw_check_lcount_common()
270 caps = snd_sof_dsp_read(sdev, HDA_DSP_BAR, ctx->shim_base + SDW_SHIM_LCAP); in hda_sdw_check_lcount_common()
275 dev_err(sdev->dev, in hda_sdw_check_lcount_common()
284 int hda_sdw_check_lcount_ext(struct snd_sof_dev *sdev) in hda_sdw_check_lcount_ext() argument
291 bus = sof_to_bus(sdev); in hda_sdw_check_lcount_ext()
293 hdev = sdev->pdata->hw_pdata; in hda_sdw_check_lcount_ext()
300 dev_err(sdev->dev, in hda_sdw_check_lcount_ext()
309 static int hda_sdw_check_lcount(struct snd_sof_dev *sdev) in hda_sdw_check_lcount() argument
313 chip = get_chip_info(sdev->pdata); in hda_sdw_check_lcount()
315 return chip->read_sdw_lcount(sdev); in hda_sdw_check_lcount()
320 int hda_sdw_startup(struct snd_sof_dev *sdev) in hda_sdw_startup() argument
323 struct snd_sof_pdata *pdata = sdev->pdata; in hda_sdw_startup()
326 hdev = sdev->pdata->hw_pdata; in hda_sdw_startup()
334 ret = hda_sdw_check_lcount(sdev); in hda_sdw_startup()
341 static int hda_sdw_exit(struct snd_sof_dev *sdev) in hda_sdw_exit() argument
345 hdev = sdev->pdata->hw_pdata; in hda_sdw_exit()
347 hda_sdw_int_enable(sdev, false); in hda_sdw_exit()
356 bool hda_common_check_sdw_irq(struct snd_sof_dev *sdev) in hda_common_check_sdw_irq() argument
362 hdev = sdev->pdata->hw_pdata; in hda_common_check_sdw_irq()
368 irq_status = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPIS2); in hda_common_check_sdw_irq()
382 static bool hda_dsp_check_sdw_irq(struct snd_sof_dev *sdev) in hda_dsp_check_sdw_irq() argument
384 u32 interface_mask = hda_get_interface_mask(sdev); in hda_dsp_check_sdw_irq()
390 chip = get_chip_info(sdev->pdata); in hda_dsp_check_sdw_irq()
392 return chip->check_sdw_irq(sdev); in hda_dsp_check_sdw_irq()
402 bool hda_sdw_check_wakeen_irq_common(struct snd_sof_dev *sdev) in hda_sdw_check_wakeen_irq_common() argument
406 hdev = sdev->pdata->hw_pdata; in hda_sdw_check_wakeen_irq_common()
408 snd_sof_dsp_read(sdev, HDA_DSP_BAR, in hda_sdw_check_wakeen_irq_common()
415 static bool hda_sdw_check_wakeen_irq(struct snd_sof_dev *sdev) in hda_sdw_check_wakeen_irq() argument
417 u32 interface_mask = hda_get_interface_mask(sdev); in hda_sdw_check_wakeen_irq()
423 chip = get_chip_info(sdev->pdata); in hda_sdw_check_wakeen_irq()
425 return chip->check_sdw_wakeen_irq(sdev); in hda_sdw_check_wakeen_irq()
430 void hda_sdw_process_wakeen(struct snd_sof_dev *sdev) in hda_sdw_process_wakeen() argument
432 u32 interface_mask = hda_get_interface_mask(sdev); in hda_sdw_process_wakeen()
438 hdev = sdev->pdata->hw_pdata; in hda_sdw_process_wakeen()
446 static inline int hda_sdw_acpi_scan(struct snd_sof_dev *sdev) in hda_sdw_acpi_scan() argument
451 static inline int hda_sdw_probe(struct snd_sof_dev *sdev) in hda_sdw_probe() argument
456 static inline int hda_sdw_exit(struct snd_sof_dev *sdev) in hda_sdw_exit() argument
461 static inline bool hda_dsp_check_sdw_irq(struct snd_sof_dev *sdev) in hda_dsp_check_sdw_irq() argument
471 static inline bool hda_sdw_check_wakeen_irq(struct snd_sof_dev *sdev) in hda_sdw_check_wakeen_irq() argument
598 static void hda_dsp_get_state(struct snd_sof_dev *sdev, const char *level) in hda_dsp_get_state() argument
600 const struct sof_intel_dsp_desc *chip = get_chip_info(sdev->pdata); in hda_dsp_get_state()
604 fsr = snd_sof_dsp_read(sdev, HDA_DSP_BAR, chip->rom_status_reg); in hda_dsp_get_state()
623 dev_printk(level, sdev->dev, "%#010x: unknown ROM status value\n", fsr); in hda_dsp_get_state()
635 dev_printk(level, sdev->dev, in hda_dsp_get_state()
640 dev_printk(level, sdev->dev, "%#010x: module: %s, state: %s, %s\n", in hda_dsp_get_state()
645 error_code = snd_sof_dsp_read(sdev, HDA_DSP_BAR, chip->rom_status_reg + 4); in hda_dsp_get_state()
655 dev_printk(level, sdev->dev, "status code: %#x (%s)\n", error_code, in hda_dsp_get_state()
658 dev_printk(level, sdev->dev, "error code: %#x (%s)\n", error_code, in hda_dsp_get_state()
662 static void hda_dsp_get_registers(struct snd_sof_dev *sdev, in hda_dsp_get_registers() argument
667 u32 offset = sdev->dsp_oops_offset; in hda_dsp_get_registers()
670 sof_mailbox_read(sdev, offset, xoops, sizeof(*xoops)); in hda_dsp_get_registers()
676 dev_err(sdev->dev, "invalid header size 0x%x. FW oops is bogus\n", in hda_dsp_get_registers()
681 sof_block_read(sdev, sdev->mmio_bar, offset, in hda_dsp_get_registers()
686 sof_block_read(sdev, sdev->mmio_bar, offset, stack, in hda_dsp_get_registers()
691 static void hda_dsp_dump_ext_rom_status(struct snd_sof_dev *sdev, const char *level, in hda_dsp_dump_ext_rom_status() argument
700 chip = get_chip_info(sdev->pdata); in hda_dsp_dump_ext_rom_status()
702 value = snd_sof_dsp_read(sdev, HDA_DSP_BAR, chip->rom_status_reg + i * 0x4); in hda_dsp_dump_ext_rom_status()
706 dev_printk(level, sdev->dev, "extended rom status: %s", msg); in hda_dsp_dump_ext_rom_status()
710 void hda_dsp_dump(struct snd_sof_dev *sdev, u32 flags) in hda_dsp_dump() argument
718 hda_dsp_get_state(sdev, level); in hda_dsp_dump()
721 if (flags & SOF_DBG_DUMP_REGS && sdev->pdata->ipc_type == SOF_IPC) { in hda_dsp_dump()
722 u32 status = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_SRAM_REG_FW_STATUS); in hda_dsp_dump()
723 u32 panic = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_SRAM_REG_FW_TRACEP); in hda_dsp_dump()
725 hda_dsp_get_registers(sdev, &xoops, &panic_info, stack, in hda_dsp_dump()
727 sof_print_oops_and_stack(sdev, level, status, panic, &xoops, in hda_dsp_dump()
730 hda_dsp_dump_ext_rom_status(sdev, level, flags); in hda_dsp_dump()
734 static bool hda_check_ipc_irq(struct snd_sof_dev *sdev) in hda_check_ipc_irq() argument
738 chip = get_chip_info(sdev->pdata); in hda_check_ipc_irq()
740 return chip->check_ipc_irq(sdev); in hda_check_ipc_irq()
745 void hda_ipc_irq_dump(struct snd_sof_dev *sdev) in hda_ipc_irq_dump() argument
754 adspis = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPIS); in hda_ipc_irq_dump()
755 intsts = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTSTS); in hda_ipc_irq_dump()
756 intctl = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTCTL); in hda_ipc_irq_dump()
757 ppsts = snd_sof_dsp_read(sdev, HDA_DSP_PP_BAR, SOF_HDA_REG_PP_PPSTS); in hda_ipc_irq_dump()
758 rirbsts = snd_sof_dsp_read8(sdev, HDA_DSP_HDA_BAR, AZX_REG_RIRBSTS); in hda_ipc_irq_dump()
760 dev_err(sdev->dev, "hda irq intsts 0x%8.8x intlctl 0x%8.8x rirb %2.2x\n", in hda_ipc_irq_dump()
762 dev_err(sdev->dev, "dsp irq ppsts 0x%8.8x adspis 0x%8.8x\n", ppsts, adspis); in hda_ipc_irq_dump()
765 void hda_ipc_dump(struct snd_sof_dev *sdev) in hda_ipc_dump() argument
771 hda_ipc_irq_dump(sdev); in hda_ipc_dump()
774 hipcie = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCIE); in hda_ipc_dump()
775 hipct = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCT); in hda_ipc_dump()
776 hipcctl = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCCTL); in hda_ipc_dump()
780 dev_err(sdev->dev, "host status 0x%8.8x dsp status 0x%8.8x mask 0x%8.8x\n", in hda_ipc_dump()
784 void hda_ipc4_dump(struct snd_sof_dev *sdev) in hda_ipc4_dump() argument
788 hda_ipc_irq_dump(sdev); in hda_ipc4_dump()
790 hipci = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCI); in hda_ipc4_dump()
791 hipcie = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCIE); in hda_ipc4_dump()
792 hipct = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCT); in hda_ipc4_dump()
793 hipcte = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCTE); in hda_ipc4_dump()
794 hipcctl = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCCTL); in hda_ipc4_dump()
798 dev_err(sdev->dev, "Host IPC initiator: %#x|%#x, target: %#x|%#x, ctl: %#x\n", in hda_ipc4_dump()
802 bool hda_ipc4_tx_is_busy(struct snd_sof_dev *sdev) in hda_ipc4_tx_is_busy() argument
804 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in hda_ipc4_tx_is_busy()
808 val = snd_sof_dsp_read(sdev, HDA_DSP_BAR, chip->ipc_req); in hda_ipc4_tx_is_busy()
813 static int hda_init(struct snd_sof_dev *sdev) in hda_init() argument
817 struct pci_dev *pci = to_pci_dev(sdev->dev); in hda_init()
820 hbus = sof_to_hbus(sdev); in hda_init()
821 bus = sof_to_bus(sdev); in hda_init()
824 sof_hda_bus_init(sdev, &pci->dev); in hda_init()
847 sdev->bar[HDA_DSP_HDA_BAR] = bus->remap_addr; in hda_init()
850 ret = hda_codec_i915_init(sdev); in hda_init()
852 dev_warn(sdev->dev, "init of i915 and HDMI codec failed\n"); in hda_init()
855 ret = hda_dsp_ctrl_get_caps(sdev); in hda_init()
857 dev_err(sdev->dev, "error: get caps error\n"); in hda_init()
862 static int check_dmic_num(struct snd_sof_dev *sdev) in check_dmic_num() argument
864 struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata; in check_dmic_num()
870 dmic_num = intel_nhlt_get_dmic_geo(sdev->dev, nhlt); in check_dmic_num()
874 dev_dbg(sdev->dev, in check_dmic_num()
881 dev_dbg(sdev->dev, "invalid dmic_number %d\n", dmic_num); in check_dmic_num()
888 static int check_nhlt_ssp_mask(struct snd_sof_dev *sdev) in check_nhlt_ssp_mask() argument
890 struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata; in check_nhlt_ssp_mask()
901 dev_info(sdev->dev, "NHLT_DEVICE_I2S detected, ssp_mask %#x\n", ssp_mask); in check_nhlt_ssp_mask()
907 static int check_nhlt_ssp_mclk_mask(struct snd_sof_dev *sdev, int ssp_num) in check_nhlt_ssp_mclk_mask() argument
909 struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata; in check_nhlt_ssp_mclk_mask()
921 static const char *fixup_tplg_name(struct snd_sof_dev *sdev, in fixup_tplg_name() argument
938 tplg_filename = devm_kasprintf(sdev->dev, GFP_KERNEL, in fixup_tplg_name()
946 static int dmic_detect_topology_fixup(struct snd_sof_dev *sdev, in dmic_detect_topology_fixup() argument
956 dmic_num = check_dmic_num(sdev); in dmic_detect_topology_fixup()
981 fixed_tplg_filename = fixup_tplg_name(sdev, default_tplg_filename, in dmic_detect_topology_fixup()
988 dev_info(sdev->dev, "DMICs detected in NHLT tables: %d\n", dmic_num); in dmic_detect_topology_fixup()
995 static int hda_init_caps(struct snd_sof_dev *sdev) in hda_init_caps() argument
997 u32 interface_mask = hda_get_interface_mask(sdev); in hda_init_caps()
998 struct hdac_bus *bus = sof_to_bus(sdev); in hda_init_caps()
999 struct snd_sof_pdata *pdata = sdev->pdata; in hda_init_caps()
1006 dev_dbg(sdev->dev, "PP capability, will probe DSP later.\n"); in hda_init_caps()
1009 ret = hda_dsp_ctrl_init_chip(sdev); in hda_init_caps()
1023 ret = hda_sdw_acpi_scan(sdev); in hda_init_caps()
1025 dev_dbg(sdev->dev, "skipping SoundWire, not detected with ACPI scan\n"); in hda_init_caps()
1031 dev_dbg(sdev->dev, "skipping SoundWire, no links enabled\n"); in hda_init_caps()
1042 ret = hda_sdw_probe(sdev); in hda_init_caps()
1044 dev_err(sdev->dev, "error: SoundWire probe error\n"); in hda_init_caps()
1051 hda_codec_probe_bus(sdev); in hda_init_caps()
1054 hda_codec_i915_display_power(sdev, false); in hda_init_caps()
1063 struct snd_sof_dev *sdev = context; in hda_dsp_interrupt_handler() local
1069 if (snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTSTS) & in hda_dsp_interrupt_handler()
1073 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, in hda_dsp_interrupt_handler()
1086 struct snd_sof_dev *sdev = context; in hda_dsp_interrupt_thread() local
1087 struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata; in hda_dsp_interrupt_thread()
1090 if (hda_dsp_check_stream_irq(sdev)) { in hda_dsp_interrupt_thread()
1091 trace_sof_intel_hda_irq(sdev, "stream"); in hda_dsp_interrupt_thread()
1092 hda_dsp_stream_threaded_handler(irq, sdev); in hda_dsp_interrupt_thread()
1095 if (hda_check_ipc_irq(sdev)) { in hda_dsp_interrupt_thread()
1096 trace_sof_intel_hda_irq(sdev, "ipc"); in hda_dsp_interrupt_thread()
1097 sof_ops(sdev)->irq_thread(irq, sdev); in hda_dsp_interrupt_thread()
1100 if (hda_dsp_check_sdw_irq(sdev)) { in hda_dsp_interrupt_thread()
1101 trace_sof_intel_hda_irq(sdev, "sdw"); in hda_dsp_interrupt_thread()
1105 if (hda_sdw_check_wakeen_irq(sdev)) { in hda_dsp_interrupt_thread()
1106 trace_sof_intel_hda_irq(sdev, "wakeen"); in hda_dsp_interrupt_thread()
1107 hda_sdw_process_wakeen(sdev); in hda_dsp_interrupt_thread()
1110 hda_codec_check_for_state_change(sdev); in hda_dsp_interrupt_thread()
1113 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, in hda_dsp_interrupt_thread()
1121 int hda_dsp_probe(struct snd_sof_dev *sdev) in hda_dsp_probe() argument
1123 struct pci_dev *pci = to_pci_dev(sdev->dev); in hda_dsp_probe()
1129 if (!sdev->dspless_mode_selected) { in hda_dsp_probe()
1138 dev_err(sdev->dev, "the DSP is not enabled on this platform, aborting probe\n"); in hda_dsp_probe()
1141 dev_err(sdev->dev, "unknown PCI class/subclass/prog-if 0x%06x found, aborting probe\n", in hda_dsp_probe()
1145 dev_info(sdev->dev, "DSP detected with PCI class/subclass/prog-if 0x%06x\n", in hda_dsp_probe()
1149 chip = get_chip_info(sdev->pdata); in hda_dsp_probe()
1151 dev_err(sdev->dev, "error: no such device supported, chip id:%x\n", in hda_dsp_probe()
1157 sdev->num_cores = chip->cores_num; in hda_dsp_probe()
1159 hdev = devm_kzalloc(sdev->dev, sizeof(*hdev), GFP_KERNEL); in hda_dsp_probe()
1162 sdev->pdata->hw_pdata = hdev; in hda_dsp_probe()
1165 hdev->dmic_dev = platform_device_register_data(sdev->dev, "dmic-codec", in hda_dsp_probe()
1169 dev_err(sdev->dev, "error: failed to create DMIC device\n"); in hda_dsp_probe()
1180 hdev->no_ipc_position = sof_ops(sdev)->pcm_pointer ? 1 : 0; in hda_dsp_probe()
1183 if (sdev->dspless_mode_selected) in hda_dsp_probe()
1187 bus = sof_to_bus(sdev); in hda_dsp_probe()
1188 ret = hda_init(sdev); in hda_dsp_probe()
1192 if (sdev->dspless_mode_selected) in hda_dsp_probe()
1196 sdev->bar[HDA_DSP_BAR] = pci_ioremap_bar(pci, HDA_DSP_BAR); in hda_dsp_probe()
1197 if (!sdev->bar[HDA_DSP_BAR]) { in hda_dsp_probe()
1198 dev_err(sdev->dev, "error: ioremap error\n"); in hda_dsp_probe()
1203 sdev->mmio_bar = HDA_DSP_BAR; in hda_dsp_probe()
1204 sdev->mailbox_bar = HDA_DSP_BAR; in hda_dsp_probe()
1209 dev_dbg(sdev->dev, "DMA mask is 32 bit\n"); in hda_dsp_probe()
1215 ret = hda_dsp_stream_init(sdev); in hda_dsp_probe()
1217 dev_err(sdev->dev, "error: failed to init streams\n"); in hda_dsp_probe()
1232 dev_info(sdev->dev, "use msi interrupt mode\n"); in hda_dsp_probe()
1233 sdev->ipc_irq = pci_irq_vector(pci, 0); in hda_dsp_probe()
1235 sdev->msi_enabled = true; in hda_dsp_probe()
1238 if (!sdev->msi_enabled) { in hda_dsp_probe()
1239 dev_info(sdev->dev, "use legacy interrupt mode\n"); in hda_dsp_probe()
1244 sdev->ipc_irq = pci->irq; in hda_dsp_probe()
1247 dev_dbg(sdev->dev, "using IPC IRQ %d\n", sdev->ipc_irq); in hda_dsp_probe()
1248 ret = request_threaded_irq(sdev->ipc_irq, hda_dsp_interrupt_handler, in hda_dsp_probe()
1250 IRQF_SHARED, "AudioDSP", sdev); in hda_dsp_probe()
1252 dev_err(sdev->dev, "error: failed to register IPC IRQ %d\n", in hda_dsp_probe()
1253 sdev->ipc_irq); in hda_dsp_probe()
1264 snd_sof_pci_update_bits(sdev, PCI_TCSEL, 0x07, 0); in hda_dsp_probe()
1267 ret = hda_init_caps(sdev); in hda_dsp_probe()
1271 if (!sdev->dspless_mode_selected) { in hda_dsp_probe()
1273 hda_dsp_ctrl_ppcap_enable(sdev, true); in hda_dsp_probe()
1274 hda_dsp_ctrl_ppcap_int_enable(sdev, true); in hda_dsp_probe()
1277 sdev->dsp_box.offset = HDA_DSP_MBOX_UPLINK_OFFSET; in hda_dsp_probe()
1284 hdev->nhlt = intel_nhlt_init(sdev->dev); in hda_dsp_probe()
1289 free_irq(sdev->ipc_irq, sdev); in hda_dsp_probe()
1291 if (sdev->msi_enabled) in hda_dsp_probe()
1294 hda_dsp_stream_free(sdev); in hda_dsp_probe()
1296 if (!sdev->dspless_mode_selected) in hda_dsp_probe()
1297 iounmap(sdev->bar[HDA_DSP_BAR]); in hda_dsp_probe()
1301 hda_codec_i915_exit(sdev); in hda_dsp_probe()
1306 int hda_dsp_remove(struct snd_sof_dev *sdev) in hda_dsp_remove() argument
1308 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in hda_dsp_remove()
1310 struct hdac_bus *bus = sof_to_bus(sdev); in hda_dsp_remove()
1311 struct pci_dev *pci = to_pci_dev(sdev->dev); in hda_dsp_remove()
1317 if (!sdev->dspless_mode_selected) in hda_dsp_remove()
1321 hda_codec_device_remove(sdev); in hda_dsp_remove()
1323 hda_sdw_exit(sdev); in hda_dsp_remove()
1328 if (!sdev->dspless_mode_selected) { in hda_dsp_remove()
1330 snd_sof_dsp_update_bits(sdev, HDA_DSP_PP_BAR, SOF_HDA_REG_PP_PPCTL, in hda_dsp_remove()
1335 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTCTL, in hda_dsp_remove()
1338 if (sdev->dspless_mode_selected) in hda_dsp_remove()
1343 chip->power_down_dsp(sdev); in hda_dsp_remove()
1346 snd_sof_dsp_update_bits(sdev, HDA_DSP_PP_BAR, SOF_HDA_REG_PP_PPCTL, in hda_dsp_remove()
1350 free_irq(sdev->ipc_irq, sdev); in hda_dsp_remove()
1351 if (sdev->msi_enabled) in hda_dsp_remove()
1354 hda_dsp_stream_free(sdev); in hda_dsp_remove()
1356 hda_bus_ml_free(sof_to_bus(sdev)); in hda_dsp_remove()
1358 if (!sdev->dspless_mode_selected) in hda_dsp_remove()
1359 iounmap(sdev->bar[HDA_DSP_BAR]); in hda_dsp_remove()
1363 sof_hda_bus_exit(sdev); in hda_dsp_remove()
1365 hda_codec_i915_exit(sdev); in hda_dsp_remove()
1370 int hda_power_down_dsp(struct snd_sof_dev *sdev) in hda_power_down_dsp() argument
1372 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in hda_power_down_dsp()
1375 return hda_dsp_core_reset_power_down(sdev, chip->host_managed_cores_mask); in hda_power_down_dsp()
1379 static void hda_generic_machine_select(struct snd_sof_dev *sdev, in hda_generic_machine_select() argument
1382 struct hdac_bus *bus = sof_to_bus(sdev); in hda_generic_machine_select()
1385 struct snd_sof_pdata *pdata = sdev->pdata; in hda_generic_machine_select()
1433 ret = dmic_detect_topology_fixup(sdev, &tplg_filename, idisp_str, &dmic_num, in hda_generic_machine_select()
1454 struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata; in hda_generic_machine_select()
1471 static void hda_generic_machine_select(struct snd_sof_dev *sdev, in hda_generic_machine_select() argument
1479 static struct snd_soc_acpi_mach *hda_sdw_machine_select(struct snd_sof_dev *sdev) in hda_sdw_machine_select() argument
1481 struct snd_sof_pdata *pdata = sdev->pdata; in hda_sdw_machine_select()
1522 if (!snd_soc_acpi_sdw_link_slaves_found(sdev->dev, link, in hda_sdw_machine_select()
1538 mach->mach_params.platform = dev_name(sdev->dev); in hda_sdw_machine_select()
1557 ret = dmic_detect_topology_fixup(sdev, &tplg_filename, "", in hda_sdw_machine_select()
1566 dev_dbg(sdev->dev, in hda_sdw_machine_select()
1574 dev_info(sdev->dev, "No SoundWire machine driver found\n"); in hda_sdw_machine_select()
1580 static struct snd_soc_acpi_mach *hda_sdw_machine_select(struct snd_sof_dev *sdev) in hda_sdw_machine_select() argument
1587 struct snd_sof_dev *sdev) in hda_set_mach_params() argument
1589 struct snd_sof_pdata *pdata = sdev->pdata; in hda_set_mach_params()
1594 mach_params->platform = dev_name(sdev->dev); in hda_set_mach_params()
1603 struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev) in hda_machine_select() argument
1605 u32 interface_mask = hda_get_interface_mask(sdev); in hda_machine_select()
1606 struct snd_sof_pdata *sof_pdata = sdev->pdata; in hda_machine_select()
1629 mach->mach_params.dmic_num = check_dmic_num(sdev); in hda_machine_select()
1634 tplg_filename = devm_kasprintf(sdev->dev, GFP_KERNEL, in hda_machine_select()
1653 mach->mach_params.i2s_link_mask = check_nhlt_ssp_mask(sdev); in hda_machine_select()
1658 const struct sof_intel_dsp_desc *chip = get_chip_info(sdev->pdata); in hda_machine_select()
1664 dev_warn(sdev->dev, "More than one SSP exposed by NHLT, choosing MSB\n"); in hda_machine_select()
1670 dev_err(sdev->dev, "Invalid SSP %d, max on this platform is %d\n", in hda_machine_select()
1675 tplg_filename = devm_kasprintf(sdev->dev, GFP_KERNEL, in hda_machine_select()
1686 mclk_mask = check_nhlt_ssp_mclk_mask(sdev, ssp_num); in hda_machine_select()
1689 dev_err(sdev->dev, "Invalid MCLK configuration\n"); in hda_machine_select()
1693 dev_dbg(sdev->dev, "MCLK mask %#x found in NHLT\n", mclk_mask); in hda_machine_select()
1696 dev_info(sdev->dev, "Overriding topology with MCLK mask %#x from NHLT\n", mclk_mask); in hda_machine_select()
1697 sdev->mclk_id_override = true; in hda_machine_select()
1698 sdev->mclk_id_quirk = (mclk_mask & BIT(0)) ? 0 : 1; in hda_machine_select()
1703 tplg_filename = devm_kasprintf(sdev->dev, GFP_KERNEL, in hda_machine_select()
1715 … dev_info(sdev->dev, "Overriding topology with MCLK %d from kernel_parameter\n", mclk_id_override); in hda_machine_select()
1716 sdev->mclk_id_override = true; in hda_machine_select()
1717 sdev->mclk_id_quirk = mclk_id_override; in hda_machine_select()
1723 mach = hda_sdw_machine_select(sdev); in hda_machine_select()
1729 hda_generic_machine_select(sdev, &mach); in hda_machine_select()
1731 dev_warn(sdev->dev, "warning: No matching ASoC machine driver found\n"); in hda_machine_select()
1750 int hda_register_clients(struct snd_sof_dev *sdev) in hda_register_clients() argument
1752 return hda_probes_register(sdev); in hda_register_clients()
1755 void hda_unregister_clients(struct snd_sof_dev *sdev) in hda_unregister_clients() argument
1757 hda_probes_unregister(sdev); in hda_unregister_clients()