drivers/soundwire/bus.h

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

File Facts

System
Linux kernel
Corpus path
drivers/soundwire/bus.h
Extension
.h
Size
7119 bytes
Lines
246
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_msg {
	u16 addr;
	u16 len;
	u8 dev_num;
	u8 addr_page1;
	u8 addr_page2;
	u8 flags;
	u8 *buf;
	bool ssp_sync;
	bool page;
};

/**
 * struct sdw_btp_section - Message section structure
 * @addr: Start Register address accessed in the Slave
 * @len: number of bytes to transfer. More than 64Kb can be transferred
 * but a practical limit of SDW_BPT_MSG_MAX_BYTES is enforced.
 * @buf: section data buffer (filled by host for write, filled
 * by Peripheral hardware for reads)
 */
struct sdw_bpt_section {
	u32 addr;
	u32 len;
	u8 *buf;
};

/**
 * struct sdw_btp_msg - Message structure
 * @sec: Pointer to array of sections
 * @sections: Number of sections in the array
 * @dev_num: Slave device number
 * @flags: transfer flags, indicate if xfer is read or write
 */
struct sdw_bpt_msg {
	struct sdw_bpt_section *sec;
	int sections;
	u8 dev_num;
	u8 flags;
};

#define SDW_DOUBLE_RATE_FACTOR		2
#define SDW_STRM_RATE_GROUPING		1

extern int sdw_rows[SDW_FRAME_ROWS];
extern int sdw_cols[SDW_FRAME_COLS];

int sdw_find_row_index(int row);
int sdw_find_col_index(int col);

/**
 * sdw_port_runtime: Runtime port parameters for Master or Slave
 *
 * @num: Port number. For audio streams, valid port number ranges from
 * [1,14]
 * @ch_mask: Channel mask
 * @transport_params: Transport parameters
 * @port_params: Port parameters
 * @port_node: List node for Master or Slave port_list
 * @lane: Which lane is used
 *
 * SoundWire spec has no mention of ports for Master interface but the
 * concept is logically extended.
 */
struct sdw_port_runtime {
	int num;
	int ch_mask;
	struct sdw_transport_params transport_params;
	struct sdw_port_params port_params;
	struct list_head port_node;
	unsigned int lane;
};

/**
 * sdw_slave_runtime: Runtime Stream parameters for Slave
 *
 * @slave: Slave handle
 * @direction: Data direction for Slave
 * @ch_count: Number of channels handled by the Slave for
 * this stream
 * @m_rt_node: sdw_master_runtime list node
 * @port_list: List of Slave Ports configured for this stream
 */
struct sdw_slave_runtime {
	struct sdw_slave *slave;
	enum sdw_data_direction direction;
	unsigned int ch_count;
	struct list_head m_rt_node;
	struct list_head port_list;
};

Annotation

Implementation Notes