diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2006-06-24 08:47:56 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-06-26 08:21:35 -0400 |
commit | 4f725cb3fa46fabe7fd7c7175fa77e12616bfdb8 (patch) | |
tree | c525f45faa57f52670e4dd348deb5f7acb8a7dc9 | |
parent | 91a972910df042a0a308b2ffd3aa6fd42b0242e3 (diff) |
V4L/DVB (4222): Always switch tuner mode when calling VIDIOC_S_FREQUENCY.
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>
-rw-r--r-- | drivers/media/video/tuner-core.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index e95792fd70f8..a26ded7d6fae 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c | |||
@@ -730,14 +730,10 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
730 | { | 730 | { |
731 | struct v4l2_frequency *f = arg; | 731 | struct v4l2_frequency *f = arg; |
732 | 732 | ||
733 | if (set_mode (client, t, f->type, "VIDIOC_S_FREQUENCY") | ||
734 | == EINVAL) | ||
735 | return 0; | ||
733 | switch_v4l2(); | 736 | switch_v4l2(); |
734 | if ((V4L2_TUNER_RADIO == f->type && V4L2_TUNER_RADIO != t->mode) | ||
735 | || (V4L2_TUNER_DIGITAL_TV == f->type | ||
736 | && V4L2_TUNER_DIGITAL_TV != t->mode)) { | ||
737 | if (set_mode (client, t, f->type, "VIDIOC_S_FREQUENCY") | ||
738 | == EINVAL) | ||
739 | return 0; | ||
740 | } | ||
741 | set_freq(client,f->frequency); | 737 | set_freq(client,f->frequency); |
742 | 738 | ||
743 | break; | 739 | break; |