sound/soc/sof/intel/hda.c
Source file repositories/reference/linux-study-clean/sound/soc/sof/intel/hda.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/sof/intel/hda.c- Extension
.c- Size
- 48848 bytes
- Lines
- 1783
- Domain
- Driver Families
- Bucket
- sound/soc
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
sound/hdaudio_ext.hsound/hda_register.hlinux/acpi.hlinux/debugfs.hlinux/module.hlinux/soundwire/sdw.hlinux/soundwire/sdw_intel.hsound/intel-dsp-config.hsound/intel-nhlt.hsound/soc-acpi-intel-ssp-common.hsound/soc_sdw_utils.hsound/sof.hsound/sof/xtensa.hsound/hda-mlink.h../sof-audio.h../sof-pci-dev.h../ops.h../ipc4-topology.h../../intel/common/sof-function-topology-lib.hhda.htrace/events/sof_intel.hsound/soc-acpi-intel-match.hshim.h
Detected Declarations
function sdw_params_streamfunction sdw_params_freefunction sdw_ace2x_params_streamfunction sdw_ace2x_free_streamfunction sdw_ace2x_triggerfunction hda_sdw_acpi_scanfunction hda_sdw_probefunction hda_sdw_startupfunction hda_sdw_exitfunction hda_common_check_sdw_irqfunction hda_dsp_check_sdw_irqfunction hda_dsp_sdw_threadfunction hda_sdw_check_wakeen_irq_commonfunction hda_sdw_check_wakeen_irqfunction hda_sdw_process_wakeen_commonfunction hda_dsp_sdw_check_mic_privacy_irqfunction hda_dsp_sdw_process_mic_privacyfunction hda_sdw_acpi_scanfunction hda_sdw_probefunction hda_sdw_exitfunction hda_dsp_check_sdw_irqfunction hda_dsp_sdw_threadfunction hda_sdw_check_wakeen_irqfunction hda_dsp_sdw_check_mic_privacy_irqfunction hda_dsp_sdw_process_mic_privacyfunction hda_dsp_post_fw_runfunction hda_initfunction check_dmic_numfunction check_nhlt_ssp_maskfunction check_nhlt_ssp_mclk_maskfunction hda_init_capsfunction hda_dsp_interrupt_handlerfunction hda_dsp_interrupt_threadfunction hda_dsp_probe_earlyfunction hda_dsp_probefunction hda_dsp_removefunction hda_dsp_remove_latefunction hda_power_down_dspfunction hda_generic_machine_selectfunction hda_generic_machine_selectfunction hda_set_mach_paramsfunction check_tplg_quirk_maskfunction hda_pci_intel_probefunction hda_register_clientsfunction hda_unregister_clients
Annotated Snippet
static inline void hda_dsp_sdw_process_mic_privacy(struct snd_sof_dev *sdev) { }
#endif /* IS_ENABLED(CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE) */
/* pre fw run operations */
int hda_dsp_pre_fw_run(struct snd_sof_dev *sdev)
{
/* disable clock gating and power gating */
return hda_dsp_ctrl_clock_power_gating(sdev, false);
}
/* post fw run operations */
int hda_dsp_post_fw_run(struct snd_sof_dev *sdev)
{
int ret;
if (sdev->first_boot) {
struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata;
ret = hda_sdw_startup(sdev);
if (ret < 0) {
dev_err(sdev->dev,
"error: could not startup SoundWire links\n");
return ret;
}
/* Check if IMR boot is usable */
if (!sof_debug_check_flag(SOF_DBG_IGNORE_D3_PERSISTENT) &&
(sdev->fw_ready.flags & SOF_IPC_INFO_D3_PERSISTENT ||
sdev->pdata->ipc_type == SOF_IPC_TYPE_4)) {
hdev->imrboot_supported = true;
debugfs_create_bool("skip_imr_boot",
0644, sdev->debugfs_root,
&hdev->skip_imr_boot);
}
}
hda_sdw_int_enable(sdev, true);
/* re-enable clock gating and power gating */
return hda_dsp_ctrl_clock_power_gating(sdev, true);
}
EXPORT_SYMBOL_NS(hda_dsp_post_fw_run, "SND_SOC_SOF_INTEL_HDA_GENERIC");
/*
* Debug
*/
#if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG)
static bool hda_use_msi = true;
module_param_named(use_msi, hda_use_msi, bool, 0444);
MODULE_PARM_DESC(use_msi, "SOF HDA use PCI MSI mode");
#else
#define hda_use_msi (1)
#endif
static char *hda_model;
module_param(hda_model, charp, 0444);
MODULE_PARM_DESC(hda_model, "Use the given HDA board model.");
static int dmic_num_override = -1;
module_param_named(dmic_num, dmic_num_override, int, 0444);
MODULE_PARM_DESC(dmic_num, "SOF HDA DMIC number");
static int mclk_id_override = -1;
module_param_named(mclk_id, mclk_id_override, int, 0444);
MODULE_PARM_DESC(mclk_id, "SOF SSP mclk_id");
static int bt_link_mask_override = -1;
module_param_named(bt_link_mask, bt_link_mask_override, int, 0444);
MODULE_PARM_DESC(bt_link_mask, "SOF BT offload link mask");
static int hda_init(struct snd_sof_dev *sdev)
{
struct hda_bus *hbus;
struct hdac_bus *bus;
struct pci_dev *pci = to_pci_dev(sdev->dev);
int ret;
hbus = sof_to_hbus(sdev);
bus = sof_to_bus(sdev);
/* HDA bus init */
sof_hda_bus_init(sdev, &pci->dev);
if (sof_hda_position_quirk == SOF_HDA_POSITION_QUIRK_USE_DPIB_REGISTERS)
bus->use_posbuf = 0;
else
bus->use_posbuf = 1;
bus->bdl_pos_adj = 0;
Annotation
- Immediate include surface: `sound/hdaudio_ext.h`, `sound/hda_register.h`, `linux/acpi.h`, `linux/debugfs.h`, `linux/module.h`, `linux/soundwire/sdw.h`, `linux/soundwire/sdw_intel.h`, `sound/intel-dsp-config.h`.
- Detected declarations: `function sdw_params_stream`, `function sdw_params_free`, `function sdw_ace2x_params_stream`, `function sdw_ace2x_free_stream`, `function sdw_ace2x_trigger`, `function hda_sdw_acpi_scan`, `function hda_sdw_probe`, `function hda_sdw_startup`, `function hda_sdw_exit`, `function hda_common_check_sdw_irq`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: integration implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.