diff options
author | Mauro Carvalho Chehab <devnull@localhost> | 2005-06-20 15:35:05 +0000 |
---|---|---|
committer | Mauro Carvalho Chehab <devnull@localhost> | 2005-06-20 15:35:05 +0000 |
commit | aac6384c805c0867edcbc45270a63d4e4b366de8 (patch) | |
tree | 7de81377856686cc944f2b2c4a1ed18bf24aadb6 /linux/drivers/media/video/tuner-core.c | |
parent | 4e21c63b1bbee8b312500fa3d5ea141ecc9959e2 (diff) | |
download | mediapointer-dvb-s2-aac6384c805c0867edcbc45270a63d4e4b366de8.tar.gz mediapointer-dvb-s2-aac6384c805c0867edcbc45270a63d4e4b366de8.tar.bz2 |
This is some small changes on tuner-core.c to correct API behavior for stereo:
- v4l2_tuner has three fields for audio mode:
capability (bitmask, says what the hardware is able to do).
rxsubchans (bitmask, which channels are available).
audmode (enum, current mode).
For radio seeing a stereo signal but sending mono the driver
can simply set this:
rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO;
audmode = V4L2_TUNER_MODE_MONO;
- VIDIOCSTUNER should not allow turning stereo/mono. Code commented.
It will be removed soon.
Signed-off-by: Gerd Knorr <kraxel@bytesex.org>
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.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/linux/drivers/media/video/tuner-core.c b/linux/drivers/media/video/tuner-core.c index bda1fbbda..d86e234e3 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.26 2005/06/19 23:52:22 mchehab Exp $ + * $Id: tuner-core.c,v 1.27 2005/06/20 15:35:05 mchehab Exp $ * * i2c tv tuner chip device driver * core core, i.e. kernel interfaces, registering and so on @@ -186,14 +186,12 @@ static void set_type(struct i2c_client *c, unsigned int type) break; default: /* TEA5767 autodetection code */ - if ( c->addr==0x60 ) { if (tea5767_tuner_init(c)!=EINVAL) { t->type = TUNER_TEA5767; if (first_tuner == 0x60) first_tuner++; break; } - } default_tuner_init(c); break; @@ -502,17 +500,16 @@ tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) tuner -> signal = t->has_signal(client); if (t->is_stereo) { if (t->is_stereo(client)) { - tuner -> rxsubchans |= V4L2_TUNER_SUB_STEREO; + tuner -> rxsubchans = V4L2_TUNER_SUB_STEREO | V4L2_TUNER_SUB_MONO; } else { - tuner -> rxsubchans &= V4L2_TUNER_SUB_MONO; + tuner -> rxsubchans = V4L2_TUNER_SUB_MONO; } } - tuner->capability |= V4L2_TUNER_CAP_LOW; - tuner->capability |= V4L2_TUNER_CAP_STEREO; + tuner->capability |= V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO; + tuner->audmode = t->audmode; tuner->rangelow = radio_range[0] * 16000; tuner->rangehigh = radio_range[1] * 16000; - } else { tuner->rangelow = tv_range[0] * 16; tuner->rangehigh = tv_range[1] * 16; @@ -521,6 +518,8 @@ tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) } case VIDIOCSTUNER: { +#if 0 + /* This is NOT an expected valid behavior for V4L1 API CALL... Should be used only for testing purposes */ struct video_tuner *vt = arg; struct v4l2_tuner tuner; @@ -543,6 +542,7 @@ tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) tuner_dbg ("Unimplemented IOCTL VIDIO_S_TUNER called to tuner-core.\n"); } break; +#endif return 0; } |