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.
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
gspca.h
Detected Declarations
struct sdstruct sensor_infoenum bridgesenum sensorsfunction reg_r_ifunction reg_rfunction reg_w_ifunction reg_wfunction read_sensor_registerfunction vc032x_probe_sensorfunction put_tab_to_regfunction usb_exchangefunction sd_configfunction sd_initfunction setbrightnessfunction setcontrastfunction setcolorsfunction sethvflipfunction setlightfreqfunction setsharpnessfunction setgainfunction setexposurefunction setautogainfunction setgammafunction setbacklightfunction setwbfunction sd_startfunction sd_stopNfunction sd_stop0function sd_s_ctrlfunction sd_init_controlsfunction sd_probe
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
- Immediate include surface: `gspca.h`.
- Detected declarations: `struct sd`, `struct sensor_info`, `enum bridges`, `enum sensors`, `function reg_r_i`, `function reg_r`, `function reg_w_i`, `function reg_w`, `function read_sensor_register`, `function vc032x_probe_sensor`.
- 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.