linux/drivers/media/platform/mediatek/jpeg/mtk_jpeg_enc_hw.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2019 MediaTek Inc.
 * Author: Xia Jiang <[email protected]>
 *
 */

#ifndef _MTK_JPEG_ENC_HW_H
#define _MTK_JPEG_ENC_HW_H

#include <media/videobuf2-core.h>

#include "mtk_jpeg_core.h"

#define JPEG_ENC_INT_STATUS_DONE
#define JPEG_ENC_INT_STATUS_MASK_ALLIRQ

#define JPEG_ENC_DST_ADDR_OFFSET_MASK

#define JPEG_ENC_CTRL_YUV_FORMAT_MASK
#define JPEG_ENC_CTRL_RESTART_EN_BIT
#define JPEG_ENC_CTRL_FILE_FORMAT_BIT
#define JPEG_ENC_CTRL_INT_EN_BIT
#define JPEG_ENC_CTRL_ENABLE_BIT
#define JPEG_ENC_RESET_BIT

#define JPEG_ENC_YUV_FORMAT_YUYV
#define JPEG_ENC_YUV_FORMAT_YVYU
#define JPEG_ENC_YUV_FORMAT_NV12
#define JEPG_ENC_YUV_FORMAT_NV21

#define JPEG_ENC_QUALITY_Q60
#define JPEG_ENC_QUALITY_Q80
#define JPEG_ENC_QUALITY_Q90
#define JPEG_ENC_QUALITY_Q95
#define JPEG_ENC_QUALITY_Q39
#define JPEG_ENC_QUALITY_Q68
#define JPEG_ENC_QUALITY_Q84
#define JPEG_ENC_QUALITY_Q92
#define JPEG_ENC_QUALITY_Q48
#define JPEG_ENC_QUALITY_Q74
#define JPEG_ENC_QUALITY_Q87
#define JPEG_ENC_QUALITY_Q34
#define JPEG_ENC_QUALITY_Q64
#define JPEG_ENC_QUALITY_Q82
#define JPEG_ENC_QUALITY_Q97

#define JPEG_ENC_RSTB
#define JPEG_ENC_CTRL
#define JPEG_ENC_QUALITY
#define JPEG_ENC_BLK_NUM
#define JPEG_ENC_BLK_CNT
#define JPEG_ENC_INT_STS
#define JPEG_ENC_DST_ADDR0
#define JPEG_ENC_DMA_ADDR0
#define JPEG_ENC_STALL_ADDR0
#define JPEG_ENC_OFFSET_ADDR
#define JPEG_ENC_RST_MCU_NUM
#define JPEG_ENC_IMG_SIZE
#define JPEG_ENC_DEBUG_INFO0
#define JPEG_ENC_DEBUG_INFO1
#define JPEG_ENC_TOTAL_CYCLE
#define JPEG_ENC_BYTE_OFFSET_MASK
#define JPEG_ENC_SRC_LUMA_ADDR
#define JPEG_ENC_SRC_CHROMA_ADDR
#define JPEG_ENC_STRIDE
#define JPEG_ENC_IMG_STRIDE
#define JPEG_ENC_DCM_CTRL
#define JPEG_ENC_CODEC_SEL
#define JPEG_ENC_ULTRA_THRES

/**
 * struct mtk_jpeg_enc_qlt - JPEG encoder quality data
 * @quality_param:	quality value
 * @hardware_value:	hardware value of quality
 */
struct mtk_jpeg_enc_qlt {};

void mtk_jpeg_enc_reset(void __iomem *base);
u32 mtk_jpeg_enc_get_file_size(void __iomem *base);
void mtk_jpeg_enc_start(void __iomem *enc_reg_base);
void mtk_jpeg_set_enc_src(struct mtk_jpeg_ctx *ctx,  void __iomem *base,
			  struct vb2_buffer *src_buf);
void mtk_jpeg_set_enc_dst(struct mtk_jpeg_ctx *ctx, void __iomem *base,
			  struct vb2_buffer *dst_buf);
void mtk_jpeg_set_enc_params(struct mtk_jpeg_ctx *ctx,  void __iomem *base);

#endif /* _MTK_JPEG_ENC_HW_H */