Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 366995
b: refs/heads/master
c: c3b3e0c
h: refs/heads/master
i:
  366993: 77e7cc2
  366991: 398878f
v: v3
  • Loading branch information
Ondrej Zary authored and Mauro Carvalho Chehab committed Apr 14, 2013
1 parent 25f758a commit 3e578a7
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d67492585d8308a22a841956f1e629ef3b7d0315
refs/heads/master: c3b3e0c5fd5ccacecf454d60c8fdc5caa96ba862
58 changes: 34 additions & 24 deletions trunk/drivers/media/pci/saa7134/saa7134-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1805,26 +1805,49 @@ static int saa7134_querycap(struct file *file, void *priv,
{
struct saa7134_fh *fh = priv;
struct saa7134_dev *dev = fh->dev;
struct video_device *vdev = video_devdata(file);
u32 radio_caps, video_caps, vbi_caps;

unsigned int tuner_type = dev->tuner_type;

strcpy(cap->driver, "saa7134");
strlcpy(cap->card, saa7134_boards[dev->board].name,
sizeof(cap->card));
sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci));
cap->capabilities =
V4L2_CAP_VIDEO_CAPTURE |
V4L2_CAP_VBI_CAPTURE |
V4L2_CAP_READWRITE |
V4L2_CAP_STREAMING |
V4L2_CAP_TUNER;

cap->device_caps = V4L2_CAP_READWRITE | V4L2_CAP_STREAMING;
if ((tuner_type != TUNER_ABSENT) && (tuner_type != UNSET))
cap->device_caps |= V4L2_CAP_TUNER;

radio_caps = V4L2_CAP_RADIO;
if (dev->has_rds)
cap->capabilities |= V4L2_CAP_RDS_CAPTURE;
radio_caps |= V4L2_CAP_RDS_CAPTURE;

video_caps = V4L2_CAP_VIDEO_CAPTURE;
if (saa7134_no_overlay <= 0)
cap->capabilities |= V4L2_CAP_VIDEO_OVERLAY;
video_caps |= V4L2_CAP_VIDEO_OVERLAY;

vbi_caps = V4L2_CAP_VBI_CAPTURE;

switch (vdev->vfl_type) {
case VFL_TYPE_RADIO:
cap->device_caps |= radio_caps;
break;
case VFL_TYPE_GRABBER:
cap->device_caps |= video_caps;
break;
case VFL_TYPE_VBI:
cap->device_caps |= vbi_caps;
break;
}
cap->capabilities = radio_caps | video_caps | vbi_caps |
cap->device_caps | V4L2_CAP_DEVICE_CAPS;
if (vdev->vfl_type == VFL_TYPE_RADIO) {
cap->device_caps &= ~V4L2_CAP_STREAMING;
if (!dev->has_rds)
cap->device_caps &= ~V4L2_CAP_READWRITE;
}

if ((tuner_type == TUNER_ABSENT) || (tuner_type == UNSET))
cap->capabilities &= ~V4L2_CAP_TUNER;
return 0;
}

Expand Down Expand Up @@ -2312,19 +2335,6 @@ static int vidioc_s_register (struct file *file, void *priv,
}
#endif

static int radio_querycap(struct file *file, void *priv,
struct v4l2_capability *cap)
{
struct saa7134_fh *fh = file->private_data;
struct saa7134_dev *dev = fh->dev;

strcpy(cap->driver, "saa7134");
strlcpy(cap->card, saa7134_boards[dev->board].name, sizeof(cap->card));
sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci));
cap->capabilities = V4L2_CAP_TUNER;
return 0;
}

static int radio_g_tuner(struct file *file, void *priv,
struct v4l2_tuner *t)
{
Expand Down Expand Up @@ -2486,7 +2496,7 @@ static const struct v4l2_file_operations radio_fops = {
};

static const struct v4l2_ioctl_ops radio_ioctl_ops = {
.vidioc_querycap = radio_querycap,
.vidioc_querycap = saa7134_querycap,
.vidioc_g_tuner = radio_g_tuner,
.vidioc_enum_input = radio_enum_input,
.vidioc_g_audio = radio_g_audio,
Expand Down

0 comments on commit 3e578a7

Please sign in to comment.