drivers/media/i2c/imx355.c
Source file repositories/reference/linux-study-clean/drivers/media/i2c/imx355.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/i2c/imx355.c- Extension
.c- Size
- 42528 bytes
- Lines
- 1899
- 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/gpio/consumer.hlinux/i2c.hlinux/module.hlinux/of.hlinux/pm_runtime.hlinux/regulator/consumer.hlinux/unaligned.hmedia/v4l2-ctrls.hmedia/v4l2-device.hmedia/v4l2-event.hmedia/v4l2-fwnode.h
Detected Declarations
struct imx355_regstruct imx355_reg_liststruct imx355_modestruct imx355_hwcfgstruct imx355function imx355_get_format_codefunction imx355_read_regfunction imx355_write_regfunction imx355_write_regsfunction imx355_openfunction imx355_set_ctrlfunction imx355_enum_mbus_codefunction imx355_enum_frame_sizefunction imx355_update_pad_formatfunction imx355_do_get_pad_formatfunction imx355_get_pad_formatfunction imx355_set_pad_formatfunction imx355_start_streamingfunction imx355_stop_streamingfunction imx355_set_streamfunction imx355_identify_modulefunction imx355_power_offfunction imx355_power_onfunction imx355_init_controlsfunction imx355_probefunction imx355_remove
Annotated Snippet
struct imx355_reg {
u16 address;
u8 val;
};
struct imx355_reg_list {
u32 num_of_regs;
const struct imx355_reg *regs;
};
/* Mode : resolution and related config&values */
struct imx355_mode {
/* Frame width */
u32 width;
/* Frame height */
u32 height;
/* V-timing */
u32 fll_def;
u32 fll_min;
/* H-timing */
u32 llp;
/* index of link frequency */
u32 link_freq_index;
/* Default register values */
struct imx355_reg_list reg_list;
};
struct imx355_hwcfg {
unsigned long link_freq_bitmap;
};
struct imx355 {
struct device *dev;
struct clk *clk;
struct v4l2_subdev sd;
struct media_pad pad;
struct v4l2_ctrl_handler ctrl_handler;
/* V4L2 Controls */
struct v4l2_ctrl *link_freq;
struct v4l2_ctrl *pixel_rate;
struct v4l2_ctrl *vblank;
struct v4l2_ctrl *hblank;
struct v4l2_ctrl *exposure;
struct v4l2_ctrl *vflip;
struct v4l2_ctrl *hflip;
/* Current mode */
const struct imx355_mode *cur_mode;
struct imx355_hwcfg *hwcfg;
/*
* Mutex for serialized access:
* Protect sensor set pad format and start/stop streaming safely.
* Protect access to sensor v4l2 controls.
*/
struct mutex mutex;
struct gpio_desc *reset_gpio;
struct regulator_bulk_data *supplies;
};
static const struct regulator_bulk_data imx355_supplies[] = {
{ .supply = "avdd" },
{ .supply = "dvdd" },
{ .supply = "dovdd" },
};
static const struct imx355_reg imx355_global_regs[] = {
{ 0x0136, 0x13 },
{ 0x0137, 0x33 },
{ 0x304e, 0x03 },
{ 0x4348, 0x16 },
{ 0x4350, 0x19 },
{ 0x4408, 0x0a },
{ 0x440c, 0x0b },
{ 0x4411, 0x5f },
{ 0x4412, 0x2c },
{ 0x4623, 0x00 },
{ 0x462c, 0x0f },
{ 0x462d, 0x00 },
{ 0x462e, 0x00 },
{ 0x4684, 0x54 },
{ 0x480a, 0x07 },
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/clk.h`, `linux/delay.h`, `linux/gpio/consumer.h`, `linux/i2c.h`, `linux/module.h`, `linux/of.h`, `linux/pm_runtime.h`.
- Detected declarations: `struct imx355_reg`, `struct imx355_reg_list`, `struct imx355_mode`, `struct imx355_hwcfg`, `struct imx355`, `function imx355_get_format_code`, `function imx355_read_reg`, `function imx355_write_reg`, `function imx355_write_regs`, `function imx355_open`.
- 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.