drivers/media/i2c/imx415.c
Source file repositories/reference/linux-study-clean/drivers/media/i2c/imx415.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/i2c/imx415.c- Extension
.c- Size
- 41638 bytes
- Lines
- 1483
- 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/gpio/consumer.hlinux/i2c.hlinux/module.hlinux/of.hlinux/pm_runtime.hlinux/regmap.hlinux/regulator/consumer.hlinux/slab.hlinux/videodev2.hmedia/v4l2-cci.hmedia/v4l2-ctrls.hmedia/v4l2-fwnode.hmedia/v4l2-subdev.h
Detected Declarations
struct imx415_clk_paramsstruct imx415_mode_reg_liststruct imx415_modestruct imx415function imx415_set_testpatternfunction imx415_s_ctrlfunction imx415_ctrls_initfunction imx415_set_modefunction imx415_setupfunction imx415_wakeupfunction imx415_stream_onfunction imx415_stream_offfunction imx415_s_streamfunction imx415_enum_mbus_codefunction imx415_enum_frame_sizefunction imx415_set_formatfunction imx415_get_selectionfunction imx415_init_statefunction imx415_subdev_initfunction imx415_subdev_cleanupfunction imx415_power_onfunction imx415_power_offfunction imx415_identify_modelfunction imx415_check_inckfunction imx415_parse_hw_configfunction imx415_probefunction imx415_removefunction imx415_runtime_resumefunction imx415_runtime_suspend
Annotated Snippet
struct imx415_clk_params {
u64 lane_rate;
u64 inck;
struct cci_reg_sequence regs[IMX415_NUM_CLK_PARAM_REGS];
};
/* INCK Settings - includes all lane rate and INCK dependent registers */
static const struct imx415_clk_params imx415_clk_params[] = {
{
.lane_rate = 594000000UL,
.inck = 27000000,
.regs[0] = { IMX415_BCWAIT_TIME, 0x05D },
.regs[1] = { IMX415_CPWAIT_TIME, 0x042 },
.regs[2] = { IMX415_SYS_MODE, 0x7 },
.regs[3] = { IMX415_INCKSEL1, 0x00 },
.regs[4] = { IMX415_INCKSEL2, 0x23 },
.regs[5] = { IMX415_INCKSEL3, 0x084 },
.regs[6] = { IMX415_INCKSEL4, 0x0E7 },
.regs[7] = { IMX415_INCKSEL5, 0x23 },
.regs[8] = { IMX415_INCKSEL6, 0x0 },
.regs[9] = { IMX415_INCKSEL7, 0x1 },
.regs[10] = { IMX415_TXCLKESC_FREQ, 0x06C0 },
},
{
.lane_rate = 594000000UL,
.inck = 37125000,
.regs[0] = { IMX415_BCWAIT_TIME, 0x07F },
.regs[1] = { IMX415_CPWAIT_TIME, 0x05B },
.regs[2] = { IMX415_SYS_MODE, 0x7 },
.regs[3] = { IMX415_INCKSEL1, 0x00 },
.regs[4] = { IMX415_INCKSEL2, 0x24 },
.regs[5] = { IMX415_INCKSEL3, 0x080 },
.regs[6] = { IMX415_INCKSEL4, 0x0E0 },
.regs[7] = { IMX415_INCKSEL5, 0x24 },
.regs[8] = { IMX415_INCKSEL6, 0x0 },
.regs[9] = { IMX415_INCKSEL7, 0x1 },
.regs[10] = { IMX415_TXCLKESC_FREQ, 0x0984 },
},
{
.lane_rate = 594000000UL,
.inck = 74250000,
.regs[0] = { IMX415_BCWAIT_TIME, 0x0FF },
.regs[1] = { IMX415_CPWAIT_TIME, 0x0B6 },
.regs[2] = { IMX415_SYS_MODE, 0x7 },
.regs[3] = { IMX415_INCKSEL1, 0x00 },
.regs[4] = { IMX415_INCKSEL2, 0x28 },
.regs[5] = { IMX415_INCKSEL3, 0x080 },
.regs[6] = { IMX415_INCKSEL4, 0x0E0 },
.regs[7] = { IMX415_INCKSEL5, 0x28 },
.regs[8] = { IMX415_INCKSEL6, 0x0 },
.regs[9] = { IMX415_INCKSEL7, 0x1 },
.regs[10] = { IMX415_TXCLKESC_FREQ, 0x1290 },
},
{
.lane_rate = 720000000UL,
.inck = 24000000,
.regs[0] = { IMX415_BCWAIT_TIME, 0x054 },
.regs[1] = { IMX415_CPWAIT_TIME, 0x03B },
.regs[2] = { IMX415_SYS_MODE, 0x9 },
.regs[3] = { IMX415_INCKSEL1, 0x00 },
.regs[4] = { IMX415_INCKSEL2, 0x23 },
.regs[5] = { IMX415_INCKSEL3, 0x0B4 },
.regs[6] = { IMX415_INCKSEL4, 0x0FC },
.regs[7] = { IMX415_INCKSEL5, 0x23 },
.regs[8] = { IMX415_INCKSEL6, 0x0 },
.regs[9] = { IMX415_INCKSEL7, 0x1 },
.regs[10] = { IMX415_TXCLKESC_FREQ, 0x0600 },
},
{
.lane_rate = 720000000UL,
.inck = 72000000,
.regs[0] = { IMX415_BCWAIT_TIME, 0x0F8 },
.regs[1] = { IMX415_CPWAIT_TIME, 0x0B0 },
.regs[2] = { IMX415_SYS_MODE, 0x9 },
.regs[3] = { IMX415_INCKSEL1, 0x00 },
.regs[4] = { IMX415_INCKSEL2, 0x28 },
.regs[5] = { IMX415_INCKSEL3, 0x0A0 },
.regs[6] = { IMX415_INCKSEL4, 0x0E0 },
.regs[7] = { IMX415_INCKSEL5, 0x28 },
.regs[8] = { IMX415_INCKSEL6, 0x0 },
.regs[9] = { IMX415_INCKSEL7, 0x1 },
.regs[10] = { IMX415_TXCLKESC_FREQ, 0x1200 },
},
{
.lane_rate = 891000000UL,
.inck = 27000000,
.regs[0] = { IMX415_BCWAIT_TIME, 0x05D },
.regs[1] = { IMX415_CPWAIT_TIME, 0x042 },
.regs[2] = { IMX415_SYS_MODE, 0x5 },
.regs[3] = { IMX415_INCKSEL1, 0x00 },
Annotation
- Immediate include surface: `linux/clk.h`, `linux/gpio/consumer.h`, `linux/i2c.h`, `linux/module.h`, `linux/of.h`, `linux/pm_runtime.h`, `linux/regmap.h`, `linux/regulator/consumer.h`.
- Detected declarations: `struct imx415_clk_params`, `struct imx415_mode_reg_list`, `struct imx415_mode`, `struct imx415`, `function imx415_set_testpattern`, `function imx415_s_ctrl`, `function imx415_ctrls_init`, `function imx415_set_mode`, `function imx415_setup`, `function imx415_wakeup`.
- 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.