drivers/media/i2c/ov5693.c
Source file repositories/reference/linux-study-clean/drivers/media/i2c/ov5693.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/i2c/ov5693.c- Extension
.c- Size
- 37367 bytes
- Lines
- 1423
- 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/device.hlinux/i2c.hlinux/module.hlinux/pm_runtime.hlinux/regulator/consumer.hlinux/slab.hlinux/types.hmedia/v4l2-cci.hmedia/v4l2-ctrls.hmedia/v4l2-device.hmedia/v4l2-fwnode.h
Detected Declarations
struct ov5693_devicestruct ov5693_modestruct ov5693_v4l2_ctrlsfunction ov5693_flip_vert_configurefunction ov5693_flip_horz_configurefunction ov5693_get_exposurefunction ov5693_exposure_configurefunction ov5693_get_gainfunction ov5693_digital_gain_configurefunction ov5693_analog_gain_configurefunction ov5693_vts_configurefunction ov5693_test_pattern_configurefunction ov5693_s_ctrlfunction ov5693_g_volatile_ctrlfunction ov5693_mode_configurefunction ov5693_enable_streamingfunction ov5693_sw_resetfunction ov5693_sensor_initfunction ov5693_sensor_powerdownfunction ov5693_sensor_powerupfunction ov5693_sensor_suspendfunction ov5693_sensor_resumefunction ov5693_detectfunction __ov5693_calc_vtsfunction __ov5693_get_pad_formatfunction __ov5693_get_pad_cropfunction ov5693_get_fmtfunction ov5693_set_fmtfunction ov5693_get_selectionfunction ov5693_set_selectionfunction ov5693_s_streamfunction ov5693_get_frame_intervalfunction ov5693_enum_mbus_codefunction ov5693_enum_frame_sizefunction ov5693_init_controlsfunction ov5693_configure_gpiosfunction ov5693_get_regulatorsfunction ov5693_check_hwcfgfunction ov5693_probefunction ov5693_remove
Annotated Snippet
struct ov5693_device {
struct device *dev;
struct regmap *regmap;
/* Protect against concurrent changes to controls */
struct mutex lock;
struct gpio_desc *reset;
struct gpio_desc *powerdown;
struct regulator_bulk_data supplies[OV5693_NUM_SUPPLIES];
struct clk *xvclk;
struct ov5693_mode {
struct v4l2_rect crop;
struct v4l2_mbus_framefmt format;
bool binning_x;
bool binning_y;
unsigned int inc_x_odd;
unsigned int inc_y_odd;
unsigned int vts;
} mode;
struct v4l2_subdev sd;
struct media_pad pad;
struct ov5693_v4l2_ctrls {
struct v4l2_ctrl_handler handler;
struct v4l2_ctrl *link_freq;
struct v4l2_ctrl *pixel_rate;
struct v4l2_ctrl *exposure;
struct v4l2_ctrl *analogue_gain;
struct v4l2_ctrl *digital_gain;
struct v4l2_ctrl *hflip;
struct v4l2_ctrl *vflip;
struct v4l2_ctrl *hblank;
struct v4l2_ctrl *vblank;
struct v4l2_ctrl *test_pattern;
} ctrls;
};
static const struct cci_reg_sequence ov5693_global_regs[] = {
{CCI_REG8(0x3016), 0xf0},
{CCI_REG8(0x3017), 0xf0},
{CCI_REG8(0x3018), 0xf0},
{CCI_REG8(0x3022), 0x01},
{CCI_REG8(0x3028), 0x44},
{CCI_REG8(0x3098), 0x02},
{CCI_REG8(0x3099), 0x19},
{CCI_REG8(0x309a), 0x02},
{CCI_REG8(0x309b), 0x01},
{CCI_REG8(0x309c), 0x00},
{CCI_REG8(0x30a0), 0xd2},
{CCI_REG8(0x30a2), 0x01},
{CCI_REG8(0x30b2), 0x00},
{CCI_REG8(0x30b3), 0x83},
{CCI_REG8(0x30b4), 0x03},
{CCI_REG8(0x30b5), 0x04},
{CCI_REG8(0x30b6), 0x01},
{CCI_REG8(0x3080), 0x01},
{CCI_REG8(0x3104), 0x21},
{CCI_REG8(0x3106), 0x00},
{CCI_REG8(0x3406), 0x01},
{CCI_REG8(0x3503), 0x07},
{CCI_REG8(0x350b), 0x40},
{CCI_REG8(0x3601), 0x0a},
{CCI_REG8(0x3602), 0x38},
{CCI_REG8(0x3612), 0x80},
{CCI_REG8(0x3620), 0x54},
{CCI_REG8(0x3621), 0xc7},
{CCI_REG8(0x3622), 0x0f},
{CCI_REG8(0x3625), 0x10},
{CCI_REG8(0x3630), 0x55},
{CCI_REG8(0x3631), 0xf4},
{CCI_REG8(0x3632), 0x00},
{CCI_REG8(0x3633), 0x34},
{CCI_REG8(0x3634), 0x02},
{CCI_REG8(0x364d), 0x0d},
{CCI_REG8(0x364f), 0xdd},
{CCI_REG8(0x3660), 0x04},
{CCI_REG8(0x3662), 0x10},
{CCI_REG8(0x3663), 0xf1},
{CCI_REG8(0x3665), 0x00},
{CCI_REG8(0x3666), 0x20},
{CCI_REG8(0x3667), 0x00},
{CCI_REG8(0x366a), 0x80},
{CCI_REG8(0x3680), 0xe0},
{CCI_REG8(0x3681), 0x00},
{CCI_REG8(0x3700), 0x42},
{CCI_REG8(0x3701), 0x14},
{CCI_REG8(0x3702), 0xa0},
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/clk.h`, `linux/delay.h`, `linux/device.h`, `linux/i2c.h`, `linux/module.h`, `linux/pm_runtime.h`, `linux/regulator/consumer.h`.
- Detected declarations: `struct ov5693_device`, `struct ov5693_mode`, `struct ov5693_v4l2_ctrls`, `function ov5693_flip_vert_configure`, `function ov5693_flip_horz_configure`, `function ov5693_get_exposure`, `function ov5693_exposure_configure`, `function ov5693_get_gain`, `function ov5693_digital_gain_configure`, `function ov5693_analog_gain_configure`.
- 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.