Commit bbf7871e authored by Michael H. Schimek's avatar Michael H. Schimek Committed by Linus Torvalds

[PATCH] V4L: Fix bttv ioctls VIDIOC_ENUMINPUT, VIDIOCGTUNER, VIDIOC_QUERYCAP

Fixed bttv ioctls VIDIOC_ENUMINPUT, VIDIOCGTUNER, VIDIOC_QUERYCAP.
Signed-off-by: default avatarNickolay V. Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: default avatarMichael H. Schimek <mschimek@gmx.at>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent fd1eab73
...@@ -1720,7 +1720,7 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg) ...@@ -1720,7 +1720,7 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg)
memset(i,0,sizeof(*i)); memset(i,0,sizeof(*i));
i->index = n; i->index = n;
i->type = V4L2_INPUT_TYPE_CAMERA; i->type = V4L2_INPUT_TYPE_CAMERA;
i->audioset = 1; i->audioset = 0;
if (i->index == bttv_tvcards[btv->c.type].tuner) { if (i->index == bttv_tvcards[btv->c.type].tuner) {
sprintf(i->name, "Television"); sprintf(i->name, "Television");
i->type = V4L2_INPUT_TYPE_TUNER; i->type = V4L2_INPUT_TYPE_TUNER;
...@@ -1771,11 +1771,19 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg) ...@@ -1771,11 +1771,19 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg)
memset(t,0,sizeof(*t)); memset(t,0,sizeof(*t));
strcpy(t->name, "Television"); strcpy(t->name, "Television");
t->type = V4L2_TUNER_ANALOG_TV; t->type = V4L2_TUNER_ANALOG_TV;
t->rangehigh = 0xffffffffUL;
t->capability = V4L2_TUNER_CAP_NORM; t->capability = V4L2_TUNER_CAP_NORM;
t->rxsubchans = V4L2_TUNER_SUB_MONO; t->rxsubchans = V4L2_TUNER_SUB_MONO;
if (btread(BT848_DSTATUS)&BT848_DSTATUS_HLOC) if (btread(BT848_DSTATUS)&BT848_DSTATUS_HLOC)
t->signal = 0xffff; t->signal = 0xffff;
{
struct video_tuner tuner;
memset(&tuner, 0, sizeof (tuner));
tuner.rangehigh = 0xffffffffUL;
bttv_call_i2c_clients(btv, VIDIOCGTUNER, &tuner);
t->rangelow = tuner.rangelow;
t->rangehigh = tuner.rangehigh;
}
{ {
/* Hmmm ... */ /* Hmmm ... */
struct video_audio va; struct video_audio va;
...@@ -2610,9 +2618,11 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, ...@@ -2610,9 +2618,11 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
if (0 == v4l2) if (0 == v4l2)
return -EINVAL; return -EINVAL;
strcpy(cap->driver,"bttv"); memset(cap, 0, sizeof (*cap));
strlcpy(cap->card,btv->video_dev->name,sizeof(cap->card)); strlcpy(cap->driver, "bttv", sizeof (cap->driver));
sprintf(cap->bus_info,"PCI:%s",pci_name(btv->c.pci)); strlcpy(cap->card, btv->video_dev->name, sizeof (cap->card));
snprintf(cap->bus_info, sizeof (cap->bus_info),
"PCI:%s", pci_name(btv->c.pci));
cap->version = BTTV_VERSION_CODE; cap->version = BTTV_VERSION_CODE;
cap->capabilities = cap->capabilities =
V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_CAPTURE |
......
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