sound/soc/sof/ipc4.c
Source file repositories/reference/linux-study-clean/sound/soc/sof/ipc4.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/sof/ipc4.c- Extension
.c- Size
- 28606 bytes
- Lines
- 957
- 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/firmware.hsound/sof/header.hsound/sof/ipc4/header.hsof-priv.hsof-audio.hipc4-fw-reg.hipc4-priv.hipc4-topology.hipc4-telemetry.hops.h
Detected Declarations
function sof_ipc4_check_reply_statusfunction sof_ipc4_log_headerfunction sof_ipc4_log_headerfunction sof_ipc4_dump_payloadfunction sof_ipc4_get_replyfunction ipc4_wait_tx_donefunction ipc4_tx_msg_unlockedfunction sof_ipc4_tx_msgfunction sof_ipc4_tx_payload_for_get_datafunction sof_ipc4_set_get_datafunction sof_ipc4_init_msg_memoryfunction sof_ipc4_find_debug_slot_offset_by_typefunction ipc4_fw_readyfunction sof_ipc4_module_notification_handlerfunction sof_ipc4_rx_msgfunction sof_ipc4_set_core_statefunction sof_ipc4_ctx_savefunction sof_ipc4_set_pm_gatefunction sof_ipc4_initfunction sof_ipc4_exitfunction xa_for_eachfunction sof_ipc4_post_bootfunction sof_ipc4_mic_privacy_state_changeexport sof_ipc4_find_debug_slot_offset_by_typeexport sof_ipc4_mic_privacy_state_change
Annotated Snippet
if (ipc4_status[i].status == status) {
dev_err(sdev->dev, "FW reported error: %u - %s\n",
status, ipc4_status[i].msg);
goto to_errno;
}
}
if (i == ARRAY_SIZE(ipc4_status))
dev_err(sdev->dev, "FW reported error: %u - Unknown\n", status);
to_errno:
switch (status) {
case 2:
case 15:
ret = -EOPNOTSUPP;
break;
case 8:
case 11:
case 105 ... 109:
case 114 ... 115:
case 160 ... 163:
case 165:
ret = -ENOENT;
break;
case 4:
case 150:
case 151:
ret = -EBUSY;
break;
default:
ret = -EINVAL;
break;
}
return ret;
}
#if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_VERBOSE_IPC)
#define DBG_IPC4_MSG_TYPE_ENTRY(type) [SOF_IPC4_##type] = #type
static const char * const ipc4_dbg_mod_msg_type[] = {
DBG_IPC4_MSG_TYPE_ENTRY(MOD_INIT_INSTANCE),
DBG_IPC4_MSG_TYPE_ENTRY(MOD_CONFIG_GET),
DBG_IPC4_MSG_TYPE_ENTRY(MOD_CONFIG_SET),
DBG_IPC4_MSG_TYPE_ENTRY(MOD_LARGE_CONFIG_GET),
DBG_IPC4_MSG_TYPE_ENTRY(MOD_LARGE_CONFIG_SET),
DBG_IPC4_MSG_TYPE_ENTRY(MOD_BIND),
DBG_IPC4_MSG_TYPE_ENTRY(MOD_UNBIND),
DBG_IPC4_MSG_TYPE_ENTRY(MOD_SET_DX),
DBG_IPC4_MSG_TYPE_ENTRY(MOD_SET_D0IX),
DBG_IPC4_MSG_TYPE_ENTRY(MOD_ENTER_MODULE_RESTORE),
DBG_IPC4_MSG_TYPE_ENTRY(MOD_EXIT_MODULE_RESTORE),
DBG_IPC4_MSG_TYPE_ENTRY(MOD_DELETE_INSTANCE),
};
static const char * const ipc4_dbg_glb_msg_type[] = {
DBG_IPC4_MSG_TYPE_ENTRY(GLB_BOOT_CONFIG),
DBG_IPC4_MSG_TYPE_ENTRY(GLB_ROM_CONTROL),
DBG_IPC4_MSG_TYPE_ENTRY(GLB_IPCGATEWAY_CMD),
DBG_IPC4_MSG_TYPE_ENTRY(GLB_PERF_MEASUREMENTS_CMD),
DBG_IPC4_MSG_TYPE_ENTRY(GLB_CHAIN_DMA),
DBG_IPC4_MSG_TYPE_ENTRY(GLB_LOAD_MULTIPLE_MODULES),
DBG_IPC4_MSG_TYPE_ENTRY(GLB_UNLOAD_MULTIPLE_MODULES),
DBG_IPC4_MSG_TYPE_ENTRY(GLB_CREATE_PIPELINE),
DBG_IPC4_MSG_TYPE_ENTRY(GLB_DELETE_PIPELINE),
DBG_IPC4_MSG_TYPE_ENTRY(GLB_SET_PIPELINE_STATE),
DBG_IPC4_MSG_TYPE_ENTRY(GLB_GET_PIPELINE_STATE),
DBG_IPC4_MSG_TYPE_ENTRY(GLB_GET_PIPELINE_CONTEXT_SIZE),
DBG_IPC4_MSG_TYPE_ENTRY(GLB_SAVE_PIPELINE),
DBG_IPC4_MSG_TYPE_ENTRY(GLB_RESTORE_PIPELINE),
DBG_IPC4_MSG_TYPE_ENTRY(GLB_LOAD_LIBRARY),
DBG_IPC4_MSG_TYPE_ENTRY(GLB_LOAD_LIBRARY_PREPARE),
DBG_IPC4_MSG_TYPE_ENTRY(GLB_INTERNAL_MESSAGE),
DBG_IPC4_MSG_TYPE_ENTRY(GLB_NOTIFICATION),
};
#define DBG_IPC4_NOTIFICATION_TYPE_ENTRY(type) [SOF_IPC4_NOTIFY_##type] = #type
static const char * const ipc4_dbg_notification_type[] = {
DBG_IPC4_NOTIFICATION_TYPE_ENTRY(PHRASE_DETECTED),
DBG_IPC4_NOTIFICATION_TYPE_ENTRY(RESOURCE_EVENT),
DBG_IPC4_NOTIFICATION_TYPE_ENTRY(LOG_BUFFER_STATUS),
DBG_IPC4_NOTIFICATION_TYPE_ENTRY(TIMESTAMP_CAPTURED),
DBG_IPC4_NOTIFICATION_TYPE_ENTRY(FW_READY),
DBG_IPC4_NOTIFICATION_TYPE_ENTRY(FW_AUD_CLASS_RESULT),
DBG_IPC4_NOTIFICATION_TYPE_ENTRY(EXCEPTION_CAUGHT),
DBG_IPC4_NOTIFICATION_TYPE_ENTRY(MODULE_NOTIFICATION),
DBG_IPC4_NOTIFICATION_TYPE_ENTRY(PROBE_DATA_AVAILABLE),
DBG_IPC4_NOTIFICATION_TYPE_ENTRY(ASYNC_MSG_SRVC_MESSAGE),
};
static void sof_ipc4_log_header(struct device *dev, u8 *text, struct sof_ipc4_msg *msg,
Annotation
- Immediate include surface: `linux/firmware.h`, `sound/sof/header.h`, `sound/sof/ipc4/header.h`, `sof-priv.h`, `sof-audio.h`, `ipc4-fw-reg.h`, `ipc4-priv.h`, `ipc4-topology.h`.
- Detected declarations: `function sof_ipc4_check_reply_status`, `function sof_ipc4_log_header`, `function sof_ipc4_log_header`, `function sof_ipc4_dump_payload`, `function sof_ipc4_get_reply`, `function ipc4_wait_tx_done`, `function ipc4_tx_msg_unlocked`, `function sof_ipc4_tx_msg`, `function sof_ipc4_tx_payload_for_get_data`, `function sof_ipc4_set_get_data`.
- 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.