aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/v4l2-core/v4l2-dev.c
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2013-12-12 11:44:14 -0500
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-03-05 12:15:20 -0500
commit582c52cb9cd2616ab0d41127b22ad56ee49d40b4 (patch)
treea307760a7c7e1b56a9327228558454b36bc60815 /drivers/media/v4l2-core/v4l2-dev.c
parent855df1dc6fdb519c7552053bc095f821bc360905 (diff)
[media] v4l: enable some IOCTLs for SDR receiver
Enable stream format (FMT) IOCTLs for SDR use. These are used for negotiate used data stream format. Reorganise some some IOCTL selection logic. Signed-off-by: Antti Palosaari <crope@iki.fi> Acked-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/v4l2-core/v4l2-dev.c')
-rw-r--r--drivers/media/v4l2-core/v4l2-dev.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c
index 9764ca04f8e2..98099e827614 100644
--- a/drivers/media/v4l2-core/v4l2-dev.c
+++ b/drivers/media/v4l2-core/v4l2-dev.c
@@ -553,7 +553,7 @@ static void determine_valid_ioctls(struct video_device *vdev)
553 const struct v4l2_ioctl_ops *ops = vdev->ioctl_ops; 553 const struct v4l2_ioctl_ops *ops = vdev->ioctl_ops;
554 bool is_vid = vdev->vfl_type == VFL_TYPE_GRABBER; 554 bool is_vid = vdev->vfl_type == VFL_TYPE_GRABBER;
555 bool is_vbi = vdev->vfl_type == VFL_TYPE_VBI; 555 bool is_vbi = vdev->vfl_type == VFL_TYPE_VBI;
556 bool is_radio = vdev->vfl_type == VFL_TYPE_RADIO; 556 bool is_sdr = vdev->vfl_type == VFL_TYPE_SDR;
557 bool is_rx = vdev->vfl_dir != VFL_DIR_TX; 557 bool is_rx = vdev->vfl_dir != VFL_DIR_TX;
558 bool is_tx = vdev->vfl_dir != VFL_DIR_RX; 558 bool is_tx = vdev->vfl_dir != VFL_DIR_RX;
559 559
@@ -662,9 +662,20 @@ static void determine_valid_ioctls(struct video_device *vdev)
662 ops->vidioc_try_fmt_sliced_vbi_out))) 662 ops->vidioc_try_fmt_sliced_vbi_out)))
663 set_bit(_IOC_NR(VIDIOC_TRY_FMT), valid_ioctls); 663 set_bit(_IOC_NR(VIDIOC_TRY_FMT), valid_ioctls);
664 SET_VALID_IOCTL(ops, VIDIOC_G_SLICED_VBI_CAP, vidioc_g_sliced_vbi_cap); 664 SET_VALID_IOCTL(ops, VIDIOC_G_SLICED_VBI_CAP, vidioc_g_sliced_vbi_cap);
665 } else if (is_sdr) {
666 /* SDR specific ioctls */
667 if (ops->vidioc_enum_fmt_sdr_cap)
668 set_bit(_IOC_NR(VIDIOC_ENUM_FMT), valid_ioctls);
669 if (ops->vidioc_g_fmt_sdr_cap)
670 set_bit(_IOC_NR(VIDIOC_G_FMT), valid_ioctls);
671 if (ops->vidioc_s_fmt_sdr_cap)
672 set_bit(_IOC_NR(VIDIOC_S_FMT), valid_ioctls);
673 if (ops->vidioc_try_fmt_sdr_cap)
674 set_bit(_IOC_NR(VIDIOC_TRY_FMT), valid_ioctls);
665 } 675 }
666 if (!is_radio) { 676
667 /* ioctls valid for video or vbi */ 677 if (is_vid || is_vbi || is_sdr) {
678 /* ioctls valid for video, vbi or sdr */
668 SET_VALID_IOCTL(ops, VIDIOC_REQBUFS, vidioc_reqbufs); 679 SET_VALID_IOCTL(ops, VIDIOC_REQBUFS, vidioc_reqbufs);
669 SET_VALID_IOCTL(ops, VIDIOC_QUERYBUF, vidioc_querybuf); 680 SET_VALID_IOCTL(ops, VIDIOC_QUERYBUF, vidioc_querybuf);
670 SET_VALID_IOCTL(ops, VIDIOC_QBUF, vidioc_qbuf); 681 SET_VALID_IOCTL(ops, VIDIOC_QBUF, vidioc_qbuf);
@@ -672,6 +683,10 @@ static void determine_valid_ioctls(struct video_device *vdev)
672 SET_VALID_IOCTL(ops, VIDIOC_DQBUF, vidioc_dqbuf); 683 SET_VALID_IOCTL(ops, VIDIOC_DQBUF, vidioc_dqbuf);
673 SET_VALID_IOCTL(ops, VIDIOC_CREATE_BUFS, vidioc_create_bufs); 684 SET_VALID_IOCTL(ops, VIDIOC_CREATE_BUFS, vidioc_create_bufs);
674 SET_VALID_IOCTL(ops, VIDIOC_PREPARE_BUF, vidioc_prepare_buf); 685 SET_VALID_IOCTL(ops, VIDIOC_PREPARE_BUF, vidioc_prepare_buf);
686 }
687
688 if (is_vid || is_vbi) {
689 /* ioctls valid for video or vbi */
675 if (ops->vidioc_s_std) 690 if (ops->vidioc_s_std)
676 set_bit(_IOC_NR(VIDIOC_ENUMSTD), valid_ioctls); 691 set_bit(_IOC_NR(VIDIOC_ENUMSTD), valid_ioctls);
677 SET_VALID_IOCTL(ops, VIDIOC_S_STD, vidioc_s_std); 692 SET_VALID_IOCTL(ops, VIDIOC_S_STD, vidioc_s_std);