drivers/media/i2c/ov6211.c

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

File Facts

System
Linux kernel
Corpus path
drivers/media/i2c/ov6211.c
Extension
.c
Size
21416 bytes
Lines
819
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 ov6211_reg_list {
	const struct cci_reg_sequence *regs;
	unsigned int num_regs;
};

struct ov6211_mode {
	u32 width;	/* Frame width in pixels */
	u32 height;	/* Frame height in pixels */
	u32 hts;	/* Horizontal timing size */
	u32 vts;	/* Default vertical timing size */
	u32 bpp;	/* Bits per pixel */

	const struct ov6211_reg_list reg_list;	/* Sensor register setting */
};

static const char * const ov6211_test_pattern_menu[] = {
	"Disabled",
	"Vertical Colour Bars",
};

static const char * const ov6211_supply_names[] = {
	"avdd",		/* Analog power */
	"dovdd",	/* Digital I/O power */
	"dvdd",		/* Digital core power */
};

#define OV6211_NUM_SUPPLIES	ARRAY_SIZE(ov6211_supply_names)

struct ov6211 {
	struct device *dev;
	struct regmap *regmap;
	struct clk *xvclk;
	struct gpio_desc *reset_gpio;
	struct regulator_bulk_data supplies[OV6211_NUM_SUPPLIES];

	struct v4l2_subdev sd;
	struct media_pad pad;

	struct v4l2_ctrl *vblank;
	struct v4l2_ctrl *exposure;
	struct v4l2_ctrl_handler ctrl_handler;

	/* Saved register values */
	u64 pre_isp;
};

static const struct cci_reg_sequence ov6211_400x400_120fps_mode[] = {
	{ CCI_REG8(0x3005), 0x00 },
	{ CCI_REG8(0x3013), 0x12 },
	{ CCI_REG8(0x3014), 0x04 },
	{ CCI_REG8(0x3016), 0x10 },
	{ CCI_REG8(0x3017), 0x00 },
	{ CCI_REG8(0x3018), 0x00 },
	{ CCI_REG8(0x301a), 0x00 },
	{ CCI_REG8(0x301b), 0x00 },
	{ CCI_REG8(0x301c), 0x00 },
	{ CCI_REG8(0x3037), 0xf0 },
	{ CCI_REG8(0x3080), 0x01 },
	{ CCI_REG8(0x3081), 0x00 },
	{ CCI_REG8(0x3082), 0x01 },
	{ CCI_REG8(0x3098), 0x04 },
	{ CCI_REG8(0x3099), 0x28 },
	{ CCI_REG8(0x309a), 0x06 },
	{ CCI_REG8(0x309b), 0x04 },
	{ CCI_REG8(0x309c), 0x00 },
	{ CCI_REG8(0x309d), 0x00 },
	{ CCI_REG8(0x309e), 0x01 },
	{ CCI_REG8(0x309f), 0x00 },
	{ CCI_REG8(0x30b0), 0x08 },
	{ CCI_REG8(0x30b1), 0x02 },
	{ CCI_REG8(0x30b2), 0x00 },
	{ CCI_REG8(0x30b3), 0x28 },
	{ CCI_REG8(0x30b4), 0x02 },
	{ CCI_REG8(0x30b5), 0x00 },
	{ CCI_REG8(0x3106), 0xd9 },
	{ CCI_REG8(0x3503), 0x07 },
	{ CCI_REG8(0x3509), 0x10 },
	{ CCI_REG8(0x3600), 0xfc },
	{ CCI_REG8(0x3620), 0xb7 },
	{ CCI_REG8(0x3621), 0x05 },
	{ CCI_REG8(0x3626), 0x31 },
	{ CCI_REG8(0x3627), 0x40 },
	{ CCI_REG8(0x3632), 0xa3 },
	{ CCI_REG8(0x3633), 0x34 },
	{ CCI_REG8(0x3634), 0x40 },
	{ CCI_REG8(0x3636), 0x00 },
	{ CCI_REG8(0x3660), 0x80 },
	{ CCI_REG8(0x3662), 0x03 },
	{ CCI_REG8(0x3664), 0xf0 },
	{ CCI_REG8(0x366a), 0x10 },

Annotation

Implementation Notes