sound/soc/sof/intel/hda-dsp.c
Source file repositories/reference/linux-study-clean/sound/soc/sof/intel/hda-dsp.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/sof/intel/hda-dsp.c- Extension
.c- Size
- 47234 bytes
- Lines
- 1636
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hsound/hdaudio_ext.hsound/hda_register.hsound/hda-mlink.htrace/events/sof_intel.hsound/sof/xtensa.h../sof-audio.h../ops.hhda.hmtl.hhda-ipc.h
Detected Declarations
struct hda_dsp_msg_codefunction hda_get_interfacesfunction hda_get_interface_maskfunction hda_is_chain_dma_supportedfunction hda_dsp_core_reset_enterfunction HDA_DSP_ADSPCS_CRST_MASKfunction hda_dsp_core_reset_leavefunction hda_dsp_core_stall_resetfunction hda_dsp_core_is_enabledfunction hda_dsp_core_runfunction hda_dsp_core_power_upfunction HDA_DSP_ADSPCS_CPA_MASKfunction hda_dsp_core_power_downfunction hda_dsp_enable_corefunction hda_dsp_core_reset_power_downfunction hda_dsp_ipc_int_enablefunction hda_dsp_ipc_int_disablefunction hda_dsp_wait_d0i3c_donefunction hda_dsp_send_pm_gate_ipcfunction hda_dsp_update_d0i3c_registerfunction hda_dsp_d0i3_streaming_applicablefunction list_for_each_entryfunction hda_dsp_set_D0_statefunction hda_dsp_state_logfunction set_power_savefunction hda_dsp_set_power_state_ipc3function hda_dsp_set_power_state_ipc4function hda_suspendfunction hda_resumefunction hda_dsp_resumefunction hda_dsp_runtime_resumefunction hda_dsp_runtime_idlefunction hda_dsp_runtime_suspendfunction hda_dsp_suspendfunction hda_dsp_check_for_dma_streamsfunction list_for_each_entryfunction hda_dsp_s5_quirkfunction hda_dsp_shutdown_dma_flushfunction hda_dsp_shutdownfunction hda_dsp_set_hw_params_upon_resumefunction hda_dsp_d0i3_workfunction hda_dsp_core_getfunction hda_common_enable_sdw_irqfunction hda_sdw_int_enablefunction hda_sdw_check_lcount_commonfunction hda_sdw_check_lcount_extfunction hda_sdw_check_lcountfunction hda_sdw_process_wakeen
Annotated Snippet
struct hda_dsp_msg_code {
u32 code;
const char *text;
};
static bool hda_enable_trace_D0I3_S0;
#if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG)
module_param_named(enable_trace_D0I3_S0, hda_enable_trace_D0I3_S0, bool, 0444);
MODULE_PARM_DESC(enable_trace_D0I3_S0,
"SOF HDA enable trace when the DSP is in D0I3 in S0");
#endif
static void hda_get_interfaces(struct snd_sof_dev *sdev, u32 *interface_mask)
{
const struct sof_intel_dsp_desc *chip;
chip = get_chip_info(sdev->pdata);
switch (chip->hw_ip_version) {
case SOF_INTEL_TANGIER:
case SOF_INTEL_BAYTRAIL:
case SOF_INTEL_BROADWELL:
interface_mask[SOF_DAI_DSP_ACCESS] = BIT(SOF_DAI_INTEL_SSP);
break;
case SOF_INTEL_CAVS_1_5:
case SOF_INTEL_CAVS_1_5_PLUS:
interface_mask[SOF_DAI_DSP_ACCESS] =
BIT(SOF_DAI_INTEL_SSP) | BIT(SOF_DAI_INTEL_DMIC) | BIT(SOF_DAI_INTEL_HDA);
interface_mask[SOF_DAI_HOST_ACCESS] = BIT(SOF_DAI_INTEL_HDA);
break;
case SOF_INTEL_CAVS_1_8:
case SOF_INTEL_CAVS_2_0:
case SOF_INTEL_CAVS_2_5:
case SOF_INTEL_ACE_1_0:
interface_mask[SOF_DAI_DSP_ACCESS] =
BIT(SOF_DAI_INTEL_SSP) | BIT(SOF_DAI_INTEL_DMIC) |
BIT(SOF_DAI_INTEL_HDA) | BIT(SOF_DAI_INTEL_ALH);
interface_mask[SOF_DAI_HOST_ACCESS] = BIT(SOF_DAI_INTEL_HDA);
break;
case SOF_INTEL_ACE_2_0:
case SOF_INTEL_ACE_3_0:
case SOF_INTEL_ACE_4_0:
interface_mask[SOF_DAI_DSP_ACCESS] =
BIT(SOF_DAI_INTEL_SSP) | BIT(SOF_DAI_INTEL_DMIC) |
BIT(SOF_DAI_INTEL_HDA) | BIT(SOF_DAI_INTEL_ALH);
/* all interfaces accessible without DSP */
interface_mask[SOF_DAI_HOST_ACCESS] =
interface_mask[SOF_DAI_DSP_ACCESS];
break;
default:
break;
}
}
u32 hda_get_interface_mask(struct snd_sof_dev *sdev)
{
u32 interface_mask[SOF_DAI_ACCESS_NUM] = { 0 };
hda_get_interfaces(sdev, interface_mask);
return interface_mask[sdev->dspless_mode_selected];
}
EXPORT_SYMBOL_NS(hda_get_interface_mask, "SND_SOC_SOF_INTEL_HDA_COMMON");
bool hda_is_chain_dma_supported(struct snd_sof_dev *sdev, u32 dai_type)
{
u32 interface_mask[SOF_DAI_ACCESS_NUM] = { 0 };
const struct sof_intel_dsp_desc *chip;
if (sdev->dspless_mode_selected)
return false;
hda_get_interfaces(sdev, interface_mask);
if (!(interface_mask[SOF_DAI_DSP_ACCESS] & BIT(dai_type)))
return false;
if (dai_type == SOF_DAI_INTEL_HDA)
return true;
switch (dai_type) {
case SOF_DAI_INTEL_SSP:
case SOF_DAI_INTEL_DMIC:
case SOF_DAI_INTEL_ALH:
chip = get_chip_info(sdev->pdata);
if (chip->hw_ip_version < SOF_INTEL_ACE_2_0)
return false;
return true;
default:
return false;
}
Annotation
- Immediate include surface: `linux/module.h`, `sound/hdaudio_ext.h`, `sound/hda_register.h`, `sound/hda-mlink.h`, `trace/events/sof_intel.h`, `sound/sof/xtensa.h`, `../sof-audio.h`, `../ops.h`.
- Detected declarations: `struct hda_dsp_msg_code`, `function hda_get_interfaces`, `function hda_get_interface_mask`, `function hda_is_chain_dma_supported`, `function hda_dsp_core_reset_enter`, `function HDA_DSP_ADSPCS_CRST_MASK`, `function hda_dsp_core_reset_leave`, `function hda_dsp_core_stall_reset`, `function hda_dsp_core_is_enabled`, `function hda_dsp_core_run`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: integration implementation candidate.
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.