Commit 66df67b7 authored by Frank Schaefer's avatar Frank Schaefer Committed by Mauro Carvalho Chehab

[media] em28xx: disable tuner related ioctls for video and VBI devices without tuner

Disable the ioctls VIDIOC_G_TUNER, VIDIOC_S_TUNER, VIDIOC_G_FREQUENCY and
VIDIOC_S_FREQUENCY for video and VBI devices without tuner.
Signed-off-by: default avatarFrank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 6e46daba
...@@ -1899,6 +1899,12 @@ int em28xx_register_analog_devices(struct em28xx *dev) ...@@ -1899,6 +1899,12 @@ int em28xx_register_analog_devices(struct em28xx *dev)
v4l2_disable_ioctl(dev->vdev, VIDIOC_G_STD); v4l2_disable_ioctl(dev->vdev, VIDIOC_G_STD);
v4l2_disable_ioctl(dev->vdev, VIDIOC_S_STD); v4l2_disable_ioctl(dev->vdev, VIDIOC_S_STD);
} }
if (dev->tuner_type == TUNER_ABSENT) {
v4l2_disable_ioctl(dev->vdev, VIDIOC_G_TUNER);
v4l2_disable_ioctl(dev->vdev, VIDIOC_S_TUNER);
v4l2_disable_ioctl(dev->vdev, VIDIOC_G_FREQUENCY);
v4l2_disable_ioctl(dev->vdev, VIDIOC_S_FREQUENCY);
}
/* register v4l2 video video_device */ /* register v4l2 video video_device */
ret = video_register_device(dev->vdev, VFL_TYPE_GRABBER, ret = video_register_device(dev->vdev, VFL_TYPE_GRABBER,
...@@ -1917,6 +1923,14 @@ int em28xx_register_analog_devices(struct em28xx *dev) ...@@ -1917,6 +1923,14 @@ int em28xx_register_analog_devices(struct em28xx *dev)
dev->vbi_dev->queue = &dev->vb_vbiq; dev->vbi_dev->queue = &dev->vb_vbiq;
dev->vbi_dev->queue->lock = &dev->vb_vbi_queue_lock; dev->vbi_dev->queue->lock = &dev->vb_vbi_queue_lock;
/* disable inapplicable ioctls */
if (dev->tuner_type == TUNER_ABSENT) {
v4l2_disable_ioctl(dev->vbi_dev, VIDIOC_G_TUNER);
v4l2_disable_ioctl(dev->vbi_dev, VIDIOC_S_TUNER);
v4l2_disable_ioctl(dev->vbi_dev, VIDIOC_G_FREQUENCY);
v4l2_disable_ioctl(dev->vbi_dev, VIDIOC_S_FREQUENCY);
}
/* register v4l2 vbi video_device */ /* register v4l2 vbi video_device */
ret = video_register_device(dev->vbi_dev, VFL_TYPE_VBI, ret = video_register_device(dev->vbi_dev, VFL_TYPE_VBI,
vbi_nr[dev->devno]); vbi_nr[dev->devno]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment