drivers/media/usb/gspca/zc3xx.c

Source file repositories/reference/linux-study-clean/drivers/media/usb/gspca/zc3xx.c

File Facts

System
Linux kernel
Corpus path
drivers/media/usb/gspca/zc3xx.c
Extension
.c
Size
259959 bytes
Lines
7030
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;	/* !! must be the first item */

	struct { /* gamma/brightness/contrast control cluster */
		struct v4l2_ctrl *gamma;
		struct v4l2_ctrl *brightness;
		struct v4l2_ctrl *contrast;
	};
	struct { /* autogain/exposure control cluster */
		struct v4l2_ctrl *autogain;
		struct v4l2_ctrl *exposure;
	};
	struct v4l2_ctrl *plfreq;
	struct v4l2_ctrl *sharpness;
	struct v4l2_ctrl *jpegqual;

	struct work_struct work;

	u8 reg08;		/* webcam compression quality */

	u8 bridge;
	u8 sensor;		/* Type of image sensor chip */
	u16 chip_revision;

	u8 jpeg_hdr[JPEG_HDR_SZ];
};
enum bridges {
	BRIDGE_ZC301,
	BRIDGE_ZC303,
};
enum sensors {
	SENSOR_ADCM2700,
	SENSOR_CS2102,
	SENSOR_CS2102K,
	SENSOR_GC0303,
	SENSOR_GC0305,
	SENSOR_HDCS2020,
	SENSOR_HV7131B,
	SENSOR_HV7131R,
	SENSOR_ICM105A,
	SENSOR_MC501CB,
	SENSOR_MT9V111_1,	/* (mi360soc) zc301 */
	SENSOR_MT9V111_3,	/* (mi360soc) zc303 */
	SENSOR_OV7620,		/* OV7648 - same values */
	SENSOR_OV7630C,
	SENSOR_PAS106,
	SENSOR_PAS202B,
	SENSOR_PB0330,
	SENSOR_PO2030,
	SENSOR_TAS5130C,
	SENSOR_MAX
};

static const struct v4l2_pix_format vga_mode[] = {
	{320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
		.bytesperline = 320,
		.sizeimage = 320 * 240 * 3 / 8 + 590,
		.colorspace = V4L2_COLORSPACE_JPEG,
		.priv = 1},
	{640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
		.bytesperline = 640,
		.sizeimage = 640 * 480 * 3 / 8 + 590,
		.colorspace = V4L2_COLORSPACE_JPEG,
		.priv = 0},
};

static const struct v4l2_pix_format broken_vga_mode[] = {
	{320, 232, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
		.bytesperline = 320,
		.sizeimage = 320 * 232 * 4 / 8 + 590,
		.colorspace = V4L2_COLORSPACE_JPEG,
		.priv = 1},
	{640, 472, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
		.bytesperline = 640,
		.sizeimage = 640 * 472 * 3 / 8 + 590,
		.colorspace = V4L2_COLORSPACE_JPEG,
		.priv = 0},
};

static const struct v4l2_pix_format sif_mode[] = {
	{176, 144, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
		.bytesperline = 176,
		.sizeimage = 176 * 144 * 3 / 8 + 590,
		.colorspace = V4L2_COLORSPACE_JPEG,
		.priv = 1},
	{352, 288, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
		.bytesperline = 352,
		.sizeimage = 352 * 288 * 3 / 8 + 590,
		.colorspace = V4L2_COLORSPACE_JPEG,
		.priv = 0},

Annotation

Implementation Notes