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.

Dependency Surface

Detected Declarations

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

Implementation Notes