Merge branch android-common-3.10
[firefly-linux-kernel-4.4.55.git] / drivers / media / video / nt99252_3way.c
index 7c0b9f5be004fba7e981c68f530f4e2a00cddf88..4b77492af356fbfd6521e47091e9d54273fc85c1 100755 (executable)
@@ -1,7 +1,12 @@
 \r
 #include "generic_sensor.h"\r
-\r
-static int version = KERNEL_VERSION(0,1,0);\r
+/*
+*      Driver Version Note\r
+*v0.0.1: this driver is compatible with generic_sensor\r
+*v0.1.1:\r
+*        add sensor_focus_af_const_pause_usr_cb;\r
+*/\r
+static int version = KERNEL_VERSION(0,1,1);\r
 module_param(version, int, S_IRUGO);\r
 \r
 static int debug =1;\r
@@ -709,8 +714,8 @@ static      struct rk_sensor_reg sensor_Exposure14[]=
        SensorEnd\r
 };\r
 \r
-static struct rk_sensor_reg *sensor_ExposureSeqe[] = {sensor_Exposure04,sensor_Exposure03, sensor_Exposure02, sensor_Exposure01, sensor_Exposure00,\r
-       sensor_Exposure11, sensor_Exposure12,sensor_Exposure13,sensor_Exposure14,NULL,\r
+static struct rk_sensor_reg *sensor_ExposureSeqe[] = {/*sensor_Exposure04,*/sensor_Exposure03, sensor_Exposure02, sensor_Exposure01, sensor_Exposure00,\r
+       sensor_Exposure11, sensor_Exposure12,sensor_Exposure13,/*sensor_Exposure14,*/NULL,\r
 };\r
 \r
 \r
@@ -877,7 +882,7 @@ static struct v4l2_querymenu sensor_menus[] =
 static struct sensor_v4l2ctrl_usr_s sensor_controls[] =\r
 {\r
        new_user_v4l2ctrl(V4L2_CID_DO_WHITE_BALANCE,V4L2_CTRL_TYPE_MENU,"White Balance Control", 0, 5, 1, 0,sensor_v4l2ctrl_default_cb, sensor_WhiteBalanceSeqe),\r
-       new_user_v4l2ctrl(V4L2_CID_EXPOSURE,V4L2_CTRL_TYPE_INTEGER,"Exposure Control", -4, 4, 1, 0,sensor_v4l2ctrl_default_cb, sensor_ExposureSeqe),\r
+       new_user_v4l2ctrl(V4L2_CID_EXPOSURE,V4L2_CTRL_TYPE_INTEGER,"Exposure Control", -3, 3, 1, 0,sensor_v4l2ctrl_default_cb, sensor_ExposureSeqe),\r
        new_user_v4l2ctrl(V4L2_CID_EFFECT,V4L2_CTRL_TYPE_MENU,"Effect Control", 0, 6, 1, 0,sensor_v4l2ctrl_default_cb, sensor_EffectSeqe),\r
        new_user_v4l2ctrl(V4L2_CID_CONTRAST,V4L2_CTRL_TYPE_INTEGER,"Contrast Control", -4, 4, 1, 0,sensor_v4l2ctrl_default_cb, sensor_ContrastSeqe),\r
 };\r
@@ -897,54 +902,6 @@ static struct soc_camera_ops sensor_ops;
 * Please codeing your program here \r
 **********************************************************\r
 */\r
-static int sensor_parameter_record(struct i2c_client *client)\r
-{\r
-       u8 ret_l,ret_m,ret_h;\r
-       int tp_l,tp_m,tp_h;\r
-       \r
-       struct generic_sensor *sensor = to_generic_sensor(client);\r
-       struct specific_sensor *spsensor = to_specific_sensor(sensor);\r
-\r
-       sensor_read(client,0x3a00, &ret_l);\r
-       sensor_write(client,0x3a00, ret_l&0xfb);\r
-\r
-       sensor_write(client,0x3503,0x07);       //stop AE/AG\r
-\r
-       sensor_read(client,0x3500,&ret_h);\r
-       sensor_read(client,0x3501, &ret_m);\r
-       sensor_read(client,0x3502, &ret_l);\r
-       tp_l = ret_l;\r
-       tp_m = ret_m;\r
-       tp_h = ret_h;\r
-       spsensor->parameter.preview_exposure = ((tp_h<<12) & 0xF000) | ((tp_m<<4) & 0x0FF0) | ((tp_l>>4) & 0x0F);\r
-       \r
-       //Read back AGC Gain for preview\r
-       sensor_read(client,0x350b, &ret_l);\r
-       spsensor->parameter.preview_gain = ret_l;\r
-\r
-       spsensor->parameter.CapturePclk = 24000;\r
-       spsensor->parameter.PreviewPclk = 24000;\r
-       spsensor->parameter.PreviewDummyPixels = 0;\r
-       spsensor->parameter.CaptureDummyPixels = 0;\r
-       SENSOR_DG("Read 0x350b=0x%02x  PreviewExposure:%d 0x3500=0x%02x  0x3501=0x%02x 0x3502=0x%02x",\r
-                 ret_l,spsensor->parameter.preview_exposure,tp_h, tp_m, tp_l);\r
-       return 0;\r
-}\r
-#define OV2659_FULL_PERIOD_PIXEL_NUMS  (1940)  // default pixel#(w/o dummy pixels) in UXGA mode\r
-#define OV2659_FULL_PERIOD_LINE_NUMS   (1238)  // default line#(w/o dummy lines) in UXGA mode\r
-#define OV2659_PV_PERIOD_PIXEL_NUMS   (970)  // default pixel#(w/o dummy pixels) in SVGA mode\r
-#define OV2659_PV_PERIOD_LINE_NUMS       (618)   // default line#(w/o dummy lines) in SVGA mode\r
-\r
-/* SENSOR EXPOSURE LINE LIMITATION */\r
-#define OV2659_FULL_EXPOSURE_LIMITATION   (1236)\r
-#define OV2659_PV_EXPOSURE_LIMITATION    (618)\r
-\r
-// SENSOR UXGA SIZE\r
-#define OV2659_IMAGE_SENSOR_FULL_WIDTH   (1600)\r
-#define OV2659_IMAGE_SENSOR_FULL_HEIGHT   (1200)\r
-\r
-#define OV2659_FULL_GRAB_WIDTH                         (OV2659_IMAGE_SENSOR_FULL_WIDTH - 16)\r
-#define OV2659_FULL_GRAB_HEIGHT                        (OV2659_IMAGE_SENSOR_FULL_HEIGHT - 12)\r
 \r
 /*\r
 **********************************************************\r
@@ -957,8 +914,6 @@ static int sensor_parameter_record(struct i2c_client *client)
 */\r
 static int sensor_activate_cb(struct i2c_client *client)\r
 {\r
-    u8 reg_val;\r
-\r
     SENSOR_DG("%s",__FUNCTION__);      \r
        return 0;\r
 }\r
@@ -967,7 +922,6 @@ static int sensor_activate_cb(struct i2c_client *client)
 */\r
 static int sensor_deactivate_cb(struct i2c_client *client)\r
 {\r
-       u8 reg_val;\r
        struct generic_sensor *sensor = to_generic_sensor(client);\r
 \r
     SENSOR_DG("%s",__FUNCTION__);\r
@@ -1134,11 +1088,16 @@ static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client,int pos){
 static int sensor_focus_af_const_usr_cb(struct i2c_client *client){\r
        return 0;\r
 }\r
+static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client)
+{
+    return 0;
+}\r
 static int sensor_focus_af_close_usr_cb(struct i2c_client *client){\r
        return 0;\r
 }\r
 \r
-static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client){\r
+static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client, int *zone_tm_pos)\r
+{\r
        return 0;\r
 }\r
 \r