drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h

Source file repositories/reference/linux-study-clean/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h

File Facts

System
Linux kernel
Corpus path
drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h
Extension
.h
Size
8738 bytes
Lines
310
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 mtk_jpeg_variant {
	struct clk_bulk_data *clks;
	int num_clks;
	struct mtk_jpeg_fmt *formats;
	int num_formats;
	const struct vb2_ops *qops;
	irqreturn_t (*irq_handler)(int irq, void *priv);
	void (*hw_reset)(void __iomem *base);
	const struct v4l2_m2m_ops *m2m_ops;
	const char *dev_name;
	const struct v4l2_ioctl_ops *ioctl_ops;
	u32 out_q_default_fourcc;
	u32 cap_q_default_fourcc;
	bool multi_core;
	void (*jpeg_worker)(struct work_struct *work);
	bool support_34bit;
};

struct mtk_jpeg_src_buf {
	u32 frame_num;
	struct vb2_v4l2_buffer b;
	struct list_head list;
	u32 bs_size;
	struct mtk_jpeg_dec_param dec_param;

	struct mtk_jpeg_ctx *curr_ctx;
};

enum mtk_jpeg_hw_state {
	MTK_JPEG_HW_IDLE = 0,
	MTK_JPEG_HW_BUSY = 1,
};

struct mtk_jpeg_hw_param {
	struct vb2_v4l2_buffer *src_buffer;
	struct vb2_v4l2_buffer *dst_buffer;
	struct mtk_jpeg_ctx *curr_ctx;
};

enum mtk_jpegenc_hw_id {
	MTK_JPEGENC_HW0,
	MTK_JPEGENC_HW1,
	MTK_JPEGENC_HW_MAX,
};

enum mtk_jpegdec_hw_id {
	MTK_JPEGDEC_HW0,
	MTK_JPEGDEC_HW1,
	MTK_JPEGDEC_HW2,
	MTK_JPEGDEC_HW_MAX,
};

/**
 * struct mtk_jpegenc_clk - Structure used to store vcodec clock information
 * @clks:		JPEG encode clock
 * @clk_num:		JPEG encode clock numbers
 */
struct mtk_jpegenc_clk {
	struct clk_bulk_data *clks;
	int clk_num;
};

/**
 * struct mtk_jpegdec_clk - Structure used to store vcodec clock information
 * @clks:		JPEG decode clock
 * @clk_num:		JPEG decode clock numbers
 */
struct mtk_jpegdec_clk {
	struct clk_bulk_data *clks;
	int clk_num;
};

/**
 * struct mtk_jpegenc_comp_dev - JPEG COREX abstraction
 * @dev:		JPEG device
 * @plat_dev:		platform device data
 * @reg_base:		JPEG registers mapping
 * @master_dev:		mtk_jpeg_dev device
 * @venc_clk:		jpeg encode clock
 * @jpegenc_irq:	jpeg encode irq num
 * @job_timeout_work:	encode timeout workqueue
 * @hw_param:		jpeg encode hw parameters
 * @hw_state:		record hw state
 * @hw_lock:		spinlock protecting the hw device resource
 */
struct mtk_jpegenc_comp_dev {
	struct device *dev;
	struct platform_device *plat_dev;
	void __iomem *reg_base;
	struct mtk_jpeg_dev *master_dev;

Annotation

Implementation Notes