aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMichael H. Schimek <mschimek@gmx.at>2005-12-01 03:51:40 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-12-01 18:48:58 -0500
commitbbf7871e1cd58b89f77b1152f457250c6e94b614 (patch)
tree77ae1f89a8e47701629d1cb6bbd49ac377b254c6 /drivers/media
parentfd1eab73d50258b4c622b8dc23d896abd5cff2e6 (diff)
[PATCH] V4L: Fix bttv ioctls VIDIOC_ENUMINPUT, VIDIOCGTUNER, VIDIOC_QUERYCAP
Fixed bttv ioctls VIDIOC_ENUMINPUT, VIDIOCGTUNER, VIDIOC_QUERYCAP. Signed-off-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru> Signed-off-by: Michael H. Schimek <mschimek@gmx.at> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/bttv-driver.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/media/video/bttv-driver.c b/drivers/media/video/bttv-driver.c
index 6fcc20de48d3..3c58a2a68906 100644
--- a/drivers/media/video/bttv-driver.c
+++ b/drivers/media/video/bttv-driver.c
@@ -1720,7 +1720,7 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg)
1720 memset(i,0,sizeof(*i)); 1720 memset(i,0,sizeof(*i));
1721 i->index = n; 1721 i->index = n;
1722 i->type = V4L2_INPUT_TYPE_CAMERA; 1722 i->type = V4L2_INPUT_TYPE_CAMERA;
1723 i->audioset = 1; 1723 i->audioset = 0;
1724 if (i->index == bttv_tvcards[btv->c.type].tuner) { 1724 if (i->index == bttv_tvcards[btv->c.type].tuner) {
1725 sprintf(i->name, "Television"); 1725 sprintf(i->name, "Television");
1726 i->type = V4L2_INPUT_TYPE_TUNER; 1726 i->type = V4L2_INPUT_TYPE_TUNER;
@@ -1771,12 +1771,20 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg)
1771 memset(t,0,sizeof(*t)); 1771 memset(t,0,sizeof(*t));
1772 strcpy(t->name, "Television"); 1772 strcpy(t->name, "Television");
1773 t->type = V4L2_TUNER_ANALOG_TV; 1773 t->type = V4L2_TUNER_ANALOG_TV;
1774 t->rangehigh = 0xffffffffUL;
1775 t->capability = V4L2_TUNER_CAP_NORM; 1774 t->capability = V4L2_TUNER_CAP_NORM;
1776 t->rxsubchans = V4L2_TUNER_SUB_MONO; 1775 t->rxsubchans = V4L2_TUNER_SUB_MONO;
1777 if (btread(BT848_DSTATUS)&BT848_DSTATUS_HLOC) 1776 if (btread(BT848_DSTATUS)&BT848_DSTATUS_HLOC)
1778 t->signal = 0xffff; 1777 t->signal = 0xffff;
1779 { 1778 {
1779 struct video_tuner tuner;
1780
1781 memset(&tuner, 0, sizeof (tuner));
1782 tuner.rangehigh = 0xffffffffUL;
1783 bttv_call_i2c_clients(btv, VIDIOCGTUNER, &tuner);
1784 t->rangelow = tuner.rangelow;
1785 t->rangehigh = tuner.rangehigh;
1786 }
1787 {
1780 /* Hmmm ... */ 1788 /* Hmmm ... */
1781 struct video_audio va; 1789 struct video_audio va;
1782 memset(&va, 0, sizeof(struct video_audio)); 1790 memset(&va, 0, sizeof(struct video_audio));
@@ -2610,9 +2618,11 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
2610 2618
2611 if (0 == v4l2) 2619 if (0 == v4l2)
2612 return -EINVAL; 2620 return -EINVAL;
2613 strcpy(cap->driver,"bttv"); 2621 memset(cap, 0, sizeof (*cap));
2614 strlcpy(cap->card,btv->video_dev->name,sizeof(cap->card)); 2622 strlcpy(cap->driver, "bttv", sizeof (cap->driver));
2615 sprintf(cap->bus_info,"PCI:%s",pci_name(btv->c.pci)); 2623 strlcpy(cap->card, btv->video_dev->name, sizeof (cap->card));
2624 snprintf(cap->bus_info, sizeof (cap->bus_info),
2625 "PCI:%s", pci_name(btv->c.pci));
2616 cap->version = BTTV_VERSION_CODE; 2626 cap->version = BTTV_VERSION_CODE;
2617 cap->capabilities = 2627 cap->capabilities =
2618 V4L2_CAP_VIDEO_CAPTURE | 2628 V4L2_CAP_VIDEO_CAPTURE |