sound/soc/intel/avs/avs.h
Source file repositories/reference/linux-study-clean/sound/soc/intel/avs/avs.h
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/intel/avs/avs.h- Extension
.h- Size
- 13329 bytes
- Lines
- 368
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/debugfs.hlinux/device.hlinux/firmware.hlinux/kfifo.hsound/hda_codec.hsound/hda_register.hsound/soc-component.hmessages.hregisters.h
Detected Declarations
struct avs_devstruct avs_tplgstruct avs_tplg_librarystruct avs_ipc_msgstruct avs_dsp_opsstruct avs_sram_specstruct avs_hipc_specstruct avs_specstruct avs_fw_entrystruct avs_devstruct avs_ipc_msgstruct avs_ipcstruct avs_soc_component
Annotated Snippet
struct avs_dsp_ops {
int (* const power)(struct avs_dev *, u32, bool);
int (* const reset)(struct avs_dev *, u32, bool);
int (* const stall)(struct avs_dev *, u32, bool);
irqreturn_t (* const dsp_interrupt)(struct avs_dev *);
void (* const int_control)(struct avs_dev *, bool);
int (* const load_basefw)(struct avs_dev *, struct firmware *);
int (* const load_lib)(struct avs_dev *, struct firmware *, u32);
int (* const transfer_mods)(struct avs_dev *, bool, struct avs_module_entry *, u32);
int (* const config_basefw)(struct avs_dev *);
int (* const enable_logs)(struct avs_dev *, enum avs_log_enable, u32, u32, unsigned long,
u32 *);
int (* const log_buffer_offset)(struct avs_dev *, u32);
int (* const log_buffer_status)(struct avs_dev *, union avs_notify_msg *);
int (* const coredump)(struct avs_dev *, union avs_notify_msg *);
bool (* const d0ix_toggle)(struct avs_dev *, struct avs_ipc_msg *, bool);
int (* const set_d0ix)(struct avs_dev *, bool);
};
#define avs_dsp_op(adev, op, ...) \
((adev)->spec->dsp_ops->op(adev, ## __VA_ARGS__))
extern const struct avs_dsp_ops avs_skl_dsp_ops;
extern const struct avs_dsp_ops avs_apl_dsp_ops;
extern const struct avs_dsp_ops avs_cnl_dsp_ops;
extern const struct avs_dsp_ops avs_icl_dsp_ops;
extern const struct avs_dsp_ops avs_tgl_dsp_ops;
extern const struct avs_dsp_ops avs_ptl_dsp_ops;
#define AVS_PLATATTR_CLDMA BIT_ULL(0)
#define AVS_PLATATTR_IMR BIT_ULL(1)
#define AVS_PLATATTR_ACE BIT_ULL(2)
#define AVS_PLATATTR_ALTHDA BIT_ULL(3)
#define avs_platattr_test(adev, attr) \
((adev)->spec->attributes & AVS_PLATATTR_##attr)
struct avs_sram_spec {
const u32 base_offset;
const u32 window_size;
};
struct avs_hipc_spec {
const u32 req_offset;
const u32 req_ext_offset;
const u32 req_busy_mask;
const u32 ack_offset;
const u32 ack_done_mask;
const u32 rsp_offset;
const u32 rsp_busy_mask;
const u32 ctl_offset;
const u32 sts_offset;
};
/* Platform specific descriptor */
struct avs_spec {
const char *name;
const struct avs_dsp_ops *const dsp_ops;
struct avs_fw_version min_fw_version; /* anything below is rejected */
const u32 core_init_mask; /* used during DSP boot */
const u64 attributes; /* bitmask of AVS_PLATATTR_* */
const struct avs_sram_spec *sram;
const struct avs_hipc_spec *hipc;
};
struct avs_fw_entry {
const char *name;
const struct firmware *fw;
struct list_head node;
};
/*
* struct avs_dev - Intel HD-Audio driver data
*
* @dev: PCI device
* @dsp_ba: DSP bar address
* @spec: platform-specific descriptor
* @fw_cfg: Firmware configuration, obtained through FW_CONFIG message
* @hw_cfg: Hardware configuration, obtained through HW_CONFIG message
* @mods_info: Available module-types, obtained through MODULES_INFO message
* @mod_idas: Module instance ID pool, one per module-type
* @modres_mutex: For synchronizing any @mods_info updates
* @ppl_ida: Pipeline instance ID pool
* @fw_list: List of libraries loaded, including base firmware
*/
struct avs_dev {
struct hda_bus base;
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/device.h`, `linux/firmware.h`, `linux/kfifo.h`, `sound/hda_codec.h`, `sound/hda_register.h`, `sound/soc-component.h`, `messages.h`.
- Detected declarations: `struct avs_dev`, `struct avs_tplg`, `struct avs_tplg_library`, `struct avs_ipc_msg`, `struct avs_dsp_ops`, `struct avs_sram_spec`, `struct avs_hipc_spec`, `struct avs_spec`, `struct avs_fw_entry`, `struct avs_dev`.
- 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.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.