From a1c94280a70a682e3468e3710c3f5790d22a3574 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 6 Jun 2005 04:54:42 +0000 Subject: tea5767.c: - Implemented status dump information for debug - Signal strengh indication corrected - Mono/Stereo detection corrected tuner-core.c: - Implemented radio stereo indication according w/ V4L and V4L2 API --- linux/drivers/media/video/tuner-core.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'linux/drivers/media/video/tuner-core.c') diff --git a/linux/drivers/media/video/tuner-core.c b/linux/drivers/media/video/tuner-core.c index cb954082b..f44f7d9be 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.8 2005/06/05 17:44:04 mchehab Exp $ + * $Id: tuner-core.c,v 1.9 2005/06/06 04:54:42 mchehab Exp $ * * i2c tv tuner chip device driver * core core, i.e. kernel interfaces, registering and so on @@ -400,8 +400,15 @@ tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) CHECK_ADDR(radio_tuner,"VIDIOCGTUNER:"); CHECK_V4L2; - if (V4L2_TUNER_RADIO == t->mode && t->has_signal) - vt->signal = t->has_signal(client); + if (V4L2_TUNER_RADIO == t->mode) { + if (t->has_signal) + vt->signal = t->has_signal(client); + if (t->is_stereo(client)) + vt-> flags |= VIDEO_TUNER_STEREO_ON; + else + vt-> flags &= 0xffff ^ VIDEO_TUNER_STEREO_ON; + } + return 0; } case VIDIOCGAUDIO: @@ -459,8 +466,18 @@ tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) CHECK_MODE("VIDIOC_G_TUNER"); SWITCH_V4L2; - if (V4L2_TUNER_RADIO == t->mode && t->has_signal) - tuner->signal = t->has_signal(client); + if (V4L2_TUNER_RADIO == t->mode) { + if (t->has_signal) + tuner -> signal = t->has_signal(client); + if (t->is_stereo(client)) { + tuner -> capability |= V4L2_TUNER_CAP_STEREO; + tuner -> rxsubchans |= V4L2_TUNER_SUB_STEREO; + tuner_dbg("stereo"); + } else { + tuner -> rxsubchans &= 0xffff ^ V4L2_TUNER_SUB_STEREO; + tuner_dbg("mono"); + } + } tuner->rangelow = tv_range[0] * 16; tuner->rangehigh = tv_range[1] * 16; break; -- cgit v1.2.3