sound/soc/qcom/qdsp6/q6apm.h
Source file repositories/reference/linux-study-clean/sound/soc/qcom/qdsp6/q6apm.h
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/qcom/qdsp6/q6apm.h- Extension
.h- Size
- 5768 bytes
- Lines
- 170
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/atomic.hlinux/slab.hlinux/wait.hlinux/kernel.hlinux/module.hlinux/sched.hlinux/of.hlinux/delay.hsound/soc.hlinux/of_platform.hlinux/jiffies.hlinux/soc/qcom/apr.h../common.haudioreach.h
Detected Declarations
struct q6apmstruct audio_bufferstruct audioreach_graph_datastruct audioreach_graphstruct q6apm_graph
Annotated Snippet
struct q6apm {
struct device *dev;
gpr_port_t *port;
gpr_device_t *gdev;
/* For Graph OPEN/START/STOP/CLOSE operations */
wait_queue_head_t wait;
struct gpr_ibasic_rsp_result_t result;
struct mutex cmd_lock;
struct mutex lock;
uint32_t state;
struct list_head widget_list;
struct idr graph_idr;
struct idr graph_info_idr;
struct idr sub_graphs_idr;
struct idr containers_idr;
struct idr modules_idr;
};
struct audio_buffer {
phys_addr_t phys;
uint32_t size; /* size of buffer */
};
struct audioreach_graph_data {
struct audio_buffer *buf;
uint32_t num_periods;
uint32_t dsp_buf;
atomic_t hw_ptr;
};
struct audioreach_graph {
struct audioreach_graph_info *info;
uint32_t id;
int state;
int start_count;
/* Cached Graph data */
void *graph;
struct kref refcount;
struct q6apm *apm;
};
typedef void (*q6apm_cb) (uint32_t opcode, uint32_t token,
void *payload, void *priv);
struct q6apm_graph {
void *priv;
q6apm_cb cb;
uint32_t id;
uint32_t shm_iid;
struct device *dev;
struct q6apm *apm;
gpr_port_t *port;
struct audioreach_graph_data rx_data;
struct audioreach_graph_data tx_data;
struct gpr_ibasic_rsp_result_t result;
wait_queue_head_t cmd_wait;
struct mutex lock;
struct audioreach_graph *ar_graph;
struct audioreach_graph_info *info;
};
/* Graph Operations */
struct q6apm_graph *q6apm_graph_open(struct device *dev, q6apm_cb cb,
void *priv, int graph_id, int dir);
int q6apm_graph_close(struct q6apm_graph *graph);
int q6apm_graph_prepare(struct q6apm_graph *graph);
int q6apm_graph_start(struct q6apm_graph *graph);
int q6apm_graph_stop(struct q6apm_graph *graph);
int q6apm_graph_flush(struct q6apm_graph *graph);
/* Media Format */
int q6apm_graph_media_format_pcm(struct q6apm_graph *graph,
struct audioreach_module_config *cfg);
int q6apm_graph_media_format_shmem(struct q6apm_graph *graph,
struct audioreach_module_config *cfg);
/* read/write related */
int q6apm_read(struct q6apm_graph *graph);
int q6apm_write_async(struct q6apm_graph *graph, uint32_t len, uint32_t msw_ts,
uint32_t lsw_ts, uint32_t wflags);
/* Memory Map related */
int q6apm_map_memory_fixed_region(struct device *dev,
unsigned int graph_id, phys_addr_t phys,
size_t sz);
int q6apm_map_pos_buffer(struct device *dev,
unsigned int graph_id, phys_addr_t phys,
size_t sz);
Annotation
- Immediate include surface: `linux/types.h`, `linux/atomic.h`, `linux/slab.h`, `linux/wait.h`, `linux/kernel.h`, `linux/module.h`, `linux/sched.h`, `linux/of.h`.
- Detected declarations: `struct q6apm`, `struct audio_buffer`, `struct audioreach_graph_data`, `struct audioreach_graph`, `struct q6apm_graph`.
- 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.