linux/drivers/media/platform/atmel/atmel-isi.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Register definitions for the Atmel Image Sensor Interface.
 *
 * Copyright (C) 2011 Atmel Corporation
 * Josh Wu, <[email protected]>
 *
 * Based on previous work by Lars Haring, <[email protected]>
 * and Sedji Gaouaou
 */
#ifndef __ATMEL_ISI_H__
#define __ATMEL_ISI_H__

#include <linux/types.h>

/* ISI_V2 register offsets */
#define ISI_CFG1
#define ISI_CFG2
#define ISI_PSIZE
#define ISI_PDECF
#define ISI_Y2R_SET0
#define ISI_Y2R_SET1
#define ISI_R2Y_SET0
#define ISI_R2Y_SET1
#define ISI_R2Y_SET2
#define ISI_CTRL
#define ISI_STATUS
#define ISI_INTEN
#define ISI_INTDIS
#define ISI_INTMASK
#define ISI_DMA_CHER
#define ISI_DMA_CHDR
#define ISI_DMA_CHSR
#define ISI_DMA_P_ADDR
#define ISI_DMA_P_CTRL
#define ISI_DMA_P_DSCR
#define ISI_DMA_C_ADDR
#define ISI_DMA_C_CTRL
#define ISI_DMA_C_DSCR

/* Bitfields in CFG1 */
#define ISI_CFG1_HSYNC_POL_ACTIVE_LOW
#define ISI_CFG1_VSYNC_POL_ACTIVE_LOW
#define ISI_CFG1_PIXCLK_POL_ACTIVE_FALLING
#define ISI_CFG1_EMB_SYNC
#define ISI_CFG1_CRC_SYNC
/* Constants for FRATE(ISI_V2) */
#define ISI_CFG1_FRATE_CAPTURE_ALL
#define ISI_CFG1_FRATE_DIV_2
#define ISI_CFG1_FRATE_DIV_3
#define ISI_CFG1_FRATE_DIV_4
#define ISI_CFG1_FRATE_DIV_5
#define ISI_CFG1_FRATE_DIV_6
#define ISI_CFG1_FRATE_DIV_7
#define ISI_CFG1_FRATE_DIV_8
#define ISI_CFG1_FRATE_DIV_MASK
#define ISI_CFG1_DISCR
#define ISI_CFG1_FULL_MODE
/* Definition for THMASK(ISI_V2) */
#define ISI_CFG1_THMASK_BEATS_4
#define ISI_CFG1_THMASK_BEATS_8
#define ISI_CFG1_THMASK_BEATS_16

/* Bitfields in CFG2 */
#define ISI_CFG2_GS_MODE_2_PIXEL
#define ISI_CFG2_GS_MODE_1_PIXEL
#define ISI_CFG2_GRAYSCALE
#define ISI_CFG2_COL_SPACE_YCbCr
#define ISI_CFG2_COL_SPACE_RGB
/* Constants for YCC_SWAP(ISI_V2) */
#define ISI_CFG2_YCC_SWAP_DEFAULT
#define ISI_CFG2_YCC_SWAP_MODE_1
#define ISI_CFG2_YCC_SWAP_MODE_2
#define ISI_CFG2_YCC_SWAP_MODE_3
#define ISI_CFG2_YCC_SWAP_MODE_MASK
#define ISI_CFG2_IM_VSIZE_OFFSET
#define ISI_CFG2_IM_HSIZE_OFFSET
#define ISI_CFG2_IM_VSIZE_MASK
#define ISI_CFG2_IM_HSIZE_MASK

/* Bitfields in PSIZE */
#define ISI_PSIZE_PREV_VSIZE_OFFSET
#define ISI_PSIZE_PREV_HSIZE_OFFSET
#define ISI_PSIZE_PREV_VSIZE_MASK
#define ISI_PSIZE_PREV_HSIZE_MASK

/* Bitfields in PDECF */
#define ISI_PDECF_DEC_FACTOR_MASK
#define ISI_PDECF_NO_SAMPLING

/* Bitfields in CTRL */
/* Also using in SR(ISI_V2) */
#define ISI_CTRL_EN
#define ISI_CTRL_CDC
/* Also using in SR/IER/IDR/IMR(ISI_V2) */
#define ISI_CTRL_DIS
#define ISI_CTRL_SRST

/* Bitfields in SR */
#define ISI_SR_SIP
/* Also using in SR/IER/IDR/IMR */
#define ISI_SR_VSYNC
#define ISI_SR_PXFR_DONE
#define ISI_SR_CXFR_DONE
#define ISI_SR_P_OVR
#define ISI_SR_C_OVR
#define ISI_SR_CRC_ERR
#define ISI_SR_FR_OVR

/* Bitfields in DMA_C_CTRL & in DMA_P_CTRL */
#define ISI_DMA_CTRL_FETCH
#define ISI_DMA_CTRL_WB
#define ISI_DMA_CTRL_IEN
#define ISI_DMA_CTRL_DONE

/* Bitfields in DMA_CHSR/CHER/CHDR */
#define ISI_DMA_CHSR_P_CH
#define ISI_DMA_CHSR_C_CH

/* Definition for isi_platform_data */
#define ISI_DATAWIDTH_8
#define ISI_DATAWIDTH_10

struct isi_platform_data {};

#endif /* __ATMEL_ISI_H__ */