aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/cx231xx/cx231xx-video.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-02-09 04:40:33 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-03-05 12:25:58 -0500
commit0752d98e1a5619553d46a67590cdd94ee5827ff3 (patch)
tree1a953ec8c0fe05d80933b6be6b63db606e32e9b6 /drivers/media/usb/cx231xx/cx231xx-video.c
parent8b735c130717cb0af7793e30bbb6e91709ef10f8 (diff)
[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>
Diffstat (limited to 'drivers/media/usb/cx231xx/cx231xx-video.c')
-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,
1356 if (f->tuner) 1356 if (f->tuner)
1357 return -EINVAL; 1357 return -EINVAL;
1358 1358
1359 f->type = fh->radio ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
1360 f->frequency = dev->ctl_freq; 1359 f->frequency = dev->ctl_freq;
1361 1360
1362 call_all(dev, tuner, g_frequency, f);
1363
1364 return 0; 1361 return 0;
1365} 1362}
1366 1363
@@ -1383,16 +1380,12 @@ static int vidioc_s_frequency(struct file *file, void *priv,
1383 if (0 != f->tuner) 1380 if (0 != f->tuner)
1384 return -EINVAL; 1381 return -EINVAL;
1385 1382
1386 if (unlikely(0 == fh->radio && f->type != V4L2_TUNER_ANALOG_TV))
1387 return -EINVAL;
1388 if (unlikely(1 == fh->radio && f->type != V4L2_TUNER_RADIO))
1389 return -EINVAL;
1390
1391 /* set pre channel change settings in DIF first */ 1383 /* set pre channel change settings in DIF first */
1392 rc = cx231xx_tuner_pre_channel_change(dev); 1384 rc = cx231xx_tuner_pre_channel_change(dev);
1393 1385
1394 dev->ctl_freq = f->frequency;
1395 call_all(dev, tuner, s_frequency, f); 1386 call_all(dev, tuner, s_frequency, f);
1387 call_all(dev, tuner, g_frequency, f);
1388 dev->ctl_freq = f->frequency;
1396 1389
1397 /* set post channel change settings in DIF first */ 1390 /* set post channel change settings in DIF first */
1398 rc = cx231xx_tuner_post_channel_change(dev); 1391 rc = cx231xx_tuner_post_channel_change(dev);