summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx88/cx88-i2c.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <devnull@localhost>2005-07-03 13:41:38 +0000
committerMauro Carvalho Chehab <devnull@localhost>2005-07-03 13:41:38 +0000
commit77bd3f4b79844adf564a9a7ab09c89e44ac8d929 (patch)
tree785ca57d1e003b51502ac5e385df46d7b0414ceb /linux/drivers/media/video/cx88/cx88-i2c.c
parentbaa52f41b316708d50ad39912800718637f7cef2 (diff)
downloadmediapointer-dvb-s2-77bd3f4b79844adf564a9a7ab09c89e44ac8d929.tar.gz
mediapointer-dvb-s2-77bd3f4b79844adf564a9a7ab09c89e44ac8d929.tar.bz2
* bttv-i2c.c, cx88-i2c.c, saa7134-i2c.c:
- I2C cleanups. Now, all drivers uses the same basic structure. * cx88-video.c: - Duplicated code commented. Should be removed soon. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'linux/drivers/media/video/cx88/cx88-i2c.c')
-rw-r--r--linux/drivers/media/video/cx88/cx88-i2c.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-i2c.c b/linux/drivers/media/video/cx88/cx88-i2c.c
index e88e9aaeb..7f1f4a6c5 100644
--- a/linux/drivers/media/video/cx88/cx88-i2c.c
+++ b/linux/drivers/media/video/cx88/cx88-i2c.c
@@ -1,5 +1,5 @@
/*
- $Id: cx88-i2c.c,v 1.26 2005/07/02 15:24:11 nsh Exp $
+ $Id: cx88-i2c.c,v 1.27 2005/07/03 13:41:38 mchehab Exp $
cx88-i2c.c -- all the i2c code is here
@@ -94,26 +94,29 @@ static int attach_inform(struct i2c_client *client)
struct tuner_addr tun_addr;
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) {
+ if ((core->radio_addr==ADDR_UNSET)||(core->radio_addr==client->addr)) {
+ tun_addr.state = T_RADIO;
+ tun_addr.type = core->radio_type;
+ tun_addr.addr = core->radio_addr;
- tun_addr.state = T_RADIO;
- tun_addr.type = core->radio_type;
- tun_addr.addr = core->radio_addr;
-
- client->driver->command(client,TUNER_SET_TYPE_ADDR, &tun_addr);
+ client->driver->command(client,TUNER_SET_TYPE_ADDR, &tun_addr);
+ }
}
if (core->tuner_type != UNSET) {
+ if ((core->tuner_addr==ADDR_UNSET)||(core->tuner_addr==client->addr)) {
- tun_addr.state = T_ANALOG_TV;
- tun_addr.type = core->tuner_type;
- tun_addr.addr = core->tuner_addr;
+ tun_addr.state = T_ANALOG_TV;
+ tun_addr.type = core->tuner_type;
+ tun_addr.addr = core->tuner_addr;
- client->driver->command(client,TUNER_SET_TYPE_ADDR, &tun_addr);
+ client->driver->command(client,TUNER_SET_TYPE_ADDR, &tun_addr);
+ }
}
if (core->tda9887_conf)