summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/tuner-core.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <devnull@localhost>2005-06-21 15:40:33 +0000
committerMauro Carvalho Chehab <devnull@localhost>2005-06-21 15:40:33 +0000
commit9b3919614ced214a1fb6f7773d5928a39c60ed62 (patch)
tree57872b904e2a717d20487027db39729cf4604474 /linux/drivers/media/video/tuner-core.c
parenta2248b164fa97fa24ff2eb744da7831758971445 (diff)
downloadmediapointer-dvb-s2-9b3919614ced214a1fb6f7773d5928a39c60ed62.tar.gz
mediapointer-dvb-s2-9b3919614ced214a1fb6f7773d5928a39c60ed62.tar.bz2
*tuner-core.c:
- some tuner_info msgs will be generated only if insmod opt tuner_debug enabled. *tea5767.c: - tuner_info msgs will be generated only if insmod tuner option tuner_debug enabled. - some cleanups for better reading. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'linux/drivers/media/video/tuner-core.c')
-rw-r--r--linux/drivers/media/video/tuner-core.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/linux/drivers/media/video/tuner-core.c b/linux/drivers/media/video/tuner-core.c
index 29ce58986..a5c3b6ab5 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.28 2005/06/21 02:35:38 mchehab Exp $
+ * $Id: tuner-core.c,v 1.29 2005/06/21 15:40:33 mchehab Exp $
*
* i2c tv tuner chip device driver
* core core, i.e. kernel interfaces, registering and so on
@@ -107,8 +107,9 @@ static void set_radio_freq(struct i2c_client *c, unsigned int freq)
return;
}
if (freq >= radio_range[0]*16000 && freq <= radio_range[1]*16000) {
- tuner_info("radio freq step 62.5Hz (%d.%06d)\n",
- freq/16000,freq%16000*1000/16);
+ if (tuner_debug)
+ tuner_info("radio freq step 62.5Hz (%d.%06d)\n",
+ freq/16000,freq%16000*1000/16);
t->radio_freq(c,freq);
} else {
tuner_info("radio freq (%d.%02d) out of range (%d-%d)\n",
@@ -200,7 +201,7 @@ static void set_type(struct i2c_client *c, unsigned int type)
}
#define CHECK_ADDR(tp,cmd,tun) if (client->addr!=tp) { \
- return 0; } else \
+ return 0; } else if (tuner_debug) \
tuner_info ("Cmd %s accepted to "tun"\n",cmd);
#define CHECK_MODE(cmd) if (t->mode == V4L2_TUNER_RADIO) { \
CHECK_ADDR(radio_tuner,cmd,"radio") } else \
@@ -376,7 +377,7 @@ tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
t->radio_if2 = 41300 * 1000;
break;
}
- break;
+ break;
/* --- v4l ioctls --- */
/* take care: bttv does userspace copying, we'll get a
kernel pointer here... */
@@ -530,11 +531,12 @@ tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
V4L2_TUNER_MODE_LANG1, V4L2_TUNER_MODE_LANG2,
V4L2_TUNER_MODE_SAP */
- if (t->set_tuner) {
- t->set_tuner(client,tuner);
- } else {
- tuner_dbg ("Unimplemented IOCTL VIDIO_S_TUNER called to tuner-core.\n");
- }
+ if (tuner->audmode == V4L2_TUNER_MODE_MONO)
+ t->audmode = V4L2_TUNER_MODE_MONO;
+ else
+ t->audmode = V4L2_TUNER_MODE_STEREO;
+
+ set_radio_freq(client, t->freq);
break;
}
case TDA9887_SET_CONFIG: /* Nothing to do on tuner-core */