drivers/soundwire/intel.h

Source file repositories/reference/linux-study-clean/drivers/soundwire/intel.h

File Facts

System
Linux kernel
Corpus path
drivers/soundwire/intel.h
Extension
.h
Size
7511 bytes
Lines
271
Domain
Driver Families
Bucket
drivers/soundwire
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 sdw_intel_link_res {
	const struct sdw_intel_hw_ops *hw_ops;

	void __iomem *mmio_base; /* not strictly needed, useful for debug */
	void __iomem *registers;
	u32 ip_offset;
	void __iomem *shim;
	void __iomem *shim_vs;
	void __iomem *alh;
	int irq;
	const struct sdw_intel_ops *ops;
	struct device *dev;
	struct mutex *shim_lock; /* protect shared registers */
	u32 *shim_mask;
	u32 clock_stop_quirks;
	bool mic_privacy;
	u32 link_mask;
	struct sdw_cdns *cdns;
	struct list_head list;
	struct hdac_bus *hbus;
};

/**
 * struct sdw_intel_bpt - SoundWire Intel BPT context
 * @bpt_tx_stream: BPT TX stream
 * @dmab_tx_bdl: BPT TX buffer descriptor list
 * @bpt_rx_stream: BPT RX stream
 * @dmab_rx_bdl: BPT RX buffer descriptor list
 * @pdi0_buffer_size: PDI0 buffer size
 * @pdi1_buffer_size: PDI1 buffer size
 * @num_frames: number of frames
 * @data_per_frame: data per frame
 */
struct sdw_intel_bpt {
	struct hdac_ext_stream *bpt_tx_stream;
	struct snd_dma_buffer dmab_tx_bdl;
	struct hdac_ext_stream *bpt_rx_stream;
	struct snd_dma_buffer dmab_rx_bdl;
	unsigned int pdi0_buffer_size;
	unsigned int pdi1_buffer_size;
	unsigned int num_frames;
	unsigned int data_per_frame;
};

struct sdw_intel {
	struct sdw_cdns cdns;
	int instance;
	struct sdw_intel_link_res *link_res;
	bool startup_done;
	struct sdw_intel_bpt bpt_ctx;
#ifdef CONFIG_DEBUG_FS
	struct dentry *debugfs;
#endif
};

struct sdw_intel_prop {
	u16 clde;
	u16 doaise2;
	u16 dodse2;
	u16 clds;
	u16 clss;
	u16 doaise;
	u16 doais;
	u16 dodse;
	u16 dods;
};

enum intel_pdi_type {
	INTEL_PDI_IN = 0,
	INTEL_PDI_OUT = 1,
	INTEL_PDI_BD = 2,
};

/*
 * Read, write helpers for HW registers
 */
static inline int intel_readl(void __iomem *base, int offset)
{
	return readl(base + offset);
}

static inline void intel_writel(void __iomem *base, int offset, int value)
{
	writel(value, base + offset);
}

static inline u16 intel_readw(void __iomem *base, int offset)
{
	return readw(base + offset);
}

Annotation

Implementation Notes