diff options
Diffstat (limited to 'linux/drivers/media/video/tuner-core.c')
-rw-r--r-- | linux/drivers/media/video/tuner-core.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/linux/drivers/media/video/tuner-core.c b/linux/drivers/media/video/tuner-core.c index cccddaeef..c6486aa59 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.46 2005/07/03 00:57:28 mchehab Exp $ + * $Id: tuner-core.c,v 1.47 2005/07/03 18:29:45 mchehab Exp $ * * i2c tv tuner chip device driver * core core, i.e. kernel interfaces, registering and so on @@ -151,9 +151,9 @@ static void set_type(struct i2c_client *c, unsigned int type, return; } - /* This code prevents against I2C early announces */ + /* This code detects calls by card attach_inform */ if (NULL == t->i2c.dev.driver) { - tuner_dbg ("tuner 0x%02x: I2C driver not registred yet!\n", c->addr); + tuner_dbg ("tuner 0x%02x: called before i2c_client register by adapter's attach_inform\n", c->addr); t->type=type; return; @@ -196,6 +196,7 @@ static void set_type(struct i2c_client *c, unsigned int type, if (t->admin_status == T_UNINITIALIZED) t->admin_status = new_admin_status; + set_freq(c, t->freq); tuner_dbg("%s %s I2C addr 0x%02x with type %d used for 0x%02x\n", c->adapter->name, c->driver->name, c->addr << 1, type, t->admin_status); @@ -306,6 +307,9 @@ static int tuner_fixup_std(struct tuner *t) /* static var Used only in tuner_attach and tuner_probe */ static unsigned default_admin_status; +/* During client attach, set_type is called by adapter's attach_inform callback. + set_type must then be completed by tuner_attach. + */ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind) { struct tuner *t; @@ -332,9 +336,9 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind) if (tea5767_autodetection(&t->i2c) != EINVAL) { t->type = TUNER_TEA5767; t->admin_status = T_RADIO | T_STANDBY; + t->freq = 87.5 * 16; /* Sets freq to FM range */ default_admin_status &= ~T_RADIO; - /* Should be just before return */ i2c_attach_client (&t->i2c); set_type(&t->i2c,t->type, t->admin_status); return 0; @@ -345,6 +349,7 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind) if (default_admin_status != T_UNINITIALIZED) { tuner_dbg ("Setting admin_status to 0x%02x\n", default_admin_status); t->admin_status = default_admin_status; + t->freq = 400 * 16; /* Sets freq to VHF High */ default_admin_status = T_UNINITIALIZED; } |