From 2677a1f5c80f8ab07b436a086316a71fa9930155 Mon Sep 17 00:00:00 2001 From: ddl Date: Fri, 8 Mar 2013 17:58:48 +0800 Subject: [PATCH] camera: update gc2035 and sp2518 driver, 2035 fix some module may output error --- drivers/media/video/gc2035.c | 2244 ++++++++++++---------------------- drivers/media/video/sp2518.c | 556 +++++---- 2 files changed, 1114 insertions(+), 1686 deletions(-) mode change 100644 => 100755 drivers/media/video/gc2035.c diff --git a/drivers/media/video/gc2035.c b/drivers/media/video/gc2035.c old mode 100644 new mode 100755 index 8bbf54331557..68bd09274fc4 --- a/drivers/media/video/gc2035.c +++ b/drivers/media/video/gc2035.c @@ -46,14 +46,14 @@ module_param(debug, int, S_IRUGO|S_IWUSR); #define SENSOR_NAME RK29_CAM_SENSOR_GC2035 #define SENSOR_V4L2_IDENT V4L2_IDENT_GC2035 #define SENSOR_ID 0x2035 -#define SENSOR_MIN_WIDTH 640 -#define SENSOR_MIN_HEIGHT 480 +#define SENSOR_MIN_WIDTH 800 +#define SENSOR_MIN_HEIGHT 600 #define SENSOR_MAX_WIDTH 1600 #define SENSOR_MAX_HEIGHT 1200 -#define SENSOR_INIT_WIDTH 640 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 480 -#define SENSOR_INIT_WINSEQADR sensor_vga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_UYVY8_2X8 +#define SENSOR_INIT_WIDTH 800 /* Sensor pixel size for sensor_init_data array */ +#define SENSOR_INIT_HEIGHT 600 +#define SENSOR_INIT_WINSEQADR sensor_svga +#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_YUYV8_2X8 #define CONFIG_SENSOR_WhiteBalance 1 #define CONFIG_SENSOR_Brightness 0 @@ -68,7 +68,7 @@ module_param(debug, int, S_IRUGO|S_IWUSR); #define CONFIG_SENSOR_Mirror 0 #define CONFIG_SENSOR_Flip 0 -#define CONFIG_SENSOR_I2C_SPEED 250000 /* Hz */ +#define CONFIG_SENSOR_I2C_SPEED 100000 /* Hz */ /* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ #define CONFIG_SENSOR_I2C_NOSCHED 0 #define CONFIG_SENSOR_I2C_RDWRCHK 0 @@ -109,1314 +109,687 @@ static enum hrtimer_restart flash_off_func(struct hrtimer *timer); static struct flash_timer flash_off_timer; //for user defined if user want to customize the series , zyc -#ifdef CONFIG_GC2035_USER_DEFINED_SERIES -#include "gc2035_user_series.c" -#else + /* init 352X288 SVGA */ static struct reginfo sensor_init_data[] ={ -{0xfe,0x80}, -{0xfe,0x80}, -{0xfe,0x80}, -{0xfe,0x80}, -{0xfc,0x06}, -{0xf9,0xfe}, //[0] pll enable -{0xfa,0x00}, -{0xf6,0x00}, -{0xf7,0x17}, //pll enable -{0xf8,0x00}, -{0xfe,0x00}, -{0x82,0x00}, -{0xb3,0x60}, -{0xb4,0x40}, -{0xb5,0x60}, -{0x03,0x05}, -{0x04,0x2e}, - -//measure window -{0xfe,0x00}, -{0xec,0x04}, -{0xed,0x04}, -{0xee,0x60}, -{0xef,0x90}, - - - -{0x0a,0x00}, //row start -{0x0c,0x00}, //col start - -{0x0d,0x04}, -{0x0e,0xc0}, -{0x0f,0x06}, //Window setting -{0x10,0x58},// - -{0x17,0x14}, //[0]mirror [1]flip -{0x18,0x0a}, //sdark 4 row in even frame?? -{0x19,0x0a}, //AD pipe number - -{0x1a,0x01}, //CISCTL mode4 -{0x1b,0x48}, -{0x1e,0x88}, //analog mode1 [7] tx-high en -{0x1f,0x0f}, //analog mode2 - -{0x20,0x05}, //[0]adclk mode [1]rowclk_MODE [2]rsthigh_en -{0x21,0x0f}, //[3]txlow_en -{0x22,0xf0}, //[3:0]vref -{0x23,0xc3}, //f3//ADC_r -{0x24,0x16}, //pad drive - -//==============================aec -//AEC -{0xfe,0x01}, -{0x09,0x00}, - -{0x11,0x10}, -{0x47,0x30}, -{0x0b,0x90}, -{0x13,0x85}, //0x75 0x80 -{0x1f,0xc0},//addd -{0x20,0x56},//add 0x60 -{0xfe,0x00}, -{0xf7,0x17}, //pll enable -{0xf8,0x00}, -{0x05,0x01}, -{0x06,0x18}, -{0x07,0x00}, -{0x08,0x48}, -{0xfe,0x01}, -{0x27,0x00}, -{0x28,0x6a}, -{0x29,0x03}, -{0x2a,0x50},//8fps -{0x2b,0x04}, -{0x2c,0xf8}, -{0x2d,0x06}, -{0x2e,0xa0},//6fps -{0x3e,0x00},//0x40 -{0xfe,0x00}, -{0xb6,0x03}, //AEC enable -{0xfe,0x00}, - -///////BLK - -{0x3f,0x00}, //prc close??? -{0x40,0x77}, // a7 77 -{0x42,0x7f}, -{0x43,0x2b},//0x30 - -{0x5c,0x08}, -//{0x6c 3a //manual_offset ,real B channel -//{0x6d 3a//manual_offset ,real B channel -//{0x6e 36//manual_offset ,real R channel -//{0x6f 36//manual_offset ,real R channel -{0x5e,0x1f},//0x20 -{0x5f,0x1f},//0x20 -{0x60,0x20}, -{0x61,0x20}, -{0x62,0x20}, -{0x63,0x20}, -{0x64,0x20}, -{0x65,0x20}, -{0x66,0x20}, -{0x67,0x20}, -{0x68,0x20}, -{0x69,0x20}, - -/////crop// -{0x90,0x01}, //crop enable -{0x95,0x04}, //1600x1200 -{0x96,0xb0}, -{0x97,0x06}, -{0x98,0x40}, - -{0xfe,0x03}, -{0x42,0x80}, -{0x43,0x06}, //output buf width //buf widthÕâÒ»¿éµÄÅäÖû¹ÐèÒª¸ãÇå³þ -{0x41,0x00}, // delay -{0x40,0x00}, //fifo half full trig -{0x17,0x01}, //wid mipi²¿·ÖµÄ·ÖƵÊÇΪʲôv£¿ -{0xfe,0x00}, + {0xfe , 0x80}, + {0xfe , 0x80}, + {0xfe , 0x80}, + {0xfc , 0x06}, + {0xf2 , 0x00}, + {0xf3 , 0x00}, + {0xf4 , 0x00}, + {0xf5 , 0x00}, + {0xf9 , 0xfe}, //[0] pll enable + {0xfa , 0x00}, + {0xf6 , 0x00}, + {0xf7 , 0x15}, //pll enable + + {0xf8 , 0x85}, + {0xfe , 0x00}, + {0x82 , 0x00}, + {0xb3 , 0x60}, + {0xb4 , 0x40}, + {0xb5 , 0x60}, -{0x80,0xff},//block enable 0xff -{0x81,0x26},//38 //skin_Y 8c_debug - -{0x03,0x05}, -{0x04,0x2e}, -{0x84,0x00}, //output put foramat -{0x86,0x03}, //sync plority -{0x87,0x80}, //middle gamma on -{0x8b,0xbc},//debug modeÐèÒª¸ãÇå³þһϠ-{0xa7,0x80},//B_channel_gain -{0xa8,0x80},//B_channel_gain -{0xb0,0x80}, //globle gain -{0xc0,0x40}, - -#if 0 -//lsc, -{0xfe,0x01}, -{0xc2,0x3a}, -{0xc3,0x27}, -{0xc4,0x21}, -{0xc8,0x2a}, -{0xc9,0x2a}, -{0xca,0x1b}, -{0xbc,0x4d}, -{0xbd,0x2c}, -{0xbe,0x28}, -{0xb6,0x5a}, -{0xb7,0x4e}, -{0xb8,0x2a}, -{0xc5,0x00}, -{0xc6,0x00}, -{0xc7,0x06}, -{0xcb,0x00}, -{0xcc,0x1e}, -{0xcd,0x00}, -{0xbf,0x08}, -{0xc0,0x00}, -{0xc1,0x05}, -{0xb9,0x07}, -{0xba,0x22}, -{0xbb,0x06}, -{0xaa,0x0b}, -{0xab,0x07}, -{0xac,0x04}, -{0xad,0x0f}, -{0xae,0x00}, -{0xaf,0x09}, -{0xb0,0x17}, -{0xb1,0x06}, -{0xb2,0x04}, -{0xb3,0x14}, -{0xb4,0x01}, -{0xb5,0x00}, -{0xd0,0x17}, -{0xd2,0x22}, -{0xd3,0x33}, -{0xd8,0x41}, -{0xda,0x0d}, -{0xdb,0x0b}, -{0xdc,0x29}, -{0xde,0x00}, -{0xdf,0x15}, -{0xd4,0x09}, -{0xd6,0x1e}, -{0xd7,0x3a}, -{0xa4,0x30}, -{0xa5,0x00}, -{0xa6,0x60}, -{0xa7,0x12}, -{0xa8,0x44}, -{0xa9,0x74}, -{0xa1,0x80}, -{0xa2,0x80}, - -{0xfe,0x02}, -{0xa4,0x00}, -{0xfe,0x00}, + {0x03 , 0x02}, + {0x04 , 0x80}, -{0xfe,0x02}, -{0xc0,0x01}, -{0xc1,0x40}, //Green_cc -{0xc2,0xfc}, -{0xc3,0x05}, -{0xc4,0xec}, -{0xc5,0x42}, -{0xc6,0xf8}, -{0xc7,0x46}, -{0xc8,0xfd}, -{0xc9,0xfd}, -{0xca,0xfd}, -{0xcb,0x46}, -{0xcc,0xfd}, -{0xcd,0x46}, -{0xce,0xfd}, -{0xcf,0xfd}, -{0xe3,0xfd}, -{0xe4,0x46}, -{0xe5,0xfd}, -{0xfe,0x00}, -//awb -{0xfe,0x01}, -{0x4f,0x00}, -{0x4d,0x10}, ////////////////10 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0x20}, ///////////////20 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0x30}, //////////////////30 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x04}, //d50 -{0x4e,0x02}, // d65 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0x40}, //////////////////////40 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x08}, //cwf -{0x4e,0x08}, // cwf -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0x50}, //////////////////50 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x10}, // tl84 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0x60}, /////////////////60 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0x70}, ///////////////////70 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x20}, // a -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0x80}, /////////////////////80 -{0x4e,0x40}, //H -{0x4e,0x40}, // h -{0x4e,0x20}, //A -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0x90}, //////////////////////90 -{0x4e,0x00}, // h -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0xa0}, /////////////////a0 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0xb0}, //////////////////////////////////b0 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0xc0}, //////////////////////////////////c0 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0xd0}, ////////////////////////////d0 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0xe0}, /////////////////////////////////e0 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0xf0}, /////////////////////////////////f0 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4f,0x01}, -#endif -//lsc, -#if 1 -////ba-wang/// -{0xfe,0x01}, -{0xc2,0x10},//0x1f -{0xc3,0x04},//0x07 -{0xc4,0x01},//0x03 -{0xc8,0x08},//10 -{0xc9,0x04},//0x0a -{0xca,0x02},//0x08 -{0xbc,0x16},//0x4a -{0xbd,0x10},//0x1c -{0xbe,0x10},//0x1a -{0xb6,0x10},//0x30 -{0xb7,0x08},//0x1c -{0xb8,0x06},//0x15 -{0xc5,0x00}, -{0xc6,0x00}, -{0xc7,0x00}, -{0xcb,0x00}, -{0xcc,0x00}, -{0xcd,0x00}, -{0xbf,0x04},//0x0c -{0xc0,0x00},//0x04 -{0xc1,0x00}, -{0xb9,0x00}, -{0xba,0x00}, -{0xbb,0x00}, -{0xaa,0x00}, -{0xab,0x00}, -{0xac,0x00}, -{0xad,0x00}, -{0xae,0x00}, -{0xaf,0x00}, -{0xb0,0x00}, -{0xb1,0x00}, -{0xb2,0x00}, -{0xb3,0x00}, -{0xb4,0x00}, -{0xb5,0x00}, -{0xd0,0x01}, -{0xd2,0x00}, -{0xd3,0x00}, -{0xd8,0x00}, -{0xda,0x00}, -{0xdb,0x00}, -{0xdc,0x00}, -{0xde,0x00},//0x07 -{0xdf,0x00}, -{0xd4,0x00}, -{0xd6,0x00}, -{0xd7,0x00}, -{0xa4,0x00}, -{0xa5,0x00}, -{0xa6,0x04}, -{0xa7,0x00}, -{0xa8,0x00}, -{0xa9,0x00}, -{0xa1,0x80}, -{0xa2,0x80}, -/************* -////ba-wang/// -{0xfe,0x01}, -{0xc2,0x30},//0x44 -{0xc3,0x2e}, -{0xc4,0x2a}, -{0xc8,0x35}, -{0xc9,0x2e}, -{0xca,0x24}, -{0xbc,0x48},//5e -{0xbd,0x45}, -{0xbe,0x43}, -{0xb6,0x5f}, -{0xb7,0x3e}, -{0xb8,0x2b}, -{0xc5,0x00}, -{0xc6,0x00}, -{0xc7,0x00}, -{0xcb,0x00}, -{0xcc,0x00}, -{0xcd,0x00}, -{0xbf,0x04},//0a -{0xc0,0x09}, -{0xc1,0x08}, -{0xb9,0x0a}, -{0xba,0x07}, -{0xbb,0x12}, -{0xaa,0x08},// q1 red 19 -{0xab,0x00},//0x03 -{0xac,0x01}, -{0xad,0x06},//0d -{0xae,0x03},//07 -{0xaf,0x00}, -{0xb0,0x02},//0x05 -{0xb1,0x04},//09 -{0xb2,0x00}, -{0xb3,0x08},//13 -{0xb4,0x06},//0c -{0xb5,0x00}, -{0xd0,0x20},//54 -{0xd2,0x00}, -{0xd3,0x00}, -{0xd8,0x2f}, -{0xda,0x00}, -{0xdb,0x00}, -{0xdc,0x00}, -{0xde,0x07}, -{0xdf,0x00}, -{0xd4,0x29}, -{0xd6,0x00}, -{0xd7,0x02}, -{0xa4,0x00}, -{0xa5,0x00}, -{0xa6,0x00}, -{0xa7,0x00}, -{0xa8,0x44}, -{0xa9,0x40}, -{0xa1,0x80}, -{0xa2,0x80}, -**************/ -{0xfe,0x02}, -{0xa4,0x00}, -{0xfe,0x00}, - -{0xfe,0x02}, -{0xc0,0x00}, //0x01 -{0xc1,0x3c}, //0x40 Green_cc -{0xc2,0xfc}, -{0xc3,0xfd},//0x05 -{0xc4,0x00},//0xec -{0xc5,0x42},//0x42 -{0xc6,0x00},//0xf8 - -{0xc7,0x3c}, -{0xc8,0xfc}, -{0xc9,0xfd}, -{0xca,0x00}, -{0xcb,0x42}, -{0xcc,0x00}, - -{0xcd,0x3c}, -{0xce,0xfc}, -{0xcf,0xfd}, -{0xe3,0x00}, -{0xe4,0x42}, -{0xe5,0x00}, - -/*** -{0xc7,0x46}, -{0xc8,0xfd}, -{0xc9,0xfd}, -{0xca,0xfd}, -{0xcb,0x46}, -{0xcc,0xfd}, -{0xcd,0x46}, -{0xce,0xfd}, -{0xcf,0xfd}, -{0xe3,0xfd}, -{0xe4,0x46}, -{0xe5,0xfd}, -***/ + //////////measure window /////////// + {0xfe , 0x00}, + {0xec , 0x06},//04 + {0xed , 0x06},//04 + {0xee , 0x62},//60 + {0xef , 0x92},//90 -{0xfe,0x00}, -//awb -{0xfe,0x01}, -{0x4f,0x00}, -{0x4d,0x10}, ////////////////10 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0x20}, ///////////////20 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0x30}, //////////////////30 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x04}, // office -{0x4e,0x00}, -{0x4e,0x02}, // d65 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0x40}, //////////////////////40 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, // cwf -{0x4e,0x08}, // cwf -{0x4e,0x04}, // d50 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0x50}, //////////////////50 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x10}, // tl84 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0x60}, /////////////////60 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0x70}, ///////////////////70 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x20}, // a -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0x80}, /////////////////////80 -{0x4e,0x00}, -{0x4e,0x40}, // h -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0x90}, //////////////////////90 -{0x4e,0x00}, // h -{0x4e,0x40}, // h -{0x4e,0x40}, // h -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0xa0}, /////////////////a0 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0xb0}, //////////////////////////////////b0 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0xc0}, //////////////////////////////////c0 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0xd0}, ////////////////////////////d0 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0xe0}, /////////////////////////////////e0 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4d,0xf0}, /////////////////////////////////f0 -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4e,0x00}, -{0x4f,0x01}, -#endif -{0xfe,0x01}, -{0x50,0xc8}, -{0x52,0x40}, -{0x54,0x60}, -{0x56,0x06}, -{0x57,0x20}, //pre adjust -{0x58,0x01}, -{0x5c,0xf0}, -{0x5d,0x40}, -{0x5b,0x02}, //AWB_gain_delta -{0x61,0xaa},//R/G stand -{0x62,0xaa},//R/G stand -{0x71,0x00}, -{0x74,0x10}, //AWB_C_max -{0x77,0x08}, //AWB_p2_x -{0x78,0xfd}, //AWB_p2_y -{0x86,0x30}, -{0x87,0x00}, -{0x88,0x06},//04 -{0x8a,0xc0},//awb move mode -{0x89,0x75}, -{0x84,0x08}, //auto_window -{0x8b,0x00}, //awb compare luma -{0x8d,0x70}, //awb gain limit R -{0x8e,0x70},//G -{0x8f,0xf4},//B -{0x5e,0xa4}, -{0x5f,0x60}, -{0x92,0x58}, -{0xfe,0x00}, -{0x82,0x02},//awb_en + ///////////analog///////////// + {0x0a , 0x00}, //row start + {0x0c , 0x00}, //col start + {0x0d , 0x04}, + {0x0e , 0xc0}, + {0x0f , 0x06}, //Window setting + {0x10 , 0x58}, + {0x17 , 0x14}, //[0]mirror [1]flip -//{0xfe ,0xec}, luma_value -{0xfe,0x01}, -{0x9c,0x02}, //add abs slope -{0x21,0xbf}, -{0xfe,0x02}, -{0xa5,0x60}, //lsc_th //40 -{0xa2,0xc0}, //lsc_dec_slope 0xa0 -{0xa3,0x30}, //when total gain is bigger than the value, enter dark light mode 0x20 added -{0xa4,0x04},//add -{0xa6,0x50}, //dd_th -{0xa7,0x80}, //ot_th 30 -{0xab,0x31}, //[0]b_dn_effect_dark_inc_or_dec -{0x88,0x15}, //[5:0]b_base -{0xa9,0x6c}, //[7:4] ASDE_DN_b_slope_high 0x6c 0x6f - -{0xb0,0x88}, //6edge effect slope 0x66 0x88 0x99 - -{0xb3,0xa0}, //saturation dec slope //0x70 0x40 -{0xb4,0x32},//0x32 0x42 -{0x8c,0xf6}, //[2]b_in_dark_inc -{0x89,0x03}, //dn_c_weight 0x03 - -{0xde,0xb6}, //b6[7]asde_autogray [3:0]auto_gray_value 0xb9 -{0x38,0x09}, //0aasde_autogray_slope 0x08 0x05 0x06 0x0a -{0x39,0x80}, //50asde_autogray_threshold 0x50 0x30 + {0x18 , 0x0e}, //sdark 4 row in even frame?? + {0x19 , 0x0c}, //AD pipe number -{0xfe,0x00}, -{0x81,0x26}, -{0x87,0xb0}, //[5:4]first_dn_en first_dd_en enable 0x80 -{0xfe,0x02}, -{0x83,0x00},//[6]green_bks_auto [5]gobal_green_bks -{0x84,0x45},//RB offset -{0xd1,0x40}, //saturation_cb 0x3a -{0xd2,0x3a}, //saturation_Cr 0x38 -{0xdc,0x30}, -{0xdd,0xb8}, //edge_sa_g,b -{0xfe,0x00}, + /* + /// ë´Ì ÏÖÏó + {0x18 , 0x0a}, //sdark 4 row in even frame?? + {0x19 , 0x0a}, //AD pipe number + */ + + {0x1a , 0x01}, //CISCTL mode4 + {0x1b , 0x8b}, + {0x1e , 0x88}, //analog mode1 [7] tx-high en [5:3]COL_bias + {0x1f , 0x08}, //[3] tx-low en// + {0x20 , 0x05}, //[0]adclk mode , 0x[1]rowclk_MODE [2]rsthigh_en + {0x21 , 0x0f}, //[6:4]rsg + {0x22 , 0xf0}, //[3:0]vref + {0x23 , 0xc3}, //f3//ADC_r + {0x24 , 0x17}, //pad drive 16 + + //AEC + {0xfe , 0x01}, + {0x11 , 0x20},//AEC_out_slope , 0x + {0x1f , 0xc0},//max_post_gain + {0x20 , 0x60},//max_pre_gain + {0x47 , 0x30},//AEC_outdoor_th + {0x0b , 0x10},// + {0x13 , 0x75},//y_target + {0xfe , 0x00}, -/*** -{0x16,0x18},// 7 -{0x17,0x1c}, -{0x18,0x22}, -{0x19,0x2a}, -{0x1a,0x37}, -{0x1b,0x44}, -{0x1c,0x4d}, -{0x1d,0x67}, -{0x1e,0x79}, -{0x1f,0x8c}, -{0x20,0x9a}, -{0x21,0xa8}, -{0x22,0xbd}, -{0x23,0xca}, -{0x24,0xd5}, -{0x25,0xdf}, -{0x26,0xea}, -{0x27,0xf3}, -{0x28,0xfa}, -{0x29,0xfd}, -*****/ -//gmma-curve4-low strech -{0xfe,0x02}, -{0x15,0x0f}, -{0x16,0x15}, -{0x17,0x1a}, -{0x18,0x20}, -{0x19,0x2a}, -{0x1a,0x32}, -{0x1b,0x38}, -{0x1c,0x40}, -{0x1d,0x4d}, -{0x1e,0x59}, -{0x1f,0x66}, -{0x20,0x70}, -{0x21,0x7b}, -{0x22,0x8f}, -{0x23,0xa2}, -{0x24,0xb0}, -{0x25,0xbb}, -{0x26,0xcf}, -{0x27,0xdf}, -{0x28,0xef}, -{0x29,0xfd}, -{0xfe,0x02}, -{0x15,0x0c}, -{0x16,0x12}, -{0x17,0x17}, -{0x18,0x1c}, -{0x19,0x24}, -{0x1a,0x2c}, -{0x1b,0x34}, -{0x1c,0x3c}, -{0x1d,0x4d}, -{0x1e,0x59}, -{0x1f,0x66}, -{0x20,0x70}, -{0x21,0x7b}, -{0x22,0x8f}, -{0x23,0xa2}, -{0x24,0xb0}, -{0x25,0xbb}, -{0x26,0xcf}, -{0x27,0xdf}, -{0x28,0xef}, -{0x29,0xfd}, -{0xfe,0x02}, -{0x15,0x15}, -{0x16,0x24}, -{0x17,0x2a}, -{0x18,0x32}, -{0x19,0x3d}, -{0x1a,0x48}, -{0x1b,0x50}, -{0x1c,0x57}, -{0x1d,0x64}, -{0x1e,0x6d}, -{0x1f,0x78}, -{0x20,0x80}, -{0x21,0x89}, -{0x22,0x94}, -{0x23,0xa3}, -{0x24,0xaf}, -{0x25,0xbc}, -{0x26,0xce}, -{0x27,0xdf}, -{0x28,0xee}, -{0x29,0xff}, -#if 0 -////Gamma curve4+curve6 -{0xfe,0x02}, -{0x15,0x0f}, -{0x16,0x16}, -{0x17,0x1f}, -{0x18,0x27}, -{0x19,0x2c}, -{0x1a,0x34}, -{0x1b,0x3b}, -{0x1c,0x43}, -{0x1d,0x4f}, -{0x1e,0x5a}, -{0x1f,0x64}, -{0x20,0x6e}, -{0x21,0x74}, -{0x22,0x8d}, -{0x23,0xa5}, -{0x24,0xb8}, -{0x25,0xca}, -{0x26,0xe0}, -{0x27,0xed}, -{0x28,0xf7}, -{0x29,0xfd}, - -/******* -gamma-curve6 -0xfe,0x02}, -0x15,0x06}, -0x16,0x0a}, -0x17,0x0d}, -0x18,0x10}, -0x19,0x14}, -0x1a,0x1e}, -0x1b,0x28}, -0x1c,0x31}, -0x1d,0x44}, -0x1e,0x50}, -0x1f,0x5f}, -0x20,0x6b}, -0x21,0x79}, -0x22,0x8f}, -0x23,0xa5}, -0x24,0xb8}, -0x25,0xca}, -0x26,0xe0}, -0x27,0xed}, -0x28,0xf7}, -0x29,0xfd}, -/***** -//gamma-new -{0xfe,0x02}, -{0x15,0x14}, -{0x16,0x28}, -{0x17,0x48}, -{0x18,0x60}, -{0x19,0x7c}, -{0x1a,0x90}, -{0x1b,0xa2}, -{0x1c,0xb2}, -{0x1d,0xc0}, -{0x1e,0xce}, -{0x1f,0xda}, -{0x20,0xe4}, -{0x21,0xec}, -{0x22,0xf4}, -{0x23,0xca}, -{0x24,0xd5}, -{0x25,0xfa}, -{0x26,0xfb}, -{0x27,0xfd}, -{0x28,0xff}, -{0x29,0xff}, - - {0x24,0xd5}, - {0x25,0xdf}, - {0x26,0xea}, - {0x27,0xf3}, - {0x28,0xfa}, - {0x29,0xfd}, - - -{0x16,0x18},// 7 -{0x17,0x1c}, -{0x18,0x22}, -{0x19,0x2a}, -{0x1a,0x37}, -{0x1b,0x44}, -{0x1c,0x4d}, -{0x1d,0x67}, -{0x1e,0x79}, -{0x1f,0x8c}, -{0x20,0x9a}, -{0x21,0xa8}, -{0x22,0xbd}, -{0x23,0xca}, -{0x24,0xd5}, -{0x25,0xdf}, -{0x26,0xea}, -{0x27,0xf3}, -{0x28,0xfa}, -{0x29,0xfd}, - - -//rgb-gamma -{0x15,0x0a}, -{0x16,0x0c}, -{0x17,0x0b}, -{0x18,0x10}, -{0x19,0x13}, -{0x1a,0x21}, -{0x1b,0x2b}, -{0x1c,0x33}, -{0x1d,0x43}, -{0x1e,0x50}, -{0x1f,0x5f}, -{0x20,0x6b}, -{0x21,0x7a}, -{0x22,0x8e}, -{0x23,0xa4}, -{0x24,0xb8}, -{0x25,0xc8}, -{0x26,0xdf}, -{0x27,0xed}, -{0x28,0xf8}, -{0x29,0xff}, -****************/ -#endif -//y-gamma -{0x2b,0x00}, -{0x2c,0x04}, -{0x2d,0x09}, -{0x2e,0x18}, -{0x2f,0x27}, -{0x30,0x37}, -{0x31,0x49}, -{0x32,0x5c}, -{0x33,0x7e}, -{0x34,0xa0}, -{0x35,0xc0}, -{0x36,0xe0}, -{0x37,0xff}, -{0xfe,0x00}, -// a-lsc -{0xfe,0x01}, -{0xa0,0x03},//0f -{0xe8,0x51}, -{0xea,0x42}, -{0xe6,0x71}, -{0xe4,0x80}, -{0xe9,0x1f}, -{0x4c,0x13}, -{0xeb,0x1e}, -{0x4d,0x13}, -{0xe7,0x20}, -{0x4b,0x15}, -{0xe5,0x1c}, -{0x4a,0x15}, -{0xe0,0x20}, -{0xe1,0x20}, -{0xe2,0x20}, -{0xe3,0x20}, -{0xd1,0x74}, -{0x4e,0x0e}, -{0xd9,0x91}, -{0x4f,0x27}, -{0xdd,0x78}, -{0xce,0x31}, -{0xd5,0x71}, -{0xcf,0x39}, -{0xa4,0x00}, -{0xa5,0x00}, -{0xa6,0x00}, -{0xa7,0x00}, -{0xa8,0x66}, -{0xa9,0x66}, -{0xa1,0x80}, -{0xa2,0x80}, -{0xfe,0x00}, + {0x05 , 0x01},//hb + {0x06 , 0x11}, + {0x07 , 0x00},//vb + {0x08 , 0x50}, + {0xfe , 0x01}, + {0x27 , 0x00},//step + {0x28 , 0xa0}, + {0x29 , 0x05},//level1 + {0x2a , 0x00}, + {0x2b , 0x05},//level2 + {0x2c , 0x00}, + {0x2d , 0x06},//6e8//level3 + {0x2e , 0xe0}, + {0x2f , 0x0a},//level4 + {0x30 , 0x00}, + {0x3e , 0x40}, + {0xfe , 0x00}, + {0xfe , 0x00}, //0x , 0x , 0x , 0x , 0x + {0xb6 , 0x03}, //AEC enable + {0xfe , 0x00}, -{0x82,0xfe}, -//sleep 400 -{0xf2,0x70}, -{0xf3,0xff}, -{0xf4,0x00}, -{0xf5,0x30}, -{0xfe,0x01}, -{0x0b,0x90}, -{0x87,0x00},//0x10 -{0xfe,0x00}, + /////////BLK////// + {0x3f , 0x00}, //prc close + {0x40 , 0x77},// + {0x42 , 0x7f}, + {0x43 , 0x30}, + {0x5c , 0x08}, + {0x5e , 0x20}, + {0x5f , 0x20}, + {0x60 , 0x20}, + {0x61 , 0x20}, + {0x62 , 0x20}, + {0x63 , 0x20}, + {0x64 , 0x20}, + {0x65 , 0x20}, + + ///block//////////// + {0x80 , 0xff}, + {0x81 , 0x26},//38 , 0x//skin_Y 8c_debug + {0x87 , 0x90}, //[7]middle gamma + {0x84 , 0x00}, //output put foramat + {0x86 , 0x07}, //02 //sync plority + {0x8b , 0xbc}, + {0xb0 , 0x80}, //globle gain + {0xc0 , 0x40},//Yuv bypass + + //////lsc///////////// + {0xfe , 0x01}, + {0xc2 , 0x38}, + {0xc3 , 0x25}, + {0xc4 , 0x21}, + {0xc8 , 0x19}, + {0xc9 , 0x12}, + {0xca , 0x0e}, + {0xbc , 0x43}, + {0xbd , 0x18}, + {0xbe , 0x1b}, + {0xb6 , 0x40}, + {0xb7 , 0x2e}, + {0xb8 , 0x26}, + {0xc5 , 0x05}, + {0xc6 , 0x03}, + {0xc7 , 0x04}, + {0xcb , 0x00}, + {0xcc , 0x00}, + {0xcd , 0x00}, + {0xbf , 0x14}, + {0xc0 , 0x22}, + {0xc1 , 0x1b}, + {0xb9 , 0x00}, + {0xba , 0x05}, + {0xbb , 0x05}, + {0xaa , 0x35}, + {0xab , 0x33}, + {0xac , 0x33}, + {0xad , 0x25}, + {0xae , 0x22}, + {0xaf , 0x27}, + {0xb0 , 0x1d}, + {0xb1 , 0x20}, + {0xb2 , 0x22}, + {0xb3 , 0x14}, + {0xb4 , 0x15}, + {0xb5 , 0x16}, + {0xd0 , 0x00}, + {0xd2 , 0x07}, + {0xd3 , 0x08}, + {0xd8 , 0x00}, + {0xda , 0x13}, + {0xdb , 0x17}, + {0xdc , 0x00}, + {0xde , 0x0a}, + {0xdf , 0x08}, + {0xd4 , 0x00}, + {0xd6 , 0x00}, + {0xd7 , 0x0c}, + {0xa4 , 0x00}, + {0xa5 , 0x00}, + {0xa6 , 0x00}, + {0xa7 , 0x00}, + {0xa8 , 0x00}, + {0xa9 , 0x00}, + {0xa1 , 0x80}, + {0xa2 , 0x80}, + + //////////cc////////////// + {0xfe , 0x02}, + {0xc0 , 0x01}, + {0xc1 , 0x40}, //Green_cc for d + {0xc2 , 0xfc}, + {0xc3 , 0x05}, + {0xc4 , 0xec}, + {0xc5 , 0x42}, + {0xc6 , 0xf8}, + {0xc7 , 0x40},//for cwf + {0xc8 , 0xf8}, + {0xc9 , 0x06}, + {0xca , 0xfd}, + {0xcb , 0x3e}, + {0xcc , 0xf3}, + {0xcd , 0x36},//for A + {0xce , 0xf6}, + {0xcf , 0x04}, + {0xe3 , 0x0c}, + {0xe4 , 0x44}, + {0xe5 , 0xe5}, + {0xfe , 0x00}, -/////,0xup},date -//ÈÈ?0x }, -{0xfe,0x02}, -{0xa6,0x80}, //dd_th -{0xa7,0x60}, //ot_th //0x80 -{0xa9,0x66}, //6f[7:4] ASDE_DN_b_slope_high 0x68 -{0xb0,0x88}, //edge effect slope 0x99 -{0x38,0x0b}, //asde_autogray_slope 0x08 0x0f 0x0a -{0x39,0x50}, //asde_autogray_threshold 0x60 -{0xfe,0x00}, -{0x87,0xb0}, //[5:4]first_dn_en first_dd_en 0x90 + ///////awb start //////////////// + //AWB clear + {0xfe , 0x01}, + {0x4f , 0x00}, + {0x4d , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4d , 0x10}, // 10 + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4d , 0x20}, // 20 + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4d , 0x30}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, // 30 + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4d , 0x40}, // 40 + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4d , 0x50}, // 50 + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4d , 0x60}, // 60 + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4d , 0x70}, // 70 + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4d , 0x80}, // 80 + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4d , 0x90}, // 90 + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4d , 0xa0}, // a0 + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4d , 0xb0}, // b0 + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4d , 0xc0}, // c0 + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4d , 0xd0}, // d0 + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4e , 0x00}, + {0x4f , 0x01}, + /////// awb value//////// + {0xfe , 0x01}, + {0x4f , 0x00}, + {0x4d , 0x30}, + {0x4e , 0x00}, + {0x4e , 0x80}, + {0x4e , 0x80}, + {0x4e , 0x02}, + {0x4e , 0x02}, + {0x4d , 0x40}, + {0x4e , 0x00}, + {0x4e , 0x80}, + {0x4e , 0x80}, + {0x4e , 0x02}, + {0x4e , 0x02}, + {0x4e , 0x02}, + {0x4d , 0x53}, + {0x4e , 0x08}, + {0x4e , 0x04}, + {0x4d , 0x62}, + {0x4e , 0x10}, + {0x4d , 0x72}, + {0x4e , 0x20}, + {0x4f , 0x01}, + + /////awb//// + {0xfe , 0x01}, + {0x50 , 0x88},//c0//[6]green mode + {0x52 , 0x40}, + {0x54 , 0x60}, + {0x56 , 0x06}, + {0x57 , 0x20}, //pre adjust + {0x58 , 0x01}, + {0x5b , 0x02}, //AWB_gain_delta + {0x61 , 0xaa},//R/G stand + {0x62 , 0xaa},//R/G stand + {0x71 , 0x00}, + {0x74 , 0x10}, //0x//AWB_C_max + {0x77 , 0x08}, // 0x//AWB_p2_x + {0x78 , 0xfd}, //AWB_p2_y + {0x86 , 0x30}, + {0x87 , 0x00}, + {0x88 , 0x04},//06 , 0x//[1]dark mode + {0x8a , 0xc0},//awb move mode + {0x89 , 0x75}, + {0x84 , 0x08}, //0x//auto_window + {0x8b , 0x00}, // 0x//awb compare luma + {0x8d , 0x70}, //awb gain limit R + {0x8e , 0x70},//G + {0x8f , 0xf4},//B + {0xfe , 0x00}, + {0x82 , 0x02},//awb_en + /////////awb end ///////////// + + ///==========asde + {0xfe , 0x01}, + {0x21 , 0xbf}, + {0xfe , 0x02}, + {0xa4 , 0x00},// + {0xa5 , 0x40}, //lsc_th + {0xa2 , 0xa0}, //lsc_dec_slope + {0xa6 , 0x80}, //dd_th + {0xa7 , 0x80}, //ot_th + {0xab , 0x31}, // + {0xa9 , 0x6f}, // + {0xb0 , 0x99}, //0x//edge effect slope low + {0xb1 , 0x34},//edge effect slope low + {0xb3 , 0x80}, //saturation dec slope + {0xde , 0xb6}, // + {0x38 , 0x0f}, // + {0x39 , 0x60}, // + {0xfe , 0x00}, + {0x81 , 0x26}, + {0xfe , 0x02}, + {0x83 , 0x00},// + {0x84 , 0x45},// + ////////////YCP////////// + {0xd1 , 0x38},//saturation_cb + {0xd2 , 0x38},//saturation_Cr + {0xd3 , 0x40},//contrast ? + {0xd4 , 0x80},//contrast center + {0xd5 , 0x00},//luma_offset + {0xdc , 0x30}, + {0xdd , 0xb8},//edge_sa_g,b + {0xfe , 0x00}, + ///////dndd/////////// + {0xfe , 0x02}, + {0x88 , 0x15},//dn_b_base + {0x8c , 0xf6}, //[2]b_in_dark_inc + {0x89 , 0x03}, //dn_c_weight + ////////EE /////////// + {0xfe , 0x02}, + {0x90 , 0x6c},// EEINTP mode1 + {0x97 , 0x45},// edge effect + ////==============RGB Gamma + {0xfe , 0x02}, + {0x15 , 0x0a}, + {0x16 , 0x12}, + {0x17 , 0x19}, + {0x18 , 0x1f}, + {0x19 , 0x2c}, + {0x1a , 0x38}, + {0x1b , 0x42}, + {0x1c , 0x4e}, + {0x1d , 0x63}, + {0x1e , 0x76}, + {0x1f , 0x87}, + {0x20 , 0x96}, + {0x21 , 0xa2}, + {0x22 , 0xb8}, + {0x23 , 0xca}, + {0x24 , 0xd8}, + {0x25 , 0xe3}, + {0x26 , 0xf0}, + {0x27 , 0xf8}, + {0x28 , 0xfd}, + {0x29 , 0xff}, + + ///=================y gamma + {0xfe , 0x02}, + {0x2b , 0x00}, + {0x2c , 0x04}, + {0x2d , 0x09}, + {0x2e , 0x18}, + {0x2f , 0x27}, + {0x30 , 0x37}, + {0x31 , 0x49}, + {0x32 , 0x5c}, + {0x33 , 0x7e}, + {0x34 , 0xa0}, + {0x35 , 0xc0}, + {0x36 , 0xe0}, + {0x37 , 0xff}, + /////1600x1200size// + {0xfe , 0x00},// + {0x90 , 0x01}, //0x//crop enable + {0x95 , 0x04}, //0x//1600x1200 + {0x96 , 0xb0}, + {0x97 , 0x06}, + {0x98 , 0x40}, -{0xfe,0x00}, -{0x90,0x01}, -{0x95,0x01}, -{0x96,0xe4}, -{0x97,0x02}, -{0x98,0x82}, -{0xc8,0x14}, -{0xf7,0x0D}, -{0xf8,0x83}, -{0xfa,0x00},//pll=4 -{0x05,0x00}, -{0x06,0xc4}, -{0x07,0x00}, -{0x08,0xae}, -{0xfe,0x01}, -{0x27,0x00}, -{0x28,0xe5}, -{0x29,0x05}, -{0x2a,0x5e},//18fps -{0x2b,0x07}, -{0x2c,0x28},//12.5fps -{0x2d,0x0a}, -{0x2e,0xbc},//8fps -{0x3e,0x00},//0x40 0x00 -{0xfe,0x03}, -{0x42,0x04}, -{0x43,0x05}, //output buf width -{0x41,0x02}, // delay -{0x40,0x40}, //fifo half full trig -{0x17,0x00}, //widv is 0 -{0xfe,0x00}, -{0xc8,0x55}, + {0xfe , 0x03}, + {0x42 , 0x40}, + {0x43 , 0x06}, //output buf width + {0x41 , 0x02}, // Pclk_polarity + {0x40 , 0x40}, //00 + {0x17 , 0x00}, //widv + {0xfe , 0x00}, + ////output DVP///// + {0xfe , 0x00}, + {0xb6 , 0x03}, + {0xf7 , 0x15}, + + {0xc8 , 0x00},//close scaler + {0x99 , 0x22},// 1/2 subsample + {0x9a , 0x06}, + {0x9b , 0x00}, + {0x9c , 0x00}, + {0x9d , 0x00}, + {0x9e , 0x00}, + {0x9f , 0x00}, + {0xa0 , 0x00}, + {0xa1 , 0x00}, + {0xa2 ,0x00}, + + {0x90 , 0x01}, //crop enable + {0x94 , 0x02}, + {0x95 , 0x02}, + {0x96 , 0x58}, + {0x97 , 0x03}, + {0x98 , 0x20}, + {0xfe , 0x00}, + {0x82 , 0xfe}, // fe + {0xf2 , 0x70}, + {0xf3 , 0xff}, + {0xf4 , 0x00}, + {0xf5 , 0x30}, + + #if 0 + ///////// re zao/// + {0xfe,0x00}, + {0x22,0xd0}, + {0xfe,0x01}, + {0x21,0xff}, + {0xfe,0x02}, + {0x8a,0x33}, + {0x8c,0x76}, + {0x8d,0x85}, + {0xa6,0xf0}, + {0xae,0x9f}, + {0xa2,0x90}, + {0xa5,0x40}, + {0xa7,0x30}, + {0xb0,0x88}, + {0x38,0x0b}, + {0x39,0x30}, + {0xfe,0x00}, + {0x87,0xb0}, + + //// small RGB gamma//// + {0xfe , 0x02}, + {0x15 , 0x0b}, + {0x16 , 0x0e}, + {0x17 , 0x10}, + {0x18 , 0x12}, + {0x19 , 0x19}, + {0x1a , 0x21}, + {0x1b , 0x29}, + {0x1c , 0x31}, + {0x1d , 0x41}, + {0x1e , 0x50}, + {0x1f , 0x5f}, + {0x20 , 0x6d}, + {0x21 , 0x79}, + {0x22 , 0x91}, + {0x23 , 0xa5}, + {0x24 , 0xb9}, + {0x25 , 0xc9}, + {0x26 , 0xe1}, + {0x27 , 0xee}, + {0x28 , 0xf7}, + {0x29 , 0xff}, + + ////dark sun///// + {0xfe , 0x02}, + {0x40 , 0x06}, + {0x41 , 0x23}, + {0x42 , 0x3f}, + {0x43 , 0x06}, + {0x44 , 0x00}, + {0x45 , 0x00}, + {0x46 , 0x14}, + {0x47 , 0x09}, + + #endif -{0x00,0x00}, + {0x00,0x00}, }; @@ -1427,38 +800,26 @@ static struct reginfo sensor_uxga[] = {0xfe , 0x00}, - {0x0a , 0x00}, //row start - {0x0c , 0x00}, //col start - - {0x0d , 0x04}, - {0x0e , 0xc0}, - {0x0f , 0x06}, //Window setting - {0x10 , 0x58},// - - - - - - {0x90 , 0x01}, //crop enable + {0xc8 , 0x00}, + {0xf7 , 0x17}, + + {0x99 , 0x11}, // disable sambsample + {0x9a , 0x06}, + {0x9b , 0x00}, + {0x9c , 0x00}, + {0x9d , 0x00}, + {0x9e , 0x00}, + {0x9f , 0x00}, + {0xa0 , 0x00}, + {0xa1 , 0x00}, + {0xa2 , 0x00}, + + {0x90 , 0x01}, {0x95 , 0x04}, - {0x96 , 0xb0}, + {0x96 , 0xb0}, {0x97 , 0x06}, {0x98 , 0x40}, - {0x99 , 0x11}, - {0xc8 , 0x00}, - - {0xfa , 0x11}, - - - {0xfe , 0x03}, - {0x42 , 0x80}, - {0x43 , 0x06}, //output buf width - {0x41 , 0x00}, // delay - {0x40 , 0x00}, //fifo half full trig - {0x17 , 0x01}, //widv - {0xfe , 0x00}, - {0xc8 , 0x00}, - + {0x00 , 0x00}, @@ -1470,14 +831,35 @@ static struct reginfo sensor_uxga[] = static struct reginfo sensor_sxga[] = { - {0x0, 0x0}, + {0x00,0x00}, }; /* 800X600 SVGA*/ static struct reginfo sensor_svga[] = { + {0xfe , 0x00}, + {0xb6 , 0x03}, + {0xf7 , 0x15}, + + {0xc8 , 0x00},//close scaler + {0x99 , 0x22},// 1/2 subsample + {0x9a , 0x06}, + {0x9b , 0x00}, + {0x9c , 0x00}, + {0x9d , 0x00}, + {0x9e , 0x00}, + {0x9f , 0x00}, + {0xa0 , 0x00}, + {0xa1 , 0x00}, + {0xa2 , 0x00}, - {0x0, 0x0}, + {0x90 , 0x01}, //crop enable + {0x94 , 0x02}, + {0x95 , 0x02}, + {0x96 , 0x58}, + {0x97 , 0x03}, + {0x98 , 0x20}, + {0x00,0x00}, }; @@ -1485,50 +867,15 @@ static struct reginfo sensor_svga[] = /* 640X480 VGA */ static struct reginfo sensor_vga[] = { - {0xfe , 0x00}, - - {0x0a , 0x00}, //row start - {0x0c , 0x00}, //col start - - {0x0d , 0x04}, - {0x0e , 0xc0}, - {0x0f , 0x06}, //Window setting - {0x10 , 0x58},// - - - - - {0x90 , 0x01}, - {0x95 , 0x01}, - {0x96 , 0xe0}, - {0x97 , 0x02}, - {0x98 , 0x80}, - {0xc8 , 0x15}, - - - - {0xfa , 0x00}, - - - {0xfe , 0x03}, - {0x42 , 0x04}, - {0x43 , 0x05}, //output buf width - {0x41 , 0x02}, // delay - {0x40 , 0x40}, //fifo half full trig - {0x17 , 0x00}, //widv is 0 - {0xfe , 0x00}, - {0xc8 , 0x55}, - {0xb6 , 0x03},//aec on {0x00 , 0x00}, - }; /* 352X288 CIF */ static struct reginfo sensor_cif[] = { - {0x0, 0x0}, + {0x00,0x00}, }; /* 320*240 QVGA */ @@ -1536,76 +883,80 @@ static struct reginfo sensor_qvga[] = { - {0x0, 0x0}, + {0x00,0x00}, }; /* 176X144 QCIF*/ static struct reginfo sensor_qcif[] = { - {0x0, 0x0}, + {0x00,0x00}, }; -#endif static struct reginfo sensor_ClrFmt_YUYV[]= { - {0x0, 0x0}, + {0x00,0x00}, }; static struct reginfo sensor_ClrFmt_UYVY[]= { - {0x0, 0x0}, + {0x00,0x00}, }; #if CONFIG_SENSOR_WhiteBalance static struct reginfo sensor_WhiteB_Auto[]= { - {0xb3, 0x61}, - {0xb4, 0x40}, - {0xb5, 0x61}, - {0x82, 0xfe}, - {0x0, 0x0}, + {0xfe, 0x00}, + {0xb3, 0x61}, + {0xb4, 0x40}, + {0xb5, 0x61}, + {0x82, 0xfe}, + {0x00,0x00}, }; /* Cloudy Colour Temperature : 6500K - 8000K */ static struct reginfo sensor_WhiteB_Cloudy[]= { - {0x82, 0xfc}, - {0xb3, 0x58}, - {0xb4, 0x40}, - {0xb5, 0x50}, - {0x0, 0x0}, + {0xfe, 0x00}, + {0x82, 0xfc}, + {0xb3, 0x58}, + {0xb4, 0x40}, + {0xb5, 0x50}, + {0x00,0x00}, }; /* ClearDay Colour Temperature : 5000K - 6500K */ static struct reginfo sensor_WhiteB_ClearDay[]= { //Sunny - {0x82, 0xfc}, - {0xb3, 0x58}, - {0xb4, 0x40}, - {0xb5, 0x50}, - {0x0, 0x0}, + {0xfe, 0x00}, + {0x82, 0xfc}, + {0xb3, 0x78}, + {0xb4, 0x40}, + {0xb5, 0x50}, + {0x00,0x00}, }; /* Office Colour Temperature : 3500K - 5000K */ static struct reginfo sensor_WhiteB_TungstenLamp1[]= { //Office - {0x82, 0xfc}, - {0xb3, 0x50}, - {0xb4, 0x40}, - {0xb5, 0xa8}, - {0x0, 0x0}, + {0xfe, 0x00}, + {0x82, 0xfc}, + {0xb3, 0x50}, + {0xb4, 0x40}, + {0xb5, 0xa8}, + {0x00,0x00}, }; /* Home Colour Temperature : 2500K - 3500K */ static struct reginfo sensor_WhiteB_TungstenLamp2[]= { //Home - {0x82, 0xfc}, - {0xb3, 0xa0}, - {0xb4, 0x45}, - {0xb5, 0x40}, - {0x0, 0x0}, + {0xfe, 0x00}, + {0x82, 0xfc}, + {0xb3, 0xa0}, + {0xb4, 0x45}, + {0xb5, 0x40}, + {0x00, 0x00}, }; static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, @@ -1618,7 +969,7 @@ static struct reginfo sensor_Brightness0[]= // Brightness -2 {0xfe, 0x01}, - {0x13, 0x40}, + {0x13, 0x70}, {0xfe, 0x02}, {0xd5, 0xe0}, {0x00, 0x00}, @@ -1629,7 +980,7 @@ static struct reginfo sensor_Brightness1[]= // Brightness -1 {0xfe, 0x01}, - {0x13, 0x48}, + {0x13, 0x78}, {0xfe, 0x02}, {0xd5, 0xf0}, {0x00, 0x00} @@ -1640,7 +991,7 @@ static struct reginfo sensor_Brightness2[]= // Brightness 0 {0xfe, 0x01}, - {0x13, 0x58}, + {0x13, 0x80}, {0xfe, 0x02}, {0xd5, 0x00}, {0x00, 0x00} @@ -1650,7 +1001,7 @@ static struct reginfo sensor_Brightness3[]= { // Brightness +1 {0xfe, 0x01}, - {0x13, 0x60}, + {0x13, 0x88}, {0xfe, 0x02}, {0xd5, 0x10}, {0x00, 0x00} @@ -1660,7 +1011,7 @@ static struct reginfo sensor_Brightness4[]= { // Brightness +2 {0xfe, 0x01}, - {0x13, 0x68}, + {0x13, 0x90}, {0xfe, 0x02}, {0xd5, 0x20}, {0x00, 0x00} @@ -1670,7 +1021,7 @@ static struct reginfo sensor_Brightness5[]= { // Brightness +3 {0xfe, 0x01}, - {0x13, 0x78}, + {0x13, 0x98}, {0xfe, 0x02}, {0xd5, 0x30}, @@ -1886,23 +1237,18 @@ static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,} static struct reginfo sensor_SceneAuto[] = { {0xfe,0x01}, - {0x3e,0x40}, {0xfe,0x00}, -{0x00, 0x00} +{0x00,0x00} }; static struct reginfo sensor_SceneNight[] = { - - - {0xfe,0x01}, - {0x3e,0x60}, {0xfe,0x00}, -{0x00, 0x00} +{0x00,0x00} }; static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; @@ -2164,10 +1510,8 @@ static const struct sensor_datafmt *sensor_find_datafmt( } static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG}, - - + {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, + {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} }; typedef struct sensor_info_priv_s @@ -2391,10 +1735,9 @@ static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd SENSOR_DG("%s %s cmd(%d) on(%d)\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd,on); switch (cmd) - { + { case Sensor_PowerDown: { - // honghaishen_test if (icl->powerdown) { ret = icl->powerdown(icd->pdev, on); if (ret == RK29_CAM_IO_SUCCESS) { @@ -2408,9 +1751,7 @@ static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd goto sensor_power_end; } } - break; - } case Sensor_Flash: { @@ -2491,6 +1832,10 @@ static int sensor_init(struct v4l2_subdev *sd, u32 val) } ret = sensor_write_array(client, sensor_init_data); + + + mdelay(300); + if (ret != 0) { @@ -2698,6 +2043,7 @@ static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefm SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); return ret; } +static unsigned int shutter_h,shutter_l; static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) { int ret1; @@ -2709,19 +2055,12 @@ static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) struct soc_camera_device *icd = client->dev.platform_data; struct reginfo *winseqe_set_addr=NULL; int ret=0, set_w,set_h; - - - ///////////////// #if 1 char value; unsigned int pid=0,shutter,temp_reg; #endif -////////////////// - - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); if (!fmt) { @@ -2822,42 +2161,35 @@ unsigned int pid=0,shutter,temp_reg; } } #endif + + if ((winseqe_set_addr == sensor_svga)||(winseqe_set_addr == sensor_vga) ) + { + sensor_write(client, 0xb6, 0x00); // AEC ON + sensor_write(client, 0x03, shutter_h); + sensor_write(client, 0x04, shutter_l); + msleep(50); + printk("set preview for rewrite 0x03"); + + } ret |= sensor_write_array(client, winseqe_set_addr); - msleep(200); #if 1 - if (winseqe_set_addr == sensor_uxga) { - - + if (winseqe_set_addr == sensor_uxga) + { sensor_write(client, 0xfe, 0x00); - sensor_write(client, 0xb6, 0x02); - - + sensor_write(client, 0xb6, 0x02); // AEC OFF sensor_read(client, 0x03, &value); + shutter_h=value; pid |= (value << 8); sensor_read(client, 0x04, &value); + shutter_l=value; pid |= (value & 0xff); shutter=pid; - - - temp_reg= shutter /2; // 2 - + temp_reg= shutter /2; if(temp_reg < 1) temp_reg = 1; - - sensor_write(client, 0x03, ((temp_reg>>8)&0xff)); - sensor_write(client, 0x04, (temp_reg&0xff)); - - - + sensor_write(client, 0x04, (temp_reg&0xff)); } - - - if ((winseqe_set_addr == sensor_svga)||(winseqe_set_addr == sensor_vga) ){ - mdelay(50);//200 - sensor_write(client, 0xB6, 0x03); - mdelay(300); - } -#endif //james +#endif if (ret != 0) { SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); @@ -2893,6 +2225,7 @@ unsigned int pid=0,shutter,temp_reg; sensor_set_effect(icd, qctrl,sensor->info_priv.effect); qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); + msleep(600); sensor->info_priv.video2preview = false; sensor->info_priv.snap2preview = false; } @@ -2906,8 +2239,7 @@ unsigned int pid=0,shutter,temp_reg; mf->width = set_w; mf->height = set_h; - msleep(100); - + msleep(100); //james added sensor_s_fmt_end: return ret; } @@ -3693,7 +3025,6 @@ static int sensor_video_probe(struct soc_camera_device *icd, /* soft reset */ /* check if it is an sensor sensor */ - #if 0 // honghaishen_test ret = sensor_read(client, 0xf0, &value); if (ret != 0) { SENSOR_TR("read chip id high byte failed\n"); @@ -3719,8 +3050,7 @@ static int sensor_video_probe(struct soc_camera_device *icd, ret = -ENODEV; goto sensor_video_probe_err; } -#endif -sensor->model = SENSOR_V4L2_IDENT; + return 0; sensor_video_probe_err: @@ -3933,3 +3263,5 @@ MODULE_AUTHOR("ddl "); MODULE_LICENSE("GPL"); + + diff --git a/drivers/media/video/sp2518.c b/drivers/media/video/sp2518.c index 09a103ece714..bd290d9ab5f5 100755 --- a/drivers/media/video/sp2518.c +++ b/drivers/media/video/sp2518.c @@ -1,13 +1,17 @@ /* -o* Driver for MT9M001 CMOS Image Sensor from Micron + * Driver for SP2518 CMOS Image Sensor from Superpix * * Copyright (C) 2008, Guennadi Liakhovetski * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. - */ +* +* History Author Data +* First Version yuanjianping 2012-09-20 +* Set P0:0x14 = 0x40 zengchaohui 2012-09-20 +*/ #include #include @@ -47,13 +51,13 @@ module_param(debug, int, S_IRUGO|S_IWUSR); #define SENSOR_V4L2_IDENT V4L2_IDENT_SP2518 #define SENSOR_ID 0x53 #define SENSOR_ID_REG 0x02 -#define SENSOR_MIN_WIDTH 640 -#define SENSOR_MIN_HEIGHT 480 +#define SENSOR_MIN_WIDTH 176//640 +#define SENSOR_MIN_HEIGHT 144//480 #define SENSOR_MAX_WIDTH 1600 #define SENSOR_MAX_HEIGHT 1200 #define SENSOR_INIT_WIDTH 800 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 600 -#define SENSOR_INIT_WINSEQADR sensor_vga +#define SENSOR_INIT_HEIGHT 600 +#define SENSOR_INIT_WINSEQADR sensor_svga #define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_YUYV8_2X8 #define CONFIG_SENSOR_WhiteBalance 1 @@ -96,14 +100,19 @@ module_param(debug, int, S_IRUGO|S_IWUSR); #define SENSOR_INIT_IS_OK (0x01<<28) //AE -#define SP2518_P0_0xf7 0x78///0x80//78 -#define SP2518_P0_0xf8 0x6e///0x74//6e -#define SP2518_P0_0xf9 0x74///0x80//74 -#define SP2518_P0_0xfa 0x6a///0x74//6a +#define SP2518_P0_0xf7 0x80//78 + +#define SP2518_P0_0xf8 0x74//6e + +#define SP2518_P0_0xf9 0x80//74 + +#define SP2518_P0_0xfa 0x74//6a //HEQ -#define SP2518_P0_0xdd 0x7c //0x80 modify by sp_yjp,20120814 -#define SP2518_P0_0xde 0x90 //0x95 modify by sp_yjp,20120814 + +#define SP2518_P0_0xdd 0x80 + +#define SP2518_P0_0xde 0x95 //auto lum #define SP2518_NORMAL_Y0ffset 0x10 //0x0f modify by sp_yjp,20120813 @@ -122,7 +131,6 @@ struct reginfo /* init 640X480 VGA */ static struct reginfo sensor_init_data[] = { - #if 1 {0xfd,0x00}, {0x1b,0x1a},//maximum drv ability //0x02 modify by sp_yjp,20120809 {0x0e,0x01}, @@ -131,7 +139,7 @@ static struct reginfo sensor_init_data[] = {0x10,0x2e}, {0x11,0x00}, {0x12,0x4f}, - {0x14,0x20}, + {0x14,0x40},// 0x20 zch 20120920 {0x16,0x02}, {0x17,0x10}, {0x1a,0x1f}, @@ -141,7 +149,7 @@ static struct reginfo sensor_init_data[] = {0x25,0x10}, {0x26,0x25}, {0x27,0x6d}, - {0x2c,0x31},//Ronlus remove balck dot0x45}, + {0x2c,0x23},//31 Ronlus remove balck dot0x45}, {0x2d,0x75}, {0x2e,0x38},//sxga 0x18 @@ -192,44 +200,7 @@ static struct reginfo sensor_init_data[] = {0x95,0x38}, {0x9c,0x6c}, {0x9d,0x38}, - - #if 0 - ///SP2518 UXGA 24MEclk 3±¶Æµ 1·ÖƵ 50Hz fix 11fps - {0xfd , 0x00}, - {0x03 , 0x03}, - {0x04 , 0xa8}, - {0x05 , 0x00}, - {0x06 , 0x6d}, - {0x07 , 0x00}, - {0x08 , 0x6d}, - {0x09 , 0x00}, - {0x0a , 0xe4}, - {0x2f , 0x00}, - {0x30 , 0x08}, - {0xf0 , 0x9c}, - {0xf1 , 0x00}, - {0xfd , 0x01}, - {0x90 , 0x09}, - {0x92 , 0x01}, - {0x98 , 0x9c}, - {0x99 , 0x00}, - {0x9a , 0x01}, - {0x9b , 0x00}, - ///Status - {0xfd , 0x01}, - {0xce , 0x7c}, - {0xcf , 0x05}, - {0xd0 , 0x7c}, - {0xd1 , 0x05}, - {0xd7 , 0x98}, - {0xd8 , 0x00}, - {0xd9 , 0x9c}, - {0xda , 0x00}, - {0xfd , 0x00}, - #endif - - #if 1 ///SP2518 UXGA 24MEclk 3±¶Æµ 1·ÖƵ 50Hz fix 10fps {0xfd , 0x00}, {0x03 , 0x03}, @@ -257,83 +228,47 @@ static struct reginfo sensor_init_data[] = {0xcf , 0x05}, {0xd0 , 0xaa}, {0xd1 , 0x05}, - {0xd7 , 0x8d}, - {0xd8 , 0x00}, - {0xd9 , 0x91}, - {0xda , 0x00}, - {0xfd , 0x00}, - #endif - - - #if 0 - /// UXGA 24MEclk 3±¶Æµ 1·ÖƵ 50Hz fix 9fps - {0xfd , 0x00}, - {0x03 , 0x03}, - {0x04 , 0x42}, - {0x05 , 0x00}, - {0x06 , 0xf0}, - {0x07 , 0x00}, - {0x08 , 0xf0}, - {0x09 , 0x01}, - {0x0a , 0x71}, - {0x2f , 0x00}, - {0x30 , 0x08}, - {0xf0 , 0x8b}, - {0xf1 , 0x00}, - {0xfd , 0x01}, - {0x90 , 0x0b}, - {0x92 , 0x01}, - {0x98 , 0x8b}, - {0x99 , 0x00}, - {0x9a , 0x01}, - {0x9b , 0x00}, - ///Status - {0xfd , 0x01}, - {0xce , 0xf9}, - {0xcf , 0x05}, - {0xd0 , 0xf9}, - {0xd1 , 0x05}, - {0xd7 , 0x87}, + {0xd7 , 0x93},//8d {0xd8 , 0x00}, - {0xd9 , 0x8b}, + {0xd9 , 0x97},//91 {0xda , 0x00}, {0xfd , 0x00}, #endif - #if 0 - /*24*3pll 8~13fps 50hz*/ - {0xfd , 0x00}, - {0x03 , 0x03}, - {0x04 , 0xf6}, - {0x05 , 0x00}, - {0x06 , 0x00}, - {0x07 , 0x00}, - {0x08 , 0x00}, - {0x09 , 0x00}, - {0x0a , 0x8b}, - ///////////////////SP2518_write_cmos_sensor(0x2f , 0x00}, modify by sp_yjp,20120809 - {0x30 , 0x08}, //0x08 modify by sp_yjp,20120809 - {0xf0 , 0xa9}, - {0xf1 , 0x00}, - {0xfd , 0x01}, - {0x90 , 0x0c}, - {0x92 , 0x01}, - {0x98 , 0xa9}, - {0x99 , 0x00}, - {0x9a , 0x01}, - {0x9b , 0x00}, - - //Status - {0xfd , 0x01}, - {0xce , 0xec}, - {0xcf , 0x07}, - {0xd0 , 0xec}, - {0xd1 , 0x07}, - {0xd7 , 0xa5}, - {0xd8 , 0x00}, - {0xd9 , 0xa9}, - {0xda , 0x00}, - {0xfd , 0x00}, + #if 1 + /*24*3pll 13-13fps 50hz*/ + + {0xfd,0x00}, + {0x03,0x03}, + {0x04,0xf6}, + {0x05,0x00}, + {0x06,0x00}, + {0x07,0x00}, + {0x08,0x00}, + {0x09,0x00}, + {0x0a,0x8b}, + {0x2f,0x00}, + {0x30,0x08}, + {0xf0,0xa9}, + {0xf1,0x00}, + {0xfd,0x01}, + {0x90,0x07}, + {0x92,0x01}, + {0x98,0xa9}, + {0x99,0x00}, + {0x9a,0x01}, + {0x9b,0x00}, + {0xfd,0x01}, + {0xce,0x9f}, + {0xcf,0x04}, + {0xd0,0x9f}, + {0xd1,0x04}, + {0xd7,0xa5}, + {0xd8,0x00}, + {0xd9,0xa9}, + {0xda,0x00}, + {0xfd,0x00}, + #endif {0xfd,0x01}, @@ -441,6 +376,11 @@ static struct reginfo sensor_init_data[] = {0x1a,0x80}, {0x1b,0x80}, {0x43,0x80}, + //outdoor + {0x00,0xd4}, + {0x01,0xb0}, + {0x02,0x90}, + {0x03,0x78}, //d65 {0x35,0xd6},//d6;b0 {0x36,0xf0},//f0;d1;e9 @@ -495,14 +435,14 @@ static struct reginfo sensor_init_data[] = {0xc0,0xb0}, {0xc1,0xf0}, - {0xd3,0x68}, //0x77 modify by sp_yjp,20120814 - {0xd4,0x68}, //0x77 modify by sp_yjp,20120814 - {0xd6,0x68}, //0x77 modify by sp_yjp,20120814 - {0xd7,0x68}, //0x77 modify by sp_yjp,20120814 - {0xd8,0x68}, //0x77 modify by sp_yjp,20120814 - {0xd9,0x68}, //0x77 modify by sp_yjp,20120814 - {0xda,0x68}, //0x77 modify by sp_yjp,20120814 - {0xdb,0x68}, //0x77 modify by sp_yjp,20120814 + {0xd3,0x77}, + {0xd4,0x77}, + {0xd6,0x77}, + {0xd7,0x77}, + {0xd8,0x77}, + {0xd9,0x77}, + {0xda,0x77}, + {0xdb,0x77}, //uv_dif {0xfd,0x00}, {0xf3,0x03}, @@ -551,6 +491,51 @@ static struct reginfo sensor_init_data[] = {0x88,0xEF},//f1 {0x89,0xF7},//f9 {0x8a,0xFF},//ff + /*//¹â°ß¹ý¶ÈºÃ + //gamma1 + {0xfd,0x00}, + {0x8b,0x00}, + {0x8c,0x14}, + {0x8d,0x24}, + {0x8e,0x3A}, + {0x8f,0x59}, + {0x90,0x70}, + {0x91,0x85}, + {0x92,0x96}, + {0x93,0xA6}, + {0x94,0xB3}, + {0x95,0xBE}, + {0x96,0xC9}, + {0x97,0xD2}, + {0x98,0xDB}, + {0x99,0xE3}, + {0x9a,0xEB}, + {0x9b,0xF2}, + {0xfd,0x01}, + {0x8d,0xF9}, + {0x8e,0xFF}, + //gamma2 + {0xfd,0x00}, + {0x78,0x00}, + {0x79,0x14}, + {0x7a,0x24}, + {0x7b,0x3A}, + {0x7c,0x59}, + {0x7d,0x70}, + {0x7e,0x85}, + {0x7f,0x96}, + {0x80,0xA6}, + {0x81,0xB3}, + {0x82,0xBE}, + {0x83,0xC9}, + {0x84,0xD2}, + {0x85,0xDB}, + {0x86,0xE3}, + {0x87,0xEB}, + {0x88,0xF2}, + {0x89,0xF9}, + {0x8a,0xFF}, +*/ //gamma_ae {0xfd,0x01}, {0x96,0x46}, @@ -614,12 +599,13 @@ static struct reginfo sensor_init_data[] = {0x35,0x40},//3 - {0x1b,0x02}, + {0x1b,0x1a}, {0xe7,0x03}, {0xe7,0x00}, //SP2518_config_window(WINDOW_SIZE_VGA} - #if 1 + #if 1 // + /* {0xfd,0x00}, {0x4b,0x00}, {0x4c,0x00}, @@ -640,18 +626,36 @@ static struct reginfo sensor_init_data[] = {0x0c,0x02}, //640 {0x0d,0x80}, {0x0e,0x01}, - {0xfd,0x00}, - #else {0xfd,0x00}, - {0x4b,0x00}, - {0x4c,0x00}, + */ + #else //uxga + {0xfd,0x00}, {0x47,0x00}, {0x48,0x00}, + {0x49,0x04}, + {0x4a,0xb0}, + + {0x4b,0x00}, + {0x4c,0x00}, {0x4d,0x06}, - {0x4e,0x40}, + {0x4e,0x40}, + + {0xfd,0x01}, + {0x0e,0x00}, + {0xfd,0x00}, + #endif + //SVGA + {0xfd,0x00}, + + {0x47,0x00}, + {0x48,0x00}, {0x49,0x04}, {0x4a,0xb0}, + {0x4b,0x00}, + {0x4c,0x00}, + {0x4d,0x06}, + {0x4e,0x40}, {0xfd,0x01}, {0x06,0x00}, {0x07,0x40}, @@ -661,12 +665,11 @@ static struct reginfo sensor_init_data[] = {0x0b,0x58}, {0x0c,0x03}, //800 {0x0d,0x20}, - {0x0e,0x01}, - #endif - #endif + {0xfd,0x00}, - {0x5d,0x0e}, + + {0x5d,0x0e}, //vsync delay {0xff,0xff}//The end flag }; @@ -687,9 +690,7 @@ static struct reginfo sensor_uxga[] = {0xfd,0x01}, {0x0e,0x00}, - {0xfd,0x00}, - {0xfd,0x00}, - + {0xfd,0x00}, {0xff,0xff}//The end flag }; @@ -697,6 +698,7 @@ static struct reginfo sensor_uxga[] = /* 1280X1024 SXGA */ static struct reginfo sensor_sxga[] = { +#if 0 {0xfd,0x00}, {0x47,0x00}, {0x48,0x50}, @@ -711,12 +713,13 @@ static struct reginfo sensor_sxga[] = {0xfd,0x01}, {0x0e,0x00}, {0xfd,0x00}, +#endif {0xff,0xff} }; /* 800X600 SVGA*/ static struct reginfo sensor_svga[] = -{ +{ {0xfd,0x00}, {0x47,0x00}, @@ -739,13 +742,13 @@ static struct reginfo sensor_svga[] = {0x0d,0x20}, {0x0e,0x01}, {0xfd,0x00}, - {0xff,0xff}//The end flag }; /* 640X480 VGA */ static struct reginfo sensor_vga[] = { +#if 0 {0xfd,0x00}, {0x47,0x00}, @@ -769,7 +772,7 @@ static struct reginfo sensor_vga[] = {0x0d,0x80}, {0x0e,0x01}, {0xfd,0x00}, - +#endif {0xff,0xff}//The end flag @@ -779,13 +782,13 @@ static struct reginfo sensor_vga[] = /* 352X288 CIF */ static struct reginfo sensor_cif[] = { - {0x00, 0x00}, - //{0xff,0xff} + {0xfd, 0x00},{0xff,0xff} }; /* 320*240 QVGA */ static struct reginfo sensor_qvga[] = { +#if 0 {0xfd,0x00}, {0x47,0x00}, @@ -811,24 +814,27 @@ static struct reginfo sensor_qvga[] = {0x0e,0x01}, {0xfd,0x00}, - +#endif {0xff,0xff}//The end flag }; /* 176X144 QCIF*/ static struct reginfo sensor_qcif[] = { - {0x00, 0x00}//,{0xff,0xff} + //{0xfd, 0x00}, + {0xff,0xff} }; static struct reginfo sensor_ClrFmt_YUYV[]= { - {0xfd, 0x00},{0xff,0xff} + //{0xfd, 0x00}, + {0xff,0xff} }; static struct reginfo sensor_ClrFmt_UYVY[]= { - {0xfd, 0x00},{0xff,0xff} + //{0xfd, 0x00}, + {0xff,0xff} }; ///=========SP2518-modify by sp_yjp,20120529================= @@ -919,7 +925,6 @@ static struct reginfo sensor_Brightness2[]= { {0xfd, 0x00}, {0xdc, 0x00}, - {0xfd, 0x00}, {0xff, 0xff} }; @@ -1277,36 +1282,39 @@ static struct reginfo sensor_SceneAuto[] = {0xb2,SP2518_NORMAL_Y0ffset}, {0xb3,0x1f}, - ///SP2518 UXGA 24MEclk 3PLL 50Hz fix 10fps - {0xfd , 0x00}, - {0x03 , 0x03}, - {0x04 , 0x66}, - {0x05 , 0x00}, - {0x06 , 0x8b}, - {0x07 , 0x00}, - {0x08 , 0x8b}, - {0x09 , 0x01}, - {0x0a , 0x3b}, - {0xf0 , 0x91}, - {0xf1 , 0x00}, - {0xfd , 0x01}, - {0x90 , 0x0a}, - {0x92 , 0x01}, - {0x98 , 0x91}, - {0x99 , 0x00}, - {0x9a , 0x01}, - {0x9b , 0x00}, - ///Status - {0xfd , 0x01}, - {0xce , 0xaa}, - {0xcf , 0x05}, - {0xd0 , 0xaa}, - {0xd1 , 0x05}, - {0xd7 , 0x8d}, - {0xd8 , 0x00}, - {0xd9 , 0x91}, - {0xda , 0x00}, - {0xfd , 0x00}, + //SP2518 UXGA 24MEclk 3PLL 50Hz fix13fps + + {0xfd,0x00}, + {0x03,0x03}, + {0x04,0xf6}, + {0x05,0x00}, + {0x06,0x00}, + {0x07,0x00}, + {0x08,0x00}, + {0x09,0x00}, + {0x0a,0x8b}, + {0x2f,0x00}, + {0x30,0x08}, + {0xf0,0xa9}, + {0xf1,0x00}, + {0xfd,0x01}, + {0x90,0x07}, + {0x92,0x01}, + {0x98,0xa9}, + {0x99,0x00}, + {0x9a,0x01}, + {0x9b,0x00}, + {0xfd,0x01}, + {0xce,0x9f}, + {0xcf,0x04}, + {0xd0,0x9f}, + {0xd1,0x04}, + {0xd7,0xa5}, + {0xd8,0x00}, + {0xd9,0xa9}, + {0xda,0x00}, + {0xfd,0x00}, + #endif {0xfd, 0x00}, @@ -1345,9 +1353,9 @@ static struct reginfo sensor_SceneNight[] = {0xcf , 0x05}, {0xd0 , 0x50}, {0xd1 , 0x05}, - {0xd7 , 0x51}, + {0xd7 , 0x57},//51 {0xd8 , 0x00}, - {0xd9 , 0x55}, + {0xd9 , 0x5b},//55 {0xda , 0x00}, #endif @@ -1783,11 +1791,13 @@ static int sensor_read(struct i2c_client *client, u8 reg, u8 *val) } /* write a array of registers */ +#if 1 static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) { int err; int i = 0; + //for(i=0; i < sizeof(sensor_init_data) / 2;i++) while((regarray[i].reg != 0xff) || (regarray[i].val != 0xff)) { err = sensor_write(client, regarray[i].reg, regarray[i].val); @@ -1801,28 +1811,51 @@ static int sensor_write_array(struct i2c_client *client, struct reginfo *regarra return 0; } -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_check_array(struct i2c_client *client, struct reginfo *regarray) +#else +static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) { - int ret; + int err; int i = 0; - - u8 value; - - while((regarray[i].reg != 0xff) || (regarray[i].val != 0xff)) + u8 val_read; + while (regarray[i].reg != 0) { - ret = sensor_read(client,regarray[i].reg,&value); - if(ret !=0) - { - SENSOR_TR("read value failed\n"); - - } - if(regarray[i].val != value) + err = sensor_write(client, regarray[i].reg, regarray[i].val); + if (err != 0) { - SENSOR_DG("%s reg[0x%x] check err,writte :0x%x read:0x%x\n",__FUNCTION__,regarray[i].reg,regarray[i].val,value); + SENSOR_TR("%s..write failed current i = %d\n", SENSOR_NAME_STRING(),i); + return err; } - + err = sensor_read(client, regarray[i].reg, &val_read); + SENSOR_TR("%s..reg[0x%x]=0x%x,0x%x\n", SENSOR_NAME_STRING(),regarray[i].reg, val_read, regarray[i].val); + i++; } + return 0; +} +#endif + +#if CONFIG_SENSOR_I2C_RDWRCHK +static int sensor_check_array(struct i2c_client *client, struct reginfo *regarray) +{ + int ret; + int i = 0; + + u8 value; + + SENSOR_DG("%s >>>>>>>>>>>>>>>>>>>>>>\n",__FUNCTION__); + for(i=0;ipowerdown(icd->pdev, on); if (ret == RK29_CAM_IO_SUCCESS) { if (on == 0) { - mdelay(2); + mdelay(20); // 2 modify by sp_yjp,20120831 if (icl->reset) icl->reset(icd->pdev); + mdelay(50); // add by sp_yjp,20120831 } } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { ret = -ENODEV; @@ -2008,8 +2042,7 @@ static int sensor_deactivate(struct i2c_client *client) } static struct reginfo sensor_power_down_sequence[]= { - {0xfd,0x00}, - {0xff,0xff} + {0xfd,0x00},{0xff,0xff} }; static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) { @@ -2162,43 +2195,53 @@ static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) set_w = mf->width; set_h = mf->height; - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) + if (((set_w <= 176) && (set_h <= 144)) && (sensor_qcif[0].reg!=0xff)) { winseqe_set_addr = sensor_qcif; set_w = 176; set_h = 144; } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) + else if (((set_w <= 320) && (set_h <= 240)) && (sensor_qvga[0].reg!=0xff)) { winseqe_set_addr = sensor_qvga; set_w = 320; set_h = 240; } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) + else if (((set_w <= 352) && (set_h<= 288)) && (sensor_cif[0].reg!=0xff)) { winseqe_set_addr = sensor_cif; set_w = 352; set_h = 288; } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) + else if (((set_w <= 640) && (set_h <= 480)) && (sensor_vga[0].reg!=0xff)) { winseqe_set_addr = sensor_vga; - set_w = 640-16; - set_h = 480-16; + set_w = 640; + set_h = 480; } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) + else if (((set_w <= 800) && (set_h <= 600))) { - winseqe_set_addr = sensor_svga; - set_w = 800; - set_h = 600; + if (sensor_svga[0].reg!=0xff) { + winseqe_set_addr = sensor_svga; + set_w = 800-16; + set_h = 600-12; + } else if (sensor_vga[0].reg!=0xff) { + winseqe_set_addr = sensor_vga; + set_w = 640-16; + set_h = 480-12; + } else if (sensor_uxga[0].reg!=0xff) { + winseqe_set_addr = sensor_uxga; + set_w = 1600-16; + set_h = 1200-12; + } } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) + else if (((set_w <= 1280) && (set_h <= 1024)) && (sensor_sxga[0].reg!=0xff)) { winseqe_set_addr = sensor_sxga; set_w = 1280; set_h = 1024; } - else if (((set_w <= 1600) && (set_h <= 1200)) && sensor_uxga[0].reg) + else if (((set_w <= 1600) && (set_h <= 1200)) && (sensor_uxga[0].reg!=0xff)) { winseqe_set_addr = sensor_uxga; set_w = 1600; @@ -2211,7 +2254,12 @@ static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) set_h = SENSOR_INIT_HEIGHT; SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); } + printk("%s(%d): %dx%d -> %dx%d\n",__FUNCTION__,__LINE__, mf->width,mf->height,set_w,set_h); + printk("win: %p %p %p %p %p %p\n",winseqe_set_addr,sensor->info_priv.winseqe_cur_addr, + sensor_uxga,sensor_svga,sensor_vga,sensor_sxga); + + if ((int)winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) { #if CONFIG_SENSOR_Flash if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ @@ -2304,40 +2352,54 @@ static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) else if (mf->width < SENSOR_MIN_WIDTH) mf->width = SENSOR_MIN_WIDTH; + + if ((mf->width == 320) && (mf->height == 240)) { + printk("%s(%d): qvga ERROR\n",__FUNCTION__,__LINE__); + return -1; + } set_w = mf->width; set_h = mf->height; - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) + if (((set_w <= 176) && (set_h <= 144)) && (sensor_qcif[0].reg!=0xff)) { set_w = 176; set_h = 144; } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) + else if (((set_w == 320) && (set_h == 240)))// && (sensor_qvga[0].reg!=0xff)) { set_w = 320; set_h = 240; + ret = -1; } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) + else if (((set_w <= 352) && (set_h<= 288)) && (sensor_cif[0].reg!=0xff)) { set_w = 352; set_h = 288; } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) + else if (((set_w <= 640) && (set_h <= 480)) && (sensor_vga[0].reg!=0xff)) { set_w = 640; set_h = 480; } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) + else if (((set_w <= 800) && (set_h <= 600))) { - set_w = 800; - set_h = 600; + if (sensor_svga[0].reg!=0xff) { + set_w = 800-16; + set_h = 600-12; + } else if (sensor_vga[0].reg!=0xff) { + set_w = 640-16; + set_h = 480-12; + } else if (sensor_uxga[0].reg!=0xff) { + set_w = 1600-16; + set_h = 1200-12; + } } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) + else if (((set_w <= 1280) && (set_h <= 1024)) && (sensor_sxga[0].reg!=0xff)) { set_w = 1280; set_h = 1024; } - else if (((set_w <= 1600) && (set_h <= 1200)) && sensor_uxga[0].reg) + else if (((set_w <= 1600) && (set_h <= 1200)) && (sensor_uxga[0].reg!=0xff)) { set_w = 1600; set_h = 1200; @@ -3068,9 +3130,10 @@ static int sensor_video_probe(struct soc_camera_device *icd, ret = -ENODEV; goto sensor_video_probe_err; } - msleep(100); + msleep(10); /* check if it is an sensor sensor */ + ////////ret = sensor_read(client, 0x00, &pid); ret = sensor_read(client, SENSOR_ID_REG, &pid); if (ret != 0) { SENSOR_TR("%s read chip id high byte failed\n",SENSOR_NAME_STRING()); @@ -3079,7 +3142,7 @@ static int sensor_video_probe(struct soc_camera_device *icd, } SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - +#if 1 if (pid == SENSOR_ID) { sensor->model = SENSOR_V4L2_IDENT; } else { @@ -3087,6 +3150,10 @@ static int sensor_video_probe(struct soc_camera_device *icd, ret = -ENODEV; goto sensor_video_probe_err; } +#else + sensor->model = SENSOR_V4L2_IDENT; + +#endif return 0; sensor_video_probe_err: @@ -3275,7 +3342,12 @@ static struct i2c_driver sensor_i2c_driver = { static int __init sensor_mod_init(void) { + printk("\n*****************%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); +#ifdef CONFIG_SOC_CAMERA_FCAM + return 0; +#else return i2c_add_driver(&sensor_i2c_driver); +#endif } static void __exit sensor_mod_exit(void) @@ -3289,5 +3361,29 @@ module_exit(sensor_mod_exit); MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); MODULE_AUTHOR("ddl "); MODULE_LICENSE("GPL"); +/* +struct cam_sensor_info cam_sensor_info_SP2518={ + "SP2518", + 1, + 1, + 0x30>>1, + 0, + SENSOR_ID_REG, + SENSOR_ID, + 0xff, + 0xff, + + &sensor_ops, + &sensor_subdev_ops, + sensor_deactivate, + sensor_read, + sensor_write, + 0, + sensor_video_probe, +}; + +EXPORT_SYMBOL_GPL(cam_sensor_info_SP2518); +*/ + -- 2.34.1