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.

Dependency Surface

Detected Declarations

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

Implementation Notes