drivers/media/i2c/og01a1b.c

Source file repositories/reference/linux-study-clean/drivers/media/i2c/og01a1b.c

File Facts

System
Linux kernel
Corpus path
drivers/media/i2c/og01a1b.c
Extension
.c
Size
30066 bytes
Lines
1143
Domain
Driver Families
Bucket
drivers/media
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 og01a1b_reg_list {
	const struct cci_reg_sequence *regs;
	u32 num_of_regs;
};

struct og01a1b_link_freq_config {
	const struct og01a1b_reg_list reg_list;
};

struct og01a1b_mode {
	/* Frame width in pixels */
	u32 width;

	/* Frame height in pixels */
	u32 height;

	/* Horizontal timining size */
	u32 hts;

	/* Default vertical timining size */
	u32 vts_def;

	/* Min vertical timining size */
	u32 vts_min;

	/* Link frequency needed for this resolution */
	u32 link_freq_index;

	/* Sensor register settings for this resolution */
	const struct og01a1b_reg_list reg_list;
};

static const u32 og01a1b_mbus_formats[] = {
	MEDIA_BUS_FMT_Y10_1X10,
	MEDIA_BUS_FMT_Y8_1X8,
};

static const struct cci_reg_sequence mipi_data_rate_1000mbps[] = {
	{ CCI_REG8(0x0103), 0x01 },
	{ CCI_REG8(0x0303), 0x02 },
	{ CCI_REG8(0x0304), 0x00 },
	{ CCI_REG8(0x0305), 0xd2 },
	{ CCI_REG8(0x0323), 0x02 },
	{ CCI_REG8(0x0324), 0x01 },
	{ CCI_REG8(0x0325), 0x77 },
};

static const struct cci_reg_sequence mode_1280x1024_regs[] = {
	{ CCI_REG8(0x0300), 0x0a },
	{ CCI_REG8(0x0301), 0x29 },
	{ CCI_REG8(0x0302), 0x31 },
	{ CCI_REG8(0x0303), 0x02 },
	{ CCI_REG8(0x0304), 0x00 },
	{ CCI_REG8(0x0305), 0xd2 },
	{ CCI_REG8(0x0306), 0x00 },
	{ CCI_REG8(0x0307), 0x01 },
	{ CCI_REG8(0x0308), 0x02 },
	{ CCI_REG8(0x0309), 0x00 },
	{ CCI_REG8(0x0310), 0x00 },
	{ CCI_REG8(0x0311), 0x00 },
	{ CCI_REG8(0x0312), 0x07 },
	{ CCI_REG8(0x0313), 0x00 },
	{ CCI_REG8(0x0314), 0x00 },
	{ CCI_REG8(0x0315), 0x00 },
	{ CCI_REG8(0x0320), 0x02 },
	{ CCI_REG8(0x0321), 0x01 },
	{ CCI_REG8(0x0322), 0x01 },
	{ CCI_REG8(0x0323), 0x02 },
	{ CCI_REG8(0x0324), 0x01 },
	{ CCI_REG8(0x0325), 0x77 },
	{ CCI_REG8(0x0326), 0xce },
	{ CCI_REG8(0x0327), 0x04 },
	{ CCI_REG8(0x0329), 0x02 },
	{ CCI_REG8(0x032a), 0x04 },
	{ CCI_REG8(0x032b), 0x04 },
	{ CCI_REG8(0x032c), 0x02 },
	{ CCI_REG8(0x032d), 0x01 },
	{ CCI_REG8(0x032e), 0x00 },
	{ CCI_REG8(0x300d), 0x02 },
	{ CCI_REG8(0x300e), 0x04 },
	{ CCI_REG8(0x3021), 0x08 },
	{ CCI_REG8(0x301e), 0x03 },
	{ CCI_REG8(0x3103), 0x00 },
	{ CCI_REG8(0x3106), 0x08 },
	{ CCI_REG8(0x3107), 0x40 },
	{ CCI_REG8(0x3216), 0x01 },
	{ CCI_REG8(0x3217), 0x00 },
	{ CCI_REG8(0x3218), 0xc0 },
	{ CCI_REG8(0x3219), 0x55 },
	{ CCI_REG8(0x3500), 0x00 },

Annotation

Implementation Notes