V4L/DVB: saa7115: add s_mbus_fmt op
authorHans Verkuil <hverkuil@xs4all.nl>
Sun, 9 May 2010 12:47:23 +0000 (09:47 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 1 Jun 2010 04:20:23 +0000 (01:20 -0300)
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/saa7115.c

index 53b6fcd..d4cc208 100644 (file)
@@ -1136,6 +1136,15 @@ static int saa711x_s_sliced_fmt(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_f
        return 0;
 }
 
+static int saa711x_s_mbus_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *fmt)
+{
+       if (fmt->code != V4L2_MBUS_FMT_FIXED)
+               return -EINVAL;
+       fmt->field = V4L2_FIELD_INTERLACED;
+       fmt->colorspace = V4L2_COLORSPACE_SMPTE170M;
+       return saa711x_set_size(sd, fmt->width, fmt->height);
+}
+
 static int saa711x_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt)
 {
        if (fmt->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
@@ -1558,6 +1567,7 @@ static const struct v4l2_subdev_video_ops saa711x_video_ops = {
        .s_crystal_freq = saa711x_s_crystal_freq,
        .g_fmt = saa711x_g_fmt,
        .s_fmt = saa711x_s_fmt,
+       .s_mbus_fmt = saa711x_s_mbus_fmt,
        .s_stream = saa711x_s_stream,
        .querystd = saa711x_querystd,
        .g_input_status = saa711x_g_input_status,