saa7134 tuner problem solved

Elad Lahav <[email protected]> Tue, 18 Oct 2005 14:15:09 -0400
Newsgroups gmane.comp.kde.kwintv
Organization School of Computer Science, University of Waterloo
Message-ID <[email protected]>
Hi,

I found a bug in the saa7134 driver that prevented kdetv from setting the
tuner frequency. Apparently, the VIDIOC_G_TUNER ioctl does not set the
tuner type field in the v4l2_tuner structure. Instead, this value remains
as 0, which is the tuner type kdetv then passes to the VIDIOC_S_FREQUENCY
ioctl, resulting in an invalid parameter error.

Here is a patch to fix the problem (made for Kernel 2.6.13.2):

--- drivers/media/video/saa7134/saa7134-video.c 2005-09-16
21:02:12.000000000 -0400
+++ drivers/media/video/saa7134/saa7134-video.c 2005-10-17
23:37:58.000000000 -0400
@@ -1840,6 +1840,7 @@
                                break;
                if (NULL != card_in(dev,n).name) {
                        strcpy(t->name, "Television");
+                       t->type = V4L2_TUNER_ANALOG_TV;
                        t->capability = V4L2_TUNER_CAP_NORM |
                                V4L2_TUNER_CAP_STEREO |
                                V4L2_TUNER_CAP_LANG1 |

I have posted the same message on the video4linux mailing list, in hope that
the bug will be fixed by the next kernel release.

Elad