drivers/i3c/master/mipi-i3c-hci/hci.h

Source file repositories/reference/linux-study-clean/drivers/i3c/master/mipi-i3c-hci/hci.h

File Facts

System
Linux kernel
Corpus path
drivers/i3c/master/mipi-i3c-hci/hci.h
Extension
.h
Size
5755 bytes
Lines
195
Domain
Driver Families
Bucket
drivers/i3c
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 dat_words {
	u32 w0;
	u32 w1;
};

/* Our main structure */
struct i3c_hci {
	struct i3c_master_controller master;
	void __iomem *base_regs;
	void __iomem *DAT_regs;
	void __iomem *DCT_regs;
	void __iomem *RHS_regs;
	void __iomem *PIO_regs;
	void __iomem *EXTCAPS_regs;
	void __iomem *AUTOCMD_regs;
	void __iomem *DEBUG_regs;
	const struct hci_io_ops *io;
	void *io_data;
	const struct hci_cmd_ops *cmd;
	spinlock_t lock;
	struct mutex control_mutex;
	atomic_t next_cmd_tid;
	bool irq_inactive;
	bool enqueue_blocked;
	bool recovery_needed;
	bool hj_init_done;
	wait_queue_head_t enqueue_wait_queue;
	u32 caps;
	unsigned int quirks;
	unsigned int DAT_entries;
	unsigned int DAT_entry_size;
	void *DAT_data;
	struct dat_words *DAT;
	struct i3c_dev_desc **ibi_devs;
	unsigned int DCT_entries;
	unsigned int DCT_entry_size;
	u8 version_major;
	u8 version_minor;
	u8 revision;
	u8 dyn_addr;
	u32 vendor_mipi_id;
	u32 vendor_version_id;
	u32 vendor_product_id;
	void *vendor_data;
};

/*
 * Structure to represent a master initiated transfer.
 * The rnw, data and data_len fields must be initialized before calling any
 * hci->cmd->*() method. The cmd method will initialize cmd_desc[] and
 * possibly modify (clear) the data field. Then xfer->cmd_desc[0] can
 * be augmented with CMD_0_ROC and/or CMD_0_TOC.
 * The completion field needs to be initialized before queueing with
 * hci->io->queue_xfer(), and requires CMD_0_ROC to be set.
 */
struct hci_xfer {
	u32 cmd_desc[4];
	u32 response;
	bool rnw;
	bool started;
	void *data;
	unsigned int data_len;
	unsigned int cmd_tid;
	struct completion *completion;
	unsigned long timeout;
	unsigned long start_jiffies;
	union {
		struct {
			/* PIO specific */
			struct hci_xfer *next_xfer;
			struct hci_xfer *next_data;
			struct hci_xfer *next_resp;
			unsigned int data_left;
			u32 data_word_before_partial;
		};
		struct {
			/* DMA specific */
			struct i3c_dma *dma;
			struct hci_xfer *final_xfer;
			int ring_number;
			int ring_entry;
			int xfer_list_pos;
		};
	};
};

static inline struct hci_xfer *hci_alloc_xfer(unsigned int n)
{
	return kzalloc_objs(struct hci_xfer, n);
}

Annotation

Implementation Notes