drivers/media/i2c/t4ka3.c
Source file repositories/reference/linux-study-clean/drivers/media/i2c/t4ka3.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/i2c/t4ka3.c- Extension
.c- Size
- 29641 bytes
- Lines
- 1065
- 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/acpi.hlinux/bits.hlinux/delay.hlinux/dev_printk.hlinux/device.hlinux/err.hlinux/errno.hlinux/gpio/consumer.hlinux/i2c.hlinux/mod_devicetable.hlinux/mutex.hlinux/pm_runtime.hlinux/regmap.hlinux/types.hmedia/media-entity.hmedia/v4l2-async.hmedia/v4l2-cci.hmedia/v4l2-common.hmedia/v4l2-ctrls.hmedia/v4l2-fwnode.hmedia/v4l2-subdev.h
Detected Declarations
struct t4ka3_ctrlsstruct t4ka3_modestruct t4ka3_datafunction t4ka3_set_bayer_orderfunction t4ka3_update_exposure_rangefunction t4ka3_fill_formatfunction t4ka3_calc_modefunction t4ka3_get_vblank_limitsfunction t4ka3_set_pad_formatfunction t4ka3_update_flipfunction t4ka3_test_patternfunction t4ka3_detectfunction t4ka3_s_ctrlfunction t4ka3_set_modefunction t4ka3_enable_streamfunction t4ka3_disable_streamfunction t4ka3_get_selectionfunction t4ka3_set_selectionfunction t4ka3_enum_mbus_codefunction t4ka3_enum_frame_sizefunction t4ka3_check_hwcfgfunction t4ka3_init_statefunction t4ka3_init_controlsfunction t4ka3_pm_suspendfunction t4ka3_pm_resumefunction t4ka3_removefunction t4ka3_probe
Annotated Snippet
struct t4ka3_ctrls {
struct v4l2_ctrl_handler handler;
struct v4l2_ctrl *hflip;
struct v4l2_ctrl *vflip;
struct v4l2_ctrl *vblank;
struct v4l2_ctrl *hblank;
struct v4l2_ctrl *exposure;
struct v4l2_ctrl *gain;
struct v4l2_ctrl *test_pattern;
struct v4l2_ctrl *link_freq;
struct v4l2_ctrl *pixel_rate;
};
struct t4ka3_mode {
int binning;
u16 win_x;
u16 win_y;
};
struct t4ka3_data {
struct v4l2_subdev sd;
struct media_pad pad;
struct mutex lock; /* serialize sensor's ioctl */
struct t4ka3_ctrls ctrls;
struct t4ka3_mode mode;
struct device *dev;
struct regmap *regmap;
struct gpio_desc *powerdown_gpio;
struct gpio_desc *reset_gpio;
int streaming;
/* MIPI lane info */
u32 link_freq_index;
u8 mipi_lanes;
};
/* init settings */
static const struct cci_reg_sequence t4ka3_init_config[] = {
{ CCI_REG8(0x4136), 0x13 },
{ CCI_REG8(0x4137), 0x33 },
{ CCI_REG8(0x3094), 0x01 },
{ CCI_REG8(0x0233), 0x01 },
{ CCI_REG8(0x4B06), 0x01 },
{ CCI_REG8(0x4B07), 0x01 },
{ CCI_REG8(0x3028), 0x01 },
{ CCI_REG8(0x3032), 0x14 },
{ CCI_REG8(0x305C), 0x0C },
{ CCI_REG8(0x306D), 0x0A },
{ CCI_REG8(0x3071), 0xFA },
{ CCI_REG8(0x307E), 0x0A },
{ CCI_REG8(0x307F), 0xFC },
{ CCI_REG8(0x3091), 0x04 },
{ CCI_REG8(0x3092), 0x60 },
{ CCI_REG8(0x3096), 0xC0 },
{ CCI_REG8(0x3100), 0x07 },
{ CCI_REG8(0x3101), 0x4C },
{ CCI_REG8(0x3118), 0xCC },
{ CCI_REG8(0x3139), 0x06 },
{ CCI_REG8(0x313A), 0x06 },
{ CCI_REG8(0x313B), 0x04 },
{ CCI_REG8(0x3143), 0x02 },
{ CCI_REG8(0x314F), 0x0E },
{ CCI_REG8(0x3169), 0x99 },
{ CCI_REG8(0x316A), 0x99 },
{ CCI_REG8(0x3171), 0x05 },
{ CCI_REG8(0x31A1), 0xA7 },
{ CCI_REG8(0x31A2), 0x9C },
{ CCI_REG8(0x31A3), 0x8F },
{ CCI_REG8(0x31A4), 0x75 },
{ CCI_REG8(0x31A5), 0xEE },
{ CCI_REG8(0x31A6), 0xEA },
{ CCI_REG8(0x31A7), 0xE4 },
{ CCI_REG8(0x31A8), 0xE4 },
{ CCI_REG8(0x31DF), 0x05 },
{ CCI_REG8(0x31EC), 0x1B },
{ CCI_REG8(0x31ED), 0x1B },
{ CCI_REG8(0x31EE), 0x1B },
{ CCI_REG8(0x31F0), 0x1B },
{ CCI_REG8(0x31F1), 0x1B },
{ CCI_REG8(0x31F2), 0x1B },
{ CCI_REG8(0x3204), 0x3F },
{ CCI_REG8(0x3205), 0x03 },
{ CCI_REG8(0x3210), 0x01 },
{ CCI_REG8(0x3216), 0x68 },
{ CCI_REG8(0x3217), 0x58 },
{ CCI_REG8(0x3218), 0x58 },
{ CCI_REG8(0x321A), 0x68 },
{ CCI_REG8(0x321B), 0x60 },
{ CCI_REG8(0x3238), 0x03 },
{ CCI_REG8(0x3239), 0x03 },
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/bits.h`, `linux/delay.h`, `linux/dev_printk.h`, `linux/device.h`, `linux/err.h`, `linux/errno.h`, `linux/gpio/consumer.h`.
- Detected declarations: `struct t4ka3_ctrls`, `struct t4ka3_mode`, `struct t4ka3_data`, `function t4ka3_set_bayer_order`, `function t4ka3_update_exposure_range`, `function t4ka3_fill_format`, `function t4ka3_calc_mode`, `function t4ka3_get_vblank_limits`, `function t4ka3_set_pad_format`, `function t4ka3_update_flip`.
- 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.