summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-02-09 13:40:33 +0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-03-05 21:25:58 +0400
commit0752d98e1a5619553d46a67590cdd94ee5827ff3 (patch)
tree1a953ec8c0fe05d80933b6be6b63db606e32e9b6
parent8b735c130717cb0af7793e30bbb6e91709ef10f8 (diff)
downloadlinux-0752d98e1a5619553d46a67590cdd94ee5827ff3.tar.xz
[media] cx231xx: fix frequency clamping
Let the tuner clamp the frequency and store that clamped value. This fixes a v4l2_compliance failure. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-video.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c
index 9593fd3cdc85..f3104f008f46 100644
--- a/drivers/media/usb/cx231xx/cx231xx-video.c
+++ b/drivers/media/usb/cx231xx/cx231xx-video.c
@@ -1356,11 +1356,8 @@ static int vidioc_g_frequency(struct file *file, void *priv,
if (f->tuner)
return -EINVAL;
- f->type = fh->radio ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
f->frequency = dev->ctl_freq;
- call_all(dev, tuner, g_frequency, f);
-
return 0;
}
@@ -1383,16 +1380,12 @@ static int vidioc_s_frequency(struct file *file, void *priv,
if (0 != f->tuner)
return -EINVAL;
- if (unlikely(0 == fh->radio && f->type != V4L2_TUNER_ANALOG_TV))
- return -EINVAL;
- if (unlikely(1 == fh->radio && f->type != V4L2_TUNER_RADIO))
- return -EINVAL;
-
/* set pre channel change settings in DIF first */
rc = cx231xx_tuner_pre_channel_change(dev);
- dev->ctl_freq = f->frequency;
call_all(dev, tuner, s_frequency, f);
+ call_all(dev, tuner, g_frequency, f);
+ dev->ctl_freq = f->frequency;
/* set post channel change settings in DIF first */
rc = cx231xx_tuner_post_channel_change(dev);