aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video/cx88/cx88-i2c.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@brturbo.com.br>2005-07-12 13:58:44 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-12 16:01:04 -0700
commit41ef7c1ed48cb273c7b7a9ffd48a262a22f84483 (patch)
treec3a2772ae4eb3ea34c5023921095b78d2acd352e /drivers/media/video/cx88/cx88-i2c.c
parentfa9846a8c5965636fbade8655ae0ce1f9a655bd4 (diff)
[PATCH] v4l: CX88 Update
- Removed unused structures. - Removed BTTV version check. - Some debug structs moved to their own .c file and converted to static - Comment changed to express better when attach_inform is running - set_freq removed from set_mode at tuner-core.c. - I2C cleanups and converged to a basic reference structure. - Rename tuner structures fields. - It calls VIDIOC_G_FREQUENCY to get tuner freq from tuner. - added missing contrast offset value, set to 0. - Let Kconfig decide whether to include frontend-specific code. Signed-Off-By: Nickolay V. Shmyrev <nshmyrev@yandex.ru> Signed-off-by: Michael Krufky <mkrufky@m1k.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/video/cx88/cx88-i2c.c')
-rw-r--r--drivers/media/video/cx88/cx88-i2c.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c
index b5342234b30..8403c4e9505 100644
--- a/drivers/media/video/cx88/cx88-i2c.c
+++ b/drivers/media/video/cx88/cx88-i2c.c
@@ -1,5 +1,5 @@
/*
- $Id: cx88-i2c.c,v 1.24 2005/06/17 18:46:23 mkrufky Exp $
+ $Id: cx88-i2c.c,v 1.28 2005/07/05 17:37:35 nsh Exp $
cx88-i2c.c -- all the i2c code is here
@@ -91,25 +91,32 @@ static int cx8800_bit_getsda(void *data)
static int attach_inform(struct i2c_client *client)
{
- struct tuner_addr tun_addr;
+ struct tuner_setup tun_setup;
struct cx88_core *core = i2c_get_adapdata(client->adapter);
- dprintk(1, "i2c attach [addr=0x%x,client=%s]\n",
- client->addr, i2c_clientname(client));
+ dprintk(1, "%s i2c attach [addr=0x%x,client=%s]\n",
+ client->driver->name,client->addr,i2c_clientname(client));
if (!client->driver->command)
return 0;
if (core->radio_type != UNSET) {
- tun_addr.v4l2_tuner = V4L2_TUNER_RADIO;
- tun_addr.type = core->radio_type;
- tun_addr.addr = core->radio_addr;
- client->driver->command(client,TUNER_SET_TYPE_ADDR, &tun_addr);
+ if ((core->radio_addr==ADDR_UNSET)||(core->radio_addr==client->addr)) {
+ tun_setup.mode_mask = T_RADIO;
+ tun_setup.type = core->radio_type;
+ tun_setup.addr = core->radio_addr;
+
+ client->driver->command (client, TUNER_SET_TYPE_ADDR, &tun_setup);
+ }
}
if (core->tuner_type != UNSET) {
- tun_addr.v4l2_tuner = V4L2_TUNER_ANALOG_TV;
- tun_addr.type = core->tuner_type;
- tun_addr.addr = core->tuner_addr;
- client->driver->command(client,TUNER_SET_TYPE_ADDR, &tun_addr);
+ if ((core->tuner_addr==ADDR_UNSET)||(core->tuner_addr==client->addr)) {
+
+ tun_setup.mode_mask = T_ANALOG_TV;
+ tun_setup.type = core->tuner_type;
+ tun_setup.addr = core->tuner_addr;
+
+ client->driver->command (client,TUNER_SET_TYPE_ADDR, &tun_setup);
+ }
}
if (core->tda9887_conf)