drivers/media/i2c/ov08x40.c

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

File Facts

System
Linux kernel
Corpus path
drivers/media/i2c/ov08x40.c
Extension
.c
Size
51932 bytes
Lines
2406
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 ov08x40_reg {
	u16 address;
	u8 val;
};

struct ov08x40_reg_list {
	u32 num_of_regs;
	const struct ov08x40_reg *regs;
};

/* Link frequency config */
struct ov08x40_link_freq_config {
	/* registers for this link frequency */
	struct ov08x40_reg_list reg_list;
};

/* Mode : resolution and related config&values */
struct ov08x40_mode {
	/* Frame width */
	u32 width;
	/* Frame height */
	u32 height;

	u32 lanes;
	/* V-timing */
	u32 vts_def;
	u32 vts_min;

	/* Line Length Pixels */
	u32 llp;

	/* Index of Link frequency config to be used */
	u32 link_freq_index;
	/* Default register values */
	struct ov08x40_reg_list reg_list;

	/* Exposure calculation */
	u16 exposure_margin;
	u16 exposure_shift;
};

static const struct ov08x40_reg ov08x40_global_regs[] = {
	{0x1216, 0x60},
	{0x1217, 0x5b},
	{0x1218, 0x00},
	{0x1220, 0x24},
	{0x198a, 0x00},
	{0x198b, 0x01},
	{0x198e, 0x00},
	{0x198f, 0x01},
	{0x3009, 0x04},
	{0x3015, 0x00},
	{0x3016, 0xb0},
	{0x3017, 0xf0},
	{0x3018, 0xf0},
	{0x3019, 0xd2},
	{0x301a, 0xb0},
	{0x301c, 0x81},
	{0x301d, 0x02},
	{0x301e, 0x80},
	{0x3022, 0xf0},
	{0x3025, 0x89},
	{0x3030, 0x03},
	{0x3044, 0xc2},
	{0x3050, 0x35},
	{0x3051, 0x60},
	{0x3052, 0x25},
	{0x3053, 0x00},
	{0x3054, 0x00},
	{0x3055, 0x02},
	{0x3056, 0x80},
	{0x3057, 0x80},
	{0x3058, 0x80},
	{0x3059, 0x00},
	{0x3107, 0x86},
	{0x3401, 0x80},
	{0x3402, 0x8c},
	{0x3404, 0x01},
	{0x3407, 0x01},
	{0x341b, 0x30},
	{0x3420, 0x00},
	{0x3421, 0x00},
	{0x3422, 0x00},
	{0x3423, 0x00},
	{0x3424, 0x00},
	{0x3425, 0x00},
	{0x3426, 0x10},
	{0x3427, 0x00},
	{0x3428, 0x0f},
	{0x3429, 0x00},

Annotation

Implementation Notes