diff options
Diffstat (limited to 'drivers/media/video/fsl-viu.c')
-rw-r--r-- | drivers/media/video/fsl-viu.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/media/video/fsl-viu.c b/drivers/media/video/fsl-viu.c index b8faff2dd711..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 | ||
199 | struct viu_fh { | 201 | struct viu_fh { |
@@ -915,6 +917,8 @@ static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i) | |||
915 | if (fh->type != i) | 917 | if (fh->type != i) |
916 | return -EINVAL; | 918 | return -EINVAL; |
917 | 919 | ||
920 | viu_start_dma(fh->dev); | ||
921 | |||
918 | return videobuf_streamon(&fh->vb_vidq); | 922 | return videobuf_streamon(&fh->vb_vidq); |
919 | } | 923 | } |
920 | 924 | ||
@@ -927,20 +931,39 @@ static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i) | |||
927 | if (fh->type != i) | 931 | if (fh->type != i) |
928 | return -EINVAL; | 932 | return -EINVAL; |
929 | 933 | ||
934 | viu_stop_dma(fh->dev); | ||
935 | |||
930 | return videobuf_streamoff(&fh->vb_vidq); | 936 | return videobuf_streamoff(&fh->vb_vidq); |
931 | } | 937 | } |
932 | 938 | ||
933 | #define decoder_call(viu, o, f, args...) \ | 939 | #define decoder_call(viu, o, f, args...) \ |
934 | v4l2_subdev_call(viu->decoder, o, f, ##args) | 940 | v4l2_subdev_call(viu->decoder, o, f, ##args) |
935 | 941 | ||
942 | static 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 | |||
936 | static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *id) | 950 | static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *id) |
937 | { | 951 | { |
938 | struct viu_fh *fh = priv; | 952 | struct viu_fh *fh = priv; |
939 | 953 | ||
954 | fh->dev->std = *id; | ||
940 | decoder_call(fh->dev, core, s_std, *id); | 955 | decoder_call(fh->dev, core, s_std, *id); |
941 | return 0; | 956 | return 0; |
942 | } | 957 | } |
943 | 958 | ||
959 | static 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 | |||
944 | /* only one input in this driver */ | 967 | /* only one input in this driver */ |
945 | static int vidioc_enum_input(struct file *file, void *priv, | 968 | static int vidioc_enum_input(struct file *file, void *priv, |
946 | struct v4l2_input *inp) | 969 | struct v4l2_input *inp) |
@@ -1331,6 +1354,7 @@ static int viu_release(struct file *file) | |||
1331 | 1354 | ||
1332 | viu_stop_dma(dev); | 1355 | viu_stop_dma(dev); |
1333 | videobuf_stop(&fh->vb_vidq); | 1356 | videobuf_stop(&fh->vb_vidq); |
1357 | videobuf_mmap_free(&fh->vb_vidq); | ||
1334 | 1358 | ||
1335 | kfree(fh); | 1359 | kfree(fh); |
1336 | 1360 | ||
@@ -1397,7 +1421,9 @@ static const struct v4l2_ioctl_ops viu_ioctl_ops = { | |||
1397 | .vidioc_querybuf = vidioc_querybuf, | 1421 | .vidioc_querybuf = vidioc_querybuf, |
1398 | .vidioc_qbuf = vidioc_qbuf, | 1422 | .vidioc_qbuf = vidioc_qbuf, |
1399 | .vidioc_dqbuf = vidioc_dqbuf, | 1423 | .vidioc_dqbuf = vidioc_dqbuf, |
1424 | .vidioc_g_std = vidioc_g_std, | ||
1400 | .vidioc_s_std = vidioc_s_std, | 1425 | .vidioc_s_std = vidioc_s_std, |
1426 | .vidioc_querystd = vidioc_querystd, | ||
1401 | .vidioc_enum_input = vidioc_enum_input, | 1427 | .vidioc_enum_input = vidioc_enum_input, |
1402 | .vidioc_g_input = vidioc_g_input, | 1428 | .vidioc_g_input = vidioc_g_input, |
1403 | .vidioc_s_input = vidioc_s_input, | 1429 | .vidioc_s_input = vidioc_s_input, |