From 871480933a1c28f8a9fed4c4d34d06c439a7a422 Mon Sep 17 00:00:00 2001 From: Srikant Patnaik Date: Sun, 11 Jan 2015 12:28:04 +0530 Subject: Moved, renamed, and deleted files The original directory structure was scattered and unorganized. Changes are basically to make it look like kernel structure. --- .../wmt_v4l2/sensors/siv121d/siv121d-kyt-093-du.h | 1128 ++++++++++++++++++++ .../media/video/wmt_v4l2/sensors/siv121d/siv121d.c | 337 ++++++ .../media/video/wmt_v4l2/sensors/siv121d/siv121d.h | 1128 ++++++++++++++++++++ 3 files changed, 2593 insertions(+) create mode 100755 drivers/media/video/wmt_v4l2/sensors/siv121d/siv121d-kyt-093-du.h create mode 100755 drivers/media/video/wmt_v4l2/sensors/siv121d/siv121d.c create mode 100755 drivers/media/video/wmt_v4l2/sensors/siv121d/siv121d.h (limited to 'drivers/media/video/wmt_v4l2/sensors/siv121d') diff --git a/drivers/media/video/wmt_v4l2/sensors/siv121d/siv121d-kyt-093-du.h b/drivers/media/video/wmt_v4l2/sensors/siv121d/siv121d-kyt-093-du.h new file mode 100755 index 00000000..2d83463c --- /dev/null +++ b/drivers/media/video/wmt_v4l2/sensors/siv121d/siv121d-kyt-093-du.h @@ -0,0 +1,1128 @@ +#ifndef SIV121D_H +#define SIV121D_H + + +// Scene Mode +uint8_t siv121d_scene_mode_auto[] = { + 0x00,0x02, + 0x11,0x10, + 0x40,0x40, +}; + +uint8_t siv121d_scene_mode_night[] = { + 0x00,0x02, + 0x11,0x18, + 0x40,0x60, +}; + + +// White Balance +uint8_t siv121d_wb_auto [] = { + 0x00,0x03, + 0x10,0xd0, + //0x60,0xC5, + //0x61,0x95, +}; + +uint8_t siv121d_wb_incandescent [] = { + 0x00,0x03, + 0x10,0x00, + 0x60,0x80, + 0x61,0xE0, +}; + +uint8_t siv121d_wb_fluorescent [] = { + 0x00,0x03, + 0x10,0x00, + 0x60,0xB8, + 0x61,0xCC, +}; + +uint8_t siv121d_wb_daylight [] = { + 0x00,0x03, + 0x10,0x00, + 0x60,0xD8, + 0x61,0x90, +}; + +uint8_t siv121d_wb_cloudy [] = { + 0x00,0x03, + 0x10,0x00, + 0x60,0xB4, + 0x61,0x90, +}; + +uint8_t siv121d_wb_tungsten [] = { + 0x00,0x03, + 0x10,0x00, + 0x60,0x7B, + 0x61,0xa0, +}; + + +// Exposure +uint8_t siv121d_exposure_neg6[] = { + 0x00,0x04, + 0xAB,0xa8, +}; + +uint8_t siv121d_exposure_neg3[] = { + 0x00,0x04, + 0xAB,0x90, +}; + +uint8_t siv121d_exposure_zero[] = { + 0x00,0x04, + 0xAB,0x00, +}; + +uint8_t siv121d_exposure_pos3[] = { + 0x00,0x04, + 0xAB,0x18, +}; + +uint8_t siv121d_exposure_pos6[] = { + 0x00,0x04, + 0xAB,0x30, +}; + +// Color Effect +uint8_t siv121d_colorfx_none[] = { + 0x00,0x04, + 0xB6,0x00, +}; + +uint8_t siv121d_colorfx_bw[] = { + 0x00,0x04, + 0xB6,0x40, +}; + +uint8_t siv121d_colorfx_sepia[] = { + 0x00,0x04, + 0xB6,0x80, + 0xB7,0x60, + 0xB8,0xA0, +}; + +uint8_t siv121d_colorfx_negative[] = { + 0x00,0x04, + 0xB6,0x20, + +}; + +uint8_t siv121d_colorfx_emboss[] = { + 0x00,0x04, + 0xB6,0x08, + 0xB7,0x00, + 0xB8,0x00, +}; + +uint8_t siv121d_colorfx_sketch[] = { + 0x00,0x04, + 0xB6,0x04, + 0xB7,0x00, + 0xB8,0x00, +}; + +uint8_t siv121d_colorfx_sky_blue[] = { + 0x00,0x04, + 0xB6,0xa0, + 0xB7,0xc0, + 0xB8,0x50, +}; + +uint8_t siv121d_colorfx_grass_green[] = { + 0x00,0x04, + 0xB6,0x80, + 0xB7,0x50, + 0xB8,0x50, +}; + +uint8_t siv121d_colorfx_skin_whiten[] = { +}; + +uint8_t sensor_colorfx_vivid[] = { +}; + +// Brightness +uint8_t sensor_brightness_neg4[] = { + 0x00,0x04, + 0xAB,0xC0, +}; + +uint8_t sensor_brightness_neg3[] = { + 0x00,0x04, + 0xAB,0xB0, +}; + +uint8_t sensor_brightness_neg2[] = { + 0x00,0x04, + 0xAB,0xA0, +}; + +uint8_t sensor_brightness_neg1[] = { + 0x00,0x04, + 0xAB,0x90, +}; + +uint8_t sensor_brightness_zero[] = { + 0x00,0x04, + 0xAB,0x00, +}; + +uint8_t sensor_brightness_pos1[] = { + 0x00,0x04, + 0xAB,0x10, +}; + +uint8_t sensor_brightness_pos2[] = { + 0x00,0x04, + 0xAB,0x20, +}; + +uint8_t sensor_brightness_pos3[] = { + 0x00,0x04, + 0xAB,0x30, +}; + +uint8_t sensor_brightness_pos4[] = { + 0x00,0x04, + 0xAB,0x40, +}; + + +// Contrast +uint8_t sensor_contrast_neg4[] = { + 0x00,0x04, + 0xA8,0x0D, + +}; + +uint8_t sensor_contrast_neg3[] = { + 0x00,0x04, + 0xA8,0x0E, +}; + +uint8_t sensor_contrast_neg2[] = { + 0x00,0x04, + 0xA8,0x0F, +}; + +uint8_t sensor_contrast_neg1[] = { + 0x00,0x04, + 0xA8,0x10, +}; + +uint8_t sensor_contrast_zero[] = { + 0x00,0x04, + 0xA8,0x10, +}; + +uint8_t sensor_contrast_pos1[] = { + 0x00,0x04, + 0xA8,0x12, +}; + +uint8_t sensor_contrast_pos2[] = { + 0x00,0x04, + 0xA8,0x13, +}; + +uint8_t sensor_contrast_pos3[] = { + 0x00,0x04, + 0xA8,0x14, +}; + +uint8_t sensor_contrast_pos4[] = { + 0x00,0x04, + 0xA8,0x15, +}; + +// Saturation +uint8_t sensor_saturation_neg4[] = { +}; + +uint8_t sensor_saturation_neg3[] = { +}; + +uint8_t sensor_saturation_neg2[] = { +}; + +uint8_t sensor_saturation_neg1[] = { +}; + +uint8_t sensor_saturation_zero[] = { +}; + +uint8_t sensor_saturation_pos1[] = { +}; + +uint8_t sensor_saturation_pos2[] = { +}; + +uint8_t sensor_saturation_pos3[] = { +}; + +uint8_t sensor_saturation_pos4[] = { +}; + + +// Resolution +uint8_t siv121d_320_240_regs[]={ + 0x00,0x01, + 0x06,0x06, + 0x00,0x04, + 0xc0,0x10, + 0xc1,0x00, + 0xc2,0x40, + 0xc3,0x00, + 0xc4,0xf0, +}; + +uint8_t siv121d_640_480_regs[]={ + 0x00,0x01, + 0x06,0x04, + 0x00,0x04, + 0xc0,0x24, + 0xc1,0x00, + 0xc2,0x80, + 0xc3,0x00, + 0xc4,0xe0, +}; + +uint8_t siv121d_default_regs_init_121d[]={ +#if 1 + 0x00 ,0x00 , + 0x00 ,0x01 , + 0x03 ,0x0a , + + 0x00 ,0x01 , + 0x03 ,0x0a , + + 0x00 ,0x00 , + 0x03 ,0x04 , + 0x10 ,0x85 , //85 + 0x11 ,0x74 , //0x11 0x61 davis20120514 + + 0x00 ,0x01 , + 0x04 ,0x00 , //00 + 0x06 ,0x04 , + 0x10 ,0x46 , + 0x11 ,0x23 , + 0x12 ,0x21 , + 0x17 ,0x86 , + 0x18 ,0x00 , + 0x20 ,0x00 , + 0x21 ,0x05 , + 0x22 ,0x01 , + 0x23 ,0x69 , //add + 0x40 ,0x0F , + 0x41 ,0x90 , + 0x42 ,0xd2 , + 0x43 ,0x00 , + + // AE + 0x00 ,0x02 , + 0x10 ,0x80 , + 0x11 ,0x10 , + 0x12 ,0x65 , // D65 target 60 + 0x14 ,0x62 , // A target 5 + 0x34 ,0x96 , + 0x40 ,0x40 , // 40 + 0x5f ,0x01 , + 0x41 ,0x28 ,//20 , + 0x42 ,0x28 ,//20 , + 0x44 ,0x08 ,//00 , + 0x45 ,0x08 ,//00 , + 0x46 ,0x15 ,//0a , + 0x47 ,0x1c ,//10 , + 0x48 ,0x20 ,//13 , + 0x49 ,0x21 ,//15 , + 0x4a ,0x23 ,//18 , + 0x4b ,0x24 ,//1a , + 0x4c ,0x25 ,//1d , + 0x4d ,0x28 ,//20 , + 0x4e ,0x1c ,//10 , + 0x4f ,0x15 ,//0a , + + 0x50 ,0x10 ,//08 , + 0x51 ,0x10 ,//06 , + 0x52 ,0x0e ,//05 , + 0x53 ,0x0c ,//04 , + 0x54 ,0x0b ,//02 , + 0x55 ,0x0a ,//01 , + 0x90 ,0x80 , + 0x91 ,0x80 , + + // AWB + 0x00 ,0x03 , + 0x10 ,0xd0 , // + 0x11 ,0xc0 ,//c0 + 0x13 ,0x81 , //Cr target + 0x14 ,0x7d , //Cb target 7d + 0x15 ,0xc0 , // R gain Top e0 + 0x16 ,0x8c , // R gain bottom 8c // + 0x17 ,0xe0 , // B gain Top e0 + 0x18 ,0x70 , // B gain bottom 0x80 // + 0x19 ,0x8c , // Cr top value 8c // + 0x1a ,0x64 , // Cr bottom value 0x64 60 //YCbYCr + 0x1b ,0x98 , // Cb top value 0x98 + 0x1c ,0x6c , // Cb bottom value 0x6c // 0x01 + 0x1d ,0x94 , // 0xa0 + 0x1e ,0x6c , // 0x60 + 0x20 ,0xe8 , // AWB luminous top value + 0x21 ,0x30 , // AWB luminous bottom value 0x20 + 0x22 ,0xb8 , + 0x23 ,0x10 , + 0x25 ,0x20 , + 0x26 ,0x0f , + 0x27 ,0x08 , // BRTSRT + 0x28 ,0x0f , // BRTEND + 0x29 ,0xba , // BRTRGNBOT + 0x2a ,0xa0 , // BRTBGNTOP + + 0x40 ,0x01 , + 0x41 ,0x04 , + 0x42 ,0x08 , + 0x43 ,0x10 , + 0x44 ,0x12 , // 0x12 + 0x45 ,0x35 , //35 + 0x46 ,0xfc , // fc + 0x62 ,0x84 , //84 // + 0x63 ,0x90 , // R D30 to D20 + 0x64 ,0xd0 , // B D30 to D20 + 0x65 ,0x90 , // R D20 to D30 + 0x66 ,0xd0 , // B D20 to D30 + + // IDP + 0x00 ,0x04 , + 0x10 ,0xff , + // 0x11 ,0x1d , + 0x11 ,0x1d , //zhongwei changed + 0x12 ,0x3d ,//zhongwei++ + + + // DPCBNR + 0x18 ,0xbe ,//fe , // DPCNRCTRL + 0x19 ,0x00 ,//04 , // DPCTHV + 0x1A ,0x00 ,//01 , // DPCTHVSLP + 0x1B ,0x00 ,//08 , // DPCTHVDIFSRT + 0x1C ,0x0f ,//08 , // DPCTHVDIFSLP + 0x1d ,0xFF , // DPCTHVMAX + + 0x1E ,0x04 , // BNRTHV 0c + 0x1F ,0x04 , // BNRTHVSLPN 10 + 0x20 ,0x10 , // BNRTHVSLPD + 0x21 ,0x00 , /// BNRNEICNT / 0x08 + 0x22 ,0x10 , // STRTNOR // 0x03 + 0x23 ,0x40 , // STRTDRK + + // Gamma + 0x31 ,0x08 ,//0x080x31, 0x04 },//0x08 0x03 + 0x32 ,0x12 ,//0x100x32, 0x0b },//0x10 0x08 + 0x33 ,0x24 ,//0x1B0x33, 0x24 },//0x1B 0x16 + 0x34 ,0x47 ,//0x370x34, 0x49 },//0x37 0x36 + 0x35 ,0x64 ,//0x4D0x35, 0x66 },//0x4D 0x56 + 0x36 ,0x7c ,//0x600x36, 0x7C },//0x60 0x77 + 0x37 ,0x8f ,//0x720x37, 0x8D },//0x72 0x88 + 0x38 ,0x9f ,//0x820x38, 0x9B },//0x82 0x9a + 0x39 ,0xad ,//0x910x39, 0xAA },//0x91 0xA9 + 0x3a ,0xba ,//0xA00x3a, 0xb6 },//0xA0 0xb5 + 0x3b ,0xcf ,//0xBA0x3b, 0xca },//0xBA 0xca + 0x3c ,0xe2 ,//0xD30x3c, 0xdc },//0xD3 0xdd + 0x3d ,0xf0 ,//0xEA0x3d, 0xef },//0xEA 0xee + + // Shading Register Setting + 0x40 ,0x04 , //06 + 0x41 ,0x44 , + 0x42 ,0x43 , + 0x43 ,0x20 , + 0x44 ,0x11 , // left R gain[7:4], right R gain[3:0] 22 + 0x45 ,0x11 , // top R gain[7:4], bottom R gain[3:0] 22 + 0x46 ,0x00 , // left G gain[7:4], right G gain[3:0] + 0x47 ,0x00 , // top G gain[7:4], bottom G gain[3:0] 11 + 0x48 ,0x00 , // left B gain[7:4], right B gain[3:0] + 0x49 ,0x00 , // top B gain[7:4], bottom B gain[3:0] //color matrix default + 0x4a ,0x04 , // X-axis center high[3:2], Y-axis center high[1:0] + 0x4b ,0x60 , // X-axis center low[7:0] 48 + 0x4c ,0xe0 , // Y-axis center low[7:0] e8 + 0x4d ,0x88 , // Shading Center Gain 80 + 0x4e ,0x00 , // Shading R Offset + 0x4f ,0x00 , // Shading Gr Offset + 0x50 ,0x00 , // Shading B Offset + + + // Interpolation + 0x60 ,0x7f , + 0x61 ,0x08 , + + // Color matrix (D65) - Daylight + 0x71 ,0x34 , //0x34 0x39 + 0x72 ,0xCe , //0xCe 0xCc + 0x73 ,0xFe , //0xFe 0xFb + 0x74 ,0x13 , //0x13 0x10 + 0x75 ,0x25 , //0x25 0x21 + 0x76 ,0x08 , //0x08 0x0f + 0x77 ,0xec , //0xec 0xf8 + 0x78 ,0xd1 , //0xd1 0xc0 + 0x79 ,0x47 , //0x47 0x48 + + // Color matrix (D20) - A + 0x83 ,0x38 , //0x3c + 0x84 ,0xd1 , //0xc6 + 0x85 ,0xf7 , //0xff + 0x86 ,0x12 , //0x12 + 0x87 ,0x25 , //0x24 + 0x88 ,0x09 , //0x0a + 0x89 ,0xe1 , //0xed + 0x8a ,0xc7 , //0xc2 + 0x8b ,0x58 , //0x51 + + 0x8c ,0x10 , //CMA select + + //G Edge + 0x90 ,0x20 , //Upper gain + 0x91 ,0x40 , //down gain + 0x92 ,0x44 , //[7:4] upper coring [3:0] down coring + 0x9a ,0x40 , + 0x9b ,0x40 , + 0x9c ,0x38 , //edge suppress start 30 + 0x9d ,0x30 , //edge suppress slope + 0xa8 ,0x10 , + 0xa9 ,0x13 , + 0xaa ,0x13 , + 0xb9 ,0x30 , // nightmode 38 at gain 0x48 5fps + 0xba ,0x44 , // nightmode 80 at gain 0x48 5fps + 0xde ,0x80 , + + 0xe5 ,0x15 , + 0xe6 ,0x02 , + 0xe7 ,0x04 , + + //Sensor On //Sensor On + 0x00 ,0x01 , + 0x03 ,0x01 , + 0x00 ,0x00 , +#else + 0x00,0x00, + 0x03,0x04, + 0x10,0x86,//8d}}, //85 + 0x11,0x74,// f1}}, //0x11 0x61 davis20120514 + + 0x00,0x01, + 0x04,0x00, //00 + 0x06,0x04, + 0x10,0x11,//46}}, + 0x11,0x25,//23}}, + 0x12,0x21, + 0x17,0x94,//86}}, + 0x18,0x00, + 0x20,0x00, + 0x21,0x05, + 0x22,0x01, + 0x23,0x69, //add + 0x40,0x0F, + 0x41,0x90, + 0x42,0xd2, + 0x43,0x00, + + // AE + 0x00,0x02, + 0x10,0x84, + 0x11,0x14,//0c}},//10}}, + 0x12,0x68,//71,//70}}, // D65 target 60 + 0x14,0x40,//68, // A target 5d + 0x34,0x96, + 0x40,0x38,//48}},//40}}, // 40 + 0x44,0x08,//00}}, + + + // AWB + 0x00,0x03, + 0x10,0xD0,//c3}}, // + 0x11,0xc1,//c0}},//c0 + 0x12,0x80, + 0x13,0x80, //Cr target 0x7e + 0x14,0x80, //Cb target 7f + 0x15,0xe0,//c0}}, // R gain Top e0 + 0x16,0x7C,//88}},//8c}}, // R gain bottom 8c // + 0x17,0xe0, // B gain Top e0 + 0x18,0x80,//70}}, // B gain bottom 0x80 // + 0x19,0x8C,//90}}, // Cr top value 8c // + 0x1a,0x64, // Cr bottom value 0x64 60 //YCbYCr + 0x1b,0x94, // Cb top value 0x98 + 0x1c,0x6c, // Cb bottom value 0x6c // 0x01 + 0x1d,0x94, // 0xa0 + 0x1e,0x6c, // 0x60 + 0x20,0xe8, // AWB luminous top value + 0x21,0x30, // AWB luminous bottom value 0x20 + 0x22,0xb8, + 0x23,0x10, + 0x25,0x08,//20}}, + 0x26,0x0f,//0f}}, + 0x27,0x60, // BRTSRT + 0x28,0x70, // BRTEND + 0x29,0xb7, // BRTRGNBOT + 0x2a,0xa3, // BRTBGNTOP + + 0x40,0x01, + 0x41,0x03,//04}}, + 0x42,0x08, + 0x43,0x10, + 0x44,0x13,//12}}, // 0x12 + 0x45,0x6a,//35}}, //35 + 0x46,0xca, // fc + + 0x62,0x80,//84}}, //84 // + + 0x63,0x90,//9c}}, // R D30 to D20 + 0x64,0xD0,//d4}}, // B D30 to D20 + 0x65,0x98,//a0}},//90}}, // R D20 to D30 + 0x66,0xd0, // B D20 to D30 + + // IDP + 0x00,0x04, + 0x10,0x7f,//f, + + 0x11,0x1d, // changed + 0x12,0x3d,//++ + 0x13,0xfe,//++ + 0x14,0x01,//++ + + + // DPCBNR + 0x18,0xbf,//fe, // DPCNRCTRL + 0x19,0x00,//04, // DPCTHV + 0x1A,0x00,//01, // DPCTHVSLP + 0x1B,0x00,//08,//08}}, // DPCTHVDIFSRT + + + + 0x1E,0x04, // BNRTHV 0c + 0x1F,0x08,//04}}, // BNRTHVSLPN 10 + 0x20,0x20, // BNRTHVSLPD + 0x21,0x00, /// BNRNEICNT / 0x08 + 0x22,0x08, // STRTNOR // 0x03 + 0x23,0x38,//40}}, // STRTDRK + 0x24,0x00, + + // Gamma + + 0x31, 0x11,//03,//0x080x31, 0x04 },//0x08 0x03 + 0x32, 0x21,//0b,//0x100x32, 0x0b },//0x10 0x08 + 0x33, 0x37,//1e,//0x1B0x33, 0x24 },//0x1B 0x16 + 0x34, 0x54,//46,//0x370x34, 0x49 },//0x37 0x36 + 0x35, 0x6e,//62,//0x4D0x35, 0x66 },//0x4D 0x56 + 0x36, 0x84,//0x600x36, 0x7C },//0x60 0x77 + 0x37, 0x96,//0x720x37, 0x8D },//0x72 0x88 + 0x38, 0xa7,//0x820x38, 0x9B },//0x82 0x9a + 0x39, 0xb7,//0x910x39, 0xAA },//0x91 0xA9 + 0x3a, 0xc4,//0xA00x3a, 0xb6 },//0xA0 0xb5 + 0x3b, 0xd9,//0xBA0x3b, 0xca },//0xBA 0xca + 0x3c, 0xea,//0xD30x3c, 0xdc },//0xD3 0xdd + 0x3d, 0xf9,//0xEA0x3d, 0xef },//0xEA 0xee + + // Shading Register Setting + 0x40,0x55,//04}}, //06 + 0x41,0x44, + 0x42,0x33,//43}}, + 0x43,0x00, + 0x44,0x22, // left R gain[7:4], right R gain[3:0] 22 + 0x45,0x22, // top R gain[7:4], bottom R gain[3:0] 22 + 0x46,0x00, // left G gain[7:4], right G gain[3:0] + 0x47,0x03, // top G gain[7:4], bottom G gain[3:0] 11 + 0x48,0x01, // left B gain[7:4], right B gain[3:0] + 0x49,0x11, // top B gain[7:4], bottom B gain[3:0] //color matrix default + 0x4a,0x05, // X-axis center high[3:2], Y-axis center high[1:0] + 0x4b,0x40, // X-axis center low[7:0] 48 + 0x4c,0x10, // Y-axis center low[7:0] e8 + 0x4d,0x80, // Shading Center Gain 80 + 0x4e,0x00, // Shading R Offset + 0x4f,0x00, // Shading Gr Offset + 0x50,0x00, // Shading B Offset + + + // Interpolation + 0x60,0x7f, + 0x61,0x08, + + // Color matrix (D65) - Daylight + + + 0x71,0x39, //0x34 0x39 + 0x72,0xC8, //0xCe 0xCc + 0x73,0xff, //0xFe 0xFb + 0x74,0x13, //0x13 0x10 + 0x75,0x25, //0x25 0x21 + 0x76,0x08, //0x08 0x0f + 0x77,0xf8, //0xec 0xf8 + 0x78,0xc0, //0xd1 0xc0 + 0x79,0x48, //0x47 0x48 + + // Color matrix (D20) - A + 0x83,0x34, //0x3c + 0x84,0xd4, //0xc6 + 0x85,0xf8, //0xff + 0x86,0x12, //0x12 + 0x87,0x25, //0x24 + 0x88,0x09, //0x0a + 0x89,0xf0, //0xed + 0x8a,0xbe, //0xc2 + 0x8b,0x54, //0x51 + + + 0x8c,0x10, //CMA select + + //G Edge + 0x90,0x30, //Upper gain + 0x91,0x40, //down gain + 0x92,0x33,//22}}, //[7:4] upper coring [3:0] down coring + 0x9a,0x40, + 0x9b,0x40, + 0x9c,0x38, //edge suppress start 30 + 0x9d,0x30, //edge suppress slope + + 0x9f,0x26, + 0xa0,0x11, + + 0xa8,0x11,//10}}, + 0xa9,0x11,//10}}, + 0xaa,0x11, + + 0xbf,0x20, + + 0xb9,0x28,//30}}, // nightmode 38 at gain 0x48 5fps + 0xba,0x41,//44}}, // nightmode 80 at gain 0x48 5fps + 0xde,0x80, + + 0xe5,0x15, + 0xe6,0x02, + 0xe7,0x04, + + //Sensor On //Sensor On + 0x00,0x01, + 0x03,0x01, + + 0x00,0x00, +#endif +}; + +uint8_t siv121d_default_regs_init_121du[] = { +#if 0 + 0x00 ,0x00 , + 0x00 ,0x01 , + 0x03 ,0x0a , + + 0x00 ,0x01 , + 0x03 ,0x0a , + + 0x00 ,0x00 , + 0x03 ,0x04 , + 0x10 ,0x85 , //85 + 0x11 ,0x74 , //0x11 0x61 davis20120514 + + 0x00 ,0x01 , + 0x04 ,0x00 , //00 + 0x06 ,0x04 , + 0x10 ,0x46 , + 0x11 ,0x23 , + 0x12 ,0x21 , + 0x17 ,0x86 , + 0x18 ,0x00 , + 0x20 ,0x00 , + 0x21 ,0x05 , + 0x22 ,0x01 , + 0x23 ,0x69 , //add + 0x40 ,0x0F , + 0x41 ,0x90 , + 0x42 ,0xd2 , + 0x43 ,0x00 , + + // AE + 0x00 ,0x02 , + 0x10 ,0x80 , + 0x11 ,0x10 , + 0x12 ,0x65 , // D65 target 60 + 0x14 ,0x62 , // A target 5 + 0x34 ,0x96 , + 0x40 ,0x40 , // 40 + 0x5f ,0x01 , + 0x41 ,0x28 ,//20 , + 0x42 ,0x28 ,//20 , + 0x44 ,0x08 ,//00 , + 0x45 ,0x08 ,//00 , + 0x46 ,0x15 ,//0a , + 0x47 ,0x1c ,//10 , + 0x48 ,0x20 ,//13 , + 0x49 ,0x21 ,//15 , + 0x4a ,0x23 ,//18 , + 0x4b ,0x24 ,//1a , + 0x4c ,0x25 ,//1d , + 0x4d ,0x28 ,//20 , + 0x4e ,0x1c ,//10 , + 0x4f ,0x15 ,//0a , + + 0x50 ,0x10 ,//08 , + 0x51 ,0x10 ,//06 , + 0x52 ,0x0e ,//05 , + 0x53 ,0x0c ,//04 , + 0x54 ,0x0b ,//02 , + 0x55 ,0x0a ,//01 , + 0x90 ,0x80 , + 0x91 ,0x80 , + + // AWB + 0x00 ,0x03 , + 0x10 ,0xd0 , // + 0x11 ,0xc0 ,//c0 + 0x13 ,0x81 , //Cr target + 0x14 ,0x7d , //Cb target 7d + 0x15 ,0xc0 , // R gain Top e0 + 0x16 ,0x8c , // R gain bottom 8c // + 0x17 ,0xe0 , // B gain Top e0 + 0x18 ,0x70 , // B gain bottom 0x80 // + 0x19 ,0x8c , // Cr top value 8c // + 0x1a ,0x64 , // Cr bottom value 0x64 60 //YCbYCr + 0x1b ,0x98 , // Cb top value 0x98 + 0x1c ,0x6c , // Cb bottom value 0x6c // 0x01 + 0x1d ,0x94 , // 0xa0 + 0x1e ,0x6c , // 0x60 + 0x20 ,0xe8 , // AWB luminous top value + 0x21 ,0x30 , // AWB luminous bottom value 0x20 + 0x22 ,0xb8 , + 0x23 ,0x10 , + 0x25 ,0x20 , + 0x26 ,0x0f , + 0x27 ,0x08 , // BRTSRT + 0x28 ,0x0f , // BRTEND + 0x29 ,0xba , // BRTRGNBOT + 0x2a ,0xa0 , // BRTBGNTOP + + 0x40 ,0x01 , + 0x41 ,0x04 , + 0x42 ,0x08 , + 0x43 ,0x10 , + 0x44 ,0x12 , // 0x12 + 0x45 ,0x35 , //35 + 0x46 ,0xfc , // fc + 0x62 ,0x84 , //84 // + 0x63 ,0x90 , // R D30 to D20 + 0x64 ,0xd0 , // B D30 to D20 + 0x65 ,0x90 , // R D20 to D30 + 0x66 ,0xd0 , // B D20 to D30 + + // IDP + 0x00 ,0x04 , + 0x10 ,0xff , + // 0x11 ,0x1d , + 0x11 ,0x1d , //zhongwei changed + 0x12 ,0x3d ,//zhongwei++ + + + // DPCBNR + 0x18 ,0xbe ,//fe , // DPCNRCTRL + 0x19 ,0x00 ,//04 , // DPCTHV + 0x1A ,0x00 ,//01 , // DPCTHVSLP + 0x1B ,0x00 ,//08 , // DPCTHVDIFSRT + 0x1C ,0x0f ,//08 , // DPCTHVDIFSLP + 0x1d ,0xFF , // DPCTHVMAX + + 0x1E ,0x04 , // BNRTHV 0c + 0x1F ,0x04 , // BNRTHVSLPN 10 + 0x20 ,0x10 , // BNRTHVSLPD + 0x21 ,0x00 , /// BNRNEICNT / 0x08 + 0x22 ,0x10 , // STRTNOR // 0x03 + 0x23 ,0x40 , // STRTDRK + + // Gamma + 0x31 ,0x08 ,//0x080x31, 0x04 },//0x08 0x03 + 0x32 ,0x12 ,//0x100x32, 0x0b },//0x10 0x08 + 0x33 ,0x24 ,//0x1B0x33, 0x24 },//0x1B 0x16 + 0x34 ,0x47 ,//0x370x34, 0x49 },//0x37 0x36 + 0x35 ,0x64 ,//0x4D0x35, 0x66 },//0x4D 0x56 + 0x36 ,0x7c ,//0x600x36, 0x7C },//0x60 0x77 + 0x37 ,0x8f ,//0x720x37, 0x8D },//0x72 0x88 + 0x38 ,0x9f ,//0x820x38, 0x9B },//0x82 0x9a + 0x39 ,0xad ,//0x910x39, 0xAA },//0x91 0xA9 + 0x3a ,0xba ,//0xA00x3a, 0xb6 },//0xA0 0xb5 + 0x3b ,0xcf ,//0xBA0x3b, 0xca },//0xBA 0xca + 0x3c ,0xe2 ,//0xD30x3c, 0xdc },//0xD3 0xdd + 0x3d ,0xf0 ,//0xEA0x3d, 0xef },//0xEA 0xee + + // Shading Register Setting + 0x40 ,0x04 , //06 + 0x41 ,0x44 , + 0x42 ,0x43 , + 0x43 ,0x20 , + 0x44 ,0x11 , // left R gain[7:4], right R gain[3:0] 22 + 0x45 ,0x11 , // top R gain[7:4], bottom R gain[3:0] 22 + 0x46 ,0x00 , // left G gain[7:4], right G gain[3:0] + 0x47 ,0x00 , // top G gain[7:4], bottom G gain[3:0] 11 + 0x48 ,0x00 , // left B gain[7:4], right B gain[3:0] + 0x49 ,0x00 , // top B gain[7:4], bottom B gain[3:0] //color matrix default + 0x4a ,0x04 , // X-axis center high[3:2], Y-axis center high[1:0] + 0x4b ,0x60 , // X-axis center low[7:0] 48 + 0x4c ,0xe0 , // Y-axis center low[7:0] e8 + 0x4d ,0x88 , // Shading Center Gain 80 + 0x4e ,0x00 , // Shading R Offset + 0x4f ,0x00 , // Shading Gr Offset + 0x50 ,0x00 , // Shading B Offset + + + // Interpolation + 0x60 ,0x7f , + 0x61 ,0x08 , + + // Color matrix (D65) - Daylight + 0x71 ,0x34 , //0x34 0x39 + 0x72 ,0xCe , //0xCe 0xCc + 0x73 ,0xFe , //0xFe 0xFb + 0x74 ,0x13 , //0x13 0x10 + 0x75 ,0x25 , //0x25 0x21 + 0x76 ,0x08 , //0x08 0x0f + 0x77 ,0xec , //0xec 0xf8 + 0x78 ,0xd1 , //0xd1 0xc0 + 0x79 ,0x47 , //0x47 0x48 + + // Color matrix (D20) - A + 0x83 ,0x38 , //0x3c + 0x84 ,0xd1 , //0xc6 + 0x85 ,0xf7 , //0xff + 0x86 ,0x12 , //0x12 + 0x87 ,0x25 , //0x24 + 0x88 ,0x09 , //0x0a + 0x89 ,0xe1 , //0xed + 0x8a ,0xc7 , //0xc2 + 0x8b ,0x58 , //0x51 + + 0x8c ,0x10 , //CMA select + + //G Edge + 0x90 ,0x20 , //Upper gain + 0x91 ,0x40 , //down gain + 0x92 ,0x44 , //[7:4] upper coring [3:0] down coring + 0x9a ,0x40 , + 0x9b ,0x40 , + 0x9c ,0x38 , //edge suppress start 30 + 0x9d ,0x30 , //edge suppress slope + 0xa8 ,0x10 , + 0xa9 ,0x13 , + 0xaa ,0x13 , + 0xb9 ,0x30 , // nightmode 38 at gain 0x48 5fps + 0xba ,0x44 , // nightmode 80 at gain 0x48 5fps + 0xde ,0x80 , + + 0xe5 ,0x15 , + 0xe6 ,0x02 , + 0xe7 ,0x04 , + + //Sensor On //Sensor On + 0x00 ,0x01 , + 0x03 ,0x01 , + 0x00 ,0x00 , +#else + 0x00,0x00, + 0x03,0x04, + 0x10,0x86,//8d}}, //85 + 0x11,0x74,// f1}}, //0x11 0x61 davis20120514 + + 0x00,0x01, + 0x04,0x00, //00 + 0x06,0x04, + 0x10,0x11,//46}}, + 0x11,0x25,//23}}, + 0x12,0x21, + 0x17,0x94,//86}}, + 0x18,0x00, + 0x20,0x00, + 0x21,0x05, + 0x22,0x01, + 0x23,0x69, //add + 0x40,0x0F, + 0x41,0x90, + 0x42,0xd2, + 0x43,0x00, + + // AE + 0x00,0x02, + 0x10,0x84, + 0x11,0x14,//0c}},//10}}, + 0x12,0x68,//71,//70}}, // D65 target 60 + 0x14,0x40,//68, // A target 5d + 0x34,0x96, + 0x40,0x38,//48}},//40}}, // 40 + 0x44,0x08,//00}}, + + + // AWB + 0x00,0x03, + 0x10,0xD0,//c3}}, // + 0x11,0xc1,//c0}},//c0 + 0x12,0x80, + 0x13,0x80, //Cr target 0x7e + 0x14,0x80, //Cb target 7f + 0x15,0xe0,//c0}}, // R gain Top e0 + 0x16,0x7C,//88}},//8c}}, // R gain bottom 8c // + 0x17,0xe0, // B gain Top e0 + 0x18,0x80,//70}}, // B gain bottom 0x80 // + 0x19,0x8C,//90}}, // Cr top value 8c // + 0x1a,0x64, // Cr bottom value 0x64 60 //YCbYCr + 0x1b,0x94, // Cb top value 0x98 + 0x1c,0x6c, // Cb bottom value 0x6c // 0x01 + 0x1d,0x94, // 0xa0 + 0x1e,0x6c, // 0x60 + 0x20,0xe8, // AWB luminous top value + 0x21,0x30, // AWB luminous bottom value 0x20 + 0x22,0xb8, + 0x23,0x10, + 0x25,0x08,//20}}, + 0x26,0x0f,//0f}}, + 0x27,0x60, // BRTSRT + 0x28,0x70, // BRTEND + 0x29,0xb7, // BRTRGNBOT + 0x2a,0xa3, // BRTBGNTOP + + 0x40,0x01, + 0x41,0x03,//04}}, + 0x42,0x08, + 0x43,0x10, + 0x44,0x13,//12}}, // 0x12 + 0x45,0x6a,//35}}, //35 + 0x46,0xca, // fc + + 0x62,0x80,//84}}, //84 // + + 0x63,0x90,//9c}}, // R D30 to D20 + 0x64,0xD0,//d4}}, // B D30 to D20 + 0x65,0x98,//a0}},//90}}, // R D20 to D30 + 0x66,0xd0, // B D20 to D30 + + // IDP + 0x00,0x04, + 0x10,0x7f,//f, + + 0x11,0x1d, // changed + 0x12,0x3d,//++ + 0x13,0xfe,//++ + 0x14,0x01,//++ + + + // DPCBNR + 0x18,0xbf,//fe, // DPCNRCTRL + 0x19,0x00,//04, // DPCTHV + 0x1A,0x00,//01, // DPCTHVSLP + 0x1B,0x00,//08,//08}}, // DPCTHVDIFSRT + + + + 0x1E,0x04, // BNRTHV 0c + 0x1F,0x08,//04}}, // BNRTHVSLPN 10 + 0x20,0x20, // BNRTHVSLPD + 0x21,0x00, /// BNRNEICNT / 0x08 + 0x22,0x08, // STRTNOR // 0x03 + 0x23,0x38,//40}}, // STRTDRK + 0x24,0x00, + + // Gamma + + 0x31, 0x11,//03,//0x080x31, 0x04 },//0x08 0x03 + 0x32, 0x21,//0b,//0x100x32, 0x0b },//0x10 0x08 + 0x33, 0x37,//1e,//0x1B0x33, 0x24 },//0x1B 0x16 + 0x34, 0x54,//46,//0x370x34, 0x49 },//0x37 0x36 + 0x35, 0x6e,//62,//0x4D0x35, 0x66 },//0x4D 0x56 + 0x36, 0x84,//0x600x36, 0x7C },//0x60 0x77 + 0x37, 0x96,//0x720x37, 0x8D },//0x72 0x88 + 0x38, 0xa7,//0x820x38, 0x9B },//0x82 0x9a + 0x39, 0xb7,//0x910x39, 0xAA },//0x91 0xA9 + 0x3a, 0xc4,//0xA00x3a, 0xb6 },//0xA0 0xb5 + 0x3b, 0xd9,//0xBA0x3b, 0xca },//0xBA 0xca + 0x3c, 0xea,//0xD30x3c, 0xdc },//0xD3 0xdd + 0x3d, 0xf9,//0xEA0x3d, 0xef },//0xEA 0xee + + // Shading Register Setting + 0x40,0x55,//04}}, //06 + 0x41,0x44, + 0x42,0x33,//43}}, + 0x43,0x00, + 0x44,0x22, // left R gain[7:4], right R gain[3:0] 22 + 0x45,0x22, // top R gain[7:4], bottom R gain[3:0] 22 + 0x46,0x00, // left G gain[7:4], right G gain[3:0] + 0x47,0x03, // top G gain[7:4], bottom G gain[3:0] 11 + 0x48,0x01, // left B gain[7:4], right B gain[3:0] + 0x49,0x11, // top B gain[7:4], bottom B gain[3:0] //color matrix default + 0x4a,0x05, // X-axis center high[3:2], Y-axis center high[1:0] + 0x4b,0x40, // X-axis center low[7:0] 48 + 0x4c,0x10, // Y-axis center low[7:0] e8 + 0x4d,0x80, // Shading Center Gain 80 + 0x4e,0x00, // Shading R Offset + 0x4f,0x00, // Shading Gr Offset + 0x50,0x00, // Shading B Offset + + + // Interpolation + 0x60,0x7f, + 0x61,0x08, + + // Color matrix (D65) - Daylight + + + 0x71,0x39, //0x34 0x39 + 0x72,0xC8, //0xCe 0xCc + 0x73,0xff, //0xFe 0xFb + 0x74,0x13, //0x13 0x10 + 0x75,0x25, //0x25 0x21 + 0x76,0x08, //0x08 0x0f + 0x77,0xf8, //0xec 0xf8 + 0x78,0xc0, //0xd1 0xc0 + 0x79,0x48, //0x47 0x48 + + // Color matrix (D20) - A + 0x83,0x34, //0x3c + 0x84,0xd4, //0xc6 + 0x85,0xf8, //0xff + 0x86,0x12, //0x12 + 0x87,0x25, //0x24 + 0x88,0x09, //0x0a + 0x89,0xf0, //0xed + 0x8a,0xbe, //0xc2 + 0x8b,0x54, //0x51 + + + 0x8c,0x10, //CMA select + + //G Edge + 0x90,0x30, //Upper gain + 0x91,0x40, //down gain + 0x92,0x33,//22}}, //[7:4] upper coring [3:0] down coring + 0x9a,0x40, + 0x9b,0x40, + 0x9c,0x38, //edge suppress start 30 + 0x9d,0x30, //edge suppress slope + + 0x9f,0x26, + 0xa0,0x11, + + 0xa8,0x11,//10}}, + 0xa9,0x11,//10}}, + 0xaa,0x11, + + 0xbf,0x20, + + 0xb9,0x28,//30}}, // nightmode 38 at gain 0x48 5fps + 0xba,0x41,//44}}, // nightmode 80 at gain 0x48 5fps + 0xde,0x80, + + 0xe5,0x15, + 0xe6,0x02, + 0xe7,0x04, + + //Sensor On //Sensor On + 0x00,0x01, + 0x03,0x01, + + 0x00,0x00, +#endif +}; + +#endif + diff --git a/drivers/media/video/wmt_v4l2/sensors/siv121d/siv121d.c b/drivers/media/video/wmt_v4l2/sensors/siv121d/siv121d.c new file mode 100755 index 00000000..55c80db7 --- /dev/null +++ b/drivers/media/video/wmt_v4l2/sensors/siv121d/siv121d.c @@ -0,0 +1,337 @@ + +#include "../cmos-subdev.h" +#include "../../wmt-vid.h" +#include "siv121d.h" + +#define sensor_write_array(sd, arr, sz) \ + cmos_init_8bit_addr(arr, sz, (sd)->i2c_addr) + +#define sensor_read(sd, reg) \ + wmt_vid_i2c_read(sd->i2c_addr, reg) + +#define sensor_write(sd, reg, val) \ + wmt_vid_i2c_write(sd->i2c_addr, reg, val) + +struct cmos_win_size { + char *name; + int width; + int height; + uint8_t *regs; + size_t size; +}; + +#define CMOS_WIN_SIZE(n, w, h, r) \ + {.name = n, .width = w , .height = h, .regs = r, .size = ARRAY_SIZE(r) } + +static const struct cmos_win_size cmos_supported_win_sizes[] = { + CMOS_WIN_SIZE("QVGA", 320, 240, siv121d_320_240_regs), + CMOS_WIN_SIZE("VGA", 640, 480, siv121d_640_480_regs), +}; + +static const struct cmos_win_size *cmos_select_win(u32 *width, u32 *height) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(cmos_supported_win_sizes); i++) { + if (cmos_supported_win_sizes[i].width == *width && + cmos_supported_win_sizes[i].height == *height) { + *width = cmos_supported_win_sizes[i].width; + *height = cmos_supported_win_sizes[i].height; + return &cmos_supported_win_sizes[i]; + } + } + return NULL; +} + +static int sensor_s_wb(struct cmos_subdev *sd, enum v4l2_wb_mode value) +{ + uint8_t *regs; + size_t size; + + switch (value) { + case WHITE_BALANCE_AUTO: + regs = siv121d_wb_auto; + size = ARRAY_SIZE(siv121d_wb_auto); + break; + case WHITE_BALANCE_INCANDESCENCE: + regs = siv121d_wb_incandescent; + size = ARRAY_SIZE(siv121d_wb_incandescent); + break; + case WHITE_BALANCE_DAYLIGHT: + regs = siv121d_wb_daylight; + size = ARRAY_SIZE(siv121d_wb_daylight); + break; + case WHITE_BALANCE_CLOUDY: + regs = siv121d_wb_cloudy; + size = ARRAY_SIZE(siv121d_wb_cloudy); + break; + case WHITE_BALANCE_FLUORESCENT: + regs = siv121d_wb_fluorescent; + size = ARRAY_SIZE(siv121d_wb_fluorescent); + break; + default: + return -EINVAL; + } + + sensor_write_array(sd, regs, size); + return 0; +} + +static int sensor_s_scenemode(struct cmos_subdev *sd, enum v4l2_scene_mode value) +{ + uint8_t *regs; + size_t size; + + switch (value) { + case SCENE_MODE_AUTO: + regs = siv121d_scene_mode_auto; + size = ARRAY_SIZE(siv121d_scene_mode_auto); + break; + case SCENE_MODE_NIGHTSHOT: + regs = siv121d_scene_mode_night; + size = ARRAY_SIZE(siv121d_scene_mode_night); + break; + default: + return -EINVAL; + } + + sensor_write_array(sd, regs, size); + return 0; +} + +static int sensor_s_exposure(struct cmos_subdev *sd, enum v4l2_exposure_mode value) +{ + uint8_t *regs; + size_t size; + + switch (value) { + case -2: + regs = siv121d_exposure_neg6; + size = ARRAY_SIZE(siv121d_exposure_neg6); + break; + case -1: + regs = siv121d_exposure_neg3; + size = ARRAY_SIZE(siv121d_exposure_neg3); + break; + case 0: + regs = siv121d_exposure_zero; + size = ARRAY_SIZE(siv121d_exposure_zero); + break; + case 1: + regs = siv121d_exposure_pos3; + size = ARRAY_SIZE(siv121d_exposure_pos3); + break; + case 2: + regs = siv121d_exposure_pos6; + size = ARRAY_SIZE(siv121d_exposure_pos6); + break; + default: + return -EINVAL; + } + + sensor_write_array(sd, regs, size); + return 0; +} + +static int sensor_s_hflip(struct cmos_subdev *sd, int value) +{ + uint8_t data; + + sensor_write(sd, 0x00, 0x01); + + data = sensor_read(sd, 0x04); + + switch (value) { + case 0: + data &= ~0x01; + break; + case 1: + data |= 0x01; + break; + default: + return -EINVAL; + } + + return sensor_write(sd, 0x04, data); +} + +static int sensor_s_vflip(struct cmos_subdev *sd, int value) +{ + uint8_t data; + + sensor_write(sd, 0x00, 0x01); + + data = sensor_read(sd, 0x04); + + switch (value) { + case 0: + data &= ~0x02; + break; + case 1: + data |= 0x02; + break; + default: + return -EINVAL; + } + + return sensor_write(sd, 0x04, data); +} + +static int sensor_queryctrl(struct cmos_subdev *sd, struct v4l2_queryctrl *qc) +{ + switch (qc->id) { + case V4L2_CID_VFLIP: + case V4L2_CID_HFLIP: + return v4l2_ctrl_query_fill(qc, 0, 1, 1, 0); + case V4L2_CID_CAMERA_SCENE_MODE: + return v4l2_ctrl_query_fill(qc, 0, 1, 1, 0); + case V4L2_CID_DO_WHITE_BALANCE: + return v4l2_ctrl_query_fill(qc, 0, 3, 1, 0); + case V4L2_CID_EXPOSURE: + return v4l2_ctrl_query_fill(qc, -2, 2, 1, 0); + } + return -EINVAL; +} + +static int sensor_s_ctrl(struct cmos_subdev *sd, struct v4l2_control *ctrl) +{ + switch (ctrl->id) { + case V4L2_CID_CAMERA_SCENE_MODE: + return sensor_s_scenemode(sd, ctrl->value); + case V4L2_CID_DO_WHITE_BALANCE: + return sensor_s_wb(sd, ctrl->value); + case V4L2_CID_EXPOSURE: + return sensor_s_exposure(sd, ctrl->value); + case V4L2_CID_HFLIP: + return sensor_s_hflip(sd, ctrl->value); + case V4L2_CID_VFLIP: + return sensor_s_vflip(sd, ctrl->value); + default: + case WMT_V4L2_CID_CAMERA_ANTIBANDING: + return -EINVAL; + } + return -EINVAL; +} + +static int sensor_g_mbus_fmt(struct cmos_subdev *sd, + struct v4l2_mbus_framefmt *mf) +{ + return -EINVAL; +} + +static int sensor_s_mbus_fmt(struct cmos_subdev *sd, + struct v4l2_mbus_framefmt *mf) +{ + const struct cmos_win_size *win; + + win = cmos_select_win(&mf->width, &mf->height); + if (!win) { + pr_err("%s, s_mbus_fmt failed, width %d, height %d\n", + sd->name, mf->width, mf->height); + return -EINVAL; + } + + sensor_write_array(sd, win->regs, win->size); + return 0; +} + +static int sensor_try_mbus_fmt(struct cmos_subdev *sd, + struct v4l2_mbus_framefmt *mf) +{ + return 0; +} + +static int sensor_enum_framesizes(struct cmos_subdev *sd, + struct v4l2_frmsizeenum *fsize) +{ + int i; + int num_valid = -1; + __u32 index = fsize->index; + + for (i = 0; i < ARRAY_SIZE(cmos_supported_win_sizes); i++) { + const struct cmos_win_size *win = &cmos_supported_win_sizes[index]; + if (index == ++num_valid) { + fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE; + fsize->discrete.width = win->width; + fsize->discrete.height = win->height; + return 0; + } + } + + return -EINVAL; +} + +static int sensor_identify(struct cmos_subdev *sd) +{ + int data; + + sensor_write(sd, 0x00, 0x0); + + data = sensor_read(sd, 0x01); + + return (data == sd->id) ? 0 : -EINVAL; +} + +static int sensor_init(struct cmos_subdev *sd) +{ + int version; + + if (sensor_identify(sd)) { + return -1; + } + + version = sensor_read(sd, 0x02); + printk("version:0x%x\n",version); + if (version == 0x10) { + sensor_write_array(sd, siv121d_default_regs_init_121d, + ARRAY_SIZE(siv121d_default_regs_init_121d)); + } else if (version == 0x15) { + sensor_write_array(sd, siv121d_default_regs_init_121du, + ARRAY_SIZE(siv121d_default_regs_init_121du)); + + } + return 0; +} + +static int sensor_exit(struct cmos_subdev *sd) +{ + return 0; +} + +static struct cmos_subdev_ops siv121d_ops = { + .identify = sensor_identify, + .init = sensor_init, + .exit = sensor_exit, + .queryctrl = sensor_queryctrl, + .s_ctrl = sensor_s_ctrl, + .s_mbus_fmt = sensor_s_mbus_fmt, + .g_mbus_fmt = sensor_g_mbus_fmt, + .try_mbus_fmt = sensor_try_mbus_fmt, + .enum_framesizes = sensor_enum_framesizes, +}; + +struct cmos_subdev siv121d = { + .name = "siv121d", + .i2c_addr = 0x33, + .id = 0xde, + .max_width = 640, + .max_height = 480, + .ops = &siv121d_ops, +}; + +#if 0 +static int __init siv121d_init(void) +{ + return cmos_register_sudbdev(&siv121d); +} + +static void __exit siv121d_exit(void) +{ + return cmos_unregister_subdev(&siv121d); +} + +module_init(siv121d_init); +module_exit(siv121d_exit); + +MODULE_LICENSE("GPL"); +#endif diff --git a/drivers/media/video/wmt_v4l2/sensors/siv121d/siv121d.h b/drivers/media/video/wmt_v4l2/sensors/siv121d/siv121d.h new file mode 100755 index 00000000..eb7a8e72 --- /dev/null +++ b/drivers/media/video/wmt_v4l2/sensors/siv121d/siv121d.h @@ -0,0 +1,1128 @@ +#ifndef SIV121D_H +#define SIV121D_H + + +// Scene Mode +uint8_t siv121d_scene_mode_auto[] = { + 0x00,0x02, + 0x11,0x10, + 0x40,0x40, +}; + +uint8_t siv121d_scene_mode_night[] = { + 0x00,0x02, + 0x11,0x18, + 0x40,0x60, +}; + + +// White Balance +uint8_t siv121d_wb_auto [] = { + 0x00,0x03, + 0x10,0xd0, + //0x60,0xC5, + //0x61,0x95, +}; + +uint8_t siv121d_wb_incandescent [] = { + 0x00,0x03, + 0x10,0x00, + 0x60,0x80, + 0x61,0xE0, +}; + +uint8_t siv121d_wb_fluorescent [] = { + 0x00,0x03, + 0x10,0x00, + 0x60,0xB8, + 0x61,0xCC, +}; + +uint8_t siv121d_wb_daylight [] = { + 0x00,0x03, + 0x10,0x00, + 0x60,0xD8, + 0x61,0x90, +}; + +uint8_t siv121d_wb_cloudy [] = { + 0x00,0x03, + 0x10,0x00, + 0x60,0xB4, + 0x61,0x90, +}; + +uint8_t siv121d_wb_tungsten [] = { + 0x00,0x03, + 0x10,0x00, + 0x60,0x7B, + 0x61,0xa0, +}; + + +// Exposure +uint8_t siv121d_exposure_neg6[] = { + 0x00,0x04, + 0xAB,0xa8, +}; + +uint8_t siv121d_exposure_neg3[] = { + 0x00,0x04, + 0xAB,0x90, +}; + +uint8_t siv121d_exposure_zero[] = { + 0x00,0x04, + 0xAB,0x00, +}; + +uint8_t siv121d_exposure_pos3[] = { + 0x00,0x04, + 0xAB,0x18, +}; + +uint8_t siv121d_exposure_pos6[] = { + 0x00,0x04, + 0xAB,0x30, +}; + +// Color Effect +uint8_t siv121d_colorfx_none[] = { + 0x00,0x04, + 0xB6,0x00, +}; + +uint8_t siv121d_colorfx_bw[] = { + 0x00,0x04, + 0xB6,0x40, +}; + +uint8_t siv121d_colorfx_sepia[] = { + 0x00,0x04, + 0xB6,0x80, + 0xB7,0x60, + 0xB8,0xA0, +}; + +uint8_t siv121d_colorfx_negative[] = { + 0x00,0x04, + 0xB6,0x20, + +}; + +uint8_t siv121d_colorfx_emboss[] = { + 0x00,0x04, + 0xB6,0x08, + 0xB7,0x00, + 0xB8,0x00, +}; + +uint8_t siv121d_colorfx_sketch[] = { + 0x00,0x04, + 0xB6,0x04, + 0xB7,0x00, + 0xB8,0x00, +}; + +uint8_t siv121d_colorfx_sky_blue[] = { + 0x00,0x04, + 0xB6,0xa0, + 0xB7,0xc0, + 0xB8,0x50, +}; + +uint8_t siv121d_colorfx_grass_green[] = { + 0x00,0x04, + 0xB6,0x80, + 0xB7,0x50, + 0xB8,0x50, +}; + +uint8_t siv121d_colorfx_skin_whiten[] = { +}; + +uint8_t sensor_colorfx_vivid[] = { +}; + +// Brightness +uint8_t sensor_brightness_neg4[] = { + 0x00,0x04, + 0xAB,0xC0, +}; + +uint8_t sensor_brightness_neg3[] = { + 0x00,0x04, + 0xAB,0xB0, +}; + +uint8_t sensor_brightness_neg2[] = { + 0x00,0x04, + 0xAB,0xA0, +}; + +uint8_t sensor_brightness_neg1[] = { + 0x00,0x04, + 0xAB,0x90, +}; + +uint8_t sensor_brightness_zero[] = { + 0x00,0x04, + 0xAB,0x00, +}; + +uint8_t sensor_brightness_pos1[] = { + 0x00,0x04, + 0xAB,0x10, +}; + +uint8_t sensor_brightness_pos2[] = { + 0x00,0x04, + 0xAB,0x20, +}; + +uint8_t sensor_brightness_pos3[] = { + 0x00,0x04, + 0xAB,0x30, +}; + +uint8_t sensor_brightness_pos4[] = { + 0x00,0x04, + 0xAB,0x40, +}; + + +// Contrast +uint8_t sensor_contrast_neg4[] = { + 0x00,0x04, + 0xA8,0x0D, + +}; + +uint8_t sensor_contrast_neg3[] = { + 0x00,0x04, + 0xA8,0x0E, +}; + +uint8_t sensor_contrast_neg2[] = { + 0x00,0x04, + 0xA8,0x0F, +}; + +uint8_t sensor_contrast_neg1[] = { + 0x00,0x04, + 0xA8,0x10, +}; + +uint8_t sensor_contrast_zero[] = { + 0x00,0x04, + 0xA8,0x10, +}; + +uint8_t sensor_contrast_pos1[] = { + 0x00,0x04, + 0xA8,0x12, +}; + +uint8_t sensor_contrast_pos2[] = { + 0x00,0x04, + 0xA8,0x13, +}; + +uint8_t sensor_contrast_pos3[] = { + 0x00,0x04, + 0xA8,0x14, +}; + +uint8_t sensor_contrast_pos4[] = { + 0x00,0x04, + 0xA8,0x15, +}; + +// Saturation +uint8_t sensor_saturation_neg4[] = { +}; + +uint8_t sensor_saturation_neg3[] = { +}; + +uint8_t sensor_saturation_neg2[] = { +}; + +uint8_t sensor_saturation_neg1[] = { +}; + +uint8_t sensor_saturation_zero[] = { +}; + +uint8_t sensor_saturation_pos1[] = { +}; + +uint8_t sensor_saturation_pos2[] = { +}; + +uint8_t sensor_saturation_pos3[] = { +}; + +uint8_t sensor_saturation_pos4[] = { +}; + + +// Resolution +uint8_t siv121d_320_240_regs[]={ + 0x00,0x01, + 0x06,0x06, + 0x00,0x04, + 0xc0,0x10, + 0xc1,0x00, + 0xc2,0x40, + 0xc3,0x00, + 0xc4,0xf0, +}; + +uint8_t siv121d_640_480_regs[]={ + 0x00,0x01, + 0x06,0x04, + 0x00,0x04, + 0xc0,0x24, + 0xc1,0x00, + 0xc2,0x80, + 0xc3,0x00, + 0xc4,0xe0, +}; + +uint8_t siv121d_default_regs_init_121d[]={ +#if 1 + 0x00 ,0x00 , + 0x00 ,0x01 , + 0x03 ,0x0a , + + 0x00 ,0x01 , + 0x03 ,0x0a , + + 0x00 ,0x00 , + 0x03 ,0x04 , + 0x10 ,0x85 , //85 + 0x11 ,0x74 , //0x11 0x61 davis20120514 + + 0x00 ,0x01 , + 0x04 ,0x00 , //00 + 0x06 ,0x04 , + 0x10 ,0x46 , + 0x11 ,0x23 , + 0x12 ,0x21 , + 0x17 ,0x86 , + 0x18 ,0x00 , + 0x20 ,0x00 , + 0x21 ,0x05 , + 0x22 ,0x01 , + 0x23 ,0x69 , //add + 0x40 ,0x0F , + 0x41 ,0x90 , + 0x42 ,0xd2 , + 0x43 ,0x00 , + + // AE + 0x00 ,0x02 , + 0x10 ,0x80 , + 0x11 ,0x10 , + 0x12 ,0x65 , // D65 target 60 + 0x14 ,0x62 , // A target 5 + 0x34 ,0x96 , + 0x40 ,0x40 , // 40 + 0x5f ,0x01 , + 0x41 ,0x28 ,//20 , + 0x42 ,0x28 ,//20 , + 0x44 ,0x08 ,//00 , + 0x45 ,0x08 ,//00 , + 0x46 ,0x15 ,//0a , + 0x47 ,0x1c ,//10 , + 0x48 ,0x20 ,//13 , + 0x49 ,0x21 ,//15 , + 0x4a ,0x23 ,//18 , + 0x4b ,0x24 ,//1a , + 0x4c ,0x25 ,//1d , + 0x4d ,0x28 ,//20 , + 0x4e ,0x1c ,//10 , + 0x4f ,0x15 ,//0a , + + 0x50 ,0x10 ,//08 , + 0x51 ,0x10 ,//06 , + 0x52 ,0x0e ,//05 , + 0x53 ,0x0c ,//04 , + 0x54 ,0x0b ,//02 , + 0x55 ,0x0a ,//01 , + 0x90 ,0x80 , + 0x91 ,0x80 , + + // AWB + 0x00 ,0x03 , + 0x10 ,0xd0 , // + 0x11 ,0xc0 ,//c0 + 0x13 ,0x81 , //Cr target + 0x14 ,0x7d , //Cb target 7d + 0x15 ,0xc0 , // R gain Top e0 + 0x16 ,0x8c , // R gain bottom 8c // + 0x17 ,0xe0 , // B gain Top e0 + 0x18 ,0x70 , // B gain bottom 0x80 // + 0x19 ,0x8c , // Cr top value 8c // + 0x1a ,0x64 , // Cr bottom value 0x64 60 //YCbYCr + 0x1b ,0x98 , // Cb top value 0x98 + 0x1c ,0x6c , // Cb bottom value 0x6c // 0x01 + 0x1d ,0x94 , // 0xa0 + 0x1e ,0x6c , // 0x60 + 0x20 ,0xe8 , // AWB luminous top value + 0x21 ,0x30 , // AWB luminous bottom value 0x20 + 0x22 ,0xb8 , + 0x23 ,0x10 , + 0x25 ,0x20 , + 0x26 ,0x0f , + 0x27 ,0x08 , // BRTSRT + 0x28 ,0x0f , // BRTEND + 0x29 ,0xba , // BRTRGNBOT + 0x2a ,0xa0 , // BRTBGNTOP + + 0x40 ,0x01 , + 0x41 ,0x04 , + 0x42 ,0x08 , + 0x43 ,0x10 , + 0x44 ,0x12 , // 0x12 + 0x45 ,0x35 , //35 + 0x46 ,0xfc , // fc + 0x62 ,0x84 , //84 // + 0x63 ,0x90 , // R D30 to D20 + 0x64 ,0xd0 , // B D30 to D20 + 0x65 ,0x90 , // R D20 to D30 + 0x66 ,0xd0 , // B D20 to D30 + + // IDP + 0x00 ,0x04 , + 0x10 ,0xff , + // 0x11 ,0x1d , + 0x11 ,0x1d , //zhongwei changed + 0x12 ,0x3d ,//zhongwei++ + + + // DPCBNR + 0x18 ,0xbe ,//fe , // DPCNRCTRL + 0x19 ,0x00 ,//04 , // DPCTHV + 0x1A ,0x00 ,//01 , // DPCTHVSLP + 0x1B ,0x00 ,//08 , // DPCTHVDIFSRT + 0x1C ,0x0f ,//08 , // DPCTHVDIFSLP + 0x1d ,0xFF , // DPCTHVMAX + + 0x1E ,0x04 , // BNRTHV 0c + 0x1F ,0x04 , // BNRTHVSLPN 10 + 0x20 ,0x10 , // BNRTHVSLPD + 0x21 ,0x00 , /// BNRNEICNT / 0x08 + 0x22 ,0x10 , // STRTNOR // 0x03 + 0x23 ,0x40 , // STRTDRK + + // Gamma + 0x31 ,0x08 ,//0x080x31, 0x04 },//0x08 0x03 + 0x32 ,0x12 ,//0x100x32, 0x0b },//0x10 0x08 + 0x33 ,0x24 ,//0x1B0x33, 0x24 },//0x1B 0x16 + 0x34 ,0x47 ,//0x370x34, 0x49 },//0x37 0x36 + 0x35 ,0x64 ,//0x4D0x35, 0x66 },//0x4D 0x56 + 0x36 ,0x7c ,//0x600x36, 0x7C },//0x60 0x77 + 0x37 ,0x8f ,//0x720x37, 0x8D },//0x72 0x88 + 0x38 ,0x9f ,//0x820x38, 0x9B },//0x82 0x9a + 0x39 ,0xad ,//0x910x39, 0xAA },//0x91 0xA9 + 0x3a ,0xba ,//0xA00x3a, 0xb6 },//0xA0 0xb5 + 0x3b ,0xcf ,//0xBA0x3b, 0xca },//0xBA 0xca + 0x3c ,0xe2 ,//0xD30x3c, 0xdc },//0xD3 0xdd + 0x3d ,0xf0 ,//0xEA0x3d, 0xef },//0xEA 0xee + + // Shading Register Setting + 0x40 ,0x04 , //06 + 0x41 ,0x44 , + 0x42 ,0x43 , + 0x43 ,0x20 , + 0x44 ,0x11 , // left R gain[7:4], right R gain[3:0] 22 + 0x45 ,0x11 , // top R gain[7:4], bottom R gain[3:0] 22 + 0x46 ,0x00 , // left G gain[7:4], right G gain[3:0] + 0x47 ,0x00 , // top G gain[7:4], bottom G gain[3:0] 11 + 0x48 ,0x00 , // left B gain[7:4], right B gain[3:0] + 0x49 ,0x00 , // top B gain[7:4], bottom B gain[3:0] //color matrix default + 0x4a ,0x04 , // X-axis center high[3:2], Y-axis center high[1:0] + 0x4b ,0x60 , // X-axis center low[7:0] 48 + 0x4c ,0xe0 , // Y-axis center low[7:0] e8 + 0x4d ,0x88 , // Shading Center Gain 80 + 0x4e ,0x00 , // Shading R Offset + 0x4f ,0x00 , // Shading Gr Offset + 0x50 ,0x00 , // Shading B Offset + + + // Interpolation + 0x60 ,0x7f , + 0x61 ,0x08 , + + // Color matrix (D65) - Daylight + 0x71 ,0x34 , //0x34 0x39 + 0x72 ,0xCe , //0xCe 0xCc + 0x73 ,0xFe , //0xFe 0xFb + 0x74 ,0x13 , //0x13 0x10 + 0x75 ,0x25 , //0x25 0x21 + 0x76 ,0x08 , //0x08 0x0f + 0x77 ,0xec , //0xec 0xf8 + 0x78 ,0xd1 , //0xd1 0xc0 + 0x79 ,0x47 , //0x47 0x48 + + // Color matrix (D20) - A + 0x83 ,0x38 , //0x3c + 0x84 ,0xd1 , //0xc6 + 0x85 ,0xf7 , //0xff + 0x86 ,0x12 , //0x12 + 0x87 ,0x25 , //0x24 + 0x88 ,0x09 , //0x0a + 0x89 ,0xe1 , //0xed + 0x8a ,0xc7 , //0xc2 + 0x8b ,0x58 , //0x51 + + 0x8c ,0x10 , //CMA select + + //G Edge + 0x90 ,0x20 , //Upper gain + 0x91 ,0x40 , //down gain + 0x92 ,0x44 , //[7:4] upper coring [3:0] down coring + 0x9a ,0x40 , + 0x9b ,0x40 , + 0x9c ,0x38 , //edge suppress start 30 + 0x9d ,0x30 , //edge suppress slope + 0xa8 ,0x10 , + 0xa9 ,0x13 , + 0xaa ,0x13 , + 0xb9 ,0x30 , // nightmode 38 at gain 0x48 5fps + 0xba ,0x44 , // nightmode 80 at gain 0x48 5fps + 0xde ,0x80 , + + 0xe5 ,0x15 , + 0xe6 ,0x02 , + 0xe7 ,0x04 , + + //Sensor On //Sensor On + 0x00 ,0x01 , + 0x03 ,0x01 , + 0x00 ,0x00 , +#else + 0x00,0x00, + 0x03,0x04, + 0x10,0x86,//8d}}, //85 + 0x11,0x74,// f1}}, //0x11 0x61 davis20120514 + + 0x00,0x01, + 0x04,0x00, //00 + 0x06,0x04, + 0x10,0x11,//46}}, + 0x11,0x25,//23}}, + 0x12,0x21, + 0x17,0x94,//86}}, + 0x18,0x00, + 0x20,0x00, + 0x21,0x05, + 0x22,0x01, + 0x23,0x69, //add + 0x40,0x0F, + 0x41,0x90, + 0x42,0xd2, + 0x43,0x00, + + // AE + 0x00,0x02, + 0x10,0x84, + 0x11,0x14,//0c}},//10}}, + 0x12,0x68,//71,//70}}, // D65 target 60 + 0x14,0x40,//68, // A target 5d + 0x34,0x96, + 0x40,0x38,//48}},//40}}, // 40 + 0x44,0x08,//00}}, + + + // AWB + 0x00,0x03, + 0x10,0xD0,//c3}}, // + 0x11,0xc1,//c0}},//c0 + 0x12,0x80, + 0x13,0x80, //Cr target 0x7e + 0x14,0x80, //Cb target 7f + 0x15,0xe0,//c0}}, // R gain Top e0 + 0x16,0x7C,//88}},//8c}}, // R gain bottom 8c // + 0x17,0xe0, // B gain Top e0 + 0x18,0x80,//70}}, // B gain bottom 0x80 // + 0x19,0x8C,//90}}, // Cr top value 8c // + 0x1a,0x64, // Cr bottom value 0x64 60 //YCbYCr + 0x1b,0x94, // Cb top value 0x98 + 0x1c,0x6c, // Cb bottom value 0x6c // 0x01 + 0x1d,0x94, // 0xa0 + 0x1e,0x6c, // 0x60 + 0x20,0xe8, // AWB luminous top value + 0x21,0x30, // AWB luminous bottom value 0x20 + 0x22,0xb8, + 0x23,0x10, + 0x25,0x08,//20}}, + 0x26,0x0f,//0f}}, + 0x27,0x60, // BRTSRT + 0x28,0x70, // BRTEND + 0x29,0xb7, // BRTRGNBOT + 0x2a,0xa3, // BRTBGNTOP + + 0x40,0x01, + 0x41,0x03,//04}}, + 0x42,0x08, + 0x43,0x10, + 0x44,0x13,//12}}, // 0x12 + 0x45,0x6a,//35}}, //35 + 0x46,0xca, // fc + + 0x62,0x80,//84}}, //84 // + + 0x63,0x90,//9c}}, // R D30 to D20 + 0x64,0xD0,//d4}}, // B D30 to D20 + 0x65,0x98,//a0}},//90}}, // R D20 to D30 + 0x66,0xd0, // B D20 to D30 + + // IDP + 0x00,0x04, + 0x10,0x7f,//f, + + 0x11,0x1d, // changed + 0x12,0x3d,//++ + 0x13,0xfe,//++ + 0x14,0x01,//++ + + + // DPCBNR + 0x18,0xbf,//fe, // DPCNRCTRL + 0x19,0x00,//04, // DPCTHV + 0x1A,0x00,//01, // DPCTHVSLP + 0x1B,0x00,//08,//08}}, // DPCTHVDIFSRT + + + + 0x1E,0x04, // BNRTHV 0c + 0x1F,0x08,//04}}, // BNRTHVSLPN 10 + 0x20,0x20, // BNRTHVSLPD + 0x21,0x00, /// BNRNEICNT / 0x08 + 0x22,0x08, // STRTNOR // 0x03 + 0x23,0x38,//40}}, // STRTDRK + 0x24,0x00, + + // Gamma + + 0x31, 0x11,//03,//0x080x31, 0x04 },//0x08 0x03 + 0x32, 0x21,//0b,//0x100x32, 0x0b },//0x10 0x08 + 0x33, 0x37,//1e,//0x1B0x33, 0x24 },//0x1B 0x16 + 0x34, 0x54,//46,//0x370x34, 0x49 },//0x37 0x36 + 0x35, 0x6e,//62,//0x4D0x35, 0x66 },//0x4D 0x56 + 0x36, 0x84,//0x600x36, 0x7C },//0x60 0x77 + 0x37, 0x96,//0x720x37, 0x8D },//0x72 0x88 + 0x38, 0xa7,//0x820x38, 0x9B },//0x82 0x9a + 0x39, 0xb7,//0x910x39, 0xAA },//0x91 0xA9 + 0x3a, 0xc4,//0xA00x3a, 0xb6 },//0xA0 0xb5 + 0x3b, 0xd9,//0xBA0x3b, 0xca },//0xBA 0xca + 0x3c, 0xea,//0xD30x3c, 0xdc },//0xD3 0xdd + 0x3d, 0xf9,//0xEA0x3d, 0xef },//0xEA 0xee + + // Shading Register Setting + 0x40,0x55,//04}}, //06 + 0x41,0x44, + 0x42,0x33,//43}}, + 0x43,0x00, + 0x44,0x22, // left R gain[7:4], right R gain[3:0] 22 + 0x45,0x22, // top R gain[7:4], bottom R gain[3:0] 22 + 0x46,0x00, // left G gain[7:4], right G gain[3:0] + 0x47,0x03, // top G gain[7:4], bottom G gain[3:0] 11 + 0x48,0x01, // left B gain[7:4], right B gain[3:0] + 0x49,0x11, // top B gain[7:4], bottom B gain[3:0] //color matrix default + 0x4a,0x05, // X-axis center high[3:2], Y-axis center high[1:0] + 0x4b,0x40, // X-axis center low[7:0] 48 + 0x4c,0x10, // Y-axis center low[7:0] e8 + 0x4d,0x80, // Shading Center Gain 80 + 0x4e,0x00, // Shading R Offset + 0x4f,0x00, // Shading Gr Offset + 0x50,0x00, // Shading B Offset + + + // Interpolation + 0x60,0x7f, + 0x61,0x08, + + // Color matrix (D65) - Daylight + + + 0x71,0x39, //0x34 0x39 + 0x72,0xC8, //0xCe 0xCc + 0x73,0xff, //0xFe 0xFb + 0x74,0x13, //0x13 0x10 + 0x75,0x25, //0x25 0x21 + 0x76,0x08, //0x08 0x0f + 0x77,0xf8, //0xec 0xf8 + 0x78,0xc0, //0xd1 0xc0 + 0x79,0x48, //0x47 0x48 + + // Color matrix (D20) - A + 0x83,0x34, //0x3c + 0x84,0xd4, //0xc6 + 0x85,0xf8, //0xff + 0x86,0x12, //0x12 + 0x87,0x25, //0x24 + 0x88,0x09, //0x0a + 0x89,0xf0, //0xed + 0x8a,0xbe, //0xc2 + 0x8b,0x54, //0x51 + + + 0x8c,0x10, //CMA select + + //G Edge + 0x90,0x30, //Upper gain + 0x91,0x40, //down gain + 0x92,0x33,//22}}, //[7:4] upper coring [3:0] down coring + 0x9a,0x40, + 0x9b,0x40, + 0x9c,0x38, //edge suppress start 30 + 0x9d,0x30, //edge suppress slope + + 0x9f,0x26, + 0xa0,0x11, + + 0xa8,0x11,//10}}, + 0xa9,0x11,//10}}, + 0xaa,0x11, + + 0xbf,0x20, + + 0xb9,0x28,//30}}, // nightmode 38 at gain 0x48 5fps + 0xba,0x41,//44}}, // nightmode 80 at gain 0x48 5fps + 0xde,0x80, + + 0xe5,0x15, + 0xe6,0x02, + 0xe7,0x04, + + //Sensor On //Sensor On + 0x00,0x01, + 0x03,0x01, + + 0x00,0x00, +#endif +}; + +uint8_t siv121d_default_regs_init_121du[] = { +#if 0 + 0x00 ,0x00 , + 0x00 ,0x01 , + 0x03 ,0x0a , + + 0x00 ,0x01 , + 0x03 ,0x0a , + + 0x00 ,0x00 , + 0x03 ,0x04 , + 0x10 ,0x85 , //85 + 0x11 ,0x74 , //0x11 0x61 davis20120514 + + 0x00 ,0x01 , + 0x04 ,0x00 , //00 + 0x06 ,0x04 , + 0x10 ,0x46 , + 0x11 ,0x23 , + 0x12 ,0x21 , + 0x17 ,0x86 , + 0x18 ,0x00 , + 0x20 ,0x00 , + 0x21 ,0x05 , + 0x22 ,0x01 , + 0x23 ,0x69 , //add + 0x40 ,0x0F , + 0x41 ,0x90 , + 0x42 ,0xd2 , + 0x43 ,0x00 , + + // AE + 0x00 ,0x02 , + 0x10 ,0x80 , + 0x11 ,0x10 , + 0x12 ,0x65 , // D65 target 60 + 0x14 ,0x62 , // A target 5 + 0x34 ,0x96 , + 0x40 ,0x40 , // 40 + 0x5f ,0x01 , + 0x41 ,0x28 ,//20 , + 0x42 ,0x28 ,//20 , + 0x44 ,0x08 ,//00 , + 0x45 ,0x08 ,//00 , + 0x46 ,0x15 ,//0a , + 0x47 ,0x1c ,//10 , + 0x48 ,0x20 ,//13 , + 0x49 ,0x21 ,//15 , + 0x4a ,0x23 ,//18 , + 0x4b ,0x24 ,//1a , + 0x4c ,0x25 ,//1d , + 0x4d ,0x28 ,//20 , + 0x4e ,0x1c ,//10 , + 0x4f ,0x15 ,//0a , + + 0x50 ,0x10 ,//08 , + 0x51 ,0x10 ,//06 , + 0x52 ,0x0e ,//05 , + 0x53 ,0x0c ,//04 , + 0x54 ,0x0b ,//02 , + 0x55 ,0x0a ,//01 , + 0x90 ,0x80 , + 0x91 ,0x80 , + + // AWB + 0x00 ,0x03 , + 0x10 ,0xd0 , // + 0x11 ,0xc0 ,//c0 + 0x13 ,0x81 , //Cr target + 0x14 ,0x7d , //Cb target 7d + 0x15 ,0xc0 , // R gain Top e0 + 0x16 ,0x8c , // R gain bottom 8c // + 0x17 ,0xe0 , // B gain Top e0 + 0x18 ,0x70 , // B gain bottom 0x80 // + 0x19 ,0x8c , // Cr top value 8c // + 0x1a ,0x64 , // Cr bottom value 0x64 60 //YCbYCr + 0x1b ,0x98 , // Cb top value 0x98 + 0x1c ,0x6c , // Cb bottom value 0x6c // 0x01 + 0x1d ,0x94 , // 0xa0 + 0x1e ,0x6c , // 0x60 + 0x20 ,0xe8 , // AWB luminous top value + 0x21 ,0x30 , // AWB luminous bottom value 0x20 + 0x22 ,0xb8 , + 0x23 ,0x10 , + 0x25 ,0x20 , + 0x26 ,0x0f , + 0x27 ,0x08 , // BRTSRT + 0x28 ,0x0f , // BRTEND + 0x29 ,0xba , // BRTRGNBOT + 0x2a ,0xa0 , // BRTBGNTOP + + 0x40 ,0x01 , + 0x41 ,0x04 , + 0x42 ,0x08 , + 0x43 ,0x10 , + 0x44 ,0x12 , // 0x12 + 0x45 ,0x35 , //35 + 0x46 ,0xfc , // fc + 0x62 ,0x84 , //84 // + 0x63 ,0x90 , // R D30 to D20 + 0x64 ,0xd0 , // B D30 to D20 + 0x65 ,0x90 , // R D20 to D30 + 0x66 ,0xd0 , // B D20 to D30 + + // IDP + 0x00 ,0x04 , + 0x10 ,0xff , + // 0x11 ,0x1d , + 0x11 ,0x1d , //zhongwei changed + 0x12 ,0x3d ,//zhongwei++ + + + // DPCBNR + 0x18 ,0xbe ,//fe , // DPCNRCTRL + 0x19 ,0x00 ,//04 , // DPCTHV + 0x1A ,0x00 ,//01 , // DPCTHVSLP + 0x1B ,0x00 ,//08 , // DPCTHVDIFSRT + 0x1C ,0x0f ,//08 , // DPCTHVDIFSLP + 0x1d ,0xFF , // DPCTHVMAX + + 0x1E ,0x04 , // BNRTHV 0c + 0x1F ,0x04 , // BNRTHVSLPN 10 + 0x20 ,0x10 , // BNRTHVSLPD + 0x21 ,0x00 , /// BNRNEICNT / 0x08 + 0x22 ,0x10 , // STRTNOR // 0x03 + 0x23 ,0x40 , // STRTDRK + + // Gamma + 0x31 ,0x08 ,//0x080x31, 0x04 },//0x08 0x03 + 0x32 ,0x12 ,//0x100x32, 0x0b },//0x10 0x08 + 0x33 ,0x24 ,//0x1B0x33, 0x24 },//0x1B 0x16 + 0x34 ,0x47 ,//0x370x34, 0x49 },//0x37 0x36 + 0x35 ,0x64 ,//0x4D0x35, 0x66 },//0x4D 0x56 + 0x36 ,0x7c ,//0x600x36, 0x7C },//0x60 0x77 + 0x37 ,0x8f ,//0x720x37, 0x8D },//0x72 0x88 + 0x38 ,0x9f ,//0x820x38, 0x9B },//0x82 0x9a + 0x39 ,0xad ,//0x910x39, 0xAA },//0x91 0xA9 + 0x3a ,0xba ,//0xA00x3a, 0xb6 },//0xA0 0xb5 + 0x3b ,0xcf ,//0xBA0x3b, 0xca },//0xBA 0xca + 0x3c ,0xe2 ,//0xD30x3c, 0xdc },//0xD3 0xdd + 0x3d ,0xf0 ,//0xEA0x3d, 0xef },//0xEA 0xee + + // Shading Register Setting + 0x40 ,0x04 , //06 + 0x41 ,0x44 , + 0x42 ,0x43 , + 0x43 ,0x20 , + 0x44 ,0x11 , // left R gain[7:4], right R gain[3:0] 22 + 0x45 ,0x11 , // top R gain[7:4], bottom R gain[3:0] 22 + 0x46 ,0x00 , // left G gain[7:4], right G gain[3:0] + 0x47 ,0x00 , // top G gain[7:4], bottom G gain[3:0] 11 + 0x48 ,0x00 , // left B gain[7:4], right B gain[3:0] + 0x49 ,0x00 , // top B gain[7:4], bottom B gain[3:0] //color matrix default + 0x4a ,0x04 , // X-axis center high[3:2], Y-axis center high[1:0] + 0x4b ,0x60 , // X-axis center low[7:0] 48 + 0x4c ,0xe0 , // Y-axis center low[7:0] e8 + 0x4d ,0x88 , // Shading Center Gain 80 + 0x4e ,0x00 , // Shading R Offset + 0x4f ,0x00 , // Shading Gr Offset + 0x50 ,0x00 , // Shading B Offset + + + // Interpolation + 0x60 ,0x7f , + 0x61 ,0x08 , + + // Color matrix (D65) - Daylight + 0x71 ,0x34 , //0x34 0x39 + 0x72 ,0xCe , //0xCe 0xCc + 0x73 ,0xFe , //0xFe 0xFb + 0x74 ,0x13 , //0x13 0x10 + 0x75 ,0x25 , //0x25 0x21 + 0x76 ,0x08 , //0x08 0x0f + 0x77 ,0xec , //0xec 0xf8 + 0x78 ,0xd1 , //0xd1 0xc0 + 0x79 ,0x47 , //0x47 0x48 + + // Color matrix (D20) - A + 0x83 ,0x38 , //0x3c + 0x84 ,0xd1 , //0xc6 + 0x85 ,0xf7 , //0xff + 0x86 ,0x12 , //0x12 + 0x87 ,0x25 , //0x24 + 0x88 ,0x09 , //0x0a + 0x89 ,0xe1 , //0xed + 0x8a ,0xc7 , //0xc2 + 0x8b ,0x58 , //0x51 + + 0x8c ,0x10 , //CMA select + + //G Edge + 0x90 ,0x20 , //Upper gain + 0x91 ,0x40 , //down gain + 0x92 ,0x44 , //[7:4] upper coring [3:0] down coring + 0x9a ,0x40 , + 0x9b ,0x40 , + 0x9c ,0x38 , //edge suppress start 30 + 0x9d ,0x30 , //edge suppress slope + 0xa8 ,0x10 , + 0xa9 ,0x13 , + 0xaa ,0x13 , + 0xb9 ,0x30 , // nightmode 38 at gain 0x48 5fps + 0xba ,0x44 , // nightmode 80 at gain 0x48 5fps + 0xde ,0x80 , + + 0xe5 ,0x15 , + 0xe6 ,0x02 , + 0xe7 ,0x04 , + + //Sensor On //Sensor On + 0x00 ,0x01 , + 0x03 ,0x01 , + 0x00 ,0x00 , +#else + 0x00,0x00, + 0x03,0x04, + 0x10,0x86,//8d}}, //85 + 0x11,0x74,// f1}}, //0x11 0x61 davis20120514 + + 0x00,0x01, + 0x04,0x00, //00 + 0x06,0x04, + 0x10,0x11,//46}}, + 0x11,0x25,//23}}, + 0x12,0x21, + 0x17,0x94,//86}}, + 0x18,0x00, + 0x20,0x00, + 0x21,0x05, + 0x22,0x01, + 0x23,0x69, //add + 0x40,0x0F, + 0x41,0x90, + 0x42,0xd2, + 0x43,0x00, + + // AE + 0x00,0x02, + 0x10,0x84, + 0x11,0x14,//0c}},//10}}, + 0x12,0x68,//71,//70}}, // D65 target 60 + 0x14,0x40,//68, // A target 5d + 0x34,0x96, + 0x40,0x38,//48}},//40}}, // 40 + 0x44,0x08,//00}}, + + + // AWB + 0x00,0x03, + 0x10,0xD0,//c3}}, // + 0x11,0xc1,//c0}},//c0 + 0x12,0x80, + 0x13,0x80, //Cr target 0x7e + 0x14,0x80, //Cb target 7f + 0x15,0xe0,//c0}}, // R gain Top e0 + 0x16,0x7C,//88}},//8c}}, // R gain bottom 8c // + 0x17,0xe0, // B gain Top e0 + 0x18,0x80,//70}}, // B gain bottom 0x80 // + 0x19,0x8C,//90}}, // Cr top value 8c // + 0x1a,0x64, // Cr bottom value 0x64 60 //YCbYCr + 0x1b,0x94, // Cb top value 0x98 + 0x1c,0x6c, // Cb bottom value 0x6c // 0x01 + 0x1d,0x94, // 0xa0 + 0x1e,0x6c, // 0x60 + 0x20,0xe8, // AWB luminous top value + 0x21,0x30, // AWB luminous bottom value 0x20 + 0x22,0xb8, + 0x23,0x10, + 0x25,0x08,//20}}, + 0x26,0x0f,//0f}}, + 0x27,0x60, // BRTSRT + 0x28,0x70, // BRTEND + 0x29,0xb7, // BRTRGNBOT + 0x2a,0xa3, // BRTBGNTOP + + 0x40,0x01, + 0x41,0x03,//04}}, + 0x42,0x08, + 0x43,0x10, + 0x44,0x13,//12}}, // 0x12 + 0x45,0x6a,//35}}, //35 + 0x46,0xca, // fc + + 0x62,0x80,//84}}, //84 // + + 0x63,0x90,//9c}}, // R D30 to D20 + 0x64,0xD0,//d4}}, // B D30 to D20 + 0x65,0x98,//a0}},//90}}, // R D20 to D30 + 0x66,0xd0, // B D20 to D30 + + // IDP + 0x00,0x04, + 0x10,0x7f,//f, + + 0x11,0x0d, // changed + 0x12,0x3d,//++ + 0x13,0xfe,//++ + 0x14,0x01,//++ + + + // DPCBNR + 0x18,0xbf,//fe, // DPCNRCTRL + 0x19,0x00,//04, // DPCTHV + 0x1A,0x00,//01, // DPCTHVSLP + 0x1B,0x00,//08,//08}}, // DPCTHVDIFSRT + + + + 0x1E,0x04, // BNRTHV 0c + 0x1F,0x08,//04}}, // BNRTHVSLPN 10 + 0x20,0x20, // BNRTHVSLPD + 0x21,0x00, /// BNRNEICNT / 0x08 + 0x22,0x08, // STRTNOR // 0x03 + 0x23,0x38,//40}}, // STRTDRK + 0x24,0x00, + + // Gamma + + 0x31, 0x11,//03,//0x080x31, 0x04 },//0x08 0x03 + 0x32, 0x21,//0b,//0x100x32, 0x0b },//0x10 0x08 + 0x33, 0x37,//1e,//0x1B0x33, 0x24 },//0x1B 0x16 + 0x34, 0x54,//46,//0x370x34, 0x49 },//0x37 0x36 + 0x35, 0x6e,//62,//0x4D0x35, 0x66 },//0x4D 0x56 + 0x36, 0x84,//0x600x36, 0x7C },//0x60 0x77 + 0x37, 0x96,//0x720x37, 0x8D },//0x72 0x88 + 0x38, 0xa7,//0x820x38, 0x9B },//0x82 0x9a + 0x39, 0xb7,//0x910x39, 0xAA },//0x91 0xA9 + 0x3a, 0xc4,//0xA00x3a, 0xb6 },//0xA0 0xb5 + 0x3b, 0xd9,//0xBA0x3b, 0xca },//0xBA 0xca + 0x3c, 0xea,//0xD30x3c, 0xdc },//0xD3 0xdd + 0x3d, 0xf9,//0xEA0x3d, 0xef },//0xEA 0xee + + // Shading Register Setting + 0x40,0x55,//04}}, //06 + 0x41,0x44, + 0x42,0x33,//43}}, + 0x43,0x00, + 0x44,0x22, // left R gain[7:4], right R gain[3:0] 22 + 0x45,0x22, // top R gain[7:4], bottom R gain[3:0] 22 + 0x46,0x00, // left G gain[7:4], right G gain[3:0] + 0x47,0x03, // top G gain[7:4], bottom G gain[3:0] 11 + 0x48,0x01, // left B gain[7:4], right B gain[3:0] + 0x49,0x11, // top B gain[7:4], bottom B gain[3:0] //color matrix default + 0x4a,0x05, // X-axis center high[3:2], Y-axis center high[1:0] + 0x4b,0x40, // X-axis center low[7:0] 48 + 0x4c,0x10, // Y-axis center low[7:0] e8 + 0x4d,0x80, // Shading Center Gain 80 + 0x4e,0x00, // Shading R Offset + 0x4f,0x00, // Shading Gr Offset + 0x50,0x00, // Shading B Offset + + + // Interpolation + 0x60,0x7f, + 0x61,0x08, + + // Color matrix (D65) - Daylight + + + 0x71,0x39, //0x34 0x39 + 0x72,0xC8, //0xCe 0xCc + 0x73,0xff, //0xFe 0xFb + 0x74,0x13, //0x13 0x10 + 0x75,0x25, //0x25 0x21 + 0x76,0x08, //0x08 0x0f + 0x77,0xf8, //0xec 0xf8 + 0x78,0xc0, //0xd1 0xc0 + 0x79,0x48, //0x47 0x48 + + // Color matrix (D20) - A + 0x83,0x34, //0x3c + 0x84,0xd4, //0xc6 + 0x85,0xf8, //0xff + 0x86,0x12, //0x12 + 0x87,0x25, //0x24 + 0x88,0x09, //0x0a + 0x89,0xf0, //0xed + 0x8a,0xbe, //0xc2 + 0x8b,0x54, //0x51 + + + 0x8c,0x10, //CMA select + + //G Edge + 0x90,0x30, //Upper gain + 0x91,0x40, //down gain + 0x92,0x33,//22}}, //[7:4] upper coring [3:0] down coring + 0x9a,0x40, + 0x9b,0x40, + 0x9c,0x38, //edge suppress start 30 + 0x9d,0x30, //edge suppress slope + + 0x9f,0x26, + 0xa0,0x11, + + 0xa8,0x11,//10}}, + 0xa9,0x11,//10}}, + 0xaa,0x11, + + 0xbf,0x20, + + 0xb9,0x28,//30}}, // nightmode 38 at gain 0x48 5fps + 0xba,0x41,//44}}, // nightmode 80 at gain 0x48 5fps + 0xde,0x80, + + 0xe5,0x15, + 0xe6,0x02, + 0xe7,0x04, + + //Sensor On //Sensor On + 0x00,0x01, + 0x03,0x01, + + 0x00,0x00, +#endif +}; + +#endif + -- cgit