sound/soc/amd/acp/amd.h

Source file repositories/reference/linux-study-clean/sound/soc/amd/acp/amd.h

File Facts

System
Linux kernel
Corpus path
sound/soc/amd/acp/amd.h
Extension
.h
Size
11444 bytes
Lines
366
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 acp_chip_info {
	char *name;		/* Platform name */
	struct resource *res;
	struct device *dev;
	struct snd_soc_dai_driver *dai_driver;

	unsigned int acp_rev;	/* ACP Revision id */
	void __iomem *base;	/* ACP memory PCI base */
	struct snd_acp_hw_ops *acp_hw_ops;
	int (*acp_hw_ops_init)(struct acp_chip_info *chip);
	struct platform_device *chip_pdev;
	struct acp_resource *rsrc; /* Platform specific resources*/
	struct list_head stream_list;
	spinlock_t acp_lock; /* Used to protect stream_list */
	struct platform_device *dmic_codec_dev;
	struct platform_device *acp_plat_dev;
	struct platform_device *mach_dev;
	struct snd_soc_acpi_mach *machines;
	int num_dai;
	u32 addr;
	u32 bclk_div;
	u32 lrclk_div;
	u32 ch_mask;
	u32 tdm_tx_fmt[3];
	u32 tdm_rx_fmt[3];
	u32 xfer_tx_resolution[3];
	u32 xfer_rx_resolution[3];
	unsigned int flag;	/* Distinguish b/w Legacy or Only PDM */
	bool is_pdm_dev;	/* flag set to true when ACP PDM controller exists */
	bool is_pdm_config;	/* flag set to true when PDM configuration is selected from BIOS */
	bool is_i2s_config;	/* flag set to true when I2S configuration is selected from BIOS */
	bool tdm_mode;
};

struct acp_stream {
	struct list_head list;
	struct snd_pcm_substream *substream;
	int irq_bit;
	int dai_id;
	int id;
	int dir;
	u64 bytescount;
	u32 reg_offset;
	u32 pte_offset;
	u32 fifo_offset;
};

struct acp_resource {
	int offset;
	int no_of_ctrls;
	int irqp_used;
	bool soc_mclk;
	u32 irq_reg_offset;
	u64 scratch_reg_offset;
	u64 sram_pte_offset;
};

/**
 * struct snd_acp_hw_ops - ACP PCI driver platform specific ops
 * @acp_init: ACP initialization
 * @acp_deinit: ACP de-initialization
 * @irq: ACP irq handler
 * @en_interrupts: ACP enable interrupts
 * @dis_interrupts: ACP disable interrupts
 */
struct snd_acp_hw_ops {
	/* ACP hardware initilizations */
	int (*acp_init)(struct acp_chip_info *chip);
	int (*acp_deinit)(struct acp_chip_info *chip);

	/* ACP Interrupts*/
	irqreturn_t (*irq)(int irq, void *data);
	int (*en_interrupts)(struct acp_chip_info *chip);
	int (*dis_interrupts)(struct acp_chip_info *chip);
};

enum acp_config {
	ACP_CONFIG_0 = 0,
	ACP_CONFIG_1,
	ACP_CONFIG_2,
	ACP_CONFIG_3,
	ACP_CONFIG_4,
	ACP_CONFIG_5,
	ACP_CONFIG_6,
	ACP_CONFIG_7,
	ACP_CONFIG_8,
	ACP_CONFIG_9,
	ACP_CONFIG_10,
	ACP_CONFIG_11,
	ACP_CONFIG_12,

Annotation

Implementation Notes