drivers/media/i2c/vd55g1.c
Source file repositories/reference/linux-study-clean/drivers/media/i2c/vd55g1.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/i2c/vd55g1.c- Extension
.c- Size
- 70248 bytes
- Lines
- 2062
- 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/clk.hlinux/delay.hlinux/gpio/consumer.hlinux/i2c.hlinux/iopoll.hlinux/module.hlinux/pm_runtime.hlinux/property.hlinux/regmap.hlinux/regulator/consumer.hlinux/unaligned.hlinux/units.hmedia/mipi-csi2.hmedia/v4l2-async.hmedia/v4l2-cci.hmedia/v4l2-ctrls.hmedia/v4l2-device.hmedia/v4l2-event.hmedia/v4l2-fwnode.hmedia/v4l2-subdev.h
Detected Declarations
struct vd55g1_modestruct vd55g1_vblank_limitsstruct vd55g1enum vd55g1_hdr_modeenum vd55g1_expo_statefunction vd55g1_get_fmt_bppfunction vd55g1_get_fmt_data_typefunction vd55g1_get_fmt_codefunction vd55g1_get_pixel_ratefunction vd55g1_get_hblank_minfunction vd55g1_get_vblank_limitsfunction vd55g1_write_arrayfunction vd55g1_poll_regfunction vd55g1_wait_statefunction vd55g1_prepare_clock_treefunction vd55g1_update_patgenfunction vd55g1_update_expo_clusterfunction vd55g1_lock_exposurefunction vd55g1_read_expo_clusterfunction vd55g1_update_frame_lengthfunction vd55g1_update_exposure_targetfunction vd55g1_apply_cold_startfunction vd55g1_update_pad_fmtfunction vd55g1_update_hdr_modefunction vd55g1_set_framefmtfunction vd55g1_update_gpiosfunction for_each_set_bitfunction vd55g1_ro_ctrls_setupfunction vd55g1_grab_ctrlsfunction vd55g1_enable_streamsfunction vd55g1_disable_streamsfunction vd55g1_patchfunction vd55g1_get_selectionfunction vd55g1_enum_mbus_codefunction vd55g1_new_format_change_controlsfunction vd55g1_set_pad_fmtfunction vd55g1_init_statefunction vd55g1_enum_frame_sizefunction vd55g1_g_volatile_ctrlfunction vd55g1_s_ctrlfunction vd55g1_init_ctrlsfunction vd55g1_detectfunction vd55g1_power_onfunction vd55g1_power_offfunction vd55g1_check_csi_conffunction vd55g1_parse_dt_gpios_arrayfunction vd55g1_parse_dt_gpiosfunction vd55g1_parse_dt
Annotated Snippet
struct vd55g1_mode {
u32 width;
u32 height;
};
static const u32 vd55g1_mbus_formats_mono[] = {
MEDIA_BUS_FMT_Y8_1X8,
MEDIA_BUS_FMT_Y10_1X10,
};
/* Format order is : no flip, hflip, vflip, both */
static const u32 vd55g1_mbus_formats_bayer[][4] = {
{
MEDIA_BUS_FMT_SRGGB8_1X8,
MEDIA_BUS_FMT_SGRBG8_1X8,
MEDIA_BUS_FMT_SGBRG8_1X8,
MEDIA_BUS_FMT_SBGGR8_1X8,
},
{
MEDIA_BUS_FMT_SRGGB10_1X10,
MEDIA_BUS_FMT_SGRBG10_1X10,
MEDIA_BUS_FMT_SGBRG10_1X10,
MEDIA_BUS_FMT_SBGGR10_1X10,
},
};
static const struct vd55g1_mode vd55g1_supported_modes[] = {
{
.width = VD55G1_WIDTH,
.height = VD55G1_HEIGHT,
},
{
.width = 800,
.height = VD55G1_HEIGHT,
},
{
.width = 800,
.height = 600,
},
{
.width = 640,
.height = 480,
},
{
.width = 320,
.height = 240,
},
};
enum vd55g1_expo_state {
VD55G1_EXP_AUTO,
VD55G1_EXP_FREEZE,
VD55G1_EXP_MANUAL,
VD55G1_EXP_SINGLE_STEP,
VD55G1_EXP_BYPASS,
};
struct vd55g1_vblank_limits {
u16 min;
u16 def;
u16 max;
};
struct vd55g1 {
struct device *dev;
unsigned int id;
struct v4l2_subdev sd;
struct media_pad pad;
struct regulator_bulk_data supplies[ARRAY_SIZE(vd55g1_supply_name)];
struct gpio_desc *reset_gpio;
struct clk *xclk;
struct regmap *regmap;
u32 xclk_freq;
u16 oif_ctrl;
u8 gpios[VD55G1_NB_GPIOS];
unsigned long ext_leds_mask;
u32 mipi_rate;
u32 pixel_clock;
u64 link_freq;
struct v4l2_ctrl_handler ctrl_handler;
struct v4l2_ctrl *pixel_rate_ctrl;
struct v4l2_ctrl *vblank_ctrl;
struct v4l2_ctrl *hblank_ctrl;
struct {
struct v4l2_ctrl *hflip_ctrl;
struct v4l2_ctrl *vflip_ctrl;
};
struct v4l2_ctrl *patgen_ctrl;
struct {
struct v4l2_ctrl *ae_ctrl;
Annotation
- Immediate include surface: `linux/clk.h`, `linux/delay.h`, `linux/gpio/consumer.h`, `linux/i2c.h`, `linux/iopoll.h`, `linux/module.h`, `linux/pm_runtime.h`, `linux/property.h`.
- Detected declarations: `struct vd55g1_mode`, `struct vd55g1_vblank_limits`, `struct vd55g1`, `enum vd55g1_hdr_mode`, `enum vd55g1_expo_state`, `function vd55g1_get_fmt_bpp`, `function vd55g1_get_fmt_data_type`, `function vd55g1_get_fmt_code`, `function vd55g1_get_pixel_rate`, `function vd55g1_get_hblank_min`.
- 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.