drivers/media/i2c/ov08x40.c
Source file repositories/reference/linux-study-clean/drivers/media/i2c/ov08x40.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/i2c/ov08x40.c- Extension
.c- Size
- 51932 bytes
- Lines
- 2406
- 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/gpio/consumer.hlinux/i2c.hlinux/module.hlinux/pm_runtime.hlinux/regulator/consumer.hlinux/unaligned.hmedia/v4l2-common.hmedia/v4l2-ctrls.hmedia/v4l2-device.hmedia/v4l2-fwnode.h
Detected Declarations
struct ov08x40_regstruct ov08x40_reg_liststruct ov08x40_link_freq_configstruct ov08x40_modestruct ov08x40function link_freq_to_pixel_ratefunction ov08x40_power_onfunction ov08x40_power_offfunction ov08x40_read_regfunction __ov08x40_burst_fill_regsfunction ov08x40_burst_fill_regsfunction ov08x40_write_regfunction ov08x40_write_regsfunction ov08x40_write_reg_listfunction ov08x40_openfunction ov08x40_update_digital_gainfunction ov08x40_enable_test_patternfunction ov08x40_set_ctrl_hflipfunction ov08x40_set_ctrl_vflipfunction ov08x40_set_ctrlfunction filter_by_mipi_lanesfunction ov08x40_enum_mbus_codefunction ov08x40_enum_frame_sizefunction ov08x40_update_pad_formatfunction ov08x40_do_get_pad_formatfunction ov08x40_get_pad_formatfunction ov08x40_set_pad_formatfunction ov08x40_start_streamingfunction ov08x40_stop_streamingfunction ov08x40_identify_modulefunction ov08x40_set_streamfunction ov08x40_init_controlsfunction ov08x40_free_controlsfunction ov08x40_check_hwcfgfunction ov08x40_probefunction ov08x40_remove
Annotated Snippet
struct ov08x40_reg {
u16 address;
u8 val;
};
struct ov08x40_reg_list {
u32 num_of_regs;
const struct ov08x40_reg *regs;
};
/* Link frequency config */
struct ov08x40_link_freq_config {
/* registers for this link frequency */
struct ov08x40_reg_list reg_list;
};
/* Mode : resolution and related config&values */
struct ov08x40_mode {
/* Frame width */
u32 width;
/* Frame height */
u32 height;
u32 lanes;
/* V-timing */
u32 vts_def;
u32 vts_min;
/* Line Length Pixels */
u32 llp;
/* Index of Link frequency config to be used */
u32 link_freq_index;
/* Default register values */
struct ov08x40_reg_list reg_list;
/* Exposure calculation */
u16 exposure_margin;
u16 exposure_shift;
};
static const struct ov08x40_reg ov08x40_global_regs[] = {
{0x1216, 0x60},
{0x1217, 0x5b},
{0x1218, 0x00},
{0x1220, 0x24},
{0x198a, 0x00},
{0x198b, 0x01},
{0x198e, 0x00},
{0x198f, 0x01},
{0x3009, 0x04},
{0x3015, 0x00},
{0x3016, 0xb0},
{0x3017, 0xf0},
{0x3018, 0xf0},
{0x3019, 0xd2},
{0x301a, 0xb0},
{0x301c, 0x81},
{0x301d, 0x02},
{0x301e, 0x80},
{0x3022, 0xf0},
{0x3025, 0x89},
{0x3030, 0x03},
{0x3044, 0xc2},
{0x3050, 0x35},
{0x3051, 0x60},
{0x3052, 0x25},
{0x3053, 0x00},
{0x3054, 0x00},
{0x3055, 0x02},
{0x3056, 0x80},
{0x3057, 0x80},
{0x3058, 0x80},
{0x3059, 0x00},
{0x3107, 0x86},
{0x3401, 0x80},
{0x3402, 0x8c},
{0x3404, 0x01},
{0x3407, 0x01},
{0x341b, 0x30},
{0x3420, 0x00},
{0x3421, 0x00},
{0x3422, 0x00},
{0x3423, 0x00},
{0x3424, 0x00},
{0x3425, 0x00},
{0x3426, 0x10},
{0x3427, 0x00},
{0x3428, 0x0f},
{0x3429, 0x00},
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/clk.h`, `linux/delay.h`, `linux/gpio/consumer.h`, `linux/i2c.h`, `linux/module.h`, `linux/pm_runtime.h`, `linux/regulator/consumer.h`.
- Detected declarations: `struct ov08x40_reg`, `struct ov08x40_reg_list`, `struct ov08x40_link_freq_config`, `struct ov08x40_mode`, `struct ov08x40`, `function link_freq_to_pixel_rate`, `function ov08x40_power_on`, `function ov08x40_power_off`, `function ov08x40_read_reg`, `function __ov08x40_burst_fill_regs`.
- 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.