ARM64: DTS: Add rk3399-firefly uart4 device, node as /dev/ttyS1
[firefly-linux-kernel-4.4.55.git] / drivers / media / video / hi704.c
index 09ea70fb3a1fc254a4358f9f46e75e0353dff60c..d12c5eeec1b50bb5a78b47bc47a976a9f58d7a5c 100755 (executable)
@@ -106,8 +106,9 @@ struct  flash_timer{
     struct soc_camera_device *icd;
        struct hrtimer timer;
 };
+#if CONFIG_SENSOR_Flash
 static enum hrtimer_restart flash_off_func(struct hrtimer *timer);
-
+#endif
 static struct  flash_timer flash_off_timer;
 //for user defined if user want to customize the series , zyc
 #ifdef CONFIG_HI704_USER_DEFINED_SERIES
@@ -123,7 +124,7 @@ static struct reginfo sensor_init_data[] =
 {0x01, 0xf3},   //PWRCTL(0x01[P0])Bit[1]:Software Reset.
 {0x01, 0xf1},
 {0x10, 0x00},//vga mode
-{0x11, 0x91},   //For No Fixed Framerate Bit[2]
+{0x11, 0x90},   //For No Fixed Framerate Bit[2]
 {0x12, 0x04},
     
 {0x20, 0x00},
@@ -150,13 +151,13 @@ static struct reginfo sensor_init_data[] =
 {0x85, 0x4b},
 {0x89, 0x48},
     
-{0x90, 0x0b},
-{0x91, 0x0b},    
-{0x92, 0x48},
-{0x93, 0x48},
+{0x90, 0x0c},
+{0x91, 0x0c},    
+{0x92, 0x78},
+{0x93, 0x70},
 {0x98, 0x38},
 {0x99, 0x40},
-{0xa0, 0x00},
+{0xa0, 0x40},
 {0xa8, 0x40},
 
 //PAGE 2
@@ -240,7 +241,7 @@ static struct reginfo sensor_init_data[] =
 {0x11, 0x43},
 {0x12, 0x30},
     
-{0x40, 0x10},//brightness +1
+{0x40, 0x00},//brightness +1
 {0x41, 0x02},
 {0x48, 0x98},//contrast level +1
     
@@ -379,7 +380,7 @@ static struct reginfo sensor_init_data[] =
 {0x39,0xbd},
 {0x3a,0xc8},
 {0x3b,0xd9},
-{0x3c,0xe8},
+{0x3c,0xe5},
 {0x3d,0xf5},
 {0x3e,0xff},
  //0930
@@ -449,7 +450,7 @@ static struct reginfo sensor_init_data[] =
 {0x6A, 0x28},
 {0x6B, 0xc8},
 
-{0x70, 0x42},//Y Target 42
+{0x70, 0x38},//Y Target 42
 
 {0x76, 0x22}, //Unlock bnd1
 {0x77, 0x02}, //Unlock bnd2 02->a2 _10_04_06 hhzin
@@ -507,12 +508,12 @@ static struct reginfo sensor_init_data[] =
 {0x99, 0x23},
 
 {0x9c, 0x0b}, //4shared limit_10_04_06 hhzin
-{0x9d, 0x3b}, // 0x06d3 --> 0x0b3b
+{0x9d, 0xb8}, // 0x06d3 --> 0x0b3b
 {0x9e, 0x00}, //4shared Unit_10_04_06 hhzin
 {0x9f, 0xfa}, // 0x01f4 --> 0xfa
 
 {0xb1, 0x14},
-{0xb2, 0x50},
+{0xb2, 0x30},
 {0xb4, 0x14},
 {0xb5, 0x38},
 {0xb6, 0x26},
@@ -601,10 +602,10 @@ static struct reginfo sensor_vga[] =
 {0x20, 0x00},
 {0x21, 0x04},
 
-{0x40, 0x00},        //HBLANK: 0x70 = 112
-{0x41, 0x70},
+{0x40, 0x01},        //HBLANK: 0x70 = 112
+{0x41, 0x58},
 {0x42, 0x00},        //VBLANK: 0x04 = 4
-{0x43, 0x40},
+{0x43, 0x64},
 
 {0x03, 0x11},
 {0x10, 0x25},  
@@ -612,19 +613,19 @@ static struct reginfo sensor_vga[] =
 {0x03, 0x20},
 {0x83, 0x00},
 {0x84, 0xaf},
-{0x85, 0x80},
+{0x85, 0xc8},
 {0x86, 0x00},
-{0x87, 0xc0},
+{0x87, 0xf0},
 
 {0x8b, 0x3a},
-{0x8c, 0x80},
+{0x8c, 0x98},
 {0x8d, 0x30},
-{0x8e, 0xc0},
+{0x8e, 0xd4},
 
-{0x9c, 0x08},
-{0x9d, 0xa0},
+{0x9c, 0x0b},
+{0x9d, 0xb8},
 {0x9e, 0x00},
-{0x9f, 0xc0},
+{0x9f, 0xfa},
 {END_REG, END_REG},
 };
 
@@ -646,7 +647,7 @@ static  struct reginfo sensor_qvga[] =
 {0x40, 0x01},        //HBLANK:  0x0158 = 344
 {0x41, 0x58},
 {0x42, 0x00},        //VBLANK:  0x14 = 20
-{0x43, 0x14},
+{0x43, 0x64},
 
 {0x03, 0x11},        //QVGA Fixframerate
 {0x10, 0x21},  
@@ -665,7 +666,7 @@ static  struct reginfo sensor_qvga[] =
 {0x8e, 0xd4},
 
 {0x9c, 0x0b},
-{0x9d, 0x3b},
+{0x9d, 0xb8},
 {0x9e, 0x00},
 {0x9f, 0xfa},
 {END_REG, END_REG},
@@ -984,8 +985,8 @@ static  struct reginfo sensor_Saturation1[]=
 {
                //00 level
        {0x03, 0x10},
-       {0x62, 0x90},
-       {0x63, 0x90},
+       {0x62, 0x80},
+       {0x63, 0x80},
        {END_REG, END_REG},
 };
 
@@ -1029,7 +1030,7 @@ static  struct reginfo sensor_Contrast3[]=
 {
     //Contrast 0
     {0x03, 0x10},
-    {0x48, 0x84},
+    {0x48, 0x80},
        {END_REG, END_REG},
 };
 
@@ -1127,7 +1128,7 @@ static struct reginfo sensor_Zoom3[] =
 };
 static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,};
 #endif
-static const struct v4l2_querymenu sensor_menus[] =
+static  struct v4l2_querymenu sensor_menus[] =
 {
        #if CONFIG_SENSOR_WhiteBalance
     { .id = V4L2_CID_DO_WHITE_BALANCE,  .index = 0,  .name = "auto",  .reserved = 0, }, {  .id = V4L2_CID_DO_WHITE_BALANCE,  .index = 1, .name = "incandescent",  .reserved = 0,},
@@ -1650,7 +1651,7 @@ static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd
 sensor_power_end:
        return ret;
 }
-
+#if CONFIG_SENSOR_Flash
 static enum hrtimer_restart flash_off_func(struct hrtimer *timer){
        struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer);
     sensor_ioctrl(fps_timer->icd,Sensor_Flash,0);
@@ -1658,6 +1659,7 @@ static enum hrtimer_restart flash_off_func(struct hrtimer *timer){
     return 0;
     
 }
+#endif
 static int sensor_init(struct v4l2_subdev *sd, u32 val)
 {
     struct i2c_client *client = v4l2_get_subdevdata(sd);