sound/soc/qcom/qdsp6/q6core.c
Source file repositories/reference/linux-study-clean/sound/soc/qcom/qdsp6/q6core.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/qcom/qdsp6/q6core.c- Extension
.c- Size
- 8595 bytes
- Lines
- 376
- 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.
- 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/slab.hlinux/wait.hlinux/kernel.hlinux/module.hlinux/sched.hlinux/of.hlinux/of_platform.hlinux/jiffies.hlinux/soc/qcom/apr.hq6core.hq6dsp-errno.h
Detected Declarations
struct avcs_svc_infostruct avcs_cmdrsp_get_versionstruct avcs_svc_api_infostruct avcs_cmdrsp_get_fwk_versionstruct q6corefunction q6core_callbackfunction q6core_get_fwk_versionsfunction q6core_get_svc_versionsfunction __q6core_is_adsp_readyfunction q6core_get_svc_api_infofunction q6core_is_adsp_readyfunction q6core_probefunction q6core_exitexport q6core_get_svc_api_infoexport q6core_is_adsp_ready
Annotated Snippet
struct avcs_svc_info {
uint32_t service_id;
uint32_t version;
} __packed;
struct avcs_cmdrsp_get_version {
uint32_t build_id;
uint32_t num_services;
struct avcs_svc_info svc_api_info[];
} __packed;
/* for ADSP2.8 and above */
struct avcs_svc_api_info {
uint32_t service_id;
uint32_t api_version;
uint32_t api_branch_version;
} __packed;
struct avcs_cmdrsp_get_fwk_version {
uint32_t build_major_version;
uint32_t build_minor_version;
uint32_t build_branch_version;
uint32_t build_subbranch_version;
uint32_t num_services;
struct avcs_svc_api_info svc_api_info[];
} __packed;
struct q6core {
struct apr_device *adev;
wait_queue_head_t wait;
uint32_t avcs_state;
struct mutex lock;
bool resp_received;
uint32_t num_services;
struct avcs_cmdrsp_get_fwk_version *fwk_version;
struct avcs_cmdrsp_get_version *svc_version;
bool fwk_version_supported;
bool get_state_supported;
bool get_version_supported;
bool is_version_requested;
};
static struct q6core *g_core;
static int q6core_callback(struct apr_device *adev, const struct apr_resp_pkt *data)
{
struct q6core *core = dev_get_drvdata(&adev->dev);
const struct aprv2_ibasic_rsp_result_t *result;
const struct apr_hdr *hdr = &data->hdr;
result = data->payload;
switch (hdr->opcode) {
case APR_BASIC_RSP_RESULT:{
result = data->payload;
switch (result->opcode) {
case AVCS_GET_VERSIONS:
if (result->status == ADSP_EUNSUPPORTED)
core->get_version_supported = false;
core->resp_received = true;
break;
case AVCS_CMD_GET_FWK_VERSION:
if (result->status == ADSP_EUNSUPPORTED)
core->fwk_version_supported = false;
core->resp_received = true;
break;
case AVCS_CMD_ADSP_EVENT_GET_STATE:
if (result->status == ADSP_EUNSUPPORTED)
core->get_state_supported = false;
core->resp_received = true;
break;
}
break;
}
case AVCS_CMDRSP_GET_FWK_VERSION: {
struct avcs_cmdrsp_get_fwk_version *fwk;
fwk = data->payload;
core->fwk_version = kmemdup(data->payload,
struct_size(fwk, svc_api_info,
fwk->num_services),
GFP_ATOMIC);
if (!core->fwk_version)
return -ENOMEM;
core->fwk_version_supported = true;
core->resp_received = true;
break;
}
Annotation
- Immediate include surface: `linux/slab.h`, `linux/wait.h`, `linux/kernel.h`, `linux/module.h`, `linux/sched.h`, `linux/of.h`, `linux/of_platform.h`, `linux/jiffies.h`.
- Detected declarations: `struct avcs_svc_info`, `struct avcs_cmdrsp_get_version`, `struct avcs_svc_api_info`, `struct avcs_cmdrsp_get_fwk_version`, `struct q6core`, `function q6core_callback`, `function q6core_get_fwk_versions`, `function q6core_get_svc_versions`, `function __q6core_is_adsp_ready`, `function q6core_get_svc_api_info`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: integration 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.