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.
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/clk.hlinux/interrupt.hmedia/v4l2-ctrls.hmedia/v4l2-device.hmedia/v4l2-fh.hmedia/videobuf2-v4l2.hmtk_jpeg_dec_hw.h
Detected Declarations
struct mtk_jpeg_variantstruct mtk_jpeg_src_bufstruct mtk_jpeg_hw_paramstruct mtk_jpegenc_clkstruct mtk_jpegdec_clkstruct mtk_jpegenc_comp_devstruct mtk_jpegdec_comp_devstruct mtk_jpeg_devstruct mtk_jpeg_fmtstruct mtk_jpeg_q_datastruct mtk_jpeg_ctxenum mtk_jpeg_ctx_stateenum mtk_jpeg_hw_stateenum mtk_jpegenc_hw_idenum mtk_jpegdec_hw_id
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
- Immediate include surface: `linux/clk.h`, `linux/interrupt.h`, `media/v4l2-ctrls.h`, `media/v4l2-device.h`, `media/v4l2-fh.h`, `media/videobuf2-v4l2.h`, `mtk_jpeg_dec_hw.h`.
- Detected declarations: `struct mtk_jpeg_variant`, `struct mtk_jpeg_src_buf`, `struct mtk_jpeg_hw_param`, `struct mtk_jpegenc_clk`, `struct mtk_jpegdec_clk`, `struct mtk_jpegenc_comp_dev`, `struct mtk_jpegdec_comp_dev`, `struct mtk_jpeg_dev`, `struct mtk_jpeg_fmt`, `struct mtk_jpeg_q_data`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.