sound/soc/qcom/qdsp6/q6afe.c
Source file repositories/reference/linux-study-clean/sound/soc/qcom/qdsp6/q6afe.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/qcom/qdsp6/q6afe.c- Extension
.c- Size
- 59664 bytes
- Lines
- 1950
- 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
dt-bindings/sound/qcom,q6afe.hlinux/slab.hlinux/kernel.hlinux/uaccess.hlinux/wait.hlinux/jiffies.hlinux/sched.hlinux/module.hlinux/kref.hlinux/of.hlinux/of_platform.hlinux/spinlock.hlinux/delay.hlinux/soc/qcom/apr.hsound/soc.hsound/soc-dai.hsound/pcm.hsound/pcm_params.hq6dsp-errno.hq6core.hq6afe.h
Detected Declarations
struct q6afestruct afe_port_cmd_device_startstruct afe_port_cmd_device_stopstruct afe_port_param_data_v2struct afe_svc_cmd_set_paramstruct afe_port_cmd_set_param_v2struct afe_param_id_hdmi_multi_chan_audio_cfgstruct afe_param_id_slimbus_cfgstruct afe_clk_cfgstruct afe_digital_clk_cfgstruct afe_param_id_i2s_cfgstruct afe_param_id_tdm_cfgstruct afe_param_id_cdc_dma_cfgstruct afe_param_id_usb_cfgstruct afe_param_id_usb_audio_dev_paramsstruct afe_param_id_usb_audio_dev_lpcm_fmtstruct afe_param_id_usb_audio_svc_intervalstruct afe_clk_setstruct afe_param_id_slot_mapping_cfgstruct q6afe_portstruct afe_cmd_remote_lpass_core_hw_vote_requeststruct afe_cmd_remote_lpass_core_hw_devote_requeststruct afe_port_mapfunction q6afe_port_freefunction q6afe_callbackfunction q6afe_get_port_idfunction afe_apr_send_pktfunction q6afe_set_paramfunction q6afe_port_set_paramfunction q6afe_port_set_param_v2function q6afe_port_set_lpass_clockfunction q6afe_set_lpass_clock_v2function q6afe_set_digital_codec_core_clockfunction q6afe_set_lpass_clockfunction q6afe_port_set_sysclkfunction q6afe_port_stopfunction q6afe_slim_port_preparefunction q6afe_tdm_port_preparefunction afe_port_send_usb_dev_paramfunction afe_port_send_usb_paramsfunction q6afe_usb_port_preparefunction q6afe_hdmi_port_preparefunction q6afe_i2s_port_preparefunction q6afe_cdc_dma_port_preparefunction q6afe_port_startfunction q6afe_port_get_from_idfunction q6afe_port_putfunction q6afe_unvote_lpass_core_hw
Annotated Snippet
struct q6afe {
struct apr_device *apr;
struct device *dev;
struct q6core_svc_api_info ainfo;
struct mutex lock;
struct aprv2_ibasic_rsp_result_t result;
wait_queue_head_t wait;
struct list_head port_list;
spinlock_t port_list_lock;
};
struct afe_port_cmd_device_start {
u16 port_id;
u16 reserved;
} __packed;
struct afe_port_cmd_device_stop {
u16 port_id;
u16 reserved;
/* Reserved for 32-bit alignment. This field must be set to 0.*/
} __packed;
struct afe_port_param_data_v2 {
u32 module_id;
u32 param_id;
u16 param_size;
u16 reserved;
} __packed;
struct afe_svc_cmd_set_param {
uint32_t payload_size;
uint32_t payload_address_lsw;
uint32_t payload_address_msw;
uint32_t mem_map_handle;
} __packed;
struct afe_port_cmd_set_param_v2 {
u16 port_id;
u16 payload_size;
u32 payload_address_lsw;
u32 payload_address_msw;
u32 mem_map_handle;
} __packed;
struct afe_param_id_hdmi_multi_chan_audio_cfg {
u32 hdmi_cfg_minor_version;
u16 datatype;
u16 channel_allocation;
u32 sample_rate;
u16 bit_width;
u16 reserved;
} __packed;
struct afe_param_id_slimbus_cfg {
u32 sb_cfg_minor_version;
/* Minor version used for tracking the version of the SLIMBUS
* configuration interface.
* Supported values: #AFE_API_VERSION_SLIMBUS_CONFIG
*/
u16 slimbus_dev_id;
/* SLIMbus hardware device ID, which is required to handle
* multiple SLIMbus hardware blocks.
* Supported values: - #AFE_SLIMBUS_DEVICE_1 - #AFE_SLIMBUS_DEVICE_2
*/
u16 bit_width;
/* Bit width of the sample.
* Supported values: 16, 24
*/
u16 data_format;
/* Data format supported by the SLIMbus hardware. The default is
* 0 (#AFE_SB_DATA_FORMAT_NOT_INDICATED), which indicates the
* hardware does not perform any format conversions before the data
* transfer.
*/
u16 num_channels;
/* Number of channels.
* Supported values: 1 to #AFE_PORT_MAX_AUDIO_CHAN_CNT
*/
u8 shared_ch_mapping[AFE_PORT_MAX_AUDIO_CHAN_CNT];
/* Mapping of shared channel IDs (128 to 255) to which the
* master port is to be connected.
* Shared_channel_mapping[i] represents the shared channel assigned
* for audio channel i in multichannel audio data.
*/
u32 sample_rate;
/* Sampling rate of the port.
* Supported values:
* - #AFE_PORT_SAMPLE_RATE_8K
* - #AFE_PORT_SAMPLE_RATE_16K
Annotation
- Immediate include surface: `dt-bindings/sound/qcom,q6afe.h`, `linux/slab.h`, `linux/kernel.h`, `linux/uaccess.h`, `linux/wait.h`, `linux/jiffies.h`, `linux/sched.h`, `linux/module.h`.
- Detected declarations: `struct q6afe`, `struct afe_port_cmd_device_start`, `struct afe_port_cmd_device_stop`, `struct afe_port_param_data_v2`, `struct afe_svc_cmd_set_param`, `struct afe_port_cmd_set_param_v2`, `struct afe_param_id_hdmi_multi_chan_audio_cfg`, `struct afe_param_id_slimbus_cfg`, `struct afe_clk_cfg`, `struct afe_digital_clk_cfg`.
- 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.