Added @lex' improved GC2035 driver from https://github.com/avafinger/gc2035

This commit is contained in:
ThomasKaiser 2016-06-11 17:27:24 +02:00
parent 81393985f0
commit 8bf22ad0f8
10 changed files with 3315 additions and 994 deletions

View file

@ -2,7 +2,7 @@
BOARD_NAME="Orange Pi 2"
LINUXFAMILY=sun8i
BOOTCONFIG=orangepi_2_defconfig
MODULES="8189es #gpio_sunxi #w1-sunxi #w1-gpio #w1-therm #gc2035"
MODULES="8189es #gpio_sunxi #w1-sunxi #w1-gpio #w1-therm #gc2035 #vfe_v4l2"
MODULES_NEXT=""
CPUMIN=480000
CPUMAX=1296000

View file

@ -2,7 +2,7 @@
BOARD_NAME="Orange Pi Lite"
LINUXFAMILY=sun8i
BOOTCONFIG=orangepi_one_defconfig
MODULES="8189fs #gpio_sunxi #w1-sunxi #w1-gpio #w1-therm #gc2035"
MODULES="8189fs #gpio_sunxi #w1-sunxi #w1-gpio #w1-therm #gc2035 #vfe_v4l2"
MODULES_NEXT=""
CPUMIN=480000
CPUMAX=1200000

View file

@ -2,7 +2,7 @@
BOARD_NAME="Orange Pi One"
LINUXFAMILY=sun8i
BOOTCONFIG=orangepi_one_defconfig
MODULES="#gpio_sunxi #w1-sunxi #w1-gpio #w1-therm #gc2035"
MODULES="#gpio_sunxi #w1-sunxi #w1-gpio #w1-therm #gc2035 #vfe_v4l2"
MODULES_NEXT=""
CPUMIN=480000
CPUMAX=1200000

View file

@ -2,7 +2,7 @@
BOARD_NAME="Orange Pi PC"
LINUXFAMILY=sun8i
BOOTCONFIG=orangepi_pc_defconfig
MODULES="8189es #gpio_sunxi #w1-sunxi #w1-gpio #w1-therm #gc2035"
MODULES="8189es #gpio_sunxi #w1-sunxi #w1-gpio #w1-therm #gc2035 #vfe_v4l2"
MODULES_NEXT=""
CPUMIN=480000
CPUMAX=1296000

View file

@ -2,7 +2,7 @@
BOARD_NAME="Orange Pi PC +"
LINUXFAMILY=sun8i
BOOTCONFIG=orangepi_pc_defconfig
MODULES="8189fs #gpio_sunxi #w1-sunxi #w1-gpio #w1-therm #gc2035"
MODULES="8189fs #gpio_sunxi #w1-sunxi #w1-gpio #w1-therm #gc2035 #vfe_v4l2"
MODULES_NEXT=""
CPUMIN=480000
CPUMAX=1296000

View file

@ -2,7 +2,7 @@
BOARD_NAME="Orange Pi+"
LINUXFAMILY=sun8i
BOOTCONFIG=orangepi_plus_defconfig
MODULES="8189es #gpio_sunxi #w1-sunxi #w1-gpio #w1-therm #gc2035"
MODULES="8189es #gpio_sunxi #w1-sunxi #w1-gpio #w1-therm #gc2035 #vfe_v4l2"
MODULES_NEXT=""
CPUMIN=480000
CPUMAX=1296000

View file

@ -2,7 +2,7 @@
BOARD_NAME="Orange Pi+ 2E"
LINUXFAMILY=sun8i
BOOTCONFIG=orangepi_pc_defconfig
MODULES="8189fs #gpio_sunxi #w1-sunxi #w1-gpio #w1-therm #gc2035"
MODULES="8189fs #gpio_sunxi #w1-sunxi #w1-gpio #w1-therm #gc2035 #vfe_v4l2"
MODULES_NEXT=""
CPUMIN=480000
CPUMAX=1296000

View file

@ -181,7 +181,7 @@ pll_de = 864
; dram_tpr7[9:0] to set ddr3 or ddr3l clk.
;*****************************************************************************
[dram_para]
dram_clk = 576
dram_clk = 624
dram_type = 3
dram_zq = 0x3b3bfb
dram_odt_en = 0x1

File diff suppressed because it is too large Load diff

View file

@ -1,986 +0,0 @@
diff --git a/drivers/media/video/sunxi-vfe/device/gc2035.c b/drivers/media/video/sunxi-vfe/device/gc2035.c
index 1d3eb0e..36f94b2 100755
--- a/drivers/media/video/sunxi-vfe/device/gc2035.c
+++ b/drivers/media/video/sunxi-vfe/device/gc2035.c
@@ -97,7 +97,676 @@ static inline struct sensor_info *to_state(struct v4l2_subdev *sd)
* The default register settings
*
*/
+/* ----------------------------------- */
+/* comment _640x480_1280x720_ONLY */
+/* if you want 800x600 and 1600x1200 */
+/* ----------------------------------- */
+#define _640x480_1280x720_ONLY
+#ifdef _640x480_1280x720_ONLY
+static struct regval_list sensor_default_regs[] = {
+ {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,0x02}, //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,0x80}, //0x75
+ {0x1f,0xc0},//addd
+ {0x20,0x50},//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,0x40},//0x40
+ {0xfe,0x00},
+ {0xb6,0x03}, //AEC enable
+ {0xfe,0x00},
+
+ ///////BLK
+
+ {0x3f,0x00}, //prc close???
+ {0x40,0xa7}, // a7 77
+ {0x42,0x7f},
+ {0x43,0x30},//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,0x20},
+ {0x5f,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},
+
+ {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 1
+ //lsc,
+ {0xfe,0x01},
+ {0xc2,0x10},//0x1f
+ {0xc3,0x02},//0x07
+ {0xc4,0x03},//0x03
+ {0xc8,0x10},//10
+ {0xc9,0x0a},//0x0a
+ {0xca,0x08},//0x08
+ {0xbc,0x16},// 3c
+ {0xbd,0x10},//0x1c
+ {0xbe,0x10},//0x1a
+ {0xb6,0x22},// 0x30
+ {0xb7,0x18},//0x1c
+ {0xb8,0x15},//0x15
+ {0xc5,0x00},
+ {0xc6,0x00},
+ {0xc7,0x00},
+ {0xcb,0x00},
+ {0xcc,0x00},
+ {0xcd,0x00},
+ {0xbf,0x0a},//0x0c
+ {0xc0,0x01},//0x04
+ {0xc1,0x00},
+ {0xb9,0x00},
+ {0xba,0x00},
+ {0xbb,0x00},
+ {0xaa,0x00},
+ {0xab,0x02},//00
+ {0xac,0x00},
+ {0xad,0x00},
+ {0xae,0x00},
+ {0xaf,0x00},
+ {0xb0,0x00},
+ {0xb1,0x00},
+ {0xb2,0x00},
+ {0xb3,0x00},
+ {0xb4,0x02},//00
+ {0xb5,0x00},
+ {0xd0,0x01},
+ {0xd2,0x02},//00
+ {0xd3,0x00},
+ {0xd8,0x18},
+ {0xda,0x00},
+ {0xdb,0x04},
+ {0xdc,0x00},
+ {0xde,0x07},//0x07
+ {0xdf,0x00},
+ {0xd4,0x00},
+ {0xd6,0x00},//00
+ {0xd7,0x00},
+ {0xa4,0x20},//00
+ {0xa5,0x02},//00
+ {0xa6,0x04},
+ {0xa7,0x00},
+ {0xa8,0x20},//00
+ {0xa9,0x02},//00
+ {0xa1,0x80},
+ {0xa2,0x80},
+
+ {0xfe,0x02},
+ {0xa4,0x00},
+ {0xfe,0x00},
+
+ {0xfe,0x02},
+ {0xc0,0x01},
+ {0xc1,0x40}, //Green_cc
+ {0xc2,0xfc},
+ {0xc3,0x05},
+ {0xc4,0xec},
+ {0xc5,0x42},
+ {0xc6,0xf8},
+ {0xc7,0x40},
+ {0xc8,0xf8},
+ {0xc9,0x06},
+ {0xca,0xfd},
+ {0xcb,0x3e},
+ {0xcc,0xf3},
+ {0xcd,0x36},
+ {0xce,0xf6},
+ {0xcf,0x04},
+ {0xe3,0x0c},
+ {0xe4,0x44},
+ {0xe5,0xe5},
+ {0xfe,0x00},
+ {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,0x02}, // d65
+ {0x4e,0x04},
+ {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},
+ {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}, //H
+ {0x4e,0x40}, // h
+ {0x4e,0x00}, //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,0x40},
+ {0x4e,0x40},
+ {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,0x88},
+ {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,0x8a},//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
+
+ //{0xfe ,0xec}, luma_value
+
+ {0xfe,0x01},
+ {0x1e,0xf1},
+ {0x9c,0x00}, //add abs slope 0x02
+ {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,0x00},//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,0x66}, //6edge effect slope 0x66 0x88 0x99
+
+ {0xb3,0x70}, //saturation dec slope //0x70 0x40
+ {0xb4,0x32},//0x32 0x42
+ {0x8c,0xf6}, //[2]b_in_dark_inc
+ {0x89,0x03}, //dn_c_weight 0x03
+
+ {0xde,0xb8}, //b6[7]asde_autogray [3:0]auto_gray_value 0xb9 0xb8 0xb9
+ {0x38,0x06}, //0aasde_autogray_slope 0x08 0x05 0x06 0x0a
+ {0x39,0x50}, //50asde_autogray_threshold 0x50 0x30
+
+ {0xfe,0x00},
+ {0x81,0x24}, //0x26
+ {0x87,0x90}, //[5:4]first_dn_en first_dd_en enable 0x80 0xb0
+
+ {0xfe,0x02},
+ {0x83,0x00},//[6]green_bks_auto [5]gobal_green_bks
+ {0x84,0x45},//RB offset
+ {0xd1,0x38}, //saturation_cb 0x3a
+ {0xd2,0x38}, //saturation_Cr 0x38
+ {0xd3,0x30},
+ {0xdc,0x30},
+ {0xdd,0xb8}, //edge_sa_g,b
+ {0xfe,0x00},
+ {0xad,0x80},//80
+ {0xae,0x7d},//80
+ {0xaf,0x80},
+
+ //gmma-curve4-low strech
+ {0xfe,0x02},
+ {0x15,0x05},
+ {0x16,0x0b},
+ {0x17,0x10},
+ {0x18,0x16},
+ {0x19,0x24},
+ {0x1a,0x32},
+ {0x1b,0x42},
+ {0x1c,0x4e},
+ {0x1d,0x64},
+ {0x1e,0x76},
+ {0x1f,0x86},
+ {0x20,0x94},
+ {0x21,0x9f},
+ {0x22,0xb4},
+ {0x23,0xc3},
+ {0x24,0xce},
+ {0x25,0xd7},
+ {0x26,0xe3},
+ {0x27,0xec},
+ {0x28,0xf7},
+ {0x29,0xff},
+
+
+
+ //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},
+
+ {0xfe,0x00},
+
+ {0x82,0xfe},
+ //sleep 400
+ {0xf2,0x70},
+ {0xf3,0xff},
+ {0xf4,0x00},
+ {0xf5,0x30},
+ {0xfe,0x01},
+ {0x0b,0x90},
+ {0x87,0x00},//0x10
+ {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,0x08}, //asde_autogray_slope 0x08 0x0f 0x0a 0b
+ {0x39,0x50}, //asde_autogray_threshold 0x60
+ {0xfe,0x00},
+ {0x87,0x90}, //[5:4]first_dn_en first_dd_en 0x90
+
+ {0xfe,0x00},
+ {0x90,0x01},
+ {0x95,0x01},
+ {0x96,0xe0},
+ {0x97,0x02},
+ {0x98,0x80},
+ {0xc8,0x14},
+ {0xf7,0x0D},
+ {0xf8,0x83},
+ {0xfa,0x00},//pll=4
+ {0x05,0x00},
+ {0x06,0xc4},
+ {0x07,0x00},
+ {0x08,0xae},
+ {0xad,0x80},
+ {0xae,0x7a},
+ {0xaf,0x7a},
+ {0xfe,0x01},
+ {0x27,0x00},
+ {0x28,0xe5},
+ {0x29,0x05},
+ {0x2a,0x5e},//18fps
+ {0x2b,0x07},
+ {0x2c,0x28},//12.5fps
+ {0x2d,0x0a},
+ {0x2e,0xbc},//8fps
+ {0x3e,0x40},// exposure level
+ {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},
+};
+#else
static struct regval_list sensor_default_regs[] = {
{0xfe , 0x80},
{0xfe , 0x80},
@@ -774,6 +1443,7 @@ static struct regval_list sensor_default_regs[] = {
#endif
};
+#endif
/* 1600X1200 UXGA capture */
static struct regval_list sensor_uxga_regs[] ={
@@ -827,73 +1497,101 @@ static struct regval_list sensor_svga_regs[] =
{0x98,0x20},
};
+/* 640X480 VGA */
+static struct regval_list sensor_vga_regs[] =
+{
+ {0xfe , 0x00},
+
+ {0x0a , 0x00}, //row start
+ {0x0c , 0x00}, //col start
+
+ {0x0d , 0x04},
+ {0x0e , 0xc0},
+ {0x0f , 0x06}, //Window setting
+ {0x10 , 0x58},//
+
+ {0x90 , 0x01},
+ {0x94 , 0x00},
+ {0x95 , 0x01},
+ {0x96 , 0xe0},
+ {0x97 , 0x02},
+ {0x98 , 0x80},
+ {0xc8 , 0x15},
+
+
+
+ {0xfa , 0x00},
+
+
+ {0xfe , 0x03},
+ {0x42 , 0x00},
+ {0x43 , 0x05}, //output buf width 280*2=500
+ {0x41 , 0x02}, // delay
+ {0x40 , 0x40}, //fifo half full trig
+ {0x17 , 0x00}, //widv is 0
+
+ {0xfe , 0x00},
+ {0xc8 , 0x55},
+ {0xb6 , 0x03},//aec on
+};
+
+
////1280*720---init---///
-//static struct regval_list Gc2015_sensor_hd720_regs[] = {
-//
-//
-//{0xfe , 0x00},
-//{0x05, 0x01},
-//{0x06, 0x9e},
-//{0x07, 0x01},
-//{0x08, 0x6d},
-//{0x0a , 0xf0}, //row start
-//{0x0c , 0xa0}, //col start
-//{0x0d , 0x02},
-//{0x0e , 0xd8},
-//{0x0f , 0x05}, //Window setting
-//{0x10 , 0x18},
-//
-//{0xfe, 0x01},
-//{0x27, 0x00},
-//{0x28, 0xd9},
-//{0x29, 0x04},
-//{0x2a, 0x3d},//18fps
-//{0x2b, 0x06},
-//{0x2c, 0xc8},//12.5fps
-//{0x2d, 0x0a},
-//{0x2e, 0x2c},//8fps
-//{0x3e, 0x40},//0x40 0x00
-//
-////measure window
-//{0xfe, 0x00},
-//{0xec, 0x04},
-//{0xed, 0x04},
-//{0xee, 0x50},
-//{0xef, 0x58},
-//
-//
-//
-//
-//{0x90 , 0x01}, //crop enable
-//{0x95 , 0x02},
-//{0x96 , 0xd0},
-//{0x97 , 0x05},
-//{0x98 , 0x00},
-//
-//
-//{0xfe , 0x03},
-//{0x42 , 0x80},
-//{0x43 , 0x06}, //output buf width
-//{0x41 , 0x00}, // delay
-//{0x40 , 0x00}, //fifo half full trig
-//{0x17 , 0x01}, //widv
-//{0xfe , 0x00},
-//
-//
-//{0x99, 0x11},
-//{0xc8, 0x00},
-//
-//{0xfa, 0x11},
-//
-//
-//
-//
-//
-//{0xff, 0xff},
-//
-//
-//
-//};
+static struct regval_list Gc2015_sensor_hd720_regs[] =
+{
+{0xfe , 0x00},
+{0x05, 0x01},
+{0x06, 0x9e},
+{0x07, 0x01},
+{0x08, 0x6d},
+{0x0a , 0xf0}, //row start
+{0x0c , 0xa0}, //col start
+{0x0d , 0x02},
+{0x0e , 0xd8},
+{0x0f , 0x05}, //Window setting
+{0x10 , 0x18},
+
+{0xfe, 0x01},
+{0x27, 0x00},
+{0x28, 0xd9},
+{0x29, 0x04},
+{0x2a, 0x3d},//18fps
+{0x2b, 0x06},
+{0x2c, 0xc8},//12.5fps
+{0x2d, 0x0a},
+{0x2e, 0x2c},//8fps
+{0x3e, 0x40},//0x40 0x00
+
+//measure window
+{0xfe, 0x00},
+{0xec, 0x04},
+{0xed, 0x04},
+{0xee, 0x50},
+{0xef, 0x58},
+
+{0x90 , 0x01}, //crop enable
+{0x95 , 0x02},
+{0x96 , 0xd0},
+{0x97 , 0x05},
+{0x98 , 0x00},
+
+
+{0xfe , 0x03},
+{0x42 , 0x80},
+{0x43 , 0x06}, //output buf width
+{0x41 , 0x00}, // delay
+{0x40 , 0x00}, //fifo half full trig
+{0x17 , 0x01}, //widv
+{0xfe , 0x00},
+
+{0x99, 0x11},
+{0xc8, 0x00},
+
+{0xfa, 0x11},
+
+{0xff, 0xff},
+
+};
@@ -2427,16 +3125,16 @@ sensor_win_sizes[] = {
.regs_size = ARRAY_SIZE(sensor_uxga_regs),
.set_size = NULL,
},
-// /* 720p */
-// {
-// .width = HD720_WIDTH,
-// .height = HD720_HEIGHT,
-// .hoffset = 0,
-// .voffset = 0,
-// .regs = Gc2015_sensor_hd720_regs,
-// .regs_size = ARRAY_SIZE(Gc2015_sensor_hd720_regs),
-// .set_size = NULL,
-// },
+ /* 720p */
+ {
+ .width = HD720_WIDTH,
+ .height = HD720_HEIGHT,
+ .hoffset = 0,
+ .voffset = 0,
+ .regs = Gc2015_sensor_hd720_regs,
+ .regs_size = ARRAY_SIZE(Gc2015_sensor_hd720_regs),
+ .set_size = NULL,
+ },
/* SVGA */
{
.width = SVGA_WIDTH,
@@ -2448,7 +3146,6 @@ sensor_win_sizes[] = {
.set_size = NULL,
},
/* VGA */
- /*
{
.width = VGA_WIDTH,
.height = VGA_HEIGHT,
@@ -2458,7 +3155,6 @@ sensor_win_sizes[] = {
.regs_size = ARRAY_SIZE(sensor_vga_regs),
.set_size = NULL,
},
- */
};
#define N_WIN_SIZES (ARRAY_SIZE(sensor_win_sizes))
@@ -2571,14 +3267,12 @@ static int sensor_s_fmt(struct v4l2_subdev *sd,
if (ret)
return ret;
+#ifndef _640x480_1280x720_ONLY
if((wsize->width==1600)&&(wsize->height==1200)) //capture mode >640*480
{
// printk(" read 2035 exptime 11111111\n" );
-
sensor_write(sd, 0xfe, 0x00);
-
sensor_write(sd, 0xb6, 0x02);
-
/*read shutter */
sensor_read(sd, 0x03, &val);
temp |= (val<< 8);
@@ -2591,6 +3285,7 @@ static int sensor_s_fmt(struct v4l2_subdev *sd,
shutter=temp;
// printk(" shutter = [%x]\n", shutter);
}
+#endif
sensor_write_array(sd, sensor_fmt->regs , sensor_fmt->regs_size);
@@ -2612,28 +3307,47 @@ static int sensor_s_fmt(struct v4l2_subdev *sd,
//////////
#if 1
+
+#ifdef _640x480_1280x720_ONLY
+ if((wsize->width==1600)&&(wsize->height==1200)) {
+
+ sensor_write(sd, 0xfe, 0x00);
+ sensor_write(sd, 0xb6, 0x02); // AEC OFF
+ sensor_read(sd, 0x03, &val);
+ temp |= (val<< 8);
+ sensor_read(sd, 0x04, &val);
+ temp |= (val & 0xff);
+ shutter=temp;
+ shutter= shutter /2; // 2
+ if (shutter < 1)
+ shutter = 1;
+ val = ((shutter>>8)&0xff);
+ sensor_write(sd, 0x03, val);
+ val = (shutter&0xff);
+ sensor_write(sd, 0x04, val);
+ msleep(550);
+ }
+#else
if((wsize->width==1600)&&(wsize->height==1200))
{
-
-
//printk(" write 2035 exptime 22222222\n" );
-
-
sensor_write(sd, 0xfe, 0x00);
-
shutter= shutter /2; // 2
-
if(shutter < 1) shutter = 1;
val = ((shutter>>8)&0xff);
// printk(" write0x03 = [%x]\n", regs.value[0]);
sensor_write(sd, 0x03, val);
-
val = (shutter&0xff);
-
sensor_write(sd, 0x04, val);
-
msleep(550);
}
+#endif
+ if((wsize->width==640)&&(wsize->height==480)) {
+ mdelay(50);//200
+ sensor_write(sd, 0xb6, 0x03); // AEC ON
+ mdelay(300);
+ }
+
#endif
/////////////////////////////
@@ -3041,3 +3755,4 @@ static __exit void exit_sensor(void)
module_init(init_sensor);
module_exit(exit_sensor);
+