drivers/media/i2c/hi847.c

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

File Facts

System
Linux kernel
Corpus path
drivers/media/i2c/hi847.c
Extension
.c
Size
61193 bytes
Lines
2957
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 hi847_reg {
	u16 address;
	u16 val;
};

struct hi847_reg_list {
	u32 num_of_regs;
	const struct hi847_reg *regs;
};

struct hi847_link_freq_config {
	const struct hi847_reg_list reg_list;
};

struct hi847_mode {
	/* Frame width in pixels */
	u32 width;

	/* Frame height in pixels */
	u32 height;

	/* Horizontal timining size */
	u32 llp;

	/* Default vertical timining size */
	u32 fll_def;

	/* Min vertical timining size */
	u32 fll_min;

	/* Link frequency needed for this resolution */
	u32 link_freq_index;

	/* Sensor register settings for this resolution */
	const struct hi847_reg_list reg_list;
};

#define to_hi847(_sd) container_of(_sd, struct hi847, sd)

//SENSOR_INITIALIZATION
static const struct hi847_reg mipi_data_rate_lane_4[] = {
	{0x0790, 0x0100},
	{0x2000, 0x0000},
	{0x2002, 0x0058},
	{0x2006, 0x40B2},
	{0x2008, 0xB05C},
	{0x200A, 0x8446},
	{0x200C, 0x40B2},
	{0x200E, 0xB082},
	{0x2010, 0x8450},
	{0x2012, 0x40B2},
	{0x2014, 0xB0AE},
	{0x2016, 0x84C6},
	{0x2018, 0x40B2},
	{0x201A, 0xB11A},
	{0x201C, 0x84BC},
	{0x201E, 0x40B2},
	{0x2020, 0xB34A},
	{0x2022, 0x84B4},
	{0x2024, 0x40B2},
	{0x2026, 0xB386},
	{0x2028, 0x84B0},
	{0x202A, 0x40B2},
	{0x202C, 0xB3B4},
	{0x202E, 0x84B8},
	{0x2030, 0x40B2},
	{0x2032, 0xB0F4},
	{0x2034, 0x8470},
	{0x2036, 0x40B2},
	{0x2038, 0xB3EA},
	{0x203A, 0x847C},
	{0x203C, 0x40B2},
	{0x203E, 0xB658},
	{0x2040, 0x8478},
	{0x2042, 0x40B2},
	{0x2044, 0xB67E},
	{0x2046, 0x847E},
	{0x2048, 0x40B2},
	{0x204A, 0xB78E},
	{0x204C, 0x843A},
	{0x204E, 0x40B2},
	{0x2050, 0xB980},
	{0x2052, 0x845C},
	{0x2054, 0x40B2},
	{0x2056, 0xB9B0},
	{0x2058, 0x845E},
	{0x205A, 0x4130},
	{0x205C, 0x1292},
	{0x205E, 0xD016},
	{0x2060, 0xB3D2},

Annotation

Implementation Notes