drivers/media/i2c/ov5675.c
Source file repositories/reference/linux-study-clean/drivers/media/i2c/ov5675.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/i2c/ov5675.c- Extension
.c- Size
- 32067 bytes
- Lines
- 1387
- 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/mod_devicetable.hlinux/module.hlinux/pm_runtime.hlinux/regulator/consumer.hlinux/unaligned.hmedia/v4l2-ctrls.hmedia/v4l2-device.hmedia/v4l2-fwnode.h
Detected Declarations
struct ov5675_regstruct ov5675_reg_liststruct ov5675_link_freq_configstruct ov5675_modestruct ov5675function to_pixel_ratefunction to_pixels_per_linefunction ov5675_read_regfunction ov5675_write_regfunction ov5675_write_reg_listfunction ov5675_update_digital_gainfunction ov5675_test_patternfunction ov5675_set_ctrl_hflipfunction ov5675_set_ctrl_vflipfunction ov5675_set_ctrlfunction ov5675_init_controlsfunction ov5675_update_pad_formatfunction ov5675_identify_modulefunction ov5675_start_streamingfunction ov5675_stop_streamingfunction ov5675_set_streamfunction ov5675_power_offfunction ov5675_power_onfunction ov5675_set_formatfunction ov5675_get_formatfunction ov5675_get_selectionfunction ov5675_enum_mbus_codefunction ov5675_enum_frame_sizefunction ov5675_openfunction ov5675_get_hwcfgfunction ov5675_removefunction ov5675_probe
Annotated Snippet
struct ov5675_reg {
u16 address;
u8 val;
};
struct ov5675_reg_list {
u32 num_of_regs;
const struct ov5675_reg *regs;
};
struct ov5675_link_freq_config {
const struct ov5675_reg_list reg_list;
};
struct ov5675_mode {
/* Frame width in pixels */
u32 width;
/* Frame height in pixels */
u32 height;
/* Horizontal timining size */
u32 hts;
/* Default vertical timining size */
u32 vts_def;
/* Min vertical timining size */
u32 vts_min;
/* Link frequency needed for this resolution */
u32 link_freq_index;
/* Sensor register settings for this resolution */
const struct ov5675_reg_list reg_list;
};
static const struct ov5675_reg mipi_data_rate_900mbps[] = {
{0x0103, 0x01},
{0x0100, 0x00},
{0x0300, 0x04},
{0x0302, 0x8d},
{0x0303, 0x00},
{0x030d, 0x26},
};
static const struct ov5675_reg mode_2592x1944_regs[] = {
{0x3002, 0x21},
{0x3107, 0x23},
{0x3501, 0x20},
{0x3503, 0x0c},
{0x3508, 0x03},
{0x3509, 0x00},
{0x3600, 0x66},
{0x3602, 0x30},
{0x3610, 0xa5},
{0x3612, 0x93},
{0x3620, 0x80},
{0x3642, 0x0e},
{0x3661, 0x00},
{0x3662, 0x10},
{0x3664, 0xf3},
{0x3665, 0x9e},
{0x3667, 0xa5},
{0x366e, 0x55},
{0x366f, 0x55},
{0x3670, 0x11},
{0x3671, 0x11},
{0x3672, 0x11},
{0x3673, 0x11},
{0x3714, 0x24},
{0x371a, 0x3e},
{0x3733, 0x10},
{0x3734, 0x00},
{0x373d, 0x24},
{0x3764, 0x20},
{0x3765, 0x20},
{0x3766, 0x12},
{0x37a1, 0x14},
{0x37a8, 0x1c},
{0x37ab, 0x0f},
{0x37c2, 0x04},
{0x37cb, 0x00},
{0x37cc, 0x00},
{0x37cd, 0x00},
{0x37ce, 0x00},
{0x37d8, 0x02},
{0x37d9, 0x08},
{0x37dc, 0x04},
{0x3800, 0x00},
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/clk.h`, `linux/delay.h`, `linux/gpio/consumer.h`, `linux/i2c.h`, `linux/mod_devicetable.h`, `linux/module.h`, `linux/pm_runtime.h`.
- Detected declarations: `struct ov5675_reg`, `struct ov5675_reg_list`, `struct ov5675_link_freq_config`, `struct ov5675_mode`, `struct ov5675`, `function to_pixel_rate`, `function to_pixels_per_line`, `function ov5675_read_reg`, `function ov5675_write_reg`, `function ov5675_write_reg_list`.
- 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.