diff options
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-video.c | 5 | ||||
-rw-r--r-- | linux/drivers/media/video/tuner-core.c | 13 | ||||
-rw-r--r-- | v4l/ChangeLog | 10 |
3 files changed, 23 insertions, 5 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-video.c b/linux/drivers/media/video/cx88/cx88-video.c index 5110ac203..fd744d712 100644 --- a/linux/drivers/media/video/cx88/cx88-video.c +++ b/linux/drivers/media/video/cx88/cx88-video.c @@ -1,5 +1,5 @@ /* - * $Id: cx88-video.c,v 1.74 2005/07/03 13:41:38 mchehab Exp $ + * $Id: cx88-video.c,v 1.75 2005/07/03 18:29:45 mchehab Exp $ * * device driver for Conexant 2388x based TV cards * video4linux video interface @@ -1599,6 +1599,9 @@ static int video_do_ioctl(struct inode *inode, struct file *file, f->type = fh->radio ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; f->frequency = dev->freq; + + cx88_call_i2c_clients(dev->core,VIDIOC_G_FREQUENCY,f); + return 0; } case VIDIOC_S_FREQUENCY: 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; } diff --git a/v4l/ChangeLog b/v4l/ChangeLog index b716a326e..dbb1945fd 100644 --- a/v4l/ChangeLog +++ b/v4l/ChangeLog @@ -1,3 +1,13 @@ +2005-07-03 18:30 mchehab + * tuner-core.c: + - Added some comments about I2C working mode. + - Frequency initialized for radio and TV. + + * cx88-video: + - It calls VIDIOC_G_FREQUENCY to get tuner freq from tuner. + + Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br> + 2005-07-03 13:40 mchehab * bttv-i2c.c, cx88-i2c.c, saa7134-i2c.c: - I2C cleanups. Now, all drivers uses the same basic structure. |