From cdfbb637505dd426cea5792d9be7c365cfac582f Mon Sep 17 00:00:00 2001
From: Ash Charles <ashcharles@gmail.com>
Date: Wed, 14 Jan 2015 10:51:25 -0800
Subject: [PATCH 2/2] Pulling in...

https://github.com/gumstix/meta-gumstix/pull/13.patch

Signed-off-by: Ash Charles <ashcharles@gmail.com>
---
 drivers/media/platform/omap3isp/ispvideo.c | 43 ++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/drivers/media/platform/omap3isp/ispvideo.c b/drivers/media/platform/omap3isp/ispvideo.c
index cdfec27e876e..5ec08ee94d7f 100644
--- a/drivers/media/platform/omap3isp/ispvideo.c
+++ b/drivers/media/platform/omap3isp/ispvideo.c
@@ -1197,6 +1197,47 @@ isp_video_s_input(struct file *file, void *fh, unsigned int input)
 	return input == 0 ? 0 : -EINVAL;
 }
 
+static int
+isp_video_enum_format(struct file *file, void *fh, struct v4l2_fmtdesc *fmtdesc)
+{
+	struct isp_video_fh *vfh = to_isp_video_fh(fh);
+	struct isp_video *video = video_drvdata(file);
+
+	if (fmtdesc->index) {
+		printk(KERN_ERR "%s: invalid index (%d)\n",
+				__func__, fmtdesc->index);
+		return -EINVAL;
+	}
+
+	if (fmtdesc->type != video->type) {
+		printk(KERN_ERR "%s: invalid type (%d). Current type: %d\n",
+				__func__, fmtdesc->type, video->type);
+		return -EINVAL;
+	}
+
+	/* Ugly hack */
+	fmtdesc->flags = 0;
+	fmtdesc->description[0] = 'U';
+	fmtdesc->description[1] = 'Y';
+	fmtdesc->description[2] = 'V';
+	fmtdesc->description[3] = 'Y';
+	fmtdesc->description[4] = '0';
+	fmtdesc->pixelformat = V4L2_PIX_FMT_UYVY;
+
+	return 0;
+}
+
+static int
+isp_video_queryctrl(struct file *file, void *fh, struct v4l2_queryctrl *queryctrl)
+{
+	if (queryctrl->id < V4L2_CID_BASE) {
+		return -EDOM;
+	}
+
+	return -EINVAL;
+}
+
+
 static const struct v4l2_ioctl_ops isp_video_ioctl_ops = {
 	.vidioc_querycap		= isp_video_querycap,
 	.vidioc_g_fmt_vid_cap		= isp_video_get_format,
@@ -1205,6 +1246,8 @@ static const struct v4l2_ioctl_ops isp_video_ioctl_ops = {
 	.vidioc_g_fmt_vid_out		= isp_video_get_format,
 	.vidioc_s_fmt_vid_out		= isp_video_set_format,
 	.vidioc_try_fmt_vid_out		= isp_video_try_format,
+	.vidioc_enum_fmt_vid_cap	= isp_video_enum_format,
+	.vidioc_queryctrl		= isp_video_queryctrl,
 	.vidioc_cropcap			= isp_video_cropcap,
 	.vidioc_g_crop			= isp_video_get_crop,
 	.vidioc_s_crop			= isp_video_set_crop,
-- 
2.1.0

