sound/soc/intel/avs/path.c
Source file repositories/reference/linux-study-clean/sound/soc/intel/avs/path.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/intel/avs/path.c- Extension
.c- Size
- 43168 bytes
- Lines
- 1609
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/acpi.hacpi/nhlt.hsound/pcm_params.hsound/soc.havs.hcontrol.hpath.htopology.h
Detected Declarations
struct avs_module_createfunction avs_path_find_tplgfunction avs_path_find_modulefunction avs_path_find_pipelinefunction avs_path_find_pathfunction list_for_each_entryfunction avs_test_hw_paramsfunction avs_path_find_variantfunction list_for_each_entryfunction list_for_each_entryfunction avs_tplg_path_template_id_equalfunction avs_path_set_constraintfunction list_for_each_entryfunction list_for_each_entryfunction avs_init_node_idfunction avs_nhlt_config_or_defaultfunction avs_append_dma_cfgfunction avs_fill_gtw_configfunction avs_copier_createfunction avs_whm_createfunction avs_peakvol_set_volumefunction avs_peakvol_set_mutefunction avs_peakvol_createfunction avs_updown_mix_createfunction avs_src_createfunction avs_asrc_createfunction avs_aec_createfunction avs_mux_createfunction avs_wov_createfunction avs_micsel_createfunction avs_modbase_createfunction avs_modext_createfunction avs_probe_createfunction avs_path_module_type_createfunction avs_path_module_send_init_configsfunction avs_path_module_freefunction avs_path_module_createfunction avs_path_binding_armfunction avs_path_binding_freefunction avs_path_pipeline_armfunction list_for_each_entryfunction avs_path_pipeline_freefunction list_for_each_entry_safefunction avs_path_pipeline_createfunction list_for_each_entryfunction avs_path_initfunction avs_path_armfunction list_for_each_entry
Annotated Snippet
struct avs_module_create {
guid_t *guid;
int (*create)(struct avs_dev *adev, struct avs_path_module *mod);
};
static struct avs_module_create avs_module_create[] = {
{ &AVS_MIXIN_MOD_UUID, avs_modbase_create },
{ &AVS_MIXOUT_MOD_UUID, avs_modbase_create },
{ &AVS_KPBUFF_MOD_UUID, avs_modbase_create },
{ &AVS_COPIER_MOD_UUID, avs_copier_create },
{ &AVS_PEAKVOL_MOD_UUID, avs_peakvol_create },
{ &AVS_GAIN_MOD_UUID, avs_peakvol_create },
{ &AVS_MICSEL_MOD_UUID, avs_micsel_create },
{ &AVS_MUX_MOD_UUID, avs_mux_create },
{ &AVS_UPDWMIX_MOD_UUID, avs_updown_mix_create },
{ &AVS_SRCINTC_MOD_UUID, avs_src_create },
{ &AVS_AEC_MOD_UUID, avs_aec_create },
{ &AVS_ASRC_MOD_UUID, avs_asrc_create },
{ &AVS_INTELWOV_MOD_UUID, avs_wov_create },
{ &AVS_PROBE_MOD_UUID, avs_probe_create },
{ &AVS_WOVHOSTM_MOD_UUID, avs_whm_create },
};
static int avs_path_module_type_create(struct avs_dev *adev, struct avs_path_module *mod)
{
const guid_t *type = &mod->template->cfg_ext->type;
for (int i = 0; i < ARRAY_SIZE(avs_module_create); i++)
if (guid_equal(type, avs_module_create[i].guid))
return avs_module_create[i].create(adev, mod);
return avs_modext_create(adev, mod);
}
static int avs_path_module_send_init_configs(struct avs_dev *adev, struct avs_path_module *mod)
{
struct avs_soc_component *acomp;
acomp = to_avs_soc_component(mod->template->owner->owner->owner->owner->comp);
u32 num_ids = mod->template->num_config_ids;
u32 *ids = mod->template->config_ids;
for (int i = 0; i < num_ids; i++) {
struct avs_tplg_init_config *config = &acomp->tplg->init_configs[ids[i]];
size_t len = config->length;
void *data = config->data;
u32 param = config->param;
int ret;
ret = avs_ipc_set_large_config(adev, mod->module_id, mod->instance_id,
param, data, len);
if (ret) {
dev_err(adev->dev, "send initial module config failed: %d\n", ret);
return AVS_IPC_RET(ret);
}
}
return 0;
}
static void avs_path_module_free(struct avs_dev *adev, struct avs_path_module *mod)
{
kfree(mod);
}
static struct avs_path_module *
avs_path_module_create(struct avs_dev *adev,
struct avs_path_pipeline *owner,
struct avs_tplg_module *template)
{
struct avs_path_module *mod;
int module_id, ret;
module_id = avs_get_module_id(adev, &template->cfg_ext->type);
if (module_id < 0)
return ERR_PTR(module_id);
mod = kzalloc_obj(*mod);
if (!mod)
return ERR_PTR(-ENOMEM);
mod->template = template;
mod->module_id = module_id;
mod->owner = owner;
INIT_LIST_HEAD(&mod->node);
ret = avs_path_module_type_create(adev, mod);
if (ret) {
dev_err(adev->dev, "module-type create failed: %d\n", ret);
Annotation
- Immediate include surface: `linux/acpi.h`, `acpi/nhlt.h`, `sound/pcm_params.h`, `sound/soc.h`, `avs.h`, `control.h`, `path.h`, `topology.h`.
- Detected declarations: `struct avs_module_create`, `function avs_path_find_tplg`, `function avs_path_find_module`, `function avs_path_find_pipeline`, `function avs_path_find_path`, `function list_for_each_entry`, `function avs_test_hw_params`, `function avs_path_find_variant`, `function list_for_each_entry`, `function list_for_each_entry`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.