drivers/media/i2c/s5kjn1.c
Source file repositories/reference/linux-study-clean/drivers/media/i2c/s5kjn1.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/i2c/s5kjn1.c- Extension
.c- Size
- 42033 bytes
- Lines
- 1488
- 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 s5kjn1_reg_liststruct s5kjn1_modestruct s5kjn1function s5kjn1_set_ctrlfunction s5kjn1_freq_to_pixel_ratefunction s5kjn1_init_controlsfunction s5kjn1_enable_streamsfunction s5kjn1_disable_streamsfunction s5kjn1_get_format_codefunction s5kjn1_update_pad_formatfunction s5kjn1_set_pad_formatfunction s5kjn1_enum_mbus_codefunction s5kjn1_enum_frame_sizefunction s5kjn1_get_selectionfunction s5kjn1_init_statefunction s5kjn1_identify_sensorfunction s5kjn1_check_hwcfgfunction s5kjn1_power_onfunction s5kjn1_power_offfunction s5kjn1_probefunction s5kjn1_remove
Annotated Snippet
struct s5kjn1_reg_list {
const struct cci_reg_sequence *regs;
unsigned int num_regs;
};
struct s5kjn1_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 */
u32 exposure_margin; /* Exposure margin */
const struct s5kjn1_reg_list reg_list; /* Sensor register setting */
};
static const char * const s5kjn1_test_pattern_menu[] = {
"Disabled",
"Solid color",
"Color bars",
"Fade to grey color bars",
"PN9",
};
struct s5kjn1 {
struct device *dev;
struct regmap *regmap;
struct clk *mclk;
struct gpio_desc *reset_gpio;
struct regulator *afvdd; /* Autofocus actuator power */
struct regulator *vdda; /* Analog power */
struct regulator *vddd; /* Digital core power */
struct regulator *vddio; /* Digital I/O power */
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 s5kjn1_mode *mode;
};
static const struct cci_reg_sequence init_array_setting[] = {
{ CCI_REG16(0x6028), 0x2400 },
{ CCI_REG16(0x602a), 0x1354 },
{ CCI_REG16(0x6f12), 0x0100 },
{ CCI_REG16(0x6f12), 0x7017 },
{ CCI_REG16(0x602a), 0x13b2 },
{ CCI_REG16(0x6f12), 0x0000 },
{ CCI_REG16(0x602a), 0x1236 },
{ CCI_REG16(0x6f12), 0x0000 },
{ CCI_REG16(0x602a), 0x1a0a },
{ CCI_REG16(0x6f12), 0x4c0a },
{ CCI_REG16(0x602a), 0x2210 },
{ CCI_REG16(0x6f12), 0x3401 },
{ CCI_REG16(0x602a), 0x2176 },
{ CCI_REG16(0x6f12), 0x6400 },
{ CCI_REG16(0x602a), 0x222e },
{ CCI_REG16(0x6f12), 0x0001 },
{ CCI_REG16(0x602a), 0x06b6 },
{ CCI_REG16(0x6f12), 0x0a00 },
{ CCI_REG16(0x602a), 0x06bc },
{ CCI_REG16(0x6f12), 0x1001 },
{ CCI_REG16(0x602a), 0x2140 },
{ CCI_REG16(0x6f12), 0x0101 },
{ CCI_REG16(0x602a), 0x1a0e },
{ CCI_REG16(0x6f12), 0x9600 },
{ CCI_REG16(0x6028), 0x4000 },
{ CCI_REG16(0xf44e), 0x0011 },
{ CCI_REG16(0xf44c), 0x0b0b },
{ CCI_REG16(0xf44a), 0x0006 },
{ CCI_REG16(0x0118), 0x0002 },
{ CCI_REG16(0x011a), 0x0001 },
};
static const struct cci_reg_sequence s5kjn1_4080x3072_30fps_mode[] = {
{ CCI_REG16(0x6028), 0x2400 },
{ CCI_REG16(0x602a), 0x1a28 },
{ CCI_REG16(0x6f12), 0x4c00 },
{ CCI_REG16(0x602a), 0x065a },
{ CCI_REG16(0x6f12), 0x0000 },
{ CCI_REG16(0x602a), 0x139e },
{ CCI_REG16(0x6f12), 0x0100 },
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 s5kjn1_reg_list`, `struct s5kjn1_mode`, `struct s5kjn1`, `function s5kjn1_set_ctrl`, `function s5kjn1_freq_to_pixel_rate`, `function s5kjn1_init_controls`, `function s5kjn1_enable_streams`, `function s5kjn1_disable_streams`, `function s5kjn1_get_format_code`, `function s5kjn1_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.