drivers/media/i2c/s5k3m5.c
Source file repositories/reference/linux-study-clean/drivers/media/i2c/s5k3m5.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/i2c/s5k3m5.c- Extension
.c- Size
- 39580 bytes
- Lines
- 1378
- 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/regulator/consumer.hlinux/units.hmedia/v4l2-cci.hmedia/v4l2-ctrls.hmedia/v4l2-device.hmedia/v4l2-fwnode.h
Detected Declarations
struct s5k3m5_reg_liststruct s5k3m5_modestruct s5k3m5function s5k3m5_set_ctrlfunction s5k3m5_freq_to_pixel_ratefunction s5k3m5_init_controlsfunction s5k3m5_enable_streamsfunction s5k3m5_disable_streamsfunction s5k3m5_get_format_codefunction s5k3m5_update_pad_formatfunction s5k3m5_set_pad_formatfunction s5k3m5_enum_mbus_codefunction s5k3m5_enum_frame_sizefunction s5k3m5_get_selectionfunction s5k3m5_init_statefunction s5k3m5_identify_sensorfunction s5k3m5_check_hwcfgfunction s5k3m5_power_onfunction s5k3m5_power_offfunction s5k3m5_probefunction s5k3m5_remove
Annotated Snippet
struct s5k3m5_reg_list {
const struct cci_reg_sequence *regs;
unsigned int num_regs;
};
struct s5k3m5_mode {
u32 width; /* Frame width in pixels */
u32 height; /* Frame height in pixels */
u32 hts; /* Horizontal timing size */
u32 vts; /* Default vertical timing size */
u32 exposure; /* Default exposure value */
const struct s5k3m5_reg_list reg_list; /* Sensor register setting */
};
static const char * const s5k3m5_test_pattern_menu[] = {
"Disabled",
"Solid colour",
"Colour bars",
"Fade to grey colour bars",
"PN9",
};
static const char * const s5k3m5_supply_names[] = {
"afvdd", /* Autofocus power */
"vdda", /* Analog power */
"vddd", /* Digital core power */
"vddio", /* Digital I/O power */
};
#define S5K3M5_NUM_SUPPLIES ARRAY_SIZE(s5k3m5_supply_names)
struct s5k3m5 {
struct device *dev;
struct regmap *regmap;
struct clk *mclk;
struct gpio_desc *reset_gpio;
struct regulator_bulk_data supplies[S5K3M5_NUM_SUPPLIES];
struct v4l2_subdev sd;
struct media_pad pad;
struct v4l2_ctrl_handler ctrl_handler;
struct v4l2_ctrl *link_freq;
struct v4l2_ctrl *pixel_rate;
struct v4l2_ctrl *hblank;
struct v4l2_ctrl *vblank;
struct v4l2_ctrl *exposure;
struct v4l2_ctrl *vflip;
struct v4l2_ctrl *hflip;
const struct s5k3m5_mode *mode;
};
static const struct cci_reg_sequence burst_array_setting[] = {
{ CCI_REG16(0x6f12), 0x0000 },
{ CCI_REG16(0x6f12), 0x0000 },
{ CCI_REG16(0x6f12), 0x0549 },
{ CCI_REG16(0x6f12), 0x0448 },
{ CCI_REG16(0x6f12), 0x054a },
{ CCI_REG16(0x6f12), 0xc1f8 },
{ CCI_REG16(0x6f12), 0xc804 },
{ CCI_REG16(0x6f12), 0x101a },
{ CCI_REG16(0x6f12), 0xa1f8 },
{ CCI_REG16(0x6f12), 0xcc04 },
{ CCI_REG16(0x6f12), 0x00f0 },
{ CCI_REG16(0x6f12), 0x1bb9 },
{ CCI_REG16(0x6f12), 0x2000 },
{ CCI_REG16(0x6f12), 0x4210 },
{ CCI_REG16(0x6f12), 0x2000 },
{ CCI_REG16(0x6f12), 0x2e50 },
{ CCI_REG16(0x6f12), 0x2000 },
{ CCI_REG16(0x6f12), 0x7000 },
{ CCI_REG16(0x6f12), 0x10b5 },
{ CCI_REG16(0x6f12), 0x00f0 },
{ CCI_REG16(0x6f12), 0x4ff9 },
{ CCI_REG16(0x6f12), 0x9949 },
{ CCI_REG16(0x6f12), 0x0120 },
{ CCI_REG16(0x6f12), 0x0880 },
{ CCI_REG16(0x6f12), 0x10bd },
{ CCI_REG16(0x6f12), 0x2de9 },
{ CCI_REG16(0x6f12), 0xf041 },
{ CCI_REG16(0x6f12), 0x974c },
{ CCI_REG16(0x6f12), 0x954f },
{ CCI_REG16(0x6f12), 0x0026 },
{ CCI_REG16(0x6f12), 0xb4f8 },
{ CCI_REG16(0x6f12), 0x6a52 },
{ CCI_REG16(0x6f12), 0x3888 },
{ CCI_REG16(0x6f12), 0x08b1 },
{ CCI_REG16(0x6f12), 0xa4f8 },
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/regulator/consumer.h`, `linux/units.h`.
- Detected declarations: `struct s5k3m5_reg_list`, `struct s5k3m5_mode`, `struct s5k3m5`, `function s5k3m5_set_ctrl`, `function s5k3m5_freq_to_pixel_rate`, `function s5k3m5_init_controls`, `function s5k3m5_enable_streams`, `function s5k3m5_disable_streams`, `function s5k3m5_get_format_code`, `function s5k3m5_update_pad_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.