drivers/staging/media/atomisp/i2c/ov2722.h
Source file repositories/reference/linux-study-clean/drivers/staging/media/atomisp/i2c/ov2722.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/atomisp/i2c/ov2722.h- Extension
.h- Size
- 17544 bytes
- Lines
- 590
- Domain
- Driver Families
- Bucket
- drivers/staging
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/types.hlinux/i2c.hlinux/delay.hlinux/videodev2.hlinux/spinlock.hmedia/v4l2-subdev.hmedia/v4l2-device.hlinux/v4l2-mediabus.hmedia/media-entity.hmedia/v4l2-ctrls.h../include/linux/atomisp_platform.h
Detected Declarations
struct regval_liststruct ov2722_resolutionstruct ov2722_formatstruct ov2722_devicestruct ov2722_regstruct ov2722_write_bufferstruct ov2722_write_ctrlenum ov2722_tok_type
Annotated Snippet
struct regval_list {
u16 reg_num;
u8 value;
};
struct ov2722_resolution {
u8 *desc;
const struct ov2722_reg *regs;
int res;
int width;
int height;
int fps;
int pix_clk_freq;
u32 skip_frames;
u16 pixels_per_line;
u16 lines_per_frame;
bool used;
int mipi_freq;
};
struct ov2722_format {
u8 *desc;
u32 pixelformat;
struct ov2722_reg *regs;
};
/*
* ov2722 device structure.
*/
struct ov2722_device {
struct v4l2_subdev sd;
struct media_pad pad;
struct v4l2_mbus_framefmt format;
struct mutex input_lock;
struct ov2722_resolution *res;
struct camera_sensor_platform_data *platform_data;
u16 pixels_per_line;
u16 lines_per_frame;
u8 type;
struct v4l2_ctrl_handler ctrl_handler;
struct v4l2_ctrl *link_freq;
};
enum ov2722_tok_type {
OV2722_8BIT = 0x0001,
OV2722_16BIT = 0x0002,
OV2722_32BIT = 0x0004,
OV2722_TOK_TERM = 0xf000, /* terminating token for reg list */
OV2722_TOK_DELAY = 0xfe00, /* delay token for reg list */
OV2722_TOK_MASK = 0xfff0
};
/**
* struct ov2722_reg - MI sensor register format
* @type: type of the register
* @reg: 16-bit offset to register
* @val: 8/16/32-bit register value
*
* Define a structure for sensor register initialization values
*/
struct ov2722_reg {
enum ov2722_tok_type type;
u16 reg;
u32 val; /* @set value for read/mod/write, @mask */
};
#define to_ov2722_sensor(x) container_of(x, struct ov2722_device, sd)
#define OV2722_MAX_WRITE_BUF_SIZE 30
struct ov2722_write_buffer {
u16 addr;
u8 data[OV2722_MAX_WRITE_BUF_SIZE];
};
struct ov2722_write_ctrl {
int index;
struct ov2722_write_buffer buffer;
};
static const struct ov2722_reg ov2722_1632_1092_30fps[] = {
/* For stand wait for a whole frame complete.(vblank) */
{OV2722_8BIT, 0x3021, 0x03},
{OV2722_8BIT, 0x3718, 0x10},
{OV2722_8BIT, 0x3702, 0x24},
{OV2722_8BIT, 0x373a, 0x60},
{OV2722_8BIT, 0x3715, 0x01},
{OV2722_8BIT, 0x3703, 0x2e},
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/types.h`, `linux/i2c.h`, `linux/delay.h`, `linux/videodev2.h`, `linux/spinlock.h`, `media/v4l2-subdev.h`, `media/v4l2-device.h`.
- Detected declarations: `struct regval_list`, `struct ov2722_resolution`, `struct ov2722_format`, `struct ov2722_device`, `struct ov2722_reg`, `struct ov2722_write_buffer`, `struct ov2722_write_ctrl`, `enum ov2722_tok_type`.
- Atlas domain: Driver Families / drivers/staging.
- 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.