drivers/media/i2c/tw9910.c
Source file repositories/reference/linux-study-clean/drivers/media/i2c/tw9910.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/i2c/tw9910.c- Extension
.c- Size
- 24699 bytes
- Lines
- 1018
- 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/init.hlinux/kernel.hlinux/module.hlinux/slab.hlinux/v4l2-mediabus.hlinux/videodev2.hmedia/i2c/tw9910.hmedia/v4l2-subdev.h
Detected Declarations
struct tw9910_scale_ctrlstruct tw9910_privfunction tw9910_mask_setfunction tw9910_set_scalefunction tw9910_set_hsyncfunction tw9910_resetfunction tw9910_powerfunction tw9910_s_streamfunction tw9910_g_stdfunction tw9910_s_stdfunction tw9910_g_registerfunction tw9910_s_registerfunction tw9910_set_gpio_valuefunction tw9910_power_onfunction tw9910_power_offfunction tw9910_s_powerfunction tw9910_set_framefunction tw9910_get_selectionfunction tw9910_get_fmtfunction tw9910_s_fmtfunction tw9910_set_fmtfunction tw9910_video_probefunction tw9910_enum_mbus_codefunction tw9910_g_tvnormsfunction tw9910_probefunction tw9910_remove
Annotated Snippet
struct tw9910_scale_ctrl {
char *name;
unsigned short width;
unsigned short height;
u16 hscale;
u16 vscale;
};
struct tw9910_priv {
struct v4l2_subdev subdev;
struct clk *clk;
struct tw9910_video_info *info;
struct gpio_desc *pdn_gpio;
struct gpio_desc *rstb_gpio;
const struct tw9910_scale_ctrl *scale;
v4l2_std_id norm;
u32 revision;
};
static const struct tw9910_scale_ctrl tw9910_ntsc_scales[] = {
{
.name = "NTSC SQ",
.width = 640,
.height = 480,
.hscale = 0x0100,
.vscale = 0x0100,
},
{
.name = "NTSC CCIR601",
.width = 720,
.height = 480,
.hscale = 0x0100,
.vscale = 0x0100,
},
{
.name = "NTSC SQ (CIF)",
.width = 320,
.height = 240,
.hscale = 0x0200,
.vscale = 0x0200,
},
{
.name = "NTSC CCIR601 (CIF)",
.width = 360,
.height = 240,
.hscale = 0x0200,
.vscale = 0x0200,
},
{
.name = "NTSC SQ (QCIF)",
.width = 160,
.height = 120,
.hscale = 0x0400,
.vscale = 0x0400,
},
{
.name = "NTSC CCIR601 (QCIF)",
.width = 180,
.height = 120,
.hscale = 0x0400,
.vscale = 0x0400,
},
};
static const struct tw9910_scale_ctrl tw9910_pal_scales[] = {
{
.name = "PAL SQ",
.width = 768,
.height = 576,
.hscale = 0x0100,
.vscale = 0x0100,
},
{
.name = "PAL CCIR601",
.width = 720,
.height = 576,
.hscale = 0x0100,
.vscale = 0x0100,
},
{
.name = "PAL SQ (CIF)",
.width = 384,
.height = 288,
.hscale = 0x0200,
.vscale = 0x0200,
},
{
.name = "PAL CCIR601 (CIF)",
.width = 360,
.height = 288,
Annotation
- Immediate include surface: `linux/clk.h`, `linux/delay.h`, `linux/gpio/consumer.h`, `linux/i2c.h`, `linux/init.h`, `linux/kernel.h`, `linux/module.h`, `linux/slab.h`.
- Detected declarations: `struct tw9910_scale_ctrl`, `struct tw9910_priv`, `function tw9910_mask_set`, `function tw9910_set_scale`, `function tw9910_set_hsync`, `function tw9910_reset`, `function tw9910_power`, `function tw9910_s_stream`, `function tw9910_g_std`, `function tw9910_s_std`.
- 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.