From c02793e14e09db70e60f8d5caad26c81b9ce466e Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 19 Jun 2005 23:52:21 +0000 Subject: tea5767 autodetection code included. It uses the same approach as DScaler code. Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/tuner-core.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 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 e360a5c02..bda1fbbda 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.25 2005/06/19 20:05:12 mchehab Exp $ + * $Id: tuner-core.c,v 1.26 2005/06/19 23:52:22 mchehab Exp $ * * i2c tv tuner chip device driver * core core, i.e. kernel interfaces, registering and so on @@ -144,7 +144,6 @@ static void set_type(struct i2c_client *c, unsigned int type) struct tuner *t = i2c_get_clientdata(c); unsigned char buffer[4]; - tuner_dbg ("I2C addr 0x%02x with type %d\n",c->addr<<1,type); /* sanity check */ if (type == UNSET || type == TUNER_ABSENT) return; @@ -171,7 +170,7 @@ static void set_type(struct i2c_client *c, unsigned int type) tda8290_init(c); break; case TUNER_TEA5767: - tea5767_tuner_init(c); + if (tea5767_tuner_init(c)==EINVAL) t->type=TUNER_ABSENT; break; case TUNER_PHILIPS_FMD1216ME_MK3: buffer[0] = 0x0b; @@ -186,9 +185,20 @@ static void set_type(struct i2c_client *c, unsigned int type) default_tuner_init(c); 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; } + tuner_dbg ("I2C addr 0x%02x with type %d\n",c->addr<<1,type); } #define CHECK_ADDR(tp,cmd,tun) if (client->addr!=tp) { \ -- cgit v1.2.3