linux/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_reg.h

/* SPDX-License-Identifier: GPL-2.0+ */
/*
 * Copyright 2021-2022 Bootlin
 * Author: Paul Kocialkowski <[email protected]>
 */

#ifndef _SUN6I_ISP_REG_H_
#define _SUN6I_ISP_REG_H_

#include <linux/kernel.h>

#define SUN6I_ISP_ADDR_VALUE(a)

/* Frontend */

#define SUN6I_ISP_SRC_MODE_DRAM
#define SUN6I_ISP_SRC_MODE_CSI(n)

#define SUN6I_ISP_FE_CFG_REG
#define SUN6I_ISP_FE_CFG_EN
#define SUN6I_ISP_FE_CFG_SRC0_MODE(v)
#define SUN6I_ISP_FE_CFG_SRC1_MODE(v)

#define SUN6I_ISP_FE_CTRL_REG
#define SUN6I_ISP_FE_CTRL_SCAP_EN
#define SUN6I_ISP_FE_CTRL_VCAP_EN
#define SUN6I_ISP_FE_CTRL_PARA_READY
#define SUN6I_ISP_FE_CTRL_LUT_UPDATE
#define SUN6I_ISP_FE_CTRL_LENS_UPDATE
#define SUN6I_ISP_FE_CTRL_GAMMA_UPDATE
#define SUN6I_ISP_FE_CTRL_DRC_UPDATE
#define SUN6I_ISP_FE_CTRL_DISC_UPDATE
#define SUN6I_ISP_FE_CTRL_OUTPUT_SPEED_CTRL(v)
#define SUN6I_ISP_FE_CTRL_VCAP_READ_START

#define SUN6I_ISP_FE_INT_EN_REG
#define SUN6I_ISP_FE_INT_EN_FINISH
#define SUN6I_ISP_FE_INT_EN_START
#define SUN6I_ISP_FE_INT_EN_PARA_SAVE
#define SUN6I_ISP_FE_INT_EN_PARA_LOAD
#define SUN6I_ISP_FE_INT_EN_SRC0_FIFO
#define SUN6I_ISP_FE_INT_EN_SRC1_FIFO
#define SUN6I_ISP_FE_INT_EN_ROT_FINISH
#define SUN6I_ISP_FE_INT_EN_LINE_NUM_START

#define SUN6I_ISP_FE_INT_STA_REG
#define SUN6I_ISP_FE_INT_STA_CLEAR
#define SUN6I_ISP_FE_INT_STA_FINISH
#define SUN6I_ISP_FE_INT_STA_START
#define SUN6I_ISP_FE_INT_STA_PARA_SAVE
#define SUN6I_ISP_FE_INT_STA_PARA_LOAD
#define SUN6I_ISP_FE_INT_STA_SRC0_FIFO
#define SUN6I_ISP_FE_INT_STA_SRC1_FIFO
#define SUN6I_ISP_FE_INT_STA_ROT_FINISH
#define SUN6I_ISP_FE_INT_STA_LINE_NUM_START

/* Only since sun9i-a80-isp. */
#define SUN6I_ISP_FE_INT_LINE_NUM_REG
#define SUN6I_ISP_FE_ROT_OF_CFG_REG

/* Buffers/tables */

#define SUN6I_ISP_REG_LOAD_ADDR_REG
#define SUN6I_ISP_REG_SAVE_ADDR_REG

#define SUN6I_ISP_LUT_TABLE_ADDR_REG
#define SUN6I_ISP_DRC_TABLE_ADDR_REG
#define SUN6I_ISP_STATS_ADDR_REG

/* SRAM */

#define SUN6I_ISP_SRAM_RW_OFFSET_REG
#define SUN6I_ISP_SRAM_RW_DATA_REG

/* Global */

#define SUN6I_ISP_MODULE_EN_REG
#define SUN6I_ISP_MODULE_EN_AE
#define SUN6I_ISP_MODULE_EN_OBC
#define SUN6I_ISP_MODULE_EN_DPC_LUT
#define SUN6I_ISP_MODULE_EN_DPC_OTF
#define SUN6I_ISP_MODULE_EN_BDNF
#define SUN6I_ISP_MODULE_EN_AWB
#define SUN6I_ISP_MODULE_EN_WB
#define SUN6I_ISP_MODULE_EN_LSC
#define SUN6I_ISP_MODULE_EN_BGC
#define SUN6I_ISP_MODULE_EN_SAP
#define SUN6I_ISP_MODULE_EN_AF
#define SUN6I_ISP_MODULE_EN_RGB2RGB
#define SUN6I_ISP_MODULE_EN_RGB_DRC
#define SUN6I_ISP_MODULE_EN_TDNF
#define SUN6I_ISP_MODULE_EN_AFS
#define SUN6I_ISP_MODULE_EN_HIST
#define SUN6I_ISP_MODULE_EN_YUV_GAIN_OFFSET
#define SUN6I_ISP_MODULE_EN_YUV_DRC
#define SUN6I_ISP_MODULE_EN_TG
#define SUN6I_ISP_MODULE_EN_ROT
#define SUN6I_ISP_MODULE_EN_CONTRAST
#define SUN6I_ISP_MODULE_EN_SATU
#define SUN6I_ISP_MODULE_EN_SRC1
#define SUN6I_ISP_MODULE_EN_SRC0

#define SUN6I_ISP_MODE_REG
#define SUN6I_ISP_MODE_INPUT_FMT(v)
#define SUN6I_ISP_MODE_INPUT_YUV_SEQ(v)
#define SUN6I_ISP_MODE_OTF_DPC(v)
#define SUN6I_ISP_MODE_SHARP(v)
#define SUN6I_ISP_MODE_HIST(v)

#define SUN6I_ISP_INPUT_FMT_YUV420
#define SUN6I_ISP_INPUT_FMT_YUV422
#define SUN6I_ISP_INPUT_FMT_RAW_BGGR
#define SUN6I_ISP_INPUT_FMT_RAW_RGGB
#define SUN6I_ISP_INPUT_FMT_RAW_GBRG
#define SUN6I_ISP_INPUT_FMT_RAW_GRBG

#define SUN6I_ISP_INPUT_YUV_SEQ_YUYV
#define SUN6I_ISP_INPUT_YUV_SEQ_YVYU
#define SUN6I_ISP_INPUT_YUV_SEQ_UYVY
#define SUN6I_ISP_INPUT_YUV_SEQ_VYUY

#define SUN6I_ISP_IN_CFG_REG
#define SUN6I_ISP_IN_CFG_STRIDE_DIV16(v)

#define SUN6I_ISP_IN_LUMA_RGB_ADDR0_REG
#define SUN6I_ISP_IN_CHROMA_ADDR0_REG
#define SUN6I_ISP_IN_LUMA_RGB_ADDR1_REG
#define SUN6I_ISP_IN_CHROMA_ADDR1_REG

/* AE */

#define SUN6I_ISP_AE_CFG_REG
#define SUN6I_ISP_AE_CFG_LOW_BRI_TH(v)
#define SUN6I_ISP_AE_CFG_HORZ_NUM(v)
#define SUN6I_ISP_AE_CFG_HIGH_BRI_TH(v)
#define SUN6I_ISP_AE_CFG_VERT_NUM(v)

#define SUN6I_ISP_AE_SIZE_REG
#define SUN6I_ISP_AE_SIZE_WIDTH(v)
#define SUN6I_ISP_AE_SIZE_HEIGHT(v)

#define SUN6I_ISP_AE_POS_REG
#define SUN6I_ISP_AE_POS_HORZ_START(v)
#define SUN6I_ISP_AE_POS_VERT_START(v)

/* OB */

#define SUN6I_ISP_OB_SIZE_REG
#define SUN6I_ISP_OB_SIZE_WIDTH(v)
#define SUN6I_ISP_OB_SIZE_HEIGHT(v)

#define SUN6I_ISP_OB_VALID_REG
#define SUN6I_ISP_OB_VALID_WIDTH(v)
#define SUN6I_ISP_OB_VALID_HEIGHT(v)

#define SUN6I_ISP_OB_SRC0_VALID_START_REG
#define SUN6I_ISP_OB_SRC0_VALID_START_HORZ(v)
#define SUN6I_ISP_OB_SRC0_VALID_START_VERT(v)

#define SUN6I_ISP_OB_SRC1_VALID_START_REG
#define SUN6I_ISP_OB_SRC1_VALID_START_HORZ(v)
#define SUN6I_ISP_OB_SRC1_VALID_START_VERT(v)

#define SUN6I_ISP_OB_SPRITE_REG
#define SUN6I_ISP_OB_SPRITE_WIDTH(v)
#define SUN6I_ISP_OB_SPRITE_HEIGHT(v)

#define SUN6I_ISP_OB_SPRITE_START_REG
#define SUN6I_ISP_OB_SPRITE_START_HORZ(v)
#define SUN6I_ISP_OB_SPRITE_START_VERT(v)

#define SUN6I_ISP_OB_CFG_REG
#define SUN6I_ISP_OB_HORZ_POS_REG
#define SUN6I_ISP_OB_VERT_PARA_REG
#define SUN6I_ISP_OB_OFFSET_FIXED_REG

/* BDNF */

#define SUN6I_ISP_BDNF_CFG_REG
#define SUN6I_ISP_BDNF_CFG_IN_DIS_MIN(v)
#define SUN6I_ISP_BDNF_CFG_IN_DIS_MAX(v)

#define SUN6I_ISP_BDNF_COEF_RB_REG
#define SUN6I_ISP_BDNF_COEF_RB(i, v)

#define SUN6I_ISP_BDNF_COEF_G_REG
#define SUN6I_ISP_BDNF_COEF_G(i, v)

/* Bayer */

#define SUN6I_ISP_BAYER_OFFSET0_REG
#define SUN6I_ISP_BAYER_OFFSET0_R(v)
#define SUN6I_ISP_BAYER_OFFSET0_GR(v)

#define SUN6I_ISP_BAYER_OFFSET1_REG
#define SUN6I_ISP_BAYER_OFFSET1_GB(v)
#define SUN6I_ISP_BAYER_OFFSET1_B(v)

#define SUN6I_ISP_BAYER_GAIN0_REG
#define SUN6I_ISP_BAYER_GAIN0_R(v)
#define SUN6I_ISP_BAYER_GAIN0_GR(v)

#define SUN6I_ISP_BAYER_GAIN1_REG
#define SUN6I_ISP_BAYER_GAIN1_GB(v)
#define SUN6I_ISP_BAYER_GAIN1_B(v)

/* WB */

#define SUN6I_ISP_WB_GAIN0_REG
#define SUN6I_ISP_WB_GAIN0_R(v)
#define SUN6I_ISP_WB_GAIN0_GR(v)

#define SUN6I_ISP_WB_GAIN1_REG
#define SUN6I_ISP_WB_GAIN1_GB(v)
#define SUN6I_ISP_WB_GAIN1_B(v)

#define SUN6I_ISP_WB_CFG_REG
#define SUN6I_ISP_WB_CFG_CLIP(v)

/* Global */

#define SUN6I_ISP_MCH_SIZE_CFG_REG
#define SUN6I_ISP_MCH_SIZE_CFG_WIDTH(v)
#define SUN6I_ISP_MCH_SIZE_CFG_HEIGHT(v)

#define SUN6I_ISP_MCH_SCALE_CFG_REG
#define SUN6I_ISP_MCH_SCALE_CFG_X_RATIO(v)
#define SUN6I_ISP_MCH_SCALE_CFG_Y_RATIO(v)
#define SUN6I_ISP_MCH_SCALE_CFG_WEIGHT_SHIFT(v)

#define SUN6I_ISP_SCH_SIZE_CFG_REG
#define SUN6I_ISP_SCH_SIZE_CFG_WIDTH(v)
#define SUN6I_ISP_SCH_SIZE_CFG_HEIGHT(v)

#define SUN6I_ISP_SCH_SCALE_CFG_REG
#define SUN6I_ISP_SCH_SCALE_CFG_X_RATIO(v)
#define SUN6I_ISP_SCH_SCALE_CFG_Y_RATIO(v)
#define SUN6I_ISP_SCH_SCALE_CFG_WEIGHT_SHIFT(v)

#define SUN6I_ISP_MCH_CFG_REG
#define SUN6I_ISP_MCH_CFG_EN
#define SUN6I_ISP_MCH_CFG_SCALE_EN
#define SUN6I_ISP_MCH_CFG_OUTPUT_FMT(v)
#define SUN6I_ISP_MCH_CFG_MIRROR_EN
#define SUN6I_ISP_MCH_CFG_FLIP_EN
#define SUN6I_ISP_MCH_CFG_STRIDE_Y_DIV4(v)
#define SUN6I_ISP_MCH_CFG_STRIDE_UV_DIV4(v)

#define SUN6I_ISP_OUTPUT_FMT_YUV420SP
#define SUN6I_ISP_OUTPUT_FMT_YUV422SP
#define SUN6I_ISP_OUTPUT_FMT_YVU420SP
#define SUN6I_ISP_OUTPUT_FMT_YVU422SP
#define SUN6I_ISP_OUTPUT_FMT_YUV420P
#define SUN6I_ISP_OUTPUT_FMT_YUV422P
#define SUN6I_ISP_OUTPUT_FMT_YVU420P
#define SUN6I_ISP_OUTPUT_FMT_YVU422P

#define SUN6I_ISP_SCH_CFG_REG

#define SUN6I_ISP_MCH_Y_ADDR0_REG
#define SUN6I_ISP_MCH_U_ADDR0_REG
#define SUN6I_ISP_MCH_V_ADDR0_REG
#define SUN6I_ISP_MCH_Y_ADDR1_REG
#define SUN6I_ISP_MCH_U_ADDR1_REG
#define SUN6I_ISP_MCH_V_ADDR1_REG
#define SUN6I_ISP_SCH_Y_ADDR0_REG
#define SUN6I_ISP_SCH_U_ADDR0_REG
#define SUN6I_ISP_SCH_V_ADDR0_REG
#define SUN6I_ISP_SCH_Y_ADDR1_REG
#define SUN6I_ISP_SCH_U_ADDR1_REG
#define SUN6I_ISP_SCH_V_ADDR1_REG

#endif