sound/soc/sof/ipc4-topology.c
Source file repositories/reference/linux-study-clean/sound/soc/sof/ipc4-topology.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/sof/ipc4-topology.c- Extension
.c- Size
- 126800 bytes
- Lines
- 4043
- 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.
- 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
linux/bitfield.hlinux/cleanup.huapi/sound/sof/tokens.hsound/pcm_params.hsound/sof/ext_manifest4.hsound/intel-nhlt.hsof-priv.hsof-audio.hipc4-priv.hipc4-topology.hops.h
Detected Declarations
struct sof_comp_domainsfunction find_domainfunction get_token_comp_domainfunction list_for_each_entryfunction sof_ipc4_fmt_cfg_to_typefunction sof_ipc4_dbg_audio_formatfunction sof_ipc4_dbg_module_audio_formatfunction sof_ipc4_get_input_pin_audio_fmtfunction sof_ipc4_get_audio_fmtfunction sof_ipc4_free_audio_fmtfunction sof_ipc4_widget_free_comp_pipelinefunction sof_ipc4_widget_set_module_infofunction sof_ipc4_widget_setup_msgfunction sof_ipc4_widget_update_kcontrol_module_idfunction sof_ipc4_update_card_components_stringfunction sof_ipc4_widget_setup_pcmfunction sof_ipc4_widget_free_comp_pcmfunction sof_ipc4_widget_setup_comp_daifunction list_for_each_entryfunction sof_ipc4_widget_free_comp_daifunction sof_ipc4_widget_setup_comp_pipelinefunction sof_ipc4_widget_setup_comp_pgafunction sof_ipc4_widget_free_comp_pgafunction sof_ipc4_widget_setup_comp_mixerfunction sof_ipc4_widget_setup_comp_srcfunction sof_ipc4_widget_setup_comp_asrcfunction sof_ipc4_widget_free_comp_srcfunction sof_ipc4_widget_free_comp_asrcfunction sof_ipc4_widget_free_comp_mixerfunction sof_ipc4_widget_setup_comp_processfunction sof_ipc4_widget_free_comp_processfunction sof_ipc4_update_resource_usagefunction sof_ipc4_widget_assign_instance_idfunction sof_ipc4_update_hw_paramsfunction sof_ipc4_is_single_formatfunction sof_ipc4_init_output_audio_fmtfunction sof_ipc4_get_valid_bitsfunction sof_ipc4_get_sample_typefunction sof_ipc4_init_input_audio_fmtfunction sof_ipc4_unprepare_copier_modulefunction snd_sof_get_hw_config_paramsfunction snd_sof_get_nhlt_endpoint_datafunction snd_sof_get_nhlt_endpoint_datafunction sof_ipc4_copier_is_single_bitdepthfunction sof_ipc4_adjust_params_to_dai_formatfunction sof_ipc4_prepare_dai_copierfunction sof_ipc4_host_configfunction sof_ipc4_prepare_copier_module
Annotated Snippet
struct sof_comp_domains {
const char *name;
enum sof_comp_domain domain;
};
static const struct sof_comp_domains sof_domains[] = {
{ "LL", SOF_COMP_DOMAIN_LL, },
{ "DP", SOF_COMP_DOMAIN_DP, }
};
static enum sof_comp_domain find_domain(const char *name)
{
int i;
for (i = 0; i < ARRAY_SIZE(sof_domains); i++) {
if (strcmp(name, sof_domains[i].name) == 0)
return sof_domains[i].domain;
}
/* No valid value found, fall back to manifest value */
return SOF_COMP_DOMAIN_UNSET;
}
static int get_token_comp_domain(void *elem, void *object, u32 offset)
{
u32 *val = (u32 *)((u8 *)object + offset);
*val = find_domain((const char *)elem);
return 0;
}
static const struct sof_topology_token ipc4_sched_tokens[] = {
{SOF_TKN_SCHED_LP_MODE, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc4_pipeline, lp_mode)},
{SOF_TKN_SCHED_USE_CHAIN_DMA, SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u16,
offsetof(struct sof_ipc4_pipeline, use_chain_dma)},
{SOF_TKN_SCHED_CORE, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc4_pipeline, core_id)},
{SOF_TKN_SCHED_PRIORITY, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc4_pipeline, priority)},
{SOF_TKN_SCHED_DIRECTION, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc4_pipeline, direction)},
{SOF_TKN_SCHED_DIRECTION, SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u16,
offsetof(struct sof_ipc4_pipeline, direction_valid)},
};
static const struct sof_topology_token pipeline_tokens[] = {
{SOF_TKN_SCHED_DYNAMIC_PIPELINE, SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u16,
offsetof(struct snd_sof_widget, dynamic_pipeline_widget)},
};
static const struct sof_topology_token ipc4_comp_tokens[] = {
{SOF_TKN_COMP_IS_PAGES, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc4_base_module_cfg, is_pages)},
};
static const struct sof_topology_token ipc4_in_audio_format_tokens[] = {
{SOF_TKN_CAVS_AUDIO_FORMAT_IN_RATE, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc4_pin_format, audio_fmt.sampling_frequency)},
{SOF_TKN_CAVS_AUDIO_FORMAT_IN_BIT_DEPTH, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc4_pin_format, audio_fmt.bit_depth)},
{SOF_TKN_CAVS_AUDIO_FORMAT_IN_CH_MAP, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc4_pin_format, audio_fmt.ch_map)},
{SOF_TKN_CAVS_AUDIO_FORMAT_IN_CH_CFG, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc4_pin_format, audio_fmt.ch_cfg)},
{SOF_TKN_CAVS_AUDIO_FORMAT_IN_INTERLEAVING_STYLE, SND_SOC_TPLG_TUPLE_TYPE_WORD,
get_token_u32, offsetof(struct sof_ipc4_pin_format,
audio_fmt.interleaving_style)},
{SOF_TKN_CAVS_AUDIO_FORMAT_IN_FMT_CFG, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc4_pin_format, audio_fmt.fmt_cfg)},
{SOF_TKN_CAVS_AUDIO_FORMAT_INPUT_PIN_INDEX, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc4_pin_format, pin_index)},
{SOF_TKN_CAVS_AUDIO_FORMAT_IBS, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc4_pin_format, buffer_size)},
};
static const struct sof_topology_token ipc4_out_audio_format_tokens[] = {
{SOF_TKN_CAVS_AUDIO_FORMAT_OUT_RATE, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc4_pin_format, audio_fmt.sampling_frequency)},
{SOF_TKN_CAVS_AUDIO_FORMAT_OUT_BIT_DEPTH, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc4_pin_format, audio_fmt.bit_depth)},
{SOF_TKN_CAVS_AUDIO_FORMAT_OUT_CH_MAP, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc4_pin_format, audio_fmt.ch_map)},
{SOF_TKN_CAVS_AUDIO_FORMAT_OUT_CH_CFG, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc4_pin_format, audio_fmt.ch_cfg)},
{SOF_TKN_CAVS_AUDIO_FORMAT_OUT_INTERLEAVING_STYLE, SND_SOC_TPLG_TUPLE_TYPE_WORD,
get_token_u32, offsetof(struct sof_ipc4_pin_format,
audio_fmt.interleaving_style)},
{SOF_TKN_CAVS_AUDIO_FORMAT_OUT_FMT_CFG, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc4_pin_format, audio_fmt.fmt_cfg)},
{SOF_TKN_CAVS_AUDIO_FORMAT_OUTPUT_PIN_INDEX, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/cleanup.h`, `uapi/sound/sof/tokens.h`, `sound/pcm_params.h`, `sound/sof/ext_manifest4.h`, `sound/intel-nhlt.h`, `sof-priv.h`, `sof-audio.h`.
- Detected declarations: `struct sof_comp_domains`, `function find_domain`, `function get_token_comp_domain`, `function list_for_each_entry`, `function sof_ipc4_fmt_cfg_to_type`, `function sof_ipc4_dbg_audio_format`, `function sof_ipc4_dbg_module_audio_format`, `function sof_ipc4_get_input_pin_audio_fmt`, `function sof_ipc4_get_audio_fmt`, `function sof_ipc4_free_audio_fmt`.
- 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.