drivers/media/pci/ivtv/ivtv-driver.h

Source file repositories/reference/linux-study-clean/drivers/media/pci/ivtv/ivtv-driver.h

File Facts

System
Linux kernel
Corpus path
drivers/media/pci/ivtv/ivtv-driver.h
Extension
.h
Size
29938 bytes
Lines
830
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 ivtv_options {
	int kilobytes[IVTV_MAX_STREAMS];        /* size in kilobytes of each stream */
	int cardtype;				/* force card type on load */
	int tuner;				/* set tuner on load */
	int radio;				/* enable/disable radio */
	int newi2c;				/* new I2C algorithm */
	int i2c_clock_period;			/* period of SCL for I2C bus */
};

/* ivtv-specific mailbox template */
struct ivtv_mailbox {
	u32 flags;
	u32 cmd;
	u32 retval;
	u32 timeout;
	u32 data[CX2341X_MBOX_MAX_DATA];
};

struct ivtv_api_cache {
	unsigned long last_jiffies;		/* when last command was issued */
	u32 data[CX2341X_MBOX_MAX_DATA];	/* last sent api data */
};

struct ivtv_mailbox_data {
	volatile struct ivtv_mailbox __iomem *mbox;
	/* Bits 0-2 are for the encoder mailboxes, 0-1 are for the decoder mailboxes.
	   If the bit is set, then the corresponding mailbox is in use by the driver. */
	unsigned long busy;
	u8 max_mbox;
};

/* per-buffer bit flags */
#define IVTV_F_B_NEED_BUF_SWAP  (1 << 0)	/* this buffer should be byte swapped */

/* per-stream, s_flags */
#define IVTV_F_S_DMA_PENDING	0	/* this stream has pending DMA */
#define IVTV_F_S_DMA_HAS_VBI	1       /* the current DMA request also requests VBI data */
#define IVTV_F_S_NEEDS_DATA	2	/* this decoding stream needs more data */

#define IVTV_F_S_CLAIMED	3	/* this stream is claimed */
#define IVTV_F_S_STREAMING      4	/* the fw is decoding/encoding this stream */
#define IVTV_F_S_INTERNAL_USE	5	/* this stream is used internally (sliced VBI processing) */
#define IVTV_F_S_PASSTHROUGH	6	/* this stream is in passthrough mode */
#define IVTV_F_S_STREAMOFF	7	/* signal end of stream EOS */
#define IVTV_F_S_APPL_IO        8	/* this stream is used read/written by an application */

#define IVTV_F_S_PIO_PENDING	9	/* this stream has pending PIO */
#define IVTV_F_S_PIO_HAS_VBI	1       /* the current PIO request also requests VBI data */

/* per-ivtv, i_flags */
#define IVTV_F_I_DMA		   0	/* DMA in progress */
#define IVTV_F_I_UDMA		   1	/* UDMA in progress */
#define IVTV_F_I_UDMA_PENDING	   2	/* UDMA pending */
#define IVTV_F_I_SPEED_CHANGE	   3	/* a speed change is in progress */
#define IVTV_F_I_EOS		   4	/* end of encoder stream reached */
#define IVTV_F_I_RADIO_USER	   5	/* the radio tuner is selected */
#define IVTV_F_I_DIG_RST	   6	/* reset digitizer */
#define IVTV_F_I_DEC_YUV	   7	/* YUV instead of MPG is being decoded */
#define IVTV_F_I_UPDATE_CC	   9	/* CC should be updated */
#define IVTV_F_I_UPDATE_WSS	   10	/* WSS should be updated */
#define IVTV_F_I_UPDATE_VPS	   11	/* VPS should be updated */
#define IVTV_F_I_DECODING_YUV	   12	/* this stream is YUV frame decoding */
#define IVTV_F_I_ENC_PAUSED	   13	/* the encoder is paused */
#define IVTV_F_I_VALID_DEC_TIMINGS 14	/* last_dec_timing is valid */
#define IVTV_F_I_HAVE_WORK	   15	/* used in the interrupt handler: there is work to be done */
#define IVTV_F_I_WORK_HANDLER_VBI  16	/* there is work to be done for VBI */
#define IVTV_F_I_WORK_HANDLER_YUV  17	/* there is work to be done for YUV */
#define IVTV_F_I_WORK_HANDLER_PIO  18	/* there is work to be done for PIO */
#define IVTV_F_I_PIO		   19	/* PIO in progress */
#define IVTV_F_I_DEC_PAUSED	   20	/* the decoder is paused */
#define IVTV_F_I_INITED		   21	/* set after first open */
#define IVTV_F_I_FAILED		   22	/* set if first open failed */
#define IVTV_F_I_WORK_HANDLER_PCM  23	/* there is work to be done for PCM */

/* Event notifications */
#define IVTV_F_I_EV_DEC_STOPPED	   28	/* decoder stopped event */
#define IVTV_F_I_EV_VSYNC	   29	/* VSYNC event */
#define IVTV_F_I_EV_VSYNC_FIELD    30	/* VSYNC event field (0 = first, 1 = second field) */
#define IVTV_F_I_EV_VSYNC_ENABLED  31	/* VSYNC event enabled */

/* Scatter-Gather array element, used in DMA transfers */
struct ivtv_sg_element {
	__le32 src;
	__le32 dst;
	__le32 size;
};

struct ivtv_sg_host_element {
	u32 src;
	u32 dst;

Annotation

Implementation Notes