camera: cif:v0.3.5 generic_sensor:v0.1.7
authorddl <ddl@rock-chips.com>
Thu, 16 May 2013 10:40:28 +0000 (18:40 +0800)
committerddl <ddl@rock-chips.com>
Thu, 16 May 2013 10:40:28 +0000 (18:40 +0800)
drivers/media/video/generic_sensor.c
drivers/media/video/generic_sensor.h
drivers/media/video/rk30_camera_oneframe.c

index a8640fbebf3e8fce6398f9048fb720e6d5831546..ec12fb506cb312c916b0dab7b2f1867656318a45 100755 (executable)
 *v0.1.3:\r
 *        add support flash control;\r
 *\r
-*v0.1.5:\r
+*v0.1.5/v0.1.7:\r
 *        fix use v4l2_mbus_framefmt.reserved array overflow in generic_sensor_s_fmt;        \r
 */\r
-static int version = KERNEL_VERSION(0,1,5);\r
+static int version = KERNEL_VERSION(0,1,7);\r
 module_param(version, int, S_IRUGO);\r
 \r
 \r
@@ -851,11 +851,11 @@ int generic_sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf)
 {\r
     struct i2c_client *client = v4l2_get_subdevdata(sd);\r
     struct soc_camera_device *icd = client->dev.platform_data;\r
-    const struct rk_sensor_datafmt *fmt;\r
+    const struct rk_sensor_datafmt *fmt=NULL;\r
     struct generic_sensor *sensor = to_generic_sensor(client);\r
     struct rk_sensor_sequence *winseqe_set_addr=NULL;\r
-    struct sensor_v4l2ctrl_info_s *v4l2ctrl_info;\r
-    bool is_capture=(mf->reserved[6]==0xfefe5a5a)?true:false;    /* ddl@rock-chips.com : v0.1.5 */ \r
+    struct sensor_v4l2ctrl_info_s *v4l2ctrl_info=NULL;\r
+    bool is_capture=(mf->reserved[0]==0xfefe5a5a)?true:false;    /* ddl@rock-chips.com : v0.1.5 */ \r
     int ret=0;\r
 \r
     fmt =generic_sensor_find_datafmt(mf->code, sensor->info_priv.datafmt,\r
@@ -876,7 +876,7 @@ int generic_sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf)
             ret |= sensor->sensor_cb.sensor_s_fmt_cb_th(client, mf, is_capture);\r
         \r
         v4l2ctrl_info = sensor_find_ctrl(sensor->ctrls,V4L2_CID_FLASH); /* ddl@rock-chips.com: v0.1.3 */        \r
-        if (v4l2ctrl_info) {   \r
+        if (v4l2ctrl_info!=NULL) {   \r
             if (is_capture) { \r
                 if ((v4l2ctrl_info->cur_value == 2) || (v4l2ctrl_info->cur_value == 1)) {\r
                     generic_sensor_ioctrl(icd, Sensor_Flash, 1);                    \r
@@ -885,7 +885,7 @@ int generic_sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf)
                 generic_sensor_ioctrl(icd, Sensor_Flash, 0); \r
             }\r
         }\r
-        \r
+       \r
         ret |= generic_sensor_write_array(client, winseqe_set_addr->data);\r
         if (ret != 0) {\r
             SENSOR_TR("set format capability failed");\r
@@ -1035,7 +1035,7 @@ int generic_sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_contro
 {\r
     struct i2c_client *client = v4l2_get_subdevdata(sd);\r
     struct soc_camera_device *icd = client->dev.platform_data;\r
-    struct generic_sensor*sensor = to_generic_sensor(client);\r
+    //struct generic_sensor*sensor = to_generic_sensor(client);\r
     int i, error_cnt=0, error_idx=-1;\r
 \r
 \r
@@ -1293,7 +1293,7 @@ int generic_sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index,
                        break;\r
        }\r
     \r
-set_end:    \r
+//set_end:    \r
        if (sensor_work->wait == false) {\r
                kfree((void*)sensor_work);\r
        } else {\r
index 31526d072a9c52d51b7c0fdce9acc047ca5a9c66..6cdae7211ba199d249e1523859b5f00c08404a84 100755 (executable)
@@ -493,7 +493,7 @@ static inline int sensor_v4l2ctrl_default_cb(struct soc_camera_device *icd, stru
 static inline int sensor_v4l2ctrl_flash_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, \r
                                                      struct v4l2_ext_control *ext_ctrl)\r
 {\r
-    struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd));\r
+    //struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd));\r
     int value = ext_ctrl->value;\r
 \r
     if ((value < ctrl_info->qctrl->minimum) || (value > ctrl_info->qctrl->maximum)) {\r
index cd1ac2be2fca31207c0ff2e2dbe37dc427e5aa09..aef351e5693c15b456956cde98661affd4462a8b 100755 (executable)
@@ -297,11 +297,11 @@ module_param(debug, int, S_IRUGO|S_IWUSR);
 *v0.3.1 :
 *         1. compatible with generic_sensor;
 *
-*v0.3.3 :
+*v0.3.3 / v0.3.5:
 *         1. fix use v4l2_mbus_framefmt.reserved array overflow in generic_sensor_s_fmt;        
 */
 
-#define RK_CAM_VERSION_CODE KERNEL_VERSION(0, 3, 0x03)
+#define RK_CAM_VERSION_CODE KERNEL_VERSION(0, 3, 0x05)
 static int version = RK_CAM_VERSION_CODE;
 module_param(version, int, S_IRUGO);
 
@@ -2111,13 +2111,14 @@ static int rk_camera_set_fmt(struct soc_camera_device *icd,
     stream_on = read_cif_reg(pcdev->base,CIF_CIF_CTRL);
     if (stream_on & ENABLE_CAPTURE)
         write_cif_reg(pcdev->base,CIF_CIF_CTRL, (stream_on & (~ENABLE_CAPTURE)));
-    
+
        mf.width        = pix->width;
        mf.height       = pix->height;
        mf.field        = pix->field;
        mf.colorspace   = pix->colorspace;
        mf.code         = xlate->code;
-    mf.reserved[6] = pix->priv;              /* ddl@rock-chips.com : v0.3.3 */      
+    mf.reserved[0] = pix->priv;              /* ddl@rock-chips.com : v0.3.3 */
+    
        ret = v4l2_subdev_call(sd, video, s_mbus_fmt, &mf);
        if (mf.code != xlate->code)
                return -EINVAL;