Path: blob/master/drivers/media/video/m5mols/m5mols_reg.h
17819 views
/*1* Register map for M-5MOLS 8M Pixel camera sensor with ISP2*3* Copyright (C) 2011 Samsung Electronics Co., Ltd.4* Author: HeungJun Kim <[email protected]>5*6* Copyright (C) 2009 Samsung Electronics Co., Ltd.7* Author: Dongsoo Nathaniel Kim <[email protected]>8*9* This program is free software; you can redistribute it and/or modify10* it under the terms of the GNU General Public License as published by11* the Free Software Foundation; either version 2 of the License, or12* (at your option) any later version.13*/1415#ifndef M5MOLS_REG_H16#define M5MOLS_REG_H1718#define M5MOLS_I2C_MAX_SIZE 419#define M5MOLS_BYTE_READ 0x0120#define M5MOLS_BYTE_WRITE 0x022122#define I2C_CATEGORY(__cat) ((__cat >> 16) & 0xff)23#define I2C_COMMAND(__comm) ((__comm >> 8) & 0xff)24#define I2C_SIZE(__reg_s) ((__reg_s) & 0xff)25#define I2C_REG(__cat, __cmd, __reg_s) ((__cat << 16) | (__cmd << 8) | __reg_s)2627/*28* Category section register29*30* The category means set including relevant command of M-5MOLS.31*/32#define CAT_SYSTEM 0x0033#define CAT_PARAM 0x0134#define CAT_MONITOR 0x0235#define CAT_AE 0x0336#define CAT_WB 0x0637#define CAT_EXIF 0x0738#define CAT_FD 0x0939#define CAT_LENS 0x0a40#define CAT_CAPT_PARM 0x0b41#define CAT_CAPT_CTRL 0x0c42#define CAT_FLASH 0x0f /* related to FW, revisions, booting */4344/*45* Category 0 - SYSTEM mode46*47* The SYSTEM mode in the M-5MOLS means area available to handle with the whole48* & all-round system of sensor. It deals with version/interrupt/setting mode &49* even sensor's status. Especially, the M-5MOLS sensor with ISP varies by50* packaging & manufacturer, even the customer and project code. And the51* function details may vary among them. The version information helps to52* determine what methods shall be used in the driver.53*54* There is many registers between customer version address and awb one. For55* more specific contents, see definition if file m5mols.h.56*/57#define CAT0_VER_CUSTOMER 0x00 /* customer version */58#define CAT0_VER_PROJECT 0x01 /* project version */59#define CAT0_VER_FIRMWARE 0x02 /* Firmware version */60#define CAT0_VER_HARDWARE 0x04 /* Hardware version */61#define CAT0_VER_PARAMETER 0x06 /* Parameter version */62#define CAT0_VER_AWB 0x08 /* Auto WB version */63#define CAT0_VER_STRING 0x0a /* string including M-5MOLS */64#define CAT0_SYSMODE 0x0b /* SYSTEM mode register */65#define CAT0_STATUS 0x0c /* SYSTEM mode status register */66#define CAT0_INT_FACTOR 0x10 /* interrupt pending register */67#define CAT0_INT_ENABLE 0x11 /* interrupt enable register */6869#define SYSTEM_VER_CUSTOMER I2C_REG(CAT_SYSTEM, CAT0_VER_CUSTOMER, 1)70#define SYSTEM_VER_PROJECT I2C_REG(CAT_SYSTEM, CAT0_VER_PROJECT, 1)71#define SYSTEM_VER_FIRMWARE I2C_REG(CAT_SYSTEM, CAT0_VER_FIRMWARE, 2)72#define SYSTEM_VER_HARDWARE I2C_REG(CAT_SYSTEM, CAT0_VER_HARDWARE, 2)73#define SYSTEM_VER_PARAMETER I2C_REG(CAT_SYSTEM, CAT0_VER_PARAMETER, 2)74#define SYSTEM_VER_AWB I2C_REG(CAT_SYSTEM, CAT0_VER_AWB, 2)7576#define SYSTEM_SYSMODE I2C_REG(CAT_SYSTEM, CAT0_SYSMODE, 1)77#define REG_SYSINIT 0x00 /* SYSTEM mode */78#define REG_PARAMETER 0x01 /* PARAMETER mode */79#define REG_MONITOR 0x02 /* MONITOR mode */80#define REG_CAPTURE 0x03 /* CAPTURE mode */8182#define SYSTEM_CMD(__cmd) I2C_REG(CAT_SYSTEM, cmd, 1)83#define SYSTEM_VER_STRING I2C_REG(CAT_SYSTEM, CAT0_VER_STRING, 1)84#define REG_SAMSUNG_ELECTRO "SE" /* Samsung Electro-Mechanics */85#define REG_SAMSUNG_OPTICS "OP" /* Samsung Fiber-Optics */86#define REG_SAMSUNG_TECHWIN "TB" /* Samsung Techwin */8788#define SYSTEM_INT_FACTOR I2C_REG(CAT_SYSTEM, CAT0_INT_FACTOR, 1)89#define SYSTEM_INT_ENABLE I2C_REG(CAT_SYSTEM, CAT0_INT_ENABLE, 1)90#define REG_INT_MODE (1 << 0)91#define REG_INT_AF (1 << 1)92#define REG_INT_ZOOM (1 << 2)93#define REG_INT_CAPTURE (1 << 3)94#define REG_INT_FRAMESYNC (1 << 4)95#define REG_INT_FD (1 << 5)96#define REG_INT_LENS_INIT (1 << 6)97#define REG_INT_SOUND (1 << 7)98#define REG_INT_MASK 0x0f99100/*101* category 1 - PARAMETER mode102*103* This category supports function of camera features of M-5MOLS. It means we104* can handle with preview(MONITOR) resolution size/frame per second/interface105* between the sensor and the Application Processor/even the image effect.106*/107#define CAT1_DATA_INTERFACE 0x00 /* interface between sensor and AP */108#define CAT1_MONITOR_SIZE 0x01 /* resolution at the MONITOR mode */109#define CAT1_MONITOR_FPS 0x02 /* frame per second at this mode */110#define CAT1_EFFECT 0x0b /* image effects */111112#define PARM_MON_SIZE I2C_REG(CAT_PARAM, CAT1_MONITOR_SIZE, 1)113114#define PARM_MON_FPS I2C_REG(CAT_PARAM, CAT1_MONITOR_FPS, 1)115#define REG_FPS_30 0x02116117#define PARM_INTERFACE I2C_REG(CAT_PARAM, CAT1_DATA_INTERFACE, 1)118#define REG_INTERFACE_MIPI 0x02119120#define PARM_EFFECT I2C_REG(CAT_PARAM, CAT1_EFFECT, 1)121#define REG_EFFECT_OFF 0x00122#define REG_EFFECT_NEGA 0x01123#define REG_EFFECT_EMBOSS 0x06124#define REG_EFFECT_OUTLINE 0x07125#define REG_EFFECT_WATERCOLOR 0x08126127/*128* Category 2 - MONITOR mode129*130* The MONITOR mode is same as preview mode as we said. The M-5MOLS has another131* mode named "Preview", but this preview mode is used at the case specific132* vider-recording mode. This mmode supports only YUYV format. On the other133* hand, the JPEG & RAW formats is supports by CAPTURE mode. And, there are134* another options like zoom/color effect(different with effect in PARAMETER135* mode)/anti hand shaking algorithm.136*/137#define CAT2_ZOOM 0x01 /* set the zoom position & execute */138#define CAT2_ZOOM_STEP 0x03 /* set the zoom step */139#define CAT2_CFIXB 0x09 /* CB value for color effect */140#define CAT2_CFIXR 0x0a /* CR value for color effect */141#define CAT2_COLOR_EFFECT 0x0b /* set on/off of color effect */142#define CAT2_CHROMA_LVL 0x0f /* set chroma level */143#define CAT2_CHROMA_EN 0x10 /* set on/off of choroma */144#define CAT2_EDGE_LVL 0x11 /* set sharpness level */145#define CAT2_EDGE_EN 0x12 /* set on/off sharpness */146#define CAT2_TONE_CTL 0x25 /* set tone color(contrast) */147148#define MON_ZOOM I2C_REG(CAT_MONITOR, CAT2_ZOOM, 1)149150#define MON_CFIXR I2C_REG(CAT_MONITOR, CAT2_CFIXR, 1)151#define MON_CFIXB I2C_REG(CAT_MONITOR, CAT2_CFIXB, 1)152#define REG_CFIXB_SEPIA 0xd8153#define REG_CFIXR_SEPIA 0x18154155#define MON_EFFECT I2C_REG(CAT_MONITOR, CAT2_COLOR_EFFECT, 1)156#define REG_COLOR_EFFECT_OFF 0x00157#define REG_COLOR_EFFECT_ON 0x01158159#define MON_CHROMA_EN I2C_REG(CAT_MONITOR, CAT2_CHROMA_EN, 1)160#define MON_CHROMA_LVL I2C_REG(CAT_MONITOR, CAT2_CHROMA_LVL, 1)161#define REG_CHROMA_OFF 0x00162#define REG_CHROMA_ON 0x01163164#define MON_EDGE_EN I2C_REG(CAT_MONITOR, CAT2_EDGE_EN, 1)165#define MON_EDGE_LVL I2C_REG(CAT_MONITOR, CAT2_EDGE_LVL, 1)166#define REG_EDGE_OFF 0x00167#define REG_EDGE_ON 0x01168169#define MON_TONE_CTL I2C_REG(CAT_MONITOR, CAT2_TONE_CTL, 1)170171/*172* Category 3 - Auto Exposure173*174* The M-5MOLS exposure capbility is detailed as which is similar to digital175* camera. This category supports AE locking/various AE mode(range of exposure)176* /ISO/flickering/EV bias/shutter/meteoring, and anything else. And the177* maximum/minimum exposure gain value depending on M-5MOLS firmware, may be178* different. So, this category also provide getting the max/min values. And,179* each MONITOR and CAPTURE mode has each gain/shutter/max exposure values.180*/181#define CAT3_AE_LOCK 0x00 /* locking Auto exposure */182#define CAT3_AE_MODE 0x01 /* set AE mode, mode means range */183#define CAT3_ISO 0x05 /* set ISO */184#define CAT3_EV_PRESET_MONITOR 0x0a /* EV(scenemode) preset for MONITOR */185#define CAT3_EV_PRESET_CAPTURE 0x0b /* EV(scenemode) preset for CAPTURE */186#define CAT3_MANUAL_GAIN_MON 0x12 /* meteoring value for the MONITOR */187#define CAT3_MAX_GAIN_MON 0x1a /* max gain value for the MONITOR */188#define CAT3_MANUAL_GAIN_CAP 0x26 /* meteoring value for the CAPTURE */189#define CAT3_AE_INDEX 0x38 /* AE index */190191#define AE_LOCK I2C_REG(CAT_AE, CAT3_AE_LOCK, 1)192#define REG_AE_UNLOCK 0x00193#define REG_AE_LOCK 0x01194195#define AE_MODE I2C_REG(CAT_AE, CAT3_AE_MODE, 1)196#define REG_AE_OFF 0x00 /* AE off */197#define REG_AE_ALL 0x01 /* calc AE in all block integral */198#define REG_AE_CENTER 0x03 /* calc AE in center weighted */199#define REG_AE_SPOT 0x06 /* calc AE in specific spot */200201#define AE_ISO I2C_REG(CAT_AE, CAT3_ISO, 1)202#define REG_ISO_AUTO 0x00203#define REG_ISO_50 0x01204#define REG_ISO_100 0x02205#define REG_ISO_200 0x03206#define REG_ISO_400 0x04207#define REG_ISO_800 0x05208209#define AE_EV_PRESET_MONITOR I2C_REG(CAT_AE, CAT3_EV_PRESET_MONITOR, 1)210#define AE_EV_PRESET_CAPTURE I2C_REG(CAT_AE, CAT3_EV_PRESET_CAPTURE, 1)211#define REG_SCENE_NORMAL 0x00212#define REG_SCENE_PORTRAIT 0x01213#define REG_SCENE_LANDSCAPE 0x02214#define REG_SCENE_SPORTS 0x03215#define REG_SCENE_PARTY_INDOOR 0x04216#define REG_SCENE_BEACH_SNOW 0x05217#define REG_SCENE_SUNSET 0x06218#define REG_SCENE_DAWN_DUSK 0x07219#define REG_SCENE_FALL 0x08220#define REG_SCENE_NIGHT 0x09221#define REG_SCENE_AGAINST_LIGHT 0x0a222#define REG_SCENE_FIRE 0x0b223#define REG_SCENE_TEXT 0x0c224#define REG_SCENE_CANDLE 0x0d225226#define AE_MAN_GAIN_MON I2C_REG(CAT_AE, CAT3_MANUAL_GAIN_MON, 2)227#define AE_MAX_GAIN_MON I2C_REG(CAT_AE, CAT3_MAX_GAIN_MON, 2)228#define AE_MAN_GAIN_CAP I2C_REG(CAT_AE, CAT3_MANUAL_GAIN_CAP, 2)229230#define AE_INDEX I2C_REG(CAT_AE, CAT3_AE_INDEX, 1)231#define REG_AE_INDEX_20_NEG 0x00232#define REG_AE_INDEX_15_NEG 0x01233#define REG_AE_INDEX_10_NEG 0x02234#define REG_AE_INDEX_05_NEG 0x03235#define REG_AE_INDEX_00 0x04236#define REG_AE_INDEX_05_POS 0x05237#define REG_AE_INDEX_10_POS 0x06238#define REG_AE_INDEX_15_POS 0x07239#define REG_AE_INDEX_20_POS 0x08240241/*242* Category 6 - White Balance243*244* This category provide AWB locking/mode/preset/speed/gain bias, etc.245*/246#define CAT6_AWB_LOCK 0x00 /* locking Auto Whitebalance */247#define CAT6_AWB_MODE 0x02 /* set Auto or Manual */248#define CAT6_AWB_MANUAL 0x03 /* set Manual(preset) value */249250#define AWB_LOCK I2C_REG(CAT_WB, CAT6_AWB_LOCK, 1)251#define REG_AWB_UNLOCK 0x00252#define REG_AWB_LOCK 0x01253254#define AWB_MODE I2C_REG(CAT_WB, CAT6_AWB_MODE, 1)255#define REG_AWB_AUTO 0x01 /* AWB off */256#define REG_AWB_PRESET 0x02 /* AWB preset */257258#define AWB_MANUAL I2C_REG(CAT_WB, CAT6_AWB_MANUAL, 1)259#define REG_AWB_INCANDESCENT 0x01260#define REG_AWB_FLUORESCENT_1 0x02261#define REG_AWB_FLUORESCENT_2 0x03262#define REG_AWB_DAYLIGHT 0x04263#define REG_AWB_CLOUDY 0x05264#define REG_AWB_SHADE 0x06265#define REG_AWB_HORIZON 0x07266#define REG_AWB_LEDLIGHT 0x09267268/*269* Category 7 - EXIF information270*/271#define CAT7_INFO_EXPTIME_NU 0x00272#define CAT7_INFO_EXPTIME_DE 0x04273#define CAT7_INFO_TV_NU 0x08274#define CAT7_INFO_TV_DE 0x0c275#define CAT7_INFO_AV_NU 0x10276#define CAT7_INFO_AV_DE 0x14277#define CAT7_INFO_BV_NU 0x18278#define CAT7_INFO_BV_DE 0x1c279#define CAT7_INFO_EBV_NU 0x20280#define CAT7_INFO_EBV_DE 0x24281#define CAT7_INFO_ISO 0x28282#define CAT7_INFO_FLASH 0x2a283#define CAT7_INFO_SDR 0x2c284#define CAT7_INFO_QVAL 0x2e285286#define EXIF_INFO_EXPTIME_NU I2C_REG(CAT_EXIF, CAT7_INFO_EXPTIME_NU, 4)287#define EXIF_INFO_EXPTIME_DE I2C_REG(CAT_EXIF, CAT7_INFO_EXPTIME_DE, 4)288#define EXIF_INFO_TV_NU I2C_REG(CAT_EXIF, CAT7_INFO_TV_NU, 4)289#define EXIF_INFO_TV_DE I2C_REG(CAT_EXIF, CAT7_INFO_TV_DE, 4)290#define EXIF_INFO_AV_NU I2C_REG(CAT_EXIF, CAT7_INFO_AV_NU, 4)291#define EXIF_INFO_AV_DE I2C_REG(CAT_EXIF, CAT7_INFO_AV_DE, 4)292#define EXIF_INFO_BV_NU I2C_REG(CAT_EXIF, CAT7_INFO_BV_NU, 4)293#define EXIF_INFO_BV_DE I2C_REG(CAT_EXIF, CAT7_INFO_BV_DE, 4)294#define EXIF_INFO_EBV_NU I2C_REG(CAT_EXIF, CAT7_INFO_EBV_NU, 4)295#define EXIF_INFO_EBV_DE I2C_REG(CAT_EXIF, CAT7_INFO_EBV_DE, 4)296#define EXIF_INFO_ISO I2C_REG(CAT_EXIF, CAT7_INFO_ISO, 2)297#define EXIF_INFO_FLASH I2C_REG(CAT_EXIF, CAT7_INFO_FLASH, 2)298#define EXIF_INFO_SDR I2C_REG(CAT_EXIF, CAT7_INFO_SDR, 2)299#define EXIF_INFO_QVAL I2C_REG(CAT_EXIF, CAT7_INFO_QVAL, 2)300301/*302* Category 9 - Face Detection303*/304#define CAT9_FD_CTL 0x00305306#define FD_CTL I2C_REG(CAT_FD, CAT9_FD_CTL, 1)307#define BIT_FD_EN 0308#define BIT_FD_DRAW_FACE_FRAME 4309#define BIT_FD_DRAW_SMILE_LVL 6310#define REG_FD(shift) (1 << shift)311#define REG_FD_OFF 0x0312313/*314* Category A - Lens Parameter315*/316#define CATA_AF_MODE 0x01317#define CATA_AF_EXECUTE 0x02318#define CATA_AF_STATUS 0x03319#define CATA_AF_VERSION 0x0a320321#define AF_MODE I2C_REG(CAT_LENS, CATA_AF_MODE, 1)322#define REG_AF_NORMAL 0x00 /* Normal AF, one time */323#define REG_AF_MACRO 0x01 /* Macro AF, one time */324#define REG_AF_POWEROFF 0x07325326#define AF_EXECUTE I2C_REG(CAT_LENS, CATA_AF_EXECUTE, 1)327#define REG_AF_STOP 0x00328#define REG_AF_EXE_AUTO 0x01329#define REG_AF_EXE_CAF 0x02330331#define AF_STATUS I2C_REG(CAT_LENS, CATA_AF_STATUS, 1)332#define REG_AF_FAIL 0x00333#define REG_AF_SUCCESS 0x02334#define REG_AF_IDLE 0x04335#define REG_AF_BUSY 0x05336337#define AF_VERSION I2C_REG(CAT_LENS, CATA_AF_VERSION, 1)338339/*340* Category B - CAPTURE Parameter341*/342#define CATB_YUVOUT_MAIN 0x00343#define CATB_MAIN_IMAGE_SIZE 0x01344#define CATB_MCC_MODE 0x1d345#define CATB_WDR_EN 0x2c346#define CATB_LIGHT_CTRL 0x40347#define CATB_FLASH_CTRL 0x41348349#define CAPP_YUVOUT_MAIN I2C_REG(CAT_CAPT_PARM, CATB_YUVOUT_MAIN, 1)350#define REG_YUV422 0x00351#define REG_BAYER10 0x05352#define REG_BAYER8 0x06353#define REG_JPEG 0x10354355#define CAPP_MAIN_IMAGE_SIZE I2C_REG(CAT_CAPT_PARM, CATB_MAIN_IMAGE_SIZE, 1)356357#define CAPP_MCC_MODE I2C_REG(CAT_CAPT_PARM, CATB_MCC_MODE, 1)358#define REG_MCC_OFF 0x00359#define REG_MCC_NORMAL 0x01360361#define CAPP_WDR_EN I2C_REG(CAT_CAPT_PARM, CATB_WDR_EN, 1)362#define REG_WDR_OFF 0x00363#define REG_WDR_ON 0x01364#define REG_WDR_AUTO 0x02365366#define CAPP_LIGHT_CTRL I2C_REG(CAT_CAPT_PARM, CATB_LIGHT_CTRL, 1)367#define REG_LIGHT_OFF 0x00368#define REG_LIGHT_ON 0x01369#define REG_LIGHT_AUTO 0x02370371#define CAPP_FLASH_CTRL I2C_REG(CAT_CAPT_PARM, CATB_FLASH_CTRL, 1)372#define REG_FLASH_OFF 0x00373#define REG_FLASH_ON 0x01374#define REG_FLASH_AUTO 0x02375376/*377* Category C - CAPTURE Control378*/379#define CATC_CAP_MODE 0x00380#define CATC_CAP_SEL_FRAME 0x06 /* It determines Single or Multi */381#define CATC_CAP_START 0x09382#define CATC_CAP_IMAGE_SIZE 0x0d383#define CATC_CAP_THUMB_SIZE 0x11384385#define CAPC_MODE I2C_REG(CAT_CAPT_CTRL, CATC_CAP_MODE, 1)386#define REG_CAP_NONE 0x00387#define REG_CAP_ANTI_SHAKE 0x02388389#define CAPC_SEL_FRAME I2C_REG(CAT_CAPT_CTRL, CATC_CAP_SEL_FRAME, 1)390391#define CAPC_START I2C_REG(CAT_CAPT_CTRL, CATC_CAP_START, 1)392#define REG_CAP_START_MAIN 0x01393#define REG_CAP_START_THUMB 0x03394395#define CAPC_IMAGE_SIZE I2C_REG(CAT_CAPT_CTRL, CATC_CAP_IMAGE_SIZE, 4)396#define CAPC_THUMB_SIZE I2C_REG(CAT_CAPT_CTRL, CATC_CAP_THUMB_SIZE, 4)397398/*399* Category F - Flash400*401* This mode provides functions about internal flash stuff and system startup.402*/403#define CATF_CAM_START 0x12 /* It starts internal ARM core booting404* after power-up */405406#define FLASH_CAM_START I2C_REG(CAT_FLASH, CATF_CAM_START, 1)407#define REG_START_ARM_BOOT 0x01408409#endif /* M5MOLS_REG_H */410411412