]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
V4L/DVB (4222): Always switch tuner mode when calling VIDIOC_S_FREQUENCY.
authorHans Verkuil <hverkuil@xs4all.nl>
Sat, 24 Jun 2006 12:47:56 +0000 (09:47 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Mon, 26 Jun 2006 12:21:35 +0000 (09:21 -0300)
Fixes the weird and incorrect condition in VIDIOC_S_FREQUENCY.
The tuner should always be switched to the mode specified in the
v4l2_frequency struct. Much simpler and also corresponding to the
v4l2 specification.
The old condition made it impossible to switch from radio to
analog tv mode using VIDIOC_S_FREQUENCY. Instead the (tv) frequency would
be given to the radio tuner.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/tuner-core.c

index e95792fd70f8a3193e081a8a611438f032c9bb55..a26ded7d6faef86d7ff23ee4b44b9786e099b784 100644 (file)
@@ -730,14 +730,10 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
                {
                        struct v4l2_frequency *f = arg;
 
+                       if (set_mode (client, t, f->type, "VIDIOC_S_FREQUENCY")
+                                       == EINVAL)
+                               return 0;
                        switch_v4l2();
-                       if ((V4L2_TUNER_RADIO == f->type && V4L2_TUNER_RADIO != t->mode)
-                               || (V4L2_TUNER_DIGITAL_TV == f->type
-                                       && V4L2_TUNER_DIGITAL_TV != t->mode)) {
-                               if (set_mode (client, t, f->type, "VIDIOC_S_FREQUENCY")
-                                           == EINVAL)
-                                       return 0;
-                       }
                        set_freq(client,f->frequency);
 
                        break;