drivers/media/i2c/gc05a2.c

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

File Facts

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

	struct clk *xclk;
	struct regulator_bulk_data supplies[ARRAY_SIZE(gc05a2_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;

	/* True if the device has been identified */
	bool identified;
	const struct gc05a2_mode *cur_mode;
};

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

static const struct cci_reg_sequence mode_2592x1944[] = {
	/* system */
	{ CCI_REG8(0x0135), 0x01 },
	{ CCI_REG8(0x0084), 0x21 },
	{ CCI_REG8(0x0d05), 0xcc },
	{ CCI_REG8(0x0218), 0x00 },
	{ CCI_REG8(0x005e), 0x48 },
	{ CCI_REG8(0x0d06), 0x01 },
	{ CCI_REG8(0x0007), 0x16 },
	{ CCI_REG8(0x0101), 0x00 },

	/* analog */
	{ CCI_REG8(0x0342), 0x07 },
	{ CCI_REG8(0x0343), 0x28 },
	{ CCI_REG8(0x0220), 0x07 },
	{ CCI_REG8(0x0221), 0xd0 },
	{ CCI_REG8(0x0202), 0x07 },
	{ CCI_REG8(0x0203), 0x32 },
	{ CCI_REG8(0x0340), 0x07 },
	{ CCI_REG8(0x0341), 0xf0 },
	{ CCI_REG8(0x0219), 0x00 },
	{ CCI_REG8(0x0346), 0x00 },
	{ CCI_REG8(0x0347), 0x04 },
	{ CCI_REG8(0x0d14), 0x00 },
	{ CCI_REG8(0x0d13), 0x05 },
	{ CCI_REG8(0x0d16), 0x05 },
	{ CCI_REG8(0x0d15), 0x1d },
	{ CCI_REG8(0x00c0), 0x0a },
	{ CCI_REG8(0x00c1), 0x30 },
	{ CCI_REG8(0x034a), 0x07 },
	{ CCI_REG8(0x034b), 0xa8 },
	{ CCI_REG8(0x0e0a), 0x00 },
	{ CCI_REG8(0x0e0b), 0x00 },
	{ CCI_REG8(0x0e0e), 0x03 },
	{ CCI_REG8(0x0e0f), 0x00 },
	{ CCI_REG8(0x0e06), 0x0a },
	{ CCI_REG8(0x0e23), 0x15 },
	{ CCI_REG8(0x0e24), 0x15 },
	{ CCI_REG8(0x0e2a), 0x10 },
	{ CCI_REG8(0x0e2b), 0x10 },
	{ CCI_REG8(0x0e17), 0x49 },
	{ CCI_REG8(0x0e1b), 0x1c },
	{ CCI_REG8(0x0e3a), 0x36 },
	{ CCI_REG8(0x0d11), 0x84 },
	{ CCI_REG8(0x0e52), 0x14 },
	{ CCI_REG8(0x000b), 0x10 },
	{ CCI_REG8(0x0008), 0x08 },
	{ CCI_REG8(0x0223), 0x17 },
	{ CCI_REG8(0x0d27), 0x39 },
	{ CCI_REG8(0x0d22), 0x00 },
	{ CCI_REG8(0x03f6), 0x0d },
	{ CCI_REG8(0x0d04), 0x07 },
	{ CCI_REG8(0x03f3), 0x72 },
	{ CCI_REG8(0x03f4), 0xb8 },
	{ CCI_REG8(0x03f5), 0xbc },
	{ CCI_REG8(0x0d02), 0x73 },

	/* auto load start */
	{ CCI_REG8(0x00cb), 0x00 },

Annotation

Implementation Notes