drivers/media/i2c/ov8858.c
Source file repositories/reference/linux-study-clean/drivers/media/i2c/ov8858.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/i2c/ov8858.c- Extension
.c- Size
- 49425 bytes
- Lines
- 1998
- 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.
- 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/unaligned.hlinux/clk.hlinux/delay.hlinux/device.hlinux/gpio/consumer.hlinux/i2c.hlinux/module.hlinux/of.hlinux/pm_runtime.hlinux/property.hlinux/regulator/consumer.hlinux/slab.hmedia/media-entity.hmedia/v4l2-async.hmedia/v4l2-common.hmedia/v4l2-ctrls.hmedia/v4l2-device.hmedia/v4l2-fwnode.hmedia/v4l2-mediabus.hmedia/v4l2-subdev.h
Detected Declarations
struct regvalstruct regval_modesstruct ov8858_modestruct ov8858function ov8858_writefunction ov8858_write_arrayfunction ov8858_readfunction ov8858_start_streamfunction ov8858_stop_streamfunction ov8858_s_streamfunction ov8858_set_fmtfunction ov8858_enum_frame_sizesfunction ov8858_enum_mbus_codefunction ov8858_init_statefunction ov8858_enable_test_patternfunction ov8858_set_ctrlfunction ov8858_power_onfunction ov8858_power_offfunction ov8858_runtime_resumefunction ov8858_runtime_suspendfunction ov8858_init_ctrlsfunction ov8858_check_sensor_idfunction ov8858_configure_regulatorsfunction ov8858_parse_offunction ov8858_probefunction ov8858_remove
Annotated Snippet
struct regval {
u16 addr;
u8 val;
};
struct regval_modes {
const struct regval *mode_2lanes;
const struct regval *mode_4lanes;
};
struct ov8858_mode {
u32 width;
u32 height;
u32 hts_def;
u32 vts_def;
u32 exp_def;
const struct regval_modes reg_modes;
};
struct ov8858 {
struct clk *xvclk;
struct gpio_desc *reset_gpio;
struct gpio_desc *pwdn_gpio;
struct regulator_bulk_data supplies[ARRAY_SIZE(ov8858_supply_names)];
struct v4l2_subdev subdev;
struct media_pad pad;
struct v4l2_ctrl_handler ctrl_handler;
struct v4l2_ctrl *exposure;
struct v4l2_ctrl *hblank;
struct v4l2_ctrl *vblank;
const struct regval *global_regs;
unsigned int num_lanes;
};
static inline struct ov8858 *sd_to_ov8858(struct v4l2_subdev *sd)
{
return container_of(sd, struct ov8858, subdev);
}
static const struct regval ov8858_global_regs_r1a[] = {
{0x0100, 0x00},
{0x0100, 0x00},
{0x0100, 0x00},
{0x0100, 0x00},
{0x0302, 0x1e},
{0x0303, 0x00},
{0x0304, 0x03},
{0x030e, 0x00},
{0x030f, 0x09},
{0x0312, 0x01},
{0x031e, 0x0c},
{0x3600, 0x00},
{0x3601, 0x00},
{0x3602, 0x00},
{0x3603, 0x00},
{0x3604, 0x22},
{0x3605, 0x30},
{0x3606, 0x00},
{0x3607, 0x20},
{0x3608, 0x11},
{0x3609, 0x28},
{0x360a, 0x00},
{0x360b, 0x06},
{0x360c, 0xdc},
{0x360d, 0x40},
{0x360e, 0x0c},
{0x360f, 0x20},
{0x3610, 0x07},
{0x3611, 0x20},
{0x3612, 0x88},
{0x3613, 0x80},
{0x3614, 0x58},
{0x3615, 0x00},
{0x3616, 0x4a},
{0x3617, 0xb0},
{0x3618, 0x56},
{0x3619, 0x70},
{0x361a, 0x99},
{0x361b, 0x00},
{0x361c, 0x07},
{0x361d, 0x00},
{0x361e, 0x00},
{0x361f, 0x00},
{0x3638, 0xff},
{0x3633, 0x0c},
{0x3634, 0x0c},
Annotation
- Immediate include surface: `linux/unaligned.h`, `linux/clk.h`, `linux/delay.h`, `linux/device.h`, `linux/gpio/consumer.h`, `linux/i2c.h`, `linux/module.h`, `linux/of.h`.
- Detected declarations: `struct regval`, `struct regval_modes`, `struct ov8858_mode`, `struct ov8858`, `function ov8858_write`, `function ov8858_write_array`, `function ov8858_read`, `function ov8858_start_stream`, `function ov8858_stop_stream`, `function ov8858_s_stream`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
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.