summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2015-06-07 05:57:59 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-07-06 08:26:10 -0300
commit4de00d0efe0a7af8e2ef591effa2a559b7cc38a3 (patch)
treea1dd06714042a76602973b9670e5017ab20e1cdc /drivers/media/platform
parentc5f98085bf3f1d645aaf76eac7c9ca0e2ab684c6 (diff)
downloadlinux-4de00d0efe0a7af8e2ef591effa2a559b7cc38a3.tar.bz2
[media] sh-vou: support compulsory G/S/ENUM_OUTPUT ioctls
Video output drivers must support these ioctls. Otherwise applications cannot deduce that these outputs exist and what capabilities they have. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r--drivers/media/platform/sh_vou.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/media/platform/sh_vou.c b/drivers/media/platform/sh_vou.c
index 4994b7ba9236..d9a4502b4a58 100644
--- a/drivers/media/platform/sh_vou.c
+++ b/drivers/media/platform/sh_vou.c
@@ -872,6 +872,30 @@ static int sh_vou_streamoff(struct file *file, void *priv,
return 0;
}
+static int sh_vou_enum_output(struct file *file, void *fh,
+ struct v4l2_output *a)
+{
+ struct sh_vou_device *vou_dev = video_drvdata(file);
+
+ if (a->index)
+ return -EINVAL;
+ strlcpy(a->name, "Video Out", sizeof(a->name));
+ a->type = V4L2_OUTPUT_TYPE_ANALOG;
+ a->std = vou_dev->vdev.tvnorms;
+ return 0;
+}
+
+int sh_vou_g_output(struct file *file, void *fh, unsigned int *i)
+{
+ *i = 0;
+ return 0;
+}
+
+int sh_vou_s_output(struct file *file, void *fh, unsigned int i)
+{
+ return i ? -EINVAL : 0;
+}
+
static u32 sh_vou_ntsc_mode(enum sh_vou_bus_fmt bus_fmt)
{
switch (bus_fmt) {
@@ -1276,6 +1300,9 @@ static const struct v4l2_ioctl_ops sh_vou_ioctl_ops = {
.vidioc_dqbuf = sh_vou_dqbuf,
.vidioc_streamon = sh_vou_streamon,
.vidioc_streamoff = sh_vou_streamoff,
+ .vidioc_g_output = sh_vou_g_output,
+ .vidioc_s_output = sh_vou_s_output,
+ .vidioc_enum_output = sh_vou_enum_output,
.vidioc_s_std = sh_vou_s_std,
.vidioc_g_std = sh_vou_g_std,
.vidioc_cropcap = sh_vou_cropcap,