aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/soc_camera/rcar_vin.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2015-04-09 04:05:35 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-05-01 08:59:28 -0300
commit5eab4983777ba913efb42dd0f177b0dcdbd4f3d9 (patch)
tree878a7999f0af3737a51d50d3e56653d3a66b808c /drivers/media/platform/soc_camera/rcar_vin.c
parent[media] v4l2: replace s_mbus_fmt by set_fmt (diff)
downloadlinux-dev-5eab4983777ba913efb42dd0f177b0dcdbd4f3d9.tar.xz
linux-dev-5eab4983777ba913efb42dd0f177b0dcdbd4f3d9.zip
[media] v4l2: replace try_mbus_fmt by set_fmt in bridge drivers
Replace all calls to try_mbus_fmt in bridge drivers by calls to the set_fmt pad op. [mchehab@osg.samsung.com: fix a merge conflict at mcam-core.c] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Scott Jiang <scott.jiang.linux@gmail.com> Cc: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform/soc_camera/rcar_vin.c')
-rw-r--r--drivers/media/platform/soc_camera/rcar_vin.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c
index 08fa61099dde..063285a8dcf5 100644
--- a/drivers/media/platform/soc_camera/rcar_vin.c
+++ b/drivers/media/platform/soc_camera/rcar_vin.c
@@ -1683,7 +1683,11 @@ static int rcar_vin_try_fmt(struct soc_camera_device *icd,
const struct soc_camera_format_xlate *xlate;
struct v4l2_pix_format *pix = &f->fmt.pix;
struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
- struct v4l2_mbus_framefmt mf;
+ struct v4l2_subdev_pad_config pad_cfg;
+ struct v4l2_subdev_format format = {
+ .which = V4L2_SUBDEV_FORMAT_TRY,
+ };
+ struct v4l2_mbus_framefmt *mf = &format.format;
__u32 pixfmt = pix->pixelformat;
int width, height;
int ret;
@@ -1710,25 +1714,25 @@ static int rcar_vin_try_fmt(struct soc_camera_device *icd,
pix->sizeimage = 0;
/* limit to sensor capabilities */
- mf.width = pix->width;
- mf.height = pix->height;
- mf.field = pix->field;
- mf.code = xlate->code;
- mf.colorspace = pix->colorspace;
+ mf->width = pix->width;
+ mf->height = pix->height;
+ mf->field = pix->field;
+ mf->code = xlate->code;
+ mf->colorspace = pix->colorspace;
ret = v4l2_device_call_until_err(sd->v4l2_dev, soc_camera_grp_id(icd),
- video, try_mbus_fmt, &mf);
+ pad, set_fmt, &pad_cfg, &format);
if (ret < 0)
return ret;
/* Adjust only if VIN cannot scale */
- if (pix->width > mf.width * 2)
- pix->width = mf.width * 2;
- if (pix->height > mf.height * 3)
- pix->height = mf.height * 3;
+ if (pix->width > mf->width * 2)
+ pix->width = mf->width * 2;
+ if (pix->height > mf->height * 3)
+ pix->height = mf->height * 3;
- pix->field = mf.field;
- pix->colorspace = mf.colorspace;
+ pix->field = mf->field;
+ pix->colorspace = mf->colorspace;
if (pixfmt == V4L2_PIX_FMT_NV16) {
/* FIXME: check against rect_max after converting soc-camera */
@@ -1739,12 +1743,12 @@ static int rcar_vin_try_fmt(struct soc_camera_device *icd,
* requested a bigger rectangle, it will not return a
* smaller one.
*/
- mf.width = VIN_MAX_WIDTH;
- mf.height = VIN_MAX_HEIGHT;
+ mf->width = VIN_MAX_WIDTH;
+ mf->height = VIN_MAX_HEIGHT;
ret = v4l2_device_call_until_err(sd->v4l2_dev,
soc_camera_grp_id(icd),
- video, try_mbus_fmt,
- &mf);
+ pad, set_fmt, &pad_cfg,
+ &format);
if (ret < 0) {
dev_err(icd->parent,
"client try_fmt() = %d\n", ret);
@@ -1752,9 +1756,9 @@ static int rcar_vin_try_fmt(struct soc_camera_device *icd,
}
}
/* We will scale exactly */
- if (mf.width > width)
+ if (mf->width > width)
pix->width = width;
- if (mf.height > height)
+ if (mf->height > height)
pix->height = height;
}