drivers/media/i2c/gc08a3.c

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

File Facts

System
Linux kernel
Corpus path
drivers/media/i2c/gc08a3.c
Extension
.c
Size
33607 bytes
Lines
1328
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 gc08a3 {
	struct device *dev;
	struct v4l2_subdev sd;
	struct media_pad pad;

	struct clk *xclk;
	struct regulator_bulk_data supplies[ARRAY_SIZE(gc08a3_supply_name)];
	struct gpio_desc *reset_gpio;

	struct v4l2_ctrl_handler ctrls;
	struct v4l2_ctrl *pixel_rate;
	struct v4l2_ctrl *link_freq;
	struct v4l2_ctrl *exposure;
	struct v4l2_ctrl *vblank;
	struct v4l2_ctrl *hblank;
	struct v4l2_ctrl *hflip;
	struct v4l2_ctrl *vflip;

	struct regmap *regmap;
	unsigned long link_freq_bitmap;
	const struct gc08a3_mode *cur_mode;
};

struct gc08a3_reg_list {
	u32 num_of_regs;
	const struct cci_reg_sequence *regs;
};

static const struct cci_reg_sequence mode_3264x2448[] = {
	/* system */
	{ CCI_REG8(0x0336), 0x70 },
	{ CCI_REG8(0x0383), 0xbb },
	{ CCI_REG8(0x0344), 0x00 },
	{ CCI_REG8(0x0345), 0x06 },
	{ CCI_REG8(0x0346), 0x00 },
	{ CCI_REG8(0x0347), 0x04 },
	{ CCI_REG8(0x0348), 0x0c },
	{ CCI_REG8(0x0349), 0xd0 },
	{ CCI_REG8(0x034a), 0x09 },
	{ CCI_REG8(0x034b), 0x9c },
	{ CCI_REG8(0x0202), 0x09 },
	{ CCI_REG8(0x0203), 0x04 },
	{ CCI_REG8(0x0340), 0x09 },
	{ CCI_REG8(0x0341), 0xf4 },
	{ CCI_REG8(0x0342), 0x07 },
	{ CCI_REG8(0x0343), 0x1c },

	{ CCI_REG8(0x0226), 0x00 },
	{ CCI_REG8(0x0227), 0x28 },
	{ CCI_REG8(0x0e38), 0x49 },
	{ CCI_REG8(0x0210), 0x13 },
	{ CCI_REG8(0x0218), 0x00 },
	{ CCI_REG8(0x0241), 0x88 },
	{ CCI_REG8(0x0392), 0x60 },

	/* ISP */
	{ CCI_REG8(0x00a2), 0x00 },
	{ CCI_REG8(0x00a3), 0x00 },
	{ CCI_REG8(0x00ab), 0x00 },
	{ CCI_REG8(0x00ac), 0x00 },

	/* GAIN */
	{ CCI_REG8(0x0204), 0x04 },
	{ CCI_REG8(0x0205), 0x00 },
	{ CCI_REG8(0x0050), 0x5c },
	{ CCI_REG8(0x0051), 0x44 },

	/* out window */
	{ CCI_REG8(0x009a), 0x66 },
	{ CCI_REG8(0x0351), 0x00 },
	{ CCI_REG8(0x0352), 0x06 },
	{ CCI_REG8(0x0353), 0x00 },
	{ CCI_REG8(0x0354), 0x08 },
	{ CCI_REG8(0x034c), 0x0c },
	{ CCI_REG8(0x034d), 0xc0 },
	{ CCI_REG8(0x034e), 0x09 },
	{ CCI_REG8(0x034f), 0x90 },

	/* MIPI */
	{ CCI_REG8(0x0114), 0x03 },
	{ CCI_REG8(0x0180), 0x65 },
	{ CCI_REG8(0x0181), 0xf0 },
	{ CCI_REG8(0x0185), 0x01 },
	{ CCI_REG8(0x0115), 0x30 },
	{ CCI_REG8(0x011b), 0x12 },
	{ CCI_REG8(0x011c), 0x12 },
	{ CCI_REG8(0x0121), 0x06 },
	{ CCI_REG8(0x0122), 0x06 },
	{ CCI_REG8(0x0123), 0x15 },
	{ CCI_REG8(0x0124), 0x01 },

Annotation

Implementation Notes