From 6d345e3fc7749413f03c6bce8f68f0e9258572eb Mon Sep 17 00:00:00 2001 From: zyc Date: Fri, 30 Jan 2015 09:42:23 +0800 Subject: [PATCH] camera: oneframe v0.1.e --- drivers/media/video/generic_sensor.h | 2 - drivers/media/video/hm5065.c | 2876 +++++++++++--------- drivers/media/video/rk30_camera_oneframe.c | 4 +- 3 files changed, 1599 insertions(+), 1283 deletions(-) diff --git a/drivers/media/video/generic_sensor.h b/drivers/media/video/generic_sensor.h index a6f26a9f47f2..4575ba69e55a 100755 --- a/drivers/media/video/generic_sensor.h +++ b/drivers/media/video/generic_sensor.h @@ -628,7 +628,6 @@ static inline int sensor_focus_default_cb(struct soc_camera_device *icd, struct } case V4L2_CID_FOCUS_AUTO: { - /****************yzm************** mutex_lock(&sensor->sensor_focus.focus_lock); //get focuszone sensor->sensor_focus.focus_zone.lx = ext_ctrl->rect[0]; @@ -652,7 +651,6 @@ static inline int sensor_focus_default_cb(struct soc_camera_device *icd, struct ret = -EINVAL; printk(KERN_ERR"\n %s valure = %d is invalidate.. \n",__FUNCTION__,value); } - *///*******************yzm*************end break; } diff --git a/drivers/media/video/hm5065.c b/drivers/media/video/hm5065.c index 15283befc376..9ad7adce5e3e 100755 --- a/drivers/media/video/hm5065.c +++ b/drivers/media/video/hm5065.c @@ -1,57 +1,65 @@ - #include "generic_sensor.h" - + #include "generic_sensor.h" + /* -* Driver Version Note -*v0.0.1: this driver is compatible with generic_sensor -*v0.1.1: -* add sensor_focus_af_const_pause_usr_cb; -*/ -static int version = KERNEL_VERSION(0,1,1); -module_param(version, int, S_IRUGO); - - -static int debug=1; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -/* Sensor Driver Configuration Begin */ -#define SENSOR_NAME RK29_CAM_SENSOR_HM5065 -#define SENSOR_V4L2_IDENT V4L2_IDENT_HM5065 -#define SENSOR_ID 0x039E -#define SENSOR_BUS_PARAM (V4L2_MBUS_MASTER |\ - V4L2_MBUS_PCLK_SAMPLE_RISING|V4L2_MBUS_HSYNC_ACTIVE_HIGH| V4L2_MBUS_VSYNC_ACTIVE_LOW|\ - V4L2_MBUS_DATA_ACTIVE_HIGH |SOCAM_MCLK_24MHZ) -#define SENSOR_PREVIEW_W 800 -#define SENSOR_PREVIEW_H 600 -#define SENSOR_PREVIEW_FPS 15000 // 15fps -#define SENSOR_FULLRES_L_FPS 7500 // 7.5fps -#define SENSOR_FULLRES_H_FPS 7500 // 7.5fps -#define SENSOR_720P_FPS 30000 -#define SENSOR_1080P_FPS 15000 - -#define SENSOR_REGISTER_LEN 2 // sensor register address bytes -#define SENSOR_VALUE_LEN 1 // sensor register value bytes - -static unsigned int SensorConfiguration = (CFG_WhiteBalance|CFG_Effect - |CFG_Scene|CFG_Focus|CFG_FocusContinues - |CFG_FocusZone); - -static unsigned int SensorChipID[] = {SENSOR_ID}; -/* Sensor Driver Configuration End */ - - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SensorRegVal(a,b) CONS4(SensorReg,SENSOR_REGISTER_LEN,Val,SENSOR_VALUE_LEN)(a,b) -#define sensor_write(client,reg,v) CONS4(sensor_write_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_read(client,reg,v) CONS4(sensor_read_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_write_array generic_sensor_write_array - - +* Driver Version Note +*v0.0.1: this driver is compatible with generic_sensor +*v0.1.1: +* add sensor_focus_af_const_pause_usr_cb; +*/ +static int version = KERNEL_VERSION(0,1,1); +module_param(version, int, S_IRUGO); + + +static int debug=1; +module_param(debug, int, S_IRUGO|S_IWUSR); + +#define dprintk(level, fmt, arg...) do { \ + if (debug >= level) \ + printk(KERN_WARNING fmt , ## arg); } while (0) + +/* Sensor Driver Configuration Begin */ +#define SENSOR_NAME RK29_CAM_SENSOR_HM5065 +#define SENSOR_V4L2_IDENT V4L2_IDENT_HM5065 +#define SENSOR_ID 0x039E +#define SENSOR_BUS_PARAM (V4L2_MBUS_MASTER |\ + V4L2_MBUS_PCLK_SAMPLE_RISING|V4L2_MBUS_HSYNC_ACTIVE_HIGH| V4L2_MBUS_VSYNC_ACTIVE_LOW|\ + V4L2_MBUS_DATA_ACTIVE_HIGH |SOCAM_MCLK_24MHZ) +#define SENSOR_PREVIEW_W 1280 //800 +#define SENSOR_PREVIEW_H 960//600 +#define SENSOR_PREVIEW_FPS 15000 // 15fps +#define SENSOR_FULLRES_L_FPS 7500 // 7.5fps +#define SENSOR_FULLRES_H_FPS 7500 // 7.5fps +#define SENSOR_720P_FPS 30000 +#define SENSOR_1080P_FPS 15000 + +#define SENSOR_REGISTER_LEN 2 // sensor register address bytes +#define SENSOR_VALUE_LEN 1 // sensor register value bytes + +#define SENSOR_AF_CONFIG 1 + +#ifdef SENSOR_AF_CONFIG +static unsigned int SensorConfiguration = (CFG_WhiteBalance|CFG_Effect + |CFG_Scene|CFG_Focus|CFG_FocusContinues + |CFG_FocusZone); + +#else +static unsigned int SensorConfiguration = (CFG_WhiteBalance|CFG_Effect + |CFG_Scene); +#endif + +static unsigned int SensorChipID[] = {SENSOR_ID}; +/* Sensor Driver Configuration End */ + + +#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) +#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) + +#define SensorRegVal(a,b) CONS4(SensorReg,SENSOR_REGISTER_LEN,Val,SENSOR_VALUE_LEN)(a,b) +#define sensor_write(client,reg,v) CONS4(sensor_write_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) +#define sensor_read(client,reg,v) CONS4(sensor_read_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) +#define sensor_write_array generic_sensor_write_array + + /* hm5065 VCM Command and Status Registers */ #define AF_TARGETPOS_REG_H 0x0700 #define AF_TARGETPOS_REG_L 0x0701 @@ -80,43 +88,43 @@ static unsigned int SensorChipID[] = {SENSOR_ID}; #define AF_ZONE3_WEIGHT 0x080B #define AF_ZONE4_WEIGHT 0x080C #define AF_ZONE5_WEIGHT 0x080D -#define AF_ZONE6_WEIGHT 0x080E - - -struct sensor_parameter -{ - int af_pos[2]; -}; - -struct specific_sensor{ - struct generic_sensor common_sensor; - //define user data below - struct sensor_parameter parameter; - -}; - -/* -* The follow setting need been filled. -* -* Must Filled: -* sensor_init_data : Sensor initial setting; -* sensor_fullres_lowfps_data : Sensor full resolution setting with best auality, recommand for video; -* sensor_preview_data : Sensor preview resolution setting, recommand it is vga or svga; -* sensor_softreset_data : Sensor software reset register; -* sensor_check_id_data : Sensir chip id register; -* -* Optional filled: -* sensor_fullres_highfps_data: Sensor full resolution setting with high framerate, recommand for video; -* sensor_720p: Sensor 720p setting, it is for video; -* sensor_1080p: Sensor 1080p setting, it is for video; -* -* :::::WARNING::::: -* The SensorEnd which is the setting end flag must be filled int the last of each setting; -*/ - -/* Sensor initial setting */ -static struct rk_sensor_reg sensor_init_data[] = { - +#define AF_ZONE6_WEIGHT 0x080E + + +struct sensor_parameter +{ + int af_pos[2]; +}; + +struct specific_sensor{ + struct generic_sensor common_sensor; + //define user data below + struct sensor_parameter parameter; + +}; + +/* +* The follow setting need been filled. +* +* Must Filled: +* sensor_init_data : Sensor initial setting; +* sensor_fullres_lowfps_data : Sensor full resolution setting with best auality, recommand for video; +* sensor_preview_data : Sensor preview resolution setting, recommand it is vga or svga; +* sensor_softreset_data : Sensor software reset register; +* sensor_check_id_data : Sensir chip id register; +* +* Optional filled: +* sensor_fullres_highfps_data: Sensor full resolution setting with high framerate, recommand for video; +* sensor_720p: Sensor 720p setting, it is for video; +* sensor_1080p: Sensor 1080p setting, it is for video; +* +* :::::WARNING::::: +* The SensorEnd which is the setting end flag must be filled int the last of each setting; +*/ + +/* Sensor initial setting */ +static struct rk_sensor_reg sensor_init_data[] = { + {0xffff,0x01}, // 2013-03-01 Start new patch {0x9000,0x03}, {0xA000,0x90}, @@ -1631,1228 +1639,1536 @@ static struct rk_sensor_reg sensor_init_data[] = { {0x90D9,0x47}, {0x90DA,0x02}, {0x9000,0x01}, - {0xffff,0x00}, // 2013-03-01 end - SensorWaitMs(200), - {0x0009,0x16}, //10 - {0x0085,0x00}, - {0x0040,0x00}, - {0x0016,0x00}, - {0x0046,0x00}, - {0x0041,0x00}, - {0x00B5,0x02}, - {0x7101,0x44}, - {0x00ED,0x0A}, - {0x00EE,0x1E}, - {0x00B3,0x80}, - {0x7104,0x00}, - {0x7105,0x80}, - {0x019C,0x4B}, - {0x019D,0x20}, - {0x0129,0x00}, - {0x0130,0x00}, - {0x0083,0x01}, - {0x0084,0x01}, - {0x01A1,0x80}, - {0x01A2,0x80}, - {0x01A3,0x80}, - {0x01A0,0x01}, - {0x0021,0x00}, - {0x0022,0x01}, - - {0x0040,0x00}, //00 - {0x0060,0x00}, - {0x0013,0x00}, - {0x0041,0x00},//00:5M 03:SVGA - - {0x0061,0x00}, - {0x0046,0x02}, - {0x0066,0x02}, - {0x0012,0x00}, - {0x7102,0x09}, - {0x7103,0x00}, - {0x7158,0x00}, - {0x00E8,0x01}, - {0x7000,0x2C}, - {0x5200,0x01}, - {0x7000,0x0C}, - {0x0143,0x5F}, - {0x0144,0x0D}, - {0x02C2,0x00}, - {0x02C3,0xC0}, - {0x015E,0x40}, - {0x015F,0x00}, - {0x0390,0x01}, - {0x0391,0x00}, - {0x0392,0x00}, - {0x03A0,0x14}, - {0x03A1,0x00}, - {0x03A2,0x5A}, - {0x03A3,0xEE}, - {0x03A4,0x69}, - {0x03A5,0x49}, - {0x03A6,0x3E}, - {0x03A7,0x00}, - {0x03A8,0x39}, - {0x03A9,0x33}, - {0x03B0,0x60}, - {0x03B1,0x00}, - {0x03B2,0x5A}, - {0x03B3,0xEE}, - {0x03B4,0x69}, - {0x03B5,0x49}, - {0x03B6,0x3E}, - {0x03B7,0x00}, - {0x03B8,0x3D}, - {0x03B9,0x20}, - {0x03C0,0x10}, - {0x03C1,0x00}, - {0x03C2,0x5A}, - {0x03C3,0xEE}, - {0x03C4,0x69}, - {0x03C5,0x49}, - {0x03C6,0x3A}, - {0x03C7,0x80}, - {0x03D0,0x64}, - {0x03D1,0x00}, - {0x03D2,0x5A}, - {0x03D3,0xEE}, - {0x03D4,0x69}, - {0x03D5,0x49}, - {0x03D6,0x34}, - {0x03D7,0xD1}, - {0x004C,0x08}, - {0x006C,0x08}, - {0x0350,0x00}, - {0x0351,0x5A}, - {0x0352,0xEE}, - {0x0353,0x69}, - {0x0354,0x49}, - {0x0355,0x39}, - {0x0356,0x6D}, - {0x0357,0x19}, - {0x0358,0x00}, - {0x0359,0x3C}, - {0x035A,0x5A}, - {0x035B,0xEE}, - {0x035C,0x69}, - {0x035D,0x49}, - {0x035E,0x39}, - {0x035F,0x85}, - {0x0049,0x14}, - {0x004A,0x0D}, - {0x0069,0x14}, - {0x006A,0x0D}, - {0x0090,0x00}, - {0x0091,0x5A}, - {0x0092,0xEE}, - {0x0093,0x3E}, - {0x0094,0x00}, - {0x0095,0x69}, - {0x0096,0x49}, - {0x0097,0x39}, - {0x0098,0xCF}, - {0x00A0,0x00}, - {0x00A1,0x5A}, - {0x00A2,0xEE}, - {0x00A3,0x3E}, - {0x00A4,0x00}, - {0x00A5,0x69}, - {0x00A6,0x49}, - {0x00A7,0x3B}, - {0x00A8,0x80}, - {0x0420,0x00}, //new LSC start - 0306 - {0x0421,0x26}, - {0x0422,0xff}, - {0x0423,0x03}, - {0x0424,0x00}, - {0x0425,0x63}, - {0x0426,0x00}, - {0x0427,0x8e}, - {0x0428,0xff}, - {0x0429,0xf3}, - {0x042A,0x00}, - {0x042B,0x26}, - {0x042C,0xff}, - {0x042D,0xc8}, - {0x042E,0xff}, - {0x042F,0x5f}, - {0x0430,0x00}, - {0x0431,0x10}, - {0x0432,0xfe}, - {0x0433,0xcf}, - {0x0434,0x00}, - {0x0435,0xc2}, - {0x0436,0x00}, - {0x0437,0xf2}, - {0x0438,0xff}, - {0x0439,0xd0}, - {0x043A,0x00}, - {0x043B,0xa1}, - {0x043C,0x00}, - {0x043D,0x2f}, - {0x043E,0xfe}, - {0x043F,0xdc}, - {0x0450,0x00}, - {0x0451,0x36}, - {0x0452,0xff}, - {0x0453,0x60}, - {0x0454,0x00}, - {0x0455,0x43}, - {0x0456,0x00}, - {0x0457,0x6b}, - {0x0458,0xff}, - {0x0459,0xdf}, - {0x045A,0x00}, - {0x045B,0x83}, - {0x045C,0xff}, - {0x045D,0xeb}, - {0x045E,0xff}, - {0x045F,0x5f}, - {0x0440,0x00}, - {0x0441,0x36}, - {0x0442,0xff}, - {0x0443,0x3e}, - {0x0444,0x00}, - {0x0445,0x6d}, - {0x0446,0x00}, - {0x0447,0x87}, - {0x0448,0x00}, - {0x0449,0x0f}, - {0x044A,0xff}, - {0x044B,0xd3}, - {0x044C,0x00}, - {0x044D,0x18}, - {0x044E,0xff}, - {0x044F,0x4f}, - {0x0561,0x08}, - {0x0460,0x00}, - {0x0461,0x22}, - {0x0462,0xff}, - {0x0463,0x0a}, - {0x0464,0x00}, - {0x0465,0x63}, - {0x0466,0x00}, - {0x0467,0x8b}, - {0x0468,0xff}, - {0x0469,0xf9}, - {0x046A,0x00}, - {0x046B,0x17}, - {0x046C,0xff}, - {0x046D,0xbd}, - {0x046E,0xff}, - {0x046F,0x65}, - {0x0470,0x00}, - {0x0471,0x15}, - {0x0472,0xfe}, - {0x0473,0xd7}, - {0x0474,0x00}, - {0x0475,0xb6}, - {0x0476,0x00}, - {0x0477,0xe5}, - {0x0478,0xff}, - {0x0479,0xd0}, - {0x047A,0x00}, - {0x047B,0xb2}, - {0x047C,0x00}, - {0x047D,0x2c}, - {0x047E,0xfe}, - {0x047F,0xe6}, - {0x0490,0x00}, - {0x0491,0x2b}, - {0x0492,0xff}, - {0x0493,0x71}, - {0x0494,0x00}, - {0x0495,0x43}, - {0x0496,0x00}, - {0x0497,0x69}, - {0x0498,0xff}, - {0x0499,0xd7}, - {0x049A,0x00}, - {0x049B,0x59}, - {0x049C,0xff}, - {0x049D,0xde}, - {0x049E,0xff}, - {0x049F,0x76}, - {0x0480,0x00}, - {0x0481,0x38}, - {0x0482,0xff}, - {0x0483,0x3a}, - {0x0484,0x00}, - {0x0485,0x6b}, - {0x0486,0x00}, - {0x0487,0x86}, - {0x0488,0x00}, - {0x0489,0x14}, - {0x048A,0xff}, - {0x048B,0xd7}, - {0x048C,0x00}, - {0x048D,0x13}, - {0x048E,0xff}, - {0x048F,0x58}, - {0x0562,0x08}, - {0x04A0,0x00}, - {0x04A1,0x17}, - {0x04A2,0xff}, - {0x04A3,0x2e}, - {0x04A4,0x00}, - {0x04A5,0x5d}, - {0x04A6,0x00}, - {0x04A7,0x7a}, - {0x04A8,0xff}, - {0x04A9,0xf9}, - {0x04AA,0xff}, - {0x04AB,0xc0}, - {0x04AC,0xff}, - {0x04AD,0xc7}, - {0x04AE,0xff}, - {0x04AF,0x7d}, - {0x04B0,0x00}, - {0x04B1,0x13}, - {0x04B2,0xff}, - {0x04B3,0x45}, - {0x04B4,0x00}, - {0x04B5,0x70}, - {0x04B6,0x00}, - {0x04B7,0x96}, - {0x04B8,0xff}, - {0x04B9,0xde}, - {0x04BA,0x00}, - {0x04BB,0x17}, - {0x04BC,0x00}, - {0x04BD,0x23}, - {0x04BE,0xff}, - {0x04BF,0x46}, - {0x04D0,0x00}, - {0x04D1,0x17}, - {0x04D2,0xff}, - {0x04D3,0x99}, - {0x04D4,0x00}, - {0x04D5,0x3d}, - {0x04D6,0x00}, - {0x04D7,0x5f}, - {0x04D8,0xff}, - {0x04D9,0xd1}, - {0x04DA,0xff}, - {0x04DB,0xe2}, - {0x04DC,0xff}, - {0x04DD,0xc6}, - {0x04DE,0xff}, - {0x04DF,0x9c}, - {0x04C0,0x00}, - {0x04C1,0x32}, - {0x04C2,0xff}, - {0x04C3,0x4e}, - {0x04C4,0x00}, - {0x04C5,0x5e}, - {0x04C6,0x00}, - {0x04C7,0x7c}, - {0x04C8,0x00}, - {0x04C9,0x17}, - {0x04CA,0xff}, - {0x04CB,0x9b}, - {0x04CC,0x00}, - {0x04CD,0x06}, - {0x04CE,0xff}, - {0x04CF,0x70}, - {0x0563,0x05}, - {0x04E0,0x00}, - {0x04E1,0x11}, - {0x04E2,0xff}, - {0x04E3,0x20}, - {0x04E4,0x00}, - {0x04E5,0x5f}, - {0x04E6,0x00}, - {0x04E7,0x7b}, - {0x04E8,0x00}, - {0x04E9,0x02}, - {0x04EA,0xff}, - {0x04EB,0xf1}, - {0x04EC,0xff}, - {0x04ED,0xb7}, - {0x04EE,0xff}, - {0x04EF,0x7b}, - {0x04F0,0x00}, - {0x04F1,0x1c}, - {0x04F2,0xff}, - {0x04F3,0x08}, - {0x04F4,0x00}, - {0x04F5,0x7e}, - {0x04F6,0x00}, - {0x04F7,0xac}, - {0x04F8,0xff}, - {0x04F9,0xeb}, - {0x04FA,0x00}, - {0x04FB,0x93}, - {0x04FC,0x00}, - {0x04FD,0x1b}, - {0x04FE,0xff}, - {0x04FF,0x11}, - {0x0510,0xff}, - {0x0511,0xfe}, - {0x0512,0xff}, - {0x0513,0x8e}, - {0x0514,0x00}, - {0x0515,0x4a}, - {0x0516,0x00}, - {0x0517,0x6e}, - {0x0518,0xff}, - {0x0519,0xbb}, - {0x051A,0xff}, - {0x051B,0xcc}, - {0x051C,0xff}, - {0x051D,0x9a}, - {0x051E,0xff}, - {0x051F,0xa2}, - {0x0500,0x00}, - {0x0501,0x30}, - {0x0502,0xff}, - {0x0503,0x36}, - {0x0504,0x00}, - {0x0505,0x5d}, - {0x0506,0x00}, - {0x0507,0x81}, - {0x0508,0x00}, - {0x0509,0x1f}, - {0x050A,0xff}, - {0x050B,0xd4}, - {0x050C,0xff}, - {0x050D,0xfe}, - {0x050E,0xff}, - {0x050F,0x75}, - {0x0564,0x00}, //new LSC end - {0x0324,0x39}, - {0x0325,0xAE}, - {0x0326,0x3A}, - {0x0327,0x29}, - {0x0328,0x3B}, - {0x0329,0x0A}, - {0x032A,0x3B}, - {0x032B,0x62}, - {0x0320,0x01}, - {0x0321,0x04}, - {0x0322,0x01}, - {0x0323,0x01}, - {0x0330,0x01}, - {0x0384,0x00}, - {0x0337,0x01}, - {0x03EC,0x39}, - {0x03ED,0x85}, - {0x03FC,0x3A}, - {0x03FD,0x14}, - {0x040C,0x3A}, - {0x040D,0xF6}, - {0x041C,0x3B}, - {0x041D,0x9A}, - {0x03E0,0xB6}, - {0x03E1,0x04}, - {0x03E2,0xBB}, - {0x03E3,0xE9}, - {0x03E4,0xBC}, - {0x03E5,0x70}, - {0x03E6,0x37}, - {0x03E7,0x02}, - {0x03E8,0xBC}, - {0x03E9,0x00}, - {0x03EA,0xBF}, - {0x03EB,0x12}, - {0x03F0,0xBA}, - {0x03F1,0x7B}, - {0x03F2,0xBA}, - {0x03F3,0x83}, - {0x03F4,0xBB}, - {0x03F5,0xBC}, - {0x03F6,0x38}, - {0x03F7,0x2D}, - {0x03F8,0xBB}, - {0x03F9,0x23}, - {0x03FA,0xBD}, - {0x03FB,0xAC}, - {0x0400,0xBE}, - {0x0401,0x96}, - {0x0402,0xB9}, - {0x0403,0xBE}, - {0x0404,0xBB}, - {0x0405,0x57}, - {0x0406,0x3A}, - {0x0407,0xBB}, - {0x0408,0xB3}, - {0x0409,0x17}, - {0x040A,0xBE}, - {0x040B,0x66}, - {0x0410,0xBB}, - {0x0411,0x2A}, - {0x0412,0xBA}, - {0x0413,0x00}, - {0x0414,0xBB}, - {0x0415,0x10}, - {0x0416,0xB8}, - {0x0417,0xCD}, - {0x0418,0xB7}, - {0x0419,0x5C}, - {0x041A,0xBB}, - {0x041B,0x6C}, - {0x01f8,0x3c}, - {0x01f9,0x00}, - {0x01fa,0x00}, - {0x02a2,0x3e}, - {0x02a3,0x00}, - {0x02a4,0x3e}, - {0x02a5,0x00}, - {0x02a6,0x3e}, - {0x02a7,0x00}, - {0x02a8,0x3e}, - {0x02a9,0x00}, - {0x056c,0x42}, - {0x056d,0x00}, - {0x056e,0x42}, - {0x056f,0x00}, - {0x0570,0x42}, - {0x0571,0x00}, - {0x0572,0x42}, - {0x0573,0x00}, - {0x0081,0x55}, //6E->55 - {0x0588,0x00}, - {0x0589,0x5A}, - {0x058A,0xEE}, - {0x058B,0x69}, - {0x058C,0x49}, - {0x058D,0x3D}, - {0x058E,0x3D}, - {0x0080,0x6C}, - {0x0082,0x5A}, - {0x0010,0x01}, - - SensorWaitMs(200), - - {0x4708,0x00}, - {0x4709,0x00}, - {0x4710,0x00}, - {0x4711,0x00}, - //AF intial setting - {0x0659,0x01},//03-06 new af @ vcm - {0x065A,0x00}, - {0x06C9,0x01}, - {0x06CD,0x01}, - {0x06CE,0xBD}, - {0x06CF,0x00}, - {0x06D0,0x93}, - {0x06D1,0x02}, - {0x06D2,0x30}, - {0x06D3,0xD4}, - {0x06D4,0x01}, - {0x06DB,0x59}, - {0x06DC,0x0d}, - {0x0730,0x00}, - {0x0731,0x00}, - {0x0732,0x03}, - {0x0733,0xFF}, - {0x0734,0x03}, - {0x0735,0x70}, - {0x0755,0x01}, - {0x0756,0x00}, - {0x075A,0x00}, - {0x075B,0x01}, - {0x075E,0x00}, - {0x0764,0x01}, - {0x0766,0x01}, - {0x0768,0x01}, - {0x076A,0x00}, - {0x0758,0x01}, - {0x075C,0x01}, - {0x0770,0x98}, - {0x0771,0x19}, - {0x0772,0x1B}, - {0x0774,0x01}, - {0x0775,0x4a}, - {0x0777,0x00}, - {0x0778,0x45}, - {0x0779,0x00}, - {0x077A,0x02}, - {0x077D,0x01}, - {0x077E,0x03}, - {0x0783,0x10}, - {0x0785,0x14}, - {0x0788,0x04}, - {0x0846,0x06}, - {0x0847,0x05}, - {0xC41A,0x05}, - {0xC423,0x11}, - {0xC427,0x11}, - {0x300B,0x09}, - - {0x7000,0x08}, - {0x5200,0x09}, - {0x00B2,0x50}, - {0x00B3,0x80}, - {0x00B5,0x01}, - {0x0030,0x14}, - {0x0040,0x01}, //AB2 - {0x0041,0x03}, //SVGA mode - - {0x0010,0x01}, - SensorWaitMs(200), - SensorEnd -}; -/* Senor full resolution setting: recommand for capture */ -static struct rk_sensor_reg sensor_fullres_lowfps_data[] ={ - - {0x7000,0x08}, - {0x5200,0x09}, - {0x0040,0x00}, - {0x0041,0x00}, - {0x0010,0x01}, - SensorEnd -}; -/* Senor full resolution setting: recommand for video */ -static struct rk_sensor_reg sensor_fullres_highfps_data[] ={ - SensorEnd -}; -/* Preview resolution setting*/ -static struct rk_sensor_reg sensor_preview_data[] = -{ - {0x0040,0x01}, - {0x0041,0x03}, - - {0x00ed,0x0A}, - {0x00ee,0x1E}, - - SensorEnd -}; -/* 1280x720 */ -static struct rk_sensor_reg sensor_720p[]={ - SensorEnd -}; - -/* 1920x1080 */ -static struct rk_sensor_reg sensor_1080p[]={ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_softreset_data[]={ - SensorEnd -}; - -static struct rk_sensor_reg sensor_check_id_data[]={ - SensorRegVal(0x0000,0), - SensorRegVal(0x0001,0), - SensorEnd -}; -/* -* The following setting must been filled, if the function is turn on by CONFIG_SENSOR_xxxx -*/ -static struct rk_sensor_reg sensor_WhiteB_Auto[]= -{ - {0x01A0,0x01}, - SensorEnd -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct rk_sensor_reg sensor_WhiteB_Cloudy[]= -{ - {0x01A0,0x04}, - SensorEnd -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct rk_sensor_reg sensor_WhiteB_ClearDay[]= -{ - {0x01A0,0x05}, - SensorEnd -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[]= -{ - {0x01A0,0x07}, - SensorEnd - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[]= -{ - {0x01A0,0x08}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; - -static struct rk_sensor_reg sensor_Brightness0[]= -{ - // Brightness -2 - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness1[]= -{ - // Brightness -1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness2[]= -{ - // Brightness 0 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness3[]= -{ - // Brightness +1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness4[]= -{ - // Brightness +2 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness5[]= -{ - // Brightness +3 - - SensorEnd -}; -static struct rk_sensor_reg *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -static struct rk_sensor_reg sensor_Effect_Normal[] = -{ - {0x0380,0x0}, + {0xffff,0x00}, // 2013-03-01 end + SensorWaitMs(200), + {0x0009,0x16}, //10 + {0x0085,0x00}, + {0x0040,0x00}, + {0x0016,0x00}, + {0x0046,0x00}, + {0x0041,0x00}, + // {0x00B5,0x02}, + {0x7101,0x44}, + {0x00ED,0x0d}, + {0x00EE,0x1E}, + //{0x00B3,0x80}, + {0x7104,0x00}, + {0x7105,0x80}, + {0x019C,0x4B}, + {0x019D,0x20}, + {0x0129,0x02}, + {0x0130,0x00}, + {0x0083,0x00}, + {0x0084,0x00}, + {0x01A1,0x80}, + {0x01A2,0x80}, + {0x01A3,0x80}, + {0x01A0,0x01}, + {0x0021,0x00}, + {0x0022,0x01}, + + {0x0040,0x00}, //00 + {0x0060,0x00}, + {0x0013,0x00}, + {0x0041,0x00},//00:5M 03:SVGA + + {0x0061,0x00}, + {0x0046,0x02}, + {0x0066,0x02}, + {0x0012,0x00}, + {0x7102,0x09}, + {0x7103,0x00}, + {0x7158,0x00}, + {0x00E8,0x01}, + {0x7000,0x2C}, + {0x5200,0x01}, + {0x7000,0x0C}, + {0x0143,0x5F}, + {0x0144,0x0D}, + {0x02C2,0x00}, + {0x02C3,0xc0}, + {0x015E,0x40}, + {0x015F,0x00}, + {0x0390,0x01}, + {0x0391,0x00}, + {0x0392,0x00}, + {0x03A0,0x14}, + {0x03A1,0x00}, + {0x03A2,0x5A}, + {0x03A3,0xEE}, + {0x03A4,0x69}, + {0x03A5,0x49}, + {0x03A6,0x3E}, + {0x03A7,0x00}, + {0x03A8,0x39}, + {0x03A9,0x33}, + {0x03B0,0x60}, + {0x03B1,0x00}, + {0x03B2,0x5A}, + {0x03B3,0xEE}, + {0x03B4,0x69}, + {0x03B5,0x49}, + {0x03B6,0x3E}, + {0x03B7,0x00}, + {0x03B8,0x3D}, + {0x03B9,0x20}, + {0x03C0,0x10}, + {0x03C1,0x00}, + {0x03C2,0x5A}, + {0x03C3,0xEE}, + {0x03C4,0x69}, + {0x03C5,0x49}, + {0x03C6,0x3A}, + {0x03C7,0x80}, + {0x03D0,0x64}, + {0x03D1,0x00}, + {0x03D2,0x5A}, + {0x03D3,0xEE}, + {0x03D4,0x69}, + {0x03D5,0x49}, + {0x03D6,0x34}, + {0x03D7,0xD1}, + {0x004C,0x0D},//enoch + {0x006C,0x08}, + {0x0350,0x00}, + {0x0351,0x5A}, + {0x0352,0xEE}, + {0x0353,0x69}, + {0x0354,0x49}, + {0x0355,0x39}, + {0x0356,0x6D}, + {0x0357,0x3c}, + {0x0358,0x00}, + {0x0359,0x3C}, + {0x035A,0x5A}, + {0x035B,0xEE}, + {0x035C,0x69}, + {0x035D,0x49}, + {0x035E,0x39}, + {0x035F,0x85}, + {0x0049,0x14}, // PipeSetupBank0 bGammaGain + {0x004A,0x0E}, // PipeSetupBank0 bGammaInterpolationGain + {0x0069,0x14}, // PipeSetupBank1 bGammaGain + {0x006A,0x0E}, // PipeSetupBank1 bGammaInterpolationGain + {0x0090,0x5A}, // GammaGainDamperControl fpX1 {MSB} //24000 + {0x0091,0xEE}, // GammaGainDamperControl fpX1 {LSB} + {0x0092,0x3E}, // GammaGainDamperControl fpY1 {MSB} //1 + {0x0093,0x00}, // GammaGainDamperControl fpY1 {LSB} + {0x0094,0x69}, // GammaGainDamperControl fpX2 {MSB} //3444736 + {0x0095,0x49}, // GammaGainDamperControl fpX2 {LSB} + {0x0096,0x39}, // GammaGainDamperControl fpY2 {MSB} //0.238 + {0x0097,0xCF}, // GammaGainDamperControl fpY2 {LSB} + {0x0098,0x01}, // GammaGainDamperControl fDisable + {0x00A0,0x5A}, // GammaInterpolationDamperControl fpX1 {MSB} //24000 + {0x00A1,0xEE}, // GammaInterpolationDamperControl fpX1 {LSB} + {0x00A2,0x3E}, // GammaInterpolationDamperControl fpY1 {MSB} //1 + {0x00A3,0x00}, // GammaInterpolationDamperControl fpY1 {LSB} + {0x00A4,0x69}, // GammaInterpolationDamperControl fpX2 {MSB} //3444736 + {0x00A5,0x49}, // GammaInterpolationDamperControl fpX2 {LSB} + {0x00A6,0x3B}, // GammaInterpolationDamperControl fpY2 {MSB} //0.4375 + {0x00A7,0x80}, // GammaInterpolationDamperControl fpY2 {LSB} + {0x00A8,0x01}, // GammaInterpolationDamperControl fDisable +#if 0 + {0x0420,0x00}, //new LSC start - 0306 + {0x0421,0x26}, + {0x0422,0xff}, + {0x0423,0x03}, + {0x0424,0x00}, + {0x0425,0x63}, + {0x0426,0x00}, + {0x0427,0x8e}, + {0x0428,0xff}, + {0x0429,0xf3}, + {0x042A,0x00}, + {0x042B,0x26}, + {0x042C,0xff}, + {0x042D,0xc8}, + {0x042E,0xff}, + {0x042F,0x5f}, + {0x0430,0x00}, + {0x0431,0x10}, + {0x0432,0xfe}, + {0x0433,0xcf}, + {0x0434,0x00}, + {0x0435,0xc2}, + {0x0436,0x00}, + {0x0437,0xf2}, + {0x0438,0xff}, + {0x0439,0xd0}, + {0x043A,0x00}, + {0x043B,0xa1}, + {0x043C,0x00}, + {0x043D,0x2f}, + {0x043E,0xfe}, + {0x043F,0xdc}, + {0x0450,0x00}, + {0x0451,0x36}, + {0x0452,0xff}, + {0x0453,0x60}, + {0x0454,0x00}, + {0x0455,0x43}, + {0x0456,0x00}, + {0x0457,0x6b}, + {0x0458,0xff}, + {0x0459,0xdf}, + {0x045A,0x00}, + {0x045B,0x83}, + {0x045C,0xff}, + {0x045D,0xeb}, + {0x045E,0xff}, + {0x045F,0x5f}, + {0x0440,0x00}, + {0x0441,0x36}, + {0x0442,0xff}, + {0x0443,0x3e}, + {0x0444,0x00}, + {0x0445,0x6d}, + {0x0446,0x00}, + {0x0447,0x87}, + {0x0448,0x00}, + {0x0449,0x0f}, + {0x044A,0xff}, + {0x044B,0xd3}, + {0x044C,0x00}, + {0x044D,0x18}, + {0x044E,0xff}, + {0x044F,0x4f}, + {0x0561,0x08}, + {0x0460,0x00}, + {0x0461,0x22}, + {0x0462,0xff}, + {0x0463,0x0a}, + {0x0464,0x00}, + {0x0465,0x63}, + {0x0466,0x00}, + {0x0467,0x8b}, + {0x0468,0xff}, + {0x0469,0xf9}, + {0x046A,0x00}, + {0x046B,0x17}, + {0x046C,0xff}, + {0x046D,0xbd}, + {0x046E,0xff}, + {0x046F,0x65}, + {0x0470,0x00}, + {0x0471,0x15}, + {0x0472,0xfe}, + {0x0473,0xd7}, + {0x0474,0x00}, + {0x0475,0xb6}, + {0x0476,0x00}, + {0x0477,0xe5}, + {0x0478,0xff}, + {0x0479,0xd0}, + {0x047A,0x00}, + {0x047B,0xb2}, + {0x047C,0x00}, + {0x047D,0x2c}, + {0x047E,0xfe}, + {0x047F,0xe6}, + {0x0490,0x00}, + {0x0491,0x2b}, + {0x0492,0xff}, + {0x0493,0x71}, + {0x0494,0x00}, + {0x0495,0x43}, + {0x0496,0x00}, + {0x0497,0x69}, + {0x0498,0xff}, + {0x0499,0xd7}, + {0x049A,0x00}, + {0x049B,0x59}, + {0x049C,0xff}, + {0x049D,0xde}, + {0x049E,0xff}, + {0x049F,0x76}, + {0x0480,0x00}, + {0x0481,0x38}, + {0x0482,0xff}, + {0x0483,0x3a}, + {0x0484,0x00}, + {0x0485,0x6b}, + {0x0486,0x00}, + {0x0487,0x86}, + {0x0488,0x00}, + {0x0489,0x14}, + {0x048A,0xff}, + {0x048B,0xd7}, + {0x048C,0x00}, + {0x048D,0x13}, + {0x048E,0xff}, + {0x048F,0x58}, + {0x0562,0x08}, + {0x04A0,0x00}, + {0x04A1,0x17}, + {0x04A2,0xff}, + {0x04A3,0x2e}, + {0x04A4,0x00}, + {0x04A5,0x5d}, + {0x04A6,0x00}, + {0x04A7,0x7a}, + {0x04A8,0xff}, + {0x04A9,0xf9}, + {0x04AA,0xff}, + {0x04AB,0xc0}, + {0x04AC,0xff}, + {0x04AD,0xc7}, + {0x04AE,0xff}, + {0x04AF,0x7d}, + {0x04B0,0x00}, + {0x04B1,0x13}, + {0x04B2,0xff}, + {0x04B3,0x45}, + {0x04B4,0x00}, + {0x04B5,0x70}, + {0x04B6,0x00}, + {0x04B7,0x96}, + {0x04B8,0xff}, + {0x04B9,0xde}, + {0x04BA,0x00}, + {0x04BB,0x17}, + {0x04BC,0x00}, + {0x04BD,0x23}, + {0x04BE,0xff}, + {0x04BF,0x46}, + {0x04D0,0x00}, + {0x04D1,0x17}, + {0x04D2,0xff}, + {0x04D3,0x99}, + {0x04D4,0x00}, + {0x04D5,0x3d}, + {0x04D6,0x00}, + {0x04D7,0x5f}, + {0x04D8,0xff}, + {0x04D9,0xd1}, + {0x04DA,0xff}, + {0x04DB,0xe2}, + {0x04DC,0xff}, + {0x04DD,0xc6}, + {0x04DE,0xff}, + {0x04DF,0x9c}, + {0x04C0,0x00}, + {0x04C1,0x32}, + {0x04C2,0xff}, + {0x04C3,0x4e}, + {0x04C4,0x00}, + {0x04C5,0x5e}, + {0x04C6,0x00}, + {0x04C7,0x7c}, + {0x04C8,0x00}, + {0x04C9,0x17}, + {0x04CA,0xff}, + {0x04CB,0x9b}, + {0x04CC,0x00}, + {0x04CD,0x06}, + {0x04CE,0xff}, + {0x04CF,0x70}, + {0x0563,0x05}, + {0x04E0,0x00}, + {0x04E1,0x11}, + {0x04E2,0xff}, + {0x04E3,0x20}, + {0x04E4,0x00}, + {0x04E5,0x5f}, + {0x04E6,0x00}, + {0x04E7,0x7b}, + {0x04E8,0x00}, + {0x04E9,0x02}, + {0x04EA,0xff}, + {0x04EB,0xf1}, + {0x04EC,0xff}, + {0x04ED,0xb7}, + {0x04EE,0xff}, + {0x04EF,0x7b}, + {0x04F0,0x00}, + {0x04F1,0x1c}, + {0x04F2,0xff}, + {0x04F3,0x08}, + {0x04F4,0x00}, + {0x04F5,0x7e}, + {0x04F6,0x00}, + {0x04F7,0xac}, + {0x04F8,0xff}, + {0x04F9,0xeb}, + {0x04FA,0x00}, + {0x04FB,0x93}, + {0x04FC,0x00}, + {0x04FD,0x1b}, + {0x04FE,0xff}, + {0x04FF,0x11}, + {0x0510,0xff}, + {0x0511,0xfe}, + {0x0512,0xff}, + {0x0513,0x8e}, + {0x0514,0x00}, + {0x0515,0x4a}, + {0x0516,0x00}, + {0x0517,0x6e}, + {0x0518,0xff}, + {0x0519,0xbb}, + {0x051A,0xff}, + {0x051B,0xcc}, + {0x051C,0xff}, + {0x051D,0x9a}, + {0x051E,0xff}, + {0x051F,0xa2}, + {0x0500,0x00}, + {0x0501,0x30}, + {0x0502,0xff}, + {0x0503,0x36}, + {0x0504,0x00}, + {0x0505,0x5d}, + {0x0506,0x00}, + {0x0507,0x81}, + {0x0508,0x00}, + {0x0509,0x1f}, + {0x050A,0xff}, + {0x050B,0xd4}, + {0x050C,0xff}, + {0x050D,0xfe}, + {0x050E,0xff}, + {0x050F,0x75}, + {0x0564,0x00}, //new LSC end +#else + +{0x0420,0x00}, //C0_GreenRed_X +{0x0421,0x1E}, //C0_GreenRed_X LSB +{0x0422,0xFF}, //C0_GreenRed_Y +{0x0423,0xF3}, //C0_GreenRed_Y LSB +{0x0424,0x00}, //C0_GreenRed_X2 +{0x0425,0x6E}, //C0_GreenRed_X2 LSB +{0x0426,0x00}, //C0_GreenRed_Y2 +{0x0427,0x96}, //C0_GreenRed_Y2 LSB +{0x0428,0x00}, //C0_GreenRed_XY +{0x0429,0x40}, //C0_GreenRed_XY LSB +{0x042A,0x00}, //C0_GreenRed_X2Y +{0x042B,0x3F}, //C0_GreenRed_X2Y LSB +{0x042C,0x00}, //C0_GreenRed_XY2 +{0x042D,0x99}, //C0_GreenRed_XY2 LSB +{0x042E,0xFF}, //C0_GreenRed_X2Y2 +{0x042F,0xCD}, //C0_GreenRed_X2Y2 LSB +{0x0430,0xFF}, //C0_Red_X +{0x0431,0xC1}, //C0_Red_X LSB +{0x0432,0xFF}, //C0_Red_Y +{0x0433,0x8C}, //C0_Red_Y LSB +{0x0434,0x00}, //C0_Red_X2 +{0x0435,0xD1}, //C0_Red_X2 LSB +{0x0436,0x00}, //C0_Red_Y2 +{0x0437,0xF9}, //C0_Red_Y2 LSB +{0x0438,0xFF}, //C0_Red_XY +{0x0439,0xD0}, //C0_Red_XY LSB +{0x043A,0xFF}, //C0_Red_X2Y +{0x043B,0xD4}, //C0_Red_X2Y LSB +{0x043C,0x00}, //C0_Red_XY2 +{0x043D,0x46}, //C0_Red_XY2 LSB +{0x043E,0xFF}, //C0_Red_X2Y2 +{0x043F,0x1F}, //C0_Red_X2Y2 LSB +{0x0440,0x00}, //C0_GreenBlue_X +{0x0441,0x00}, //C0_GreenBlue_X LSB +{0x0442,0xFF}, //C0_GreenBlue_Y +{0x0443,0xEC}, //C0_GreenBlue_Y LSB +{0x0444,0x00}, //C0_GreenBlue_X2 +{0x0445,0x7D}, //C0_GreenBlue_X2 LSB +{0x0446,0x00}, //C0_GreenBlue_Y2 +{0x0447,0x89}, //C0_GreenBlue_Y2 LSB +{0x0448,0x00}, //C0_GreenBlue_XY +{0x0449,0x4A}, //C0_GreenBlue_XY LSB +{0x044A,0x00}, //C0_GreenBlue_X2Y +{0x044B,0x00}, //C0_GreenBlue_X2Y LSB +{0x044C,0x00}, //C0_GreenBlue_XY2 +{0x044D,0x6C}, //C0_GreenBlue_XY2 LSB +{0x044E,0xFF}, //C0_GreenBlue_X2Y2 +{0x044F,0xB5}, //C0_GreenBlue_X2Y2 LSB // C9 +{0x0450,0x00}, //C0_Blue_X +{0x0451,0x03}, //C0_Blue_X LSB +{0x0452,0xFF}, //C0_Blue_Y +{0x0453,0xC8}, //C0_Blue_Y LSB +{0x0454,0x00}, //C0_Blue_X2 +{0x0455,0x5D}, //C0_Blue_X2 LSB +{0x0456,0x00}, //C0_Blue_Y2 +{0x0457,0x7F}, //C0_Blue_Y2 LSB +{0x0458,0xFF}, //C0_Blue_XY +{0x0459,0xD0}, //C0_Blue_XY LSB +{0x045A,0x00}, //C0_Blue_X2Y +{0x045B,0x1A}, //C0_Blue_X2Y LSB +{0x045C,0xFF}, //C0_Blue_XY2 +{0x045D,0xC8}, //C0_Blue_XY2 LSB +{0x045E,0xFF}, //C0_Blue_X2Y2 +{0x045F,0xDA}, //C0_Blue_X2Y2 LSB +{0x0460,0x00}, //C1_GreenRed_X +{0x0461,0x25}, //C1_GreenRed_X LSB +{0x0462,0x00}, //C1_GreenRed_Y +{0x0463,0x00}, //C1_GreenRed_Y LSB +{0x0464,0x00}, //C1_GreenRed_X2 +{0x0465,0x65}, //C1_GreenRed_X2 LSB +{0x0466,0x00}, //C1_GreenRed_Y2 +{0x0467,0x85}, //C1_GreenRed_Y2 LSB +{0x0468,0x00}, //C1_GreenRed_XY +{0x0469,0x41}, //C1_GreenRed_XY LSB +{0x046A,0x00}, //C1_GreenRed_X2Y +{0x046B,0x42}, //C1_GreenRed_X2Y LSB +{0x046C,0x00}, //C1_GreenRed_XY2 +{0x046D,0x91}, //C1_GreenRed_XY2 LSB +{0x046E,0xFF}, //C1_GreenRed_X2Y2 +{0x046F,0xDA}, //C1_GreenRed_X2Y2 LSB // F0 +{0x0470,0xFF}, //C1_Red_X +{0x0471,0xD7}, //C1_Red_X LSB +{0x0472,0xFF}, //C1_Red_Y +{0x0473,0xA0}, //C1_Red_Y LSB +{0x0474,0x00}, //C1_Red_X2 +{0x0475,0x8C}, //C1_Red_X2 LSB +{0x0476,0x00}, //C1_Red_Y2 +{0x0477,0xA5}, //C1_Red_Y2 LSB +{0x0478,0xFF}, //C1_Red_XY +{0x0479,0xD6}, //C1_Red_XY LSB +{0x047A,0xFF}, //C1_Red_X2Y +{0x047B,0xDA}, //C1_Red_X2Y LSB +{0x047C,0x00}, //C1_Red_XY2 +{0x047D,0x58}, //C1_Red_XY2 LSB +{0x047E,0xFF}, //C1_Red_X2Y2 +{0x047F,0xC4}, //C1_Red_X2Y2 LSB +{0x0480,0x00}, //C1_GreenBlue_X +{0x0481,0x04}, //C1_GreenBlue_X LSB +{0x0482,0xFF}, //C1_GreenBlue_Y +{0x0483,0xFA}, //C1_GreenBlue_Y LSB +{0x0484,0x00}, //C1_GreenBlue_X2 +{0x0485,0x70}, //C1_GreenBlue_X2 LSB +{0x0486,0x00}, //C1_GreenBlue_Y2 +{0x0487,0x7B}, //C1_GreenBlue_Y2 LSB +{0x0488,0x00}, //C1_GreenBlue_XY +{0x0489,0x4E}, //C1_GreenBlue_XY LSB +{0x048A,0x00}, //C1_GreenBlue_X2Y +{0x048B,0x00}, //C1_GreenBlue_X2Y LSB +{0x048C,0x00}, //C1_GreenBlue_XY2 +{0x048D,0x8F}, //C1_GreenBlue_XY2 LSB +{0x048E,0xFF}, //C1_GreenBlue_X2Y2 +{0x048F,0xEC}, //C1_GreenBlue_X2Y2 LSB +{0x0490,0x00}, //C1_Blue_X +{0x0491,0x08}, //C1_Blue_X LSB +{0x0492,0xFF}, //C1_Blue_Y +{0x0493,0xD0}, //C1_Blue_Y LSB +{0x0494,0x00}, //C1_Blue_X2 +{0x0495,0x55}, //C1_Blue_X2 LSB +{0x0496,0x00}, //C1_Blue_Y2 +{0x0497,0x70}, //C1_Blue_Y2 LSB +{0x0498,0xFF}, //C1_Blue_XY +{0x0499,0xC4}, //C1_Blue_XY LSB +{0x049A,0x00}, //C1_Blue_X2Y +{0x049B,0x03}, //C1_Blue_X2Y LSB +{0x049C,0xFF}, //C1_Blue_XY2 +{0x049D,0xD2}, //C1_Blue_XY2 LSB +{0x049E,0x00}, //C1_Blue_X2Y2 +{0x049F,0x04}, //C1_Blue_X2Y2 LSB +{0x04A0,0x00}, //C2_GreenRed_X +{0x04A1,0x28}, //C2_GreenRed_X LSB +{0x04A2,0xFF}, //C2_GreenRed_Y +{0x04A3,0xFA}, //C2_GreenRed_Y LSB +{0x04A4,0x00}, //C2_GreenRed_X2 +{0x04A5,0x69}, //C2_GreenRed_X2 LSB +{0x04A6,0x00}, //C2_GreenRed_Y2 +{0x04A7,0x88}, //C2_GreenRed_Y2 LSB +{0x04A8,0x00}, //C2_GreenRed_XY +{0x04A9,0x47}, //C2_GreenRed_XY LSB +{0x04AA,0x00}, //C2_GreenRed_X2Y +{0x04AB,0x46}, //C2_GreenRed_X2Y LSB +{0x04AC,0x00}, //C2_GreenRed_XY2 +{0x04AD,0xA2}, //C2_GreenRed_XY2 LSB +{0x04AE,0xFF}, //C2_GreenRed_X2Y2 +{0x04AF,0xCF}, //C2_GreenRed_X2Y2 LSB // EA +{0x04B0,0xFF}, //C2_Red_X +{0x04B1,0xDC}, //C2_Red_X LSB +{0x04B2,0xFF}, //C2_Red_Y +{0x04B3,0xA4}, //C2_Red_Y LSB +{0x04B4,0x00}, //C2_Red_X2 +{0x04B5,0x93}, //C2_Red_X2 LSB +{0x04B6,0x00}, //C2_Red_Y2 +{0x04B7,0xB2}, //C2_Red_Y2 LSB +{0x04B8,0xFF}, //C2_Red_XY +{0x04B9,0xD8}, //C2_Red_XY LSB +{0x04BA,0xFF}, //C2_Red_X2Y +{0x04BB,0xCD}, //C2_Red_X2Y LSB +{0x04BC,0x00}, //C2_Red_XY2 +{0x04BD,0x48}, //C2_Red_XY2 LSB +{0x04BE,0xFF}, //C2_Red_X2Y2 +{0x04BF,0x9B}, //C2_Red_X2Y2 LSB +{0x04C0,0x00}, //C2_GreenBlue_X +{0x04C1,0x08}, //C2_GreenBlue_X LSB +{0x04C2,0x00}, //C2_GreenBlue_Y +{0x04C3,0x00}, //C2_GreenBlue_Y LSB +{0x04C4,0x00}, //C2_GreenBlue_X2 +{0x04C5,0x73}, //C2_GreenBlue_X2 LSB +{0x04C6,0x00}, //C2_GreenBlue_Y2 +{0x04C7,0x80}, //C2_GreenBlue_Y2 LSB +{0x04C8,0x00}, //C2_GreenBlue_XY +{0x04C9,0x4F}, //C2_GreenBlue_XY LSB +{0x04CA,0xFF}, //C2_GreenBlue_X2Y +{0x04CB,0xEF}, //C2_GreenBlue_X2Y LSB +{0x04CC,0x00}, //C2_GreenBlue_XY2 +{0x04CD,0x89}, //C2_GreenBlue_XY2 LSB +{0x04CE,0xFF}, //C2_GreenBlue_X2Y2 +{0x04CF,0xE2}, //C2_GreenBlue_X2Y2 LSB +{0x04D0,0x00}, //C2_Blue_X +{0x04D1,0x0C}, //C2_Blue_X LSB +{0x04D2,0xFF}, //C2_Blue_Y +{0x04D3,0xCE}, //C2_Blue_Y LSB +{0x04D4,0x00}, //C2_Blue_X2 +{0x04D5,0x57}, //C2_Blue_X2 LSB +{0x04D6,0x00}, //C2_Blue_Y2 +{0x04D7,0x72}, //C2_Blue_Y2 LSB +{0x04D8,0xFF}, //C2_Blue_XY +{0x04D9,0xC4}, //C2_Blue_XY LSB +{0x04DA,0x00}, //C2_Blue_X2Y +{0x04DB,0x09}, //C2_Blue_X2Y LSB +{0x04DC,0xFF}, //C2_Blue_XY2 +{0x04DD,0xD2}, //C2_Blue_XY2 LSB +{0x04DE,0xFF}, //C2_Blue_X2Y2 +{0x04DF,0xFC}, //C2_Blue_X2Y2 LSB +{0x04E0,0x00}, //C3_GreenRed_X +{0x04E1,0x2C}, //C3_GreenRed_X LSB +{0x04E2,0xFF}, //C3_GreenRed_Y +{0x04E3,0xFB}, //C3_GreenRed_Y LSB +{0x04E4,0x00}, //C3_GreenRed_X2 +{0x04E5,0x69}, //C3_GreenRed_X2 LSB +{0x04E6,0x00}, //C3_GreenRed_Y2 +{0x04E7,0x87}, //C3_GreenRed_Y2 LSB +{0x04E8,0x00}, //C3_GreenRed_XY +{0x04E9,0x4A}, //C3_GreenRed_XY LSB +{0x04EA,0x00}, //C3_GreenRed_X2Y +{0x04EB,0x56}, //C3_GreenRed_X2Y LSB +{0x04EC,0x00}, //C3_GreenRed_XY2 +{0x04ED,0x9A}, //C3_GreenRed_XY2 LSB +{0x04EE,0xFF}, //C3_GreenRed_X2Y2 +{0x04EF,0xBE}, //C3_GreenRed_X2Y2 LSB // DC +{0x04F0,0xFF}, //C3_Red_X +{0x04F1,0xEB}, //C3_Red_X LSB +{0x04F2,0xFF}, //C3_Red_Y +{0x04F3,0x9B}, //C3_Red_Y LSB +{0x04F4,0x00}, //C3_Red_X2 +{0x04F5,0xA5}, //C3_Red_X2 LSB +{0x04F6,0x00}, //C3_Red_Y2 +{0x04F7,0xCC}, //C3_Red_Y2 LSB +{0x04F8,0xFF}, //C3_Red_XY +{0x04F9,0xE1}, //C3_Red_XY LSB +{0x04FA,0xFF}, //C3_Red_X2Y +{0x04FB,0xD9}, //C3_Red_X2Y LSB +{0x04FC,0x00}, //C3_Red_XY2 +{0x04FD,0x6A}, //C3_Red_XY2 LSB +{0x04FE,0xFF}, //C3_Red_X2Y2 +{0x04FF,0x5E}, //C3_Red_X2Y2 LSB +{0x0500,0x00}, //C3_GreenBlue_X +{0x0501,0x06}, //C3_GreenBlue_X LSB +{0x0502,0xFF}, //C3_GreenBlue_Y +{0x0503,0xFC}, //C3_GreenBlue_Y LSB +{0x0504,0x00}, //C3_GreenBlue_X2 +{0x0505,0x6F}, //C3_GreenBlue_X2 LSB +{0x0506,0x00}, //C3_GreenBlue_Y2 +{0x0507,0x83}, //C3_GreenBlue_Y2 LSB +{0x0508,0x00}, //C3_GreenBlue_XY +{0x0509,0x5A}, //C3_GreenBlue_XY LSB +{0x050A,0xFF}, //C3_GreenBlue_X2Y +{0x050B,0xF7}, //C3_GreenBlue_X2Y LSB +{0x050C,0x00}, //C3_GreenBlue_XY2 +{0x050D,0x80}, //C3_GreenBlue_XY2 LSB +{0x050E,0xFF}, //C3_GreenBlue_X2Y2 +{0x050F,0xD3}, //C3_GreenBlue_X2Y2 LSB +{0x0510,0x00}, //C3_Blue_X +{0x0511,0x0B}, //C3_Blue_X LSB +{0x0512,0xFF}, //C3_Blue_Y +{0x0513,0xCE}, //C3_Blue_Y LSB +{0x0514,0x00}, //C3_Blue_X2 +{0x0515,0x58}, //C3_Blue_X2 LSB +{0x0516,0x00}, //C3_Blue_Y2 +{0x0517,0x73}, //C3_Blue_Y2 LSB +{0x0518,0xFF}, //C3_Blue_XY +{0x0519,0xBE}, //C3_Blue_XY LSB +{0x051A,0xFF}, //C3_Blue_X2Y +{0x051B,0xFB}, //C3_Blue_X2Y LSB +{0x051C,0xFF}, //C3_Blue_XY2 +{0x051D,0xD2}, //C3_Blue_XY2 LSB +{0x051E,0xFF}, //C3_Blue_X2Y2 +{0x051F,0xFA}, //C3_Blue_X2Y2 LSB +{0x0561,0x05}, //C0 Unity +{0x0562,0x01}, //C1 Unity +{0x0563,0x01}, //C2 Unity +{0x0564,0x09}, //C3 Unity + + +#endif + + {0x0324,0x39}, + {0x0325,0xAE}, + {0x0326,0x3A}, + {0x0327,0x29}, + {0x0328,0x3B}, + {0x0329,0x0A}, + {0x032A,0x3B}, + {0x032B,0x62}, + {0x0320,0x01}, + {0x0321,0x04}, + {0x0322,0x01}, + {0x0323,0x01}, + {0x0330,0x01}, + {0x0384,0x00}, + {0x0337,0x01}, + {0x03EC,0x39}, + {0x03ED,0x85}, + {0x03FC,0x3A}, + {0x03FD,0x14}, + {0x040C,0x3A}, + {0x040D,0xF6}, + {0x041C,0x3B}, + {0x041D,0x9A}, + {0x03E0,0xB6}, + {0x03E1,0x04}, + {0x03E2,0xBB}, + {0x03E3,0xE9}, + {0x03E4,0xBC}, + {0x03E5,0x70}, + {0x03E6,0x37}, + {0x03E7,0x02}, + {0x03E8,0xBC}, + {0x03E9,0x00}, + {0x03EA,0xBF}, + {0x03EB,0x12}, + {0x03F0,0xBA}, + {0x03F1,0x7B}, + {0x03F2,0xBA}, + {0x03F3,0x83}, + {0x03F4,0xBB}, + {0x03F5,0xBC}, + {0x03F6,0x38}, + {0x03F7,0x2D}, + {0x03F8,0xBB}, + {0x03F9,0x23}, + {0x03FA,0xBD}, + {0x03FB,0xAC}, + {0x0400,0xBE}, + {0x0401,0x96}, + {0x0402,0xB9}, + {0x0403,0xBE}, + {0x0404,0xBB}, + {0x0405,0x57}, + {0x0406,0x3A}, + {0x0407,0xBB}, + {0x0408,0xB3}, + {0x0409,0x17}, + {0x040A,0xBE}, + {0x040B,0x66}, + {0x0410,0xBB}, + {0x0411,0x2A}, + {0x0412,0xBA}, + {0x0413,0x00}, + {0x0414,0xBB}, + {0x0415,0x10}, + {0x0416,0xB8}, + {0x0417,0xCD}, + {0x0418,0xB7}, + {0x0419,0x5C}, + {0x041A,0xBB}, + {0x041B,0x6C}, + {0x01f8,0x3c}, + {0x01f9,0x00}, + {0x01fa,0x00}, + {0x02a2,0x3e}, + {0x02a3,0x00}, + {0x02a4,0x3e}, + {0x02a5,0x00}, + {0x02a6,0x3e}, + {0x02a7,0x00}, + {0x02a8,0x3e}, + {0x02a9,0x00}, + {0x056c,0x42}, + {0x056d,0x00}, + {0x056e,0x42}, + {0x056f,0x00}, + {0x0570,0x42}, + {0x0571,0x00}, + {0x0572,0x42}, + {0x0573,0x10}, + {0x0081,0x64}, //6E->55 + {0x0588,0x00}, + {0x0589,0x5A}, + {0x058A,0xEE}, + {0x058B,0x69}, + {0x058C,0x49}, + {0x058D,0x3D}, + {0x058E,0x3D}, + {0x0080,0x64}, + {0x0082,0x5a}, + // {0x0010,0x01}, + + // SensorWaitMs(200), + + {0x4708,0x00}, + {0x4709,0x00}, + {0x4710,0x00}, + {0x4711,0x00}, + //AF intial setting + {0x0659,0x01},//03-06 new af @ vcm + {0x065A,0x00}, + {0x06C9,0x01}, + {0x06CD,0x01}, + {0x06CE,0xBD}, + {0x06CF,0x00}, + {0x06D0,0x60}, + {0x06D1,0x02}, + {0x06D2,0x30}, + {0x06D3,0xD4}, + {0x06D4,0x01}, + {0x06D5,0x01}, + {0x06D6,0xBD},//60->BC->66 + {0x06D7,0x00}, + {0x06D8,0x60},//93 + {0x06D9,0x00}, + {0x06DA,0x60},//93 + {0x06DB,0x59}, + {0x06DC,0x0d}, + {0x0730,0x00}, + {0x0731,0x00}, + {0x0732,0x03}, + {0x0733,0xFF}, + {0x0734,0x03}, + {0x0735,0x70}, + {0x0755,0x01}, + {0x0756,0x00}, + {0x075A,0x00}, + {0x075B,0x01}, + {0x075E,0x00}, + {0x0764,0x01}, + {0x0766,0x01}, + {0x0768,0x01}, + {0x076A,0x00}, + {0x0758,0x01}, + {0x075C,0x01}, + {0x0770,0x98}, + {0x0771,0x19}, + {0x0772,0x1B}, + {0x0774,0x01}, + {0x0775,0x4a}, + {0x0777,0x00}, + {0x0778,0x45}, + {0x0779,0x00}, + {0x077A,0x02}, + {0x077D,0x01}, + {0x077E,0x03}, + {0x0783,0x10}, + {0x0785,0x14}, + {0x0788,0x04}, + {0x0846,0x06}, + {0x0847,0x05}, + {0xC41A,0x05}, + {0xC423,0x11}, + {0xC427,0x11}, + {0x300B,0x09}, + + {0x7000,0x08}, + {0x5200,0x09}, + {0x00B2,0x50}, + {0x00B3,0x80}, + {0x00B5,0x02}, + {0x0030,0x11}, + // {0x0040,0x01}, //AB2 + // {0x0041,0x03}, //SVGA mode + {0x0040,0x01}, + {0x0041,0x0A}, + {0x0042,0x05}, + {0x0043,0x00}, + {0x0044,0x03}, + {0x0045,0xC0}, + + {0x0010,0x01}, + SensorWaitMs(150), + SensorEnd +}; +/* Senor full resolution setting: recommand for capture */ +static struct rk_sensor_reg sensor_fullres_lowfps_data[] ={ + + // {0x0010,0x02}, + // SensorWaitMs(100), + //{0x00B5, 0x02}, + //{0x0030, 0x11}, + {0x0040, 0x00}, + {0x0041, 0x00}, + {0x004c, 0x12}, + //{0x0010, 0x01}, + // SensorWaitMs(150), + + SensorEnd +}; +/* Senor full resolution setting: recommand for video */ +static struct rk_sensor_reg sensor_fullres_highfps_data[] ={ + SensorEnd +}; +/* Preview resolution setting*/ +static struct rk_sensor_reg sensor_preview_data[] = +{ + + // {0x0010,0x02}, + // SensorWaitMs(100), + // {0x00B5, 0x01}, + // {0x0030, 0x12}, + {0x0040,0x01}, + {0x0041,0x0A}, + {0x0042,0x05}, + {0x0043,0x00}, + {0x0044,0x03}, + {0x0045,0xC0}, + {0x004c,0x0e}, + //{0x00ed,0x0d}, + //{0x0010, 0x01}, + // SensorWaitMs(150), + + SensorEnd +}; +/* 1280x720 */ +static struct rk_sensor_reg sensor_720p[]={ + SensorEnd +}; + +/* 1920x1080 */ +static struct rk_sensor_reg sensor_1080p[]={ + SensorEnd +}; + + +static struct rk_sensor_reg sensor_softreset_data[]={ + SensorEnd +}; + +static struct rk_sensor_reg sensor_check_id_data[]={ + SensorRegVal(0x0000,0), + SensorRegVal(0x0001,0), + SensorEnd +}; +/* +* The following setting must been filled, if the function is turn on by CONFIG_SENSOR_xxxx +*/ +static struct rk_sensor_reg sensor_WhiteB_Auto[]= +{ + {0x01A0,0x01}, + SensorEnd +}; +/* Cloudy Colour Temperature : 6500K - 8000K */ +static struct rk_sensor_reg sensor_WhiteB_Cloudy[]= +{ + {0x01A0,0x04}, + SensorEnd +}; +/* ClearDay Colour Temperature : 5000K - 6500K */ +static struct rk_sensor_reg sensor_WhiteB_ClearDay[]= +{ + {0x01A0,0x05}, + SensorEnd +}; +/* Office Colour Temperature : 3500K - 5000K */ +static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[]= +{ + {0x01A0,0x07}, + SensorEnd + +}; +/* Home Colour Temperature : 2500K - 3500K */ +static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[]= +{ + {0x01A0,0x08}, + SensorEnd +}; +static struct rk_sensor_reg *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, + sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, +}; + +static struct rk_sensor_reg sensor_Brightness0[]= +{ + // Brightness -2 + SensorEnd +}; + +static struct rk_sensor_reg sensor_Brightness1[]= +{ + // Brightness -1 + + SensorEnd +}; + +static struct rk_sensor_reg sensor_Brightness2[]= +{ + // Brightness 0 + + SensorEnd +}; + +static struct rk_sensor_reg sensor_Brightness3[]= +{ + // Brightness +1 + + SensorEnd +}; + +static struct rk_sensor_reg sensor_Brightness4[]= +{ + // Brightness +2 + + SensorEnd +}; + +static struct rk_sensor_reg sensor_Brightness5[]= +{ + // Brightness +3 + + SensorEnd +}; +static struct rk_sensor_reg *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, + sensor_Brightness4, sensor_Brightness5,NULL, +}; + +static struct rk_sensor_reg sensor_Effect_Normal[] = +{ + {0x0380,0x0}, {0x0381,0x0}, {0x0382,0x0}, - {0x0384,0x0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_WandB[] = -{ - {0x0380,0x0}, + {0x0384,0x0}, + SensorEnd +}; + +static struct rk_sensor_reg sensor_Effect_WandB[] = +{ + {0x0380,0x0}, {0x0381,0x0}, {0x0382,0x0}, - {0x0384,0x5}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Sepia[] = -{ - {0x0380,0x0}, + {0x0384,0x5}, + SensorEnd +}; + +static struct rk_sensor_reg sensor_Effect_Sepia[] = +{ + {0x0380,0x0}, {0x0381,0x0}, {0x0382,0x0}, - {0x0384,0x6}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Negative[] = -{ - //Negative - {0x0380,0x0}, + {0x0384,0x6}, + SensorEnd +}; + +static struct rk_sensor_reg sensor_Effect_Negative[] = +{ + //Negative + {0x0380,0x0}, {0x0381,0x0}, {0x0382,0x0}, - {0x0384,0x8}, - SensorEnd -}; -static struct rk_sensor_reg sensor_Effect_Bluish[] = -{ - // Bluish - {0x0380,0x0}, + {0x0384,0x8}, + SensorEnd +}; +static struct rk_sensor_reg sensor_Effect_Bluish[] = +{ + // Bluish + {0x0380,0x0}, {0x0381,0x0}, {0x0382,0x0}, - {0x0384,0x4}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Green[] = -{ - // Greenish - {0x0380,0x0}, + {0x0384,0x4}, + SensorEnd +}; + +static struct rk_sensor_reg sensor_Effect_Green[] = +{ + // Greenish + {0x0380,0x0}, {0x0381,0x0}, {0x0382,0x0}, - {0x0384,0x3}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; - -static struct rk_sensor_reg sensor_Exposure0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure2[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure3[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure4[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure5[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure6[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; - -static struct rk_sensor_reg sensor_Saturation0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation2[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -static struct rk_sensor_reg sensor_Contrast0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast2[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast3[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast4[]= -{ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Contrast5[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast6[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; -static struct rk_sensor_reg sensor_SceneAuto[] = -{ - {0x3a00, 0x78}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_SceneNight[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -static struct rk_sensor_reg sensor_Zoom0[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom1[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom2[] = -{ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Zoom3[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; - -/* -* User could be add v4l2_querymenu in sensor_controls by new_usr_v4l2menu -*/ -static struct v4l2_querymenu sensor_menus[] = -{ -}; -/* -* User could be add v4l2_queryctrl in sensor_controls by new_user_v4l2ctrl -*/ -static struct sensor_v4l2ctrl_usr_s sensor_controls[] = -{ -}; - -//MUST define the current used format as the first item -static struct rk_sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG} -}; -/*static struct soc_camera_ops sensor_ops;*/ - - -/* -********************************************************** -* Following is local code: -* -* Please codeing your program here -********************************************************** -*/ - - -/* -********************************************************** -* Following is callback -* If necessary, you could coding these callback -********************************************************** -*/ - -/* -* the function is called in open sensor -*/ -static int sensor_activate_cb(struct i2c_client *client) -{ - SENSOR_DG("%s",__FUNCTION__); - return 0; -} -/* -* the function is called in close sensor -*/ -static int sensor_deactivate_cb(struct i2c_client *client) -{ - SENSOR_DG("%s",__FUNCTION__); - return 0; -} -/* -* the function is called before sensor register setting in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - //struct generic_sensor*sensor = to_generic_sensor(client); - - - return 0; -} -static int sensor_softrest_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - - return 0; -} -static int sensor_check_id_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - return 0; -} - -/* -* the function is called after sensor register setting finished in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_bh (struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - struct soc_camera_device *icd = client->dev.platform_data; - struct generic_sensor *gsensor = to_generic_sensor(client); - - if (capture) { - generic_sensor_af_workqueue_set(icd, WqCmd_af_special_pos,0,true); - } else { - if (gsensor->sensor_focus.focus_mode == V4L2_CID_FOCUS_AUTO) { - generic_sensor_af_workqueue_set(icd, WqCmd_af_close,0,false); - } else if (gsensor->sensor_focus.focus_mode == V4L2_CID_FOCUS_CONTINUOUS) { - generic_sensor_af_workqueue_set(icd,WqCmd_af_continues,0,false); - } - } - return 0; -} -static int sensor_try_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf) -{ - struct soc_camera_device *icd = client->dev.platform_data; - struct generic_sensor *gsensor = to_generic_sensor(client); - - if (gsensor->sensor_focus.focus_mode == V4L2_CID_FOCUS_CONTINUOUS) { - generic_sensor_af_workqueue_set(icd,WqCmd_af_continues_pause,0,true); - } - return 0; -} - -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - //struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("Suspend"); - - } else { - SENSOR_TR("pm_msg.event(0x%x) != PM_EVENT_SUSPEND\n",pm_msg.event); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - - SENSOR_DG("Resume"); - - return 0; - -} -static int sensor_mirror_cb (struct i2c_client *client, int mirror) -{ - - SENSOR_DG("mirror: %d",mirror); - - return 0; -} -/* -* the function is v4l2 control V4L2_CID_HFLIP callback -*/ -static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_mirror_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_mirror failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_mirror success, value:0x%x",ext_ctrl->value); - return 0; -} - -static int sensor_flip_cb(struct i2c_client *client, int flip) -{ - SENSOR_DG("flip: %d",flip); - - return 0; -} -/* -* the function is v4l2 control V4L2_CID_VFLIP callback -*/ -static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_flip_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_flip failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_flip success, value:0x%x",ext_ctrl->value); - return 0; -} -/* -* the functions are focus callbacks -*/ -static int sensor_focus_af_single_usr_cb(struct i2c_client *client); - -static int sensor_focus_init_usr_cb(struct i2c_client *client) -{ - return 0; -} - -static int sensor_focus_af_single_usr_cb(struct i2c_client *client) -{ + {0x0384,0x3}, + SensorEnd +}; +static struct rk_sensor_reg *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, + sensor_Effect_Bluish, sensor_Effect_Green,NULL, +}; + +static struct rk_sensor_reg sensor_Exposure0[]= +{ + SensorEnd +}; + +static struct rk_sensor_reg sensor_Exposure1[]= +{ + SensorEnd +}; + +static struct rk_sensor_reg sensor_Exposure2[]= +{ + SensorEnd +}; + +static struct rk_sensor_reg sensor_Exposure3[]= +{ + SensorEnd +}; + +static struct rk_sensor_reg sensor_Exposure4[]= +{ + SensorEnd +}; + +static struct rk_sensor_reg sensor_Exposure5[]= +{ + SensorEnd +}; + +static struct rk_sensor_reg sensor_Exposure6[]= +{ + SensorEnd +}; + +static struct rk_sensor_reg *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, + sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, +}; + +static struct rk_sensor_reg sensor_Saturation0[]= +{ + SensorEnd +}; + +static struct rk_sensor_reg sensor_Saturation1[]= +{ + SensorEnd +}; + +static struct rk_sensor_reg sensor_Saturation2[]= +{ + SensorEnd +}; +static struct rk_sensor_reg *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; + +static struct rk_sensor_reg sensor_Contrast0[]= +{ + SensorEnd +}; + +static struct rk_sensor_reg sensor_Contrast1[]= +{ + SensorEnd +}; + +static struct rk_sensor_reg sensor_Contrast2[]= +{ + SensorEnd +}; + +static struct rk_sensor_reg sensor_Contrast3[]= +{ + SensorEnd +}; + +static struct rk_sensor_reg sensor_Contrast4[]= +{ + SensorEnd +}; + + +static struct rk_sensor_reg sensor_Contrast5[]= +{ + SensorEnd +}; + +static struct rk_sensor_reg sensor_Contrast6[]= +{ + SensorEnd +}; +static struct rk_sensor_reg *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, + sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, +}; +static struct rk_sensor_reg sensor_SceneAuto[] = +{ + {0x3a00, 0x78}, + SensorEnd +}; + +static struct rk_sensor_reg sensor_SceneNight[] = +{ + SensorEnd +}; +static struct rk_sensor_reg *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; + +static struct rk_sensor_reg sensor_Zoom0[] = +{ + SensorEnd +}; + +static struct rk_sensor_reg sensor_Zoom1[] = +{ + SensorEnd +}; + +static struct rk_sensor_reg sensor_Zoom2[] = +{ + SensorEnd +}; + + +static struct rk_sensor_reg sensor_Zoom3[] = +{ + SensorEnd +}; +static struct rk_sensor_reg *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; + +/* +* User could be add v4l2_querymenu in sensor_controls by new_usr_v4l2menu +*/ +static struct v4l2_querymenu sensor_menus[] = +{ +}; +/* +* User could be add v4l2_queryctrl in sensor_controls by new_user_v4l2ctrl +*/ +static struct sensor_v4l2ctrl_usr_s sensor_controls[] = +{ +}; + +//MUST define the current used format as the first item +static struct rk_sensor_datafmt sensor_colour_fmts[] = { + {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG} +}; + + +/* +********************************************************** +* Following is local code: +* +* Please codeing your program here +********************************************************** +*/ + + +/* +********************************************************** +* Following is callback +* If necessary, you could coding these callback +********************************************************** +*/ + +/* +* the function is called in open sensor +*/ +static int sensor_activate_cb(struct i2c_client *client) +{ + SENSOR_DG("%s",__FUNCTION__); + return 0; +} +/* +* the function is called in close sensor +*/ +static int sensor_deactivate_cb(struct i2c_client *client) +{ + SENSOR_DG("%s",__FUNCTION__); + return 0; +} +/* +* the function is called before sensor register setting in VIDIOC_S_FMT +*/ +static int sensor_s_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) +{ + //struct generic_sensor*sensor = to_generic_sensor(client); + + + return 0; +} +static int sensor_softrest_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) +{ + + return 0; +} +static int sensor_check_id_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) +{ + return 0; +} + +/* +* the function is called after sensor register setting finished in VIDIOC_S_FMT +*/ +static int sensor_s_fmt_cb_bh (struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) +{ + struct soc_camera_subdev_desc *ssdd = client->dev.platform_data; + struct soc_camera_device *icd = ssdd->socdev; + struct generic_sensor *gsensor = to_generic_sensor(client); + + if (capture) { + generic_sensor_af_workqueue_set(icd, WqCmd_af_special_pos,0,true); + } else { + if (gsensor->sensor_focus.focus_mode == V4L2_CID_FOCUS_AUTO) { + generic_sensor_af_workqueue_set(icd, WqCmd_af_close,0,false); + } else if (gsensor->sensor_focus.focus_mode == V4L2_CID_FOCUS_CONTINUOUS) { + generic_sensor_af_workqueue_set(icd,WqCmd_af_continues,0,false); + } + } + return 0; +} +static int sensor_try_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf) +{ + struct soc_camera_subdev_desc *ssdd = client->dev.platform_data; + struct soc_camera_device *icd = ssdd->socdev; + struct generic_sensor *gsensor = to_generic_sensor(client); + + if (gsensor->sensor_focus.focus_mode == V4L2_CID_FOCUS_CONTINUOUS) { + generic_sensor_af_workqueue_set(icd,WqCmd_af_continues_pause,0,true); + } + return 0; +} + +static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) +{ + //struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); + + if (pm_msg.event == PM_EVENT_SUSPEND) { + SENSOR_DG("Suspend"); + + } else { + SENSOR_TR("pm_msg.event(0x%x) != PM_EVENT_SUSPEND\n",pm_msg.event); + return -EINVAL; + } + return 0; +} + +static int sensor_resume(struct soc_camera_device *icd) +{ + + SENSOR_DG("Resume"); + + return 0; + +} +static int sensor_mirror_cb (struct i2c_client *client, int mirror) +{ + + SENSOR_DG("mirror: %d",mirror); + + return 0; +} +/* +* the function is v4l2 control V4L2_CID_HFLIP callback +*/ +static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, + struct v4l2_ext_control *ext_ctrl) +{ + struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); + + if (sensor_mirror_cb(client,ext_ctrl->value) != 0) + SENSOR_TR("sensor_mirror failed, value:0x%x",ext_ctrl->value); + + SENSOR_DG("sensor_mirror success, value:0x%x",ext_ctrl->value); + return 0; +} + +static int sensor_flip_cb(struct i2c_client *client, int flip) +{ + SENSOR_DG("flip: %d",flip); + + return 0; +} +/* +* the function is v4l2 control V4L2_CID_VFLIP callback +*/ +static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, + struct v4l2_ext_control *ext_ctrl) +{ + struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); + + if (sensor_flip_cb(client,ext_ctrl->value) != 0) + SENSOR_TR("sensor_flip failed, value:0x%x",ext_ctrl->value); + + SENSOR_DG("sensor_flip success, value:0x%x",ext_ctrl->value); + return 0; +} +/* +* the functions are focus callbacks +*/ +static int sensor_focus_af_single_usr_cb(struct i2c_client *client); + +static int sensor_focus_init_usr_cb(struct i2c_client *client) +{ + return 0; +} + +static int sensor_focus_af_single_usr_cb(struct i2c_client *client) +{ int ret = 0; - char state,cnt=0; - struct generic_sensor *sensor = to_generic_sensor(client); - struct specific_sensor *ssensor = to_specific_sensor(sensor); - - ret |= sensor_write(client,AF_MODES_REG,0x03); + +#ifdef SENSOR_AF_CONFIG //xhh + struct generic_sensor *sensor = to_generic_sensor(client); + struct specific_sensor *ssensor = to_specific_sensor(sensor); + + sensor_write(client,0x0751,0x00);//add by jink 20141127 + ret |= sensor_write(client,AF_MODES_REG,0x03); + msleep(200); //add by jink 20141127 ret |= sensor_write(client,AF_AUTOCMDS_REG,0x01); - msleep(200); + msleep(200);//add by jink 20141127 ret |= sensor_write(client,AF_AUTOCMDS_REG,0x02); + msleep(300); - do { - msleep(20); - sensor_read(client,AF_FINISHCHK_REG,&state); - cnt++; - }while ((state != 1) && (cnt<100)); + // do { + // msleep(20); + // sensor_read(client,AF_FINISHCHK_REG,&state); + // cnt++; + // }while ((state != 1) && (cnt<100)); - if (state == 1) { - sensor_read(client, AF_LENSPOS_REG_H,(char*)&ssensor->parameter.af_pos[0]); - sensor_read(client, AF_LENSPOS_REG_L,(char*)&ssensor->parameter.af_pos[1]); - } + // if (state == 1) { + sensor_read(client, AF_LENSPOS_REG_H,(char*)&ssensor->parameter.af_pos[0]); + sensor_read(client, AF_LENSPOS_REG_L,(char*)&ssensor->parameter.af_pos[1]); + // } + + //SENSOR_DG("single focus, state: %d cnt: %d",state,cnt); +#endif +//sensor_af_single_end: + return ret; +} - SENSOR_DG("single focus, state: %d cnt: %d",state,cnt); - -//sensor_af_single_end: - return ret; -} - -static int sensor_focus_af_near_usr_cb(struct i2c_client *client) -{ - return 0; -} - -static int sensor_focus_af_far_usr_cb(struct i2c_client *client) -{ - - return 0; -} - -static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client,int pos) -{ - struct generic_sensor *sensor = to_generic_sensor(client); - struct specific_sensor *ssensor = to_specific_sensor(sensor); - - sensor_write(client,0x070A, 0x00); - sensor_write(client,0x0734, ssensor->parameter.af_pos[0]& 0xFF); - sensor_write(client,0x0735, ssensor->parameter.af_pos[1] & 0xFF); +static int sensor_focus_af_near_usr_cb(struct i2c_client *client) +{ + return 0; +} + +static int sensor_focus_af_far_usr_cb(struct i2c_client *client) +{ + + return 0; +} + +static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client,int pos) +{ + struct generic_sensor *sensor = to_generic_sensor(client); + struct specific_sensor *ssensor = to_specific_sensor(sensor); + #ifdef SENSOR_AF_CONFIG //xhh + sensor_write(client,0x070A, 0x00); + sensor_write(client,0x0734, ssensor->parameter.af_pos[0]& 0xFF); + sensor_write(client,0x0735, ssensor->parameter.af_pos[1] & 0xFF); sensor_write(client,0x070C, 0x00); mdelay(100); - sensor_write(client,0x070C, 0x05); - - return 0; -} - -static int sensor_focus_af_const_usr_cb(struct i2c_client *client) -{ - int ret; - - ret = sensor_write(client, AF_MODES_REG, 0x01); -//sensor_af_const_end: - return ret; -} -static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client) -{ - int ret = 0; - char status = 0; - struct generic_sensor *sensor = to_generic_sensor(client); - struct specific_sensor *ssensor = to_specific_sensor(sensor); - - sensor_read(client, 0x07ae, &status); + sensor_write(client,0x070C, 0x05); +#endif + return 0; +} + +static int sensor_focus_af_const_usr_cb(struct i2c_client *client) +{ + int ret; + #ifdef SENSOR_AF_CONFIG //xhh + sensor_write(client,0x0751,0x00);//add by jink 20141127 + ret = sensor_write(client, AF_MODES_REG, 0x01); + #endif +//sensor_af_const_end: + return ret; +} +static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client) +{ + int ret = 0; + #ifdef SENSOR_AF_CONFIG //xhh + char status = 0; + struct generic_sensor *sensor = to_generic_sensor(client); + struct specific_sensor *ssensor = to_specific_sensor(sensor); + + sensor_read(client, 0x07ae, &status); //add by jink 20141127 if (status == 1) { - sensor_read(client, AF_LENSPOS_REG_H,(char*)&ssensor->parameter.af_pos[0]); - sensor_read(client, AF_LENSPOS_REG_L,(char*)&ssensor->parameter.af_pos[1]); + sensor_read(client, AF_LENSPOS_REG_H,(char*)&ssensor->parameter.af_pos[0]); + sensor_read(client, AF_LENSPOS_REG_L,(char*)&ssensor->parameter.af_pos[1]); } else { - sensor_focus_af_single_usr_cb(client); - } - - return ret; -} -static int sensor_focus_af_close_usr_cb(struct i2c_client *client) -{ - int ret =0; - - ret |= sensor_write(client,0x070A, 0x00); - ret |= sensor_write(client,0x0700, 0x03); - ret |= sensor_write(client,0x0701, 0xFF); - ret |= sensor_write(client,0x070C, 0x00); - ret |= sensor_write(client,0x070C, 0x07); - SENSOR_DG("%s",__FUNCTION__); - return ret; -} - -static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client, int *zone_tm_pos) -{ - int ret = 0; - int xstart,ystart; - - *zone_tm_pos += 1000; - *(zone_tm_pos+1) += 1000; - *(zone_tm_pos+2) += 1000; - *(zone_tm_pos+3) += 1000; - - xstart = ((*zone_tm_pos + *(zone_tm_pos+2))>>1)*800/2000; - ystart = ((*(zone_tm_pos+1) + *(zone_tm_pos+3))>>1)*600/2000; - - if (xstart>0xa0) { - xstart -= 0xa0; - } else { - xstart = 0; - } - - if (ystart>0xa0) { - ystart -= 0xa0; - } else { - ystart = 0; - } + sensor_focus_af_single_usr_cb(client); + } + #endif + return ret; +} +static int sensor_focus_af_close_usr_cb(struct i2c_client *client) +{ + int ret =0; + #ifdef SENSOR_AF_CONFIG //xhh + sensor_write(client,0x0751,0x01);//add by jink 20141127 + /* + ret |= sensor_write(client,0x070A, 0x00); + ret |= sensor_write(client,0x0700, 0x03); + ret |= sensor_write(client,0x0701, 0xFF); + ret |= sensor_write(client,0x070C, 0x00); + ret |= sensor_write(client,0x070C, 0x07); + */ + #endif + SENSOR_DG("%s",__FUNCTION__); + return ret; +} + +static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client, int *zone_tm_pos) +{ + int ret = 0; + #ifdef SENSOR_AF_CONFIG //xhh + int xstart,ystart; - ret |= sensor_write(client, AF_ZONE0_WEIGHT,0x01); + *zone_tm_pos += 1000; + *(zone_tm_pos+1) += 1000; + *(zone_tm_pos+2) += 1000; + *(zone_tm_pos+3) += 1000; + + xstart = ((*zone_tm_pos + *(zone_tm_pos+2))>>1)*800/2000; + ystart = ((*(zone_tm_pos+1) + *(zone_tm_pos+3))>>1)*600/2000; + + if (xstart>0xa0) { + xstart -= 0xa0; + } else { + xstart = 0; + } + + if (ystart>0xa0) { + ystart -= 0xa0; + } else { + ystart = 0; + } + + ret |= sensor_write(client, AF_ZONE0_WEIGHT,0x01); ret |= sensor_write(client, AF_ZONE1_WEIGHT,0x00); ret |= sensor_write(client, AF_ZONE2_WEIGHT,0x00); ret |= sensor_write(client, AF_ZONE3_WEIGHT,0x00); ret |= sensor_write(client, AF_ZONE4_WEIGHT,0x00); ret |= sensor_write(client, AF_ZONE5_WEIGHT,0x00); ret |= sensor_write(client, AF_ZONE6_WEIGHT,0x00); - ret |= sensor_write(client, FACE_LC,0x03); + ret |= sensor_write(client, FACE_LC,0x01); - ret |= sensor_write(client, FACE_START_XH, ((xstart&0xff00)>>8)); - ret |= sensor_write(client, FACE_START_XL, xstart&0xff); - ret |= sensor_write(client, FACE_START_YH, ((ystart&0xff00)>>8)); - ret |= sensor_write(client, FACE_START_YL, ystart&0xff); + ret |= sensor_write(client, FACE_START_XH, ((xstart&0xff00)>>8)); + ret |= sensor_write(client, FACE_START_XL, xstart&0xff); + ret |= sensor_write(client, FACE_START_YH, ((ystart&0xff00)>>8)); + ret |= sensor_write(client, FACE_START_YL, ystart&0xff); ret |= sensor_write(client, FACE_SIZE_XH, 0x01); ret |= sensor_write(client, FACE_SIZE_XL, 0x40); ret |= sensor_write(client, FACE_SIZE_YH, 0x01); - ret |= sensor_write(client, FACE_SIZE_YL, 0x40); -//sensor_af_zone_end: - return ret; -} - -/* -face defect call back -*/ -static int sensor_face_detect_usr_cb(struct i2c_client *client,int on){ - return 0; -} - -/* -* The function can been run in sensor_init_parametres which run in sensor_probe, so user can do some -* initialization in the function. -*/ -static void sensor_init_parameters_user(struct specific_sensor* spsensor,struct soc_camera_device *icd) -{ - return; -} - -/* -* :::::WARNING::::: -* It is not allowed to modify the following code -*/ - -sensor_init_parameters_default_code(); - -sensor_v4l2_struct_initialization(); - -sensor_probe_default_code(); - -sensor_remove_default_code(); - -sensor_driver_default_module_code(); - - - - + ret |= sensor_write(client, FACE_SIZE_YL, 0x40); + #endif +//sensor_af_zone_end: + return ret; +} + +/* +face defect call back +*/ +static int sensor_face_detect_usr_cb(struct i2c_client *client,int on){ + return 0; +} + +/* +* The function can been run in sensor_init_parametres which run in sensor_probe, so user can do some +* initialization in the function. +*/ +static void sensor_init_parameters_user(struct specific_sensor* spsensor,struct soc_camera_device *icd) +{ + return; +} + +/* +* :::::WARNING::::: +* It is not allowed to modify the following code +*/ + +sensor_init_parameters_default_code(); + +sensor_v4l2_struct_initialization(); + +sensor_probe_default_code(); + +sensor_remove_default_code(); + +sensor_driver_default_module_code(); + + + + diff --git a/drivers/media/video/rk30_camera_oneframe.c b/drivers/media/video/rk30_camera_oneframe.c index 9aa388a5f549..7f795d7aa715 100755 --- a/drivers/media/video/rk30_camera_oneframe.c +++ b/drivers/media/video/rk30_camera_oneframe.c @@ -291,8 +291,10 @@ static u32 CHIP_NAME; 1. setting cif capture en bit can't stop cif really,reset cif instead. *v0.1.d: 1. use of_find_node_by_name to get vpu node instead of of_find_compatible_node +*v0.1.e: + 1. support focus mode. */ -#define RK_CAM_VERSION_CODE KERNEL_VERSION(0, 1, 0xd) +#define RK_CAM_VERSION_CODE KERNEL_VERSION(0, 1, 0xe) static int version = RK_CAM_VERSION_CODE; module_param(version, int, S_IRUGO); -- 2.34.1