diff options
author | Mauro Carvalho Chehab <devnull@localhost> | 2005-07-01 17:50:10 +0000 |
---|---|---|
committer | Mauro Carvalho Chehab <devnull@localhost> | 2005-07-01 17:50:10 +0000 |
commit | e48e82e75652333d4d74ca31a4491d0cbe181ed0 (patch) | |
tree | 025bcb50784372cd1a99c2e6a6b7c83855f00b80 /linux | |
parent | 669535fb595eaa3d2d159fc0b3531cb770ebeafd (diff) | |
download | mediapointer-dvb-s2-e48e82e75652333d4d74ca31a4491d0cbe181ed0.tar.gz mediapointer-dvb-s2-e48e82e75652333d4d74ca31a4491d0cbe181ed0.tar.bz2 |
* tuner-core.c:
- Added a code to avoid I2C early announce.
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/video/tuner-core.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/linux/drivers/media/video/tuner-core.c b/linux/drivers/media/video/tuner-core.c index 3b85b442f..040647c0d 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.38 2005/07/01 15:02:09 mchehab Exp $ + * $Id: tuner-core.c,v 1.39 2005/07/01 17:50:10 mchehab Exp $ * * i2c tv tuner chip device driver * core core, i.e. kernel interfaces, registering and so on @@ -143,6 +143,7 @@ static void set_type(struct i2c_client *c, unsigned int type, enum tuner_admin_state new_admin_status) { struct tuner *t = i2c_get_clientdata(c); + unsigned int i; unsigned char buffer[4]; /* sanity check */ @@ -156,11 +157,19 @@ static void set_type(struct i2c_client *c, unsigned int type, return; } + /* This code prevents against I2C early announces */ if (NULL == t->i2c.dev.driver) { dprintk("tuner 0x%02x: I2C driver not registred yet!\n",c->addr); - t->type=type; - /* not registered yet */ - return; + + for (i=0;(i<5)&&(NULL == t->i2c.dev.driver);i++) { + msleep(1); /* Giver 1 ms for I2C */ + } + if (NULL == t->i2c.dev.driver) { + dprintk("tuner 0x%02x: I2C driver still not registred. Giving up!\n",c->addr); + t->type=type; + /* not registered yet */ + return; + } } /* if ((t->admin_status==T_UNINITIALIZED) && (t->type == type)) return; |