camera: modify mv9335 autofocus logic.
authorzyc <zyc@rock-chips.com>
Fri, 11 Jan 2013 07:10:01 +0000 (15:10 +0800)
committerzyc <zyc@rock-chips.com>
Fri, 11 Jan 2013 07:10:01 +0000 (15:10 +0800)
drivers/media/video/mv9335/mv9335.c

index 44acfbaf36813f21bc59853585beacc10269356c..cfc49b710a313b3fa4c33379a17785487ed5b1d2 100755 (executable)
@@ -543,7 +543,7 @@ static  struct v4l2_queryctrl sensor_controls[] =
         .type          = V4L2_CTRL_TYPE_INTEGER,\r
         .name          = "Focus Control",\r
         .minimum       = 0,\r
-        .maximum       = 2,\r
+        .maximum       = 0xff,\r
         .step          = 1,\r
         .default_value = 0,\r
     },\r
@@ -1307,7 +1307,7 @@ static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_c
                if (SENSOR_AF_CONTINUOUS == sensor->isp_priv_info.auto_focus) {\r
                        sensor_af_workqueue_set(icd,0,SENSOR_AF_CONTINUOUS_OFF,true);\r
                        }\r
-               if (ext_ctrl->value == 1) {\r
+               if (ext_ctrl->value == 0xff) {\r
                        sensor_af_workqueue_set(icd,0,SENSOR_AF_MACRO,true);\r
                        sensor->isp_priv_info.auto_focus = SENSOR_AF_MACRO;\r
                } else if(ext_ctrl->value == 0){\r
@@ -1331,7 +1331,7 @@ static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_c
                                if (SENSOR_AF_CONTINUOUS == sensor->isp_priv_info.auto_focus) {\r
                                        sensor_af_workqueue_set(icd,0,SENSOR_AF_CONTINUOUS_OFF,true);\r
                                }\r
-                               if (ext_ctrl->value == 1) {\r
+                               if ((ext_ctrl->value == 1)||(sensor->isp_priv_info.auto_focus == SENSOR_AF_SINGLE)) {\r
                                    sensor_af_workqueue_set(icd,0,SENSOR_AF_SINGLE,true);\r
                                        sensor->isp_priv_info.auto_focus = SENSOR_AF_SINGLE;\r
                                } else if(ext_ctrl->value == 0){\r
@@ -1371,7 +1371,7 @@ static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_c
                                if (sensor_set_face_detect(client, ext_ctrl->value) != 0)\r
                                        return -EINVAL;\r
                                sensor->isp_priv_info.face = ext_ctrl->value;\r
-                               SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->isp_priv_info.face);\r
+                               SENSOR_DG("%s face value is %x\n",SENSOR_NAME_STRING(), sensor->isp_priv_info.face);\r
                                }\r
                        break;\r
                }\r
@@ -1796,7 +1796,7 @@ static int sensor_init(struct v4l2_subdev *sd, u32 val)
     /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code  */\r
        //qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_AUTO);\r
        //if (qctrl)\r
-               sensor->isp_priv_info.auto_focus = SENSOR_AF_CONTINUOUS_OFF;\r
+               sensor->isp_priv_info.auto_focus = SENSOR_AF_MODE_CLOSE;\r
        qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FACEDETECT);\r
        if (qctrl)\r
                sensor->isp_priv_info.face = qctrl->default_value;\r