drivers/media/usb/gspca/sn9c20x.c
Source file repositories/reference/linux-study-clean/drivers/media/usb/gspca/sn9c20x.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/usb/gspca/sn9c20x.c- Extension
.c- Size
- 71484 bytes
- Lines
- 2410
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/input.hgspca.hjpeg.hlinux/dmi.h
Detected Declarations
struct sdstruct i2c_reg_u8struct i2c_reg_u16function reg_rfunction reg_wfunction reg_w1function i2c_wfunction i2c_w1function i2c_w1_buffunction i2c_w2function i2c_w2_buffunction i2c_r1function i2c_r2function ov9650_init_sensorfunction ov9655_init_sensorfunction soi968_init_sensorfunction ov7660_init_sensorfunction ov7670_init_sensorfunction mt9v_init_sensorfunction mt9m112_init_sensorfunction mt9m111_init_sensorfunction mt9m001_init_sensorfunction hv7131r_init_sensorfunction set_cmatrixfunction set_gammafunction set_redbluefunction set_hvflipfunction set_exposurefunction set_gainfunction set_led_modefunction set_qualityfunction sd_dbg_g_registerfunction sd_dbg_s_registerfunction sd_chip_infofunction sd_configfunction sd_s_ctrlfunction sd_init_controlsfunction sd_initfunction configure_sensor_outputfunction sd_isoc_initfunction sd_startfunction sd_stopNfunction sd_stop0function do_autoexposurefunction do_autogainfunction sd_dqcallbackfunction qual_updfunction transfer_check
Annotated Snippet
struct sd {
struct gspca_dev gspca_dev;
struct { /* color control cluster */
struct v4l2_ctrl *brightness;
struct v4l2_ctrl *contrast;
struct v4l2_ctrl *saturation;
struct v4l2_ctrl *hue;
};
struct { /* blue/red balance control cluster */
struct v4l2_ctrl *blue;
struct v4l2_ctrl *red;
};
struct { /* h/vflip control cluster */
struct v4l2_ctrl *hflip;
struct v4l2_ctrl *vflip;
};
struct v4l2_ctrl *gamma;
struct { /* autogain and exposure or gain control cluster */
struct v4l2_ctrl *autogain;
struct v4l2_ctrl *exposure;
struct v4l2_ctrl *gain;
};
struct v4l2_ctrl *jpegqual;
struct v4l2_ctrl *led_mode;
struct work_struct work;
u32 pktsz; /* (used by pkt_scan) */
u16 npkt;
s8 nchg;
u8 fmt; /* (used for JPEG QTAB update */
#define MIN_AVG_LUM 80
#define MAX_AVG_LUM 130
atomic_t avg_lum;
u8 old_step;
u8 older_step;
u8 exposure_step;
u8 i2c_addr;
u8 i2c_intf;
u8 sensor;
u8 hstart;
u8 vstart;
u8 jpeg_hdr[JPEG_HDR_SZ];
u8 flags;
};
static void qual_upd(struct work_struct *work);
struct i2c_reg_u8 {
u8 reg;
u8 val;
};
struct i2c_reg_u16 {
u8 reg;
u16 val;
};
static const struct dmi_system_id flip_dmi_table[] = {
{
.ident = "MSI MS-1034",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "MICRO-STAR INT'L CO.,LTD."),
DMI_MATCH(DMI_PRODUCT_NAME, "MS-1034"),
DMI_MATCH(DMI_PRODUCT_VERSION, "0341")
}
},
{
.ident = "MSI MS-1039",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "MICRO-STAR INT'L CO.,LTD."),
DMI_MATCH(DMI_PRODUCT_NAME, "MS-1039"),
}
},
{
.ident = "MSI MS-1632",
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "MSI"),
DMI_MATCH(DMI_BOARD_NAME, "MS-1632")
}
},
{
.ident = "MSI MS-1633X",
.matches = {
Annotation
- Immediate include surface: `linux/input.h`, `gspca.h`, `jpeg.h`, `linux/dmi.h`.
- Detected declarations: `struct sd`, `struct i2c_reg_u8`, `struct i2c_reg_u16`, `function reg_r`, `function reg_w`, `function reg_w1`, `function i2c_w`, `function i2c_w1`, `function i2c_w1_buf`, `function i2c_w2`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.