sound/soc/intel/avs/topology.c
Source file repositories/reference/linux-study-clean/sound/soc/intel/avs/topology.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/intel/avs/topology.c- Extension
.c- Size
- 64780 bytes
- Lines
- 2248
- Domain
- Driver Families
- Bucket
- sound/soc
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- 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/firmware.hlinux/uuid.hsound/soc.hsound/soc-acpi.hsound/soc-topology.huapi/sound/intel/avs/tokens.havs.hcontrol.htopology.hutils.h
Detected Declarations
struct avs_tplg_token_parserfunction avs_tplg_vendor_array_lookupfunction avs_tplg_vendor_array_lookupfunction avs_tplg_vendor_array_lookupfunction avs_parse_uuid_tokenfunction avs_parse_bool_tokenfunction avs_parse_byte_tokenfunction avs_parse_short_tokenfunction avs_parse_word_tokenfunction avs_parse_string_tokenfunction avs_parse_uuid_tokensfunction avs_parse_string_tokensfunction avs_parse_word_tokensfunction avs_parse_tokensfunction parse_audio_format_bitfieldfunction avs_ssp_sprintfunction parse_link_formatted_stringfunction avs_parse_nhlt_config_sizefunction parse_dictionary_headerfunction parse_dictionary_entriesfunction parse_dictionaryfunction avs_tplg_parse_librariesfunction avs_tplg_parse_audio_formatsfunction avs_tplg_parse_modcfgs_basefunction assign_copier_gtw_instancefunction avs_tplg_parse_modcfg_extfunction avs_tplg_parse_modcfgs_extfunction avs_tplg_parse_pplcfgsfunction avs_tplg_parse_bindingsfunction avs_tplg_module_createfunction avs_tplg_pipeline_createfunction avs_tplg_path_createfunction parse_path_templatefunction avs_tplg_path_template_createfunction avs_tplg_parse_condpath_templatesfunction avs_tplg_parse_initial_configsfunction avs_tplg_parse_nhlt_configsfunction avs_route_loadfunction avs_widget_loadfunction avs_widget_readyfunction avs_dai_loadfunction avs_link_loadfunction avs_manifestfunction avs_control_loadfunction avs_load_topologyfunction avs_remove_topology
Annotated Snippet
struct avs_tplg_token_parser {
enum avs_tplg_token token;
u32 type;
u32 offset;
int (*parse)(struct snd_soc_component *comp, void *elem, void *object, u32 offset);
};
static int
avs_parse_uuid_token(struct snd_soc_component *comp, void *elem, void *object, u32 offset)
{
struct snd_soc_tplg_vendor_uuid_elem *tuple = elem;
guid_t *val = (guid_t *)((u8 *)object + offset);
guid_copy((guid_t *)val, (const guid_t *)&tuple->uuid);
return 0;
}
static int
avs_parse_bool_token(struct snd_soc_component *comp, void *elem, void *object, u32 offset)
{
struct snd_soc_tplg_vendor_value_elem *tuple = elem;
bool *val = (bool *)((u8 *)object + offset);
*val = le32_to_cpu(tuple->value);
return 0;
}
static int
avs_parse_byte_token(struct snd_soc_component *comp, void *elem, void *object, u32 offset)
{
struct snd_soc_tplg_vendor_value_elem *tuple = elem;
u8 *val = ((u8 *)object + offset);
*val = le32_to_cpu(tuple->value);
return 0;
}
static int
avs_parse_short_token(struct snd_soc_component *comp, void *elem, void *object, u32 offset)
{
struct snd_soc_tplg_vendor_value_elem *tuple = elem;
u16 *val = (u16 *)((u8 *)object + offset);
*val = le32_to_cpu(tuple->value);
return 0;
}
static int
avs_parse_word_token(struct snd_soc_component *comp, void *elem, void *object, u32 offset)
{
struct snd_soc_tplg_vendor_value_elem *tuple = elem;
u32 *val = (u32 *)((u8 *)object + offset);
*val = le32_to_cpu(tuple->value);
return 0;
}
static int
avs_parse_string_token(struct snd_soc_component *comp, void *elem, void *object, u32 offset)
{
struct snd_soc_tplg_vendor_string_elem *tuple = elem;
char *val = (char *)((u8 *)object + offset);
snprintf(val, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, "%s", tuple->string);
return 0;
}
static int avs_parse_uuid_tokens(struct snd_soc_component *comp, void *object,
const struct avs_tplg_token_parser *parsers, int count,
struct snd_soc_tplg_vendor_array *tuples)
{
struct snd_soc_tplg_vendor_uuid_elem *tuple;
int ret, i, j;
/* Parse element by element. */
for (i = 0; i < le32_to_cpu(tuples->num_elems); i++) {
tuple = &tuples->uuid[i];
for (j = 0; j < count; j++) {
/* Ignore non-UUID tokens. */
if (parsers[j].type != SND_SOC_TPLG_TUPLE_TYPE_UUID ||
parsers[j].token != le32_to_cpu(tuple->token))
continue;
Annotation
- Immediate include surface: `linux/firmware.h`, `linux/uuid.h`, `sound/soc.h`, `sound/soc-acpi.h`, `sound/soc-topology.h`, `uapi/sound/intel/avs/tokens.h`, `avs.h`, `control.h`.
- Detected declarations: `struct avs_tplg_token_parser`, `function avs_tplg_vendor_array_lookup`, `function avs_tplg_vendor_array_lookup`, `function avs_tplg_vendor_array_lookup`, `function avs_parse_uuid_token`, `function avs_parse_bool_token`, `function avs_parse_byte_token`, `function avs_parse_short_token`, `function avs_parse_word_token`, `function avs_parse_string_token`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source 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.