aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/fsl-viu.c
diff options
context:
space:
mode:
authorAnatolij Gustschin <agust@denx.de>2010-12-22 15:31:59 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-12-29 05:17:16 -0500
commit50155c25bf346b65fec8e215131df397b0a5ee6e (patch)
treed7157fe72c96fb063ece6004a8a24e07ec4d812d /drivers/media/video/fsl-viu.c
parentf9d7d787842e92bc768d282f37fc3056c5441ddb (diff)
[media] fsl_viu: add VIDIOC_QUERYSTD and VIDIOC_G_STD support
VIDIOC_QUERYSTD and VIDIOC_G_STD ioctls are currently not supported in the FSL VIU driver. The decoder subdevice driver saa7115 extended by previous patch supports QUERYSTD for saa711x, so we add the appropriate ioctls to the VIU driver to be able to determine the video input's standard. Signed-off-by: Anatolij Gustschin <agust@denx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/fsl-viu.c')
-rw-r--r--drivers/media/video/fsl-viu.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/media/video/fsl-viu.c b/drivers/media/video/fsl-viu.c
index 693e9c07e3f4..e4bba88254c7 100644
--- a/drivers/media/video/fsl-viu.c
+++ b/drivers/media/video/fsl-viu.c
@@ -194,6 +194,8 @@ struct viu_dev {
194 194
195 /* decoder */ 195 /* decoder */
196 struct v4l2_subdev *decoder; 196 struct v4l2_subdev *decoder;
197
198 v4l2_std_id std;
197}; 199};
198 200
199struct viu_fh { 201struct viu_fh {
@@ -937,14 +939,31 @@ static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
937#define decoder_call(viu, o, f, args...) \ 939#define decoder_call(viu, o, f, args...) \
938 v4l2_subdev_call(viu->decoder, o, f, ##args) 940 v4l2_subdev_call(viu->decoder, o, f, ##args)
939 941
942static int vidioc_querystd(struct file *file, void *priv, v4l2_std_id *std_id)
943{
944 struct viu_fh *fh = priv;
945
946 decoder_call(fh->dev, video, querystd, std_id);
947 return 0;
948}
949
940static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *id) 950static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *id)
941{ 951{
942 struct viu_fh *fh = priv; 952 struct viu_fh *fh = priv;
943 953
954 fh->dev->std = *id;
944 decoder_call(fh->dev, core, s_std, *id); 955 decoder_call(fh->dev, core, s_std, *id);
945 return 0; 956 return 0;
946} 957}
947 958
959static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *std_id)
960{
961 struct viu_fh *fh = priv;
962
963 *std_id = fh->dev->std;
964 return 0;
965}
966
948/* only one input in this driver */ 967/* only one input in this driver */
949static int vidioc_enum_input(struct file *file, void *priv, 968static int vidioc_enum_input(struct file *file, void *priv,
950 struct v4l2_input *inp) 969 struct v4l2_input *inp)
@@ -1402,7 +1421,9 @@ static const struct v4l2_ioctl_ops viu_ioctl_ops = {
1402 .vidioc_querybuf = vidioc_querybuf, 1421 .vidioc_querybuf = vidioc_querybuf,
1403 .vidioc_qbuf = vidioc_qbuf, 1422 .vidioc_qbuf = vidioc_qbuf,
1404 .vidioc_dqbuf = vidioc_dqbuf, 1423 .vidioc_dqbuf = vidioc_dqbuf,
1424 .vidioc_g_std = vidioc_g_std,
1405 .vidioc_s_std = vidioc_s_std, 1425 .vidioc_s_std = vidioc_s_std,
1426 .vidioc_querystd = vidioc_querystd,
1406 .vidioc_enum_input = vidioc_enum_input, 1427 .vidioc_enum_input = vidioc_enum_input,
1407 .vidioc_g_input = vidioc_g_input, 1428 .vidioc_g_input = vidioc_g_input,
1408 .vidioc_s_input = vidioc_s_input, 1429 .vidioc_s_input = vidioc_s_input,