media: imx: Handle VIDIOC_ENUMINPUT
PATCH 1/1 media: imx: Handle VIDIOC_ENUMINPUT
Add basic handling for VIDIOC_ENUMINPUT, where the imx capture devices report they are cameras to userspace. Code like e.g. Qt5 qcamera uses this information when enumerating camera devices and this fixes it's operation on iMX6, where it previously didn't detect any cameras.
Signed-off-by Marek Vasut <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Hans Verkuil <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc Steve Longerbeam <[email protected]>
--- drivers/staging/media/imx/imx-media-capture.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/staging/media/imx/imx-media-capture.c +13 -0
@@ -148,6 +148,18 @@ static int capture_enum_frameintervals(struct file *file, void *fh,return 0 ; } +static int capture_enum_input (struct file *file,void *priv, +struct v4l2_input *inp) +{ +if (inp->index >0 ) +return -EINVAL ; + + inp->type =V4L2_INPUT_TYPE_CAMERA ; +strlcpy (inp->name,"Camera" ,sizeof (inp->name)); + +return 0 ; +} +static int capture_enum_fmt_vid_cap (struct file *file,void *fh,struct v4l2_fmtdesc *f) {
@@ -414,6 +426,7 @@ static const struct v4l2_ioctl_ops capture_ioctl_ops = { .vidioc_enum_framesizes = capture_enum_framesizes, .vidioc_enum_frameintervals = capture_enum_frameintervals, + .vidioc_enum_input = capture_enum_input, .vidioc_enum_fmt_vid_cap = capture_enum_fmt_vid_cap, .vidioc_g_fmt_vid_cap = capture_g_fmt_vid_cap,
Signature · 1 line
2.20.1