summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/tea5767.c4
-rw-r--r--linux/drivers/media/video/tuner-core.c17
2 files changed, 12 insertions, 9 deletions
diff --git a/linux/drivers/media/video/tea5767.c b/linux/drivers/media/video/tea5767.c
index f34dc46b0..6d3f0a3f9 100644
--- a/linux/drivers/media/video/tea5767.c
+++ b/linux/drivers/media/video/tea5767.c
@@ -2,7 +2,7 @@
* For Philips TEA5767 FM Chip used on some TV Cards like Prolink Pixelview
* I2C address is allways 0xC0.
*
- * $Id: tea5767.c,v 1.16 2005/07/05 17:37:35 nsh Exp $
+ * $Id: tea5767.c,v 1.17 2005/07/06 03:33:43 mchehab Exp $
*
* Copyright (c) 2005 Mauro Carvalho Chehab (mchehab@brturbo.com.br)
* This code is placed under the terms of the GNU General Public License
@@ -206,7 +206,7 @@ static void set_radio_freq(struct i2c_client *c, unsigned int frq)
TEA5767_ST_NOISE_CTL | TEA5767_JAPAN_BAND;
buffer[4] = 0;
- if (t->mode == T_STANDBY) {
+ if (t->mode_mask & T_STANDBY) {
tuner_dbg("TEA5767 set to standby mode\n");
buffer[3] |= TEA5767_STDBY;
}
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;