Path: blob/master/drivers/media/video/davinci/isif_regs.h
17686 views
/*1* Copyright (C) 2008-2009 Texas Instruments Inc2*3* This program is free software; you can redistribute it and/or modify4* it under the terms of the GNU General Public License as published by5* the Free Software Foundation; either version 2 of the License, or6* (at your option) any later version.7*8* This program is distributed in the hope that it will be useful,9* but WITHOUT ANY WARRANTY; without even the implied warranty of10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11* GNU General Public License for more details.12*13* You should have received a copy of the GNU General Public License14* along with this program; if not, write to the Free Software15* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA16*/17#ifndef _ISIF_REGS_H18#define _ISIF_REGS_H1920/* ISIF registers relative offsets */21#define SYNCEN 0x0022#define MODESET 0x0423#define HDW 0x0824#define VDW 0x0c25#define PPLN 0x1026#define LPFR 0x1427#define SPH 0x1828#define LNH 0x1c29#define SLV0 0x2030#define SLV1 0x2431#define LNV 0x2832#define CULH 0x2c33#define CULV 0x3034#define HSIZE 0x3435#define SDOFST 0x3836#define CADU 0x3c37#define CADL 0x4038#define LINCFG0 0x4439#define LINCFG1 0x4840#define CCOLP 0x4c41#define CRGAIN 0x5042#define CGRGAIN 0x5443#define CGBGAIN 0x5844#define CBGAIN 0x5c45#define COFSTA 0x6046#define FLSHCFG0 0x6447#define FLSHCFG1 0x6848#define FLSHCFG2 0x6c49#define VDINT0 0x7050#define VDINT1 0x7451#define VDINT2 0x7852#define MISC 0x7c53#define CGAMMAWD 0x8054#define REC656IF 0x8455#define CCDCFG 0x8856/*****************************************************57* Defect Correction registers58*****************************************************/59#define DFCCTL 0x8c60#define VDFSATLV 0x9061#define DFCMEMCTL 0x9462#define DFCMEM0 0x9863#define DFCMEM1 0x9c64#define DFCMEM2 0xa065#define DFCMEM3 0xa466#define DFCMEM4 0xa867/****************************************************68* Black Clamp registers69****************************************************/70#define CLAMPCFG 0xac71#define CLDCOFST 0xb072#define CLSV 0xb473#define CLHWIN0 0xb874#define CLHWIN1 0xbc75#define CLHWIN2 0xc076#define CLVRV 0xc477#define CLVWIN0 0xc878#define CLVWIN1 0xcc79#define CLVWIN2 0xd080#define CLVWIN3 0xd481/****************************************************82* Lense Shading Correction83****************************************************/84#define DATAHOFST 0xd885#define DATAVOFST 0xdc86#define LSCHVAL 0xe087#define LSCVVAL 0xe488#define TWODLSCCFG 0xe889#define TWODLSCOFST 0xec90#define TWODLSCINI 0xf091#define TWODLSCGRBU 0xf492#define TWODLSCGRBL 0xf893#define TWODLSCGROF 0xfc94#define TWODLSCORBU 0x10095#define TWODLSCORBL 0x10496#define TWODLSCOROF 0x10897#define TWODLSCIRQEN 0x10c98#define TWODLSCIRQST 0x11099/****************************************************100* Data formatter101****************************************************/102#define FMTCFG 0x114103#define FMTPLEN 0x118104#define FMTSPH 0x11c105#define FMTLNH 0x120106#define FMTSLV 0x124107#define FMTLNV 0x128108#define FMTRLEN 0x12c109#define FMTHCNT 0x130110#define FMTAPTR_BASE 0x134111/* Below macro for addresses FMTAPTR0 - FMTAPTR15 */112#define FMTAPTR(i) (FMTAPTR_BASE + (i * 4))113#define FMTPGMVF0 0x174114#define FMTPGMVF1 0x178115#define FMTPGMAPU0 0x17c116#define FMTPGMAPU1 0x180117#define FMTPGMAPS0 0x184118#define FMTPGMAPS1 0x188119#define FMTPGMAPS2 0x18c120#define FMTPGMAPS3 0x190121#define FMTPGMAPS4 0x194122#define FMTPGMAPS5 0x198123#define FMTPGMAPS6 0x19c124#define FMTPGMAPS7 0x1a0125/************************************************126* Color Space Converter127************************************************/128#define CSCCTL 0x1a4129#define CSCM0 0x1a8130#define CSCM1 0x1ac131#define CSCM2 0x1b0132#define CSCM3 0x1b4133#define CSCM4 0x1b8134#define CSCM5 0x1bc135#define CSCM6 0x1c0136#define CSCM7 0x1c4137#define OBWIN0 0x1c8138#define OBWIN1 0x1cc139#define OBWIN2 0x1d0140#define OBWIN3 0x1d4141#define OBVAL0 0x1d8142#define OBVAL1 0x1dc143#define OBVAL2 0x1e0144#define OBVAL3 0x1e4145#define OBVAL4 0x1e8146#define OBVAL5 0x1ec147#define OBVAL6 0x1f0148#define OBVAL7 0x1f4149#define CLKCTL 0x1f8150151/* Masks & Shifts below */152#define START_PX_HOR_MASK 0x7FFF153#define NUM_PX_HOR_MASK 0x7FFF154#define START_VER_ONE_MASK 0x7FFF155#define START_VER_TWO_MASK 0x7FFF156#define NUM_LINES_VER 0x7FFF157158/* gain - offset masks */159#define GAIN_INTEGER_SHIFT 9160#define OFFSET_MASK 0xFFF161#define GAIN_SDRAM_EN_SHIFT 12162#define GAIN_IPIPE_EN_SHIFT 13163#define GAIN_H3A_EN_SHIFT 14164#define OFST_SDRAM_EN_SHIFT 8165#define OFST_IPIPE_EN_SHIFT 9166#define OFST_H3A_EN_SHIFT 10167#define GAIN_OFFSET_EN_MASK 0x7700168169/* Culling */170#define CULL_PAT_EVEN_LINE_SHIFT 8171172/* CCDCFG register */173#define ISIF_YCINSWP_RAW (0x00 << 4)174#define ISIF_YCINSWP_YCBCR (0x01 << 4)175#define ISIF_CCDCFG_FIDMD_LATCH_VSYNC (0x00 << 6)176#define ISIF_CCDCFG_WENLOG_AND (0x00 << 8)177#define ISIF_CCDCFG_TRGSEL_WEN (0x00 << 9)178#define ISIF_CCDCFG_EXTRG_DISABLE (0x00 << 10)179#define ISIF_LATCH_ON_VSYNC_DISABLE (0x01 << 15)180#define ISIF_LATCH_ON_VSYNC_ENABLE (0x00 << 15)181#define ISIF_DATA_PACK_MASK 3182#define ISIF_DATA_PACK16 0183#define ISIF_DATA_PACK12 1184#define ISIF_DATA_PACK8 2185#define ISIF_PIX_ORDER_SHIFT 11186#define ISIF_BW656_ENABLE (0x01 << 5)187188/* MODESET registers */189#define ISIF_VDHDOUT_INPUT (0x00 << 0)190#define ISIF_INPUT_SHIFT 12191#define ISIF_RAW_INPUT_MODE 0192#define ISIF_FID_POL_SHIFT 4193#define ISIF_HD_POL_SHIFT 3194#define ISIF_VD_POL_SHIFT 2195#define ISIF_DATAPOL_NORMAL 0196#define ISIF_DATAPOL_SHIFT 6197#define ISIF_EXWEN_DISABLE 0198#define ISIF_EXWEN_SHIFT 5199#define ISIF_FRM_FMT_SHIFT 7200#define ISIF_DATASFT_SHIFT 8201#define ISIF_LPF_SHIFT 14202#define ISIF_LPF_MASK 1203204/* GAMMAWD registers */205#define ISIF_ALAW_GAMA_WD_MASK 0xF206#define ISIF_ALAW_GAMA_WD_SHIFT 1207#define ISIF_ALAW_ENABLE 1208#define ISIF_GAMMAWD_CFA_SHIFT 5209210/* HSIZE registers */211#define ISIF_HSIZE_FLIP_MASK 1212#define ISIF_HSIZE_FLIP_SHIFT 12213214/* MISC registers */215#define ISIF_DPCM_EN_SHIFT 12216#define ISIF_DPCM_PREDICTOR_SHIFT 13217218/* Black clamp related */219#define ISIF_BC_MODE_COLOR_SHIFT 4220#define ISIF_HORZ_BC_MODE_SHIFT 1221#define ISIF_HORZ_BC_WIN_SEL_SHIFT 5222#define ISIF_HORZ_BC_PIX_LIMIT_SHIFT 6223#define ISIF_HORZ_BC_WIN_H_SIZE_SHIFT 8224#define ISIF_HORZ_BC_WIN_V_SIZE_SHIFT 12225#define ISIF_VERT_BC_RST_VAL_SEL_SHIFT 4226#define ISIF_VERT_BC_LINE_AVE_COEF_SHIFT 8227228/* VDFC registers */229#define ISIF_VDFC_EN_SHIFT 4230#define ISIF_VDFC_CORR_MOD_SHIFT 5231#define ISIF_VDFC_CORR_WHOLE_LN_SHIFT 7232#define ISIF_VDFC_LEVEL_SHFT_SHIFT 8233#define ISIF_VDFC_POS_MASK 0x1FFF234#define ISIF_DFCMEMCTL_DFCMARST_SHIFT 2235236/* CSC registers */237#define ISIF_CSC_COEF_INTEG_MASK 7238#define ISIF_CSC_COEF_DECIMAL_MASK 0x1f239#define ISIF_CSC_COEF_INTEG_SHIFT 5240#define ISIF_CSCM_MSB_SHIFT 8241#define ISIF_DF_CSC_SPH_MASK 0x1FFF242#define ISIF_DF_CSC_LNH_MASK 0x1FFF243#define ISIF_DF_CSC_SLV_MASK 0x1FFF244#define ISIF_DF_CSC_LNV_MASK 0x1FFF245#define ISIF_DF_NUMLINES 0x7FFF246#define ISIF_DF_NUMPIX 0x1FFF247248/* Offsets for LSC/DFC/Gain */249#define ISIF_DATA_H_OFFSET_MASK 0x1FFF250#define ISIF_DATA_V_OFFSET_MASK 0x1FFF251252/* Linearization */253#define ISIF_LIN_CORRSFT_SHIFT 4254#define ISIF_LIN_SCALE_FACT_INTEG_SHIFT 10255256257/* Pattern registers */258#define ISIF_PG_EN (1 << 3)259#define ISIF_SEL_PG_SRC (3 << 4)260#define ISIF_PG_VD_POL_SHIFT 0261#define ISIF_PG_HD_POL_SHIFT 1262263/*random other junk*/264#define ISIF_SYNCEN_VDHDEN_MASK (1 << 0)265#define ISIF_SYNCEN_WEN_MASK (1 << 1)266#define ISIF_SYNCEN_WEN_SHIFT 1267268#endif269270271