drivers/media/platform/samsung/s5p-jpeg/jpeg-core.h

Source file repositories/reference/linux-study-clean/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.h

File Facts

System
Linux kernel
Corpus path
drivers/media/platform/samsung/s5p-jpeg/jpeg-core.h
Extension
.h
Size
7023 bytes
Lines
258
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 s5p_jpeg {
	struct mutex		lock;
	spinlock_t		slock;

	struct v4l2_device	v4l2_dev;
	struct video_device	*vfd_encoder;
	struct video_device	*vfd_decoder;
	struct v4l2_m2m_dev	*m2m_dev;

	void __iomem		*regs;
	unsigned int		irq;
	enum exynos4_jpeg_result irq_ret;
	struct clk		*clocks[JPEG_MAX_CLOCKS];
	struct device		*dev;
	struct s5p_jpeg_variant *variant;
	u32			irq_status;
};

struct s5p_jpeg_variant {
	unsigned int		version;
	unsigned int		fmt_ver_flag;
	unsigned int		hw3250_compat:1;
	unsigned int		htbl_reinit:1;
	unsigned int		hw_ex4_compat:1;
	const struct v4l2_m2m_ops *m2m_ops;
	irqreturn_t		(*jpeg_irq)(int irq, void *priv);
	const char		*clk_names[JPEG_MAX_CLOCKS];
	int			num_clocks;
};

/**
 * struct s5p_jpeg_fmt - driver's internal color format data
 * @fourcc:	the fourcc code, 0 if not applicable
 * @depth:	number of bits per pixel
 * @colplanes:	number of color planes (1 for packed formats)
 * @memplanes:	number of memory planes (1 for packed formats)
 * @h_align:	horizontal alignment order (align to 2^h_align)
 * @v_align:	vertical alignment order (align to 2^v_align)
 * @subsampling:subsampling of a raw format or a JPEG
 * @flags:	flags describing format applicability
 */
struct s5p_jpeg_fmt {
	u32	fourcc;
	int	depth;
	int	colplanes;
	int	memplanes;
	int	h_align;
	int	v_align;
	int	subsampling;
	u32	flags;
};

/**
 * struct s5p_jpeg_marker - collection of markers from jpeg header
 * @marker:	markers' positions relative to the buffer beginning
 * @len:	markers' payload lengths (without length field)
 * @n:		number of markers in collection
 */
struct s5p_jpeg_marker {
	u32	marker[S5P_JPEG_MAX_MARKER];
	u32	len[S5P_JPEG_MAX_MARKER];
	u32	n;
};

/**
 * struct s5p_jpeg_q_data - parameters of one queue
 * @fmt:	driver-specific format of this queue
 * @w:		image width
 * @h:		image height
 * @sos:	JPEG_MARKER_SOS's position relative to the buffer beginning
 * @dht:	JPEG_MARKER_DHT' positions relative to the buffer beginning
 * @dqt:	JPEG_MARKER_DQT' positions relative to the buffer beginning
 * @sof:	JPEG_MARKER_SOF0's position relative to the buffer beginning
 * @sof_len:	JPEG_MARKER_SOF0's payload length (without length field itself)
 * @size:	image buffer size in bytes
 */
struct s5p_jpeg_q_data {
	struct s5p_jpeg_fmt	*fmt;
	u32			w;
	u32			h;
	u32			sos;
	struct s5p_jpeg_marker	dht;
	struct s5p_jpeg_marker	dqt;
	u32			sof;
	u32			sof_len;
	u32			size;
};

/**
 * struct s5p_jpeg_ctx - the device context data

Annotation

Implementation Notes