linux/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_reg.h

/* SPDX-License-Identifier: GPL-2.0+ */
/*
 * Copyright (c) 2011-2018 Magewell Electronics Co., Ltd. (Nanjing)
 * Author: Yong Deng <[email protected]>
 * Copyright 2021-2022 Bootlin
 * Author: Paul Kocialkowski <[email protected]>
 */

#ifndef _SUN6I_CSI_REG_H_
#define _SUN6I_CSI_REG_H_

#include <linux/kernel.h>

#define SUN6I_CSI_ADDR_VALUE(a)

#define SUN6I_CSI_EN_REG
#define SUN6I_CSI_EN_VER_EN
#define SUN6I_CSI_EN_PTN_CYCLE(v)
#define SUN6I_CSI_EN_SRAM_PWDN
#define SUN6I_CSI_EN_PTN_START
#define SUN6I_CSI_EN_CLK_CNT_SPL_VSYNC
#define SUN6I_CSI_EN_CLK_CNT_EN
#define SUN6I_CSI_EN_PTN_GEN_EN
#define SUN6I_CSI_EN_CSI_EN

/* Note that Allwinner manuals and code invert positive/negative definitions. */

#define SUN6I_CSI_IF_CFG_REG
#define SUN6I_CSI_IF_CFG_FIELD_DT_PCLK_SHIFT(v)
#define SUN6I_CSI_IF_CFG_SRC_TYPE_PROGRESSIVE
#define SUN6I_CSI_IF_CFG_SRC_TYPE_INTERLACED
#define SUN6I_CSI_IF_CFG_FPS_DS
#define SUN6I_CSI_IF_CFG_FIELD_POSITIVE
#define SUN6I_CSI_IF_CFG_FIELD_NEGATIVE
#define SUN6I_CSI_IF_CFG_VREF_POL_POSITIVE
#define SUN6I_CSI_IF_CFG_VREF_POL_NEGATIVE
#define SUN6I_CSI_IF_CFG_HREF_POL_POSITIVE
#define SUN6I_CSI_IF_CFG_HREF_POL_NEGATIVE
#define SUN6I_CSI_IF_CFG_CLK_POL_FALLING
#define SUN6I_CSI_IF_CFG_CLK_POL_RISING
#define SUN6I_CSI_IF_CFG_FIELD_DT_FIELD_VSYNC
#define SUN6I_CSI_IF_CFG_FIELD_DT_FIELD
#define SUN6I_CSI_IF_CFG_FIELD_DT_VSYNC
#define SUN6I_CSI_IF_CFG_DATA_WIDTH_8
#define SUN6I_CSI_IF_CFG_DATA_WIDTH_10
#define SUN6I_CSI_IF_CFG_DATA_WIDTH_12
#define SUN6I_CSI_IF_CFG_DATA_WIDTH_8_PLUS_2
#define SUN6I_CSI_IF_CFG_DATA_WIDTH_2_TIMES_8
#define SUN6I_CSI_IF_CFG_IF_CSI
#define SUN6I_CSI_IF_CFG_IF_MIPI
#define SUN6I_CSI_IF_CFG_IF_CSI_YUV_RAW
#define SUN6I_CSI_IF_CFG_IF_CSI_YUV_COMBINED
#define SUN6I_CSI_IF_CFG_IF_CSI_BT656
#define SUN6I_CSI_IF_CFG_IF_CSI_BT1120

#define SUN6I_CSI_CAP_REG
#define SUN6I_CSI_CAP_MASK(v)
#define SUN6I_CSI_CAP_VCAP_ON
#define SUN6I_CSI_CAP_SCAP_ON

#define SUN6I_CSI_SYNC_CNT_REG
#define SUN6I_CSI_FIFO_THRS_REG
#define SUN6I_CSI_BT656_HEAD_CFG_REG

#define SUN6I_CSI_PTN_LEN_REG
#define SUN6I_CSI_PTN_ADDR_REG
#define SUN6I_CSI_VER_REG

#define SUN6I_CSI_CH_CFG_REG
#define SUN6I_CSI_CH_CFG_PAD_VAL(v)
#define SUN6I_CSI_CH_CFG_INPUT_FMT(v)
#define SUN6I_CSI_CH_CFG_OUTPUT_FMT(v)
#define SUN6I_CSI_CH_CFG_VFLIP_EN
#define SUN6I_CSI_CH_CFG_HFLIP_EN
#define SUN6I_CSI_CH_CFG_FIELD_SEL_FIELD0
#define SUN6I_CSI_CH_CFG_FIELD_SEL_FIELD1
#define SUN6I_CSI_CH_CFG_FIELD_SEL_EITHER
#define SUN6I_CSI_CH_CFG_INPUT_YUV_SEQ(v)

#define SUN6I_CSI_INPUT_FMT_RAW
#define SUN6I_CSI_INPUT_FMT_YUV422
#define SUN6I_CSI_INPUT_FMT_YUV420

/* Note that Allwinner manuals and code invert frame/field definitions. */

/* RAW */
#define SUN6I_CSI_OUTPUT_FMT_FRAME_RAW_8
#define SUN6I_CSI_OUTPUT_FMT_FRAME_RAW_10
#define SUN6I_CSI_OUTPUT_FMT_FRAME_RAW_12
#define SUN6I_CSI_OUTPUT_FMT_FRAME_RGB565
#define SUN6I_CSI_OUTPUT_FMT_FRAME_RGB888
#define SUN6I_CSI_OUTPUT_FMT_FRAME_PRGB888
#define SUN6I_CSI_OUTPUT_FMT_FIELD_RAW_8
#define SUN6I_CSI_OUTPUT_FMT_FIELD_RAW_10
#define SUN6I_CSI_OUTPUT_FMT_FIELD_RAW_12
#define SUN6I_CSI_OUTPUT_FMT_FIELD_RGB565
#define SUN6I_CSI_OUTPUT_FMT_FIELD_RGB888
#define SUN6I_CSI_OUTPUT_FMT_FIELD_PRGB888

/* YUV */
#define SUN6I_CSI_OUTPUT_FMT_FRAME_YUV422P
#define SUN6I_CSI_OUTPUT_FMT_FRAME_YUV420P
#define SUN6I_CSI_OUTPUT_FMT_FIELD_YUV420P
#define SUN6I_CSI_OUTPUT_FMT_FIELD_YUV422P
#define SUN6I_CSI_OUTPUT_FMT_FRAME_YUV422SP
#define SUN6I_CSI_OUTPUT_FMT_FRAME_YUV420SP
#define SUN6I_CSI_OUTPUT_FMT_FIELD_YUV420SP
#define SUN6I_CSI_OUTPUT_FMT_FIELD_YUV422SP
#define SUN6I_CSI_OUTPUT_FMT_FRAME_YUV422MB
#define SUN6I_CSI_OUTPUT_FMT_FRAME_YUV420MB
#define SUN6I_CSI_OUTPUT_FMT_FIELD_YUV420MB
#define SUN6I_CSI_OUTPUT_FMT_FIELD_YUV422MB
#define SUN6I_CSI_OUTPUT_FMT_FRAME_YUV422SP_10
#define SUN6I_CSI_OUTPUT_FMT_FRAME_YUV420SP_10

/* YUV Planar */
#define SUN6I_CSI_INPUT_YUV_SEQ_YUYV
#define SUN6I_CSI_INPUT_YUV_SEQ_YVYU
#define SUN6I_CSI_INPUT_YUV_SEQ_UYVY
#define SUN6I_CSI_INPUT_YUV_SEQ_VYUY

/* YUV Semi-planar */
#define SUN6I_CSI_INPUT_YUV_SEQ_UV
#define SUN6I_CSI_INPUT_YUV_SEQ_VU

#define SUN6I_CSI_CH_SCALE_REG
#define SUN6I_CSI_CH_SCALE_QUART_EN

#define SUN6I_CSI_CH_FIFO0_ADDR_REG
#define SUN6I_CSI_CH_FIFO1_ADDR_REG
#define SUN6I_CSI_CH_FIFO2_ADDR_REG

#define SUN6I_CSI_CH_STA_REG
#define SUN6I_CSI_CH_STA_FIELD
#define SUN6I_CSI_CH_STA_VCAP
#define SUN6I_CSI_CH_STA_SCAP

#define SUN6I_CSI_CH_INT_EN_REG
#define SUN6I_CSI_CH_INT_EN_VS
#define SUN6I_CSI_CH_INT_EN_HB_OF
#define SUN6I_CSI_CH_INT_EN_MUL_ERR
#define SUN6I_CSI_CH_INT_EN_FIFO2_OF
#define SUN6I_CSI_CH_INT_EN_FIFO1_OF
#define SUN6I_CSI_CH_INT_EN_FIFO0_OF
#define SUN6I_CSI_CH_INT_EN_FD
#define SUN6I_CSI_CH_INT_EN_CD

#define SUN6I_CSI_CH_INT_STA_REG
#define SUN6I_CSI_CH_INT_STA_CLEAR
#define SUN6I_CSI_CH_INT_STA_VS
#define SUN6I_CSI_CH_INT_STA_HB_OF
#define SUN6I_CSI_CH_INT_STA_MUL_ERR
#define SUN6I_CSI_CH_INT_STA_FIFO2_OF
#define SUN6I_CSI_CH_INT_STA_FIFO1_OF
#define SUN6I_CSI_CH_INT_STA_FIFO0_OF
#define SUN6I_CSI_CH_INT_STA_FD
#define SUN6I_CSI_CH_INT_STA_CD

#define SUN6I_CSI_CH_FLD1_VSIZE_REG
#define SUN6I_CSI_CH_FLD1_VSIZE_VER_LEN(v)
#define SUN6I_CSI_CH_FLD1_VSIZE_VER_START(v)

#define SUN6I_CSI_CH_HSIZE_REG
#define SUN6I_CSI_CH_HSIZE_LEN(v)
#define SUN6I_CSI_CH_HSIZE_START(v)

#define SUN6I_CSI_CH_VSIZE_REG
#define SUN6I_CSI_CH_VSIZE_LEN(v)
#define SUN6I_CSI_CH_VSIZE_START(v)

#define SUN6I_CSI_CH_BUF_LEN_REG
#define SUN6I_CSI_CH_BUF_LEN_CHROMA_LINE(v)
#define SUN6I_CSI_CH_BUF_LEN_LUMA_LINE(v)

#define SUN6I_CSI_CH_FLIP_SIZE_REG
#define SUN6I_CSI_CH_FLIP_SIZE_VER_LEN(v)
#define SUN6I_CSI_CH_FLIP_SIZE_VALID_LEN(v)

#define SUN6I_CSI_CH_FRM_CLK_CNT_REG
#define SUN6I_CSI_CH_ACC_ITNL_CLK_CNT_REG
#define SUN6I_CSI_CH_FIFO_STAT_REG
#define SUN6I_CSI_CH_PCLK_STAT_REG

#endif