summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSheng Nan <b38800@freescale.com>2012-10-17 14:55:10 +0800
committerSheng Nan <b38800@freescale.com>2012-10-17 15:06:22 +0800
commit2dd75f173f1253b50fc3eae97d6a9785e0f622f4 (patch)
treea93e0e812f494f8a7ca06122314b1b0c1c6831d0 /drivers
parentbff791a2345d5023c2a537b9bbfa86cd9a3b1bea (diff)
ENGR00229962 Capture: ov5642/ov5640: update sensor params even if s_parm failed
ioctl_s_parm for ov5642 and ov5640, it didn't check if sensor changed mode successfully. So it updates the sensor parameters with new framerate and new mode even if the sensor failed to change mode. The original framerate and mode is useful for the exposure calculation. It should keep consistent with sensor actual work mode. - This patch checks the return value of function which changes sensor mode If it succeed, update sensor parameters. Signed-off-by: Sheng Nan <b38800@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/mxc/capture/ov5640_mipi.c7
-rw-r--r--drivers/media/video/mxc/capture/ov5642.c3
2 files changed, 8 insertions, 2 deletions
diff --git a/drivers/media/video/mxc/capture/ov5640_mipi.c b/drivers/media/video/mxc/capture/ov5640_mipi.c
index 44cdd466337e..bde39a51d368 100644
--- a/drivers/media/video/mxc/capture/ov5640_mipi.c
+++ b/drivers/media/video/mxc/capture/ov5640_mipi.c
@@ -1494,12 +1494,15 @@ static int ioctl_s_parm(struct v4l2_int_device *s, struct v4l2_streamparm *a)
}
orig_mode = sensor->streamcap.capturemode;
+ ret = ov5640_init_mode(frame_rate,
+ (u32)a->parm.capture.capturemode, orig_mode);
+ if (ret < 0)
+ return ret;
+
sensor->streamcap.timeperframe = *timeperframe;
sensor->streamcap.capturemode =
(u32)a->parm.capture.capturemode;
- ret = ov5640_init_mode(frame_rate,
- sensor->streamcap.capturemode, orig_mode);
break;
/* These are all the possible cases. */
diff --git a/drivers/media/video/mxc/capture/ov5642.c b/drivers/media/video/mxc/capture/ov5642.c
index 534d8ad38a16..426438276908 100644
--- a/drivers/media/video/mxc/capture/ov5642.c
+++ b/drivers/media/video/mxc/capture/ov5642.c
@@ -3526,6 +3526,9 @@ static int ioctl_s_parm(struct v4l2_int_device *s, struct v4l2_streamparm *a)
ret = ov5642_change_mode(new_frame_rate, old_frame_rate,
a->parm.capture.capturemode,
sensor->streamcap.capturemode);
+ if (ret < 0)
+ return ret;
+
sensor->streamcap.timeperframe = *timeperframe;
sensor->streamcap.capturemode =
(u32)a->parm.capture.capturemode;