summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuxi Sun <b36102@freescale.com>2012-08-27 09:58:30 +0800
committerYuxi Sun <b36102@freescale.com>2012-08-27 10:23:43 +0800
commit12b09bf866634a638e110e5acce6e8b118bf1f12 (patch)
treef0ed6b8a23a62939a1f5e9f1da08c5e9b46f0881
parentd3f7f366becf5e31225dbe1aaceef84813f7ccb8 (diff)
ENGR00221445 ov5642: return error number when change camera mode
return error number when set camera change mode fail, if not the driver may continue to setup the video processing with wrong parameter. Signed-off-by: Yuxi Sun <b36102@freescale.com>
-rw-r--r--drivers/media/video/mxc/capture/ov5642.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/media/video/mxc/capture/ov5642.c b/drivers/media/video/mxc/capture/ov5642.c
index 245a92c15ef1..492748c6cac4 100644
--- a/drivers/media/video/mxc/capture/ov5642.c
+++ b/drivers/media/video/mxc/capture/ov5642.c
@@ -3228,6 +3228,7 @@ err:
static int ov5642_write_snapshot_para(enum ov5642_frame_rate frame_rate,
enum ov5642_mode mode)
{
+ int ret = 0;
bool m_60Hz = false;
u16 capture_frame_rate = 50;
u16 g_preview_frame_rate = 225;
@@ -3255,7 +3256,10 @@ static int ov5642_write_snapshot_para(enum ov5642_frame_rate frame_rate,
gain = 0;
ov5642_read_reg(0x350b, &gain);
- ov5642_init_mode(frame_rate, mode);
+ ret = ov5642_init_mode(frame_rate, mode);
+ if (ret < 0)
+ return ret;
+
ret_h = ret_m = ret_l = 0;
ov5642_read_reg(0x380e, &ret_h);
ov5642_read_reg(0x380f, &ret_l);
@@ -3331,7 +3335,7 @@ static int ov5642_write_snapshot_para(enum ov5642_frame_rate frame_rate,
ov5642_write_reg(0x3500, exposure_high);
msleep(500);
- return 0;
+ return ret ;
}