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.
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/input.hgspca.hjpeg.hzc3xx-reg.h
Detected Declarations
struct sdstruct usb_actionstruct sensor_by_chipset_revisionenum bridgesenum sensorsfunction reg_rfunction reg_wfunction i2c_readfunction i2c_writefunction usb_exchangefunction setmatrixfunction setsharpnessfunction setcontrastfunction getexposurefunction setexposurefunction setqualityfunction setlightfreqfunction setautogainfunction transfer_updatefunction send_unknownfunction start_2wr_probefunction sif_probefunction vga_2wr_probefunction vga_3wr_probefunction zcxx_probeSensorfunction sd_configfunction zcxx_g_volatile_ctrlfunction zcxx_s_ctrlfunction sd_init_controlsfunction sd_initfunction sd_pre_startfunction sd_startfunction sd_stop0function sd_pkt_scanfunction sd_set_jcompfunction sd_get_jcompfunction sd_int_pkt_scanfunction sd_probe
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
- Immediate include surface: `linux/input.h`, `gspca.h`, `jpeg.h`, `zc3xx-reg.h`.
- Detected declarations: `struct sd`, `struct usb_action`, `struct sensor_by_chipset_revision`, `enum bridges`, `enum sensors`, `function reg_r`, `function reg_w`, `function i2c_read`, `function i2c_write`, `function usb_exchange`.
- 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.
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.