summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/usbvision
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2015-07-20 14:59:32 +0200
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-08-11 11:51:00 +0200
commitcbe12cc66e9c03ebd62a5937aada4240924dbe75 (patch)
treea4d651ce827f125f44b2ec075a4eb3e89094d4c1 /drivers/media/usb/usbvision
parent[media] usbvision: remove g/s_audio and for radio remove enum/g/s_input (diff)
downloadlinux-cbe12cc66e9c03ebd62a5937aada4240924dbe75.tar.xz
linux-cbe12cc66e9c03ebd62a5937aada4240924dbe75.zip
[media] usbvision: the radio device node has wrong caps
The radio device node had the same caps as the video node. Fix this. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/usb/usbvision')
-rw-r--r--drivers/media/usb/usbvision/usbvision-video.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/media/usb/usbvision/usbvision-video.c b/drivers/media/usb/usbvision/usbvision-video.c
index 15a1ebf336e2..f526712a6435 100644
--- a/drivers/media/usb/usbvision/usbvision-video.c
+++ b/drivers/media/usb/usbvision/usbvision-video.c
@@ -487,17 +487,24 @@ static int vidioc_querycap(struct file *file, void *priv,
struct v4l2_capability *vc)
{
struct usb_usbvision *usbvision = video_drvdata(file);
+ struct video_device *vdev = video_devdata(file);
strlcpy(vc->driver, "USBVision", sizeof(vc->driver));
strlcpy(vc->card,
usbvision_device_data[usbvision->dev_model].model_string,
sizeof(vc->card));
usb_make_path(usbvision->dev, vc->bus_info, sizeof(vc->bus_info));
- vc->device_caps = V4L2_CAP_VIDEO_CAPTURE |
- V4L2_CAP_READWRITE |
- V4L2_CAP_STREAMING |
- (usbvision->have_tuner ? V4L2_CAP_TUNER : 0);
- vc->capabilities = vc->device_caps | V4L2_CAP_DEVICE_CAPS;
+ vc->device_caps = usbvision->have_tuner ? V4L2_CAP_TUNER : 0;
+ if (vdev->vfl_type == VFL_TYPE_GRABBER)
+ vc->device_caps |= V4L2_CAP_VIDEO_CAPTURE |
+ V4L2_CAP_READWRITE | V4L2_CAP_STREAMING;
+ else
+ vc->device_caps |= V4L2_CAP_RADIO;
+
+ vc->capabilities = vc->device_caps | V4L2_CAP_VIDEO_CAPTURE |
+ V4L2_CAP_READWRITE | V4L2_CAP_STREAMING | V4L2_CAP_DEVICE_CAPS;
+ if (usbvision_device_data[usbvision->dev_model].radio)
+ vc->capabilities |= V4L2_CAP_RADIO;
return 0;
}