summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <devnull@localhost>2005-06-09 11:44:24 +0000
committerMauro Carvalho Chehab <devnull@localhost>2005-06-09 11:44:24 +0000
commitf6df2aef7add3bcfd7f67da4179d09fad6e67ce2 (patch)
tree082849341ff335d477589ddb0f1dd63d35a3a128 /linux
parent428d1aaa0f65caf859776986cb58fecbe45cf46e (diff)
downloadmediapointer-dvb-s2-f6df2aef7add3bcfd7f67da4179d09fad6e67ce2.tar.gz
mediapointer-dvb-s2-f6df2aef7add3bcfd7f67da4179d09fad6e67ce2.tar.bz2
tuner_core.c, cx88-video.c:
- Add initial support for V4L2_TUNER_CAP_LOW. Still to be improved. - set_type call at set_addr fixed.
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/cx88/cx88-video.c3
-rw-r--r--linux/drivers/media/video/tuner-core.c49
2 files changed, 38 insertions, 14 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-video.c b/linux/drivers/media/video/cx88/cx88-video.c
index a1e40f6f3..1ca1f94c0 100644
--- a/linux/drivers/media/video/cx88/cx88-video.c
+++ b/linux/drivers/media/video/cx88/cx88-video.c
@@ -1,5 +1,5 @@
/*
- * $Id: cx88-video.c,v 1.60 2005/06/08 01:28:09 mchehab Exp $
+ * $Id: cx88-video.c,v 1.61 2005/06/09 11:44:24 mchehab Exp $
*
* device driver for Conexant 2388x based TV cards
* video4linux video interface
@@ -1357,6 +1357,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
V4L2_CAP_READWRITE |
V4L2_CAP_STREAMING |
V4L2_CAP_VBI_CAPTURE |
+ V4L2_TUNER_CAP_LOW |
#if 0
V4L2_CAP_VIDEO_OVERLAY |
#endif
diff --git a/linux/drivers/media/video/tuner-core.c b/linux/drivers/media/video/tuner-core.c
index e92c65160..424729d58 100644
--- a/linux/drivers/media/video/tuner-core.c
+++ b/linux/drivers/media/video/tuner-core.c
@@ -1,5 +1,5 @@
/*
- * $Id: tuner-core.c,v 1.12 2005/06/08 14:00:37 mchehab Exp $
+ * $Id: tuner-core.c,v 1.13 2005/06/09 11:44:24 mchehab Exp $
*
* i2c tv tuner chip device driver
* core core, i.e. kernel interfaces, registering and so on
@@ -90,13 +90,24 @@ static void set_tv_freq(struct i2c_client *c, unsigned int freq)
return;
}
if (freq < tv_range[0]*16 || freq > tv_range[1]*16) {
- /* FIXME: better do that chip-specific, but
- right now we don't have that in the config
- struct and this way is still better than no
- check at all */
- tuner_info("TV freq (%d.%02d) out of range (%d-%d)\n",
- freq/16,freq%16*100/16,tv_range[0],tv_range[1]);
- return;
+
+ if (freq >= tv_range[0]*16364 && freq <= tv_range[1]*16384) {
+ /* V4L2_TUNER_CAP_LOW frequency */
+
+ tuner_info("V4L2_TUNER_CAP_LOW freq selected for TV. Tuners yet doesn't support converting it to valid freq.\n");
+
+ t->tv_freq(c,freq>>10);
+
+ return;
+ } else {
+ /* FIXME: better do that chip-specific, but
+ right now we don't have that in the config
+ struct and this way is still better than no
+ check at all */
+ tuner_info("TV freq (%d.%02d) out of range (%d-%d)\n",
+ freq/16,freq%16*100/16,tv_range[0],tv_range[1]);
+ return;
+ }
}
t->tv_freq(c,freq);
}
@@ -114,10 +125,19 @@ static void set_radio_freq(struct i2c_client *c, unsigned int freq)
return;
}
if (freq < radio_range[0]*16 || freq > radio_range[1]*16) {
- tuner_info("radio freq (%d.%02d) out of range (%d-%d)\n",
+ if (freq >= tv_range[0]*16364 && freq <= tv_range[1]*16384) {
+ /* V4L2_TUNER_CAP_LOW frequency */
+
+ tuner_info("V4L2_TUNER_CAP_LOW freq selected for Radio. Tuners yet doesn't support converting it to valid freq.\n");
+
+ t->radio_freq(c,freq>>10);
+
+ } else {
+ tuner_info("radio freq (%d.%02d) out of range (%d-%d)\n",
freq/16,freq%16*100/16,
- radio_range[0],radio_range[1]);
- return;
+ radio_range[0],radio_range[1]);
+ return;
+ }
}
t->radio_freq(c,freq);
}
@@ -212,10 +232,12 @@ static void set_addr(struct i2c_client *c, struct tuner_addr *tun_addr)
switch (tun_addr->v4l2_tuner) {
case V4L2_TUNER_RADIO:
radio_tuner=tun_addr->addr;
- break;
+ if ( tun_addr->addr == c->addr ) set_type(c,tun_addr->type);
+ return;
default:
tv_tuner=tun_addr->addr;
- break;
+ if ( tun_addr->addr == c->addr ) set_type(c,tun_addr->type);
+ return;
}
}
set_type(c,tun_addr->type);
@@ -422,6 +444,7 @@ tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
else
vt-> flags &= 0xffff ^ VIDEO_TUNER_STEREO_ON;
}
+ vt->flags |= V4L2_TUNER_CAP_LOW; /* Allow freqs at 62.5 Hz */
}
return 0;