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.
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/acpi.hlinux/clk.hlinux/delay.hlinux/i2c.hlinux/module.hlinux/pm_runtime.hlinux/unaligned.hmedia/v4l2-ctrls.hmedia/v4l2-device.hmedia/v4l2-fwnode.h
Detected Declarations
struct hi847_regstruct hi847_reg_liststruct hi847_link_freq_configstruct hi847_modestruct hi847function to_pixel_ratefunction hi847_read_regfunction hi847_write_regfunction hi847_write_reg_listfunction hi847_update_digital_gainfunction hi847_test_patternfunction hi847_grbg_shiftfunction hi847_set_ctrl_hflipfunction hi847_set_ctrl_vflipfunction hi847_set_ctrlfunction hi847_init_controlsfunction hi847_assign_pad_formatfunction hi847_start_streamingfunction hi847_stop_streamingfunction hi847_set_streamfunction hi847_set_formatfunction hi847_get_formatfunction hi847_enum_mbus_codefunction hi847_enum_frame_sizefunction hi847_openfunction hi847_identify_modulefunction hi847_check_hwcfgfunction hi847_removefunction hi847_probe
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
- Immediate include surface: `linux/acpi.h`, `linux/clk.h`, `linux/delay.h`, `linux/i2c.h`, `linux/module.h`, `linux/pm_runtime.h`, `linux/unaligned.h`, `media/v4l2-ctrls.h`.
- Detected declarations: `struct hi847_reg`, `struct hi847_reg_list`, `struct hi847_link_freq_config`, `struct hi847_mode`, `struct hi847`, `function to_pixel_rate`, `function hi847_read_reg`, `function hi847_write_reg`, `function hi847_write_reg_list`, `function hi847_update_digital_gain`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.