[media] saa7134: v4l2-compliance: return real frequency
authorOndrej Zary <linux@rainbow-software.org>
Fri, 1 Feb 2013 23:01:17 +0000 (20:01 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 14 Apr 2013 22:00:28 +0000 (19:00 -0300)
Make saa7134 driver more V4L2 compliant: don't cache frequency in
s_frequency/g_frequency but return real one instead

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/pci/saa7134/saa7134-video.c
drivers/media/pci/saa7134/saa7134.h

index 941e2ebab41dc66aa86f8a1fa68caa494543b403..506a9f401db7ea4b520c9e1dcd15352a63cd2404 100644 (file)
@@ -2051,8 +2051,11 @@ static int saa7134_g_frequency(struct file *file, void *priv,
        struct saa7134_fh *fh = priv;
        struct saa7134_dev *dev = fh->dev;
 
+       if (0 != f->tuner)
+               return -EINVAL;
+
        f->type = fh->radio ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
-       f->frequency = dev->ctl_freq;
+       saa_call_all(dev, tuner, g_frequency, f);
 
        return 0;
 }
@@ -2070,7 +2073,6 @@ static int saa7134_s_frequency(struct file *file, void *priv,
        if (1 == fh->radio && V4L2_TUNER_RADIO != f->type)
                return -EINVAL;
        mutex_lock(&dev->lock);
-       dev->ctl_freq = f->frequency;
 
        saa_call_all(dev, tuner, s_frequency, f);
 
index fc07b19ed5363c6a161505c06675875883a88b84..d2ad16c1569a8be6120420549403706748ce1195 100644 (file)
@@ -607,7 +607,6 @@ struct saa7134_dev {
        int                        ctl_contrast;
        int                        ctl_hue;
        int                        ctl_saturation;
-       int                        ctl_freq;
        int                        ctl_mute;             /* audio */
        int                        ctl_volume;
        int                        ctl_invert;           /* private */