From: ddl Date: Sun, 19 Dec 2010 04:43:26 +0000 (+0800) Subject: camera: fix ov2655 driver support IPP X-Git-Tag: firefly_0821_release~10917 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4c8310da73e8c468e7c8b881e7c621dd766b0117;p=firefly-linux-kernel-4.4.55.git camera: fix ov2655 driver support IPP --- diff --git a/drivers/media/video/ov2655.c b/drivers/media/video/ov2655.c index fd29b7f4fcde..03c50fb80818 100644 --- a/drivers/media/video/ov2655.c +++ b/drivers/media/video/ov2655.c @@ -1769,7 +1769,7 @@ static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f) struct sensor *sensor = to_sensor(client); struct v4l2_pix_format *pix = &f->fmt.pix; struct reginfo *winseqe_set_addr=NULL; - int ret, set_w,set_h; + int ret=0, set_w,set_h; if (sensor->info_priv.pixfmt != pix->pixelformat) { switch (pix->pixelformat) @@ -1847,21 +1847,20 @@ static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f) winseqe_set_addr = SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ set_w = SENSOR_INIT_WIDTH; set_h = SENSOR_INIT_HEIGHT; - + ret = -1; SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,pix->width,pix->height); } if ((int)winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) { - ret = sensor_write_array(client, winseqe_set_addr); - if (ret != 0) - { + ret |= sensor_write_array(client, winseqe_set_addr); + if (ret != 0) { SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - return ret; + goto sensor_s_fmt_end; } sensor->info_priv.winseqe_cur_addr = (int)winseqe_set_addr; - //mdelay(250); + SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); } @@ -1870,7 +1869,11 @@ static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f) SENSOR_TR("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); } - return 0; + pix->width = set_w; + pix->height = set_h; + +sensor_s_fmt_end: + return ret; } static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_format *f)