drivers/media/i2c/imx335.c
Source file repositories/reference/linux-study-clean/drivers/media/i2c/imx335.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/i2c/imx335.c- Extension
.c- Size
- 40100 bytes
- Lines
- 1492
- 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/unaligned.hlinux/clk.hlinux/delay.hlinux/i2c.hlinux/module.hlinux/pm_runtime.hlinux/regmap.hmedia/v4l2-cci.hmedia/v4l2-ctrls.hmedia/v4l2-fwnode.hmedia/v4l2-subdev.h
Detected Declarations
struct imx335_reg_liststruct imx335_modestruct imx335enum imx335_scan_modefunction to_imx335function imx335_update_controlsfunction imx335_update_exp_gainfunction imx335_update_vertical_flipfunction imx335_update_test_patternfunction imx335_set_ctrlfunction imx335_get_format_codefunction imx335_enum_mbus_codefunction imx335_enum_frame_sizefunction imx335_fill_pad_formatfunction imx335_set_pad_formatfunction imx335_init_statefunction imx335_get_selectionfunction imx335_set_framefmtfunction imx335_enable_streamsfunction imx335_disable_streamsfunction imx335_detectfunction imx335_parse_hw_configfunction imx335_power_onfunction imx335_power_offfunction imx335_init_controlsfunction imx335_probefunction imx335_remove
Annotated Snippet
struct imx335_reg_list {
u32 num_of_regs;
const struct cci_reg_sequence *regs;
};
static const char * const imx335_supply_name[] = {
"avdd", /* Analog (2.9V) supply */
"ovdd", /* Digital I/O (1.8V) supply */
"dvdd", /* Digital Core (1.2V) supply */
};
enum imx335_scan_mode {
IMX335_ALL_PIXEL,
IMX335_2_2_BINNING,
};
/**
* struct imx335_mode - imx335 sensor mode structure
* @scan_mode: Configuration scan mode (All pixel / 2x2Binning)
* @width: Frame width
* @height: Frame height
* @code: Format code
* @hblank: Horizontal blanking in lines
* @vblank: Vertical blanking in lines
* @vblank_min: Minimum vertical blanking in lines
* @vblank_max: Maximum vertical blanking in lines
* @pclk: Sensor pixel clock
* @reg_list: Register list for sensor mode
* @vflip_normal: Register list vflip (normal readout)
* @vflip_inverted: Register list vflip (inverted readout)
*/
struct imx335_mode {
enum imx335_scan_mode scan_mode;
u32 width;
u32 height;
u32 code;
u32 hblank;
u32 vblank;
u32 vblank_min;
u32 vblank_max;
u64 pclk;
struct imx335_reg_list reg_list;
struct imx335_reg_list vflip_normal;
struct imx335_reg_list vflip_inverted;
};
/**
* struct imx335 - imx335 sensor device structure
* @dev: Pointer to generic device
* @client: Pointer to i2c client
* @sd: V4L2 sub-device
* @pad: Media pad. Only one pad supported
* @reset_gpio: Sensor reset gpio
* @supplies: Regulator supplies to handle power control
* @cci: CCI register map
* @inclk: Sensor input clock
* @ctrl_handler: V4L2 control handler
* @link_freq_ctrl: Pointer to link frequency control
* @pclk_ctrl: Pointer to pixel clock control
* @hblank_ctrl: Pointer to horizontal blanking control
* @vblank_ctrl: Pointer to vertical blanking control
* @vflip: Pointer to vertical flip control
* @exp_ctrl: Pointer to exposure control
* @again_ctrl: Pointer to analog gain control
* @vblank: Vertical blanking in lines
* @lane_mode: Mode for number of connected data lanes
* @cur_mode: Pointer to current selected sensor mode
* @link_freq_bitmap: Menu bitmap for link_freq_ctrl
* @cur_mbus_code: Currently selected media bus format code
*/
struct imx335 {
struct device *dev;
struct i2c_client *client;
struct v4l2_subdev sd;
struct media_pad pad;
struct gpio_desc *reset_gpio;
struct regulator_bulk_data supplies[ARRAY_SIZE(imx335_supply_name)];
struct regmap *cci;
struct clk *inclk;
struct v4l2_ctrl_handler ctrl_handler;
struct v4l2_ctrl *link_freq_ctrl;
struct v4l2_ctrl *pclk_ctrl;
struct v4l2_ctrl *hblank_ctrl;
struct v4l2_ctrl *vblank_ctrl;
struct v4l2_ctrl *vflip;
struct {
struct v4l2_ctrl *exp_ctrl;
struct v4l2_ctrl *again_ctrl;
};
Annotation
- Immediate include surface: `linux/unaligned.h`, `linux/clk.h`, `linux/delay.h`, `linux/i2c.h`, `linux/module.h`, `linux/pm_runtime.h`, `linux/regmap.h`, `media/v4l2-cci.h`.
- Detected declarations: `struct imx335_reg_list`, `struct imx335_mode`, `struct imx335`, `enum imx335_scan_mode`, `function to_imx335`, `function imx335_update_controls`, `function imx335_update_exp_gain`, `function imx335_update_vertical_flip`, `function imx335_update_test_pattern`, `function imx335_set_ctrl`.
- 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.