drivers/media/usb/gspca/spca500.c
Source file repositories/reference/linux-study-clean/drivers/media/usb/gspca/spca500.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/usb/gspca/spca500.c- Extension
.c- Size
- 27172 bytes
- Lines
- 980
- 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.hjpeg.h
Detected Declarations
struct sdfunction reg_rfunction reg_wfunction reg_r_waitfunction write_vectorfunction spca50x_setup_qtablefunction spca500_ping310function spca500_clksmart310_initfunction spca500_setmodefunction spca500_full_resetfunction spca500_synch310function spca500_reinitfunction sd_configfunction sd_initfunction sd_startfunction sd_stopNfunction setbrightnessfunction setcontrastfunction setcolorsfunction sd_s_ctrlfunction sd_init_controlsfunction sd_probe
Annotated Snippet
struct sd {
struct gspca_dev gspca_dev; /* !! must be the first item */
char subtype;
#define AgfaCl20 0
#define AiptekPocketDV 1
#define BenqDC1016 2
#define CreativePCCam300 3
#define DLinkDSC350 4
#define Gsmartmini 5
#define IntelPocketPCCamera 6
#define KodakEZ200 7
#define LogitechClickSmart310 8
#define LogitechClickSmart510 9
#define LogitechTraveler 10
#define MustekGsmart300 11
#define Optimedia 12
#define PalmPixDC85 13
#define ToptroIndus 14
u8 jpeg_hdr[JPEG_HDR_SZ];
};
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 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},
};
/* Frame packet header offsets for the spca500 */
#define SPCA500_OFFSET_PADDINGLB 2
#define SPCA500_OFFSET_PADDINGHB 3
#define SPCA500_OFFSET_MODE 4
#define SPCA500_OFFSET_IMGWIDTH 5
#define SPCA500_OFFSET_IMGHEIGHT 6
#define SPCA500_OFFSET_IMGMODE 7
#define SPCA500_OFFSET_QTBLINDEX 8
#define SPCA500_OFFSET_FRAMSEQ 9
#define SPCA500_OFFSET_CDSPINFO 10
#define SPCA500_OFFSET_GPIO 11
#define SPCA500_OFFSET_AUGPIO 12
#define SPCA500_OFFSET_DATA 16
static const __u16 spca500_visual_defaults[][3] = {
{0x00, 0x0003, 0x816b}, /* SSI not active sync with vsync,
* hue (H byte) = 0,
* saturation/hue enable,
* brightness/contrast enable.
*/
{0x00, 0x0000, 0x8167}, /* brightness = 0 */
{0x00, 0x0020, 0x8168}, /* contrast = 0 */
{0x00, 0x0003, 0x816b}, /* SSI not active sync with vsync,
* hue (H byte) = 0, saturation/hue enable,
* brightness/contrast enable.
* was 0x0003, now 0x0000.
*/
{0x00, 0x0000, 0x816a}, /* hue (L byte) = 0 */
{0x00, 0x0020, 0x8169}, /* saturation = 0x20 */
{0x00, 0x0050, 0x8157}, /* edge gain high threshold */
{0x00, 0x0030, 0x8158}, /* edge gain low threshold */
{0x00, 0x0028, 0x8159}, /* edge bandwidth high threshold */
{0x00, 0x000a, 0x815a}, /* edge bandwidth low threshold */
{0x00, 0x0001, 0x8202}, /* clock rate compensation = 1/25 sec/frame */
{0x0c, 0x0004, 0x0000},
/* set interface */
{}
};
static const __u16 Clicksmart510_defaults[][3] = {
{0x00, 0x00, 0x8211},
Annotation
- Immediate include surface: `gspca.h`, `jpeg.h`.
- Detected declarations: `struct sd`, `function reg_r`, `function reg_w`, `function reg_r_wait`, `function write_vector`, `function spca50x_setup_qtable`, `function spca500_ping310`, `function spca500_clksmart310_init`, `function spca500_setmode`, `function spca500_full_reset`.
- 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.