summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/tuner-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/tuner-core.c')
-rw-r--r--linux/drivers/media/video/tuner-core.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/linux/drivers/media/video/tuner-core.c b/linux/drivers/media/video/tuner-core.c
index f563a57f8..627edeff0 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.49 2005/07/05 17:37:35 nsh Exp $
+ * $Id: tuner-core.c,v 1.50 2005/07/06 03:33:43 mchehab Exp $
*
* i2c tv tuner chip device driver
* core core, i.e. kernel interfaces, registering and so on
@@ -131,7 +131,7 @@ static void set_freq(struct i2c_client *c, unsigned long freq)
freq / 16, freq % 16 * 100 / 16);
set_tv_freq(c, freq);
break;
- default:
+ default:
return;
}
t->freq = freq;
@@ -226,6 +226,7 @@ static void set_addr(struct i2c_client *c, struct tuner_setup *tun_setup)
static inline int check_mode (struct tuner *t, char *cmd)
{
if (t->mode & t->mode_mask) {
+ tuner_dbg ("mode=%d, mask=%d\n",t->mode, t->mode_mask);
switch (t->mode) {
case T_RADIO:
tuner_dbg ("Cmd %s accepted for radio\n", cmd);
@@ -237,6 +238,7 @@ static inline int check_mode (struct tuner *t, char *cmd)
tuner_dbg ("Cmd %s accepted for digital TV\n", cmd);
break;
default:
+ tuner_dbg ("Cmd %s for unknown mode %d\n", cmd,t->mode);
return EINVAL;
}
return 0;
@@ -406,15 +408,16 @@ static inline int set_mode(struct i2c_client *client, struct tuner *t, int mode,
if (mode != t->mode) {
t->mode = mode;
if (check_mode(t, cmd) == EINVAL) {
- t->mode = T_STANDBY;
- set_freq (client, t->freq);
- return EINVAL;
- } else {
+ t->mode_mask |= T_STANDBY;
if (T_RADIO == mode) {
set_tv_freq(client, 400 * 16);
} else {
set_radio_freq(client, 87.5 * 16000);
}
+ return EINVAL;
+ } else {
+ t->mode_mask &= ~T_STANDBY;
+ set_freq (client, t->freq);
}
}
return 0;
@@ -527,7 +530,7 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
vt->flags &=
~VIDEO_TUNER_STEREO_ON;
}
- vt->flags |= VIDEO_TUNER_LOW; /* Allow freqs at 62.5 Hz */
+ vt->flags |= V4L2_TUNER_CAP_LOW; /* Allow freqs at 62.5 Hz */
vt->rangelow = radio_range[0] * 16000;
vt->rangehigh = radio_range[1] * 16000;