-static int ov5640_q_flash(struct i2c_client *c, int *value)
+static int ov5640_q_flash(struct v4l2_subdev *sd, int *value)
{
- if(!value)
- return -EINVAL;
*value=ov5640_flash;
return 0;
}
@@ -1327,6 +1322,37 @@
return ret;
}
+static int ov5640_q_exposure_level_detect(struct v4l2_subdev *sd, int
*value)
+{
+ int ret = 0;
+ struct i2c_client *c = v4l2_get_subdevdata(sd);
+ int exposure, gain;
+ u8 v;
+
+ ret += ov5640_read(c, 0x3500, &v);
+ exposure = v;
+ ret += ov5640_read(c, 0x3501, &v);
+ exposure = (exposure<<8) | v;
+ ret += ov5640_read(c, 0x3502, &v);
+ exposure = (exposure<<8) | v;
+
+ ret += ov5640_read(c, 0x350a, &v);
+ gain = v;
+ ret += ov5640_read(c, 0x350b, &v);
+ gain = (gain<<8) | v;
+
+ *value = exposure*gain;
+ return ret;
+}
+
I am not sure why it is okay to not check if value is NULL before doing the
assign in the above two statements. Could you clarify that for me?
_______________________________________________
MeeGo-kernel mailing list
[email protected]
http://lists.meego.com/listinfo/meego-kernel