#include <linux/clk.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/slab.h>
#include <media/media-device.h>
#include <media/videobuf2-core.h>
#include <media/videobuf2-v4l2.h>
#include <media/v4l2-mem2mem.h>
#include <media/v4l2-dev.h>
#include <media/v4l2-device.h>
#include <media/v4l2-fh.h>
#include <media/v4l2-event.h>
#include "mtk_jpeg_core.h"
#include "mtk_jpeg_dec_hw.h"
#define MTK_JPEG_DUNUM_MASK(val) …
enum mtk_jpeg_color { … };
static const struct of_device_id mtk_jpegdec_hw_ids[] = …;
MODULE_DEVICE_TABLE(of, mtk_jpegdec_hw_ids);
static inline int mtk_jpeg_verify_align(u32 val, int align, u32 reg)
{ … }
static int mtk_jpeg_decide_format(struct mtk_jpeg_dec_param *param)
{ … }
static void mtk_jpeg_calc_mcu(struct mtk_jpeg_dec_param *param)
{ … }
static void mtk_jpeg_calc_dma_group(struct mtk_jpeg_dec_param *param)
{ … }
static int mtk_jpeg_calc_dst_size(struct mtk_jpeg_dec_param *param)
{ … }
int mtk_jpeg_dec_fill_param(struct mtk_jpeg_dec_param *param)
{ … }
EXPORT_SYMBOL_GPL(…);
u32 mtk_jpeg_dec_get_int_status(void __iomem *base)
{ … }
EXPORT_SYMBOL_GPL(…);
u32 mtk_jpeg_dec_enum_result(u32 irq_result)
{ … }
EXPORT_SYMBOL_GPL(…);
void mtk_jpeg_dec_start(void __iomem *base)
{ … }
EXPORT_SYMBOL_GPL(…);
static void mtk_jpeg_dec_soft_reset(void __iomem *base)
{ … }
static void mtk_jpeg_dec_hard_reset(void __iomem *base)
{ … }
void mtk_jpeg_dec_reset(void __iomem *base)
{ … }
EXPORT_SYMBOL_GPL(…);
static void mtk_jpeg_dec_set_brz_factor(void __iomem *base, u8 yscale_w,
u8 yscale_h, u8 uvscale_w, u8 uvscale_h)
{ … }
static void mtk_jpeg_dec_set_dst_bank0(void __iomem *base, u32 addr_y,
u32 addr_u, u32 addr_v)
{ … }
static void mtk_jpeg_dec_set_dst_bank1(void __iomem *base, u32 addr_y,
u32 addr_u, u32 addr_v)
{ … }
static void mtk_jpeg_dec_set_mem_stride(void __iomem *base, u32 stride_y,
u32 stride_uv)
{ … }
static void mtk_jpeg_dec_set_img_stride(void __iomem *base, u32 stride_y,
u32 stride_uv)
{ … }
static void mtk_jpeg_dec_set_pause_mcu_idx(void __iomem *base, u32 idx)
{ … }
static void mtk_jpeg_dec_set_dec_mode(void __iomem *base, u32 mode)
{ … }
static void mtk_jpeg_dec_set_bs_write_ptr(void __iomem *base, u32 ptr)
{ … }
static void mtk_jpeg_dec_set_bs_info(void __iomem *base, u32 addr, u32 size,
u32 bitstream_size)
{ … }
static void mtk_jpeg_dec_set_comp_id(void __iomem *base, u32 id_y, u32 id_u,
u32 id_v)
{ … }
static void mtk_jpeg_dec_set_total_mcu(void __iomem *base, u32 num)
{ … }
static void mtk_jpeg_dec_set_comp0_du(void __iomem *base, u32 num)
{ … }
static void mtk_jpeg_dec_set_du_membership(void __iomem *base, u32 member,
u32 gmc, u32 isgray)
{ … }
static void mtk_jpeg_dec_set_q_table(void __iomem *base, u32 id0, u32 id1,
u32 id2)
{ … }
static void mtk_jpeg_dec_set_dma_group(void __iomem *base, u32 mcu_group,
u32 group_num, u32 last_mcu)
{ … }
static void mtk_jpeg_dec_set_sampling_factor(void __iomem *base, u32 comp_num,
u32 y_w, u32 y_h, u32 u_w,
u32 u_h, u32 v_w, u32 v_h)
{ … }
void mtk_jpeg_dec_set_config(void __iomem *base,
struct mtk_jpeg_dec_param *cfg,
u32 bitstream_size,
struct mtk_jpeg_bs *bs,
struct mtk_jpeg_fb *fb)
{ … }
EXPORT_SYMBOL_GPL(…);
static void mtk_jpegdec_put_buf(struct mtk_jpegdec_comp_dev *jpeg)
{ … }
static void mtk_jpegdec_timeout_work(struct work_struct *work)
{ … }
static irqreturn_t mtk_jpegdec_hw_irq_handler(int irq, void *priv)
{ … }
static int mtk_jpegdec_hw_init_irq(struct mtk_jpegdec_comp_dev *dev)
{ … }
static void mtk_jpegdec_destroy_workqueue(void *data)
{ … }
static int mtk_jpegdec_hw_probe(struct platform_device *pdev)
{ … }
static struct platform_driver mtk_jpegdec_hw_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;