drivers/media/i2c/ov5693.c

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

File Facts

System
Linux kernel
Corpus path
drivers/media/i2c/ov5693.c
Extension
.c
Size
37367 bytes
Lines
1423
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 ov5693_device {
	struct device *dev;
	struct regmap *regmap;

	/* Protect against concurrent changes to controls */
	struct mutex lock;

	struct gpio_desc *reset;
	struct gpio_desc *powerdown;
	struct regulator_bulk_data supplies[OV5693_NUM_SUPPLIES];
	struct clk *xvclk;

	struct ov5693_mode {
		struct v4l2_rect crop;
		struct v4l2_mbus_framefmt format;
		bool binning_x;
		bool binning_y;
		unsigned int inc_x_odd;
		unsigned int inc_y_odd;
		unsigned int vts;
	} mode;

	struct v4l2_subdev sd;
	struct media_pad pad;

	struct ov5693_v4l2_ctrls {
		struct v4l2_ctrl_handler handler;
		struct v4l2_ctrl *link_freq;
		struct v4l2_ctrl *pixel_rate;
		struct v4l2_ctrl *exposure;
		struct v4l2_ctrl *analogue_gain;
		struct v4l2_ctrl *digital_gain;
		struct v4l2_ctrl *hflip;
		struct v4l2_ctrl *vflip;
		struct v4l2_ctrl *hblank;
		struct v4l2_ctrl *vblank;
		struct v4l2_ctrl *test_pattern;
	} ctrls;
};

static const struct cci_reg_sequence ov5693_global_regs[] = {
	{CCI_REG8(0x3016), 0xf0},
	{CCI_REG8(0x3017), 0xf0},
	{CCI_REG8(0x3018), 0xf0},
	{CCI_REG8(0x3022), 0x01},
	{CCI_REG8(0x3028), 0x44},
	{CCI_REG8(0x3098), 0x02},
	{CCI_REG8(0x3099), 0x19},
	{CCI_REG8(0x309a), 0x02},
	{CCI_REG8(0x309b), 0x01},
	{CCI_REG8(0x309c), 0x00},
	{CCI_REG8(0x30a0), 0xd2},
	{CCI_REG8(0x30a2), 0x01},
	{CCI_REG8(0x30b2), 0x00},
	{CCI_REG8(0x30b3), 0x83},
	{CCI_REG8(0x30b4), 0x03},
	{CCI_REG8(0x30b5), 0x04},
	{CCI_REG8(0x30b6), 0x01},
	{CCI_REG8(0x3080), 0x01},
	{CCI_REG8(0x3104), 0x21},
	{CCI_REG8(0x3106), 0x00},
	{CCI_REG8(0x3406), 0x01},
	{CCI_REG8(0x3503), 0x07},
	{CCI_REG8(0x350b), 0x40},
	{CCI_REG8(0x3601), 0x0a},
	{CCI_REG8(0x3602), 0x38},
	{CCI_REG8(0x3612), 0x80},
	{CCI_REG8(0x3620), 0x54},
	{CCI_REG8(0x3621), 0xc7},
	{CCI_REG8(0x3622), 0x0f},
	{CCI_REG8(0x3625), 0x10},
	{CCI_REG8(0x3630), 0x55},
	{CCI_REG8(0x3631), 0xf4},
	{CCI_REG8(0x3632), 0x00},
	{CCI_REG8(0x3633), 0x34},
	{CCI_REG8(0x3634), 0x02},
	{CCI_REG8(0x364d), 0x0d},
	{CCI_REG8(0x364f), 0xdd},
	{CCI_REG8(0x3660), 0x04},
	{CCI_REG8(0x3662), 0x10},
	{CCI_REG8(0x3663), 0xf1},
	{CCI_REG8(0x3665), 0x00},
	{CCI_REG8(0x3666), 0x20},
	{CCI_REG8(0x3667), 0x00},
	{CCI_REG8(0x366a), 0x80},
	{CCI_REG8(0x3680), 0xe0},
	{CCI_REG8(0x3681), 0x00},
	{CCI_REG8(0x3700), 0x42},
	{CCI_REG8(0x3701), 0x14},
	{CCI_REG8(0x3702), 0xa0},

Annotation

Implementation Notes