drivers/media/usb/gspca/ov534.c
Source file repositories/reference/linux-study-clean/drivers/media/usb/gspca/ov534.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/usb/gspca/ov534.c- Extension
.c- Size
- 38595 bytes
- Lines
- 1609
- 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.hlinux/fixp-arith.hmedia/v4l2-ctrls.h
Detected Declarations
struct sdstruct reg_arraystruct rate_senum sensorsfunction ov534_reg_writefunction ov534_reg_readfunction ov534_set_ledfunction sccb_check_statusfunction sccb_reg_writefunction sccb_reg_readfunction reg_w_arrayfunction sccb_w_arrayfunction set_frame_ratefunction sethuefunction setsaturationfunction setbrightnessfunction setcontrastfunction setgainfunction getgainfunction setexposurefunction getexposurefunction setagcfunction setawbfunction setaecfunction setsharpnessfunction sethvflipfunction setlightfreqfunction sd_configfunction ov534_g_volatile_ctrlfunction ov534_s_ctrlfunction sd_init_controlsfunction sd_initfunction sd_startfunction sd_stopNfunction sd_pkt_scanfunction sd_get_streamparmfunction sd_set_streamparmfunction sd_probe
Annotated Snippet
struct sd {
struct gspca_dev gspca_dev; /* !! must be the first item */
struct v4l2_ctrl_handler ctrl_handler;
struct v4l2_ctrl *hue;
struct v4l2_ctrl *saturation;
struct v4l2_ctrl *brightness;
struct v4l2_ctrl *contrast;
struct { /* gain control cluster */
struct v4l2_ctrl *autogain;
struct v4l2_ctrl *gain;
};
struct v4l2_ctrl *autowhitebalance;
struct { /* exposure control cluster */
struct v4l2_ctrl *autoexposure;
struct v4l2_ctrl *exposure;
};
struct v4l2_ctrl *sharpness;
struct v4l2_ctrl *hflip;
struct v4l2_ctrl *vflip;
struct v4l2_ctrl *plfreq;
__u32 last_pts;
u16 last_fid;
u8 frame_rate;
u8 sensor;
};
enum sensors {
SENSOR_OV767x,
SENSOR_OV772x,
NSENSORS
};
static int sd_start(struct gspca_dev *gspca_dev);
static void sd_stopN(struct gspca_dev *gspca_dev);
static const struct v4l2_pix_format ov772x_mode[] = {
{320, 240, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
.bytesperline = 320 * 2,
.sizeimage = 320 * 240 * 2,
.colorspace = V4L2_COLORSPACE_SRGB,
.priv = 1},
{640, 480, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
.bytesperline = 640 * 2,
.sizeimage = 640 * 480 * 2,
.colorspace = V4L2_COLORSPACE_SRGB,
.priv = 0},
{320, 240, V4L2_PIX_FMT_SGRBG8, V4L2_FIELD_NONE,
.bytesperline = 320,
.sizeimage = 320 * 240,
.colorspace = V4L2_COLORSPACE_SRGB,
.priv = 1},
{640, 480, V4L2_PIX_FMT_SGRBG8, V4L2_FIELD_NONE,
.bytesperline = 640,
.sizeimage = 640 * 480,
.colorspace = V4L2_COLORSPACE_SRGB,
.priv = 0},
};
static const struct v4l2_pix_format ov767x_mode[] = {
{320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
.bytesperline = 320,
.sizeimage = 320 * 240 * 3 / 8 + 590,
.colorspace = V4L2_COLORSPACE_JPEG},
{640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
.bytesperline = 640,
.sizeimage = 640 * 480 * 3 / 8 + 590,
.colorspace = V4L2_COLORSPACE_JPEG},
};
static const u8 qvga_rates[] = {187, 150, 137, 125, 100, 75, 60, 50, 37, 30};
static const u8 vga_rates[] = {60, 50, 40, 30, 15};
static const struct framerates ov772x_framerates[] = {
{ /* 320x240 */
.rates = qvga_rates,
.nrates = ARRAY_SIZE(qvga_rates),
},
{ /* 640x480 */
.rates = vga_rates,
.nrates = ARRAY_SIZE(vga_rates),
},
{ /* 320x240 SGBRG8 */
.rates = qvga_rates,
.nrates = ARRAY_SIZE(qvga_rates),
},
{ /* 640x480 SGBRG8 */
.rates = vga_rates,
.nrates = ARRAY_SIZE(vga_rates),
Annotation
- Immediate include surface: `gspca.h`, `linux/fixp-arith.h`, `media/v4l2-ctrls.h`.
- Detected declarations: `struct sd`, `struct reg_array`, `struct rate_s`, `enum sensors`, `function ov534_reg_write`, `function ov534_reg_read`, `function ov534_set_led`, `function sccb_check_status`, `function sccb_reg_write`, `function sccb_reg_read`.
- 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.