• Home
  • Raw
  • Download

Lines Matching refs:sdev

68 	struct snd_sof_dev *sdev = dev_get_drvdata(dev);  in sdw_params_stream()  local
85 ret = sof_ipc_tx_message(sdev->ipc, in sdw_params_stream()
89 dev_err(sdev->dev, in sdw_params_stream()
100 struct snd_sof_dev *sdev = dev_get_drvdata(dev); in sdw_free_stream() local
116 ret = sof_ipc_tx_message(sdev->ipc, in sdw_free_stream()
120 dev_err(sdev->dev, in sdw_free_stream()
133 void hda_sdw_int_enable(struct snd_sof_dev *sdev, bool enable) in hda_sdw_int_enable() argument
135 sdw_intel_enable_irq(sdev->bar[HDA_DSP_BAR], enable); in hda_sdw_int_enable()
138 static int hda_sdw_acpi_scan(struct snd_sof_dev *sdev) in hda_sdw_acpi_scan() argument
144 handle = ACPI_HANDLE(sdev->dev); in hda_sdw_acpi_scan()
147 hdev = sdev->pdata->hw_pdata; in hda_sdw_acpi_scan()
156 static int hda_sdw_probe(struct snd_sof_dev *sdev) in hda_sdw_probe() argument
162 hdev = sdev->pdata->hw_pdata; in hda_sdw_probe()
166 res.mmio_base = sdev->bar[HDA_DSP_BAR]; in hda_sdw_probe()
167 res.irq = sdev->ipc_irq; in hda_sdw_probe()
169 res.parent = sdev->dev; in hda_sdw_probe()
171 res.dev = sdev->dev; in hda_sdw_probe()
186 dev_err(sdev->dev, "error: SoundWire probe failed\n"); in hda_sdw_probe()
196 int hda_sdw_startup(struct snd_sof_dev *sdev) in hda_sdw_startup() argument
200 hdev = sdev->pdata->hw_pdata; in hda_sdw_startup()
208 static int hda_sdw_exit(struct snd_sof_dev *sdev) in hda_sdw_exit() argument
212 hdev = sdev->pdata->hw_pdata; in hda_sdw_exit()
214 hda_sdw_int_enable(sdev, false); in hda_sdw_exit()
223 static bool hda_dsp_check_sdw_irq(struct snd_sof_dev *sdev) in hda_dsp_check_sdw_irq() argument
229 hdev = sdev->pdata->hw_pdata; in hda_dsp_check_sdw_irq()
235 irq_status = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPIS2); in hda_dsp_check_sdw_irq()
254 static bool hda_sdw_check_wakeen_irq(struct snd_sof_dev *sdev) in hda_sdw_check_wakeen_irq() argument
258 hdev = sdev->pdata->hw_pdata; in hda_sdw_check_wakeen_irq()
260 snd_sof_dsp_read(sdev, HDA_DSP_BAR, in hda_sdw_check_wakeen_irq()
267 void hda_sdw_process_wakeen(struct snd_sof_dev *sdev) in hda_sdw_process_wakeen() argument
271 hdev = sdev->pdata->hw_pdata; in hda_sdw_process_wakeen()
331 static void hda_dsp_get_status_skl(struct snd_sof_dev *sdev) in hda_dsp_get_status_skl() argument
336 status = snd_sof_dsp_read(sdev, HDA_DSP_BAR, in hda_dsp_get_status_skl()
341 dev_err(sdev->dev, "%s - code %8.8x\n", in hda_dsp_get_status_skl()
348 dev_dbg(sdev->dev, "unknown ROM status value %8.8x\n", status); in hda_dsp_get_status_skl()
351 static void hda_dsp_get_status(struct snd_sof_dev *sdev) in hda_dsp_get_status() argument
356 status = snd_sof_dsp_read(sdev, HDA_DSP_BAR, in hda_dsp_get_status()
361 dev_err(sdev->dev, "%s - code %8.8x\n", in hda_dsp_get_status()
368 dev_dbg(sdev->dev, "unknown ROM status value %8.8x\n", status); in hda_dsp_get_status()
371 static void hda_dsp_get_registers(struct snd_sof_dev *sdev, in hda_dsp_get_registers() argument
376 u32 offset = sdev->dsp_oops_offset; in hda_dsp_get_registers()
379 sof_mailbox_read(sdev, offset, xoops, sizeof(*xoops)); in hda_dsp_get_registers()
385 dev_err(sdev->dev, "invalid header size 0x%x. FW oops is bogus\n", in hda_dsp_get_registers()
390 sof_block_read(sdev, sdev->mmio_bar, offset, in hda_dsp_get_registers()
395 sof_block_read(sdev, sdev->mmio_bar, offset, stack, in hda_dsp_get_registers()
399 void hda_dsp_dump_skl(struct snd_sof_dev *sdev, u32 flags) in hda_dsp_dump_skl() argument
407 hda_dsp_get_status_skl(sdev); in hda_dsp_dump_skl()
410 status = snd_sof_dsp_read(sdev, HDA_DSP_BAR, in hda_dsp_dump_skl()
414 panic = snd_sof_dsp_read(sdev, HDA_DSP_BAR, in hda_dsp_dump_skl()
417 if (sdev->fw_state == SOF_FW_BOOT_COMPLETE) { in hda_dsp_dump_skl()
418 hda_dsp_get_registers(sdev, &xoops, &panic_info, stack, in hda_dsp_dump_skl()
420 snd_sof_get_status(sdev, status, panic, &xoops, &panic_info, in hda_dsp_dump_skl()
423 dev_err(sdev->dev, "error: status = 0x%8.8x panic = 0x%8.8x\n", in hda_dsp_dump_skl()
425 hda_dsp_get_status_skl(sdev); in hda_dsp_dump_skl()
430 static void hda_dsp_dump_ext_rom_status(struct snd_sof_dev *sdev) in hda_dsp_dump_ext_rom_status() argument
432 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in hda_dsp_dump_ext_rom_status()
439 value = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_SRAM_REG_ROM_STATUS + i * 0x4); in hda_dsp_dump_ext_rom_status()
443 sof_dev_dbg_or_err(sdev->dev, hda->boot_iteration == HDA_FW_BOOT_ATTEMPTS, in hda_dsp_dump_ext_rom_status()
448 void hda_dsp_dump(struct snd_sof_dev *sdev, u32 flags) in hda_dsp_dump() argument
450 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in hda_dsp_dump()
457 hda_dsp_get_status(sdev); in hda_dsp_dump()
460 status = snd_sof_dsp_read(sdev, HDA_DSP_BAR, in hda_dsp_dump()
462 panic = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_SRAM_REG_FW_TRACEP); in hda_dsp_dump()
464 if (sdev->fw_state == SOF_FW_BOOT_COMPLETE) { in hda_dsp_dump()
465 hda_dsp_get_registers(sdev, &xoops, &panic_info, stack, in hda_dsp_dump()
467 snd_sof_get_status(sdev, status, panic, &xoops, &panic_info, in hda_dsp_dump()
470 sof_dev_dbg_or_err(sdev->dev, hda->boot_iteration == HDA_FW_BOOT_ATTEMPTS, in hda_dsp_dump()
474 hda_dsp_dump_ext_rom_status(sdev); in hda_dsp_dump()
475 hda_dsp_get_status(sdev); in hda_dsp_dump()
479 void hda_ipc_irq_dump(struct snd_sof_dev *sdev) in hda_ipc_irq_dump() argument
481 struct hdac_bus *bus = sof_to_bus(sdev); in hda_ipc_irq_dump()
489 adspis = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPIS); in hda_ipc_irq_dump()
490 intsts = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTSTS); in hda_ipc_irq_dump()
491 intctl = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTCTL); in hda_ipc_irq_dump()
492 ppsts = snd_sof_dsp_read(sdev, HDA_DSP_PP_BAR, SOF_HDA_REG_PP_PPSTS); in hda_ipc_irq_dump()
495 dev_err(sdev->dev, in hda_ipc_irq_dump()
498 dev_err(sdev->dev, in hda_ipc_irq_dump()
503 void hda_ipc_dump(struct snd_sof_dev *sdev) in hda_ipc_dump() argument
509 hda_ipc_irq_dump(sdev); in hda_ipc_dump()
512 hipcie = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCIE); in hda_ipc_dump()
513 hipct = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCT); in hda_ipc_dump()
514 hipcctl = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCCTL); in hda_ipc_dump()
518 dev_err(sdev->dev, in hda_ipc_dump()
523 static int hda_init(struct snd_sof_dev *sdev) in hda_init() argument
527 struct pci_dev *pci = to_pci_dev(sdev->dev); in hda_init()
530 hbus = sof_to_hbus(sdev); in hda_init()
531 bus = sof_to_bus(sdev); in hda_init()
556 sdev->bar[HDA_DSP_HDA_BAR] = bus->remap_addr; in hda_init()
559 ret = hda_codec_i915_init(sdev); in hda_init()
561 dev_warn(sdev->dev, "init of i915 and HDMI codec failed\n"); in hda_init()
564 ret = hda_dsp_ctrl_get_caps(sdev); in hda_init()
566 dev_err(sdev->dev, "error: get caps error\n"); in hda_init()
573 static int check_nhlt_dmic(struct snd_sof_dev *sdev) in check_nhlt_dmic() argument
578 nhlt = intel_nhlt_init(sdev->dev); in check_nhlt_dmic()
580 dmic_num = intel_nhlt_get_dmic_geo(sdev->dev, nhlt); in check_nhlt_dmic()
589 static const char *fixup_tplg_name(struct snd_sof_dev *sdev, in fixup_tplg_name() argument
598 filename = devm_kstrdup(sdev->dev, sof_tplg_filename, GFP_KERNEL); in fixup_tplg_name()
605 tplg_filename = devm_kasprintf(sdev->dev, GFP_KERNEL, in fixup_tplg_name()
616 static int hda_init_caps(struct snd_sof_dev *sdev) in hda_init_caps() argument
618 struct hdac_bus *bus = sof_to_bus(sdev); in hda_init_caps()
619 struct snd_sof_pdata *pdata = sdev->pdata; in hda_init_caps()
631 dev_dbg(sdev->dev, "PP capability, will probe DSP later.\n"); in hda_init_caps()
634 ret = hda_dsp_ctrl_init_chip(sdev, true); in hda_init_caps()
642 ret = hda_sdw_acpi_scan(sdev); in hda_init_caps()
644 dev_dbg(sdev->dev, "skipping SoundWire, not detected with ACPI scan\n"); in hda_init_caps()
650 dev_dbg(sdev->dev, "skipping SoundWire, no links enabled\n"); in hda_init_caps()
661 ret = hda_sdw_probe(sdev); in hda_init_caps()
663 dev_err(sdev->dev, "error: SoundWire probe error\n"); in hda_init_caps()
674 hda_codec_probe_bus(sdev, hda_codec_use_common_hdmi); in hda_init_caps()
677 hda_codec_i915_display_power(sdev, false); in hda_init_caps()
690 struct snd_sof_dev *sdev = context; in hda_dsp_interrupt_handler() local
696 if (snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTSTS) & in hda_dsp_interrupt_handler()
700 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, in hda_dsp_interrupt_handler()
713 struct snd_sof_dev *sdev = context; in hda_dsp_interrupt_thread() local
714 struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata; in hda_dsp_interrupt_thread()
717 if (hda_dsp_check_stream_irq(sdev)) in hda_dsp_interrupt_thread()
718 hda_dsp_stream_threaded_handler(irq, sdev); in hda_dsp_interrupt_thread()
720 if (hda_dsp_check_ipc_irq(sdev)) in hda_dsp_interrupt_thread()
721 sof_ops(sdev)->irq_thread(irq, sdev); in hda_dsp_interrupt_thread()
723 if (hda_dsp_check_sdw_irq(sdev)) in hda_dsp_interrupt_thread()
726 if (hda_sdw_check_wakeen_irq(sdev)) in hda_dsp_interrupt_thread()
727 hda_sdw_process_wakeen(sdev); in hda_dsp_interrupt_thread()
730 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, in hda_dsp_interrupt_thread()
738 int hda_dsp_probe(struct snd_sof_dev *sdev) in hda_dsp_probe() argument
740 struct pci_dev *pci = to_pci_dev(sdev->dev); in hda_dsp_probe()
754 dev_err(sdev->dev, "error: the DSP is not enabled on this platform, aborting probe\n"); in hda_dsp_probe()
757 …dev_err(sdev->dev, "error: unknown PCI class/subclass/prog-if 0x%06x found, aborting probe\n", pci… in hda_dsp_probe()
760 dev_info(sdev->dev, "DSP detected with PCI class/subclass/prog-if 0x%06x\n", pci->class); in hda_dsp_probe()
762 chip = get_chip_info(sdev->pdata); in hda_dsp_probe()
764 dev_err(sdev->dev, "error: no such device supported, chip id:%x\n", in hda_dsp_probe()
770 hdev = devm_kzalloc(sdev->dev, sizeof(*hdev), GFP_KERNEL); in hda_dsp_probe()
773 sdev->pdata->hw_pdata = hdev; in hda_dsp_probe()
776 hdev->dmic_dev = platform_device_register_data(sdev->dev, "dmic-codec", in hda_dsp_probe()
780 dev_err(sdev->dev, "error: failed to create DMIC device\n"); in hda_dsp_probe()
791 hdev->no_ipc_position = sof_ops(sdev)->pcm_pointer ? 1 : 0; in hda_dsp_probe()
795 bus = sof_to_bus(sdev); in hda_dsp_probe()
796 ret = hda_init(sdev); in hda_dsp_probe()
802 sdev->bar[HDA_DSP_BAR] = pci_ioremap_bar(pci, HDA_DSP_BAR); in hda_dsp_probe()
804 if (!sdev->bar[HDA_DSP_BAR]) { in hda_dsp_probe()
805 dev_err(sdev->dev, "error: ioremap error\n"); in hda_dsp_probe()
810 sdev->mmio_bar = HDA_DSP_BAR; in hda_dsp_probe()
811 sdev->mailbox_bar = HDA_DSP_BAR; in hda_dsp_probe()
815 dev_dbg(sdev->dev, "DMA mask is 64 bit\n"); in hda_dsp_probe()
818 dev_dbg(sdev->dev, "DMA mask is 32 bit\n"); in hda_dsp_probe()
824 ret = hda_dsp_stream_init(sdev); in hda_dsp_probe()
826 dev_err(sdev->dev, "error: failed to init streams\n"); in hda_dsp_probe()
841 dev_info(sdev->dev, "use msi interrupt mode\n"); in hda_dsp_probe()
842 sdev->ipc_irq = pci_irq_vector(pci, 0); in hda_dsp_probe()
844 sdev->msi_enabled = true; in hda_dsp_probe()
847 if (!sdev->msi_enabled) { in hda_dsp_probe()
848 dev_info(sdev->dev, "use legacy interrupt mode\n"); in hda_dsp_probe()
853 sdev->ipc_irq = pci->irq; in hda_dsp_probe()
856 dev_dbg(sdev->dev, "using IPC IRQ %d\n", sdev->ipc_irq); in hda_dsp_probe()
857 ret = request_threaded_irq(sdev->ipc_irq, hda_dsp_interrupt_handler, in hda_dsp_probe()
859 IRQF_SHARED, "AudioDSP", sdev); in hda_dsp_probe()
861 dev_err(sdev->dev, "error: failed to register IPC IRQ %d\n", in hda_dsp_probe()
862 sdev->ipc_irq); in hda_dsp_probe()
873 snd_sof_pci_update_bits(sdev, PCI_TCSEL, 0x07, 0); in hda_dsp_probe()
876 ret = hda_init_caps(sdev); in hda_dsp_probe()
881 hda_dsp_ctrl_ppcap_enable(sdev, true); in hda_dsp_probe()
882 hda_dsp_ctrl_ppcap_int_enable(sdev, true); in hda_dsp_probe()
885 sdev->dsp_box.offset = HDA_DSP_MBOX_UPLINK_OFFSET; in hda_dsp_probe()
892 free_irq(sdev->ipc_irq, sdev); in hda_dsp_probe()
894 if (sdev->msi_enabled) in hda_dsp_probe()
897 hda_dsp_stream_free(sdev); in hda_dsp_probe()
899 iounmap(sdev->bar[HDA_DSP_BAR]); in hda_dsp_probe()
903 hda_codec_i915_exit(sdev); in hda_dsp_probe()
908 int hda_dsp_remove(struct snd_sof_dev *sdev) in hda_dsp_remove() argument
910 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in hda_dsp_remove()
911 struct hdac_bus *bus = sof_to_bus(sdev); in hda_dsp_remove()
912 struct pci_dev *pci = to_pci_dev(sdev->dev); in hda_dsp_remove()
923 hda_sdw_exit(sdev); in hda_dsp_remove()
929 snd_sof_dsp_update_bits(sdev, HDA_DSP_PP_BAR, SOF_HDA_REG_PP_PPCTL, in hda_dsp_remove()
933 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTCTL, in hda_dsp_remove()
938 hda_dsp_core_reset_power_down(sdev, chip->host_managed_cores_mask); in hda_dsp_remove()
941 snd_sof_dsp_update_bits(sdev, HDA_DSP_PP_BAR, SOF_HDA_REG_PP_PPCTL, in hda_dsp_remove()
944 free_irq(sdev->ipc_irq, sdev); in hda_dsp_remove()
945 if (sdev->msi_enabled) in hda_dsp_remove()
948 hda_dsp_stream_free(sdev); in hda_dsp_remove()
953 iounmap(sdev->bar[HDA_DSP_BAR]); in hda_dsp_remove()
959 hda_codec_i915_exit(sdev); in hda_dsp_remove()
965 static int hda_generic_machine_select(struct snd_sof_dev *sdev) in hda_generic_machine_select() argument
967 struct hdac_bus *bus = sof_to_bus(sdev); in hda_generic_machine_select()
970 struct snd_sof_pdata *pdata = sdev->pdata; in hda_generic_machine_select()
1013 dmic_num = check_nhlt_dmic(sdev); in hda_generic_machine_select()
1039 tplg_filename = fixup_tplg_name(sdev, tplg_filename, in hda_generic_machine_select()
1065 static int hda_generic_machine_select(struct snd_sof_dev *sdev) in hda_generic_machine_select() argument
1073 static bool link_slaves_found(struct snd_sof_dev *sdev, in link_slaves_found() argument
1077 struct hdac_bus *bus = sof_to_bus(sdev); in link_slaves_found()
1119 static int hda_sdw_machine_select(struct snd_sof_dev *sdev) in hda_sdw_machine_select() argument
1121 struct snd_sof_pdata *pdata = sdev->pdata; in hda_sdw_machine_select()
1123 struct hdac_bus *bus = sof_to_bus(sdev); in hda_sdw_machine_select()
1163 if (!link_slaves_found(sdev, link, hdev->sdw)) in hda_sdw_machine_select()
1178 mach->mach_params.platform = dev_name(sdev->dev); in hda_sdw_machine_select()
1182 dev_info(sdev->dev, in hda_sdw_machine_select()
1190 static int hda_sdw_machine_select(struct snd_sof_dev *sdev) in hda_sdw_machine_select() argument
1205 void hda_machine_select(struct snd_sof_dev *sdev) in hda_machine_select() argument
1207 struct snd_sof_pdata *sof_pdata = sdev->pdata; in hda_machine_select()
1231 hda_sdw_machine_select(sdev); in hda_machine_select()
1237 hda_generic_machine_select(sdev); in hda_machine_select()
1240 dev_warn(sdev->dev, "warning: No matching ASoC machine driver found\n"); in hda_machine_select()