drivers/media/i2c/imx214.c
Source file repositories/reference/linux-study-clean/drivers/media/i2c/imx214.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/i2c/imx214.c- Extension
.c- Size
- 43324 bytes
- Lines
- 1536
- 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/module.hlinux/pm_runtime.hlinux/regmap.hlinux/regulator/consumer.hmedia/media-entity.hmedia/v4l2-cci.hmedia/v4l2-ctrls.hmedia/v4l2-fwnode.hmedia/v4l2-subdev.hccs-pll.h
Detected Declarations
struct imx214function imx214_power_onfunction imx214_power_offfunction imx214_get_format_codefunction imx214_update_pad_formatfunction imx214_enum_mbus_codefunction imx214_enum_frame_sizefunction imx214_s_registerfunction imx214_g_registerfunction imx214_set_formatfunction imx214_get_selectionfunction imx214_entity_init_statefunction imx214_configure_pllfunction imx214_update_digital_gainfunction imx214_set_ctrlfunction imx214_pll_calculatefunction imx214_pll_updatefunction imx214_ctrls_initfunction imx214_start_streamingfunction imx214_stop_streamingfunction imx214_s_streamfunction imx214_get_frame_intervalfunction imx214_enum_frame_intervalfunction imx214_get_regulatorsfunction imx214_identify_modulefunction imx214_parse_fwnodefunction imx214_probefunction imx214_remove
Annotated Snippet
struct imx214 {
struct device *dev;
struct clk *xclk;
struct regmap *regmap;
struct ccs_pll pll;
struct v4l2_fwnode_endpoint bus_cfg;
struct v4l2_subdev sd;
struct media_pad pad;
struct v4l2_ctrl_handler ctrls;
struct v4l2_ctrl *pixel_rate;
struct v4l2_ctrl *link_freq;
struct v4l2_ctrl *vblank;
struct v4l2_ctrl *hblank;
struct v4l2_ctrl *exposure;
struct v4l2_ctrl *unit_size;
struct {
struct v4l2_ctrl *hflip;
struct v4l2_ctrl *vflip;
};
struct regulator_bulk_data supplies[IMX214_NUM_SUPPLIES];
struct gpio_desc *enable_gpio;
};
/*From imx214_mode_tbls.h*/
static const struct cci_reg_sequence mode_4096x2304[] = {
{ IMX214_REG_HDR_MODE, IMX214_HDR_MODE_OFF },
{ IMX214_REG_HDR_RES_REDUCTION, IMX214_HDR_RES_REDU_THROUGH },
{ IMX214_REG_EXPOSURE_RATIO, 1 },
{ IMX214_REG_X_ADD_STA, 56 },
{ IMX214_REG_Y_ADD_STA, 408 },
{ IMX214_REG_X_ADD_END, 4151 },
{ IMX214_REG_Y_ADD_END, 2711 },
{ IMX214_REG_X_EVEN_INC, 1 },
{ IMX214_REG_X_ODD_INC, 1 },
{ IMX214_REG_Y_EVEN_INC, 1 },
{ IMX214_REG_Y_ODD_INC, 1 },
{ IMX214_REG_BINNING_MODE, IMX214_BINNING_NONE },
{ IMX214_REG_BINNING_TYPE, 0 },
{ IMX214_REG_BINNING_WEIGHTING, IMX214_BINNING_AVERAGE },
{ CCI_REG8(0x3000), 0x35 },
{ CCI_REG8(0x3054), 0x01 },
{ CCI_REG8(0x305C), 0x11 },
{ IMX214_REG_CSI_DATA_FORMAT, IMX214_CSI_DATA_FORMAT_RAW10 },
{ IMX214_REG_X_OUTPUT_SIZE, 4096 },
{ IMX214_REG_Y_OUTPUT_SIZE, 2304 },
{ IMX214_REG_SCALE_MODE, IMX214_SCALE_NONE },
{ IMX214_REG_SCALE_M, 2 },
{ IMX214_REG_DIG_CROP_X_OFFSET, 0 },
{ IMX214_REG_DIG_CROP_Y_OFFSET, 0 },
{ IMX214_REG_DIG_CROP_WIDTH, 4096 },
{ IMX214_REG_DIG_CROP_HEIGHT, 2304 },
{ CCI_REG8(0x3A03), 0x09 },
{ CCI_REG8(0x3A04), 0x50 },
{ CCI_REG8(0x3A05), 0x01 },
{ IMX214_REG_SING_DEF_CORR_EN, IMX214_SING_DEF_CORR_ON },
{ IMX214_REG_NML_NR_EN, IMX214_NML_NR_OFF },
{ CCI_REG8(0x30B4), 0x00 },
{ CCI_REG8(0x3A02), 0xFF },
{ CCI_REG8(0x3011), 0x00 },
{ IMX214_REG_STATS_OUT_EN, IMX214_STATS_OUT_ON },
{ IMX214_REG_SHORT_EXPOSURE, 500 },
{ CCI_REG8(0x4170), 0x00 },
{ CCI_REG8(0x4171), 0x10 },
{ CCI_REG8(0x4176), 0x00 },
{ CCI_REG8(0x4177), 0x3C },
{ CCI_REG8(0xAE20), 0x04 },
{ CCI_REG8(0xAE21), 0x5C },
};
static const struct cci_reg_sequence mode_1920x1080[] = {
{ IMX214_REG_HDR_MODE, IMX214_HDR_MODE_OFF },
{ IMX214_REG_HDR_RES_REDUCTION, IMX214_HDR_RES_REDU_THROUGH },
{ IMX214_REG_EXPOSURE_RATIO, 1 },
{ IMX214_REG_X_ADD_STA, 1144 },
{ IMX214_REG_Y_ADD_STA, 1020 },
{ IMX214_REG_X_ADD_END, 3063 },
Annotation
- Immediate include surface: `linux/clk.h`, `linux/delay.h`, `linux/gpio/consumer.h`, `linux/i2c.h`, `linux/module.h`, `linux/pm_runtime.h`, `linux/regmap.h`, `linux/regulator/consumer.h`.
- Detected declarations: `struct imx214`, `function imx214_power_on`, `function imx214_power_off`, `function imx214_get_format_code`, `function imx214_update_pad_format`, `function imx214_enum_mbus_code`, `function imx214_enum_frame_size`, `function imx214_s_register`, `function imx214_g_register`, `function imx214_set_format`.
- 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.