drivers/media/pci/zoran/videocodec.h

Source file repositories/reference/linux-study-clean/drivers/media/pci/zoran/videocodec.h

File Facts

System
Linux kernel
Corpus path
drivers/media/pci/zoran/videocodec.h
Extension
.h
Size
12675 bytes
Lines
326
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 vfe_polarity {
	unsigned int vsync_pol:1;
	unsigned int hsync_pol:1;
	unsigned int field_pol:1;
	unsigned int blank_pol:1;
	unsigned int subimg_pol:1;
	unsigned int poe_pol:1;
	unsigned int pvalid_pol:1;
	unsigned int vclk_pol:1;
};

struct vfe_settings {
	__u32 x, y;		/* Offsets into image */
	__u32 width, height;	/* Area to capture */
	__u16 decimation;	/* Decimation divider */
	__u16 flags;		/* Flags for capture */
	__u16 quality;		/* quality of the video */
};

struct tvnorm {
	u16 wt, wa, h_start, h_sync_start, ht, ha, v_start;
};

struct jpeg_com_marker {
	int len; /* number of usable bytes in data */
	char data[60];
};

struct jpeg_app_marker {
	int appn; /* number app segment */
	int len; /* number of usable bytes in data */
	char data[60];
};

struct videocodec {
	/* -- filled in by slave device during register -- */
	char name[32];
	unsigned long magic;	/* may be used for client<->master attaching */
	unsigned long flags;	/* functionality flags */
	unsigned int type;	/* codec type */

	/* -- these is filled in later during master device attach -- */

	struct videocodec_master *master_data;

	/* -- these are filled in by the slave device during register -- */

	void *data;		/* private slave data */

	/* attach/detach client functions (indirect call) */
	int (*setup)(struct videocodec *codec);
	int (*unset)(struct videocodec *codec);

	/* main functions, every client needs them for sure! */
	// set compression or decompression (or freeze, stop, standby, etc)
	int (*set_mode)(struct videocodec *codec, int mode);
	// setup picture size and norm (for the codec's video frontend)
	int (*set_video)(struct videocodec *codec, const struct tvnorm *norm,
			 struct vfe_settings *cap, struct vfe_polarity *pol);
	// other control commands, also mmap setup etc.
	int (*control)(struct videocodec *codec, int type, int size, void *data);

	/* additional setup/query/processing (may be NULL pointer) */
	// interrupt setup / handling (for irq's delivered by master)
	int (*setup_interrupt)(struct videocodec *codec, long mode);
	int (*handle_interrupt)(struct videocodec *codec, int source, long flag);
	// picture interface (if any)
	long (*put_image)(struct videocodec *codec, int tr_type, int block,
			  long *fr_num, long *flag, long size, void *buf);
	long (*get_image)(struct videocodec *codec, int tr_type, int block,
			  long *fr_num, long *flag, long size, void *buf);
};

struct videocodec_master {
	/* -- filled in by master device for registration -- */
	char name[32];
	unsigned long magic;	/* may be used for client<->master attaching */
	unsigned long flags;	/* functionality flags */
	unsigned int type;	/* master type */

	void *data;		/* private master data */

	__u32 (*readreg)(struct videocodec *codec, __u16 reg);
	void (*writereg)(struct videocodec *codec, __u16 reg, __u32 value);
};

/* ================================================= */
/* function prototypes of the master/slave interface */
/* ================================================= */

Annotation

Implementation Notes