drivers/media/pci/intel/ipu3/ipu3-cio2.h

Source file repositories/reference/linux-study-clean/drivers/media/pci/intel/ipu3/ipu3-cio2.h

File Facts

System
Linux kernel
Corpus path
drivers/media/pci/intel/ipu3/ipu3-cio2.h
Extension
.h
Size
16724 bytes
Lines
457
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 cio2_csi2_timing {
	s32 clk_termen;
	s32 clk_settle;
	s32 dat_termen;
	s32 dat_settle;
};

struct cio2_buffer {
	struct vb2_v4l2_buffer vbb;
	u32 *lop[CIO2_MAX_LOPS];
	dma_addr_t lop_bus_addr[CIO2_MAX_LOPS];
	unsigned int offset;
};

#define to_cio2_buffer(vb)	container_of(vb, struct cio2_buffer, vbb.vb2_buf)

struct csi2_bus_info {
	u32 port;
	u32 lanes;
};

struct cio2_queue {
	/* mutex to be used by vb2_queue */
	struct mutex lock;
	struct media_pipeline pipe;
	struct csi2_bus_info csi2;
	struct v4l2_subdev *sensor;
	void __iomem *csi_rx_base;

	/* Subdev, /dev/v4l-subdevX */
	struct v4l2_subdev subdev;
	struct media_pad subdev_pads[CIO2_PADS];
	atomic_t frame_sequence;

	/* Video device, /dev/videoX */
	struct video_device vdev;
	struct media_pad vdev_pad;
	struct v4l2_pix_format_mplane format;
	struct vb2_queue vbq;

	/* Buffer queue handling */
	struct cio2_fbpt_entry *fbpt;	/* Frame buffer pointer table */
	dma_addr_t fbpt_bus_addr;
	struct cio2_buffer *bufs[CIO2_MAX_BUFFERS];
	unsigned int bufs_first;	/* Index of the first used entry */
	unsigned int bufs_next;	/* Index of the first unused entry */
	atomic_t bufs_queued;
};

struct cio2_device {
	struct pci_dev *pci_dev;
	void __iomem *base;
	struct v4l2_device v4l2_dev;
	struct cio2_queue queue[CIO2_QUEUES];
	struct cio2_queue *cur_queue;
	/* mutex to be used by video_device */
	struct mutex lock;

	bool streaming;
	struct v4l2_async_notifier notifier;
	struct media_device media_dev;

	/*
	 * Safety net to catch DMA fetch ahead
	 * when reaching the end of LOP
	 */
	void *dummy_page;
	/* DMA handle of dummy_page */
	dma_addr_t dummy_page_bus_addr;
	/* single List of Pointers (LOP) page */
	u32 *dummy_lop;
	/* DMA handle of dummy_lop */
	dma_addr_t dummy_lop_bus_addr;
};

#define to_cio2_device(n)	container_of(n, struct cio2_device, notifier)

/**************** Virtual channel ****************/
/*
 * This should come from sensor driver. No
 * driver interface nor requirement yet.
 */
#define SENSOR_VIR_CH_DFLT		0

/**************** FBPT operations ****************/
#define CIO2_FBPT_SIZE			(CIO2_MAX_BUFFERS * CIO2_MAX_LOPS * \
					 sizeof(struct cio2_fbpt_entry))

#define CIO2_FBPT_SUBENTRY_UNIT		4

Annotation

Implementation Notes