Commit 5492728b authored by Enrico Scholz's avatar Enrico Scholz

media:mx6s_capture: differ between TRY_FMT and SET_FMT

Signed-off-by: Enrico Scholz's avatarEnrico Scholz <enrico.scholz@sigma-chemnitz.de>
parent 0c1f14a1
......@@ -1446,14 +1446,14 @@ static int mx6s_vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
return 0;
}
static int mx6s_vidioc_try_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
static int _mx6s_vidioc_try_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f, unsigned int which)
{
struct mx6s_csi_dev *csi_dev = video_drvdata(file);
struct v4l2_subdev *sd = csi_dev->sd;
struct v4l2_pix_format *pix = &f->fmt.pix;
struct v4l2_subdev_format format = {
.which = V4L2_SUBDEV_FORMAT_ACTIVE,
.which = which,
};
struct mx6s_fmt *fmt;
int ret;
......@@ -1484,6 +1484,12 @@ static int mx6s_vidioc_try_fmt_vid_cap(struct file *file, void *priv,
return ret;
}
static int mx6s_vidioc_try_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{
return _mx6s_vidioc_try_fmt_vid_cap(file, priv, f, V4L2_SUBDEV_FORMAT_TRY);
}
/*
* The real work of figuring out a workable format.
*/
......@@ -1494,7 +1500,8 @@ static int mx6s_vidioc_s_fmt_vid_cap(struct file *file, void *priv,
struct mx6s_csi_dev *csi_dev = video_drvdata(file);
int ret;
ret = mx6s_vidioc_try_fmt_vid_cap(file, csi_dev, f);
ret = _mx6s_vidioc_try_fmt_vid_cap(file, csi_dev, f,
V4L2_SUBDEV_FORMAT_ACTIVE);
if (ret < 0)
return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment