From 6bfafe7457958e5204d16694c429472c39fa9d15 Mon Sep 17 00:00:00 2001 From: "Nickolay V. Shmyrev" Date: Fri, 10 Jun 2005 19:53:26 +0000 Subject: Use audio gain for stereo radio. Correctly check stereo for different tuner types. --- linux/drivers/media/video/tuner-simple.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'linux/drivers/media/video/tuner-simple.c') diff --git a/linux/drivers/media/video/tuner-simple.c b/linux/drivers/media/video/tuner-simple.c index a43ac3553..e79366b83 100644 --- a/linux/drivers/media/video/tuner-simple.c +++ b/linux/drivers/media/video/tuner-simple.c @@ -1,5 +1,5 @@ /* - * $Id: tuner-simple.c,v 1.20 2005/06/08 01:28:09 mchehab Exp $ + * $Id: tuner-simple.c,v 1.21 2005/06/10 19:53:26 nsh Exp $ * * i2c tv tuner chip device driver * controls all those simple 4-control-bytes style tuners. @@ -247,7 +247,8 @@ static int tuner_getstatus(struct i2c_client *c) #define TUNER_MODE 0x38 #define TUNER_AFC 0x07 -#define TUNER_STEREO 0x04 /* radio mode */ +#define TUNER_STEREO 0x10 /* radio mode */ +#define TUNER_STEREO_MK3 0x04 /* radio mode */ #define TUNER_SIGNAL 0x07 /* radio mode */ static int tuner_signal(struct i2c_client *c) @@ -257,7 +258,22 @@ static int tuner_signal(struct i2c_client *c) static int tuner_stereo(struct i2c_client *c) { - return ((tuner_getstatus (c) & TUNER_SIGNAL) == TUNER_STEREO); + int stereo, status; + struct tuner *t = i2c_get_clientdata(c); + + status = tuner_getstatus (c); + + switch (t->type) { + case TUNER_PHILIPS_FM1216ME_MK3: + case TUNER_PHILIPS_FM1236_MK3: + case TUNER_PHILIPS_FM1256_IH3: + stereo = ((status & TUNER_SIGNAL) == TUNER_STEREO_MK3); + break; + default: + stereo = status & TUNER_STEREO; + } + + return stereo; } #if 0 /* unused */ -- cgit v1.2.3