sound/soc/sof/amd/acp-common.c
Source file repositories/reference/linux-study-clean/sound/soc/sof/amd/acp-common.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/sof/amd/acp-common.c- Extension
.c- Size
- 8520 bytes
- Lines
- 269
- 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
../sof-priv.h../sof-audio.h../ops.hacp.hacp-dsp-offset.hsound/sof/xtensa.h
Detected Declarations
function amd_sof_ipc_dumpfunction amd_get_registersfunction amd_sof_dumpfunction amd_sof_sdw_get_slave_info
Annotated Snippet
if (ret) {
dev_info(sdev->dev, "failed to read slave information\n");
return NULL;
}
for (mach = sdev->pdata->desc->alt_machines; mach; mach++) {
if (!mach->links)
break;
link = mach->links;
for (i = 0; i < acp_data->info.count && link->num_adr; link++, i++) {
if (!snd_soc_acpi_sdw_link_slaves_found(sdev->dev, link,
acp_data->sdw->peripherals))
break;
}
if (i == acp_data->info.count || !link->num_adr)
if (!mach->machine_check || mach->machine_check(acp_data->sdw))
break;
}
if (mach && mach->link_mask) {
mach->mach_params.subsystem_rev = acp_data->pci_rev;
mach->mach_params.links = mach->links;
mach->mach_params.link_mask = mach->link_mask;
mach->mach_params.platform = dev_name(sdev->dev);
return mach;
}
}
dev_info(sdev->dev, "No SoundWire machine driver found\n");
return NULL;
}
#else
static struct snd_soc_acpi_mach *amd_sof_sdw_machine_select(struct snd_sof_dev *sdev)
{
return NULL;
}
#endif
struct snd_soc_acpi_mach *amd_sof_machine_select(struct snd_sof_dev *sdev)
{
struct snd_sof_pdata *sof_pdata = sdev->pdata;
struct acp_dev_data *acp_data = sdev->pdata->hw_pdata;
const struct sof_dev_desc *desc = sof_pdata->desc;
struct snd_soc_acpi_mach *mach = NULL;
if (desc->machines)
mach = snd_soc_acpi_find_machine(desc->machines);
if (!mach) {
mach = amd_sof_sdw_machine_select(sdev);
if (!mach) {
dev_warn(sdev->dev, "No matching ASoC machine driver found\n");
return NULL;
}
}
mach->mach_params.subsystem_rev = acp_data->pci_rev;
sof_pdata->tplg_filename = mach->sof_tplg_filename;
sof_pdata->fw_filename = mach->fw_filename;
return mach;
}
/* AMD Common DSP ops */
const struct snd_sof_dsp_ops sof_acp_common_ops = {
/* probe and remove */
.probe = amd_sof_acp_probe,
.remove = amd_sof_acp_remove,
/* Register IO */
.write = sof_io_write,
.read = sof_io_read,
/* Block IO */
.block_read = acp_dsp_block_read,
.block_write = acp_dsp_block_write,
/*Firmware loading */
.load_firmware = snd_sof_load_firmware_memcpy,
.pre_fw_run = acp_dsp_pre_fw_run,
.get_bar_index = acp_get_bar_index,
/* DSP core boot */
.run = acp_sof_dsp_run,
/*IPC */
.send_msg = acp_sof_ipc_send_msg,
.ipc_msg_data = acp_sof_ipc_msg_data,
.set_stream_data_offset = acp_set_stream_data_offset,
.get_mailbox_offset = acp_sof_ipc_get_mailbox_offset,
.get_window_offset = acp_sof_ipc_get_window_offset,
.irq_thread = acp_sof_ipc_irq_thread,
Annotation
- Immediate include surface: `../sof-priv.h`, `../sof-audio.h`, `../ops.h`, `acp.h`, `acp-dsp-offset.h`, `sound/sof/xtensa.h`.
- Detected declarations: `function amd_sof_ipc_dump`, `function amd_get_registers`, `function amd_sof_dump`, `function amd_sof_sdw_get_slave_info`.
- 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.