drivers/media/i2c/t4ka3.c

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

File Facts

System
Linux kernel
Corpus path
drivers/media/i2c/t4ka3.c
Extension
.c
Size
29641 bytes
Lines
1065
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 t4ka3_ctrls {
	struct v4l2_ctrl_handler handler;
	struct v4l2_ctrl *hflip;
	struct v4l2_ctrl *vflip;
	struct v4l2_ctrl *vblank;
	struct v4l2_ctrl *hblank;
	struct v4l2_ctrl *exposure;
	struct v4l2_ctrl *gain;
	struct v4l2_ctrl *test_pattern;
	struct v4l2_ctrl *link_freq;
	struct v4l2_ctrl *pixel_rate;
};

struct t4ka3_mode {
	int binning;
	u16 win_x;
	u16 win_y;
};

struct t4ka3_data {
	struct v4l2_subdev sd;
	struct media_pad pad;
	struct mutex lock; /* serialize sensor's ioctl */
	struct t4ka3_ctrls ctrls;
	struct t4ka3_mode mode;
	struct device *dev;
	struct regmap *regmap;
	struct gpio_desc *powerdown_gpio;
	struct gpio_desc *reset_gpio;
	int streaming;

	/* MIPI lane info */
	u32 link_freq_index;
	u8 mipi_lanes;
};

/* init settings */
static const struct cci_reg_sequence t4ka3_init_config[] = {
	{ CCI_REG8(0x4136), 0x13 },
	{ CCI_REG8(0x4137), 0x33 },
	{ CCI_REG8(0x3094), 0x01 },
	{ CCI_REG8(0x0233), 0x01 },
	{ CCI_REG8(0x4B06), 0x01 },
	{ CCI_REG8(0x4B07), 0x01 },
	{ CCI_REG8(0x3028), 0x01 },
	{ CCI_REG8(0x3032), 0x14 },
	{ CCI_REG8(0x305C), 0x0C },
	{ CCI_REG8(0x306D), 0x0A },
	{ CCI_REG8(0x3071), 0xFA },
	{ CCI_REG8(0x307E), 0x0A },
	{ CCI_REG8(0x307F), 0xFC },
	{ CCI_REG8(0x3091), 0x04 },
	{ CCI_REG8(0x3092), 0x60 },
	{ CCI_REG8(0x3096), 0xC0 },
	{ CCI_REG8(0x3100), 0x07 },
	{ CCI_REG8(0x3101), 0x4C },
	{ CCI_REG8(0x3118), 0xCC },
	{ CCI_REG8(0x3139), 0x06 },
	{ CCI_REG8(0x313A), 0x06 },
	{ CCI_REG8(0x313B), 0x04 },
	{ CCI_REG8(0x3143), 0x02 },
	{ CCI_REG8(0x314F), 0x0E },
	{ CCI_REG8(0x3169), 0x99 },
	{ CCI_REG8(0x316A), 0x99 },
	{ CCI_REG8(0x3171), 0x05 },
	{ CCI_REG8(0x31A1), 0xA7 },
	{ CCI_REG8(0x31A2), 0x9C },
	{ CCI_REG8(0x31A3), 0x8F },
	{ CCI_REG8(0x31A4), 0x75 },
	{ CCI_REG8(0x31A5), 0xEE },
	{ CCI_REG8(0x31A6), 0xEA },
	{ CCI_REG8(0x31A7), 0xE4 },
	{ CCI_REG8(0x31A8), 0xE4 },
	{ CCI_REG8(0x31DF), 0x05 },
	{ CCI_REG8(0x31EC), 0x1B },
	{ CCI_REG8(0x31ED), 0x1B },
	{ CCI_REG8(0x31EE), 0x1B },
	{ CCI_REG8(0x31F0), 0x1B },
	{ CCI_REG8(0x31F1), 0x1B },
	{ CCI_REG8(0x31F2), 0x1B },
	{ CCI_REG8(0x3204), 0x3F },
	{ CCI_REG8(0x3205), 0x03 },
	{ CCI_REG8(0x3210), 0x01 },
	{ CCI_REG8(0x3216), 0x68 },
	{ CCI_REG8(0x3217), 0x58 },
	{ CCI_REG8(0x3218), 0x58 },
	{ CCI_REG8(0x321A), 0x68 },
	{ CCI_REG8(0x321B), 0x60 },
	{ CCI_REG8(0x3238), 0x03 },
	{ CCI_REG8(0x3239), 0x03 },

Annotation

Implementation Notes