Commit a1060d07 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab
Browse files

media: imx: capture: Expose V4L2_CAP_IO_MC for the MC-centric API



Report to userspace that the MC-centric API is MC-centric by exposing
the V4L2_CAP_IO_MC. This requires adding support for mbus code filtering
in format enumeration, as required by V4L2_CAP_IO_MC.

Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarRui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent b41e9326
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -96,7 +96,7 @@ static int capture_enum_fmt_vid_cap(struct file *file, void *fh,
				    struct v4l2_fmtdesc *f)
{
	return imx_media_enum_pixel_formats(&f->pixelformat, f->index,
					    PIXFMT_SEL_ANY, 0);
					    PIXFMT_SEL_ANY, f->mbus_code);
}

static int capture_enum_framesizes(struct file *file, void *fh,
@@ -986,7 +986,8 @@ imx_media_capture_device_init(struct device *dev, struct v4l2_subdev *src_sd,
	vfd->release = video_device_release;
	vfd->vfl_dir = VFL_DIR_RX;
	vfd->tvnorms = V4L2_STD_NTSC | V4L2_STD_PAL | V4L2_STD_SECAM;
	vfd->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
	vfd->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING
			 | (!legacy_api ? V4L2_CAP_IO_MC : 0);
	vfd->lock = &priv->mutex;
	vfd->queue = &priv->q;