diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2012-09-06 06:31:04 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-01-04 21:45:43 -0500 |
commit | a9d79fe581f4019209ddc121b114dc28b88cdab0 (patch) | |
tree | b0493ee374372679c9041ceb3268bbfd8c258634 | |
parent | 3ac693c40a08703f3c456d8f45940a48c1f8d93f (diff) |
[media] em28xx: fix querycap
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-video.c | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index 4c1726d43374..fb9ee4677130 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c | |||
@@ -1577,6 +1577,7 @@ static int vidioc_streamoff(struct file *file, void *priv, | |||
1577 | static int vidioc_querycap(struct file *file, void *priv, | 1577 | static int vidioc_querycap(struct file *file, void *priv, |
1578 | struct v4l2_capability *cap) | 1578 | struct v4l2_capability *cap) |
1579 | { | 1579 | { |
1580 | struct video_device *vdev = video_devdata(file); | ||
1580 | struct em28xx_fh *fh = priv; | 1581 | struct em28xx_fh *fh = priv; |
1581 | struct em28xx *dev = fh->dev; | 1582 | struct em28xx *dev = fh->dev; |
1582 | 1583 | ||
@@ -1584,20 +1585,28 @@ static int vidioc_querycap(struct file *file, void *priv, | |||
1584 | strlcpy(cap->card, em28xx_boards[dev->model].name, sizeof(cap->card)); | 1585 | strlcpy(cap->card, em28xx_boards[dev->model].name, sizeof(cap->card)); |
1585 | usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info)); | 1586 | usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info)); |
1586 | 1587 | ||
1587 | cap->capabilities = | 1588 | if (vdev->vfl_type == VFL_TYPE_GRABBER) |
1588 | V4L2_CAP_SLICED_VBI_CAPTURE | | 1589 | cap->device_caps = V4L2_CAP_READWRITE | |
1589 | V4L2_CAP_VIDEO_CAPTURE | | 1590 | V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING; |
1590 | V4L2_CAP_READWRITE | V4L2_CAP_STREAMING; | 1591 | else if (vdev->vfl_type == VFL_TYPE_RADIO) |
1591 | 1592 | cap->device_caps = V4L2_CAP_RADIO; | |
1592 | if (dev->vbi_dev) | 1593 | else |
1593 | cap->capabilities |= V4L2_CAP_VBI_CAPTURE; | 1594 | cap->device_caps = V4L2_CAP_READWRITE | |
1595 | V4L2_CAP_VBI_CAPTURE | V4L2_CAP_SLICED_VBI_CAPTURE; | ||
1594 | 1596 | ||
1595 | if (dev->audio_mode.has_audio) | 1597 | if (dev->audio_mode.has_audio) |
1596 | cap->capabilities |= V4L2_CAP_AUDIO; | 1598 | cap->device_caps |= V4L2_CAP_AUDIO; |
1597 | 1599 | ||
1598 | if (dev->tuner_type != TUNER_ABSENT) | 1600 | if (dev->tuner_type != TUNER_ABSENT) |
1599 | cap->capabilities |= V4L2_CAP_TUNER; | 1601 | cap->device_caps |= V4L2_CAP_TUNER; |
1600 | 1602 | ||
1603 | cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS | | ||
1604 | V4L2_CAP_READWRITE | V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING; | ||
1605 | if (dev->vbi_dev) | ||
1606 | cap->capabilities |= | ||
1607 | V4L2_CAP_VBI_CAPTURE | V4L2_CAP_SLICED_VBI_CAPTURE; | ||
1608 | if (dev->radio_dev) | ||
1609 | cap->capabilities |= V4L2_CAP_RADIO; | ||
1601 | return 0; | 1610 | return 0; |
1602 | } | 1611 | } |
1603 | 1612 | ||
@@ -1831,19 +1840,6 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b) | |||
1831 | /* RADIO ESPECIFIC IOCTLS */ | 1840 | /* RADIO ESPECIFIC IOCTLS */ |
1832 | /* ----------------------------------------------------------- */ | 1841 | /* ----------------------------------------------------------- */ |
1833 | 1842 | ||
1834 | static int radio_querycap(struct file *file, void *priv, | ||
1835 | struct v4l2_capability *cap) | ||
1836 | { | ||
1837 | struct em28xx *dev = ((struct em28xx_fh *)priv)->dev; | ||
1838 | |||
1839 | strlcpy(cap->driver, "em28xx", sizeof(cap->driver)); | ||
1840 | strlcpy(cap->card, em28xx_boards[dev->model].name, sizeof(cap->card)); | ||
1841 | usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info)); | ||
1842 | |||
1843 | cap->capabilities = V4L2_CAP_TUNER; | ||
1844 | return 0; | ||
1845 | } | ||
1846 | |||
1847 | static int radio_g_tuner(struct file *file, void *priv, | 1843 | static int radio_g_tuner(struct file *file, void *priv, |
1848 | struct v4l2_tuner *t) | 1844 | struct v4l2_tuner *t) |
1849 | { | 1845 | { |
@@ -2281,7 +2277,7 @@ static const struct v4l2_file_operations radio_fops = { | |||
2281 | }; | 2277 | }; |
2282 | 2278 | ||
2283 | static const struct v4l2_ioctl_ops radio_ioctl_ops = { | 2279 | static const struct v4l2_ioctl_ops radio_ioctl_ops = { |
2284 | .vidioc_querycap = radio_querycap, | 2280 | .vidioc_querycap = vidioc_querycap, |
2285 | .vidioc_g_tuner = radio_g_tuner, | 2281 | .vidioc_g_tuner = radio_g_tuner, |
2286 | .vidioc_enum_input = radio_enum_input, | 2282 | .vidioc_enum_input = radio_enum_input, |
2287 | .vidioc_g_audio = radio_g_audio, | 2283 | .vidioc_g_audio = radio_g_audio, |