drivers/media/usb/gspca/vc032x.c

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

File Facts

System
Linux kernel
Corpus path
drivers/media/usb/gspca/vc032x.c
Extension
.c
Size
113154 bytes
Lines
3839
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 { /* hvflip cluster */
		struct v4l2_ctrl *hflip;
		struct v4l2_ctrl *vflip;
	};

	u8 image_offset;

	u8 bridge;
	u8 sensor;
	u8 flags;
#define FL_SAMSUNG 0x01		/* SamsungQ1 (2 sensors) */
#define FL_HFLIP 0x02		/* mirrored by default */
#define FL_VFLIP 0x04		/* vertical flipped by default */
};
enum bridges {
	BRIDGE_VC0321,
	BRIDGE_VC0323,
};
enum sensors {
	SENSOR_HV7131R,
	SENSOR_MI0360,
	SENSOR_MI1310_SOC,
	SENSOR_MI1320,
	SENSOR_MI1320_SOC,
	SENSOR_OV7660,
	SENSOR_OV7670,
	SENSOR_PO1200,
	SENSOR_PO3130NC,
	SENSOR_POxxxx,
	NSENSORS
};


static const struct v4l2_pix_format vc0321_mode[] = {
	{320, 240, V4L2_PIX_FMT_YVYU, V4L2_FIELD_NONE,
		.bytesperline = 320 * 2,
		.sizeimage = 320 * 240 * 2,
		.colorspace = V4L2_COLORSPACE_SRGB,
		.priv = 1},
	{640, 480, V4L2_PIX_FMT_YVYU, V4L2_FIELD_NONE,
		.bytesperline = 640 * 2,
		.sizeimage = 640 * 480 * 2,
		.colorspace = V4L2_COLORSPACE_SRGB,
		.priv = 0},
};
static const struct v4l2_pix_format vc0323_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},
	{1280, 960, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, /* mi1310_soc only */
		.bytesperline = 1280,
		.sizeimage = 1280 * 960 * 3 / 8 + 590,
		.colorspace = V4L2_COLORSPACE_JPEG,
		.priv = 2},
};
static const struct v4l2_pix_format bi_mode[] = {
	{320, 240, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
		.bytesperline = 320 * 2,
		.sizeimage = 320 * 240 * 2,
		.colorspace = V4L2_COLORSPACE_SRGB,
		.priv = 2},
	{640, 480, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
		.bytesperline = 640 * 2,
		.sizeimage = 640 * 480 * 2,
		.colorspace = V4L2_COLORSPACE_SRGB,
		.priv = 1},
	{1280, 1024, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
		.bytesperline = 1280 * 2,
		.sizeimage = 1280 * 1024 * 2,
		.colorspace = V4L2_COLORSPACE_SRGB,
		.priv = 0},
};
static const struct v4l2_pix_format svga_mode[] = {
	{800, 600, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
		.bytesperline = 800,
		.sizeimage = 800 * 600 * 1 / 4 + 590,
		.colorspace = V4L2_COLORSPACE_JPEG,
		.priv = 0},
};

/* OV7660/7670 registers */

Annotation

Implementation Notes