drivers/media/i2c/ov9734.c
Source file repositories/reference/linux-study-clean/drivers/media/i2c/ov9734.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/i2c/ov9734.c- Extension
.c- Size
- 23492 bytes
- Lines
- 995
- 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 ov9734_regstruct ov9734_reg_liststruct ov9734_link_freq_configstruct ov9734_modestruct ov9734function to_pixel_ratefunction to_pixels_per_linefunction ov9734_read_regfunction ov9734_write_regfunction ov9734_write_reg_listfunction ov9734_update_digital_gainfunction ov9734_test_patternfunction ov9734_set_ctrlfunction ov9734_init_controlsfunction ov9734_update_pad_formatfunction ov9734_start_streamingfunction ov9734_stop_streamingfunction ov9734_set_streamfunction ov9734_set_formatfunction ov9734_get_formatfunction ov9734_enum_mbus_codefunction ov9734_enum_frame_sizefunction ov9734_openfunction ov9734_identify_modulefunction ov9734_check_hwcfgfunction ov9734_removefunction ov9734_probe
Annotated Snippet
struct ov9734_reg {
u16 address;
u8 val;
};
struct ov9734_reg_list {
u32 num_of_regs;
const struct ov9734_reg *regs;
};
struct ov9734_link_freq_config {
const struct ov9734_reg_list reg_list;
};
struct ov9734_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 ov9734_reg_list reg_list;
};
static const struct ov9734_reg mipi_data_rate_360mbps[] = {
{0x3030, 0x19},
{0x3080, 0x02},
{0x3081, 0x4b},
{0x3082, 0x04},
{0x3083, 0x00},
{0x3084, 0x02},
{0x3085, 0x01},
{0x3086, 0x01},
{0x3089, 0x01},
{0x308a, 0x00},
{0x301e, 0x15},
{0x3103, 0x01},
};
static const struct ov9734_reg mode_1296x734_regs[] = {
{0x3001, 0x00},
{0x3002, 0x00},
{0x3007, 0x00},
{0x3010, 0x00},
{0x3011, 0x08},
{0x3014, 0x22},
{0x3600, 0x55},
{0x3601, 0x02},
{0x3605, 0x22},
{0x3611, 0xe7},
{0x3654, 0x10},
{0x3655, 0x77},
{0x3656, 0x77},
{0x3657, 0x07},
{0x3658, 0x22},
{0x3659, 0x22},
{0x365a, 0x02},
{0x3784, 0x05},
{0x3785, 0x55},
{0x37c0, 0x07},
{0x3800, 0x00},
{0x3801, 0x04},
{0x3802, 0x00},
{0x3803, 0x04},
{0x3804, 0x05},
{0x3805, 0x0b},
{0x3806, 0x02},
{0x3807, 0xdb},
{0x3808, 0x05},
{0x3809, 0x00},
{0x380a, 0x02},
{0x380b, 0xd0},
{0x380c, 0x05},
{0x380d, 0xc6},
{0x380e, 0x03},
{0x380f, 0x22},
{0x3810, 0x00},
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 ov9734_reg`, `struct ov9734_reg_list`, `struct ov9734_link_freq_config`, `struct ov9734_mode`, `struct ov9734`, `function to_pixel_rate`, `function to_pixels_per_line`, `function ov9734_read_reg`, `function ov9734_write_reg`, `function ov9734_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.