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_sdw_int_enable(struct snd_sof_dev *sdev, bool enable) in hda_sdw_int_enable() argument
160 sdw_intel_enable_irq(sdev->bar[HDA_DSP_BAR], enable); in hda_sdw_int_enable()
163 static int hda_sdw_acpi_scan(struct snd_sof_dev *sdev) in hda_sdw_acpi_scan() argument
169 handle = ACPI_HANDLE(sdev->dev); in hda_sdw_acpi_scan()
172 hdev = sdev->pdata->hw_pdata; in hda_sdw_acpi_scan()
181 static int hda_sdw_probe(struct snd_sof_dev *sdev) in hda_sdw_probe() argument
187 hdev = sdev->pdata->hw_pdata; in hda_sdw_probe()
191 res.mmio_base = sdev->bar[HDA_DSP_BAR]; in hda_sdw_probe()
194 res.irq = sdev->ipc_irq; in hda_sdw_probe()
196 res.parent = sdev->dev; in hda_sdw_probe()
198 res.dev = sdev->dev; in hda_sdw_probe()
213 dev_err(sdev->dev, "error: SoundWire probe failed\n"); in hda_sdw_probe()
223 int hda_sdw_startup(struct snd_sof_dev *sdev) in hda_sdw_startup() argument
226 struct snd_sof_pdata *pdata = sdev->pdata; in hda_sdw_startup()
228 hdev = sdev->pdata->hw_pdata; in hda_sdw_startup()
239 static int hda_sdw_exit(struct snd_sof_dev *sdev) in hda_sdw_exit() argument
243 hdev = sdev->pdata->hw_pdata; in hda_sdw_exit()
245 hda_sdw_int_enable(sdev, false); in hda_sdw_exit()
254 bool hda_common_check_sdw_irq(struct snd_sof_dev *sdev) in hda_common_check_sdw_irq() argument
260 hdev = sdev->pdata->hw_pdata; in hda_common_check_sdw_irq()
266 irq_status = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPIS2); in hda_common_check_sdw_irq()
280 static bool hda_dsp_check_sdw_irq(struct snd_sof_dev *sdev) in hda_dsp_check_sdw_irq() argument
284 chip = get_chip_info(sdev->pdata); in hda_dsp_check_sdw_irq()
286 return chip->check_sdw_irq(sdev); in hda_dsp_check_sdw_irq()
296 static bool hda_sdw_check_wakeen_irq(struct snd_sof_dev *sdev) in hda_sdw_check_wakeen_irq() argument
300 hdev = sdev->pdata->hw_pdata; in hda_sdw_check_wakeen_irq()
302 snd_sof_dsp_read(sdev, HDA_DSP_BAR, in hda_sdw_check_wakeen_irq()
309 void hda_sdw_process_wakeen(struct snd_sof_dev *sdev) in hda_sdw_process_wakeen() argument
313 hdev = sdev->pdata->hw_pdata; in hda_sdw_process_wakeen()
321 static inline int hda_sdw_acpi_scan(struct snd_sof_dev *sdev) in hda_sdw_acpi_scan() argument
326 static inline int hda_sdw_probe(struct snd_sof_dev *sdev) in hda_sdw_probe() argument
331 static inline int hda_sdw_exit(struct snd_sof_dev *sdev) in hda_sdw_exit() argument
336 static inline bool hda_dsp_check_sdw_irq(struct snd_sof_dev *sdev) in hda_dsp_check_sdw_irq() argument
346 static inline bool hda_sdw_check_wakeen_irq(struct snd_sof_dev *sdev) in hda_sdw_check_wakeen_irq() argument
479 static void hda_dsp_get_state(struct snd_sof_dev *sdev, const char *level) in hda_dsp_get_state() argument
481 const struct sof_intel_dsp_desc *chip = get_chip_info(sdev->pdata); in hda_dsp_get_state()
485 fsr = snd_sof_dsp_read(sdev, HDA_DSP_BAR, chip->rom_status_reg); in hda_dsp_get_state()
504 dev_printk(level, sdev->dev, "%#010x: unknown ROM status value\n", fsr); in hda_dsp_get_state()
516 dev_printk(level, sdev->dev, in hda_dsp_get_state()
521 dev_printk(level, sdev->dev, "%#010x: module: %s, state: %s, %s\n", in hda_dsp_get_state()
526 error_code = snd_sof_dsp_read(sdev, HDA_DSP_BAR, chip->rom_status_reg + 4); in hda_dsp_get_state()
536 dev_printk(level, sdev->dev, "status code: %#x (%s)\n", error_code, in hda_dsp_get_state()
539 dev_printk(level, sdev->dev, "error code: %#x (%s)\n", error_code, in hda_dsp_get_state()
543 static void hda_dsp_get_registers(struct snd_sof_dev *sdev, in hda_dsp_get_registers() argument
548 u32 offset = sdev->dsp_oops_offset; in hda_dsp_get_registers()
551 sof_mailbox_read(sdev, offset, xoops, sizeof(*xoops)); in hda_dsp_get_registers()
557 dev_err(sdev->dev, "invalid header size 0x%x. FW oops is bogus\n", in hda_dsp_get_registers()
562 sof_block_read(sdev, sdev->mmio_bar, offset, in hda_dsp_get_registers()
567 sof_block_read(sdev, sdev->mmio_bar, offset, stack, in hda_dsp_get_registers()
572 static void hda_dsp_dump_ext_rom_status(struct snd_sof_dev *sdev, const char *level, in hda_dsp_dump_ext_rom_status() argument
581 chip = get_chip_info(sdev->pdata); in hda_dsp_dump_ext_rom_status()
583 value = snd_sof_dsp_read(sdev, HDA_DSP_BAR, chip->rom_status_reg + i * 0x4); in hda_dsp_dump_ext_rom_status()
587 dev_printk(level, sdev->dev, "extended rom status: %s", msg); in hda_dsp_dump_ext_rom_status()
591 void hda_dsp_dump(struct snd_sof_dev *sdev, u32 flags) in hda_dsp_dump() argument
599 hda_dsp_get_state(sdev, level); in hda_dsp_dump()
602 if (flags & SOF_DBG_DUMP_REGS && sdev->pdata->ipc_type == SOF_IPC) { in hda_dsp_dump()
603 u32 status = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_SRAM_REG_FW_STATUS); in hda_dsp_dump()
604 u32 panic = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_SRAM_REG_FW_TRACEP); in hda_dsp_dump()
606 hda_dsp_get_registers(sdev, &xoops, &panic_info, stack, in hda_dsp_dump()
608 sof_print_oops_and_stack(sdev, level, status, panic, &xoops, in hda_dsp_dump()
611 hda_dsp_dump_ext_rom_status(sdev, level, flags); in hda_dsp_dump()
615 static bool hda_check_ipc_irq(struct snd_sof_dev *sdev) in hda_check_ipc_irq() argument
619 chip = get_chip_info(sdev->pdata); in hda_check_ipc_irq()
621 return chip->check_ipc_irq(sdev); in hda_check_ipc_irq()
626 void hda_ipc_irq_dump(struct snd_sof_dev *sdev) in hda_ipc_irq_dump() argument
628 struct hdac_bus *bus = sof_to_bus(sdev); in hda_ipc_irq_dump()
636 adspis = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPIS); in hda_ipc_irq_dump()
637 intsts = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTSTS); in hda_ipc_irq_dump()
638 intctl = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTCTL); in hda_ipc_irq_dump()
639 ppsts = snd_sof_dsp_read(sdev, HDA_DSP_PP_BAR, SOF_HDA_REG_PP_PPSTS); in hda_ipc_irq_dump()
642 dev_err(sdev->dev, "hda irq intsts 0x%8.8x intlctl 0x%8.8x rirb %2.2x\n", in hda_ipc_irq_dump()
644 dev_err(sdev->dev, "dsp irq ppsts 0x%8.8x adspis 0x%8.8x\n", ppsts, adspis); in hda_ipc_irq_dump()
647 void hda_ipc_dump(struct snd_sof_dev *sdev) in hda_ipc_dump() argument
653 hda_ipc_irq_dump(sdev); in hda_ipc_dump()
656 hipcie = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCIE); in hda_ipc_dump()
657 hipct = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCT); in hda_ipc_dump()
658 hipcctl = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCCTL); in hda_ipc_dump()
662 dev_err(sdev->dev, "host status 0x%8.8x dsp status 0x%8.8x mask 0x%8.8x\n", in hda_ipc_dump()
666 void hda_ipc4_dump(struct snd_sof_dev *sdev) in hda_ipc4_dump() argument
670 hda_ipc_irq_dump(sdev); in hda_ipc4_dump()
672 hipci = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCI); in hda_ipc4_dump()
673 hipcie = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCIE); in hda_ipc4_dump()
674 hipct = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCT); in hda_ipc4_dump()
675 hipcte = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCTE); in hda_ipc4_dump()
676 hipcctl = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCCTL); in hda_ipc4_dump()
680 dev_err(sdev->dev, "Host IPC initiator: %#x|%#x, target: %#x|%#x, ctl: %#x\n", in hda_ipc4_dump()
684 static int hda_init(struct snd_sof_dev *sdev) in hda_init() argument
688 struct pci_dev *pci = to_pci_dev(sdev->dev); in hda_init()
691 hbus = sof_to_hbus(sdev); in hda_init()
692 bus = sof_to_bus(sdev); in hda_init()
718 sdev->bar[HDA_DSP_HDA_BAR] = bus->remap_addr; in hda_init()
721 ret = hda_codec_i915_init(sdev); in hda_init()
723 dev_warn(sdev->dev, "init of i915 and HDMI codec failed\n"); in hda_init()
726 ret = hda_dsp_ctrl_get_caps(sdev); in hda_init()
728 dev_err(sdev->dev, "error: get caps error\n"); in hda_init()
733 static int check_dmic_num(struct snd_sof_dev *sdev) in check_dmic_num() argument
735 struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata; in check_dmic_num()
741 dmic_num = intel_nhlt_get_dmic_geo(sdev->dev, nhlt); in check_dmic_num()
745 dev_dbg(sdev->dev, in check_dmic_num()
752 dev_dbg(sdev->dev, "invalid dmic_number %d\n", dmic_num); in check_dmic_num()
759 static int check_nhlt_ssp_mask(struct snd_sof_dev *sdev) in check_nhlt_ssp_mask() argument
761 struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata; in check_nhlt_ssp_mask()
772 dev_info(sdev->dev, "NHLT_DEVICE_I2S detected, ssp_mask %#x\n", ssp_mask); in check_nhlt_ssp_mask()
778 static int check_nhlt_ssp_mclk_mask(struct snd_sof_dev *sdev, int ssp_num) in check_nhlt_ssp_mclk_mask() argument
780 struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata; in check_nhlt_ssp_mclk_mask()
792 static const char *fixup_tplg_name(struct snd_sof_dev *sdev, in fixup_tplg_name() argument
809 tplg_filename = devm_kasprintf(sdev->dev, GFP_KERNEL, in fixup_tplg_name()
817 static int dmic_detect_topology_fixup(struct snd_sof_dev *sdev, in dmic_detect_topology_fixup() argument
827 dmic_num = check_dmic_num(sdev); in dmic_detect_topology_fixup()
852 fixed_tplg_filename = fixup_tplg_name(sdev, default_tplg_filename, in dmic_detect_topology_fixup()
859 dev_info(sdev->dev, "DMICs detected in NHLT tables: %d\n", dmic_num); in dmic_detect_topology_fixup()
866 static int hda_init_caps(struct snd_sof_dev *sdev) in hda_init_caps() argument
868 struct hdac_bus *bus = sof_to_bus(sdev); in hda_init_caps()
869 struct snd_sof_pdata *pdata = sdev->pdata; in hda_init_caps()
879 dev_dbg(sdev->dev, "PP capability, will probe DSP later.\n"); in hda_init_caps()
882 ret = hda_dsp_ctrl_init_chip(sdev, true); in hda_init_caps()
890 ret = hda_sdw_acpi_scan(sdev); in hda_init_caps()
892 dev_dbg(sdev->dev, "skipping SoundWire, not detected with ACPI scan\n"); in hda_init_caps()
898 dev_dbg(sdev->dev, "skipping SoundWire, no links enabled\n"); in hda_init_caps()
909 ret = hda_sdw_probe(sdev); in hda_init_caps()
911 dev_err(sdev->dev, "error: SoundWire probe error\n"); in hda_init_caps()
922 hda_codec_probe_bus(sdev, hda_codec_use_common_hdmi); in hda_init_caps()
925 hda_codec_i915_display_power(sdev, false); in hda_init_caps()
936 static void hda_check_for_state_change(struct snd_sof_dev *sdev) in hda_check_for_state_change() argument
939 struct hdac_bus *bus = sof_to_bus(sdev); in hda_check_for_state_change()
944 hda_codec_jack_check(sdev); in hda_check_for_state_change()
952 struct snd_sof_dev *sdev = context; in hda_dsp_interrupt_handler() local
958 if (snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTSTS) & in hda_dsp_interrupt_handler()
962 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, in hda_dsp_interrupt_handler()
975 struct snd_sof_dev *sdev = context; in hda_dsp_interrupt_thread() local
976 struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata; in hda_dsp_interrupt_thread()
979 if (hda_dsp_check_stream_irq(sdev)) { in hda_dsp_interrupt_thread()
980 trace_sof_intel_hda_irq(sdev, "stream"); in hda_dsp_interrupt_thread()
981 hda_dsp_stream_threaded_handler(irq, sdev); in hda_dsp_interrupt_thread()
984 if (hda_check_ipc_irq(sdev)) { in hda_dsp_interrupt_thread()
985 trace_sof_intel_hda_irq(sdev, "ipc"); in hda_dsp_interrupt_thread()
986 sof_ops(sdev)->irq_thread(irq, sdev); in hda_dsp_interrupt_thread()
989 if (hda_dsp_check_sdw_irq(sdev)) { in hda_dsp_interrupt_thread()
990 trace_sof_intel_hda_irq(sdev, "sdw"); in hda_dsp_interrupt_thread()
994 if (hda_sdw_check_wakeen_irq(sdev)) { in hda_dsp_interrupt_thread()
995 trace_sof_intel_hda_irq(sdev, "wakeen"); in hda_dsp_interrupt_thread()
996 hda_sdw_process_wakeen(sdev); in hda_dsp_interrupt_thread()
999 hda_check_for_state_change(sdev); in hda_dsp_interrupt_thread()
1002 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, in hda_dsp_interrupt_thread()
1010 int hda_dsp_probe(struct snd_sof_dev *sdev) in hda_dsp_probe() argument
1012 struct pci_dev *pci = to_pci_dev(sdev->dev); in hda_dsp_probe()
1026 dev_err(sdev->dev, "error: the DSP is not enabled on this platform, aborting probe\n"); in hda_dsp_probe()
1029 …dev_err(sdev->dev, "error: unknown PCI class/subclass/prog-if 0x%06x found, aborting probe\n", pci… in hda_dsp_probe()
1032 dev_info(sdev->dev, "DSP detected with PCI class/subclass/prog-if 0x%06x\n", pci->class); in hda_dsp_probe()
1034 chip = get_chip_info(sdev->pdata); in hda_dsp_probe()
1036 dev_err(sdev->dev, "error: no such device supported, chip id:%x\n", in hda_dsp_probe()
1042 sdev->num_cores = chip->cores_num; in hda_dsp_probe()
1044 hdev = devm_kzalloc(sdev->dev, sizeof(*hdev), GFP_KERNEL); in hda_dsp_probe()
1047 sdev->pdata->hw_pdata = hdev; in hda_dsp_probe()
1050 hdev->dmic_dev = platform_device_register_data(sdev->dev, "dmic-codec", in hda_dsp_probe()
1054 dev_err(sdev->dev, "error: failed to create DMIC device\n"); in hda_dsp_probe()
1065 hdev->no_ipc_position = sof_ops(sdev)->pcm_pointer ? 1 : 0; in hda_dsp_probe()
1069 bus = sof_to_bus(sdev); in hda_dsp_probe()
1070 ret = hda_init(sdev); in hda_dsp_probe()
1075 sdev->bar[HDA_DSP_BAR] = pci_ioremap_bar(pci, HDA_DSP_BAR); in hda_dsp_probe()
1076 if (!sdev->bar[HDA_DSP_BAR]) { in hda_dsp_probe()
1077 dev_err(sdev->dev, "error: ioremap error\n"); in hda_dsp_probe()
1082 sdev->mmio_bar = HDA_DSP_BAR; in hda_dsp_probe()
1083 sdev->mailbox_bar = HDA_DSP_BAR; in hda_dsp_probe()
1087 dev_dbg(sdev->dev, "DMA mask is 32 bit\n"); in hda_dsp_probe()
1093 ret = hda_dsp_stream_init(sdev); in hda_dsp_probe()
1095 dev_err(sdev->dev, "error: failed to init streams\n"); in hda_dsp_probe()
1110 dev_info(sdev->dev, "use msi interrupt mode\n"); in hda_dsp_probe()
1111 sdev->ipc_irq = pci_irq_vector(pci, 0); in hda_dsp_probe()
1113 sdev->msi_enabled = true; in hda_dsp_probe()
1116 if (!sdev->msi_enabled) { in hda_dsp_probe()
1117 dev_info(sdev->dev, "use legacy interrupt mode\n"); in hda_dsp_probe()
1122 sdev->ipc_irq = pci->irq; in hda_dsp_probe()
1125 dev_dbg(sdev->dev, "using IPC IRQ %d\n", sdev->ipc_irq); in hda_dsp_probe()
1126 ret = request_threaded_irq(sdev->ipc_irq, hda_dsp_interrupt_handler, in hda_dsp_probe()
1128 IRQF_SHARED, "AudioDSP", sdev); in hda_dsp_probe()
1130 dev_err(sdev->dev, "error: failed to register IPC IRQ %d\n", in hda_dsp_probe()
1131 sdev->ipc_irq); in hda_dsp_probe()
1142 snd_sof_pci_update_bits(sdev, PCI_TCSEL, 0x07, 0); in hda_dsp_probe()
1145 ret = hda_init_caps(sdev); in hda_dsp_probe()
1150 hda_dsp_ctrl_ppcap_enable(sdev, true); in hda_dsp_probe()
1151 hda_dsp_ctrl_ppcap_int_enable(sdev, true); in hda_dsp_probe()
1154 sdev->dsp_box.offset = HDA_DSP_MBOX_UPLINK_OFFSET; in hda_dsp_probe()
1160 hdev->nhlt = intel_nhlt_init(sdev->dev); in hda_dsp_probe()
1165 free_irq(sdev->ipc_irq, sdev); in hda_dsp_probe()
1167 if (sdev->msi_enabled) in hda_dsp_probe()
1170 hda_dsp_stream_free(sdev); in hda_dsp_probe()
1172 iounmap(sdev->bar[HDA_DSP_BAR]); in hda_dsp_probe()
1176 hda_codec_i915_exit(sdev); in hda_dsp_probe()
1181 int hda_dsp_remove(struct snd_sof_dev *sdev) in hda_dsp_remove() argument
1183 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in hda_dsp_remove()
1185 struct hdac_bus *bus = sof_to_bus(sdev); in hda_dsp_remove()
1186 struct pci_dev *pci = to_pci_dev(sdev->dev); in hda_dsp_remove()
1200 hda_sdw_exit(sdev); in hda_dsp_remove()
1206 snd_sof_dsp_update_bits(sdev, HDA_DSP_PP_BAR, SOF_HDA_REG_PP_PPCTL, in hda_dsp_remove()
1210 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTCTL, in hda_dsp_remove()
1215 chip->power_down_dsp(sdev); in hda_dsp_remove()
1218 snd_sof_dsp_update_bits(sdev, HDA_DSP_PP_BAR, SOF_HDA_REG_PP_PPCTL, in hda_dsp_remove()
1221 free_irq(sdev->ipc_irq, sdev); in hda_dsp_remove()
1222 if (sdev->msi_enabled) in hda_dsp_remove()
1225 hda_dsp_stream_free(sdev); in hda_dsp_remove()
1230 iounmap(sdev->bar[HDA_DSP_BAR]); in hda_dsp_remove()
1236 hda_codec_i915_exit(sdev); in hda_dsp_remove()
1241 int hda_power_down_dsp(struct snd_sof_dev *sdev) in hda_power_down_dsp() argument
1243 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in hda_power_down_dsp()
1246 return hda_dsp_core_reset_power_down(sdev, chip->host_managed_cores_mask); in hda_power_down_dsp()
1250 static void hda_generic_machine_select(struct snd_sof_dev *sdev, in hda_generic_machine_select() argument
1253 struct hdac_bus *bus = sof_to_bus(sdev); in hda_generic_machine_select()
1256 struct snd_sof_pdata *pdata = sdev->pdata; in hda_generic_machine_select()
1304 ret = dmic_detect_topology_fixup(sdev, &tplg_filename, idisp_str, &dmic_num, in hda_generic_machine_select()
1332 static void hda_generic_machine_select(struct snd_sof_dev *sdev, in hda_generic_machine_select() argument
1344 static bool link_slaves_found(struct snd_sof_dev *sdev, in link_slaves_found() argument
1348 struct hdac_bus *bus = sof_to_bus(sdev); in link_slaves_found()
1417 static struct snd_soc_acpi_mach *hda_sdw_machine_select(struct snd_sof_dev *sdev) in hda_sdw_machine_select() argument
1419 struct snd_sof_pdata *pdata = sdev->pdata; in hda_sdw_machine_select()
1460 if (!link_slaves_found(sdev, link, hdev->sdw)) in hda_sdw_machine_select()
1474 mach->mach_params.platform = dev_name(sdev->dev); in hda_sdw_machine_select()
1493 ret = dmic_detect_topology_fixup(sdev, &tplg_filename, "", in hda_sdw_machine_select()
1502 dev_dbg(sdev->dev, in hda_sdw_machine_select()
1510 dev_info(sdev->dev, "No SoundWire machine driver found\n"); in hda_sdw_machine_select()
1516 static struct snd_soc_acpi_mach *hda_sdw_machine_select(struct snd_sof_dev *sdev) in hda_sdw_machine_select() argument
1523 struct snd_sof_dev *sdev) in hda_set_mach_params() argument
1525 struct snd_sof_pdata *pdata = sdev->pdata; in hda_set_mach_params()
1530 mach_params->platform = dev_name(sdev->dev); in hda_set_mach_params()
1535 struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev) in hda_machine_select() argument
1537 struct snd_sof_pdata *sof_pdata = sdev->pdata; in hda_machine_select()
1557 mach->mach_params.dmic_num = check_dmic_num(sdev); in hda_machine_select()
1562 tplg_filename = devm_kasprintf(sdev->dev, GFP_KERNEL, in hda_machine_select()
1581 mach->mach_params.i2s_link_mask = check_nhlt_ssp_mask(sdev); in hda_machine_select()
1586 const struct sof_intel_dsp_desc *chip = get_chip_info(sdev->pdata); in hda_machine_select()
1592 dev_warn(sdev->dev, "More than one SSP exposed by NHLT, choosing MSB\n"); in hda_machine_select()
1598 dev_err(sdev->dev, "Invalid SSP %d, max on this platform is %d\n", in hda_machine_select()
1603 tplg_filename = devm_kasprintf(sdev->dev, GFP_KERNEL, in hda_machine_select()
1614 mclk_mask = check_nhlt_ssp_mclk_mask(sdev, ssp_num); in hda_machine_select()
1617 dev_err(sdev->dev, "Invalid MCLK configuration\n"); in hda_machine_select()
1621 dev_dbg(sdev->dev, "MCLK mask %#x found in NHLT\n", mclk_mask); in hda_machine_select()
1624 dev_info(sdev->dev, "Overriding topology with MCLK mask %#x from NHLT\n", mclk_mask); in hda_machine_select()
1625 sdev->mclk_id_override = true; in hda_machine_select()
1626 sdev->mclk_id_quirk = (mclk_mask & BIT(0)) ? 0 : 1; in hda_machine_select()
1631 tplg_filename = devm_kasprintf(sdev->dev, GFP_KERNEL, in hda_machine_select()
1643 … dev_info(sdev->dev, "Overriding topology with MCLK %d from kernel_parameter\n", mclk_id_override); in hda_machine_select()
1644 sdev->mclk_id_override = true; in hda_machine_select()
1645 sdev->mclk_id_quirk = mclk_id_override; in hda_machine_select()
1653 mach = hda_sdw_machine_select(sdev); in hda_machine_select()
1659 hda_generic_machine_select(sdev, &mach); in hda_machine_select()
1661 dev_warn(sdev->dev, "warning: No matching ASoC machine driver found\n"); in hda_machine_select()
1680 int hda_register_clients(struct snd_sof_dev *sdev) in hda_register_clients() argument
1682 return hda_probes_register(sdev); in hda_register_clients()
1685 void hda_unregister_clients(struct snd_sof_dev *sdev) in hda_unregister_clients() argument
1687 hda_probes_unregister(sdev); in hda_unregister_clients()